Package wprover
Class CProveText
- java.lang.Object
-
- wprover.CProveText
-
public class CProveText extends java.lang.ObjectCProveText 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 voidclearSelection()Clears the selection of the proof text.voiddraw(java.awt.Graphics2D g2)Draws the proof text.voiddraw(java.awt.Graphics2D g2, boolean selected)Draws the proof text with the given selection state.voiddrawChild(java.awt.Graphics2D g2, java.awt.Point p)Draws the child proof text at the given point.voidexpand()Expands or collapses the proof text.CProveTextfd_text(int i)Finds the proof text with the given row index.CProveTextfindPText(wprover.UndoStruct un)Finds the proof text associated with the given undo structure.java.awt.ColorgetCaptainColor()Retrieves the color of the caption.Condgetcond()Retrieves the condition associated with this proof text.java.lang.StringgetDescription()Retrieves the description of the proof text.voidgetFlashObjectList(java.util.Vector v, DrawProcess dp)Retrieves the list of flash objects associated with the proof text.java.awt.FontgetFont()Retrieves the font used for the proof text.java.lang.StringgetHead()Retrieves the header text.java.lang.StringgetMessage()Retrieves the message text.java.awt.ColorgetMessageColor()Retrieves the color of the message.voidgetNextPosition(java.awt.Point p)Gets the next position for the proof text.java.util.VectorgetObjectList()Retrieves the list of objects associated with the undo structure.java.awt.PointgetPopExLocation()Gets the location for the pop-up menu.java.awt.RectanglegetRectangle()Retrieves the rectangle representing the bounds of this proof text.static intgetRow()Retrieves the current row counter value.java.lang.StringgetRule()Retrieves the rule associated with this proof text.java.lang.StringgetRulePath()Retrieves the path to the rule file.wprover.UndoStructgetUndoStruct()Retrieves the undo structure associated with this proof text.booleangetVisible()Checks if the proof text is visible.doublegetWidth()Retrieves the width of the proof text.booleanisExpanded()Checks if the proof text is expanded.voidLoad(java.io.DataInputStream in, DrawProcess dp)Loads the proof text data from the specified data input stream.CProveTextmouseMove(double x, double y)Handles mouse movement events.voidmove(double dx, double dy)Moves the proof text by the given offsets.CProveTextnext_prove_step(DrawProcess dp, CProveText cpt, CBoolean find)Finds the next proof step in the draw process.java.awt.FontReadFont(java.io.DataInputStream in)Reads a font from the specified data input stream.java.lang.StringReadString(java.io.DataInputStream in)Reads a string from the specified data input stream.CProveTextredo_invisible_head(DrawProcess dp)Redoes the invisible head of the proof text in the draw process.static voidresetRow()Resets the row counter to zero.booleanrun_to_begin(DrawProcess dp)Runs the proof text to the beginning of the draw process.voidSave(java.io.DataOutputStream out)Saves the proof text data to the specified data output stream.voidSavePS(java.io.FileOutputStream fp, int stype, int ntype)Saves the proof text as a PostScript file.voidSavePsColor(java.awt.Color c, java.io.FileOutputStream fp, int stype)Sets the PostScript color based on the given color and style type.voidsaveText(java.io.DataOutputStream out, int space)Saves the text representation of the proof to the specified data output stream.booleanselect(double x1, double y1)Checks if the given coordinates are within the bounds of the proof text.CProveTextselectAll(double x1, double y1)Selects all proof texts at the given coordinates.CProveTextselectChild(double x1, double y1, boolean onselect)Selects the child proof text at the given coordinates.voidsetCaptainColor(java.awt.Color c)Sets the color of the caption.voidsetCurrentPosition(java.awt.Point p)Sets the current position of the proof text.voidsetExpanded(boolean exp)Sets the expanded state of the proof text.voidsetFont(java.awt.Font f)Sets the font used for the proof text.voidsetFontSize(int size)Sets the font size for the proof text.voidsetHead(java.lang.String s)Sets the header text.voidsetIndex(int index)Sets the index for the proof text.voidsetMessage(java.lang.String s)Sets the message text.voidsetMessageColor(java.awt.Color c)Sets the color of the message.voidsetObjectList(java.util.Vector v)Sets the list of objects associated with the undo structure.voidsetRule(java.lang.String r)Sets the rule associated with this proof text.voidsetRulePath(java.lang.String path)Sets the path to the rule file.voidsetStepRowDefault()Sets the step row to the default value.voidsetVisible(boolean v)Sets the visibility of the proof text.voidsetWidth(double ww)Sets the width of the proof text.voidsetXY(double x, double y)Sets the x and y coordinates of the proof text.java.lang.StringTypeString()Retrieves the type string of the proof text.booleanundo_default(DrawProcess dp)Undoes the default action for the proof text.booleanundo_to_head(DrawProcess dp)Undoes the proof text to the head of the draw process.voidWriteFont(java.io.DataOutputStream out, java.awt.Font f)Writes a font to the specified data output stream.voidWriteString(java.io.DataOutputStream out, java.lang.String s)Writes a string to the specified data output stream.
-
-
-
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 texts2- 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 structures- 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 conditions- 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 vectorco- the conditionindex- the indexgc- 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 structureindex- 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 sety- 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 checky1- the y-coordinate to checkonselect- 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 objectsdp- 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 processcpt- the current proof textfind- 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 checky1- 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 mousey- 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 checky1- 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 bydy- 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 contextselected- 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 contextp- 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.IOExceptionSaves the text representation of the proof to the specified data output stream.- Parameters:
out- the data output stream to write tospace- 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.IOExceptionSaves the proof text as a PostScript file.- Parameters:
fp- the file output stream to write tostype- 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.IOExceptionSets the PostScript color based on the given color and style type.- Parameters:
c- the color to setfp- the file output stream to write tostype- 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.IOExceptionWrites a string to the specified data output stream.- Parameters:
out- the data output stream to write tos- 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.IOExceptionWrites a font to the specified data output stream.- Parameters:
out- the data output stream to write tof- 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.IOExceptionReads 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.IOExceptionReads 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.IOExceptionSaves 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.IOExceptionLoads the proof text data from the specified data input stream.- Parameters:
in- the data input stream to read fromdp- the draw process- Throws:
java.io.IOException- if an I/O error occurs
-
-