|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.canvas.FigCanvasRubberband
manage rubberband redrawing on a FigCanvas.
FigCanvasRubberband implements rubberbanding with double buffering for jfig.canvas.FigCanvas. The following modes are supported: lines, rectangles, bbox, circles, lines2 (xfig move-polyline-point), and possibly polylines (for xfig object-moves).
For performance reasons, all coordinates in FigCanvasRubberband are in screen coordinates.
FigCanvas
Field Summary | |
static int |
arcRubber
|
(package private) double |
aspect
|
(package private) int |
base_x
|
(package private) int |
base_y
|
(package private) int |
base2_x
|
(package private) int |
base2_y
|
(package private) FigBbox |
bbox
|
static int |
bboxRubber
|
static int |
CB
|
static int |
CC
|
static int |
circle2Rubber
|
static int |
circleRubber
|
static int |
CT
|
(package private) boolean |
debug
|
(package private) int |
dx
|
(package private) int |
dy
|
static int |
ellipseRubber
|
static int |
geometryManagedRubber
|
(package private) GeometryManager |
geometryManager
|
static int |
LB
|
static int |
LC
|
static int |
line2Rubber
|
static int |
lineRubber
|
static int |
LT
|
(package private) java.awt.Font |
mfont
|
(package private) int |
mode
|
static int |
noRubber
|
(package private) java.lang.Object |
obj
|
(package private) int |
offset_x
|
(package private) int |
offset_y
|
(package private) int |
old_x
|
(package private) int |
old_y
|
(package private) java.awt.Polygon |
pg
|
static int |
pointRubber
|
static int |
polylineRubber
|
static int |
RB
|
static int |
RC
|
static int |
rectRubber
|
static int |
restrictedBboxRubber
|
static int |
restrictedScaleRubber
|
static int |
RT
|
static int |
scaleRubber
|
(package private) boolean |
showLineLengthsEnable
|
(package private) FigTrafo2D |
trafo
|
(package private) int |
x
|
(package private) int |
y
|
Constructor Summary | |
FigCanvasRubberband(FigTrafo2D trafo)
constructor: nothing to do. |
Method Summary | |
void |
changeMode(int mode)
set a new mode for the rubberbanding. |
void |
changeMode(int mode,
FigTrafo2D trafo,
java.lang.Object obj)
set a new mode for the rubberbanding. |
void |
changeMode(int mode,
GeometryManager manager)
|
java.awt.Point |
getBasePoint()
|
boolean |
getDebug()
|
int |
getMode()
|
java.awt.Rectangle |
getRubberBoundingBox(int old_x,
int old_y,
int cur_x,
int cur_y)
calculate the bounding box Rectangle which needs to be redrawn. |
static int |
max(int a,
int b,
int c)
|
static int |
max(int a,
int b,
int c,
int d)
|
static int |
max(int a,
int b,
int c,
int d,
int e)
|
(package private) void |
measure(java.awt.Graphics g,
int delta,
int x,
int y,
int align)
utility function to format and draw a numerical value label as required by the "show line length" rubberbanding modi. |
static int |
min(int a,
int b,
int c)
|
static int |
min(int a,
int b,
int c,
int d)
|
static int |
min(int a,
int b,
int c,
int d,
int e)
|
void |
paint(java.awt.Graphics g,
int x,
int y,
boolean erase_old)
draw the rubberband (in the current mode) at new position (x,y), XOR mode should probably be set by the calling parent. |
void |
paintOnce(java.awt.Graphics g,
int x,
int y)
|
void |
setAspect(double d)
set the aspect ratio (y vs. |
void |
setBasePoint(int x,
int y)
|
void |
setBasePoint(java.awt.Point p)
set a new basepoint for the rubberband, use Point or two integers as arguments. |
void |
setBasePoint2(java.awt.Point p)
set the second basepoint for the line movePoint rubberband |
boolean |
setDebug(boolean debug)
toggle debug messages on or off |
void |
setGeometryManager(GeometryManager manager)
|
void |
setShowLineLengths(boolean b)
|
void |
setTrafo(FigTrafo2D trafo)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int noRubber
public static final int pointRubber
public static final int lineRubber
public static final int line2Rubber
public static final int rectRubber
public static final int bboxRubber
public static final int circleRubber
public static final int ellipseRubber
public static final int polylineRubber
public static final int scaleRubber
public static final int arcRubber
public static final int restrictedBboxRubber
public static final int restrictedScaleRubber
public static final int geometryManagedRubber
public static final int circle2Rubber
public static final int RC
public static final int LC
public static final int CC
public static final int CT
public static final int CB
public static final int RT
public static final int RB
public static final int LB
public static final int LT
int mode
java.lang.Object obj
FigBbox bbox
FigTrafo2D trafo
java.awt.Polygon pg
int base_x
int base_y
int base2_x
int base2_y
int old_x
int old_y
int x
int y
int dx
int dy
int offset_x
int offset_y
double aspect
boolean debug
boolean showLineLengthsEnable
java.awt.Font mfont
GeometryManager geometryManager
Constructor Detail |
public FigCanvasRubberband(FigTrafo2D trafo)
Method Detail |
public boolean setDebug(boolean debug)
public boolean getDebug()
public void setTrafo(FigTrafo2D trafo)
public void setShowLineLengths(boolean b)
public void setBasePoint(java.awt.Point p)
public void setBasePoint(int x, int y)
public void setGeometryManager(GeometryManager manager)
public void setBasePoint2(java.awt.Point p)
public void setAspect(double d)
public int getMode()
public void changeMode(int mode)
public void changeMode(int mode, GeometryManager manager)
public void changeMode(int mode, FigTrafo2D trafo, java.lang.Object obj)
public void paint(java.awt.Graphics g, int x, int y, boolean erase_old)
public java.awt.Point getBasePoint()
public void paintOnce(java.awt.Graphics g, int x, int y)
public java.awt.Rectangle getRubberBoundingBox(int old_x, int old_y, int cur_x, int cur_y)
void measure(java.awt.Graphics g, int delta, int x, int y, int align)
The "delta" value is converted from screen (pixel) coordinates to the current world coordinates via our "trafo" transformation instance, and then converted to the currently selected user units (e.g. inches). Next, the resulting value is converted via jfig.utils.Format( "%4.3f" ) into a String, which is then drawn.
Note that the resulting numerical value may be sligthly "off grid" due to 0.5-pixel rounding errors for the screen coordinate grid. This should probably be fixed to be more user-friendly.
public static final int min(int a, int b, int c)
public static final int min(int a, int b, int c, int d)
public static final int min(int a, int b, int c, int d, int e)
public static final int max(int a, int b, int c)
public static final int max(int a, int b, int c, int d)
public static final int max(int a, int b, int c, int d, int e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |