TPTP 4.4.0 Platform Project
Public API Specification

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

java.lang.Object
  extended byorg.eclipse.hyades.uml2sd.ui.core.GraphNode
      extended byorg.eclipse.hyades.uml2sd.ui.core.BaseMessage
          extended byorg.eclipse.hyades.uml2sd.ui.core.AsyncMessage
All Implemented Interfaces:
ITimeRange
Direct Known Subclasses:
AsyncMessageReturn

public class AsyncMessage
extends BaseMessage
implements ITimeRange

A AsyncMessage is a asynchronous message which appear at two different event occurences on each lifeline ends (sender and receiver).


Usage example:

  Frame frame;
  Lifeline lifeLine1;
  Lifeline lifeLine2;
 
	AsyncMessage message = new AsyncMessage();
	//Create a new event occurrence on each lifeline
	lifeline1.getNewOccurrenceIndex();
	lifeline2.getNewOccurrenceIndex();
  //Set the message sender and receiver
	message.setStartLifeline(lifeLine1);
	message.setEndLifline(lifeline2);
	message.setName("Message label");
  //add the message to the frame
	frame.addMessage(message);
 

See Also:
Lifeline for more event occurence details

Field Summary
static java.lang.String ASYNC_MESS_TAG
           
protected  double endTime
          The time when the message begin
protected  boolean hasTime
           
protected  AsyncMessageReturn messageReturn
          The associated message.
protected  double startTime
          The time when the message end
 
Fields inherited from class org.eclipse.hyades.uml2sd.ui.core.BaseMessage
endLifeline, startLifeline, visible
 
Fields inherited from class org.eclipse.hyades.uml2sd.ui.core.GraphNode
bnodes, bSort, endEventOccurrence, fnodes, fSort, hasChilds, indexes, nodes, prefId, startEventOccurrence
 
Constructor Summary
AsyncMessage()
           
 
Method Summary
 void autoSetEndLifeline(Lifeline lifeline)
          Set the lifeLine which has received the message.
 void autoSetStartLifeline(Lifeline lifeline)
          Set the lifeLine which has sent the message.
 boolean contains(int x, int y)
          Returns true if the message or the message label contains the point given in parameter
 void draw(IGC context)
          Draws the asynchrous message in the given GC
 java.lang.String getArrayId()
          Return the node type for all class instances.
 java.util.Comparator getBackComparator()
          If needed, return a different comparator to backward scan the GraphNode array
 java.util.Comparator getComparator()
          Return a comparator to sort the GraphNode of the same type This comparator is used to order the GraphNode array of the given node type.
 double getFirstTime()
          Returns the time when the message end
 int getHeight()
          Returns the graph node height
 double getLastTime()
          Returns the time when the message begin
 int getWidth()
          Returns the graph node width
 int getX()
          Returns the x coordinate of the graph node
 int getY()
          Returns the y coordinate of the graph node
 boolean hasTimeInfo()
           
protected  void informFrame(Lifeline lifeLine, int occurrence)
           
protected  boolean isNearSegment(int xA, int yA, int xB, int yB, int xC, int yC)
          Returns true if the point C is on the segment defined with the point A and B
 boolean isVisible(int x, int y, int width, int height)
          Returns the GraphNode visibility for the given visible area.
 boolean positiveDistanceToPoint(int x, int y)
          Return true if the distance from the GraphNode to the given point is positif
 void setEndLifeline(Lifeline lifeline)
          Set the lifeLine which has received the message.
 void setEndOccurrence(int occurrence)
          Set the event occurrence attached to this message for its end lifeline
 void setEndTime(double time)
          Set the time when the message end
protected  void setMessageReturn(AsyncMessageReturn message)
          Set the message return associated with this message.
 void setStartLifeline(Lifeline lifeline)
          Set the lifeLine which has sent the message.
 void setStartOccurrence(int occurrence)
          Set the event occurrence attached to this message for its start lifeline
 void setStartTime(double time)
          Set the time when the message start
 
Methods inherited from class org.eclipse.hyades.uml2sd.ui.core.BaseMessage
drawFocus, drawRot, getEndLifeline, getEventOccurrence, getStartLifeline, getWidth, getX, isMessageEndInActivation, isMessageStartInActivation, isSameAs, isVisible, setEventOccurrence, setVisible
 
Methods inherited from class org.eclipse.hyades.uml2sd.ui.core.GraphNode
addNode, contains, drawChildsNodes, getEndOccurrence, getName, getNodeAt, getNodeFromListAt, getNodeList, getStartOccurrence, hasFocus, isSelected, 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

hasTime

protected boolean hasTime

endTime

protected double endTime
The time when the message begin


startTime

protected double startTime
The time when the message end


