sims.ihm.graph
Class Arrow2D

java.lang.Object
  extended by sims.ihm.graph.Arrow2D

public class Arrow2D
extends java.lang.Object


Constructor Summary
Arrow2D(java.awt.Graphics2D g2, float SourceX, float SourceY, float DestX, float DestY)
          Arrow2D Constructor to build an arrow between two points
Arrow2D(java.awt.Graphics2D g2, GraphState2D state1, GraphState2D state2, Graph gr)
          Arrow2D Constructor to build an arrow between two states
Arrow2D(java.awt.Graphics2D g2, GraphState2D state1, int dir)
          Arrow2D Constructor to build an arrow on a self-state
 
Method Summary
 void draw()
          Arrow2D method to draw the arrow Draw()
 int getAngle()
          Accessor to get the value of the angle of the arrow
 int getDirection()
          Accessor to get the direction for self-vertex edges
 int getFinalX()
          Accessor to get the X-coordinate of the final point
 int getFinalY()
          Accessor to get the Y-coordinate of the final point
 int getInitialX()
          Accessor to get the X-coordinate of the initial point
 int getInitialY()
          Accessor to get the Y-coordinate of the initial point
 GraphState2D getState1()
          Accessor to get the initial vertex
 GraphState2D getState2()
          Accessor to get the final vertex
 void setAngle()
          Calculation of the angle of the triangular part of the arrow.
 void setCoordinates()
          Set the coordinates of the arrow and the triangle setCoordinates()
 void setDirection(int dir)
          Accessor to get the direction for self-vertex edges
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Arrow2D

public Arrow2D(java.awt.Graphics2D g2,
               GraphState2D state1,
               GraphState2D state2,
               Graph gr)
Arrow2D Constructor to build an arrow between two states

Parameters:
ObjectToDraw -
SourceState -
DestinationState - Arrow2D()

Arrow2D

public Arrow2D(java.awt.Graphics2D g2,
               GraphState2D state1,
               int dir)
Arrow2D Constructor to build an arrow on a self-state

Parameters:
ObjectToDraw -
State -
Position - Arrow2D()

Arrow2D

public Arrow2D(java.awt.Graphics2D g2,
               float SourceX,
               float SourceY,
               float DestX,
               float DestY)
Arrow2D Constructor to build an arrow between two points

Parameters:
ObjectToDraw -
SourceX -
SourceY -
DestinationX -
DestinationY - Arrow2D()
Method Detail

setCoordinates

public void setCoordinates()
Set the coordinates of the arrow and the triangle setCoordinates()


setAngle

public void setAngle()
Calculation of the angle of the triangular part of the arrow. setAngle()


getInitialX

public int getInitialX()
Accessor to get the X-coordinate of the initial point

Returns:
the X-coordinate of the base of the arrow getInitialX()

getInitialY

public int getInitialY()
Accessor to get the Y-coordinate of the initial point

Returns:
the Y-coordinate of the base of the arrow getInitialY()

getFinalX

public int getFinalX()
Accessor to get the X-coordinate of the final point

Returns:
the X-coordinate of the top of the arrow getFinalX()

getFinalY

public int getFinalY()
Accessor to get the Y-coordinate of the final point

Returns:
the Y-coordinate of the top of the arrow getFinalY()

getState1

public GraphState2D getState1()
Accessor to get the initial vertex

Returns:
the initial vertex getState1()

getState2

public GraphState2D getState2()
Accessor to get the final vertex

Returns:
the final vertex getState2()

getAngle

public int getAngle()
Accessor to get the value of the angle of the arrow

Returns:
the value of the angle of the arrow getAngle()

getDirection

public int getDirection()
Accessor to get the direction for self-vertex edges

Returns:
the direction getDirection()

setDirection

public void setDirection(int dir)
Accessor to get the direction for self-vertex edges

Parameters:
direction - setDirection()

draw

public void draw()
Arrow2D method to draw the arrow Draw()