The editor supports basic diagram editing
options as drawing lines, rectangles, circles, and text. The objects
can be selected, moved, deleted. The editor
offers a possibility to change the colors of the objects, as well as to
change the text font.
The real merit of the GEF is that it also
supports connected graph editing. Each node in the graph is a
composite object, which has several ports
which are the inputs or outputs of a node. New nodes can be
created graphicaly.
GEF package listing
GEFs Figures
Events in GEF
GEFvsJDK1.1 event
mapping tables
EventQueuing in
GEF
|
|
|
The EventHandler class in GEF.util extends
the Observable class of java.util under JDK1.0 it has methods like.
Prehandle event, transform it, dispatch
it to one of many event handler methods (e.g.,
mouseDown()), and posthandle
the event.Returns true if the event was
successfuly handled, false if the event
should be passed on to some other object
that might handle it.
public boolean handleEvent(Event origEvent) {}
Call one of the several event handling methods defined in JDK1.0.2. For example, mouseDown().
public boolean dispatchEvent(Event
e)
Event.MOUSE_ENTER:
Event.MOUSE_EXIT:
Event.MOUSE_MOVE:
Event.MOUSE_DOWN:
Event.MOUSE_DRAG:
Event.MOUSE_UP:
Event.KEY_PRESS:
Event.KEY_ACTION:
Method to do something special before
the event is handled.
public void preHandleEvent(Event e) { }
Method to do something special after the event is handled.
public void postHandleEvent(Event e) { }
Method to change the event before it is handled
public Event transformEvent(Event
e) { return e; }
public boolean mouseEnter(Event e, int x, int y) { return false; }
public boolean mouseExit(Event e, int x, int y) { return false; }
public boolean mouseUp(Event e, int x, int y) { return false; }
public boolean mouseDown(Event e, int x, int y) { return false; }
public boolean mouseDrag(Event e, int x, int y) { return false; }
public boolean mouseMove(Event e, int x, int y) { return false; }
public boolean keyUp(Event e, int key) { return false; }
public boolean keyDown(Event e, int key) { return false; }
public boolean handleMenuEvent(Event e) { return false; }
GEF EventHandle class constant |
jdk1.1 AWTEvent class constant |
MOUSE_ENTER | MouseEvent.MOUSE_ENTERED |
MOUSE_EXIT | MouseEvent.MOUSE_EXITED |
MOUSE_DOWN | MouseEvent.MOUSE_PRESSED |
MOUSE_DRAG | MouseEvent.MOUSE_DRAGGED |
MOUSE_UP | MouseEvent.MOUSE_RELEASED |
KEY_PRESS | MouseEvent.MOUSE_PRESSED |
KEY_ACTION | MouseEvent.MOUSE_TYPED |
GEF |
JDK1.1 |
|
|
|
|
MOUSE_DRAG/mouseDrag | graphedit.ForwardingPanel,
graphedit.ForwardingFrame, graphedit.ModeCreate, graphedit.ModeModify, graphedit.ModeSelect, graphedit.ModePlace, graphedit.SelectionSingle, graphedit.SelectionMultiple, ui.ColorTilePanel, util.EventHandler |
MouseMotionListener | mouseDragged(MouseEvent) |
MOUSE_MOVE/mouseMove | graphedit.ForwardingFrame, graphedit.ForwardingPanel, graphedit.ModePlace, util.EventHandler | MouseMotionListener | mouseMoved(MouseEvent) |
MOUSE_DOWN/mouseDown | graphedit.ModeCreate, graphedit.ForwardingPanel, graphedit.ForwardingFrame,
raphedit.ModeModify, graphedit.ModePlace, graphedit.ModeSelect , graphedit.SelectionMultiple, graphedit.SelectionSingle, graphedit.ForwardingFrame, util.EventHandler |
MouseListener | mousePressed(MouseEvent) |
MOUSE_UP/mouseUp | graphedit.ModeCreate, graphedit.ForwardingPanel, graphedit.ForwardingFrame,
raphedit.ModeModify, graphedit.ModePlace, graphedit.ModeSelect , graphedit.SelectionMultiple, graphedit.SelectionSingle, graphedit.ForwardingFrame, graphedit.NetNode, ui.ColorTilePanel, util.EventHandler |
MouseListener | mouseReleased(MouseEvent) |
MOUSE_ENTER/mouseEnter
|
graphedit.ForwardingPanel, graphedit.ModePlace,
graphedit.ForwardingFrame, graphedit.Perspective, util.EventHandler |
MouseListener | mouseEntered(MouseEvent)
mouseExited(MouseEvent) |
KEY_PRESS/keyDown
KEY_ACTION/keyDown |
Mode, graphedit.ArcPerzRectiline, graphedit.SelectionMultiple, util.EventHandler | KeyListener | keyPressed(KeyEvent) keyReleased(KeyEvent) keyTyped(KeyEvent) |
action | graphedit.PaletteTop, PaletteSticky, ActiiveComponent, ActiveChoice, ActiveList, ExecuteActionWindow, PrefsEditor, ui.PropSheetCategory, ui.ColorPickerGrid, util.Progress, | ActionListener,
ItemListener |
actionPerformed(ActionEvent) itemStateChanged(ItemEvent) |
handleEvent | graphedit.Editor, ForwardingFrame, ExecuteActionWindow, PrefsEditor, graphedit.ModeStack, ui.PropEditorColor, ui.PropEditorRect, ui.ColorPickerGrid, ui.TabPropFrame, util.Progress, util.IEventHandler, util.EventHandler | ActionListener
ComponentListener |
actionPerformed(ActionEvent)
componentHidden(ComponentEvent) componentMoved(ComponentEvent) componentResized(ComponentEvent) componentShown(ComponentEvent) |
handleMenuEvent | graphedit.Editor, graphedit.EditorMenus, graphedit.ForwardingFrame, util.EventHandler, util.IEventHandler | ActionListener | actionPerformed(ActionEvent) |
public void enqueue(Event obj)
This method takes the first event off the queue.
public Event dequeue()
This method os to see what is at the head
of the queue.
public Event peek()
Returns true if leading two events have the same event id.
public synchronized boolean nextIsSameAs(Event curEvent)
This gives the number of events in the queue.
public int size()
Method to check if the Queue is Empty.
public boolean
isEmpty()
Remove an event from the queue and return
it.
getNextEvent()
Return the first event without removing it.
peekEvent()
peekEvent(int)
Post a 1.1-style event to the EventQueue.
postEvent(AWTEvent)