jcreek.gui.conceptmap
Class VisualEntity

java.lang.Object
  extended byjcreek.util.graph.Node
      extended byjcreek.gui.conceptmap.VisualEntity
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class VisualEntity
extends Node

See Also:
Serialized Form

Field Summary
 
Fields inherited from class jcreek.util.graph.Node
graph
 
Constructor Summary
VisualEntity(Entity entity, int startX, int startY)
          Creates a new VisualEntity.
VisualEntity(Entity entity, java.awt.Point pos)
          Creates a new VisualEntity.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this node.
 boolean equals(java.lang.Object ob)
          Two VisualEntities are considered equal if they encapsulate the same Creek Entity.
 Entity getEntity()
          Returns the Creek Entity this VisualEntity encapsulates.
 int hashCode()
          Overridden to fulfill hasCode contract as equals() is overridden.
 boolean isSelected()
          Returns true if this VisualEntity is part of the selection set of the current graph.
 boolean represents(Entity e)
          Returns true if this VisualEntity is a representation of the given entity, i.e. if getEntity().equals(e).
 void setSelected(boolean selected)
          Add this entity to the selected set of entities in the current graph.
 java.lang.String toString()
          Returns a string representation of this VisualEntity, including the name of the underlaying entity and the position of the node.
 
Methods inherited from class jcreek.util.graph.Node
addEdge, addEdgeP, edgeSize, getEdgeIterator, getGraph, getPosition, remove, removeEdge, removeEdgeP, removeP, setPosition, setPosition, suspendEventReport, translate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VisualEntity

public VisualEntity(Entity entity,
                    int startX,
                    int startY)
Creates a new VisualEntity.

Parameters:
entity - The entity in a KnowledgeModel represented by this VisualEntity.
startX - The x coordinate in a 2-d space representing the initial position of the VisualEntity.
startY - The y coordinate in a 2-d space representing the initial position of the VisualEntity.

VisualEntity

public VisualEntity(Entity entity,
                    java.awt.Point pos)
Creates a new VisualEntity.

Parameters:
entity - The entity in a KnowledgeModel represented by this VisualEntity.
pos - The point in a 2-d space representing the initial position of the VisualEntity.
Method Detail

represents

public boolean represents(Entity e)
Returns true if this VisualEntity is a representation of the given entity, i.e. if getEntity().equals(e).


clone

public java.lang.Object clone()
Description copied from class: Node
Returns a clone of this node.

Overrides:
clone in class Node

setSelected

public void setSelected(boolean selected)
Add this entity to the selected set of entities in the current graph.


isSelected

public boolean isSelected()
Returns true if this VisualEntity is part of the selection set of the current graph.


getEntity

public Entity getEntity()
Returns the Creek Entity this VisualEntity encapsulates.


hashCode

public int hashCode()
Overridden to fulfill hasCode contract as equals() is overridden.


equals

public boolean equals(java.lang.Object ob)
Two VisualEntities are considered equal if they encapsulate the same Creek Entity.


toString

public java.lang.String toString()
Returns a string representation of this VisualEntity, including the name of the underlaying entity and the position of the node.



Created at IDI, NTNU by the Artificial Intelligence and Learning group