|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--sub_arctic.lib.min_interactor
|
+--sub_arctic.lib.base_interactor
|
+--sub_arctic.lib.line_display
Class to display a line with optional arrowheads. Note: the presence of the arrowheads makes it that case that the endpoints of the line are not necessarily at the corners of the bounding box (consider, for example, a horizontal line). This unfortunately makes use of the line with constraints still a bit problematical.
| Field Summary | |
protected int |
_arrow_head_angle
The angle (in degrees) between each of the arrowhead lines and the line itself. |
protected int |
_arrow_head_length
The length of the edges of the arrowhead lines. |
protected java.awt.Point |
line_end
Record of line end point. |
protected java.awt.Point |
line_start
Record of line start point. |
protected static int |
NEG_DIAG
Interactor flag bit to indicate if line is negatively sloped: 0,0 -> w,h [true] or positively sloped: 0,h -> w,0 [false]. |
| Fields inherited from class sub_arctic.lib.base_interactor |
_child_index,
_child_list,
_clip_bounds,
_constraint_flags,
_enabled_constraint,
_flags,
_h,
_h_constraint,
_parent,
_part_a_constraint,
_part_b_constraint,
_user_data,
_visible_constraint,
_w,
_w_constraint,
_x,
_x_constraint,
_y,
_y_constraint,
default_child_hint |
| Constructor Summary | |
line_display(int x1,
int y1,
int x2,
int y2,
int arrowheads)
Constructor with arrowhead defaults. |
|
line_display(int x1,
int y1,
int x2,
int y2,
int arrowheads,
int l,
int a)
Full constructor. |
|
| Method Summary | |
int |
arrow_head_angle()
The angle (in degrees) between each of the arrowhead lines and the line itself. |
int |
arrow_head_length()
The length of the edges of the arrowhead lines. |
int |
arrow_heads()
Number of arrowheads. |
void |
draw_self_local(drawable d)
Draw the image of the line |
boolean |
neg_diag()
Indicate if line is negatively sloped (i.e., to be interpreted as 0,0 -> w,h rather than 0,h -> w,0). |
static java.util.Vector |
phase2(double radius,
int length,
int angle)
phase 2 computes the locations of the points given that the arrow was along the x axis, pointing right. |
void |
set_arrow_head_angle(int a)
Set the angle (in degrees) between each of the arrowhead lines and the line itself. |
void |
set_arrow_head_length(int l)
Set the length of the edges of the arrowhead lines. |
void |
set_arrow_heads(int h)
Set the number of arrowheads. |
void |
set_coords(int x1,
int y1,
int x2,
int y2)
Set the position of the line. |
int |
x1()
Return x1 in parent's coordinate system. |
int |
x2()
Return x2 in parent's coordinate system. |
int |
y1()
Return y1 in parent's coordinate system. |
int |
y2()
Return y2 in parent's coordinate system. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected static final int NEG_DIAG
protected java.awt.Point line_start
protected java.awt.Point line_end
protected int _arrow_head_length
protected int _arrow_head_angle
| Constructor Detail |
public line_display(int x1,
int y1,
int x2,
int y2,
int arrowheads)
int - x1 x1 coordinate of the line.int - y1 y1 coordinate of the line.int - x2 x2 coordinate of the line.int - y2 y2 coordinate of the line.int - arrowheads the number of arrowheads to draw (must be 0,1, or 2).
public line_display(int x1,
int y1,
int x2,
int y2,
int arrowheads,
int l,
int a)
int - x1 x1 coordinate of the line.int - y1 y1 coordinate of the line.int - x2 x2 coordinate of the line.int - y2 y2 coordinate of the line.int - arrowheads the number of arrowheads to draw (must be 0,1, or 2).| Method Detail |
public boolean neg_diag()
public int x1()
public int y1()
public int x2()
public int y2()
public void set_coords(int x1,
int y1,
int x2,
int y2)
int - x1 x1 coordinate of the line (in parent's coordinate system).int - y1 y1 coordinate of the line (in parent's coordinate system).int - x1 x1 coordinate of the line (in parent's coordinate system).int - y1 y1 coordinate of the line (in parent's coordinate system).public void draw_self_local(drawable d)
public void set_arrow_heads(int h)
int - h number of arrowheads on this line.public int arrow_heads()
public int arrow_head_length()
public void set_arrow_head_length(int l)
int - l the length of the edges of the arrowhead lines.public int arrow_head_angle()
public void set_arrow_head_angle(int a)
int - a angle (in degrees) between arrowhead lines and the line
itself.
public static java.util.Vector phase2(double radius,
int length,
int angle)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||