|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.edu.agh.cast.model.visual.backward.ModelElement
pl.edu.agh.cast.model.visual.backward.Node
public class Node
Class representing nodes of IDiagram.
| Field Summary | |
|---|---|
protected List<ConnectionGroup> |
connectionGroups
List of ConnectionGroups adjacent to the node. |
static String |
CONNECTIONS
Name of the Connections changed event. |
static String |
DEFAULT_NODE_TYPE
Default node type. |
protected org.eclipse.draw2d.geometry.Dimension |
dimensions
Dimensions of the node. |
protected String |
imageId
Node's image identifier - one from Images. |
protected org.eclipse.draw2d.geometry.Point |
location
Location of the node. |
static String |
LOCATION
Name of the Location changed event. |
static String |
SELECTED
Name of the Selected event. |
static String |
SELECTED_PRIMARY
Name of the Selected primary event. |
| Fields inherited from class pl.edu.agh.cast.model.visual.backward.ModelElement |
|---|
ATTRIBUTE_CHANGE, attributeValues |
| Constructor Summary | |
|---|---|
|
Node(String id,
boolean isMainNode,
NodeAttributeManager attributeManager)
Creates new Node instance. |
protected |
Node(String id,
boolean isMainNode,
NodeAttributeManager attributeManager,
org.eclipse.draw2d.geometry.Point location)
Creates new Node instance in specified location. |
| Method Summary | |
|---|---|
void |
addConnectionGroup(ConnectionGroup connectionGroup)
Adds adjacent ConnectionGroup to this node. |
void |
copyTo(Node that)
Copies all fields of this Node instance to that instance. |
boolean |
equals(Object obj)
Two nodes are equal if their getId()s are equal. |
AttributeManager |
getAttributeManager()
Returns attribute manager for this container. |
List<ConnectionGroup> |
getConnectionGroups()
Returns the list of all ConnectionGroups adjacent to this node. |
org.eclipse.draw2d.geometry.Dimension |
getDimensions()
Returns the dimension of this node. |
String |
getId()
Returns the Id of this node. |
String |
getImageId()
Returns the Id of an image that is used to display this node. |
String |
getLabel()
Returns a label, composed of values of all ValueType.String attributes
that have Attribute.isShowAsLabel() set. |
org.eclipse.draw2d.geometry.Point |
getLocation()
Returns current location of movable element. |
int |
getTotalConnectionsCount()
Returns the number of Connections this node is source or target for. |
int |
getTotalSourceConnectionsCount()
Returns the number of Connections this node is source for. |
int |
getTotalTargetConnectionsCount()
Returns the number of Connections this node is target for. |
String |
getType()
Returns the type of this node. |
int |
hashCode()
|
boolean |
isConnected(Node node)
Checks if this node is directly connected to given node. |
boolean |
isMainNode()
Returns main flag for this node. |
static boolean |
isSuppressLocationChangeEvents()
|
protected Object |
readResolve()
Inits transient fields during deserialization. |
boolean |
removeConnectionGroup(ConnectionGroup connectionGroup)
Removes adjacent ConnectionGroup to this node. |
void |
select(boolean primary)
Selects this node. |
void |
setDimensions(org.eclipse.draw2d.geometry.Dimension dimensions)
Sets dimensions of Node. |
void |
setImageId(String id)
|
void |
setLocation(org.eclipse.draw2d.geometry.Point newLocation)
Sets new location of movable element. |
static void |
setSuppressLocationChangeEvents(boolean suppressLocationChangeEvents)
|
void |
setType(String type)
Sets the type of this node. |
String |
toString()
|
| Methods inherited from class pl.edu.agh.cast.model.visual.backward.ModelElement |
|---|
addPropertyChangeListener, bindToAttributeManager, copyAttributes, copyAttributeValues, firePropertyChange, getAllValues, getAttributeValue, getMid, isAttributeEditable, isAttributeSettable, isSaved, propertyChange, removePropertyChangeListener, removePropertyValue, setAttributeValue, setAttributeValue, setMid, setSaved |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String LOCATION
public static final String CONNECTIONS
public static final String SELECTED
public static final String SELECTED_PRIMARY
public static final String DEFAULT_NODE_TYPE
protected org.eclipse.draw2d.geometry.Point location
protected org.eclipse.draw2d.geometry.Dimension dimensions
@XStreamAsAttribute protected String imageId
Images.
protected List<ConnectionGroup> connectionGroups
ConnectionGroups adjacent to the node.
| Constructor Detail |
|---|
public Node(String id,
boolean isMainNode,
NodeAttributeManager attributeManager)
id - id of the node; non-nullisMainNode - whether the node is a main node or not. Main nodes are highlighted on diagrams.attributeManager - AttributeManager for the node
IllegalArgumentException - if supplied node id is null
protected Node(String id,
boolean isMainNode,
NodeAttributeManager attributeManager,
org.eclipse.draw2d.geometry.Point location)
id - id of the nodeisMainNode - whether the node is a main node or not. Main nodes are highlighted on diagrams.attributeManager - AttributeManager for the nodelocation - the location of the node| Method Detail |
|---|
protected Object readResolve()
readResolve in class ModelElementModelElement.readResolve()public void addConnectionGroup(ConnectionGroup connectionGroup)
ConnectionGroup to this node.
connectionGroup - ConnectionGroup to addpublic boolean removeConnectionGroup(ConnectionGroup connectionGroup)
ConnectionGroup to this node.
connectionGroup - ConnectionGroup to remove
List.remove(Object) for details)public List<ConnectionGroup> getConnectionGroups()
ConnectionGroups adjacent to this node.
ConnectionGroupspublic String getId()
public String getLabel()
ValueType.String attributes
that have Attribute.isShowAsLabel() set.
Returns label of movable element.
getLabel in interface IMoveableIMoveable.getLabel()public boolean isMainNode()
public void setType(String type)
type - type of the nodepublic String getType()
public org.eclipse.draw2d.geometry.Point getLocation()
getLocation in interface IMoveableIMoveable.getLocation()public void setLocation(org.eclipse.draw2d.geometry.Point newLocation)
setLocation in interface IMoveablenewLocation - new location pointIMoveable.setLocation(org.eclipse.draw2d.geometry.Point)public org.eclipse.draw2d.geometry.Dimension getDimensions()
public void setDimensions(org.eclipse.draw2d.geometry.Dimension dimensions)
dimensions - new dimensions of this nodepublic void copyTo(Node that)
Node instance to that instance.
that - instance of Node to copy this instance topublic String getImageId()
public void setImageId(String id)
public int getTotalTargetConnectionsCount()
Connections this node is target for.
Connections this node is target forpublic int getTotalSourceConnectionsCount()
Connections this node is source for.
Connections this node is source forpublic int getTotalConnectionsCount()
Connections this node is source or target for.
Connections this node is source or target forpublic boolean isConnected(Node node)
node.
node - another node to check connection for
true if there is a direct Connection between this node and given nodepublic String toString()
toString in class ObjectObject.toString()public boolean equals(Object obj)
getId()s are equal.
equals in class ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public void select(boolean primary)
primary - whether the selection is primarypublic AttributeManager getAttributeManager()
getAttributeManager in interface AttributeValueContainergetAttributeManager in class ModelElementModelElement.getAttributeManager()public static void setSuppressLocationChangeEvents(boolean suppressLocationChangeEvents)
public static boolean isSuppressLocationChangeEvents()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||