Class Polyline

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ICurve, IGeometry, IRotatable<Polyline>, IScalable<Polyline>, ITranslatable<Polyline>

    public class Polyline
    extends java.lang.Object
    implements ICurve
    Represents the geometric shape of a polyline. Note that while all manipulations (e.g. within shrink, expand) within this class are based on double precision, all comparisons (e.g. within contains, intersects, equals, etc.) are based on a limited precision (with an accuracy defined within PrecisionUtils) to compensate for rounding effects.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Polyline​(double... coordinates)
      Constructs a new Polyline from a even-numbered sequence of coordinates.
      Polyline​(Line[] segmentsArray)
      Constructs a new Polyline from the given array of Line segments.
      Polyline​(Point... points)
      Constructs a new Polyline from the given sequence of Point s.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Overridden with public visibility as recommended within Cloneable .
      boolean contains​(double x, double y)
      Checks whether the point that is represented by its x- and y-coordinates is contained within this Polyline.
      boolean contains​(Point p)
      Returns whether the given Point is contained within this IGeometry.
      boolean equals​(java.lang.Object o)  
      boolean equals​(Point... points)
      Checks whether this Polyline and the one that is indirectly given via the sequence of points are regarded to be equal.
      Rectangle getBounds()
      Returns the smallest Rectangle fully enclosing this IGeometry.
      Point getCentroid()
      Computes the centroid of this AbstractPointListBasedGeometry.
      double[] getCoordinates()
      Returns a double array which represents the sequence of coordinates of the Points that make up this AbstractPointListBasedGeometry.
      Polyline getCopy()
      Returns a new identical copy of this IGeometry.
      Line[] getCurves()
      Returns a sequence of Lines, representing the segments that are obtained by linking each two successive point of this Polyline (including the last and the first one).
      Point[] getIntersections​(ICurve c)
      Returns the points of intersection between this ICurve and the given ICurve.
      double getLength()
      Returns the length of this Polyline by adding up the lengths of the individual Lines.
      ICurve[] getOverlaps​(ICurve c)
      Returns the curve segments at which this ICurve and the given ICurve overlap.
      Point getP1()
      Returns a Point representing the start point of this ICurve.
      Point getP2()
      Returns a Point representing the end point of this ICurve .
      Point[] getPoints()
      Returns a copy of the Points that make up this AbstractPointListBasedGeometry.
      Point getProjection​(Point reference)
      Returns a projection of the given reference Point onto this ICurve, i.e. a Point on this ICurve that is closest to the given reference Point.
      T getRotatedCCW​(Angle alpha)
      Rotates the calling object by specified Angle counter-clock-wise (CCW) around its center Point.
      T getRotatedCCW​(Angle angle, double cx, double cy)
      Rotates the calling object by the specified Angle counter-clock-wise (CCW) around the specified center Point (cx, cy).
      T getRotatedCCW​(Angle alpha, Point center)
      Rotates the calling object by the specified Angle counter-clock-wise (CCW) around the specified center Point.
      T getRotatedCW​(Angle alpha)
      Rotates the calling object by specified Angle clock-wise (CW) around its center Point.
      T getRotatedCW​(Angle angle, double cx, double cy)
      Rotates the calling object by the specified Angle clock-wise (CW) around the specified center Point (cx, cy).
      T getRotatedCW​(Angle alpha, Point center)
      Rotates the calling object by the specified Angle clock-wise (CW) around the specified center Point.
      T getScaled​(double factor)
      Scales a copy of the calling object by the given factor relative to its center Point.
      T getScaled​(double factorX, double factorY)
      Scales a copy of the calling object by the given factors relative to its center Point.
      T getScaled​(double factor, double cx, double cy)
      Scales a copy of the calling object by the given factor relative to the given center Point (cx, cy).
      T getScaled​(double fx, double fy, double cx, double cy)
      Scales a copy of the calling object by the given factors relative to the given center Point (cx, cy).
      T getScaled​(double factorX, double factorY, Point center)
      Scales a copy of the calling object by the given factors relative to the given center Point.
      T getScaled​(double factor, Point center)
      Scales a copy of the calling object by the given factor relative to the given center Point.
      Polyline getTransformed​(AffineTransform t)
      Default implementation returning a transformed Path representation of this IGeometry.
      T getTranslated​(double dx, double dy)
      Translates a copy of this object by the given values in x and y direction.
      T getTranslated​(Point pt)
      Translates a copy of this object by the given Point.
      double getX1()
      Returns the start Point's x coordinate.
      double getX2()
      Returns the end Point's x coordinate.
      double getY1()
      Returns the start Point's y coordinate.
      double getY2()
      Returns the end Point's y coordinate.
      int hashCode()  
      boolean intersects​(ICurve c)
      Tests if this ICurve and the given ICurve intersect, i.e.
      boolean overlaps​(ICurve c)
      Tests if this ICurve and the given ICurve overlap, i.e.
      T rotateCCW​(Angle alpha)
      Rotates this AbstractPointListBasedGeometry counter-clockwise (CCW) by the given Angle around its centroid (see getCentroid()).
      T rotateCCW​(Angle alpha, double cx, double cy)
      Rotates this AbstractPointListBasedGeometry counter-clockwise (CCW) by the given Angle around the Point specified by the passed-in x and y coordinates.
      T rotateCCW​(Angle alpha, Point center)
      Rotates this AbstractPointListBasedGeometry counter-clockwise (CCW) by the given Angle around the given Point.
      T rotateCW​(Angle alpha)
      Rotates this AbstractPointListBasedGeometry clockwise (CW) by the given Angle around its centroid (see getCentroid()).
      T rotateCW​(Angle alpha, double cx, double cy)
      Rotates this AbstractPointListBasedGeometry clockwise (CW) by the given Angle around the Point specified by the passed-in x and y coordinates.
      T rotateCW​(Angle alpha, Point center)
      Rotates this AbstractPointListBasedGeometry clockwise (CW) by the given Angle around the given Point.
      T scale​(double factor)
      Scales the calling object by the given factor relative to its center Point.
      T scale​(double fx, double fy)
      Scales the calling object by the given factors relative to the given center Point.
      T scale​(double factor, double cx, double cy)
      Scales the calling object by the given factor relative to the given center Point (cx, cy).
      T scale​(double fx, double fy, double cx, double cy)
      Scales the calling object by the given factors relative to the given center Point (cx, cy).
      T scale​(double fx, double fy, Point center)
      Scales the calling object by the given factors relative to the given center Point.
      T scale​(double factor, Point center)
      Scales the calling object by the given factor relative to the given center Point.
      Line[] toBezier()
      Computes a list of BezierCurves that approximate the ICurve.
      Path toPath()
      Converts this IGeometry into a Path representation.
      PolyBezier toPolyBezier()
      Transforms this Polyline into a PolyBezier.
      java.lang.String toString()  
      boolean touches​(IGeometry g)
      Returns true if the input IGeometry touches this IGeometry, i.e. there is at least one common point.
      T translate​(double dx, double dy)
      Translates the object by the given values in x and y direction.
      T translate​(Point p)
      Translates the object by the given Point.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Polyline

        public Polyline​(double... coordinates)
        Constructs a new Polyline from a even-numbered sequence of coordinates. Similar to Polyline(Point...), only that coordinates of points rather than Points are provided.
        Parameters:
        coordinates - an alternating, even-numbered sequence of x- and y-coordinates, representing the points from which the Polyline is to be created
      • Polyline

        public Polyline​(Line[] segmentsArray)
        Constructs a new Polyline from the given array of Line segments.
        Parameters:
        segmentsArray - The array of Lines from which this Polyline is constructed.
      • Polyline

        public Polyline​(Point... points)
        Constructs a new Polyline from the given sequence of Point s. The Polyline that is created will be automatically closed, i.e. it will not only contain a segment between succeeding points of the sequence but as well back from the last to the first point.
        Parameters:
        points - a sequence of points, from which the Polyline is to be created
    • Method Detail

      • contains

        public boolean contains​(double x,
                                double y)
        Checks whether the point that is represented by its x- and y-coordinates is contained within this Polyline.
        Parameters:
        x - the x coordinate of the point to test
        y - the y coordinate of the point to test
        Returns:
        true if the point represented by its coordinates if contained within this Polyline, otherwise false
      • 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​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • equals

        public boolean equals​(Point... points)
        Checks whether this Polyline and the one that is indirectly given via the sequence of points are regarded to be equal. The Polyline s will be regarded equal, if they are characterized by the same segments.
        Parameters:
        points - an array of Point characterizing a Polyline to be checked for equality
        Returns:
        true if the sequence of points that characterize this Polyline and the Polyline indirectly given via the array of points are regarded to form the same segments
      • getCurves

        public Line[] getCurves()
        Returns a sequence of Lines, representing the segments that are obtained by linking each two successive point of this Polyline (including the last and the first one).
        Returns:
        an array of Lines, representing the segments that make up this Polyline
      • getIntersections

        public Point[] getIntersections​(ICurve c)
        Description copied from interface: ICurve
        Returns the points of intersection between this ICurve and the given ICurve.
        Specified by:
        getIntersections in interface ICurve
        Parameters:
        c - The ICurve to compute intersection points with.
        Returns:
        The points of intersection.
      • getLength

        public double getLength()
        Returns the length of this Polyline by adding up the lengths of the individual Lines.
        Returns:
        The length of this Polyline.
      • getOverlaps

        public ICurve[] getOverlaps​(ICurve c)
        Description copied from interface: ICurve
        Returns the curve segments at which this ICurve and the given ICurve overlap.
        Specified by:
        getOverlaps in interface ICurve
        Parameters:
        c - The curve to compute overlaps with.
        Returns:
        The segments where both curves overlap.
      • getP1

        public Point getP1()
        Description copied from interface: ICurve
        Returns a Point representing the start point of this ICurve.
        Specified by:
        getP1 in interface ICurve
        Returns:
        a new Point with the coordinates of the ICurve's start point.
      • getP2

        public Point getP2()
        Description copied from interface: ICurve
        Returns a Point representing the end point of this ICurve .
        Specified by:
        getP2 in interface ICurve
        Returns:
        a new Point with the coordinates of the ICurve's end point.
      • getProjection

        public Point getProjection​(Point reference)
        Description copied from interface: ICurve
        Returns a projection of the given reference Point onto this ICurve, i.e. a Point on this ICurve that is closest to the given reference Point. Note, that
        Specified by:
        getProjection in interface ICurve
        Parameters:
        reference - The reference Point for which to return the projection.
        Returns:
        The projection of the given reference Point onto this ICurve.
      • getX1

        public double getX1()
        Description copied from interface: ICurve
        Returns the start Point's x coordinate.
        Specified by:
        getX1 in interface ICurve
        Returns:
        the start Point's x coordinate
      • getX2

        public double getX2()
        Description copied from interface: ICurve
        Returns the end Point's x coordinate.
        Specified by:
        getX2 in interface ICurve
        Returns:
        the end Point's x coordinate
      • getY1

        public double getY1()
        Description copied from interface: ICurve
        Returns the start Point's y coordinate.
        Specified by:
        getY1 in interface ICurve
        Returns:
        the start Point's y coordinate
      • getY2

        public double getY2()
        Description copied from interface: ICurve
        Returns the end Point's y coordinate.
        Specified by:
        getY2 in interface ICurve
        Returns:
        the end Point's y coordinate
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getCentroid

        public Point getCentroid()
        Computes the centroid of this AbstractPointListBasedGeometry. The centroid is the "center of gravity", i.e. assuming a Polygon is spanned by the Points of this AbstractPointListBasedGeometry and it is made of a material of constant density, then it is in a balanced state, if you put it on a pin that is placed exactly on its centroid.
        Returns:
        the center Point (or centroid) of this AbstractPointListBasedGeometry
      • getCoordinates

        public final double[] getCoordinates()
        Returns a double array which represents the sequence of coordinates of the Points that make up this AbstractPointListBasedGeometry.
        Returns:
        an array that alternately contains the x and y coordinates of this AbstractPointListBasedGeometry's points
      • getPoints

        public final Point[] getPoints()
        Returns a copy of the Points that make up this AbstractPointListBasedGeometry.
        Returns:
        an array of Points representing the Points that make up this AbstractPointListBasedGeometry
      • getRotatedCCW

        public T getRotatedCCW​(Angle alpha)
        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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        alpha - rotation Angle
        Returns:
        an IGeometry representing the result of the rotation
      • getRotatedCCW

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        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 T getRotatedCCW​(Angle alpha,
                               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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        alpha - rotation Angle
        center - relative Point for the rotation
        Returns:
        an IGeometry representing the result of the rotation
      • getRotatedCW

        public T getRotatedCW​(Angle alpha)
        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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        alpha - rotation Angle
        Returns:
        an IGeometry representing the result of the rotation
      • getRotatedCW

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        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 T getRotatedCW​(Angle alpha,
                              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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        alpha - rotation Angle
        center - relative Point for the rotation
        Returns:
        an IGeometry representing the result of the rotation
      • getScaled

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        factor - scale-factor
        Returns:
        the new, scaled object
      • getScaled

        public T getScaled​(double factorX,
                           double factorY)
        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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        factorX - x-scale-factor
        factorY - y-scale-factor
        Returns:
        the new, scaled object
      • getScaled

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        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 T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        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 T getScaled​(double factorX,
                           double factorY,
                           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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        factorX - x-scale-factor
        factorY - y-scale-factor
        center - relative Point for the scaling
        Returns:
        the new, scaled object
      • getScaled

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        factor - scale-factor
        center - relative Point for the scaling
        Returns:
        the new, scaled object
      • getTranslated

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        dx - x-translation
        dy - y-translation
        Returns:
        a new, translated object
      • getTranslated

        public T getTranslated​(Point pt)
        Description copied from interface: ITranslatable
        Translates a copy of this object by the given Point.
        Specified by:
        getTranslated in interface ITranslatable<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        pt - translation Point
        Returns:
        a new, translated object
      • rotateCCW

        public T rotateCCW​(Angle alpha)
        Rotates this AbstractPointListBasedGeometry counter-clockwise (CCW) by the given Angle around its centroid (see getCentroid()).
        Parameters:
        alpha - the rotation Angle
        Returns:
        this for convenience
        See Also:
        rotateCCW(Angle, Point)
      • rotateCCW

        public T rotateCCW​(Angle alpha,
                           double cx,
                           double cy)
        Rotates this AbstractPointListBasedGeometry counter-clockwise (CCW) by the given Angle around the Point specified by the passed-in x and y coordinates.
        Parameters:
        alpha - 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
        See Also:
        rotateCCW(Angle, Point)
      • rotateCCW

        public T rotateCCW​(Angle alpha,
                           Point center)
        Rotates this AbstractPointListBasedGeometry counter-clockwise (CCW) by the given Angle around the given Point. The rotation is done by
        1. translating this AbstractPointListBasedGeometry by the negated Point center
        2. rotating each Point of this AbstractPointListBasedGeometry counter-clockwise by the given Angle
        3. translating this AbstractPointListBasedGeometry back by the Point center
        Parameters:
        alpha - the rotation Angle
        center - the Point to rotate around
        Returns:
        this for convenience
      • rotateCW

        public T rotateCW​(Angle alpha)
        Rotates this AbstractPointListBasedGeometry clockwise (CW) by the given Angle around its centroid (see getCentroid()).
        Parameters:
        alpha - the rotation Angle
        Returns:
        this for convenience
        See Also:
        rotateCW(Angle, Point)
      • rotateCW

        public T rotateCW​(Angle alpha,
                          double cx,
                          double cy)
        Rotates this AbstractPointListBasedGeometry clockwise (CW) by the given Angle around the Point specified by the passed-in x and y coordinates.
        Parameters:
        alpha - 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
        See Also:
        rotateCW(Angle, Point)
      • rotateCW

        public T rotateCW​(Angle alpha,
                          Point center)
        Rotates this AbstractPointListBasedGeometry clockwise (CW) by the given Angle around the given Point. The rotation is done by
        1. translating this AbstractPointListBasedGeometry by the negated Point center
        2. rotating each Point of this AbstractPointListBasedGeometry clockwise by the given Angle
        3. translating this AbstractPointListBasedGeometry back by the Point center
        Parameters:
        alpha - the rotation Angle
        center - the Point to rotate around
        Returns:
        this for convenience
      • scale

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        factor - scale-factor
        Returns:
        this for convenience
      • scale

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        fx - x-scale-factor
        fy - y-scale-factor
        Returns:
        this for convenience
      • scale

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        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 T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        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 T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        fx - x-scale-factor
        fy - y-scale-factor
        center - relative Point for the scaling
        Returns:
        this for convenience
      • scale

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        factor - scale-factor
        center - relative Point for the scaling
        Returns:
        this for convenience
      • translate

        public T 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<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        dx - x-translation
        dy - y-translation
        Returns:
        this for convenience
      • translate

        public T translate​(Point p)
        Description copied from interface: ITranslatable
        Translates the object by the given Point.
        Specified by:
        translate in interface ITranslatable<T extends org.eclipse.gef.geometry.planar.AbstractPointListBasedGeometry<?>>
        Parameters:
        p - translation Point
        Returns:
        this for convenience
      • clone

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

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()