Class ShapeElement

    • Constructor Detail

      • ShapeElement

        public ShapeElement​(java.lang.String name)
        Constructor.
        Parameters:
        name - Element Name.
      • ShapeElement

        public ShapeElement​(java.lang.String name,
                            java.lang.String uri)
        Constructor.
        Parameters:
        name - Element Name.
        uri - Element URI.
      • ShapeElement

        public ShapeElement​(nu.xom.Element element)
        Constructor
        Parameters:
        element - Element.
    • Method Detail

      • getType

        public java.lang.String getType()
        Get the Shape's type.
        Returns:
        Shape's Type.
      • setType

        public java.lang.String setType​(java.lang.String type)
        Set the shape's type.
        Parameters:
        type - Shape Type.
        Returns:
        Maybe set type.
      • delete

        public void delete​(DocIO resIO)
        Description copied from class: VisualElement
        Delete the element and sub-elements.
        Specified by:
        delete in class VisualElement
        Parameters:
        resIO - Resource handler to remove resources on delete.
      • setStroke

        public void setStroke​(java.lang.String colour,
                              java.lang.String style,
                              java.lang.Double width)
        Set a shape's stroke.
        Parameters:
        colour - Colour to set.
        style - Stroke Style.
        width - Stroke Width.
      • setSegPoints

        public final void setSegPoints​(java.util.ArrayList<java.lang.Double> points)
                                throws java.lang.Exception
        Set segment points for polygon or alt-line.
        Parameters:
        points - Segment points.
        Throws:
        java.lang.Exception - Something odd happened.
      • getSegPoints

        public final java.util.ArrayList<java.lang.Double> getSegPoints()
        Get a list of points if the element is a line or polygon.
        Returns:
        List of points if line or polygon, else returns an empty list.
      • getText

        public java.util.Optional<java.util.ArrayList<StyledTextSeg>> getText()
        Gets text for shape element - optional as won't necessarily exist.
        Returns:
        Maybe text array.
      • getTextString

        public java.lang.String getTextString()
        Get my text string.
        Returns:
        String of text contained.
      • setText

        public final void setText​(java.util.ArrayList<StyledTextSeg> text)
        Sets text of the shape element.
        Parameters:
        text - Text segments to set.
      • setText

        public void setText​(java.lang.String text)
        Set a text string, preserving properties of the first segment.
        Parameters:
        text - Text string to set.
      • setTextProperties

        public void setTextProperties​(java.util.HashMap<java.lang.String,​java.lang.Object> props)
        Set my text properties via map.
        Parameters:
        props - Properties to set.
      • setTextAlpha

        public void setTextAlpha​(java.lang.Double alpha)
        Set alpha of contained text.
        Parameters:
        alpha - Opacity/Alpha value.
      • setTextColour

        public void setTextColour​(java.lang.String colour)
        Set text Colour.
        Parameters:
        colour - Colour String.
      • getTextColour

        public java.util.Optional<javafx.scene.paint.Color> getTextColour()
        Get Text Colour.
        Returns:
        Text Colour.
      • setAlignment

        public void setAlignment​(java.lang.String hAlign,
                                 java.lang.String vAlign)
        Set text alignment.
        Parameters:
        hAlign - Horizontal.
        vAlign - Vertical.
      • setFont

        public void setFont​(java.lang.String font,
                            java.lang.String colour,
                            java.lang.Double size,
                            java.lang.Boolean underscore,
                            java.lang.Boolean italic,
                            java.lang.Boolean bold)
        Set my font.
        Parameters:
        font - Font Name.
        colour - Font Colour.
        size - Font Size.
        underscore - Underscore?
        italic - Italicise?
        bold - Bold?