org.drools.eclipse.editors.rete.model
Class GraphicalVertex

java.lang.Object
  extended by org.drools.eclipse.editors.rete.model.ModelElement
      extended by org.drools.eclipse.editors.rete.model.GraphicalVertex
Direct Known Subclasses:
BaseVertex

public abstract class GraphicalVertex
extends ModelElement

Visual vertex representation for ReteGraph. Base impl for all rete vertices. Can be connected with another BaseVertex with a Connector.


Field Summary
static String LOCATION_PROP
          Property ID to use when the location of this shape is modified.
static String SIZE_PROP
          Property ID to use then the size of this shape is modified.
static String SOURCE_CONNECTIONS_PROP
          Property ID to use when the list of outgoing connections is modified.
static String TARGET_CONNECTIONS_PROP
          Property ID to use when the list of incoming connections is modified.
 
Constructor Summary
GraphicalVertex()
           
 
Method Summary
 void addConnection(Connection conn)
          Add an incoming or outgoing connection to this vertex.
static String dumpConstraints(org.drools.spi.Constraint[] constraints)
          Constructs constraints string
 org.eclipse.swt.graphics.Color getDrawColor()
          Color used for borders
abstract  org.eclipse.swt.graphics.Color getFillColor()
          Color used for filling vertex figure
abstract  String getHtml()
          HTML formatted representation of this node
 org.eclipse.draw2d.geometry.Point getLocation()
          Return the Location of this vertex.
 org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
          Returns an array of IPropertyDescriptors for this vertex.
 Object getPropertyValue(Object propertyId)
          Return the property value for the given propertyId, or null.
 org.eclipse.draw2d.geometry.Dimension getSize()
          Return the Size of this vertex.
 List getSourceConnections()
          Return a List of outgoing Connections.
 List getTargetConnections()
          Return a List of incoming Connections.
 void removeConnection(Connection conn)
          Remove an incoming or outgoing connection from this vertex.
 void setLocation(org.eclipse.draw2d.geometry.Point newLocation)
          Set the Location of this vertex.
 void setPropertyValue(Object propertyId, Object value)
          Set the property value for the given property id.
 void setSize(org.eclipse.draw2d.geometry.Dimension newSize)
          Set the Size of this vertex.
 String toString()
           
 
Methods inherited from class org.drools.eclipse.editors.rete.model.ModelElement
addPropertyChangeListener, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCATION_PROP

public static final String LOCATION_PROP
Property ID to use when the location of this shape is modified.

See Also:
Constant Field Values

SIZE_PROP

public static final String SIZE_PROP
Property ID to use then the size of this shape is modified.

See Also:
Constant Field Values

SOURCE_CONNECTIONS_PROP

public static final String SOURCE_CONNECTIONS_PROP
Property ID to use when the list of outgoing connections is modified.

See Also:
Constant Field Values

TARGET_CONNECTIONS_PROP

public static final String TARGET_CONNECTIONS_PROP
Property ID to use when the list of incoming connections is modified.

See Also:
Constant Field Values
Constructor Detail

GraphicalVertex

public GraphicalVertex()
Method Detail

getHtml

public abstract String getHtml()
HTML formatted representation of this node

Returns:
#getHtml

getFillColor

public abstract org.eclipse.swt.graphics.Color getFillColor()
Color used for filling vertex figure

Returns:
color

addConnection

public void addConnection(Connection conn)
Add an incoming or outgoing connection to this vertex.

Parameters:
conn - a non-null connection instance
Throws:
IllegalArgumentException - if the connection is null or has not distinct endpoints

getLocation

public org.eclipse.draw2d.geometry.Point getLocation()
Return the Location of this vertex.

Returns:
a non-null copy of location instance

getPropertyDescriptors

public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
Returns an array of IPropertyDescriptors for this vertex.


getPropertyValue

public Object getPropertyValue(Object propertyId)
Return the property value for the given propertyId, or null.


getSize

public org.eclipse.draw2d.geometry.Dimension getSize()
Return the Size of this vertex.

Returns:
a non-null copy of Dimension instance

getSourceConnections

public List getSourceConnections()
Return a List of outgoing Connections.


getTargetConnections

public List getTargetConnections()
Return a List of incoming Connections.


removeConnection

public void removeConnection(Connection conn)
Remove an incoming or outgoing connection from this vertex.

Parameters:
conn - a non-null connection instance
Throws:
IllegalArgumentException - if the parameter is null

setLocation

public void setLocation(org.eclipse.draw2d.geometry.Point newLocation)
Set the Location of this vertex.

Parameters:
newLocation - a non-null Point instance
Throws:
IllegalArgumentException - if the parameter is null

setPropertyValue

public void setPropertyValue(Object propertyId,
                             Object value)
Set the property value for the given property id.


setSize

public void setSize(org.eclipse.draw2d.geometry.Dimension newSize)
Set the Size of this vertex. Will not update the size if newSize is null.

Parameters:
newSize - a non-null Dimension instance or null

toString

public String toString()
Overrides:
toString in class Object

getDrawColor

public org.eclipse.swt.graphics.Color getDrawColor()
Color used for borders

Returns:
draw color

dumpConstraints

public static String dumpConstraints(org.drools.spi.Constraint[] constraints)
Constructs constraints string

Parameters:
constraints - array of constraints
Returns:
html-formatted constraints representation


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.