TPTP 4.4.0 Platform Project
Public API Specification

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

java.lang.Object
  extended byorg.eclipse.hyades.uml2sd.ui.core.GraphNode
      extended byorg.eclipse.hyades.uml2sd.ui.core.BasicFrame
          extended byorg.eclipse.hyades.uml2sd.ui.core.Frame

public class Frame
extends BasicFrame

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  java.util.List executionOccurrencesWithTime
           
protected  IColor highlightColor
           
protected  Lifeline highlightLifeline
           
protected  LifelineCategories[] lifelineCategories
           
protected  int nbEvent
           
protected  int startEvent
           
 
Fields inherited from class org.eclipse.hyades.uml2sd.ui.core.BasicFrame
computeMinMax, forceEventOccurrenceSpacing, horizontalIndex, lastExternalTimePref, maxTime, minTime, timeInfo, unitName, userPref, verticalIndex
 
Fields inherited from class org.eclipse.hyades.uml2sd.ui.core.GraphNode
bnodes, bSort, endEventOccurrence, fnodes, fSort, hasChilds, indexes, nodes, prefId, startEventOccurrence
 
Constructor Summary
Frame()
           
 
Method Summary
 void addLifeLine(Lifeline lifeLine)
          Adds a lifeline to the frame lifelines list.
 void addMessage(BaseMessage message)
          Adds a message to the Frame message list.
 int asyncMessageCount()
          Returns the number of asyncMessage stored in the frame
 int asyncMessageReturnCount()
          Returns the number of asyncMessageReturn stored in 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
 void draw(IGC context)
          Draws the Frame on the given context.
 boolean findDateBounds(double dateToFind, ITimeRange[] bounds)
          Find the two graph nodes that are closest to this date, one just earlier, second just later.
 AsyncMessage getAsyncMessage(int index)
          Returns the asyncMessage at the given index in the asyncMessage array
 AsyncMessageReturn getAsyncMessageReturn(int index)
          Returns the asyncMessageReturn at the given index in the asyncMessageReturn array
protected  java.util.List getAsyncMessages()
          Returns a list of asyncMessages known by this frame.
protected  java.util.List getAsyncMessagesReturn()
          Returns a list of asyncMessageRetun known by this frame.
 GraphNode getCalledMessage(BaseMessage StartMessage)
           
 GraphNode getCallerMessage(BaseMessage StartMessage)
           
protected  GraphNode getCloserEnteringMessage(Lifeline lifeline, BaseMessage message, java.util.List list, boolean smallerEvent)
           
protected  GraphNode getCloserLeavingMessage(Lifeline lifeline, BaseMessage message, java.util.List list, boolean smallerEvent)
           
 Lifeline getCloserLifeline(int x)
           
 java.util.List getExecutionOccurrencesWithTime()
           
 BasicExecutionOccurrence getFirstExecution(Lifeline lifeline)
           
 int getFirstVisibleAsyncMessage()
          Returns the first visible synchronous message drawn in the view
 int getFirstVisibleAsyncMessageReturn()
          Returns the first visible synchronous message return drawn in the view
 int getFirstVisibleLifeline()
          Returns the first visible lifeline drawn in the view
 int getFirstVisibleSyncMessage()
          Returns the first visible synchronous message drawn in the view
 int getFirstVisibleSyncMessageReturn()
          Returns the first visible synchronous message return drawn in the view
 BasicExecutionOccurrence getLastExecOccurrence(Lifeline lifeline)
           
 Lifeline getLifeline(int index)
          Returns the lifeline at the given index in the lifelines array
 LifelineCategories[] getLifelineCategories()
          Returns the lifeline categories array set for the this frame
protected  java.util.List getLifelines()
          Returns a list of all lifelines known by this frame.
 BasicExecutionOccurrence getNextExecOccurrence(BasicExecutionOccurrence exec)
           
 GraphNode getNextLifelineMessage(Lifeline lifeline, BaseMessage StartMessage)
           
 BasicExecutionOccurrence getPrevExecOccurrence(BasicExecutionOccurrence exec)
           
 GraphNode getPrevLifelineMessage(Lifeline lifeline, BaseMessage StartMessage)
           
 SyncMessage getSyncMessage(int index)
          Returns the syncMessage at the given index in the syncMessages array
 SyncMessageReturn getSyncMessageReturn(int index)
          Returns the syncMessageReturn at the given index in the syncMessageReturn array
protected  java.util.List getSyncMessages()
          Returns a list of syncMessages known by this frame.
 java.lang.Object[] getSyncMessagesArray()
          Deprecated.  
protected  java.util.List getSyncMessagesReturn()
          Returns a list of syncMessages return known by this frame.
 java.lang.Object[] getSyncMessagesReturnArray()
          Deprecated.  
 boolean hasTimeInfo()
           
 void highlightTimeCompression(Lifeline lifeline, int startEvent, int nbEvent, IColor color)
           
 void insertLifelineAfter(Lifeline toInsert, Lifeline after)
           
 void insertLifelineBefore(Lifeline toInsert, Lifeline before)
           
 int lifeLinesCount()
          Returns the number of lifelines stored in the frame
 void reorder(java.util.ArrayList list)
           
 void resetTimeCompression()
           
protected  void setHasTimeInfo(boolean value)
           
 void setLifelineCategories(LifelineCategories[] categories)
          Set the lifeline categories which will be use during the lifelines creation
 int syncMessageCount()
          Returns the number of syncMessages stored in the frame
 int syncMessageReturnCount()
          Returns the number of syncMessageReturn stored in the frame
 
Methods inherited from class org.eclipse.hyades.uml2sd.ui.core.BasicFrame
addNode, computeMaxMinTime, contains, draw, drawFrame, forceEventOccurrenceSpacing, getArrayId, getHeight, getHorizontalIndex, getMaxEventOccurrence, getMaxTime, getMinTime, getNewHorizontalIndex, getNodeFromListAt, getSDMaxTime, getSDMinTime, getTimeUnitName, getUserPref, getVisibleAreaHeight, getVisibleAreaWidth, getVisibleAreaX, getVisibleAreaY, getWidth, getX, getY, resetCustomMinMax, setMax, setMaxEventOccurrence, setMin, setTimeUnitName, setUserPref
 
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

highlightLifeline

protected Lifeline highlightLifeline

startEvent

protected int startEvent

nbEvent

protected int nbEvent

highlightColor

protected IColor highlightColor

executionOccurrencesWithTime

protected java.util.List executionOccurrencesWithTime

lifelineCategories

protected LifelineCategories[] lifelineCategories
Constructor Detail

Frame

public Frame()
Method Detail

getLifelines

protected java.util.List getLifelines()
Returns a list of all lifelines known by this frame. Known lifelines are the only one which can be displayed on screen.

Returns:
the lifelines list

lifeLinesCount

public int lifeLinesCount()
Returns the number of lifelines stored in the frame

Returns:
the number of lifelines

getLifeline

public Lifeline getLifeline(int index)
Returns the lifeline at the given index in the lifelines array

Parameters:
index - the position in the lifeline array
Returns:
the lifeline

getSyncMessages

protected java.util.List getSyncMessages()
Returns a list of syncMessages known by this frame. Known syncMessages are the only on which can be displayed on screen

Returns:
the syncMessages list

getSyncMessagesArray

public java.lang.Object[] getSyncMessagesArray()
Deprecated.  

Returns an array of all sync messages known by this frame. This table can be manipulated by the caller, the order is kept.

Returns:
the sync messages array

syncMessageCount

public int syncMessageCount()
Returns the number of syncMessages stored in the frame

Returns:
the number of syncMessage

getSyncMessage

public SyncMessage getSyncMessage(int index)
Returns the syncMessage at the given index in the syncMessages array

Parameters:
index - the position in the syncMessages array
Returns:
the syncMessage

getAsyncMessages

protected java.util.List getAsyncMessages()
Returns a list of asyncMessages known by this frame. Known asyncMessages are the only on which can be displayed on screen

Returns:
the asyncMessages list

asyncMessageCount

public int asyncMessageCount()
Returns the number of asyncMessage stored in the frame

Returns:
the number of asyncMessage

getAsyncMessage

public AsyncMessage getAsyncMessage(int index)
Returns the asyncMessage at the given index in the asyncMessage array

Parameters:
index - the position in the asyncMessage array
Returns:
the asyncMessage

getSyncMessagesReturn

protected java.util.List getSyncMessagesReturn()
Returns a list of syncMessages return known by this frame. Known syncMessages return are the only on which can be displayed on screen

Returns:
the syncMessages return list

getSyncMessagesReturnArray

public java.lang.Object[] getSyncMessagesReturnArray()
Deprecated.  

Returns an array of all sync messages return known by this frame. This table can be manipulated by the caller, the order is kept.

Returns:
the sync messages return array

syncMessageReturnCount

public int syncMessageReturnCount()
Returns the number of syncMessageReturn stored in the frame

Returns:
the number of syncMessageReturn

getSyncMessageReturn

public SyncMessageReturn getSyncMessageReturn(int index)
Returns the syncMessageReturn at the given index in the syncMessageReturn array

Parameters:
index - the position in the syncMessageReturn array
Returns:
the syncMessageReturn

getAsyncMessagesReturn

protected java.util.List getAsyncMessagesReturn()
Returns a list of asyncMessageRetun known by this frame. Known asyncMessageRetun are the only on which can be displayed on screen

Returns:
the asyncMessageRetun list

asyncMessageReturnCount

public int asyncMessageReturnCount()
Returns the number of asyncMessageReturn stored in the frame

Returns:
the number of asyncMessageReturn

getAsyncMessageReturn

public AsyncMessageReturn getAsyncMessageReturn(int index)
Returns the asyncMessageReturn at the given index in the asyncMessageReturn array

Parameters:
index - the position in the asyncMessageReturn array
Returns:
the asyncMessageReturn

addLifeLine

public void addLifeLine(Lifeline lifeLine)
Adds a lifeline to the frame lifelines list. The lifeline X drawing order depends on the lifeline addition order into the frame lifelines list.


getFirstVisibleLifeline

public int getFirstVisibleLifeline()
Returns the first visible lifeline drawn in the view

Returns:
the first visible lifeline index

getFirstVisibleSyncMessage

public int getFirstVisibleSyncMessage()
Returns the first visible synchronous message drawn in the view

Returns:
the first visible synchronous message index

getFirstVisibleSyncMessageReturn

public int getFirstVisibleSyncMessageReturn()
Returns the first visible synchronous message return drawn in the view

Returns:
the first visible synchronous message return index

getFirstVisibleAsyncMessage

public int getFirstVisibleAsyncMessage()
Returns the first visible synchronous message drawn in the view

Returns:
the first visible synchronous message index

getFirstVisibleAsyncMessageReturn

public int getFirstVisibleAsyncMessageReturn()
Returns the first visible synchronous message return drawn in the view

Returns:
the first visible synchronous message return index

getExecutionOccurrencesWithTime

public java.util.List getExecutionOccurrencesWithTime()

insertLifelineAfter

public void insertLifelineAfter(Lifeline toInsert,
                                Lifeline after)

insertLifelineBefore

public void insertLifelineBefore(Lifeline toInsert,
                                 Lifeline before)

getCloserLifeline

public Lifeline getCloserLifeline(int x)

reorder

public void reorder(java.util.ArrayList list)

resetTimeCompression

public void resetTimeCompression()

computeMinMax

protected void computeMinMax()
Description copied from class: BasicFrame
Browse all the GraphNode to compute the mim and max times store in the Frame

Overrides:
computeMinMax in class BasicFrame

findDateBounds

public boolean findDateBounds(double dateToFind,
                              ITimeRange[] bounds)
Find the two graph nodes that are closest to this date, one just earlier, second just later. If date is before any graph node, bounds[0] is null and bounds[1] is the earliest. If date is after any graph node, bounds[1] is null and bounds[0] is the latest.

Parameters:
dateToFind - date to be found
bounds - a two items array that will receive bounds if found
Returns:
true if both bounds not null

setHasTimeInfo

protected void setHasTimeInfo(boolean value)

hasTimeInfo

public boolean hasTimeInfo()

highlightTimeCompression

public void highlightTimeCompression(Lifeline lifeline,
                                     int startEvent,
                                     int nbEvent,
                                     IColor color)

setLifelineCategories

public void setLifelineCategories(LifelineCategories[] categories)
Set the lifeline categories which will be use during the lifelines creation

Parameters:
categories - the lifeline categories array
See Also:
Lifeline.setCategory(int)

getLifelineCategories

public LifelineCategories[] getLifelineCategories()
Returns the lifeline categories array set for the this frame

Returns:
the lifeline categories array or null if not set

addMessage

public void addMessage(BaseMessage message)
Adds a message to the Frame message list. Four kinds of syncMessages can be added:
- synchronous syncMessages
- synchronous syncMessages return
- asynchonous syncMessages
- asynchronous syncMessages return
For drawing performance reason, it is recommanded to add synchronous syncMessages in the same order they should appear along the Y axis in the Frame.


draw

public void draw(IGC context)
Description copied from class: BasicFrame
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.

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

buildTimeArray

protected java.util.List buildTimeArray()
Overrides:
buildTimeArray in class BasicFrame

getCloserLeavingMessage

protected GraphNode getCloserLeavingMessage(Lifeline lifeline,
                                            BaseMessage message,
                                            java.util.List list,
                                            boolean smallerEvent)

getCloserEnteringMessage

protected GraphNode getCloserEnteringMessage(Lifeline lifeline,
                                             BaseMessage message,
                                             java.util.List list,
                                             boolean smallerEvent)

getCalledMessage

public GraphNode getCalledMessage(BaseMessage StartMessage)

getCallerMessage

public GraphNode getCallerMessage(BaseMessage StartMessage)

getNextLifelineMessage

public GraphNode getNextLifelineMessage(Lifeline lifeline,
                                        BaseMessage StartMessage)

getFirstExecution

public BasicExecutionOccurrence getFirstExecution(Lifeline lifeline)

getPrevExecOccurrence

public BasicExecutionOccurrence getPrevExecOccurrence(BasicExecutionOccurrence exec)

getNextExecOccurrence

public BasicExecutionOccurrence getNextExecOccurrence(BasicExecutionOccurrence exec)

getLastExecOccurrence

public BasicExecutionOccurrence getLastExecOccurrence(Lifeline lifeline)

getPrevLifelineMessage

public GraphNode getPrevLifelineMessage(Lifeline lifeline,
                                        BaseMessage StartMessage)

TPTP 4.4.0 Platform Project
Public API Specification