Package wprover

Class CProveText


  • public class CProveText
    extends java.lang.Object
    CProveText is a class that represents a proof text in a graphical user interface. It contains methods for drawing the text, handling mouse events, and saving/loading data.
    • Constructor Summary

      Constructors 
      Constructor Description
      CProveText()
      Default constructor for the CProveText class.
      CProveText​(Cond co, java.lang.String s)
      Constructor for the CProveText class with a condition and header.
      CProveText​(java.lang.String s)
      Constructor for the CProveText class with a specified message.
      CProveText​(java.lang.String s1, java.lang.String s2)
      Constructor for the CProveText class with specified header and message.
      CProveText​(java.util.Vector vl, Cond co, int index, boolean gc)
      Constructor for the CProveText class with a vector, condition, index, and a boolean flag.
      CProveText​(wprover.UndoStruct un)
      Constructor for the CProveText class with an undo structure.
      CProveText​(wprover.UndoStruct un, int index)
      Constructor for the CProveText class with an undo structure and index.
      CProveText​(wprover.UndoStruct un, java.lang.String s)
      Constructor for the CProveText class with an undo structure and header.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearSelection()
      Clears the selection of the proof text.
      void draw​(java.awt.Graphics2D g2)
      Draws the proof text.
      void draw​(java.awt.Graphics2D g2, boolean selected)
      Draws the proof text with the given selection state.
      void drawChild​(java.awt.Graphics2D g2, java.awt.Point p)
      Draws the child proof text at the given point.
      void expand()
      Expands or collapses the proof text.
      CProveText fd_text​(int i)
      Finds the proof text with the given row index.
      CProveText findPText​(wprover.UndoStruct un)
      Finds the proof text associated with the given undo structure.
      java.awt.Color getCaptainColor()
      Retrieves the color of the caption.
      Cond getcond()
      Retrieves the condition associated with this proof text.
      java.lang.String getDescription()
      Retrieves the description of the proof text.
      void getFlashObjectList​(java.util.Vector v, DrawProcess dp)
      Retrieves the list of flash objects associated with the proof text.
      java.awt.Font getFont()
      Retrieves the font used for the proof text.
      java.lang.String getHead()
      Retrieves the header text.
      java.lang.String getMessage()
      Retrieves the message text.
      java.awt.Color getMessageColor()
      Retrieves the color of the message.
      void getNextPosition​(java.awt.Point p)
      Gets the next position for the proof text.
      java.util.Vector getObjectList()
      Retrieves the list of objects associated with the undo structure.
      java.awt.Point getPopExLocation()
      Gets the location for the pop-up menu.
      java.awt.Rectangle getRectangle()
      Retrieves the rectangle representing the bounds of this proof text.
      static int getRow()
      Retrieves the current row counter value.
      java.lang.String getRule()
      Retrieves the rule associated with this proof text.
      java.lang.String getRulePath()
      Retrieves the path to the rule file.
      wprover.UndoStruct getUndoStruct()
      Retrieves the undo structure associated with this proof text.
      boolean getVisible()
      Checks if the proof text is visible.
      double getWidth()
      Retrieves the width of the proof text.
      boolean isExpanded()
      Checks if the proof text is expanded.
      void Load​(java.io.DataInputStream in, DrawProcess dp)
      Loads the proof text data from the specified data input stream.
      CProveText mouseMove​(double x, double y)
      Handles mouse movement events.
      void move​(double dx, double dy)
      Moves the proof text by the given offsets.
      CProveText next_prove_step​(DrawProcess dp, CProveText cpt, CBoolean find)
      Finds the next proof step in the draw process.
      java.awt.Font ReadFont​(java.io.DataInputStream in)
      Reads a font from the specified data input stream.
      java.lang.String ReadString​(java.io.DataInputStream in)
      Reads a string from the specified data input stream.
      CProveText redo_invisible_head​(DrawProcess dp)
      Redoes the invisible head of the proof text in the draw process.
      static void resetRow()
      Resets the row counter to zero.
      boolean run_to_begin​(DrawProcess dp)
      Runs the proof text to the beginning of the draw process.
      void Save​(java.io.DataOutputStream out)
      Saves the proof text data to the specified data output stream.
      void SavePS​(java.io.FileOutputStream fp, int stype, int ntype)
      Saves the proof text as a PostScript file.
      void SavePsColor​(java.awt.Color c, java.io.FileOutputStream fp, int stype)
      Sets the PostScript color based on the given color and style type.
      void saveText​(java.io.DataOutputStream out, int space)
      Saves the text representation of the proof to the specified data output stream.
      boolean select​(double x1, double y1)
      Checks if the given coordinates are within the bounds of the proof text.
      CProveText selectAll​(double x1, double y1)
      Selects all proof texts at the given coordinates.
      CProveText selectChild​(double x1, double y1, boolean onselect)
      Selects the child proof text at the given coordinates.
      void setCaptainColor​(java.awt.Color c)
      Sets the color of the caption.
      void setCurrentPosition​(java.awt.Point p)
      Sets the current position of the proof text.
      void setExpanded​(boolean exp)
      Sets the expanded state of the proof text.
      void setFont​(java.awt.Font f)
      Sets the font used for the proof text.
      void setFontSize​(int size)
      Sets the font size for the proof text.
      void setHead​(java.lang.String s)
      Sets the header text.
      void setIndex​(int index)
      Sets the index for the proof text.
      void setMessage​(java.lang.String s)
      Sets the message text.
      void setMessageColor​(java.awt.Color c)
      Sets the color of the message.
      void setObjectList​(java.util.Vector v)
      Sets the list of objects associated with the undo structure.
      void setRule​(java.lang.String r)
      Sets the rule associated with this proof text.
      void setRulePath​(java.lang.String path)
      Sets the path to the rule file.
      void setStepRowDefault()
      Sets the step row to the default value.
      void setVisible​(boolean v)
      Sets the visibility of the proof text.
      void setWidth​(double ww)
      Sets the width of the proof text.
      void setXY​(double x, double y)
      Sets the x and y coordinates of the proof text.
      java.lang.String TypeString()
      Retrieves the type string of the proof text.
      boolean undo_default​(DrawProcess dp)
      Undoes the default action for the proof text.
      boolean undo_to_head​(DrawProcess dp)
      Undoes the proof text to the head of the draw process.
      void WriteFont​(java.io.DataOutputStream out, java.awt.Font f)
      Writes a font to the specified data output stream.
      void WriteString​(java.io.DataOutputStream out, java.lang.String s)
      Writes a string to the specified data output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CProveText

        public CProveText()
        Default constructor for the CProveText class.
      • CProveText

        public CProveText​(java.lang.String s1,
                          java.lang.String s2)
        Constructor for the CProveText class with specified header and message.
        Parameters:
        s1 - the header text
        s2 - the message text
      • CProveText

        public CProveText​(wprover.UndoStruct un,
                          java.lang.String s)
        Constructor for the CProveText class with an undo structure and header.
        Parameters:
        un - the undo structure
        s - the header text
      • CProveText

        public CProveText​(java.lang.String s)
        Constructor for the CProveText class with a specified message.
        Parameters:
        s - the message text
      • CProveText

        public CProveText​(Cond co,
                          java.lang.String s)
        Constructor for the CProveText class with a condition and header.
        Parameters:
        co - the condition
        s - the header text
      • CProveText

        public CProveText​(wprover.UndoStruct un)
        Constructor for the CProveText class with an undo structure.
        Parameters:
        un - the undo structure
      • CProveText

        public CProveText​(java.util.Vector vl,
                          Cond co,
                          int index,
                          boolean gc)
        Constructor for the CProveText class with a vector, condition, index, and a boolean flag.
        Parameters:
        vl - the vector
        co - the condition
        index - the index
        gc - the boolean flag
      • CProveText

        public CProveText​(wprover.UndoStruct un,
                          int index)
        Constructor for the CProveText class with an undo structure and index.
        Parameters:
        un - the undo structure
        index - the index
    • Method Detail

      • setExpanded

        public void setExpanded​(boolean exp)
        Sets the expanded state of the proof text.
        Parameters:
        exp - true to expand, false to collapse
      • isExpanded

        public boolean isExpanded()
        Checks if the proof text is expanded.
        Returns:
        true if expanded, false otherwise
      • getcond

        public Cond getcond()
        Retrieves the condition associated with this proof text.
        Returns:
        the condition
      • resetRow

        public static void resetRow()
        Resets the row counter to zero.
      • getRow

        public static int getRow()
        Retrieves the current row counter value.
        Returns:
        the current row counter value
      • setFontSize

        public void setFontSize​(int size)
        Sets the font size for the proof text.
        Parameters:
        size - the font size to set
      • setIndex

        public void setIndex​(int index)
        Sets the index for the proof text.
        Parameters:
        index - the index to set
      • setVisible

        public void setVisible​(boolean v)
        Sets the visibility of the proof text.
        Parameters:
        v - true to make visible, false to hide
      • getVisible

        public boolean getVisible()
        Checks if the proof text is visible.
        Returns:
        true if visible, false otherwise
      • getUndoStruct

        public wprover.UndoStruct getUndoStruct()
        Retrieves the undo structure associated with this proof text.
        Returns:
        the undo structure
      • getRectangle

        public java.awt.Rectangle getRectangle()
        Retrieves the rectangle representing the bounds of this proof text.
        Returns:
        the rectangle representing the bounds
      • getCaptainColor

        public java.awt.Color getCaptainColor()
        Retrieves the color of the caption.
        Returns:
        the caption color
      • setRule

        public void setRule​(java.lang.String r)
        Sets the rule associated with this proof text.
        Parameters:
        r - the rule to set
      • getRule

        public java.lang.String getRule()
        Retrieves the rule associated with this proof text.
        Returns:
        the rule
      • setRulePath

        public void setRulePath​(java.lang.String path)
        Sets the path to the rule file.
        Parameters:
        path - the path to set
      • getRulePath

        public java.lang.String getRulePath()
        Retrieves the path to the rule file.
        Returns:
        the rule path
      • setCaptainColor

        public void setCaptainColor​(java.awt.Color c)
        Sets the color of the caption.
        Parameters:
        c - the color to set
      • getMessageColor

        public java.awt.Color getMessageColor()
        Retrieves the color of the message.
        Returns:
        the message color
      • setMessageColor

        public void setMessageColor​(java.awt.Color c)
        Sets the color of the message.
        Parameters:
        c - the color to set
      • getFont

        public java.awt.Font getFont()
        Retrieves the font used for the proof text.
        Returns:
        the font
      • setFont

        public void setFont​(java.awt.Font f)
        Sets the font used for the proof text.
        Parameters:
        f - the font to set
      • getHead

        public java.lang.String getHead()
        Retrieves the header text.
        Returns:
        the header text
      • setHead

        public void setHead​(java.lang.String s)
        Sets the header text.
        Parameters:
        s - the header text to set
      • getMessage

        public java.lang.String getMessage()
        Retrieves the message text.
        Returns:
        the message text
      • setMessage

        public void setMessage​(java.lang.String s)
        Sets the message text.
        Parameters:
        s - the message text to set
      • getObjectList

        public java.util.Vector getObjectList()
        Retrieves the list of objects associated with the undo structure.
        Returns:
        the list of objects
      • setObjectList

        public void setObjectList​(java.util.Vector v)
        Sets the list of objects associated with the undo structure.
        Parameters:
        v - the list of objects to set
      • setWidth

        public void setWidth​(double ww)
        Sets the width of the proof text.
        Parameters:
        ww - the width to set
      • getWidth

        public double getWidth()
        Retrieves the width of the proof text.
        Returns:
        the width
      • setXY

        public void setXY​(double x,
                          double y)
        Sets the x and y coordinates of the proof text.
        Parameters:
        x - the x-coordinate to set
        y - the y-coordinate to set
      • TypeString

        public java.lang.String TypeString()
        Retrieves the type string of the proof text.
        Returns:
        the type string
      • getDescription

        public java.lang.String getDescription()
        Retrieves the description of the proof text.
        Returns:
        the description
      • selectChild

        public CProveText selectChild​(double x1,
                                      double y1,
                                      boolean onselect)
        Selects the child proof text at the given coordinates.
        Parameters:
        x1 - the x-coordinate to check
        y1 - the y-coordinate to check
        onselect - a boolean indicating whether to select the child
        Returns:
        the selected child proof text, or null if not found
      • clearSelection

        public void clearSelection()
        Clears the selection of the proof text.
      • expand

        public void expand()
        Expands or collapses the proof text.
      • redo_invisible_head

        public CProveText redo_invisible_head​(DrawProcess dp)
        Redoes the invisible head of the proof text in the draw process.
        Parameters:
        dp - the draw process
        Returns:
        the proof text with the redone invisible head
      • getFlashObjectList

        public void getFlashObjectList​(java.util.Vector v,
                                       DrawProcess dp)
        Retrieves the list of flash objects associated with the proof text.
        Parameters:
        v - the list to populate with flash objects
        dp - the draw process
      • findPText

        public CProveText findPText​(wprover.UndoStruct un)
        Finds the proof text associated with the given undo structure.
        Parameters:
        un - the undo structure to find the proof text for
        Returns:
        the proof text associated with the undo structure, or null if not found
      • next_prove_step

        public CProveText next_prove_step​(DrawProcess dp,
                                          CProveText cpt,
                                          CBoolean find)
        Finds the next proof step in the draw process.
        Parameters:
        dp - the draw process
        cpt - the current proof text
        find - a boolean indicating whether the proof step has been found
        Returns:
        the next proof step, or null if not found
      • select

        public boolean select​(double x1,
                              double y1)
        Checks if the given coordinates are within the bounds of the proof text.
        Parameters:
        x1 - the x-coordinate to check
        y1 - the y-coordinate to check
        Returns:
        true if the coordinates are within the bounds, false otherwise
      • getPopExLocation

        public java.awt.Point getPopExLocation()
        Gets the location for the pop-up menu.
        Returns:
        the location for the pop-up menu
      • mouseMove

        public CProveText mouseMove​(double x,
                                    double y)
        Handles mouse movement events.
        Parameters:
        x - the x-coordinate of the mouse
        y - the y-coordinate of the mouse
        Returns:
        the proof text if the mouse is on the arrow, or null otherwise
      • selectAll

        public CProveText selectAll​(double x1,
                                    double y1)
        Selects all proof texts at the given coordinates.
        Parameters:
        x1 - the x-coordinate to check
        y1 - the y-coordinate to check
        Returns:
        the selected proof text, or null if not found
      • move

        public void move​(double dx,
                         double dy)
        Moves the proof text by the given offsets.
        Parameters:
        dx - the x-offset to move by
        dy - the y-offset to move by
      • setCurrentPosition

        public void setCurrentPosition​(java.awt.Point p)
        Sets the current position of the proof text.
        Parameters:
        p - the point to set the position to
      • getNextPosition

        public void getNextPosition​(java.awt.Point p)
        Gets the next position for the proof text.
        Parameters:
        p - the point to set the next position to
      • run_to_begin

        public boolean run_to_begin​(DrawProcess dp)
        Runs the proof text to the beginning of the draw process.
        Parameters:
        dp - the draw process
        Returns:
        true if successful, false otherwise
      • undo_default

        public boolean undo_default​(DrawProcess dp)
        Undoes the default action for the proof text.
        Parameters:
        dp - the draw process
        Returns:
        true if successful, false otherwise
      • undo_to_head

        public boolean undo_to_head​(DrawProcess dp)
        Undoes the proof text to the head of the draw process.
        Parameters:
        dp - the draw process
        Returns:
        true if successful, false otherwise
      • draw

        public void draw​(java.awt.Graphics2D g2,
                         boolean selected)
        Draws the proof text with the given selection state.
        Parameters:
        g2 - the graphics context
        selected - true if the proof text is selected, false otherwise
      • drawChild

        public void drawChild​(java.awt.Graphics2D g2,
                              java.awt.Point p)
        Draws the child proof text at the given point.
        Parameters:
        g2 - the graphics context
        p - the point to draw the child proof text at
      • fd_text

        public CProveText fd_text​(int i)
        Finds the proof text with the given row index.
        Parameters:
        i - the row index to find the proof text for
        Returns:
        the proof text with the given row index, or null if not found
      • setStepRowDefault

        public void setStepRowDefault()
        Sets the step row to the default value.
      • draw

        public void draw​(java.awt.Graphics2D g2)
        Draws the proof text.
        Parameters:
        g2 - the graphics context
      • saveText

        public void saveText​(java.io.DataOutputStream out,
                             int space)
                      throws java.io.IOException
        Saves the text representation of the proof to the specified data output stream.
        Parameters:
        out - the data output stream to write to
        space - the number of spaces to indent the text
        Throws:
        java.io.IOException - if an I/O error occurs
      • SavePS

        public void SavePS​(java.io.FileOutputStream fp,
                           int stype,
                           int ntype)
                    throws java.io.IOException
        Saves the proof text as a PostScript file.
        Parameters:
        fp - the file output stream to write to
        stype - the style type (0 for color, 1 for gray, 2 for black & white)
        ntype - the number type (0 for default, 1 for 20 added, 2 for 25 added)
        Throws:
        java.io.IOException - if an I/O error occurs
      • SavePsColor

        public void SavePsColor​(java.awt.Color c,
                                java.io.FileOutputStream fp,
                                int stype)
                         throws java.io.IOException
        Sets the PostScript color based on the given color and style type.
        Parameters:
        c - the color to set
        fp - the file output stream to write to
        stype - the style type (0 for color, 1 for gray, 2 for black & white)
        Throws:
        java.io.IOException - if an I/O error occurs
      • WriteString

        public void WriteString​(java.io.DataOutputStream out,
                                java.lang.String s)
                         throws java.io.IOException
        Writes a string to the specified data output stream.
        Parameters:
        out - the data output stream to write to
        s - the string to write
        Throws:
        java.io.IOException - if an I/O error occurs
      • WriteFont

        public void WriteFont​(java.io.DataOutputStream out,
                              java.awt.Font f)
                       throws java.io.IOException
        Writes a font to the specified data output stream.
        Parameters:
        out - the data output stream to write to
        f - the font to write
        Throws:
        java.io.IOException - if an I/O error occurs
      • ReadString

        public java.lang.String ReadString​(java.io.DataInputStream in)
                                    throws java.io.IOException
        Reads a string from the specified data input stream.
        Parameters:
        in - the data input stream to read from
        Returns:
        the string read from the input stream
        Throws:
        java.io.IOException - if an I/O error occurs
      • ReadFont

        public java.awt.Font ReadFont​(java.io.DataInputStream in)
                               throws java.io.IOException
        Reads a font from the specified data input stream.
        Parameters:
        in - the data input stream to read from
        Returns:
        the font read from the input stream
        Throws:
        java.io.IOException - if an I/O error occurs
      • Save

        public void Save​(java.io.DataOutputStream out)
                  throws java.io.IOException
        Saves the proof text data to the specified data output stream.
        Parameters:
        out - the data output stream 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 proof text data from the specified data input stream.
        Parameters:
        in - the data input stream to read from
        dp - the draw process
        Throws:
        java.io.IOException - if an I/O error occurs