Package wprover
Class CDistance
- java.lang.Object
-
- wprover.CClass
-
- wprover.CDistance
-
public class CDistance extends CClass
Represents a distance measurement between two points in a geometric context. This class extends CClass and provides methods for drawing, saving, and loading distance measurements.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrag(double xx, double yy)Drags the distance to a new position.voiddraw(java.awt.Graphics2D g2)Draws the distance using the given Graphics2D object.voiddraw(java.awt.Graphics2D g2, boolean isSelected)Draws the distance with the option to highlight if selected.java.lang.StringgetDescription()Gets the description of the distance.voidLoad(java.io.DataInputStream in, DrawProcess dp)Loads the distance data from an input stream.voidSave(java.io.DataOutputStream out)Saves the distance data to an output stream.voidSavePS(java.io.FileOutputStream fp, int stype)Saves the distance to a PostScript file.booleanselect(double xx, double yy)Selects the distance if the given coordinates are within its range.java.lang.StringTypeString()Gets the type string of the distance.-
Methods inherited from class wprover.CClass
copy, get_type, getColor, getColorIndex, getname, getPSLineString, hasNameSet, isdraw, saveSuper, saveSuperColor, setAttr, setAttrAux, setColor, setDash, setInFlashing, setWidth, stopFlash, toString, visible
-
-
-
-
Method Detail
-
TypeString
public java.lang.String TypeString()
Gets the type string of the distance.- Specified by:
TypeStringin classCClass- Returns:
- the type string of the distance
-
getDescription
public java.lang.String getDescription()
Gets the description of the distance.- Specified by:
getDescriptionin classCClass- Returns:
- the description of the distance
-
drag
public void drag(double xx, double yy)Drags the distance to a new position.- Parameters:
xx- the x-coordinate of the new positionyy- the y-coordinate of the new position
-
select
public boolean select(double xx, double yy)Selects the distance if the given coordinates are within its range.- Parameters:
xx- the x-coordinateyy- the y-coordinate- Returns:
- true if the distance is selected, false otherwise
-
draw
public void draw(java.awt.Graphics2D g2)
Draws the distance using the given Graphics2D object.
-
draw
public void draw(java.awt.Graphics2D g2, boolean isSelected)Draws the distance with the option to highlight if selected.- Parameters:
g2- the Graphics2D objectisSelected- true if the distance is selected, false otherwise
-
SavePS
public void SavePS(java.io.FileOutputStream fp, int stype) throws java.io.IOExceptionSaves the distance to a PostScript file.
-
Save
public void Save(java.io.DataOutputStream out) throws java.io.IOExceptionSaves the distance data to an output stream.
-
Load
public void Load(java.io.DataInputStream in, DrawProcess dp) throws java.io.IOExceptionLoads the distance data from an input stream.
-
-