|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.commands.Command jfig.commands.CreateDimensioningCommand
create a dimensioning annotation from two specified endpoints
CreateDimensioningCommand allows to easily create a dimensioning annotation in CAD-style for given coordinates. In order to avoid a new non-xfig-compatible object type, we create a compound object that includes the arrows, marker lines, text background rectangle, and text. Use the following properties to control the algorithm:
jfig.commands.CreateDimensioningCommand.font helvetica jfig.commands.CreateDimensioningCommand.fontsize 12 jfig commands.CreateDimensioningCommand.format %6.2g jfig commands.CreateDimensioningCommand.units mm jfig.commands.CreateDimensioningCommand.color black jfig.commands.CreateDimensioningCommand.arrowhead 2.0,6.0,1 // w l t jfig.commands.CreateDimensioningCommand.linewidth 1 // FIG units jfig.commands.CreateDimensioningCommand.markerlength 2.0 // mm jfig.commands.CreateDimensioningCommand.layer 200 jfig.commands.CreateDimensioningCommand.outerArrowLimit 10 // mmMarkerlength is the length of the short marker lines orthogonal to the main dimensioning line, while linewidth (d) is the width of the dimensioning lines (in FIG units). The arrowheads are set to conform to the German DIN standards, i.e. length (5*d) and opening angle (15?), and arrowhead filled. When the distance between the endpoints of the dimensioning is smaller than outerArrowLimit (default 10 millimeters), the dimensioning automagically uses 'outer' arrows instead of the single double-headed 'inner' arrow. Specify outerArrowLimit=0.0 to disable this. You can also call the static createDimensioning( Point, Point ) method directly, e.g. to create dimensioning annotation in 'batch mode'.
Field Summary | |
protected FigCompound |
dimensioning
|
protected int |
n_points
|
protected java.awt.Point |
P
|
protected java.awt.Point |
Q
|
Fields inherited from class jfig.commands.Command |
editor, objectCanvas, ready |
Constructor Summary | |
CreateDimensioningCommand(FigBasicEditor editor,
FigCanvas objectCanvas)
|
Method Summary | |
void |
cancel()
cancel the current editor command |
static FigCompound |
createDimensioning(java.awt.Point P,
java.awt.Point Q,
FigTrafo2D trafo)
according to 'Hoischen, Technisches Zeichnen, 23rd Edition, 1990' we need the following: |
void |
execute()
execute the current editor command |
java.lang.String |
getDescription()
one-line description of this command |
static java.awt.Point[] |
getMarkerPoints(java.awt.Point origin,
double dx,
double dy,
double norm,
double len)
|
FigObject[] |
getModifiedObjects()
return an array-wrapped reference to the polyline object created by this command. |
void |
mousePressed(FigCanvasEvent evt)
mousePressed: specify the start and end points for this dimensioning. |
java.lang.String |
toString()
return a (possibly verbose) description of this Command object |
void |
undo()
undo this command |
Methods inherited from class jfig.commands.Command |
isReady, message, notifyEditor, statusMessage |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.awt.Point P
protected java.awt.Point Q
protected FigCompound dimensioning
protected int n_points
Constructor Detail |
public CreateDimensioningCommand(FigBasicEditor editor, FigCanvas objectCanvas)
Method Detail |
public FigObject[] getModifiedObjects()
getModifiedObjects
in class Command
public void execute()
Command
This method is empty for class Command.
execute
in class Command
public void cancel()
Command
cancel and cleanup the current command. Note that this method is empty for class Command, but might be implemented by subclasses.
cancel
in class Command
public void undo()
Command
Try to undo this command as far as possible. Don't try to undo() a command that has never been execute()d before. This method is empty for class Command.
undo
in class Command
public static java.awt.Point[] getMarkerPoints(java.awt.Point origin, double dx, double dy, double norm, double len)
public static FigCompound createDimensioning(java.awt.Point P, java.awt.Point Q, FigTrafo2D trafo)
let 'd' be the width of the line this dimensioning belongs to, where d is one of the norm widths, i.e. { 0.25, 0.35, 0.5, 0.7, 1.0 } millimeters. Then
public void mousePressed(FigCanvasEvent evt)
mousePressed
in class Command
public java.lang.String getDescription()
Command
return a one-line desription of this command, e.g. to label the undo/redo buttons, if any
getDescription
in class Command
public java.lang.String toString()
Command
toString
in class Command
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |