Package chemaxon.struc.graphics
Class MMidPoint
- java.lang.Object
-
- chemaxon.struc.MObject
-
- chemaxon.struc.MPoint
-
- chemaxon.struc.graphics.MMidPoint
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
MMidPoint.Sticky
@PublicAPI public class MMidPoint extends MPoint
Middle point in a line.- Since:
- Marvin 4.1, 04/26/2006
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MMidPoint.Sticky
Fixed middle point that can be a point of a polyline.
-
Field Summary
Fields Modifier and Type Field Description protected MPolyline
parentLine
protected int
polylinePointIndex
-
Fields inherited from class chemaxon.struc.MObject
TRANSFORM_DISTORT
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNotify(MDocument doc)
Point added to a document.MMidPoint
clone()
Creates a clone.boolean
equals(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(MDocument doc)
Point removed from a document.void
setLocation(DPoint3 p, CTransform3D trot)
Sets the locationString
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, getLocation, getLocation, getPoint, getPointCount, getPointRef, getPointRefCount, hashCode, isInternalSelectable
-
Methods inherited from class chemaxon.struc.MObject
addAttributeKeys, addCdataAttributeKeys, checkValidity, connectToSgroupOfAtom, containsAtom, containsPoint, distanceFrom, finishCloning, fixClonedPoints, getAttribute, getBackground, getColor, getContainerMObject, getLineColor, hasBackground, hasColor, hasLineColor, isEmpty, isReactionArrow, isSelected, isTransformable, makeColor, removeAtom, removeChild, replaceAtom, setAttribute, setBackground, setColor, setLineColor, setSelected, unselectContents, updateBoundingRect, updateBoundingRect
-
-
-
-
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 polylinei
- polyline point indexx
- the x coordinatey
- the y coordinatez
- the z coordinate
-
MMidPoint
protected MMidPoint(MMidPoint p)
Copy constructor.- Parameters:
p
- the point
-
-
Method Detail
-
equals
public boolean equals(Object o)
Two midpoints equal if their parent lines are the same and the polyline point indices also equal.
-
isSelectableNow
public boolean isSelectableNow()
Description copied from class:MObject
Is the object selectable now?- Overrides:
isSelectableNow
in classMObject
- Returns:
- true for ordinary objects, false for some internal selectables
-
isChildOf
public boolean isChildOf(MObject o)
Is this object a children of another one?
-
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(MDocument doc)
Point added to a document.
-
removeNotify
public void removeNotify(MDocument doc)
Point removed from a document.- Overrides:
removeNotify
in classMObject
- Parameters:
doc
- The document from which the object is removed.
-
getLocation
public void getLocation(DPoint3 q, CTransform3D t)
Gets the location.- Overrides:
getLocation
in classMPoint
- Parameters:
q
- the output point objectt
- 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 objectt
- the transformation matrix or null
-
setLocation
public void setLocation(DPoint3 p, CTransform3D trot)
Sets the location- Overrides:
setLocation
in classMPoint
- Parameters:
p
- the new locationtrot
- the viewing transformation or null
-
transform
public void transform(CTransform3D t, int opts, CTransform3D trot)
Transforms all points.- Overrides:
transform
in classMPoint
- Parameters:
t
- the transformation matrixopts
- the transform optionstrot
- the viewing transformation or null- See Also:
MObject.TRANSFORM_DISTORT
-
toString
public 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.
-
-