com.alveole.studio.web.data
Class NodeLink

java.lang.Object
  extended by com.alveole.studio.web.data.NodeLink

public class NodeLink
extends java.lang.Object

Defines a link between two node-containers. Links must be strongly typed, using a mgrId and a linkSpecificPart object. Links have common features (such as linking two nodes), and are exetended with a specific LinkManager that manages specificAttributes and linkSpecificPart. It enables to add specific information such as a link disciminator (for struts actions for example)...

Author:
sylvain

Field Summary
protected  boolean arrowNode1
          Check if an arrow should be displayed on origin node.
protected  boolean arrowNode2
          Check if an arrow should be displayed on target node.
protected  java.lang.String label
          A label to be displayed on this link.
protected  java.lang.String linkMgrId
          The manager plugin ID.
protected  java.lang.Object linkSpecificPart
          A specific object to store specific data in that link.
protected  NodeContainer node1
          The origin node.
protected  NodeContainer node2
          The target node.
protected  java.util.Properties specificAttributes
          A properties set, to store link specific data.
 
Constructor Summary
NodeLink(java.lang.String mgrId, java.lang.String label, NodeContainer node1, NodeContainer node2)
          A constructor.
 
Method Summary
 boolean arrowNode1()
          Check whether arrow must be displayed on node1.
 boolean arrowNode2()
          Check whether arrow must be displayed on node2.
 java.lang.String getLabel()
          Gets a label to display this link.
 java.lang.String getLinkMgrId()
          Get the ID of the LinkManager plugin.
 java.lang.Object getLinkSpecificPart()
          Get specific object for this link type.
 NodeContainer getNode1()
          Gets origin node.
 NodeContainer getNode2()
          Gets target node.
 java.util.Properties getSpecificAttributes()
          Get specific properties for this link.
 boolean isArrowNode1()
          Check if origin node must display an arrow.
 boolean isArrowNode2()
          Check if target node must display arrow.
 void setArrowNode1(boolean arrowNode1)
          Set if an arrow must be displayed on origin node.
 void setArrowNode2(boolean arrowNode2)
          Set arrow node display.
 void setLabel(java.lang.String label)
          Set a display label for this link.
 void setLinkMgrId(java.lang.String linkMgrId)
          Sets the ID of the LinkManager plugin.
 void setLinkSpecificPart(java.lang.Object linkSpecificPart)
          Sets a specific embedded object for this link;
 void setSpecificAttributes(java.util.Properties specificAttributes)
          Set specific properties for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node1

protected NodeContainer node1
The origin node.


node2

protected NodeContainer node2
The target node.


label

protected java.lang.String label
A label to be displayed on this link.


linkMgrId

protected java.lang.String linkMgrId
The manager plugin ID.


linkSpecificPart

protected java.lang.Object linkSpecificPart
A specific object to store specific data in that link.


specificAttributes

protected java.util.Properties specificAttributes
A properties set, to store link specific data.


arrowNode1

protected boolean arrowNode1
Check if an arrow should be displayed on origin node.


arrowNode2

protected boolean arrowNode2
Check if an arrow should be displayed on target node.

Constructor Detail

NodeLink

public NodeLink(java.lang.String mgrId,
                java.lang.String label,
                NodeContainer node1,
                NodeContainer node2)
A constructor.

Parameters:
mgrId - The specific LinkManager plugin ID.
label - A label for displaying this link.
node1 - Origin node.
node2 - target node.
Method Detail

getNode1

public NodeContainer getNode1()
Gets origin node.

Returns:
Origin node.

getNode2

public NodeContainer getNode2()
Gets target node.

Returns:
Target node.

arrowNode2

public boolean arrowNode2()
Check whether arrow must be displayed on node2.

Returns:
true if arrow is displayed.

arrowNode1

public boolean arrowNode1()
Check whether arrow must be displayed on node1.

Returns:
true if arrow is displayed.

getLabel

public java.lang.String getLabel()
Gets a label to display this link.

Returns:
A label.

setLabel

public void setLabel(java.lang.String label)
Set a display label for this link.

Parameters:
label - The display label.

getLinkMgrId

public java.lang.String getLinkMgrId()
Get the ID of the LinkManager plugin.

Returns:
The ID.

setLinkMgrId

public void setLinkMgrId(java.lang.String linkMgrId)
Sets the ID of the LinkManager plugin.

Parameters:
linkMgrId - The ID.

getLinkSpecificPart

public java.lang.Object getLinkSpecificPart()
Get specific object for this link type.

Returns:
A link specific part object.

setLinkSpecificPart

public void setLinkSpecificPart(java.lang.Object linkSpecificPart)
Sets a specific embedded object for this link;

Parameters:
linkSpecificPart - A specific object.

getSpecificAttributes

public java.util.Properties getSpecificAttributes()
Get specific properties for this link.

Returns:
Specific properties.

setSpecificAttributes

public void setSpecificAttributes(java.util.Properties specificAttributes)
Set specific properties for this object.

Parameters:
specificAttributes - Specific properties.

isArrowNode2

public boolean isArrowNode2()
Check if target node must display arrow.

Returns:
True to display arrow.

setArrowNode2

public void setArrowNode2(boolean arrowNode2)
Set arrow node display.

Parameters:
arrowNode2 - True to display arrow.

isArrowNode1

public boolean isArrowNode1()
Check if origin node must display an arrow.

Returns:
True to display it.

setArrowNode1

public void setArrowNode1(boolean arrowNode1)
Set if an arrow must be displayed on origin node.

Parameters:
arrowNode1 - true to display it.