org.jupe.editors.classdiagram.graphics.connections
Class RelationFigure

java.lang.Object
  extended by org.eclipse.draw2d.Figure
      extended by org.eclipse.draw2d.Shape
          extended by org.eclipse.draw2d.Polyline
              extended by org.eclipse.draw2d.PolylineConnection
                  extended by org.jupe.editors.classdiagram.graphics.connections.AbstractConnectionFigure
                      extended by org.jupe.editors.classdiagram.graphics.connections.RelationFigure
All Implemented Interfaces:
org.eclipse.draw2d.AnchorListener, org.eclipse.draw2d.Connection, org.eclipse.draw2d.IFigure, IConnectionFigure

public class RelationFigure
extends AbstractConnectionFigure

A figure representing 3 types of uml2 elements : aggregation, association and composition. A connecting figure is created between two node figures of a class diagram. The connection is created using a PolylineConnection. The figure can own :

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.Connection
PROPERTY_CONNECTION_ROUTER, PROPERTY_POINTS
 
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
 
Constructor Summary
RelationFigure(boolean isDirected, java.lang.String type, java.lang.String startMultiplicity, java.lang.String endMultiplicity, java.lang.String startMultCaption, java.lang.String endMultCaption, java.lang.String caption, boolean hasQualifier)
          Constructor of a new RelationFigure.
RelationFigure(java.lang.String type)
          Simple constructor to create a directed association, aggregation or composition with any labels.
 
Method Summary
 void emptyFigure()
          Construct an empty figure : a connection line without any decoration.
 void setCaption(java.lang.String caption)
          Set the description of the RelationFigure.
 void setDirected(boolean directed)
          Set connection between node figures directed i.e. add an arrow
 void setEndMultiplicity(java.lang.String endMultiplicity)
          Set multiplicity at end point of connection.
 void setEndMultiplicityDescription(java.lang.String endMultiplicityDescription)
          Set description of multiplicity at end point of the connection.
 void setStartMultiplicity(java.lang.String startMultiplicity)
          Set multiplicity type at start point of the connection.
 void setStartMultiplicityDescription(java.lang.String startMultiplicityDescription)
          Set description of multiplicity at start point of the connection
 void setType(java.lang.String type)
          Sets the type of the connection : aggregation, association or composition The corresponding decoration (nothing or a rhombus) is set in a certain distance.
 
Methods inherited from class org.jupe.editors.classdiagram.graphics.connections.AbstractConnectionFigure
getEndFigure, getStartFigure, setEndFigure, setStartFigure
 
Methods inherited from class org.eclipse.draw2d.PolylineConnection
addNotify, addRoutingListener, anchorMoved, getBounds, getConnectionRouter, getRoutingConstraint, getSourceAnchor, getTargetAnchor, layout, removeNotify, removeRoutingListener, revalidate, setConnectionRouter, setRoutingConstraint, setSourceAnchor, setSourceDecoration, setTargetAnchor, setTargetDecoration
 
Methods inherited from class org.eclipse.draw2d.Polyline
addPoint, containsPoint, getEnd, getPoints, getStart, insertPoint, isOpaque, primTranslate, removeAllPoints, removePoint, setEnd, setEndpoints, setLineWidth, setPoint, setPoints, setStart
 
Methods inherited from class org.eclipse.draw2d.Shape
getLineStyle, getLineWidth, paintFigure, setFill, setFillXOR, setLineStyle, setOutline, setOutlineXOR, setXOR
 
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, 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, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, 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
 
Methods inherited from interface org.eclipse.draw2d.Connection
getPoints, setPoints
 
Methods inherited from interface org.eclipse.draw2d.IFigure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getChildren, getClientArea, getClientArea, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, 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, remove, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, setBackgroundColor, setBorder, setBounds, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
 

Constructor Detail

RelationFigure

public RelationFigure(java.lang.String type)
Simple constructor to create a directed association, aggregation or composition with any labels.

Parameters:
type - indicating type of RelationFigure : aggregation, association or composition
See Also:
IConstants

RelationFigure

public RelationFigure(boolean isDirected,
                      java.lang.String type,
                      java.lang.String startMultiplicity,
                      java.lang.String endMultiplicity,
                      java.lang.String startMultCaption,
                      java.lang.String endMultCaption,
                      java.lang.String caption,
                      boolean hasQualifier)
Constructor of a new RelationFigure. Creates a new PolylineConnetion, adds a decoration corresponding to the uml2-type to the connection

Parameters:
isDirected - indicates connection is directed. If so an arrow is added to its end point.
type - indicate the RelationFigureType : aggregation, association or composition
startMultiplicity - the multiplicity type at the start point of the connection. Must be uml2-conform. E.g. [0..1]
endMultiplicity - the multiplicity type at the end point of the connection. Must be uml2-conform. E.g. [0..1]
startMultCaption - the description of the multiplicity of the start point.
endMultCaption - the description of the multiplicity of the end point.
caption - the general description of the connection
hasQualifier - not used for the moment
Method Detail

setType

public void setType(java.lang.String type)
Sets the type of the connection : aggregation, association or composition The corresponding decoration (nothing or a rhombus) is set in a certain distance.

Parameters:
type - the type of RelationFigure : aggreagtion, association or composition (uml2)

setDirected

public void setDirected(boolean directed)
Set connection between node figures directed i.e. add an arrow

Parameters:
directed - Set if connection is directed or not.

setCaption

public void setCaption(java.lang.String caption)
Set the description of the RelationFigure. A Label is added in the middle of the connection. Attention: Should be called after all other set*() methods!

Parameters:
caption -

setEndMultiplicity

public void setEndMultiplicity(java.lang.String endMultiplicity)
Set multiplicity at end point of connection.

Parameters:
endMultiplicity - the multiplicity type to be set.

setStartMultiplicity

public void setStartMultiplicity(java.lang.String startMultiplicity)
Set multiplicity type at start point of the connection.

Parameters:
startMultiplicity - the type of multiplicity to be set.

setEndMultiplicityDescription

public void setEndMultiplicityDescription(java.lang.String endMultiplicityDescription)
Set description of multiplicity at end point of the connection.

Parameters:
endMultiplicityDescription - the description to be set.

setStartMultiplicityDescription

public void setStartMultiplicityDescription(java.lang.String startMultiplicityDescription)
Set description of multiplicity at start point of the connection

Parameters:
startMultiplicityDescription - the description to be set.

emptyFigure

public void emptyFigure()
Construct an empty figure : a connection line without any decoration.