net.sf.sdedit.drawable
Class LoopArrow

java.lang.Object
  extended by net.sf.sdedit.drawable.Drawable
      extended by net.sf.sdedit.drawable.SequenceElement
          extended by net.sf.sdedit.drawable.Arrow
              extended by net.sf.sdedit.drawable.LoopArrow
All Implemented Interfaces:
Constants

public class LoopArrow
extends Arrow


Field Summary
 
Fields inherited from class net.sf.sdedit.drawable.SequenceElement
configuration, diagram
 
Fields inherited from interface net.sf.sdedit.Constants
ACTIVE_LIFELINE_COLOR, ANTI_ALIAS, dashed, DEFAULT_CODE_FONT, DEFAULT_CURSOR, DEFAULT_ENCODING_SCHEME, dotted, emptyStroke, GLOBAL_CONF_FILE, HAND_CURSOR, MOVE_CURSOR, SAVE_AS_FILE_PROPERTY, SAVE_AS_TYPE_PROPERTY, solid, TEST_FREEHEP_CLASSNAME, thick, thick_dashed, THREAD_COLORS
 
Constructor Summary
LoopArrow(Message msg, ArrowStroke stroke, Direction align, int y)
          Creates a new LoopArrow.
 
Method Summary
 void computeLayoutInformation()
          This method is called when and if the left and top positions of the drawable components of a sequence diagram are fixed.
 void draw(Graphics2D g)
          Draws the sequence diagram element into the given Graphics2D context, using the rectangle starting at Drawable.getTop(), Drawable.getLeft(), sized Drawable.getHeight(), Drawable.getWidth().
 Point getAnchor()
          Returns the point in the middle of this arrow, the one that serves as an anchor when a connection to a Note is made.
 int getInnerHeight()
          Returns the sum of the height of the text and the space between the text and the arrow.
 Point[] getLinePoints()
          Returns an array of four points, representing the positions of the points that are connected by the lines of which the loop arrow is made up.
 Point getTextPosition()
          Returns the position of the left bottom of the label of the loop arrow.
 
Methods inherited from class net.sf.sdedit.drawable.Arrow
drawArrowHead, drawText, getInnerHeight, getMessage, getPoints, getSpace, getStroke, overrideColor, setSpace
 
Methods inherited from class net.sf.sdedit.drawable.SequenceElement
configuration, diagram, drawMultilineString, getAlign, getLeftEndpoint, getLeftLimit, getRightEndpoint, getRightLimit, leftPadding, rightPadding, setLeftEndpoint, setLeftLimit, setRightEndpoint, setRightLimit, textHeight, textWidth
 
Methods inherited from class net.sf.sdedit.drawable.Drawable
contains, drawMultilineString, getBottom, getHeight, getLeft, getRight, getTop, getWidth, intersects, isVisible, setBottom, setHeight, setLeft, setRight, setTop, setVisible, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoopArrow

public LoopArrow(Message msg,
                 ArrowStroke stroke,
                 Direction align,
                 int y)
Creates a new LoopArrow.

Parameters:
msg - a self-message or answer to self
stroke - the stroke to be used for drawing the arrow
align - Align.LEFT if the message is to be drawn on the left of a lifeline, otherwise Align.RIGHT
y - the vertical position where to start drawing
Method Detail

draw

public void draw(Graphics2D g)
Description copied from class: Drawable
Draws the sequence diagram element into the given Graphics2D context, using the rectangle starting at Drawable.getTop(), Drawable.getLeft(), sized Drawable.getHeight(), Drawable.getWidth().

Overrides:
draw in class Arrow
Parameters:
g - the Graphics2D context to draw this drawable sequence diagram element into
See Also:
Drawable.draw(java.awt.Graphics2D)

getInnerHeight

public int getInnerHeight()
Description copied from class: Arrow
Returns the sum of the height of the text and the space between the text and the arrow. In other words, this is the height minus the half height of the arrow head.

Overrides:
getInnerHeight in class Arrow
Returns:
the sum of the height of the text and the space between the text and the arrow

getLinePoints

public Point[] getLinePoints()
Returns an array of four points, representing the positions of the points that are connected by the lines of which the loop arrow is made up.

Returns:
an array of four points, representing the positions of the points that are connected by the lines of which the loop arrow is made up

getAnchor

public Point getAnchor()
Description copied from class: Arrow
Returns the point in the middle of this arrow, the one that serves as an anchor when a connection to a Note is made.

Overrides:
getAnchor in class Arrow
Returns:
the point in the middle of this arrow

getTextPosition

public Point getTextPosition()
Returns the position of the left bottom of the label of the loop arrow.

Overrides:
getTextPosition in class Arrow
Returns:
the position of the left bottom of the label of the loop arrow

computeLayoutInformation

public void computeLayoutInformation()
Description copied from class: Drawable
This method is called when and if the left and top positions of the drawable components of a sequence diagram are fixed. Its purpose is to use this information to compute even finer layout information, such as the width of the component.

Overrides:
computeLayoutInformation in class Arrow
See Also:
Drawable.computeLayoutInformation()


Copyright © 2011. All Rights Reserved.