org.jupe.editors.classdiagram.graphics.nodes
Class ObjectFigure

java.lang.Object
  extended by org.eclipse.draw2d.Figure
      extended by org.jupe.editors.classdiagram.graphics.nodes.NodeFigure
          extended by org.jupe.editors.classdiagram.graphics.nodes.ObjectFigure
All Implemented Interfaces:
org.eclipse.draw2d.IFigure

public class ObjectFigure
extends NodeFigure

Figure that represents a uml2-object. On first place it contains a captionLabel indicating the name of the instance and the class it instantiates. Optionaly it can contain a subfigure for values of attributes.

Author:
Steffen Klüpfel, Michael Pradel

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator
 
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets
 
Field Summary
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
ObjectFigure(java.lang.String className, java.lang.String instanceName)
          Constructor of a new ObjectFigure
 
Method Summary
 void add(org.eclipse.draw2d.IFigure figure, java.lang.Object constraint, int index)
          Adds a new Figure with the given constraints to the ObjectFigure
 org.eclipse.draw2d.Label getCaptionLabel()
          Get the captionLabel of this ObjectFigure
 void remove(org.eclipse.draw2d.IFigure figure)
          Remove a subfigure from its parent.
 void setCaption(java.lang.String className, java.lang.String instanceName)
          Set caption of this ObjectFigure
 void setCaptionLabel(org.eclipse.draw2d.Label newCaptionLabel)
          Set the captionLabel of this ObjectFigure
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFigure

public ObjectFigure(java.lang.String className,
                    java.lang.String instanceName)
Constructor of a new ObjectFigure

Parameters:
className - the class that the object instanciates
instanceName - the instances name
Method Detail

add

public void add(org.eclipse.draw2d.IFigure figure,
                java.lang.Object constraint,
                int index)
Adds a new Figure with the given constraints to the ObjectFigure

Specified by:
add in interface org.eclipse.draw2d.IFigure
Overrides:
add in class org.eclipse.draw2d.Figure
Parameters:
figure - the figure to be added
constraint - the constraint used on the figure
index - index of insertion

remove

public void remove(org.eclipse.draw2d.IFigure figure)
Remove a subfigure from its parent. If subfigure is AttributeValueFigure remove-action is performed here. Otherwise the remove action is performed in AbstractNodeFigure.

Specified by:
remove in interface org.eclipse.draw2d.IFigure
Overrides:
remove in class org.eclipse.draw2d.Figure
Parameters:
figure - the figure to be removed

setCaption

public void setCaption(java.lang.String className,
                       java.lang.String instanceName)
Set caption of this ObjectFigure

Parameters:
className - name of the class this object instanciates
instanceName - instances name

getCaptionLabel

public org.eclipse.draw2d.Label getCaptionLabel()
Get the captionLabel of this ObjectFigure

Returns:
Returns the captionLabel.

setCaptionLabel

public void setCaptionLabel(org.eclipse.draw2d.Label newCaptionLabel)
Set the captionLabel of this ObjectFigure

Parameters:
newCaptionLabel - The caption to set.