|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchemaxon.struc.MObject
public abstract class MObject
Paintable object. This class and its subclasses are under development, use them at your own risk!
Field Summary | |
---|---|
static int |
PAINT_ANTIALIAS
Antialias flag. |
static int |
PAINT_FOCUSED
Input focus on the component (MTextBox). |
static int |
TRANSFORM_DISTORT
Distorting transformations are allowed. |
Constructor Summary | |
---|---|
protected |
MObject(java.awt.Color c,
java.awt.Color lc,
java.awt.Color bg)
Contructs a paintable object with the specified color. |
protected |
MObject(MObject o)
Copy constructor. |
Method Summary | |
---|---|
void |
addAttributeKeys(java.util.List<java.lang.String> l)
Adds the attribute names to the specified list. |
void |
addCdataAttributeKeys(java.util.List<java.lang.String> l)
Adds attribute names to the specified list. |
void |
addNotify()
Called when the object is added to a document. |
abstract void |
calcCenter(DPoint3 p,
CTransform3D t)
Calculates the geometrical center. |
boolean |
checkValidity(MDocument doc,
java.util.Collection<MolAtom> invec)
Is it a valid object in the document? |
abstract java.lang.Object |
clone()
Creates a clone. |
boolean |
containsAtom(MolAtom a)
Checks if the object contains the specified atom reference. |
boolean |
containsPoint(DPoint3 p,
CTransform3D trot)
|
double |
distanceFrom(double x,
double y)
Gets the 2D distance from the specified point. |
abstract double |
distanceFrom(double x,
double y,
CTransform3D t)
Gets the 2D distance from the specified point. |
void |
finishCloning(MDocument olddoc,
MDocument newdoc)
Finish cloning a document. |
void |
fixClonedPoints(MObject[] objarr0,
MObject[] objarr,
int i)
Sets the parent object for this object. |
java.lang.String |
getAttribute(java.lang.String s)
Gets the value of an attribute. |
java.awt.Color |
getBackground()
Gets the background color of the object. |
java.awt.Color |
getColor()
Gets the color of the object. |
java.awt.Color |
getLineColor()
Gets the line color of the object. |
abstract MPoint |
getPoint(int i)
Gets a point of the object. |
abstract int |
getPointCount()
Gets the number of points. |
MPoint |
getPointRef(int i,
CTransform3D trot)
Gets a reference to a point of the object. |
int |
getPointRefCount()
Gets the number of point references. |
boolean |
hasBackground()
Can the object have a background? |
boolean |
hasColor()
Can the object have a color (non-line and non-background)? |
boolean |
hasLineColor()
Can the object have a line color? |
boolean |
isChildOf(MObject o)
Is this object a children of another one? |
boolean |
isEmpty()
An object may become empty if all the children are removed. |
boolean |
isInternalSelectable()
Is it a selection only internal object? |
boolean |
isReactionArrow(MoleculeGraph mol)
|
boolean |
isSelectableNow()
Is the object selectable now? |
boolean |
isSelected()
Is the object selected? |
boolean |
isTransformable()
Is it a transformable object? |
protected static java.awt.Color |
makeColor(java.lang.String s)
|
void |
removeAtom(MolAtom atom)
Removes the atom from the corresponding molecule object. |
void |
removeChild(MObject o)
Removes a child object. |
void |
removeNotify()
Called when the object is removed from a document. |
void |
replaceAtom(MolAtom orig,
MolAtom a)
Replaces a contained atom with another one. |
void |
setAttribute(java.lang.String s,
java.lang.String v)
Sets the value of an attribute. |
void |
setBackground(java.awt.Color c)
Sets the background color of the object. |
void |
setColor(java.awt.Color c)
Sets the color of the object. |
void |
setLineColor(java.awt.Color c)
Sets the color of the object. |
void |
setSelected(boolean s)
Selects or unselects the object. |
java.lang.String |
toString()
Overrides Object.toString() to ease debugging. |
abstract void |
transform(CTransform3D t,
int opts,
CTransform3D trot)
Transforms the object. |
void |
unselectContents()
Unselects sub-objects. |
void |
updateBoundingRect(double[] xyminm,
CTransform3D pretrf)
Calculate the bounding rectangle. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int PAINT_ANTIALIAS
public static final int PAINT_FOCUSED
public static final int TRANSFORM_DISTORT
Constructor Detail |
---|
protected MObject(java.awt.Color c, java.awt.Color lc, java.awt.Color bg)
lc
- the line color or null to use the defaultbg
- the background colorprotected MObject(MObject o)
Method Detail |
---|
public abstract java.lang.Object clone()
clone
in class java.lang.Object
public boolean isEmpty()
public boolean isChildOf(MObject o)
o
- a possible parent
public boolean checkValidity(MDocument doc, java.util.Collection<MolAtom> invec)
doc
- the documentinvec
- collection of invalid atoms or null
public void removeChild(MObject o)
o
- the childpublic boolean containsAtom(MolAtom a)
public void replaceAtom(MolAtom orig, MolAtom a)
orig
- the original atoma
- the new atompublic boolean isTransformable()
public boolean isInternalSelectable()
public boolean isSelectableNow()
public void addNotify()
public void removeNotify()
public abstract int getPointCount()
public abstract MPoint getPoint(int i)
i
- the point index
public int getPointRefCount()
public void updateBoundingRect(double[] xyminm, CTransform3D pretrf)
xyminm
- array containing the current minimum x, y and maximum x, y
coordinatespretrf
- transformation matrixpublic MPoint getPointRef(int i, CTransform3D trot)
i
- the point indextrot
- the viewing transformation or null
public void addAttributeKeys(java.util.List<java.lang.String> l)
l
- the listpublic void addCdataAttributeKeys(java.util.List<java.lang.String> l)
l
- the listpublic java.lang.String getAttribute(java.lang.String s)
s
- the attribute name
public void setAttribute(java.lang.String s, java.lang.String v)
s
- the attribute namev
- the attribute valuepublic abstract void transform(CTransform3D t, int opts, CTransform3D trot)
t
- the transformation matrixopts
- transform options or 0trot
- the viewing transformation or nullTRANSFORM_DISTORT
public abstract void calcCenter(DPoint3 p, CTransform3D t)
p
- store the coordinates heret
- the transformation matrix or nullpublic double distanceFrom(double x, double y)
x
- the x coordinatey
- the y coordinatepublic abstract double distanceFrom(double x, double y, CTransform3D t)
x
- the x coordinatey
- the y coordinatet
- transformation or nullpublic boolean containsPoint(DPoint3 p, CTransform3D trot)
public boolean isSelected()
public void setSelected(boolean s)
s
- use true to select, false to unselectpublic boolean isReactionArrow(MoleculeGraph mol)
public void unselectContents()
public java.awt.Color getColor()
public void setColor(java.awt.Color c)
c
- the color or null to use the defaultpublic java.awt.Color getLineColor()
public void setLineColor(java.awt.Color c)
c
- the color or nullpublic boolean hasColor()
public boolean hasLineColor()
public boolean hasBackground()
public java.awt.Color getBackground()
public void setBackground(java.awt.Color c)
c
- the colorpublic void finishCloning(MDocument olddoc, MDocument newdoc)
public java.lang.String toString()
@
', and the unsigned hexadecimal representation
of the hash code of the object.
toString
in class java.lang.Object
protected static java.awt.Color makeColor(java.lang.String s)
public void removeAtom(MolAtom atom)
atom
- the atom to removepublic void fixClonedPoints(MObject[] objarr0, MObject[] objarr, int i)
objarr0
- the new object listobjarr
- the old object listi
- the corresponding index from the old object list
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |