TPTP 4.1.0 Platform Project
Public API Specification

org.eclipse.hyades.uml2sd.ui.core
Class BasicFrame

java.lang.Object
  extended byorg.eclipse.hyades.uml2sd.ui.core.GraphNode
      extended byorg.eclipse.hyades.uml2sd.ui.core.BasicFrame
Direct Known Subclasses:
Frame

public class BasicFrame
extends GraphNode

The Frame class is the base sequence diagram graph nodes container.
For instance, only one frame can be drawn in the View.
Lifelines, Messages and Stop which are supposed to represent a Sequence diagram are drawn in a Frame.
Only the graph node added to their representing list will be drawn. The lifelines are appended along the X axsis when added in a frame.
The syncMessages are ordered along the Y axsis depending on the event occurrence they are attached to.

See Also:
Lifeline for more event occurence details

Field Summary
protected  boolean computeMinMax
          Indicate if the min and max enlapsed time between two consecutive messages in the whole frame need to be computed
protected  int forceEventOccurrenceSpacing
           
protected  int horizontalIndex
          The index along the x axis where the next lifeline will is drawn This directly impact the Frame width
protected  boolean lastExternalTimePref
          Store the preference set by the user regarding the external time.
protected  double maxTime
          Contains the max enlapsed time between two consecutive messages in the whole frame
protected  double minTime
          Contains the min enlapsed time between two consecutive messages in the whole frame
protected  boolean timeInfo
           
protected  java.lang.String unitName
           
protected static ISDPreferences userPref
           
protected  int verticalIndex
          The greater event occurence created on graph nodes drawn in this Frame This directly impact the Frame height
 
Fields inherited from class org.eclipse.hyades.uml2sd.ui.core.GraphNode
bnodes, bSort, endEventOccurrence, fnodes, fSort, hasChilds, indexes, nodes, prefId, startEventOccurrence
 
Constructor Summary
BasicFrame()
          Creates an empty frame.
 
Method Summary
 void addNode(GraphNode nodeToAdd)
          Add a GraphNode into the frame
protected  java.util.List buildTimeArray()
           
protected  void computeMinMax()
          Browse all the GraphNode to compute the mim and max times store in the Frame
 boolean contains(int x, int y)
          Returns true if the graph node contains the point given in parameter, return false otherwise.
 void draw(IGC context)
          Draws the Frame on the given context.
This method start width GraphNodes ordering if neeeded.
After, depending on the visible area, only visible GraphNodes are drawn.
protected  void draw(IGC context, boolean drawFrame)
          Draws the Frame on the given context.
This method start width GraphNodes ordering if neeeded.
After, depending on the visible area, only visible GraphNodes are drawn.
protected  void drawFrame(IGC context)
          Draw the Frame rectangle
 void forceEventOccurrenceSpacing(int space)
           
 java.lang.String getArrayId()
          Return the node type for all class instances.
 int getHeight()
          The Frame height depends on the maximum number of messsages added to a lifeline( Taking all lifelines into account)
protected  int getHorizontalIndex()
          Returns the current horizontal index
protected  int getMaxEventOccurrence()
          Returns the greater event occurence known by the Frame
 double getMaxTime()
          Return the maximum time stored in the frame taking all GraphNodes into account
 double getMinTime()
          Return the minimum time stored in the frame taking all GraphNodes into account
protected  int getNewHorizontalIndex()
          This method increase the lifeline place holder The return value is usually assign to a lifeline.
protected  GraphNode getNodeFromListAt(int x, int y, java.util.List list, int fromIndex)
          Returns the graph node which contains the point given in parameter for the given graph node list and starting the iteration at the given index
WARNING: Only graph nodes with smaller coordinates than the current visible area can be returned.
 java.lang.String getTimeUnitName()
           
static ISDPreferences getUserPref()
           
 int getVisibleAreaHeight()
          Return the frame visible area height
 int getVisibleAreaWidth()
          Return the frame visible area width
 int getVisibleAreaX()
          Return the X coordinates of the frame visible area
 int getVisibleAreaY()
          Return the X coordinates of the frame visible area
 int getWidth()
          The frame width depends on the number of lifeline added in the frame
 int getX()
          Returns the x coordinate of the graph node
 int getY()
          Returns the y coordinate of the graph node
protected  void setMaxEventOccurrence(int eventOccurrence)
          Set the greater event occurrence created in GraphNodes included in the frame
 void setTimeUnitName(java.lang.String name)
           
static void setUserPref(ISDPreferences pref)
           
 
Methods inherited from class org.eclipse.hyades.uml2sd.ui.core.GraphNode
contains, drawChildsNodes, drawFocus, getBackComparator, getComparator, getEndOccurrence, getName, getNodeAt, getNodeList, getStartOccurrence, hasFocus, isSameAs, isSelected, isVisible, positiveDistanceToPoint, resetIndex, setFocused, setName, setSelected, updateIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxTime

protected double maxTime
Contains the max enlapsed time between two consecutive messages in the whole frame


minTime

protected double minTime
Contains the min enlapsed time between two consecutive messages in the whole frame


computeMinMax

protected boolean computeMinMax
Indicate if the min and max enlapsed time between two consecutive messages in the whole frame need to be computed


lastExternalTimePref

protected boolean lastExternalTimePref
Store the preference set by the user regarding the external time. This flag is used determine if the min and max need to be recomputed in case this preference is changed.


verticalIndex

protected int verticalIndex
The greater event occurence created on graph nodes drawn in this Frame This directly impact the Frame height


horizontalIndex

protected int horizontalIndex
The index along the x axis where the next lifeline will is drawn This directly impact the Frame width


