de.upb.swt.epctools.model
Class Arc

java.lang.Object
  extended by de.upb.swt.epctools.model.Arc
Direct Known Subclasses:
SimArc

public class Arc
extends java.lang.Object

This class represents an EPC arc


Field Summary
 int a_type
           
static int ANCHOR_BOTTOM
           
static int ANCHOR_LEFT
           
static int ANCHOR_NONE
           
static int ANCHOR_RIGHT
           
static int ANCHOR_TOP
           
private  java.util.Vector m_bend_points
           
private  EPC m_epc
           
private  int m_folder_number
           
private  int m_id
           
private  ModelListenerList m_listener
           
private  Node m_source
           
private  int m_source_anchor_id
           
private  Node m_target
           
private  int m_target_anchor_id
           
 ArcPart part
           
 int r_type
           
static int TYPE_ANY
           
static int TYPE_FLOW
           
static int TYPE_INPUT
           
static int TYPE_OUTPUT
           
static int TYPE_RELATION
           
static int TYPE_ROLE
           
 
Constructor Summary
Arc(EPC parent_epc, Node source, Node target, int source_anchor_id, int target_anchor_id)
          Initialization.
 
Method Summary
 void addListener(ModelListener obj)
          This function adds a listener to the list of listeners.
 void addToNodes()
          This function adds this Arc to all connected Nodes.
 void forwardMessage(int message)
          This function forwards a message to all listeners.
private static java.awt.Point getAnchorPosition(java.awt.Rectangle r, java.awt.Point reference, int id)
          Returns the anchor position.
 java.util.Vector getBendPoints()
          Returns a Vector of bend points.
 Arc getDistantArc()
          This function scans parent or child Arcs and returns an Arc as far as possible from "this".
 Arc getDistantChild()
          This function scans child Arcs and return a Arc as far as possible from "this".
 Arc getDistantParent()
          This function scans parent Arcs and return an Arc as far as possible from "this".
 EPC getEPC()
          Returns the parent EPC.
 int getFolders()
          Returns number of process folders on this Arc.
 int getId()
          Returns the Id of "this" Arc.
static int getNearestAnchor(java.awt.Rectangle r, java.awt.Point p)
          Returns the nearest anchor to a given point.
 Node getSource()
          Returns the source node of this connection.
 int getSourceAnchorId()
          Returns the anchor id of "this" Arc's source point.
 java.awt.Point getSourceAnchorPosition()
          Returns the anchor position to the source Node.
 Node getTarget()
          Returns the target Node.
 int getTargetAnchorId()
          Returns the anchor id of this Arc's target point.
 java.awt.Point getTargetAnchorPosition()
          Returns the anchor position to the target Node.
 void removeFromNodes()
          This function removes "this" Arc from all connected Nodes.
 void removeListener(ModelListener obj)
          This function removes a listener.
 void setFolders(int i)
          This function specifies the number of folders.
 void setId(int id)
          This function specifies the Id of "this" Arc.
 void setSource(Node source_node)
          This function specifies a source Node and registers "this" Arc in the Node.
 void setSourceAnchorId(int id)
          This function specifies the anchor id of "this" Arc's source point
 void setTarget(Node target_node)
          This function specifies a target Node and registers "this" Arc in the Node.
 void setTargetAnchorId(int id)
          This function specifies the anchor id of "this" Arc's target point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANCHOR_NONE

public static final int ANCHOR_NONE
See Also:
Constant Field Values

ANCHOR_LEFT

public static final int ANCHOR_LEFT
See Also:
Constant Field Values

ANCHOR_RIGHT

public static final int ANCHOR_RIGHT
See Also:
Constant Field Values

ANCHOR_BOTTOM

public static final int ANCHOR_BOTTOM
See Also:
Constant Field Values

ANCHOR_TOP

public static final int ANCHOR_TOP
See Also:
Constant Field Values

m_id

private int m_id

m_folder_number

private int m_folder_number

m_source

private Node m_source

m_target

private Node m_target

