org.molwind.chemical.model
Class ChemicalEntity

java.lang.Object
  extended by org.molwind.model.BaseWorldEntity
      extended by org.molwind.model.PlacedWorldEntity
          extended by org.molwind.chemical.model.ChemicalEntity
All Implemented Interfaces:
Place, WorldEntity

public class ChemicalEntity
extends PlacedWorldEntity

ChemicalEntity represents a chemical entity in a Molwind world.

Version:
1.0
Author:
Oliver Karch

Field Summary
 
Fields inherited from class org.molwind.model.PlacedWorldEntity
x, y
 
Fields inherited from class org.molwind.model.BaseWorldEntity
relationships
 
Constructor Summary
ChemicalEntity()
          Creates a new empty chemical entity.
ChemicalEntity(org.openscience.cdk.interfaces.IMolecule newMolecule)
          Creates a new empty chemical entity.
 
Method Summary
 void addRelationship(Relationship relation)
          Adds a new relationship if it is not existing already.
 boolean equals(java.lang.Object object)
          Tests whether two objects are identical by using the Identity strategy which has been provided (optionally).
 java.lang.String getAttribute(java.lang.String name)
          Returns the value of the attribute with the given name.
 int getDimension()
          Returns int for the bigness of the entity
 java.awt.image.BufferedImage getDrawing()
          Renders an image representation of this entity.
 Identity getIdentity()
          Get the Identity value.
 org.openscience.cdk.interfaces.IMolecule getMolecule()
          Return the molecule object
 MoleculeRenderer getMoleculeRenderer()
          Get the MoleculeRenderer value.
 double getX()
          Get the X value.
 double getY()
          Get the Y value.
 int hashCode()
          Returns a hash code value for this relationship.
 Relationship[] hasRelationship(ChemicalEntity entity)
          Tests whether there are relationships between this entity and the given entity.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Sets the value of the attribute with the given name.
 void setIdentity(Identity newIdentity)
          Set the Identity value.
 void setMolecule(org.openscience.cdk.interfaces.IMolecule mol)
          Sets the molecule object
 void setMoleculeRenderer(MoleculeRenderer newMoleculeRenderer)
          Set the MoleculeRenderer value.
 void setX(double newX)
          Set the X value.
 void setY(double newY)
          Set the Y value.
 
Methods inherited from class org.molwind.model.PlacedWorldEntity
getLayer, setDeltaX, setDeltaY, setLayer
 
Methods inherited from class org.molwind.model.BaseWorldEntity
existRelationship, getRelationship, getRelationships, putAttribute
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChemicalEntity

public ChemicalEntity()
Creates a new empty chemical entity.


ChemicalEntity

public ChemicalEntity(org.openscience.cdk.interfaces.IMolecule newMolecule)
Creates a new empty chemical entity.

Parameters:
newMolecule - the new molecule value
Method Detail

getIdentity

public Identity getIdentity()
Get the Identity value.

Returns:
the Identity value

setIdentity

public void setIdentity(Identity newIdentity)
Set the Identity value.

Parameters:
newIdentity - the new Identity value

addRelationship

public void addRelationship(Relationship relation)
Adds a new relationship if it is not existing already.

Overrides:
addRelationship in class BaseWorldEntity
Parameters:
relation - the relationship

hasRelationship

public Relationship[] hasRelationship(ChemicalEntity entity)
Tests whether there are relationships between this entity and the given entity.

Parameters:
entity - the entity to test relationship
Returns:
an array of relationship objects (which can be empty)

getMoleculeRenderer

public MoleculeRenderer getMoleculeRenderer()
Get the MoleculeRenderer value.

Returns:
the MoleculeRenderer value

setMoleculeRenderer

public void setMoleculeRenderer(MoleculeRenderer newMoleculeRenderer)
Set the MoleculeRenderer value.

Parameters:
newMoleculeRenderer - the new MoleculeRenderer value

getDrawing

public java.awt.image.BufferedImage getDrawing()
Renders an image representation of this entity.

Returns:
an empty image

equals

public boolean equals(java.lang.Object object)
Tests whether two objects are identical by using the Identity strategy which has been provided (optionally).

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to compare to
Returns:
true if this object equals to the given object

hashCode

public int hashCode()
Returns a hash code value for this relationship. The method must be defined, because this class overrides equals(Object).

TODO Auto-generated hashCode() method

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object

getMolecule

public org.openscience.cdk.interfaces.IMolecule getMolecule()
Return the molecule object

Returns:
IMolecule

setMolecule

public void setMolecule(org.openscience.cdk.interfaces.IMolecule mol)
Sets the molecule object

Parameters:
IMolecule -

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Returns the value of the attribute with the given name.

Specified by:
getAttribute in interface WorldEntity
Overrides:
getAttribute in class BaseWorldEntity
Parameters:
name - the name of the attribute
Returns:
the value of the attribute

getDimension

public int getDimension()
Returns int for the bigness of the entity

Specified by:
getDimension in interface WorldEntity
Overrides:
getDimension in class BaseWorldEntity
Returns:
the bigness of the entity

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Sets the value of the attribute with the given name.

Parameters:
name - the name of the attribute
value - the value of the attribute

getX

public double getX()
Get the X value.

Specified by:
getX in interface Place
Overrides:
getX in class PlacedWorldEntity
Returns:
the X value.

setX

public void setX(double newX)
Set the X value.

Overrides:
setX in class PlacedWorldEntity
Parameters:
newX - The new X value.

getY

public double getY()
Get the Y value.

Specified by:
getY in interface Place
Overrides:
getY in class PlacedWorldEntity
Returns:
the Y value.

setY

public void setY(double newY)
Set the Y value.

Overrides:
setY in class PlacedWorldEntity
Parameters:
newY - The new Y value.


Copyright © 2008-2010. All Rights Reserved.