|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pnp.xfeature.models.AbstractComponentModel
com.pnp.xfeature.models.FeatureNodeModel
public class FeatureNodeModel
Class representing a feature node. It contains method that manipulates the feature node and provides information about it.
| Field Summary | |
|---|---|
static RGB |
FEA_DEFAULTCOLOUR
Feature attribute constants |
static java.lang.String |
PROPERTY_CONNECTION_ADDED
event identifier |
static java.lang.String |
PROPERTY_CONNECTION_PARENT_EXPANDED_COLLAPSED
event identifier |
static java.lang.String |
PROPERTY_CONNECTION_REMOVED
event identifier |
static java.lang.String |
PROPERTY_CONSTRAINT
event identifier |
static java.lang.String |
PROPERTY_EXPANDED
event identifier |
static java.lang.String |
PROPERTY_NAME
event identifier |
static java.lang.String |
PROPERTY_TOOLTIPTEXT
event identifier |
| Constructor Summary | |
|---|---|
FeatureNodeModel(org.w3c.dom.Node node,
org.w3c.dom.Document displayModel,
org.w3c.dom.Document metaModel,
FeatureDiagramModel diagram)
Creates new instance of FeatureNodeModel reading data from W3C DOM Node object. |
|
| Method Summary | |
|---|---|
void |
addAttachedNode(FeatureNodeModel nodeModel)
attaches a new attached node to this node |
void |
addChild(FeatureNodeModel feature)
adds a child node to the list of children |
void |
addSourceConnection(FeatureConnectionModel connection)
adds a new connection to the list of source connections |
void |
addTargetConnection(FeatureConnectionModel connection)
adds a new connection to the list of target connections |
void |
alignToParent()
aligns an attached node to its parent, it assumes that the attached node is below its parent |
void |
fire()
fires property change event when node position or size is changed Fixme: This is just to fire the event that fixes the connection O.R. |
java.lang.String |
getAttachedToParentPosition()
getter method |
java.lang.String |
getCardinality()
Returns the feature node cardnality. |
java.lang.String |
getCardinalityFont()
getter method |
int |
getCardinalityFontSize()
getter method |
int |
getCardinalityFontStyle()
getter method |
RGB |
getCardinalityTextColor()
getter method |
java.lang.String |
getCardinalityTextPosition()
getter method |
Rectangle |
getConstraint()
getter method |
RGB |
getFillColor()
getter method |
java.lang.String |
getFont()
getter method |
int |
getFontSize()
getter method |
int |
getFontStyle()
getter method |
java.util.Map |
getGlobalConstraintParents()
This is a setter method. |
java.util.List |
getGlobalConstraints()
This is a setter method. |
java.util.List |
getChildren()
returns list of all child nodes |
Image |
getIcon()
returns a pictogram (small icon) describing this model element. |
java.lang.String |
getIconPath()
queries the display model for the path to the icon |
Image |
getImage(java.lang.String string)
creates new Eclipse image, called from getIcon and FeatureNodeFigure construcotor |
ILabelProvider |
getLabelProvider()
returns dummy label provider; used to dsplay icons of feature nodes |
RGB |
getLineColor()
getter method |
int |
getLineStyle()
getter method |
int |
getLineWidth()
getter method |
org.w3c.dom.Document |
getMetamodel()
getter method |
java.lang.String |
getName()
getter method |
Dimension |
getNameTextExtent()
returns size of the node name as it is displayed with current font name, font size, and font style |
org.w3c.dom.Node |
getNode()
returns the node as a W3C DOM Node object, the returned node is the node as it is written in the *.xfm file |
int |
getNodeLastPosition()
getter method |
int |
getNodeWidth()
returns number of pixels necessary to fit the node to the screen |
int |
getNumberOfAlreadyArrangedNodesOfThisType(java.lang.String posCode)
returns number of nodes of given type for which the postion has been already computed |
int |
getNumberOfAlreadyAttachedNodes()
returns the number of actually attached nodes. |
FeatureNodeModel |
getParent()
getter method |
RGB |
getParentConnectorColor()
getter method |
int |
getParentConnectorStyle()
getter method |
int |
getParentConnectorWidth()
getter method |
IPropertyDescriptor[] |
getPropertyDescriptors()
creates an array of property descriptors to appear in the property view of Eclipse perspective according to the sub-nodes of this node |
java.lang.Object |
getPropertyValue(java.lang.Object id)
returns value of the property from the property view |
long |
getRefreshSubtreeTimeStamp()
getter method |
java.lang.String |
getShape()
getter method |
int |
getSize()
getter method |
java.util.List |
getSourceConnections()
getter method |
int |
getSubtreeOffset()
getter method |
long |
getSubtreeOffsetTimeStamp()
getter method |
int |
getSubtreeWidth()
getter method |
long |
getSubtreeWidthTimeStamp()
getter method |
java.util.List |
getTargetConnections()
getter method |
RGB |
getTextColor()
getter method |
java.lang.String |
getToolTipText()
returns the tooltip or the node |
int |
getTotalNumberOfAttachedNodes()
returns the number of all nodes attached to this node, used to automaticaly position them along the bottome side of the parent node |
int |
getTotalNumberOfAttachedNodesOfThisType(java.lang.String posCode)
returns number of child nodes of given type |
long |
getUniqueId()
getter method |
boolean |
hasCardinalityText()
getter method |
boolean |
hasCollapsedAncestor()
returns true if there is an ancestor that is colappsed |
boolean |
hasChildNodes()
returns true if there is at least one child node |
boolean |
hasNameText()
getter method |
boolean |
hasParentConnector()
getter method |
boolean |
hasPropertySet(java.lang.String name)
Checks whether the node has a property set(s) or not |
boolean |
isAttachedToParent()
getter method |
boolean |
isExpanded()
setter method |
boolean |
isIconAttached()
ToDo: query the display model whether an icon is attached to this node |
boolean |
isPropertySet(java.lang.Object id)
returns true (a property is always set if it exist) |
void |
removeAttachedNode(FeatureNodeModel nodeModel)
dettaches an attached node from this node |
void |
removeConnectionToParent()
removes the connection from tha parent node to this node |
void |
removeChild(FeatureNodeModel feature)
removes a node to the list of children |
void |
removeSourceConnection(FeatureConnectionModel connection)
removes existing connection from the list of source connections |
void |
removeTargetConnection(FeatureConnectionModel connection)
removes existing connection from the list of target connections |
void |
setConstraintInit(Rectangle rect)
sets the initial position of a node |
void |
setConstraintOffset(Rectangle rect)
modifies the position of the node and its children that are attached to it |
void |
setExpanded(boolean expanded)
setter method, fires property change event to inform the editpart that feature model has to be repainted |
void |
setName(java.lang.String name)
setter method |
void |
setNodeLastPosition(int nodeLastPosition)
setter method |
void |
setParent(FeatureNodeModel parent)
setter method |
void |
setPropertyValue(java.lang.Object id,
java.lang.Object value)
writes the new property value to the model and updates the graphical view via call of firePropertyChange() |
void |
setRefreshSubtreeTimeStamp(long refreshSubtreeTimeStamp)
setter method |
void |
setSubtreeOffset(int subtreeOffset,
long timeStamp)
setter method |
void |
setSubtreeOffsetTimeStamp(long subtreeOffsetTimeStamp)
setter method |
void |
setSubtreeWidth(int subtreeWidth,
long timeStamp)
setter method |
void |
setSubtreeWidthTimeStamp(long subtreeWidthTimeStamp)
setter method |
void |
setTreeLevel(int level)
setter method |
void |
setUniqueId(long uniqueId)
setter method |
java.lang.String |
toString()
retuen name othe feature |
boolean |
validIntString(java.lang.String intStr)
Checks whether the passed string intStr can be converted to an integer |
| Methods inherited from class com.pnp.xfeature.models.AbstractComponentModel |
|---|
addPropertyChangeListener, firePropertyChange, getEditableValue, removePropertyChangeListener, resetPropertyValue |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final RGB FEA_DEFAULTCOLOUR
public static final java.lang.String PROPERTY_CONSTRAINT
public static final java.lang.String PROPERTY_NAME
public static final java.lang.String PROPERTY_TOOLTIPTEXT
public static final java.lang.String PROPERTY_EXPANDED
public static final java.lang.String PROPERTY_CONNECTION_ADDED
public static final java.lang.String PROPERTY_CONNECTION_REMOVED
public static final java.lang.String PROPERTY_CONNECTION_PARENT_EXPANDED_COLLAPSED
| Constructor Detail |
|---|
public FeatureNodeModel(org.w3c.dom.Node node,
org.w3c.dom.Document displayModel,
org.w3c.dom.Document metaModel,
FeatureDiagramModel diagram)
node - displayModel - metaModel - | Method Detail |
|---|
public java.lang.String getCardinality()
public boolean hasPropertySet(java.lang.String name)
public java.lang.String getToolTipText()
public long getUniqueId()
public org.w3c.dom.Document getMetamodel()
public java.lang.String getName()
public void setName(java.lang.String name)
public RGB getFillColor()
public RGB getTextColor()
public RGB getCardinalityTextColor()
public RGB getLineColor()
public RGB getParentConnectorColor()
public java.lang.String getShape()
public int getSize()
public int getLineStyle()
public int getLineWidth()
public int getParentConnectorWidth()
public int getParentConnectorStyle()
public java.lang.String getCardinalityTextPosition()
public java.lang.String getAttachedToParentPosition()
public boolean isAttachedToParent()
public boolean hasParentConnector()
public java.lang.String getFont()
public java.lang.String getCardinalityFont()
public int getFontSize()
public int getCardinalityFontSize()
public int getFontStyle()
public int getCardinalityFontStyle()
public boolean hasNameText()
public boolean hasCardinalityText()
public void setTreeLevel(int level)
public Rectangle getConstraint()
public void setConstraintOffset(Rectangle rect)
public void setConstraintInit(Rectangle rect)
public void alignToParent()
public ILabelProvider getLabelProvider()
public IPropertyDescriptor[] getPropertyDescriptors()
getPropertyDescriptors in class AbstractComponentModelorg.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors()public java.lang.Object getPropertyValue(java.lang.Object id)
getPropertyValue in class AbstractComponentModelorg.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object)public boolean isPropertySet(java.lang.Object id)
isPropertySet in class AbstractComponentModelorg.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object)
public void setPropertyValue(java.lang.Object id,
java.lang.Object value)
setPropertyValue in class AbstractComponentModelorg.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, java.lang.Object)public boolean validIntString(java.lang.String intStr)
public java.util.List getSourceConnections()
public java.util.List getTargetConnections()
public void addSourceConnection(FeatureConnectionModel connection)
public void addTargetConnection(FeatureConnectionModel connection)
public void removeSourceConnection(FeatureConnectionModel connection)
public void removeTargetConnection(FeatureConnectionModel connection)
public void removeConnectionToParent()
public org.w3c.dom.Node getNode()
public int getTotalNumberOfAttachedNodes()
public int getNumberOfAlreadyAttachedNodes()
public void addAttachedNode(FeatureNodeModel nodeModel)
public void removeAttachedNode(FeatureNodeModel nodeModel)
public void setUniqueId(long uniqueId)
public Image getIcon()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List getChildren()
public void setParent(FeatureNodeModel parent)
public void addChild(FeatureNodeModel feature)
public void removeChild(FeatureNodeModel feature)
public FeatureNodeModel getParent()
public int getNodeLastPosition()
public void setNodeLastPosition(int nodeLastPosition)
public void fire()
public boolean isExpanded()
public void setExpanded(boolean expanded)
public boolean hasCollapsedAncestor()
public boolean hasChildNodes()
public Dimension getNameTextExtent()
public int getNodeWidth()
public boolean isIconAttached()
public int getTotalNumberOfAttachedNodesOfThisType(java.lang.String posCode)
public int getNumberOfAlreadyArrangedNodesOfThisType(java.lang.String posCode)
public int getSubtreeWidth()
public void setSubtreeWidth(int subtreeWidth,
long timeStamp)
public int getSubtreeOffset()
public void setSubtreeOffset(int subtreeOffset,
long timeStamp)
public long getRefreshSubtreeTimeStamp()
public void setRefreshSubtreeTimeStamp(long refreshSubtreeTimeStamp)
public long getSubtreeOffsetTimeStamp()
public void setSubtreeOffsetTimeStamp(long subtreeOffsetTimeStamp)
public long getSubtreeWidthTimeStamp()
public void setSubtreeWidthTimeStamp(long subtreeWidthTimeStamp)
public java.lang.String getIconPath()
public Image getImage(java.lang.String string)
string -
public java.util.List getGlobalConstraints()
public java.util.Map getGlobalConstraintParents()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||