Class 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:
  • Field Details

    • polylinePointIndex

      protected transient int polylinePointIndex
    • parentLine

      protected transient MPolyline parentLine
  • Constructor Details

    • 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 Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class MPoint
    • equals

      public boolean equals(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
    • clone

      public MMidPoint 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(MDocument doc)
      Point added to a document.
      Overrides:
      addNotify in class MObject
      Parameters:
      doc - The document the object is being added to.
    • removeNotify

      public void removeNotify(MDocument doc)
      Point removed from a document.
      Overrides:
      removeNotify in class MObject
      Parameters:
      doc - The document from which the object is removed.
    • 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:
    • 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.
      Overrides:
      toString in class MPoint
      Returns:
      a string representation of the object
      Since:
      Marvin 4.1, 05/01/2006