chemaxon.struc.graphics
Class MRectanglePoint

java.lang.Object
  extended by chemaxon.struc.MObject
      extended by chemaxon.struc.MPoint
          extended by chemaxon.struc.graphics.MRectanglePoint
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
MRectanglePoint.Sticky

public class MRectanglePoint
extends MPoint

Rectangle point object.

Since:
Marvin 3.3, 10/18/2003
Version:
4.1, 05/01/2006
Author:
Peter Csizmadia
See Also:
Serialized Form

Nested Class Summary
static class MRectanglePoint.Sticky
          Fixed rectangle point that can be a point of a polyline.
 
Field Summary
protected  MRectangle parentRect
           
protected  byte positionInRect
           
 
Fields inherited from class chemaxon.struc.MObject
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT
 
Constructor Summary
protected MRectanglePoint(MRectangle r, int i, double x, double y, double z)
          Contructs a rectangle corner point object.
protected MRectanglePoint(MRectanglePoint p)
          Copy constructor.
 
Method Summary
 void addNotify()
          Point added to a document.
 java.lang.Object clone()
          Creates a clone.
 boolean equals(MRectanglePoint o)
          Two rectangle points equal if their parent rectangles are the same and they are on the same corner or edge.
 boolean equals(java.lang.Object o)
          Two rectangle points equal if their parent rectangles are the same and they are on the same corner or edge.
 MRectangle getParentRect()
          Gets the parent rectangle.
 int getPositionInRect()
          Gets the position in the rectangle.
 boolean isChildOf(MObject o)
          Is this object a children of another one?
 boolean isSelectableNow()
          Is the object selectable now?
 boolean isTransformable()
          Is it a transformable object?
 void removeNotify()
          Point removed from a document.
 void setLocation(DPoint3 p, CTransform3D t)
          Sets the coordinates.
 java.lang.String toString()
          Overrides Object.toString() to ease debugging.
 void transform(CTransform3D t, int opts, CTransform3D trot)
          Transforms all points.
 
Methods inherited from class chemaxon.struc.MPoint
calcCenter, distanceFrom, equals, getLocation, getLocation, getLocation, getPoint, getPointCount, getPointRef, getPointRefCount, isInternalSelectable
 
Methods inherited from class chemaxon.struc.MObject
addAttributeKeys, addCdataAttributeKeys, checkValidity, containsAtom, containsPoint, distanceFrom, finishCloning, fixClonedPoints, getAttribute, getBackground, getColor, getLineColor, hasBackground, hasColor, hasLineColor, isEmpty, isReactionArrow, isSelected, makeColor, removeAtom, removeChild, replaceAtom, setAttribute, setBackground, setColor, setLineColor, setSelected, unselectContents, updateBoundingRect
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

positionInRect

protected transient byte positionInRect

parentRect

protected transient MRectangle parentRect
Constructor Detail

MRectanglePoint

protected MRectanglePoint(MRectangle r,
                          int i,
                          double x,
                          double y,
                          double z)
Contructs a rectangle corner point object.

Parameters:
r - the parent rectangle
i - position on the rectangle (0-3)
x - the x coordinate
y - the y coordinate
z - the z coordinate

MRectanglePoint

protected MRectanglePoint(MRectanglePoint p)
Copy constructor.

Parameters:
p - the point
Method Detail

equals

public boolean equals(java.lang.Object o)
Two rectangle points equal if their parent rectangles are the same and they are on the same corner or edge.

Overrides:
equals in class MPoint
Parameters:
o - the other point
Returns:
true if they equal, false otherwise

equals

public boolean equals(MRectanglePoint o)
Two rectangle points equal if their parent rectangles are the same and they are on the same corner or edge.

Parameters:
o - the other point
Returns:
true if they equal, false otherwise

clone

public java.lang.Object clone()
Description copied from class: MObject
Creates a clone.

Overrides:
clone in class MPoint
Returns:
the clone

isSelectableNow

public boolean isSelectableNow()
Description copied from class: MObject
Is the object selectable now?

Overrides:
isSelectableNow in class MObject
Returns:
true for ordinary objects, false for some internal selectables

isChildOf

public boolean isChildOf(MObject o)
Is this object a children of another one?

Overrides:
isChildOf in class MPoint
Parameters:
o - a possible parent
Returns:
true if the other object is the parent rectangle, false otherwise

getPositionInRect

public int getPositionInRect()
Gets the position in the rectangle.

Returns:
the position
Since:
Marvin 4.1, 03/06/2006

getParentRect

public MRectangle getParentRect()
Gets the parent rectangle.

Returns:
the parent rectangle
Since:
Marvin 4.1, 03/06/2006

addNotify

public void addNotify()
Point added to a document.

Overrides:
addNotify in class MObject

removeNotify

public void removeNotify()
Point removed from a document.

Overrides:
removeNotify in class MObject

setLocation

public void setLocation(DPoint3 p,
                        CTransform3D t)
Sets the coordinates.

Overrides:
setLocation in class MPoint
Parameters:
p - the new location
t - the viewing transformation or null

transform

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

Overrides:
transform in class MPoint
Parameters:
t - the transformation matrix
opts - the options
trot - the viewing transformation or null
See Also:
MObject.TRANSFORM_DISTORT

toString

public java.lang.String toString()
Description copied from class: MObject
Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object.

Overrides:
toString in class MObject
Returns:
a string representation of the object

isTransformable

public boolean isTransformable()
Description copied from class: MObject
Is it a transformable object?

Overrides:
isTransformable in class MObject
Returns:
true if the object can be transformed, false otherwise