Package wprover
Class CClass
- java.lang.Object
-
- wprover.CClass
-
- Direct Known Subclasses:
CAngle,CArrow,CDistance,Cedmark,Circle,CLine,CPoint,CPolygon,CText,CTMark,CTrace
public abstract class CClass extends java.lang.ObjectCClass is an abstract class representing a geometric object with various properties and methods. It serves as a base class for different types of geometric objects.
-
-
Field Summary
Fields Modifier and Type Field Description static intANGLEstatic intARROWstatic intCIRCLEstatic intDISTANCEstatic intEQMARKstatic intLINEstatic intPOINTstatic intPOLYGONstatic intPTEXTstatic intTEMP_POINTstatic intTEXTstatic intTMARKstatic intTRACEstatic intTVALUE
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcopy(CClass c)Copies attributes from another CClass object.voiddraw(java.awt.Graphics2D g2)Draws the geometry item using the given Graphics2D object.intget_type()Gets the type of the geometry item.java.awt.ColorgetColor()Gets the color of the geometry item.intgetColorIndex()Gets the color index of the geometry item.abstract java.lang.StringgetDescription()Gets the description of the geometry item.java.lang.Stringgetname()Gets the name of the geometry item.java.lang.StringgetPSLineString(int x1, int y1, int x2, int y2)Gets the PostScript line string representation of the geometry item.booleanhasNameSet()Checks if the geometry item has a name set.booleanisdraw()Determines if the geometry item should be drawn.voidLoad(java.io.DataInputStream in, DrawProcess dp)Loads the geometry item from a data input stream.voidSave(java.io.DataOutputStream out)Saves the geometry item to a data output stream.abstract voidSavePS(java.io.FileOutputStream fp, int stype)Saves the geometry item to a PostScript file.voidsaveSuper(java.io.FileOutputStream fp)Saves the geometry item to a PostScript file.voidsaveSuperColor(java.io.FileOutputStream fp)Saves the color of the geometry item to a PostScript file.voidsetAttr(CClass c)Sets attributes for the geometry item by copying another CClass object.voidsetAttrAux()Sets auxiliary attributes for the geometry item.voidsetColor(int c)Sets the color for the geometry item.voidsetDash(int d)Sets the dash style for the geometry item.voidsetInFlashing(boolean flash)Sets the flashing mode for the geometry item.voidsetWidth(int index)Sets the width for the geometry item.voidstopFlash()Stops the flashing mode for the geometry item.java.lang.StringtoString()Returns the string representation of the geometry item.abstract java.lang.StringTypeString()Gets the type string of the geometry item.booleanvisible()Determines if the geometry item is visible.
-
-
-
Field Detail
-
POINT
public static final int POINT
- See Also:
- Constant Field Values
-
LINE
public static final int LINE
- See Also:
- Constant Field Values
-
CIRCLE
public static final int CIRCLE
- See Also:
- Constant Field Values
-
TRACE
public static final int TRACE
- See Also:
- Constant Field Values
-
DISTANCE
public static final int DISTANCE
- See Also:
- Constant Field Values
-
ANGLE
public static final int ANGLE
- See Also:
- Constant Field Values
-
POLYGON
public static final int POLYGON
- See Also:
- Constant Field Values
-
TEXT
public static final int TEXT
- See Also:
- Constant Field Values
-
TVALUE
public static final int TVALUE
- See Also:
- Constant Field Values
-
PTEXT
public static final int PTEXT
- See Also:
- Constant Field Values
-
EQMARK
public static final int EQMARK
- See Also:
- Constant Field Values
-
TMARK
public static final int TMARK
- See Also:
- Constant Field Values
-
ARROW
public static final int ARROW
- See Also:
- Constant Field Values
-
TEMP_POINT
public static final int TEMP_POINT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CClass
public CClass(CClass c)
Constructs a CClass object by copying another CClass object.- Parameters:
c- the CClass object to copy
-
CClass
public CClass(int type)
Constructs a CClass object with the specified type.- Parameters:
type- the type of the geometry item
-
-
Method Detail
-
get_type
public int get_type()
Gets the type of the geometry item.- Returns:
- the type of the geometry item
-
setInFlashing
public void setInFlashing(boolean flash)
Sets the flashing mode for the geometry item.- Parameters:
flash- true to enable flashing, false to disable
-
stopFlash
public void stopFlash()
Stops the flashing mode for the geometry item.
-
isdraw
public boolean isdraw()
Determines if the geometry item should be drawn.- Returns:
- true if the item should be drawn, false otherwise
-
visible
public boolean visible()
Determines if the geometry item is visible.- Returns:
- true if the item is visible, false otherwise
-
setAttrAux
public void setAttrAux()
Sets auxiliary attributes for the geometry item.
-
setAttr
public void setAttr(CClass c)
Sets attributes for the geometry item by copying another CClass object.- Parameters:
c- the CClass object to copy attributes from
-
copy
public void copy(CClass c)
Copies attributes from another CClass object.- Parameters:
c- the CClass object to copy attributes from
-
setDash
public void setDash(int d)
Sets the dash style for the geometry item.- Parameters:
d- the dash style index
-
setWidth
public void setWidth(int index)
Sets the width for the geometry item.- Parameters:
index- the width index
-
getname
public java.lang.String getname()
Gets the name of the geometry item.- Returns:
- the name of the geometry item
-
hasNameSet
public boolean hasNameSet()
Checks if the geometry item has a name set.- Returns:
- true if the item has a name set, false otherwise
-
getColor
public java.awt.Color getColor()
Gets the color of the geometry item.- Returns:
- the color of the geometry item
-
getColorIndex
public int getColorIndex()
Gets the color index of the geometry item.- Returns:
- the color index of the geometry item
-
draw
public void draw(java.awt.Graphics2D g2)
Draws the geometry item using the given Graphics2D object.- Parameters:
g2- the Graphics2D object
-
setColor
public void setColor(int c)
Sets the color for the geometry item.- Parameters:
c- the color index
-
TypeString
public abstract java.lang.String TypeString()
Gets the type string of the geometry item.- Returns:
- the type string of the geometry item
-
getDescription
public abstract java.lang.String getDescription()
Gets the description of the geometry item.- Returns:
- the description of the geometry item
-
toString
public java.lang.String toString()
Returns the string representation of the geometry item.- Overrides:
toStringin classjava.lang.Object- Returns:
- the string representation of the geometry item
-
SavePS
public abstract void SavePS(java.io.FileOutputStream fp, int stype) throws java.io.IOExceptionSaves the geometry item to a PostScript file.- Parameters:
fp- the file output streamstype- the show type- Throws:
java.io.IOException- if an I/O error occurs
-
saveSuperColor
public void saveSuperColor(java.io.FileOutputStream fp) throws java.io.IOExceptionSaves the color of the geometry item to a PostScript file.- Parameters:
fp- the file output stream- Throws:
java.io.IOException- if an I/O error occurs
-
saveSuper
public void saveSuper(java.io.FileOutputStream fp) throws java.io.IOExceptionSaves the geometry item to a PostScript file.- Parameters:
fp- the file output stream- Throws:
java.io.IOException- if an I/O error occurs
-
getPSLineString
public java.lang.String getPSLineString(int x1, int y1, int x2, int y2)Gets the PostScript line string representation of the geometry item.- Parameters:
x1- the x-coordinate of the starting pointy1- the y-coordinate of the starting pointx2- the x-coordinate of the ending pointy2- the y-coordinate of the ending point- Returns:
- the PostScript line string representation
-
Save
public void Save(java.io.DataOutputStream out) throws java.io.IOExceptionSaves the geometry item to a data output stream.- Parameters:
out- the data output stream- 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 geometry item from a data input stream.- Parameters:
in- the data input streamdp- the draw process- Throws:
java.io.IOException- if an I/O error occurs
-
-