Package wprover
Class CArrow
- java.lang.Object
-
- wprover.CClass
-
- wprover.CArrow
-
public class CArrow extends CClass
Represents an arrow in a geometric drawing. The arrow is defined by its starting and ending points, angle, and length.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubledistance(double x, double y)Calculates the distance from the given coordinates to the arrow.voiddraw(java.awt.Graphics2D g2)Draws the arrow using the given Graphics2D object.java.lang.StringgetDescription()Gets the description of the arrow.doublegetK()Gets the slope of the arrow.voidLoad(java.io.DataInputStream in, DrawProcess dp)Loads the arrow data from an input stream.voidSave(java.io.DataOutputStream out)Saves the arrow data to an output stream.voidSavePS(java.io.FileOutputStream fp, int stype)Saves the arrow to a PostScript file.java.lang.StringTypeString()Gets the type string of the arrow.-
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 arrow.- Specified by:
TypeStringin classCClass- Returns:
- the type string
-
getDescription
public java.lang.String getDescription()
Gets the description of the arrow.- Specified by:
getDescriptionin classCClass- Returns:
- the description string
-
draw
public void draw(java.awt.Graphics2D g2)
Draws the arrow using the given Graphics2D object.
-
getK
public double getK()
Gets the slope of the arrow.- Returns:
- the slope of the arrow
-
distance
public double distance(double x, double y)Calculates the distance from the given coordinates to the arrow.- Parameters:
x- the x-coordinatey- the y-coordinate- Returns:
- the distance to the arrow
-
SavePS
public void SavePS(java.io.FileOutputStream fp, int stype) throws java.io.IOExceptionSaves the arrow to a PostScript file.
-
Save
public void Save(java.io.DataOutputStream out) throws java.io.IOExceptionSaves the arrow data to an output stream.
-
Load
public void Load(java.io.DataInputStream in, DrawProcess dp) throws java.io.IOExceptionLoads the arrow data from an input stream.
-
-