Class CurvedPolygon

java.lang.Object
org.eclipse.gef.geometry.planar.CurvedPolygon
All Implemented Interfaces:
Serializable, Cloneable, IGeometry, IRotatable<CurvedPolygon>, IScalable<CurvedPolygon>, IShape, ITranslatable<CurvedPolygon>

public class CurvedPolygon extends Object implements IShape, ITranslatable<CurvedPolygon>, IRotatable<CurvedPolygon>, IScalable<CurvedPolygon>
A CurvedPolygon is an IShape with BezierCurve edges.
See Also:
  • Constructor Details

  • Method Details

    • contains

      public boolean contains(IGeometry g)
      Description copied from interface: IShape
      Tests whether the given IGeometry is fully contained by this IShape.
      Specified by:
      contains in interface IShape
      Parameters:
      g - The IGeometry to test for containment
      Returns:
      true if the given IGeometry is fully contained by this IShape, false otherwise.
    • contains

      public boolean contains(Point p)
      Description copied from interface: IGeometry
      Returns whether the given Point is contained within this IGeometry. This includes the case that the Point lies on the border of this IGeometry.
      Specified by:
      contains in interface IGeometry
      Parameters:
      p - The Point being tested for containment
      Returns:
      true if the Point is contained within this IGeometry, false otherwise.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getBounds

      public Rectangle getBounds()
      Description copied from interface: IGeometry
      Returns the smallest Rectangle fully enclosing this IGeometry.
      Specified by:
      getBounds in interface IGeometry
      Returns:
      A new Rectangle object that fully encloses this IGeometry
    • getCenter

      public Point getCenter()
      Returns an approximated center Point of this CurvedPolygon.
      Returns:
      an approximated center Point of this CurvedPolygon
    • getCopy

      public CurvedPolygon getCopy()
      Description copied from interface: IGeometry
      Returns a new identical copy of this IGeometry.
      Specified by:
      getCopy in interface IGeometry
      Returns:
      a copy identical to this IGeometry
    • getOutline

      public PolyBezier getOutline()
      Description copied from interface: IShape
      Returns an ICurve representing the outline of this IShape .
      Specified by:
      getOutline in interface IShape
      Returns:
      An ICurve representing this IShape's outline.
    • getOutlineSegments

      public BezierCurve[] getOutlineSegments()
      Description copied from interface: IShape
      Returns the individual ICurve segments, which constitute the outline of this IShape.
      Specified by:
      getOutlineSegments in interface IShape
      Returns:
      The ICurve segments of this IShape's outline.
    • getRotatedCCW

      public CurvedPolygon getRotatedCCW(Angle angle)
      Description copied from interface: IRotatable
      Rotates the calling object by specified Angle counter-clock-wise (CCW) around its center Point. Does not necessarily return an object of the same type.
      Specified by:
      getRotatedCCW in interface IRotatable<CurvedPolygon>
      Parameters:
      angle - rotation Angle
      Returns:
      an IGeometry representing the result of the rotation
    • getRotatedCCW

      public CurvedPolygon getRotatedCCW(Angle angle, double cx, double cy)
      Description copied from interface: IRotatable
      Rotates the calling object by the specified Angle counter-clock-wise (CCW) around the specified center Point (cx, cy). Does not necessarily return an object of the same type.
      Specified by:
      getRotatedCCW in interface IRotatable<CurvedPolygon>
      Parameters:
      angle - rotation Angle
      cx - x-coordinate of the relative Point for the rotation
      cy - y-coordinate of the relative Point for the rotation
      Returns:
      an IGeometry representing the result of the rotation
    • getRotatedCCW

      public CurvedPolygon getRotatedCCW(Angle angle, Point center)
      Description copied from interface: IRotatable
      Rotates the calling object by the specified Angle counter-clock-wise (CCW) around the specified center Point. Does not necessarily return an object of the same type.
      Specified by:
      getRotatedCCW in interface IRotatable<CurvedPolygon>
      Parameters:
      angle - rotation Angle
      center - relative Point for the rotation
      Returns:
      an IGeometry representing the result of the rotation
    • getRotatedCW

      public CurvedPolygon getRotatedCW(Angle angle)
      Description copied from interface: IRotatable
      Rotates the calling object by specified Angle clock-wise (CW) around its center Point. Does not necessarily return an object of the same type.
      Specified by:
      getRotatedCW in interface IRotatable<CurvedPolygon>
      Parameters:
      angle - rotation Angle
      Returns:
      an IGeometry representing the result of the rotation
    • getRotatedCW

      public CurvedPolygon getRotatedCW(Angle angle, double cx, double cy)
      Description copied from interface: IRotatable
      Rotates the calling object by the specified Angle clock-wise (CW) around the specified center Point (cx, cy). Does not necessarily return an object of the same type.
      Specified by:
      getRotatedCW in interface IRotatable<CurvedPolygon>
      Parameters:
      angle - rotation Angle
      cx - x-coordinate of the relative Point for the rotation
      cy - y-coordinate of the relative Point for the rotation
      Returns:
      an IGeometry representing the result of the rotation
    • getRotatedCW

      public CurvedPolygon getRotatedCW(Angle angle, Point center)
      Description copied from interface: IRotatable
      Rotates the calling object by the specified Angle clock-wise (CW) around the specified center Point. Does not necessarily return an object of the same type.
      Specified by:
      getRotatedCW in interface IRotatable<CurvedPolygon>
      Parameters:
      angle - rotation Angle
      center - relative Point for the rotation
      Returns:
      an IGeometry representing the result of the rotation
    • getScaled

      public CurvedPolygon getScaled(double factor)
      Description copied from interface: IScalable
      Scales a copy of the calling object by the given factor relative to its center Point.
      Specified by:
      getScaled in interface IScalable<CurvedPolygon>
      Parameters:
      factor - scale-factor
      Returns:
      the new, scaled object
    • getScaled

      public CurvedPolygon getScaled(double fx, double fy)
      Description copied from interface: IScalable
      Scales a copy of the calling object by the given factors relative to its center Point.
      Specified by:
      getScaled in interface IScalable<CurvedPolygon>
      Parameters:
      fx - x-scale-factor
      fy - y-scale-factor
      Returns:
      the new, scaled object
    • getScaled

      public CurvedPolygon getScaled(double factor, double cx, double cy)
      Description copied from interface: IScalable
      Scales a copy of the calling object by the given factor relative to the given center Point (cx, cy).
      Specified by:
      getScaled in interface IScalable<CurvedPolygon>
      Parameters:
      factor - scale-factor
      cx - x-coordinate of the relative Point for the scaling
      cy - y-coordinate of the relative Point for the scaling
      Returns:
      the new, scaled object
    • getScaled

      public CurvedPolygon getScaled(double fx, double fy, double cx, double cy)
      Description copied from interface: IScalable
      Scales a copy of the calling object by the given factors relative to the given center Point (cx, cy).
      Specified by:
      getScaled in interface IScalable<CurvedPolygon>
      Parameters:
      fx - x-scale-factor
      fy - y-scale-factor
      cx - x-coordinate of the relative Point for the scaling
      cy - y-coordinate of the relative Point for the scaling
      Returns:
      the new, scaled object
    • getScaled

      public CurvedPolygon getScaled(double fx, double fy, Point center)
      Description copied from interface: IScalable
      Scales a copy of the calling object by the given factors relative to the given center Point.
      Specified by:
      getScaled in interface IScalable<CurvedPolygon>
      Parameters:
      fx - x-scale-factor
      fy - y-scale-factor
      center - relative Point for the scaling
      Returns:
      the new, scaled object
    • getScaled

      public CurvedPolygon getScaled(double factor, Point center)
      Description copied from interface: IScalable
      Scales a copy of the calling object by the given factor relative to the given center Point.
      Specified by:
      getScaled in interface IScalable<CurvedPolygon>
      Parameters:
      factor - scale-factor
      center - relative Point for the scaling
      Returns:
      the new, scaled object
    • getTransformed

      public CurvedPolygon getTransformed(AffineTransform t)
      Default implementation returning a transformed Path representation of this IGeometry. Subclasses may override this method to return a more specific representation.
      Specified by:
      getTransformed in interface IGeometry
      Specified by:
      getTransformed in interface IShape
      Parameters:
      t - The AffineTransform to be applied
      Returns:
      a transformed Path representation of this IGeometry
      See Also:
    • getTranslated

      public CurvedPolygon getTranslated(double dx, double dy)
      Description copied from interface: ITranslatable
      Translates a copy of this object by the given values in x and y direction.
      Specified by:
      getTranslated in interface ITranslatable<CurvedPolygon>
      Parameters:
      dx - x-translation
      dy - y-translation
      Returns:
      a new, translated object
    • getTranslated

      public CurvedPolygon getTranslated(Point d)
      Description copied from interface: ITranslatable
      Translates a copy of this object by the given Point.
      Specified by:
      getTranslated in interface ITranslatable<CurvedPolygon>
      Parameters:
      d - translation Point
      Returns:
      a new, translated object
    • rotateCCW

      public CurvedPolygon rotateCCW(Angle angle)
      Rotates this CurvedPolygon counter-clockwise (CCW) by the given Angle around the center Point of this CurvedPolygon.
      Parameters:
      angle - the rotation Angle
      Returns:
      this for convenience
    • rotateCCW

      public CurvedPolygon rotateCCW(Angle angle, double cx, double cy)
      Rotates this CurvedPolygon counter-clockwise (CCW) by the given Angle around the Point specified by the given x and y coordinates.
      Parameters:
      angle - the rotation Angle
      cx - the x coordinate of the Point to rotate around
      cy - the y coordinate of the Point to rotate around
      Returns:
      this for convenience
    • rotateCCW

      public CurvedPolygon rotateCCW(Angle angle, Point center)
      Rotates this CurvedPolygon counter-clockwise (CCW) by the given Angle around the given Point.
      Parameters:
      angle - the rotation Angle
      center - the Point to rotate around
      Returns:
      this for convenience
    • rotateCW

      public CurvedPolygon rotateCW(Angle angle)
      Rotates this CurvedPolygon counter-clockwise (CCW) by the given Angle around the center Point of this CurvedPolygon.
      Parameters:
      angle - the rotation Angle
      Returns:
      this for convenience
    • rotateCW

      public CurvedPolygon rotateCW(Angle angle, double cx, double cy)
      Rotates this CurvedPolygon clockwise (CW) by the given Angle around the Point specified by the given x and y coordinates.
      Parameters:
      angle - the rotation Angle
      cx - the x coordinate of the Point to rotate around
      cy - the y coordinate of the Point to rotate around
      Returns:
      this for convenience
    • rotateCW

      public CurvedPolygon rotateCW(Angle angle, Point center)
      Rotates this CurvedPolygon clockwise (CW) by the given Angle around the given Point.
      Parameters:
      angle - the rotation Angle
      center - the Point to rotate around
      Returns:
      this for convenience
    • scale

      public CurvedPolygon scale(double factor)
      Description copied from interface: IScalable
      Scales the calling object by the given factor relative to its center Point.
      Specified by:
      scale in interface IScalable<CurvedPolygon>
      Parameters:
      factor - scale-factor
      Returns:
      this for convenience
    • scale

      public CurvedPolygon scale(double fx, double fy)
      Description copied from interface: IScalable
      Scales the calling object by the given factors relative to the given center Point.
      Specified by:
      scale in interface IScalable<CurvedPolygon>
      Parameters:
      fx - x-scale-factor
      fy - y-scale-factor
      Returns:
      this for convenience
    • scale

      public CurvedPolygon scale(double factor, double cx, double cy)
      Description copied from interface: IScalable
      Scales the calling object by the given factor relative to the given center Point (cx, cy).
      Specified by:
      scale in interface IScalable<CurvedPolygon>
      Parameters:
      factor - scale-factor
      cx - x-coordinate of the relative Point for the scaling
      cy - y-coordinate of the relative Point for the scaling
      Returns:
      this for convenience
    • scale

      public CurvedPolygon scale(double fx, double fy, double cx, double cy)
      Description copied from interface: IScalable
      Scales the calling object by the given factors relative to the given center Point (cx, cy).
      Specified by:
      scale in interface IScalable<CurvedPolygon>
      Parameters:
      fx - x-scale-factor
      fy - y-scale-factor
      cx - x-coordinate of the relative Point for the scaling
      cy - y-coordinate of the relative Point for the scaling
      Returns:
      this for convenience
    • scale

      public CurvedPolygon scale(double fx, double fy, Point center)
      Description copied from interface: IScalable
      Scales the calling object by the given factors relative to the given center Point.
      Specified by:
      scale in interface IScalable<CurvedPolygon>
      Parameters:
      fx - x-scale-factor
      fy - y-scale-factor
      center - relative Point for the scaling
      Returns:
      this for convenience
    • scale

      public CurvedPolygon scale(double factor, Point center)
      Description copied from interface: IScalable
      Scales the calling object by the given factor relative to the given center Point.
      Specified by:
      scale in interface IScalable<CurvedPolygon>
      Parameters:
      factor - scale-factor
      center - relative Point for the scaling
      Returns:
      this for convenience
    • toPath

      public Path toPath()
      Description copied from interface: IGeometry
      Converts this IGeometry into a Path representation.
      Specified by:
      toPath in interface IGeometry
      Returns:
      A new Path representation for this IGeometry.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • translate

      public CurvedPolygon translate(double dx, double dy)
      Description copied from interface: ITranslatable
      Translates the object by the given values in x and y direction.
      Specified by:
      translate in interface ITranslatable<CurvedPolygon>
      Parameters:
      dx - x-translation
      dy - y-translation
      Returns:
      this for convenience
    • translate

      public CurvedPolygon translate(Point d)
      Description copied from interface: ITranslatable
      Translates the object by the given Point.
      Specified by:
      translate in interface ITranslatable<CurvedPolygon>
      Parameters:
      d - translation Point
      Returns:
      this for convenience
    • clone

      public Object clone()
      Overridden with public visibility as recommended within Cloneable .
      Overrides:
      clone in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • touches

      public boolean touches(IGeometry g)
      Description copied from interface: IGeometry
      Returns true if the input IGeometry touches this IGeometry, i.e. there is at least one common point.
      Specified by:
      touches in interface IGeometry
      Parameters:
      g - The IGeometry for the intersection test
      Returns:
      true if the input IGeometry and this IGeometry have at least one common point.