timeInfo

protected boolean timeInfo

userPref

protected static ISDPreferences userPref

unitName

protected java.lang.String unitName

forceEventOccurrenceSpacing

protected int forceEventOccurrenceSpacing
Constructor Detail

BasicFrame

public BasicFrame()
Creates an empty frame.

Method Detail

getMaxEventOccurrence

protected int getMaxEventOccurrence()
Returns the greater event occurence known by the Frame

Returns:
the greater event occurrence

setMaxEventOccurrence

protected void setMaxEventOccurrence(int eventOccurrence)
Set the greater event occurrence created in GraphNodes included in the frame

Parameters:
eventOccurrence - the new greater event occurrence

getNewHorizontalIndex

protected int getNewHorizontalIndex()
This method increase the lifeline place holder The return value is usually assign to a lifeline. This can be used to set the lifelines drawing order. Also, calling this method two times and assigning only the last given index to a lifeline will increase this lifeline draw spacing (2 times the default spacing) from the last added lifeline.

Returns:
a new lifeline index

getHorizontalIndex

protected int getHorizontalIndex()
Returns the current horizontal index

Returns:
the current horizontal index
See Also:
for horizontal index description

addNode

public void addNode(GraphNode nodeToAdd)
Add a GraphNode into the frame

Overrides:
addNode in class GraphNode
Parameters:
nodeToAdd - the node to add

getX

public int getX()
Description copied from class: GraphNode
Returns the x coordinate of the graph node

Specified by:
getX in class GraphNode
Returns:
the frame x axis value in the containing view
See Also:
GraphNode.getX()

getY

public int getY()
Description copied from class: GraphNode
Returns the y coordinate of the graph node

Specified by:
getY in class GraphNode
Returns:
the frame y axis value in the containing view
See Also:
GraphNode.getX()

getWidth

public int getWidth()
The frame width depends on the number of lifeline added in the frame

Specified by:
getWidth in class GraphNode
Returns:
the frame width
See Also:
GraphNode.getWidth()

getHeight

public int getHeight()
The Frame height depends on the maximum number of messsages added to a lifeline( Taking all lifelines into account)

Specified by:
getHeight in class GraphNode
Returns:
the frame height
See Also:
GraphNode.getHeight()

getNodeFromListAt

protected GraphNode getNodeFromListAt(int x,
                                      int y,
                                      java.util.List list,
                                      int fromIndex)
Returns the graph node which contains the point given in parameter for the given graph node list and starting the iteration at the given index
WARNING: Only graph nodes with smaller coordinates than the current visible area can be returned.

Overrides:
getNodeFromListAt in class GraphNode
Parameters:
x - the x coordinate of the point to test
y - the y coordinate of the point to test
list - the list to search in
fromIndex - list browsing starting point
Returns:
the graph node containing the point given in parameter, null otherwise

drawFrame

protected void drawFrame(IGC context)
Draw the Frame rectangle

Parameters:
context - the context to draw to

draw

public void draw(IGC context)
Draws the Frame on the given context.
This method start width GraphNodes ordering if neeeded.
After, depending on the visible area, only visible GraphNodes are drawn.

Specified by:
draw in class GraphNode
Parameters:
context - the context to draw to
See Also:
GraphNode.draw(IGC)

draw

protected void draw(IGC context,
                    boolean drawFrame)
Draws the Frame on the given context.
This method start width GraphNodes ordering if neeeded.
After, depending on the visible area, only visible GraphNodes are drawn.

Parameters:
context - the context to draw to
drawFrame - indicate if the frame rectangle need to be redrawn
See Also:
GraphNode.draw(IGC)

setUserPref

public static void setUserPref(ISDPreferences pref)

getUserPref

public static ISDPreferences getUserPref()

setTimeUnitName

public void setTimeUnitName(java.lang.String name)

getTimeUnitName

public java.lang.String getTimeUnitName()

forceEventOccurrenceSpacing

public void forceEventOccurrenceSpacing(int space)

getVisibleAreaX

public int getVisibleAreaX()
Return the X coordinates of the frame visible area

Returns:
the X coordinates of the frame visible area

getVisibleAreaWidth

public int getVisibleAreaWidth()
Return the frame visible area width

Returns:
the frame visible area width

getVisibleAreaHeight

public int getVisibleAreaHeight()
Return the frame visible area height

Returns:
the frame visible area height

getVisibleAreaY

public int getVisibleAreaY()
Return the X coordinates of the frame visible area

Returns:
the X coordinates of the frame visible area

getMinTime

public double getMinTime()
Return the minimum time stored in the frame taking all GraphNodes into account

Returns:
the minimum GraphNode time

getMaxTime

public double getMaxTime()
Return the maximum time stored in the frame taking all GraphNodes into account

Returns:
the maximum GraphNode time

computeMinMax

protected void computeMinMax()
Browse all the GraphNode to compute the mim and max times store in the Frame


buildTimeArray

protected java.util.List buildTimeArray()

getArrayId

public java.lang.String getArrayId()
Description copied from class: GraphNode
Return the node type for all class instances. This id is used to store the same nodes kind in the same ordered array.

Specified by:
getArrayId in class GraphNode
Returns:
the node type identifier

contains

public boolean contains(int x,
                        int y)
Description copied from class: GraphNode
Returns true if the graph node contains the point given in parameter, return false otherwise.

Specified by:
contains in class GraphNode
Parameters:
x - the x coordinate of the point to test containment
y the y coordinate of the point to test containment
Returns:
true if contained, false otherwise

TPTP 4.1.0 Platform Project
Public API Specification