|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.objects.LineWrapper
draw attributed lines using AWT 1.0.
LineWrapper provides a wrapper for drawing of variable Width lines (depending on internal line width and zoom factor) for use by other editor objects.
Additionally, LineWrapper uses the timestamp information from the current viewport transformation and the last internal modification to decide whether a new world-coordinate -> screen-coordinate transformation is necessary.
Support for fat lines is currently done with filled polygons for each line part. This should probably use some better algorithm to get smooth corners.
Field Summary | |
(package private) java.awt.Point |
anchor
|
(package private) FigAttribs |
attribs
|
(package private) java.awt.Point[][] |
dashes
|
(package private) boolean |
debug
|
(package private) int |
dx
|
(package private) int |
dy
|
(package private) java.awt.Polygon[] |
fillers
|
(package private) boolean |
graphicsWasTranslated
|
(package private) boolean |
is_closed
|
(package private) int |
np
|
(package private) java.awt.Point |
old_anchor
|
(package private) FigObject |
parent
|
(package private) boolean |
pen_down
|
(package private) java.awt.Polygon[] |
polygons
|
(package private) java.awt.Point |
sp
|
(package private) int[] |
sx
|
(package private) int[] |
sy
|
(package private) long |
timestamp
|
(package private) FigTrafo2D |
trafo
|
(package private) int |
visible_linewidth
|
(package private) java.awt.Point[] |
wcp
|
(package private) java.awt.Point |
wp
|
(package private) int[] |
xf
|
(package private) int[] |
xp
|
(package private) int[] |
yf
|
(package private) int[] |
yp
|
Constructor Summary | |
LineWrapper(FigObject parent,
FigTrafo2D trafo,
java.awt.Point[] wcp,
boolean closed)
basic LineWrapper constructor. |
Method Summary | |
(package private) double |
build_dashes_segment(java.util.Vector DD,
java.awt.Point P,
java.awt.Point Q,
double missingLength)
build_dashes_segment(): Given the segment i .. |
(package private) void |
build_fillers()
Create and construct the polygons to fill the space between adjacent polyline segments. |
(package private) void |
buildDashes()
buildDashes(): build the array with the individual dash-lines from the lines world-coordinates in the wcp[] array. |
void |
buildScreenPoints()
the transformation has changed for this line. |
int[] |
getScreenPointsX()
|
int[] |
getScreenPointsY()
|
long |
getTimestamp()
|
void |
message(java.lang.String s)
|
void |
paint(java.awt.Graphics g)
|
void |
paintAWT11(java.awt.Graphics g)
paint(): Check whether we the viewport transformation has changed. |
void |
paintDashes(java.awt.Graphics g)
paintDashes(): this is a dashed/dotted line. |
void |
reset_debug()
turn of the debug output |
void |
set_debug()
activate debug output |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
java.awt.Point[] wcp
int[] sx
int[] sy
java.awt.Polygon[] polygons
java.awt.Polygon[] fillers
FigObject parent
FigTrafo2D trafo
FigAttribs attribs
boolean is_closed
java.awt.Point[][] dashes
boolean pen_down
long timestamp
boolean graphicsWasTranslated
java.awt.Point anchor
java.awt.Point old_anchor
int dx
int dy
boolean debug
int visible_linewidth
int[] xp
int[] yp
int np
int[] xf
int[] yf
java.awt.Point wp
java.awt.Point sp
Constructor Detail |
public LineWrapper(FigObject parent, FigTrafo2D trafo, java.awt.Point[] wcp, boolean closed)
parent
- The FigObject that uses this LineWrappertrafo
- The current editor viewport transformation,
needed for the wc->sc transformationwcp
- The Point[] array with the world-coords for the
line.closed
- Whether this line should be closed (P_n+1 = P_0)Method Detail |
public long getTimestamp()
public void set_debug()
public void reset_debug()
public int[] getScreenPointsX()
public int[] getScreenPointsY()
void build_fillers()
public void buildScreenPoints()
void buildDashes()
double build_dashes_segment(java.util.Vector DD, java.awt.Point P, java.awt.Point Q, double missingLength)
public void paintDashes(java.awt.Graphics g)
public void paint(java.awt.Graphics g)
public void paintAWT11(java.awt.Graphics g)
Currently only one-pixel wide lines are supported.
public void message(java.lang.String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |