chemaxon.struc.graphics
Class MChemicalStruct

java.lang.Object
  extended bychemaxon.struc.MObject
      extended bychemaxon.struc.graphics.MChemicalStruct
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class MChemicalStruct
extends MObject

Molecule graph object.

Since:
Marvin 3.3
Version:
3.5, 11/04/2004
Author:
Peter Csizmadia
See Also:
Serialized Form

Field Summary
 
Fields inherited from class chemaxon.struc.MObject
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT
 
Constructor Summary
protected MChemicalStruct(MChemicalStruct mcs)
          Copy constructor.
  MChemicalStruct(MoleculeGraph m)
          Contructs a molecule graph object.
 
Method Summary
 void calcCenter(DPoint3 p)
          Calculates the geometrical center.
 java.lang.Object clone()
          Creates a clone.
 boolean containsAtom(MolAtom a)
          Checks if the atom set contains the specified atom object.
 double distanceFrom(double x, double y, CTransform3D t)
          Gets the 2D distance from the specified point.
 MoleculeGraph getMoleculeGraph()
          Gets the stored molecule graph.
 MPoint getPoint(int i)
          Gets a point of the object.
 int getPointCount()
          Gets the number of points (atoms).
 boolean hasSelection()
          Checks the existence of the selection.
 boolean isEmpty()
          A chemical structure object is empty if the molecule graph is empty.
 void setSelected(boolean s)
          Selects or unselects the object.
 void transform(CTransform3D t, int opts)
          Transforms all points.
 void unselectContents()
          Unselects atoms.
 
Methods inherited from class chemaxon.struc.MObject
addAttributeKeys, addCdataAttributeKeys, addNotify, checkValidity, distanceFrom, finishCloning, getAttribute, getBackground, getColor, getLineColor, getPointRef, getPointRefCount, hasBackground, hasColor, hasLineColor, isChildOf, isInternalSelectable, isSelectableNow, isSelected, isTransformable, makeColor, makeColorString, paint, removeChild, removeNotify, replaceAtom, setAttribute, setBackground, setColor, setLineColor
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MChemicalStruct

public MChemicalStruct(MoleculeGraph m)
Contructs a molecule graph object.

Parameters:
m - the molecule graph

MChemicalStruct

protected MChemicalStruct(MChemicalStruct mcs)
Copy constructor.

Parameters:
mcs - the original object
Method Detail

getMoleculeGraph

public MoleculeGraph getMoleculeGraph()
Gets the stored molecule graph.

Returns:
the molecule graph

clone

public java.lang.Object clone()
Creates a clone.

Specified by:
clone in class MObject
Returns:
the clone

isEmpty

public boolean isEmpty()
A chemical structure object is empty if the molecule graph is empty.

Overrides:
isEmpty in class MObject
Returns:
true if empty, false otherwise

getPointCount

public int getPointCount()
Gets the number of points (atoms).

Specified by:
getPointCount in class MObject
Returns:
the number of points

getPoint

public MPoint getPoint(int i)
Gets a point of the object.

Specified by:
getPoint in class MObject
Parameters:
i - the point index
Returns:
the point's clone

containsAtom

public boolean containsAtom(MolAtom a)
Checks if the atom set contains the specified atom object.

Overrides:
containsAtom in class MObject
Returns:
true if the atom set contains the specified object, false otherwise
Since:
Marvin 3.5, 07/04/2004

transform

public void transform(CTransform3D t,
                      int opts)
Transforms all points.

Specified by:
transform in class MObject
Parameters:
t - the transformation matrix
opts - transform options or 0
See Also:
MObject.TRANSFORM_DISTORT

calcCenter

public void calcCenter(DPoint3 p)
Calculates the geometrical center.

Specified by:
calcCenter in class MObject
Parameters:
p - store the coordinates here

distanceFrom

public double distanceFrom(double x,
                           double y,
                           CTransform3D t)
Gets the 2D distance from the specified point.

Specified by:
distanceFrom in class MObject
Parameters:
x - the x coordinate
y - the y coordinate
t - transformation or null
Since:
3.5, 11/04/2004

setSelected

public void setSelected(boolean s)
Selects or unselects the object.

Overrides:
setSelected in class MObject
Parameters:
s - use true to select, false to unselect

hasSelection

public boolean hasSelection()
Checks the existence of the selection.

Returns:
true if selection exists, false otherwise

unselectContents

public void unselectContents()
Unselects atoms.

Overrides:
unselectContents in class MObject