chemaxon.struc.graphics
Class MMidPoint

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

public class MMidPoint
extends MPoint

Middle point in a line.

Since:
Marvin 4.1, 04/26/2006
Version:
4.1, 04/28/2006
Author:
Peter Csizmadia
See Also:
Serialized Form

Nested Class Summary
static class MMidPoint.Sticky
          Fixed middle point that can be a point of a polyline.
 
Field Summary
protected  MPolyline parentLine
           
protected  int polylinePointIndex
           
 
Fields inherited from class chemaxon.struc.MObject
PAINT_ANTIALIAS, PAINT_FOCUSED, TRANSFORM_DISTORT
 
Constructor Summary
protected MMidPoint(MMidPoint p)
          Copy constructor.
protected MMidPoint(MPolyline l, int i, double x, double y, double z)
          Contructs a middle point object.
 
Method Summary
 void addNotify()
          Point added to a document.
 java.lang.Object clone()
          Creates a clone.
 boolean equals(MMidPoint o)
          Two midpoints equal if their parent lines are the same and the polyline point indices also equal.
 boolean equals(java.lang.Object o)
          Two midpoints equal if their parent lines are the same and the polyline point indices also equal.
protected  void getFixedLocation(DPoint3 q, CTransform3D t)
          Gets the fixed location in the polyline.
 void getLocation(DPoint3 q, CTransform3D t)
          Gets the location.
 MPolyline getParentLine()
          Gets the parent line.
 int getPositionInPolyline()
          Gets the position in the polyline.
 boolean isChildOf(MObject o)
          Is this object a children of another one?
 boolean isSelectableNow()
          Is the object selectable now?
 void removeNotify()
          Point removed from a document.
 void setLocation(DPoint3 p, CTransform3D trot)
          Sets the location
 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, 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, isTransformable, 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

polylinePointIndex

protected transient int polylinePointIndex

parentLine

protected transient MPolyline parentLine
Constructor Detail

MMidPoint

protected MMidPoint(MPolyline l,
                    int i,
                    double x,
                    double y,
                    double z)
Contructs a middle point object.

Parameters:
l - the parent polyline
i - polyline point index
x - the x coordinate
y - the y coordinate
z - the z coordinate

MMidPoint

protected MMidPoint(MMidPoint p)
Copy constructor.

Parameters:
p - the point
Method Detail

equals

public boolean equals(java.lang.Object o)
Two midpoints equal if their parent lines are the same and the polyline point indices also equal.

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

equals

public boolean equals(MMidPoint o)
Two midpoints equal if their parent lines are the same and the polyline point indices also equal.

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 line, false otherwise

getPositionInPolyline

public int getPositionInPolyline()
Gets the position in the polyline.

Returns:
the position

getParentLine

public MPolyline getParentLine()
Gets the parent line.

Returns:
the parent line

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

getLocation

public void getLocation(DPoint3 q,
                        CTransform3D t)
Gets the location.

Overrides:
getLocation in class MPoint
Parameters:
q - the output point object
t - the transformation matrix or null

getFixedLocation

protected void getFixedLocation(DPoint3 q,
                                CTransform3D t)
Gets the fixed location in the polyline.

Parameters:
q - the output point object
t - the transformation matrix or null

setLocation

public void setLocation(DPoint3 p,
                        CTransform3D trot)
Sets the location

Overrides:
setLocation in class MPoint
Parameters:
p - the new location
trot - 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 transform options
trot - the viewing transformation or null
See Also:
MObject.TRANSFORM_DISTORT

toString

public java.lang.String toString()
Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@', the unsigned hexadecimal representation of the hash code of the object and location information in square brackets. The location information consists of the parent polyline's toString representation and the section index, separated by a comma.

Overrides:
toString in class MObject
Returns:
a string representation of the object
Since:
Marvin 4.1, 05/01/2006