messageReturn

protected AsyncMessageReturn messageReturn
The associated message.


ASYNC_MESS_TAG

public static final java.lang.String ASYNC_MESS_TAG
See Also:
Constant Field Values
Constructor Detail

AsyncMessage

public AsyncMessage()
Method Detail

getX

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

Overrides:
getX in class BaseMessage

getY

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

Overrides:
getY in class BaseMessage

getWidth

public int getWidth()
Description copied from class: GraphNode
Returns the graph node width

Overrides:
getWidth in class BaseMessage

getHeight

public int getHeight()
Description copied from class: GraphNode
Returns the graph node height

Overrides:
getHeight in class BaseMessage

setMessageReturn

protected void setMessageReturn(AsyncMessageReturn message)
Set the message return associated with this message.

Parameters:
message - the message return to associate

setEndOccurrence

public void setEndOccurrence(int occurrence)
Set the event occurrence attached to this message for its end lifeline

Parameters:
occurrence - the event occurrence to set

informFrame

protected void informFrame(Lifeline lifeLine,
                           int occurrence)

setStartOccurrence

public void setStartOccurrence(int occurrence)
Set the event occurrence attached to this message for its start lifeline

Parameters:
occurrence - the event occurrence to set

autoSetStartLifeline

public void autoSetStartLifeline(Lifeline lifeline)
Set the lifeLine which has sent the message.
A new EventOccurence will be create on this lifeLine.

Parameters:
lifeline - the message sender

autoSetEndLifeline

public void autoSetEndLifeline(Lifeline lifeline)
Set the lifeLine which has received the message.
A new EventOccurence will be create on this lifeLine.

Parameters:
lifeline - the message receiver

setStartLifeline

public void setStartLifeline(Lifeline lifeline)
Set the lifeLine which has sent the message.

Overrides:
setStartLifeline in class BaseMessage
Parameters:
lifeline - the message sender

setEndLifeline

public void setEndLifeline(Lifeline lifeline)
Set the lifeLine which has received the message.

Overrides:
setEndLifeline in class BaseMessage
Parameters:
lifeline - the message receiver

isNearSegment

protected boolean isNearSegment(int xA,
                                int yA,
                                int xB,
                                int yB,
                                int xC,
                                int yC)
Returns true if the point C is on the segment defined with the point A and B

Parameters:
xA - point A x coordinate
yA - point A y coordinate
xB - point B x coordinate
yB - point B y coordinate
xC - point C x coordinate
yC - point C y coordinate
Returns:
Return true if the point C is on the segment defined with the point A and B, else otherwise

contains

public boolean contains(int x,
                        int y)
Description copied from class: BaseMessage
Returns true if the message or the message label contains the point given in parameter

Overrides:
contains in class BaseMessage

draw

public void draw(IGC context)
Draws the asynchrous message in the given GC

Overrides:
draw in class BaseMessage

setEndTime

public void setEndTime(double time)
Set the time when the message end

Parameters:
time - the time when the message end

setStartTime

public void setStartTime(double time)
Set the time when the message start

Parameters:
time - the time when the message start

getLastTime

public double getLastTime()
Returns the time when the message begin

Specified by:
getLastTime in interface ITimeRange
Returns:
the time

getFirstTime

public double getFirstTime()
Returns the time when the message end

Specified by:
getFirstTime in interface ITimeRange
Returns:
the time

hasTimeInfo

public boolean hasTimeInfo()
Specified by:
hasTimeInfo in interface ITimeRange

isVisible

public boolean isVisible(int x,
                         int y,
                         int width,
                         int height)
Description copied from class: GraphNode
Returns the GraphNode visibility for the given visible area. Wrong visibity calculation, may strongly impact drawing performance

Overrides:
isVisible in class BaseMessage

getComparator

public java.util.Comparator getComparator()
Description copied from class: GraphNode
Return a comparator to sort the GraphNode of the same type This comparator is used to order the GraphNode array of the given node type. (see getArrayId).

Overrides:
getComparator in class GraphNode
Returns:
the comparator

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

getBackComparator

public java.util.Comparator getBackComparator()
Description copied from class: GraphNode
If needed, return a different comparator to backward scan the GraphNode array

Overrides:
getBackComparator in class GraphNode
Returns:
the backward comparator or null if not needed

positiveDistanceToPoint

public boolean positiveDistanceToPoint(int x,
                                       int y)
Description copied from class: GraphNode
Return true if the distance from the GraphNode to the given point is positif

Overrides:
positiveDistanceToPoint in class GraphNode
Parameters:
x - the point x coordinate
y - the point y coordinate
Returns:
true if positif false otherwise

TPTP 4.4.0 Platform Project
Public API Specification