GraphLab Project

graphlab.graph.graph
Class VertexModel

java.lang.Object
  extended by graphlab.library.BaseVertex
      extended by graphlab.graph.graph.VertexModel

public class VertexModel
extends BaseVertex

Authors: Azin Azadi,Roozbeh


Field Summary
 boolean isSelected
           
 GShape shape
           
 VertexModelListener view
           
 
Fields inherited from class graphlab.library.BaseVertex
prop
 
Constructor Summary
VertexModel()
           
VertexModel(VertexModel v)
          copy constructor creates a copy (clone) of v
 
Method Summary
static void addGlobalUserDefinedAttribute(java.lang.String name, java.lang.Object defaultvalue)
          sets and stores a global user defined attribute for the vertex.
 java.awt.geom.Rectangle2D.Double getBounds()
           
 java.awt.Point getCenter()
           
 VertexModel getCopy()
           
 java.lang.String getLabel()
           
 GraphPoint getLabelLocation()
           
 GraphPoint getLocation()
           
 GShape getShape()
           
 GStroke getShapeStroke()
           
 GraphPoint getSize()
           
<t> t
getUserDefinedAttribute(java.lang.String name)
          returns the specified user defined attribute, or null if it does not exists.
 java.util.HashMap<java.lang.String,java.lang.Object> getUserDefinedAttributes()
           
 boolean isSelected()
           
static void removeGlobalUserDefinedAttribute(java.lang.String name)
           
 void removeUserDefinedAttribute(java.lang.String name)
          removes the given attribute from the list of user defined attributes
 void repaint()
           
 void setColor(int color)
          Sets the color of the vertex.
 void setLabel(java.lang.String label)
           
 void setLabelLocation(GraphPoint graphPoint)
           
 void setLocation(GraphPoint p)
           
 void setLocation(java.awt.Point p)
           
 void setMark(boolean mark)
          Flag whether it is marked.
 void setProp(BaseVertexProperties prop)
          Sets properties object for this vertex; Overwrites the existing.
 void setSelected(boolean selected)
           
 void setShape(GShape shape)
           
 void setShapeStroke(GStroke stroke)
           
 void setSize(GraphPoint size)
           
 void setUserDefinedAttribute(java.lang.String name, java.lang.Object value)
          sets and stores a user defined attribute for the vertex.
 void setVertexListener(VertexModelListener listener)
           
 java.lang.String toString()
           
 
Methods inherited from class graphlab.library.BaseVertex
getColor, getId, getMark, getProp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

view

public VertexModelListener view

shape

public GShape shape

isSelected

public boolean isSelected
Constructor Detail

VertexModel

public VertexModel(VertexModel v)
copy constructor creates a copy (clone) of v

Parameters:
v -

VertexModel

public VertexModel()
Method Detail

setUserDefinedAttribute

public void setUserDefinedAttribute(java.lang.String name,
                                    java.lang.Object value)
sets and stores a user defined attribute for the vertex. here you can put any attribute you like that are not available in the standard attributes. your attributes will be editable in property editor part of GUI. Use this method carefully. user defined attributes are stored in HashMap and bad use of them will cause memory leak in large graphs

Parameters:
name -
value -

getUserDefinedAttribute

public <t> t getUserDefinedAttribute(java.lang.String name)
returns the specified user defined attribute, or null if it does not exists.

Parameters:
name -
Returns:

removeUserDefinedAttribute

public void removeUserDefinedAttribute(java.lang.String name)
removes the given attribute from the list of user defined attributes

Parameters:
name -

getUserDefinedAttributes

public java.util.HashMap<java.lang.String,java.lang.Object> getUserDefinedAttributes()
Returns:
a HashMap containing all user defined attributes.

addGlobalUserDefinedAttribute

public static void addGlobalUserDefinedAttribute(java.lang.String name,
                                                 java.lang.Object defaultvalue)
sets and stores a global user defined attribute for the vertex. this attributes will be added to each vertex on constructing time using setUserDefinedAttribute method.

note that this method only affects the afterward created vertices, and current vertices will not affected by this method.


removeGlobalUserDefinedAttribute

public static void removeGlobalUserDefinedAttribute(java.lang.String name)
See Also:
addGlobalUserDefinedAttribute(java.lang.String, java.lang.Object)

getCopy

public VertexModel getCopy()
Overrides:
getCopy in class BaseVertex

toString

public java.lang.String toString()
Overrides:
toString in class BaseVertex

setMark

public void setMark(boolean mark)
Description copied from class: BaseVertex
Flag whether it is marked.

Overrides:
setMark in class BaseVertex
Parameters:
mark - whether the vertex is marked.

setVertexListener

public void setVertexListener(VertexModelListener listener)

setProp

public void setProp(BaseVertexProperties prop)
Description copied from class: BaseVertex
Sets properties object for this vertex; Overwrites the existing.

Overrides:
setProp in class BaseVertex
Parameters:
prop - The property object to set.

getCenter

public java.awt.Point getCenter()
Returns:
the center point of the vertex

setLocation

public void setLocation(java.awt.Point p)

setLocation

public void setLocation(GraphPoint p)

getLocation

public GraphPoint getLocation()
Returns:
the location of the vertex. it is the center of vertex

getLabel

public java.lang.String getLabel()

setLabel

public void setLabel(java.lang.String label)

setShape

public void setShape(GShape shape)

getShape

public GShape getShape()

setShapeStroke

public void setShapeStroke(GStroke stroke)

getShapeStroke

public GStroke getShapeStroke()

setSize

public void setSize(GraphPoint size)

getSize

public GraphPoint getSize()

getBounds

public java.awt.geom.Rectangle2D.Double getBounds()

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean selected)

repaint

public void repaint()

setLabelLocation

public void setLabelLocation(GraphPoint graphPoint)

getLabelLocation

public GraphPoint getLabelLocation()

setColor

public void setColor(int color)
Description copied from class: BaseVertex
Sets the color of the vertex.

Overrides:
setColor in class BaseVertex
Parameters:
color - Sets col as the color of the vertex.

GraphLab Project