org.objectweb.jac.ide.diagrams
Class LinkFigure

java.lang.Object
  |
  +--CH.ifa.draw.standard.AbstractFigure
        |
        +--CH.ifa.draw.figures.PolyLineFigure
              |
              +--CH.ifa.draw.figures.LineConnection
                    |
                    +--org.objectweb.jac.ide.diagrams.LinkFigure
All Implemented Interfaces:
Cloneable, CH.ifa.draw.framework.ConnectionFigure, EventListener, CH.ifa.draw.framework.Figure, CH.ifa.draw.framework.FigureChangeListener, ModelElementFigure, ObjectUpdate, Serializable
Direct Known Subclasses:
InheritanceLinkFigure, PointcutLinkFigure, RelationLinkFigure

public class LinkFigure
extends CH.ifa.draw.figures.LineConnection
implements ObjectUpdate, ModelElementFigure

See Also:
Serialized Form

Field Summary
static int END_CARDINALITY
           
static int END_ROLE
           
static int NAME
           
static int START_CARDINALITY
           
static int START_ROLE
           
 
Fields inherited from class CH.ifa.draw.figures.LineConnection
myEndConnector, myStartConnector
 
Fields inherited from class CH.ifa.draw.figures.PolyLineFigure
ARROW_TIP_BOTH, ARROW_TIP_END, ARROW_TIP_NONE, ARROW_TIP_START, fEndDecoration, fFrameColor, fPoints, fStartDecoration
 
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
 
Constructor Summary
LinkFigure()
           
LinkFigure(LinkFigure figure)
           
 
Method Summary
 void addAttachedTextFigure(AttachedTextFigure f)
           
protected  void basicMoveBy(int dx, int dy)
           
 void close()
          Unregister from update events
 CH.ifa.draw.framework.Locator connectedTextLocator(CH.ifa.draw.framework.Figure f)
           
 AttachedTextFigure createAttachedFigure(int type)
           
 AttachedTextFigure createAttachedFigure(int type, String s)
           
 AttachedTextFigure createEndCardinality()
           
 AttachedTextFigure createEndCardinality(String s)
           
 AttachedTextFigure createEndRole()
           
 AttachedTextFigure createEndRole(String s)
           
 AttachedTextFigure createName()
           
 AttachedTextFigure createName(String s)
           
 AttachedTextFigure createStartCardinality()
           
 AttachedTextFigure createStartCardinality(String s)
           
 AttachedTextFigure createStartRole()
           
 AttachedTextFigure createStartRole(String s)
           
 void endPoint(Point p)
           
 ModelElement getSubstance()
          Get the value of substance.
 void handleConnect(CH.ifa.draw.framework.Figure start, ModelElementFigure end)
           
 void handleDisconnect(CH.ifa.draw.framework.Figure start, CH.ifa.draw.framework.Figure end)
           
 Vector handles()
           
 void insertPointAt(Point p, int i)
           
protected  void layout()
           
 void load(CH.ifa.draw.framework.Drawing drawing)
          Initialize associated text figures (cardinality, role name, ...)
 void objectUpdated(Object object, Object extra)
          The callback method.
 void release()
           
 void removePointAt(int i)
           
 void setFocus(FieldItem field, Object extraOption)
           
 void setLinkFigure(LinkFigure linkFig)
           
 void setPointAt(Point p, int i)
          Changes the coordinates of a point of the line connection
 void startPoint(Point p)
           
 void updateConnection()
          Updates the connection.
 
Methods inherited from class CH.ifa.draw.figures.LineConnection
canConnect, canConnect, connectEnd, connectsSame, connectStart, disconnectEnd, disconnectStart, endFigure, endPoint, endPoint, figureChanged, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate, getEndConnector, getStartConnector, handleConnect, layoutConnection, setEndConnector, setStartConnector, startFigure, startPoint, startPoint
 
Methods inherited from class CH.ifa.draw.figures.PolyLineFigure
addPoint, basicDisplayBox, connectorAt, containsPoint, displayBox, draw, drawLine, findSegment, getAttribute, getEndDecoration, getFrameColor, getStartDecoration, isEmpty, joinSegments, locator, pointAt, pointCount, points, setAttribute, setEndDecoration, setFrameColor, setStartDecoration, splitSegment
 
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, center, changed, clone, connectionInsets, connectorVisibility, decompose, displayBox, displayBox, figures, findFigureInside, getZValue, includes, invalidate, listener, moveBy, removeFigureChangeListener, removeFromContainer, setZValue, size, willChange
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface CH.ifa.draw.framework.Figure
addFigureChangeListener, addToContainer, basicDisplayBox, canConnect, center, changed, clone, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, displayBox, draw, figures, findFigureInside, getAttribute, getZValue, includes, invalidate, isEmpty, listener, moveBy, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange
 
