Class Shape

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    ChartText, PointShape, PolygonShape, PolylineShape


    public abstract class Shape
    extends java.lang.Object
    implements java.lang.Cloneable
    Shape class
    • Constructor Detail

      • Shape

        public Shape​()
        Contructor
      • Shape

        public Shape​(Geometry geometry)
        Constructor
        Parameters:
        geometry - Geometry
    • Method Detail

      • getShapeType

        public abstract ShapeTypes getShapeType​()
        Get shape type
        Returns:
        Shape type
      • isVisible

        public boolean isVisible​()
        Get if visible
        Returns:
        is visible or not
      • setVisible

        public void setVisible​(boolean isTrue)
        Set visible
        Parameters:
        isTrue - True or not
      • isSelected

        public boolean isSelected​()
        Get if the shape is selected
        Returns:
        Boolean
      • setSelected

        public void setSelected​(boolean isTrue)
        Set selected
        Parameters:
        isTrue - True or not
      • isEditing

        public boolean isEditing​()
        Get if is editing
        Returns:
        Boolean
      • setEditing

        public void setEditing​(boolean value)
        Set if is editing
        Parameters:
        value - Boolean
      • getExtent

        public Extent getExtent​()
        Get extent
        Returns:
        extent Extent
      • setExtent

        public void setExtent​(Extent aExtent)
        Set extent
        Parameters:
        aExtent - Extent
      • getLegendIndex

        public int getLegendIndex​()
        Get legend index
        Returns:
        Legend index
      • setLegendIndex

        public void setLegendIndex​(int value)
        Set legend index
        Parameters:
        value - Legend index
      • getValue

        public double getValue​()
        Get value
        Returns:
        Value
      • setValue

        public void setValue​(double value)
        Set value
        Parameters:
        value - Value
      • getPoints

        public java.util.List<? extends PointD> getPoints​()
        Get points
        Returns:
        point list
      • setPoints

        public void setPoints​(java.util.List<? extends PointD> points)
        Set points
        Parameters:
        points - point list
      • addVertice

        public void addVertice​(int vIdx,
                               PointD vertice)
        Add a vertice
        Parameters:
        vIdx - Vertice index
        vertice - The vertice
      • removeVerice

        public void removeVerice​(int vIdx)
        Remove a vertice
        Parameters:
        vIdx - Vertice index
      • moveVertice

        public void moveVertice​(int vIdx,
                                double newX,
                                double newY)
        Vertice edited update
        Parameters:
        vIdx - Vertice index
        newX - New X
        newY - New Y
      • move

        public void move​(double xShift,
                         double yShift)
        Move the shape
        Parameters:
        xShift - X shift
        yShift - Y shift
      • reverse

        public void reverse​()
        Reverse points direction
      • toGeometry

        public abstract Geometry toGeometry​(GeometryFactory factory)
        To geometry method
        Parameters:
        factory - GeometryFactory
        Returns:
        Geometry
      • toGeometry

        public Geometry toGeometry​()
        To geometry method
        Returns:
        Geometry
      • geometry2Shape

        public static Shape geometry2Shape​(Geometry geo)
      • intersection

        public Shape intersection​(Shape b)
        Get intersection shape
        Parameters:
        b - Other shape
        Returns:
        Intersection shape
      • union

        public Shape union​(Shape b)
        Get union shape
        Parameters:
        b - Other shape
        Returns:
        Union shape
      • difference

        public Shape difference​(Shape b)
        Get difference shape
        Parameters:
        b - Other shape
        Returns:
        Difference shape
      • symDifference

        public Shape symDifference​(Shape b)
        Get system difference shape
        Parameters:
        b - Other shape
        Returns:
        System difference shape
      • buffer

        public Shape buffer​(double distance)
        Get buffer shape
        Parameters:
        distance - Distance
        Returns:
        Buffered shape
      • convexHull

        public Shape convexHull​()
        Get convexhull shape
        Returns:
        Convexhull shape
      • split

        public java.util.List<Shape> split​(Shape line)
        Split shape
        Parameters:
        line - Split line
        Returns:
        Splitted shapes
      • reform

        public Shape reform​(Shape line)
        Reform the shape by a line
        Parameters:
        line - The line
        Returns:
        Result shape
      • crosses

        public boolean crosses​(Shape other)
        Is shapes cross each other or not
        Parameters:
        other - Other shape
        Returns:
        Cross or not
      • contains

        public boolean contains​(Shape other)
        If this shape contains another one
        Parameters:
        other - Other shape
        Returns:
        Contains or not
      • coveredBy

        public boolean coveredBy​(Shape other)
        If this shape covered by another one
        Parameters:
        other - Other shape
        Returns:
        Covered by or not
      • covers

        public boolean covers​(Shape other)
        If this shape covers another one
        Parameters:
        other - Other shape
        Returns:
        Covers or not
      • disjoint

        public boolean disjoint​(Shape other)
        If this shape disjoint another one
        Parameters:
        other - Other shape
        Returns:
        Disjoint or not
      • equals

        public boolean equals​(Shape other)
        If this shape equals another one
        Parameters:
        other - Other shape
        Returns:
        Equals or not
      • intersects

        public boolean intersects​(Shape other)
        If this shape intersects another one
        Parameters:
        other - Other shape
        Returns:
        Intersects or not
      • overlaps

        public boolean overlaps​(Shape other)
        If this shape overlaps another one
        Parameters:
        other - Other shape
        Returns:
        Overlaps or not
      • touches

        public boolean touches​(Shape other)
        If this shape touches another one
        Parameters:
        other - Other shape
        Returns:
        Touches or not
      • within

        public boolean within​(Shape other)
        If this shape within another one
        Parameters:
        other - Other shape
        Returns:
        Within or not
      • clone

        public java.lang.Object clone​()
        Clone
        Overrides:
        clone in class java.lang.Object
        Returns:
        Shape object
      • cloneValue

        public void cloneValue​(Shape other)
        Clone value
        Parameters:
        other - Other shape