org.tigris.gef.base
Class ModePlace

java.lang.Object
  extended by org.tigris.gef.base.ModeImpl
      extended by org.tigris.gef.base.FigModifyingModeImpl
          extended by org.tigris.gef.base.ModePlace
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.util.EventListener, FigModifyingMode, Mode

public class ModePlace
extends FigModifyingModeImpl

Mode to place new a FigNode on a node in a diagram. Normally invoked via CmdCreateNode.

See Also:
CmdCreateNode, FigNode, Serialized Form

Field Summary
protected  boolean _addRelatedEdges
           
protected  GraphFactory _factory
           
protected  java.lang.String _instructions
           
protected  java.lang.Object _node
          The (new) node being placed.
protected  FigNode _pers
          The (new) FigNode being placed.
 
Fields inherited from class org.tigris.gef.base.FigModifyingModeImpl
editor
 
Fields inherited from class org.tigris.gef.base.ModeImpl
_args
 
Constructor Summary
ModePlace(GraphFactory gf)
          Construct a new instance of ModePlace and store the given node.
ModePlace(GraphFactory gf, java.lang.String instructions)
           
 
Method Summary
 void done()
          When a Mode handles a certain event that indicates that the user wants to exit that Mode (e.g., a mouse up event after a drag in ModeCreateEdge) the Mode calls done to make switching to another Mode possible.
 java.awt.Cursor getInitialCursor()
          By default all creation modes use CROSSHAIR_CURSOR.
 java.lang.String instructions()
          A string to be shown in the status bar of the Editor when this mode is on top of the ModeManager.
 void keyPressed(java.awt.event.KeyEvent ke)
           
 void mouseDragged(java.awt.event.MouseEvent me)
           
 void mouseEntered(java.awt.event.MouseEvent me)
          Eat this event and do nothing
 void mouseExited(java.awt.event.MouseEvent me)
          Move the perpective along with the mouse.
 void mouseMoved(java.awt.event.MouseEvent me)
          Move the perpective along with the mouse.
 void mousePressed(java.awt.event.MouseEvent me)
          Move the perpective along with the mouse.
 void mouseReleased(java.awt.event.MouseEvent me)
          Actually add the Perpective to the diagram.
 void paint(java.awt.Graphics g)
          Paint the FigNode being dragged around.
 void setAddRelatedEdges(boolean b)
           
 
Methods inherited from class org.tigris.gef.base.FigModifyingModeImpl
getEditor, isFigEnclosedIn, print, setCursor, setEditor
 
Methods inherited from class org.tigris.gef.base.ModeImpl
canExit, getArg, getArgs, init, keyReleased, keyTyped, leave, mouseClicked, setArg, setArgs, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.tigris.gef.base.Mode
canExit, getArg, getArgs, init, setArg, setArgs, start
 

Field Detail

_node

protected java.lang.Object _node
The (new) node being placed. It might be an existing node that is adding a new FigNode.


_pers

protected FigNode _pers
The (new) FigNode being placed. It might be an existing FigNode on an existing node being placed in another diagram.


_factory

protected GraphFactory _factory

_addRelatedEdges

protected boolean _addRelatedEdges

_instructions

protected java.lang.String _instructions
Constructor Detail

ModePlace

public ModePlace(GraphFactory gf)
Construct a new instance of ModePlace and store the given node.


ModePlace

public ModePlace(GraphFactory gf,
                 java.lang.String instructions)
Method Detail

instructions

public java.lang.String instructions()
A string to be shown in the status bar of the Editor when this mode is on top of the ModeManager.

Specified by:
instructions in interface FigModifyingMode
Overrides:
instructions in class FigModifyingModeImpl

getInitialCursor

public java.awt.Cursor getInitialCursor()
By default all creation modes use CROSSHAIR_CURSOR.

Specified by:
getInitialCursor in interface FigModifyingMode
Overrides:
getInitialCursor in class FigModifyingModeImpl

setAddRelatedEdges

public void setAddRelatedEdges(boolean b)

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
Move the perpective along with the mouse.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class ModeImpl

mouseExited

public void mouseExited(java.awt.event.MouseEvent me)
Move the perpective along with the mouse.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class ModeImpl

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent me)
Move the perpective along with the mouse.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class ModeImpl

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent me)
Eat this event and do nothing

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Overrides:
mouseEntered in class ModeImpl

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent me)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class ModeImpl

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent me)
Actually add the Perpective to the diagram.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class ModeImpl

keyPressed

public void keyPressed(java.awt.event.KeyEvent ke)
Specified by:
keyPressed in interface java.awt.event.KeyListener
Overrides:
keyPressed in class ModeImpl

done

public void done()
Description copied from class: ModeImpl
When a Mode handles a certain event that indicates that the user wants to exit that Mode (e.g., a mouse up event after a drag in ModeCreateEdge) the Mode calls done to make switching to another Mode possible.

Specified by:
done in interface Mode
Overrides:
done in class FigModifyingModeImpl

paint

public void paint(java.awt.Graphics g)
Paint the FigNode being dragged around.

Specified by:
paint in interface FigModifyingMode
Overrides:
paint in class FigModifyingModeImpl