Methods inherited from interface CH.ifa.draw.framework.ConnectionFigure
joinSegments, pointAt, pointCount, splitSegment
 

Field Detail

NAME

public static final int NAME
See Also:
Constant Field Values

START_CARDINALITY

public static final int START_CARDINALITY
See Also:
Constant Field Values

END_CARDINALITY

public static final int END_CARDINALITY
See Also:
Constant Field Values

START_ROLE

public static final int START_ROLE
See Also:
Constant Field Values

END_ROLE

public static final int END_ROLE
See Also:
Constant Field Values
Constructor Detail

LinkFigure

public LinkFigure(LinkFigure figure)

LinkFigure

public LinkFigure()
Method Detail

layout

protected void layout()

addAttachedTextFigure

public void addAttachedTextFigure(AttachedTextFigure f)

createAttachedFigure

public AttachedTextFigure createAttachedFigure(int type)

createAttachedFigure

public AttachedTextFigure createAttachedFigure(int type,
                                               String s)

createName

public AttachedTextFigure createName()

createEndRole

public AttachedTextFigure createEndRole()

createStartRole

public AttachedTextFigure createStartRole()

createStartCardinality

public AttachedTextFigure createStartCardinality()

createEndCardinality

public AttachedTextFigure createEndCardinality()

createName

public AttachedTextFigure createName(String s)

createEndRole

public AttachedTextFigure createEndRole(String s)

createStartRole

public AttachedTextFigure createStartRole(String s)

createStartCardinality

public AttachedTextFigure createStartCardinality(String s)

createEndCardinality

public AttachedTextFigure createEndCardinality(String s)

setFocus

public void setFocus(FieldItem field,
                     Object extraOption)

objectUpdated

public void objectUpdated(Object object,
                          Object extra)
Description copied from interface: ObjectUpdate
The callback method.

Specified by:
objectUpdated in interface ObjectUpdate
Parameters:
object - the updated object
extra - extra data
See Also:
ViewControlWrapper.registerObject(Wrappee,ObjectUpdate,Object)

insertPointAt

public void insertPointAt(Point p,
                          int i)
Overrides:
insertPointAt in class CH.ifa.draw.figures.LineConnection

removePointAt

public void removePointAt(int i)
Overrides:
removePointAt in class CH.ifa.draw.figures.LineConnection

close

public void close()
Description copied from interface: ModelElementFigure
Unregister from update events

Specified by:
close in interface ModelElementFigure

getSubstance

public ModelElement getSubstance()
Get the value of substance.

Specified by:
getSubstance in interface ModelElementFigure
Returns:
value of substance.

setLinkFigure

public void setLinkFigure(LinkFigure linkFig)

handleConnect

public void handleConnect(CH.ifa.draw.framework.Figure start,
                          ModelElementFigure end)

handleDisconnect

public void handleDisconnect(CH.ifa.draw.framework.Figure start,
                             CH.ifa.draw.framework.Figure end)
Overrides:
handleDisconnect in class CH.ifa.draw.figures.LineConnection

handles

public Vector handles()
Specified by:
handles in interface CH.ifa.draw.framework.Figure
Overrides:
handles in class CH.ifa.draw.figures.LineConnection

connectedTextLocator

public CH.ifa.draw.framework.Locator connectedTextLocator(CH.ifa.draw.framework.Figure f)
Specified by:
connectedTextLocator in interface CH.ifa.draw.framework.Figure
Overrides:
connectedTextLocator in class CH.ifa.draw.standard.AbstractFigure

basicMoveBy

protected void basicMoveBy(int dx,
                           int dy)
Overrides:
basicMoveBy in class CH.ifa.draw.figures.LineConnection

setPointAt

public void setPointAt(Point p,
                       int i)
Changes the coordinates of a point of the line connection

Specified by:
setPointAt in interface CH.ifa.draw.framework.ConnectionFigure
Overrides:
setPointAt in class CH.ifa.draw.figures.LineConnection
Parameters:
p - the new point
i - index of the point to modify

updateConnection

public void updateConnection()
Updates the connection.

Specified by:
updateConnection in interface CH.ifa.draw.framework.ConnectionFigure
Overrides:
updateConnection in class CH.ifa.draw.figures.LineConnection

load

public void load(CH.ifa.draw.framework.Drawing drawing)
Initialize associated text figures (cardinality, role name, ...)

Parameters:
drawing - a drawing to add the figures to

release

public void release()
Specified by:
release in interface CH.ifa.draw.framework.Figure
Overrides:
release in class CH.ifa.draw.figures.LineConnection

endPoint

public void endPoint(Point p)

startPoint

public void startPoint(Point p)