org.tigris.gef.demo
Class SampleNode

java.lang.Object
  extended by org.tigris.gef.graph.presentation.NetPrimitive
      extended by org.tigris.gef.graph.presentation.NetNode
          extended by org.tigris.gef.demo.SampleNode
All Implemented Interfaces:
java.io.Serializable, GraphNodeHooks
Direct Known Subclasses:
SampleNode2, SampleNode4

public class SampleNode
extends NetNode
implements java.io.Serializable

An example subclass of NetNode for use in the BasicApplication application.

See Also:
Serialized Form

Field Summary
protected  int _number
           
 SamplePort east
           
 SamplePort north
           
 SamplePort south
           
 SamplePort west
           
 
Fields inherited from class org.tigris.gef.graph.presentation.NetPrimitive
_changeSup, _highlight
 
Constructor Summary
SampleNode()
           
 
Method Summary
 java.lang.String getId()
           
 int getNumber()
           
 void initialize(java.util.Hashtable args)
          Initialize a new SampleNode from the given default node and application specific model.
 void keyPressed(java.awt.event.KeyEvent e)
          Sample event handler: prints a message to the console.
 void keyReleased(java.awt.event.KeyEvent e)
          Sample event handler: prints a message to the console.
 void keyTyped(java.awt.event.KeyEvent e)
          Sample event handler: prints a message to the console.
 FigNode makePresentation(Layer lay)
          Construct and return a new FigNode to present this NetNode in the given Layer.
 void mouseClicked(java.awt.event.MouseEvent e)
          Sample event handler: prints a message to the console.
 void mouseDragged(java.awt.event.MouseEvent e)
          Sample event handler: prints a message to the console.
 void mouseEntered(java.awt.event.MouseEvent e)
          Sample event handler: prints a message to the console.
 void mouseExited(java.awt.event.MouseEvent e)
          Sample event handler: prints a message to the console.
 void mouseMoved(java.awt.event.MouseEvent e)
          Sample event handler: prints a message to the console.
 void mousePressed(java.awt.event.MouseEvent e)
          Sample event handler: prints a message to the console.
 void mouseReleased(java.awt.event.MouseEvent e)
          Sample event handler: prints a message to the console.
 
Methods inherited from class org.tigris.gef.graph.presentation.NetNode
addPort, canConnectTo, deleteFromModel, getAttributes, getPort, getPorts, postConnect, postDisconnect, postPlacement, presentationFor, setPorts
 
Methods inherited from class org.tigris.gef.graph.presentation.NetPrimitive
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getHighlight, removePropertyChangeListener, setHighlight
 
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.graph.GraphNodeHooks
addPropertyChangeListener, removePropertyChangeListener, setHighlight
 

Field Detail

north

public SamplePort north

east

public SamplePort east

west

public SamplePort west

south

public SamplePort south

_number

protected int _number
Constructor Detail

SampleNode

public SampleNode()
Method Detail

initialize

public void initialize(java.util.Hashtable args)
Initialize a new SampleNode from the given default node and application specific model.

Needs-More-Work: for now we construct the FigNode programatically, but eventually we will store it in a class variable and just refer to it, or copy it(?). That way the user can edit the FigNode(s) stored in the class variable and have those changes shown for all existing nodes, or for all future nodes. Maybe I should think about doing virtual copies?

Specified by:
initialize in interface GraphNodeHooks
Specified by:
initialize in class NetNode

getNumber

public int getNumber()

getId

public java.lang.String getId()
Specified by:
getId in class NetPrimitive

makePresentation

public FigNode makePresentation(Layer lay)
Description copied from class: NetNode
Construct and return a new FigNode to present this NetNode in the given Layer. A default implementation is supplied as an example, but all subclasses should override this method. NetPorts of this NetNode should be associated with individual Figs that make up the FigNode.

Specified by:
makePresentation in class NetNode

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Sample event handler: prints a message to the console.


mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Sample event handler: prints a message to the console.


mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Sample event handler: prints a message to the console.


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Sample event handler: prints a message to the console.


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Sample event handler: prints a message to the console.


mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Sample event handler: prints a message to the console.


mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Sample event handler: prints a message to the console.


keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Sample event handler: prints a message to the console.


keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Sample event handler: prints a message to the console.


keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Sample event handler: prints a message to the console.