net.sf.sdedit.drawable
Class ExtensibleDrawable

java.lang.Object
  extended by net.sf.sdedit.drawable.Drawable
      extended by net.sf.sdedit.drawable.ExtensibleDrawable
All Implemented Interfaces:
Constants
Direct Known Subclasses:
Line, Rectangle

public abstract class ExtensibleDrawable
extends Drawable

An ExtensibleDrawable represents the state of a lifeline during a sequence. It is being extended - i. e. its height grows - as long as the state remains the same. If the state changes, the ExtensibleDrawable is closed and another instance is used for representing the state.

Author:
Markus Strauch

Field Summary
 
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
protected ExtensibleDrawable(int width, Lifeline lifeline)
          Creates a new ExtensibleDrawable with an initial height of 0.
 
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.
abstract  void drawPartially(Graphics2D g2d, int from, int to)
          Draws as much of this ExtensibleDrawable as lies between the specified vertical positions.
 void extend(int amount)
          Increases this ExtensibleDrawable's height by the specified amount.
 Lifeline getLifeline()
          Returns the lifeline of which the state is represented.
 boolean isVisible()
           
 
Methods inherited from class net.sf.sdedit.drawable.Drawable
contains, draw, drawMultilineString, getBottom, getHeight, getLeft, getRight, getTop, getWidth, intersects, 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

ExtensibleDrawable

protected ExtensibleDrawable(int width,
                             Lifeline lifeline)
Creates a new ExtensibleDrawable with an initial height of 0.

Parameters:
width - the drawable width
lifeline - the lifeline of which the state is represented by the ExtensibleDrawable
Method Detail

isVisible

public boolean isVisible()
Overrides:
isVisible in class Drawable
Returns:
the visible

getLifeline

public Lifeline getLifeline()
Returns the lifeline of which the state is represented.

Returns:
the lifeline of which the state is represented

extend

public final void extend(int amount)
Increases this ExtensibleDrawable's height by the specified amount.

Parameters:
amount - the amount of pixels by which the height is to be increased

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.

Specified by:
computeLayoutInformation in class Drawable
See Also:
Drawable.computeLayoutInformation()

drawPartially

public abstract void drawPartially(Graphics2D g2d,
                                   int from,
                                   int to)
Draws as much of this ExtensibleDrawable as lies between the specified vertical positions.

Parameters:
g2d - the graphics context to draw into
from - the vertical position where to start drawing, if it is -1, drawing is started at Drawable.getTop()
to - the vertical position where to end drawing, if it is -1, drawing ends at Drawable.getBottom()


Copyright © 2011. All Rights Reserved.