menu
Class Node

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--menu.menuComponent
                          |
                          +--menu.Node
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class Node
extends menuComponent

Node class represents a generic node of a menu. Each node has an image and a name. When the node is painted, the name is printed near the image. A node can represent, for example, a class of a UML class diagram, an actor of a UML use cases diagram, etc.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 java.awt.Dimension NODE_IMAGE_SIZE
           
 
Fields inherited from class menu.menuComponent
bounds
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Node()
          Constructor.
 
Method Summary
 void add(Node node)
          Adds a sub-node to this node.
 void computeBounds()
          Computes the bounds of the node.
 java.awt.Dimension getMinimumSize()
          Determines the minimum size of the node.
 java.lang.String getName()
          Gets the name of the node.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of the node.
 java.lang.String getType()
          Gets the type of the node (e.g.: class, actor, use_case etc.).
 java.lang.String getXmiId()
          Gets the ID of the node.
 java.lang.String getXmiUuid()
          Gets the UUID (Universally Unique IDentifier) of the node.
 boolean hasChildren()
          Determines if this node has sub-nodes.
 boolean isClosed()
          Gets the visibility status of this node.
 void mouseClicked(java.awt.event.MouseEvent e)
          Method from interface java.awt.event.MouseListener.
 void paint(java.awt.Graphics g)
           
 void setClosed(boolean closed)
          Sets the visibility status of this node.
 void setName(java.lang.String name)
          Sets the name of the node.
 void setType(java.lang.String type)
          Sets the type of the node (e.g.: class, actor, use_case etc.).
 void setXmi(XMI Xmi)
          Sets a reference to the object menu.XMI.
 void setXmiId(java.lang.String xmiId)
          Sets the ID of the node.
 void setXmiUuid(java.lang.String xmiUuid)
          Sets the UUID (Universally Unique IDentifier) of the node.
 void update(java.awt.Graphics g)
           
 
Methods inherited from class menu.menuComponent
mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE_IMAGE_SIZE

public final java.awt.Dimension NODE_IMAGE_SIZE
Constructor Detail

Node

public Node()
Constructor.

Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the node.

Overrides:
setName in class java.awt.Component

getName

public java.lang.String getName()
Gets the name of the node.

Overrides:
getName in class java.awt.Component
Returns:
name the name of the node.

setType

public void setType(java.lang.String type)
Sets the type of the node (e.g.: class, actor, use_case etc.).


getType

public java.lang.String getType()
Gets the type of the node (e.g.: class, actor, use_case etc.).

Returns:
type the type of the node.

setXmiId

public void setXmiId(java.lang.String xmiId)
Sets the ID of the node. The ID is taken from an XMI document (attribute xmi.id).


getXmiId

public java.lang.String getXmiId()
Gets the ID of the node. The ID is taken from an XMI document (attribute xmi.id).

Returns:
xmiId the ID of the node.

setXmiUuid

public void setXmiUuid(java.lang.String xmiUuid)
Sets the UUID (Universally Unique IDentifier) of the node. The UUID is taken from an XMI document (attribute xmi.uuid).


getXmiUuid

public java.lang.String getXmiUuid()
Gets the UUID (Universally Unique IDentifier) of the node. The UUID is taken from an XMI document (attribute xmi.uuid).

Returns:
xmiUuid the UUID of the node.

setXmi

public void setXmi(XMI Xmi)
Sets a reference to the object menu.XMI.


setClosed

public void setClosed(boolean closed)
Sets the visibility status of this node. If true, the corresponding switch is closed and the node is not visible.


isClosed

public boolean isClosed()
Gets the visibility status of this node. If true, the corresponding switch is closed and the node is not visible.

Returns:
closed the visibility status.

hasChildren

public boolean hasChildren()
Determines if this node has sub-nodes.

Returns:
hasChildren true if this node has sub-nodes.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of the node.

Overrides:
getPreferredSize in class java.awt.Container
Returns:
preferredSize the preferred size of the node.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Determines the minimum size of the node.

Overrides:
getMinimumSize in class java.awt.Container
Returns:
minimumSize the minimum size of the node.

add

public void add(Node node)
Adds a sub-node to this node.


update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Container

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

computeBounds

public void computeBounds()
Computes the bounds of the node.

Specified by:
computeBounds in class menuComponent

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Method from interface java.awt.event.MouseListener. This method manages mouse clicks. When a node is clicked the correnspondig component in the UML diagram is activated and is selected in the data dictionary. If the correnspondig component is a class or an interface of a UML class diagram, the code is selected in the code generator.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Specified by:
mouseClicked in class menuComponent