Package wprover

Class CTMark


  • public class CTMark
    extends CClass
    CTMark is a class that represents a mark on a drawing, defined by two lines. It provides methods for drawing the mark, moving it, and saving/loading its state.
    • Constructor Detail

      • CTMark

        public CTMark()
        Default constructor for CTMark.
      • CTMark

        public CTMark​(CLine ln1,
                      CLine ln2)
        Constructs a CTMark with two lines.
        Parameters:
        ln1 - the first line
        ln2 - the second line
    • Method Detail

      • TypeString

        public java.lang.String TypeString()
        Returns the type string of the mark.
        Specified by:
        TypeString in class CClass
        Returns:
        the type string
      • getDescription

        public java.lang.String getDescription()
        Returns the description of the mark.
        Specified by:
        getDescription in class CClass
        Returns:
        the description
      • draw

        public void draw​(java.awt.Graphics2D g2)
        Draws the mark using the specified Graphics2D object.
        Overrides:
        draw in class CClass
        Parameters:
        g2 - the Graphics2D object
      • draw

        public void draw​(java.awt.Graphics2D g2,
                         boolean selected)
        Draws the mark using the specified Graphics2D object, with an option to select it.
        Parameters:
        g2 - the Graphics2D object
        selected - whether the mark is selected
      • SavePS

        public void SavePS​(java.io.FileOutputStream fp,
                           int stype)
                    throws java.io.IOException
        Saves the mark to a PostScript file.
        Specified by:
        SavePS in class CClass
        Parameters:
        fp - the FileOutputStream to write to
        stype - the stroke type
        Throws:
        java.io.IOException - if an I/O error occurs
      • drawTTFoot

        public void drawTTFoot​(java.awt.Graphics2D g2,
                               double x,
                               double y,
                               CPoint p1,
                               CPoint p2,
                               boolean select)
        Draws the TTFoot mark using the specified Graphics2D object.
        Parameters:
        g2 - the Graphics2D object
        x - the x coordinate
        y - the y coordinate
        p1 - the first point
        p2 - the second point
        select - whether the mark is selected
      • Save

        public void Save​(java.io.DataOutputStream out)
                  throws java.io.IOException
        Saves the mark to a DataOutputStream.
        Overrides:
        Save in class CClass
        Parameters:
        out - the DataOutputStream to write to
        Throws:
        java.io.IOException - if an I/O error occurs
      • Load

        public void Load​(java.io.DataInputStream in,
                         DrawProcess dp)
                  throws java.io.IOException
        Loads the mark from a DataInputStream.
        Overrides:
        Load in class CClass
        Parameters:
        in - the DataInputStream to read from
        dp - the DrawProcess used for loading
        Throws:
        java.io.IOException - if an I/O error occurs