jfig.commands
Interface FigBasicEditor

All Superinterfaces:
java.awt.event.ActionListener, java.util.EventListener
All Known Implementing Classes:
JExportOptionsAdapter, JModularEditor, ModularEditor, Viewer

public interface FigBasicEditor
extends java.awt.event.ActionListener

what a jfig graphics editor has to do.

Interface FigBasicEditor collects all methods necessary to interface a basic graphics/diagram editor with the jfig editing commands and objects.

Basically, jfig consists of four main parts. First, all graphical objects are realized as individual objects, that implement the jfig.objects.FigObject interface. Second, the objects are displayed on a special canvas, realized as a subclass of jfig.canvas.FigCanvas. The canvas supports zooming and panning, rulers, rubberbanding, a grid, and all required repaint algorithms. One of the repaint modes allow to draw one or a few 'tmp objects' over a static background buffer of the fixed 'standard' objects.

Third, the objects and all editing are managed by an editor, which must implement the FigBasicEditor (i.e., this) interface. We assume that the editor implements some kind of object list to keep track of the currently active graphics objects. Member functions of this interface allow to query the object list, to insert objects into it, to delete them, etc. This interface also provides functions to specify the current tmp object (needed for better display performance).

Fourth, we assume that all editing functionality is provided by small command objects, e.g. CopyObjectCommand etc. These command objects are also responsible for undo/redo capability.

See Also:
Command, UndoStack, FigCanvas

Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 void addTmpObject(FigObject obj)
           
 void call(java.lang.String functionKey, java.lang.Object arg)
           
 void deleteFromObjectList(FigObject object)
           
 void deleteTmpObject(FigObject obj)
           
 void doRedraw()
           
 FigObject[] findAllObjectsAt(java.awt.Point P)
           
 FigObject findNextObjectAt(java.awt.Point P, FigObject previous)
           
 FigObject findObjectAt(java.awt.Point P)
           
 FigAttribs getCurrentAttribs()
          getCurrentAttribs: return a reference to the current editor global object attributes.
 Command getCurrentCommand()
           
 java.lang.String getFilename()
          allow to query the current filename (if any)
 FigCanvas getObjectCanvas()
          getObjectCanvas: return a reference to the FigCanvas responsible for displaying the grahics objects.
 java.util.Enumeration getObjects()
           
 FigObject[] getTmpObjects()
           
 UndoStack getUndoStack()
           
 void hideAllObjectCorners()
           
 void insertIntoObjectList(FigObject object)
           
 boolean isInObjectList(FigObject object)
           
 void message(java.lang.String msg)
           
 void setCurrentAttribs(FigAttribs newAttribs)
           
 void showAllObjectCorners()
           
 void showObjectCorners(FigObject obj)
           
 void statusMessage(java.lang.String msg)
           
 

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getUndoStack

public UndoStack getUndoStack()

getCurrentCommand

public Command getCurrentCommand()

getObjectCanvas

public FigCanvas getObjectCanvas()
getObjectCanvas: return a reference to the FigCanvas responsible for displaying the grahics objects.


getCurrentAttribs

public FigAttribs getCurrentAttribs()
getCurrentAttribs: return a reference to the current editor global object attributes. Like many graphical editors, jfig maintains a single global attribute object to use for all new objects.


setCurrentAttribs

public void setCurrentAttribs(FigAttribs newAttribs)

insertIntoObjectList

public void insertIntoObjectList(FigObject object)

deleteFromObjectList

public void deleteFromObjectList(FigObject object)

isInObjectList

public boolean isInObjectList(FigObject object)

getObjects

public java.util.Enumeration getObjects()

findObjectAt

public FigObject findObjectAt(java.awt.Point P)

findNextObjectAt

public FigObject findNextObjectAt(java.awt.Point P,
                                  FigObject previous)

findAllObjectsAt

public FigObject[] findAllObjectsAt(java.awt.Point P)

addTmpObject

public void addTmpObject(FigObject obj)

deleteTmpObject

public void deleteTmpObject(FigObject obj)

getTmpObjects

public FigObject[] getTmpObjects()

hideAllObjectCorners

public void hideAllObjectCorners()

showAllObjectCorners

public void showAllObjectCorners()

showObjectCorners

public void showObjectCorners(FigObject obj)

doRedraw

public void doRedraw()

statusMessage

public void statusMessage(java.lang.String msg)

message

public void message(java.lang.String msg)

call

public void call(java.lang.String functionKey,
                 java.lang.Object arg)

getFilename

public java.lang.String getFilename()
allow to query the current filename (if any)