m_epc

private EPC m_epc

m_bend_points

private java.util.Vector m_bend_points

m_source_anchor_id

private int m_source_anchor_id

m_target_anchor_id

private int m_target_anchor_id

TYPE_FLOW

public static final int TYPE_FLOW
See Also:
Constant Field Values

TYPE_RELATION

public static final int TYPE_RELATION
See Also:
Constant Field Values

a_type

public int a_type

TYPE_ROLE

public static final int TYPE_ROLE
See Also:
Constant Field Values

TYPE_INPUT

public static final int TYPE_INPUT
See Also:
Constant Field Values

TYPE_OUTPUT

public static final int TYPE_OUTPUT
See Also:
Constant Field Values

TYPE_ANY

public static final int TYPE_ANY
See Also:
Constant Field Values

r_type

public int r_type

m_listener

private ModelListenerList m_listener

part

public ArcPart part
Constructor Detail

Arc

public Arc(EPC parent_epc,
           Node source,
           Node target,
           int source_anchor_id,
           int target_anchor_id)
Initialization.

Method Detail

getEPC

public EPC getEPC()
Returns the parent EPC.


getId

public int getId()
Returns the Id of "this" Arc.


setId

public void setId(int id)
This function specifies the Id of "this" Arc.


removeFromNodes

public void removeFromNodes()
This function removes "this" Arc from all connected Nodes.


addToNodes

public void addToNodes()
This function adds this Arc to all connected Nodes.


getBendPoints

public java.util.Vector getBendPoints()
Returns a Vector of bend points.


getSource

public Node getSource()
Returns the source node of this connection.


setSource

public void setSource(Node source_node)
This function specifies a source Node and registers "this" Arc in the Node.


setTarget

public void setTarget(Node target_node)
This function specifies a target Node and registers "this" Arc in the Node.


addListener

public void addListener(ModelListener obj)
This function adds a listener to the list of listeners.


forwardMessage

public void forwardMessage(int message)
This function forwards a message to all listeners.


removeListener

public void removeListener(ModelListener obj)
This function removes a listener.


getTarget

public Node getTarget()
Returns the target Node.


getFolders

public int getFolders()
Returns number of process folders on this Arc.


setFolders

public void setFolders(int i)
This function specifies the number of folders.


getSourceAnchorId

public int getSourceAnchorId()
Returns the anchor id of "this" Arc's source point.


setSourceAnchorId

public void setSourceAnchorId(int id)
This function specifies the anchor id of "this" Arc's source point


setTargetAnchorId

public void setTargetAnchorId(int id)
This function specifies the anchor id of "this" Arc's target point.


getTargetAnchorId

public int getTargetAnchorId()
Returns the anchor id of this Arc's target point.


getSourceAnchorPosition

public java.awt.Point getSourceAnchorPosition()
Returns the anchor position to the source Node.


getTargetAnchorPosition

public java.awt.Point getTargetAnchorPosition()
Returns the anchor position to the target Node.


getDistantParent

public Arc getDistantParent()
This function scans parent Arcs and return an Arc as far as possible from "this". Therefore a random path is traversed starting at "this".


getDistantChild

public Arc getDistantChild()
This function scans child Arcs and return a Arc as far as possible from "this". Therefore a random path is traversed starting at "this".


getDistantArc

public Arc getDistantArc()
This function scans parent or child Arcs and returns an Arc as far as possible from "this". Therefore a random path is traversed starting at "this".


getAnchorPosition

private static java.awt.Point getAnchorPosition(java.awt.Rectangle r,
                                                java.awt.Point reference,
                                                int id)
Returns the anchor position.

Parameters:
r - Size and position of the node bounding box
id - anchor id

getNearestAnchor

public static int getNearestAnchor(java.awt.Rectangle r,
                                   java.awt.Point p)
Returns the nearest anchor to a given point. Note: Here we use java.awt.Point and Rectangle structures so that our model can be used without eclipse

Parameters:
r - Size and position of the Node bounding box
p -