GEF documentation

Overview

GEF package listing
GEFs Figures
Events in GEF
GEFvsJDK1.1 event mapping tables
EventQueuing in GEF
 

GEF package:

  • Action :
    • Action
    • ActionAdjustGrid 
    • AdjustGuide 
    • AdjustPageBreak 
    • Align 
    • CreateNode 
    • Delete 
    • Dispose 
    • EditNode 
    • Group 
    • InsertVertex 
    • Load 
    • Nudge 
    • Null 
    • OpenWindow 
    • Print 
    • Quit 
    • RemoveVertex 
    • Reorder 
    • Save 
    • Scroll 
    • SelectAll 
    • SelectInvert 
    • SelectNext 
    • Sequence 
    • SetAttr 
    • SetMode 
    • ShowURL 
    • Spawn 
    • Ungroup
  • Figures:
    • fig 
    • Circle 
    • Image 
    • Ink 
    • Line 
    • List 
    • Poly 
    • RRect 
    • Rect 
    • Text 
  • Layers: 
    • Layer 
    • Composite 
    • Diagram 
    • Grid 
    • PageBreaks 
    • Perspective 
    • Polar 
  • Modes: 
    • Mode 
    • Create 
    • CreateArc 
    • CreateFigCircle 
    • CreateFigImage 
    • CreateFigInk 
    • CreateFigLine
    • CreateFigPoly
    • CreateFigRRect
    • CreateFigRect
    • CreateFigText
    • ExampleKeys
    • Modify
    • Place
    • Select
    • Stack
  • Net:
    • NetArc
    • NetList
    • NetNode
    • NetPort
    • NetPrimitive
  • Palette:
    • Palette
    • Attr
    • Compound
    • Decorator
    • Fig
    • Sticky
    • Top
  • Selection:
    • Selection
    • Box
    • Handles
    • Multple
    • Single
     
     

    GEF in relevance to BeanAuthor

    Figures..


    Events:

    GEF Event handling

      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 EventHandling vs JDK1.1 events map table

     

    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
     

     Event Conversion Table

     
     

                      GEF 

                                                  JDK1.1            

     
    EVENT/METHOD
    GENERATED BY
    INTERFACE
    METHODS
    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 
    MOUSE_EXIT/mouseExit

    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)
     

     Event Queuing in GEF:

     

    It has the following methods..

    This Adds an event to the queue.

      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()
     

    Event Queuing in JDK1.1

        JDK1.1 has a EventQueue class to implement the Event queuing. It has the following methods:

    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)