|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjview.ArrowIcon
public class ArrowIcon
An icon that implements an arrow pointing in any direction up/down/left/right. Even multiple arrow heads are allowed. No arrow heads render a square. The principal dimension of the arrow are best studied using the following image (/z/wooz/stella/clipart/all_arrows.png).
| Nested Class Summary | |
|---|---|
static class |
ArrowIcon.Show
Test class for display. |
| Field Summary | |
|---|---|
static String |
ACTIONCOMMAND
The action-event command for continuous-exposure button. |
private double |
angle
The arrow opening angle. |
private Color |
back
The background color, or from main component. |
private double |
base
The arrow base width, follows from angle and head. |
static double |
DEFANGLE
Default miter angle in degrees. |
static double |
DEFHEAD
Default relative size of an arrow head. |
static double |
DEFHIGH
Default relative size of a vertical arrow neck. |
static double |
DEFLEN
Default relative size of a horizontal arrow neck. |
static double |
DEFQUAD
Default relative size of the arrows quadratic box. |
static double |
DEFSIZE
The default icon size multiplication factor. |
static int |
DOWN
The integer value for arrow head down. |
private Color |
fill
The fill color, or foreground from main component. |
private double |
head
The arrow head size. |
private double |
high
The arrow half-height, 0-.5. |
private Insets |
inset
If icon is drawn with special insets. |
static int |
LEFT
The integer value for arrow head left. |
private double |
len
The arrow length, 0-1. |
private int |
mask
All head directions. |
private Color |
outline
The forground color, or from main component. |
private double |
quad
The arrow quadratic portion. |
static int |
RIGHT
The integer value vor for arrow head. |
static int |
UP
The integer value for arrow head up. |
private double |
zoom
This icon is customizable in size, but fix sized once constructed. |
| Constructor Summary | |
|---|---|
ArrowIcon(int arrows)
Minimum constructor, specifying only the arrow directions as an bit-wise or of UP, LEFT, DOWN, and
RIGHT. |
|
ArrowIcon(int arrows,
double size)
Constructs a new arrow icon with all arrow properties, but no colors specified. |
|
ArrowIcon(int arrows,
double size,
double q,
double l,
double h,
double a,
double deg)
Constructs a new arrow icon with all arrow properties, but no colors specified. |
|
ArrowIcon(int arrows,
double size,
double q,
double l,
double h,
double a,
double deg,
Color o,
Color f,
Color b)
Constructs a new arrow icon with all arrow properties specified. |
|
| Method Summary | |
|---|---|
private Polygon |
getArrowPolygon(int x0,
int y0)
Calculates the actual arrow polygon, upper left corner of entire Icon is x, y. |
private int |
getHorizontalArrowCount()
Counts the number of horizontal arrows, 0, 1, or 2. |
int |
getIconHeight()
The height of the icon equals the size specified on construct. |
int |
getIconWidth()
The width of the icon equals the size specified on construct. |
Insets |
getInsets()
Gets the additional insets. |
private int |
getVerticalArrowCount()
Counts the number of vertical arrows, 0, 1, or 2. |
boolean |
isHorizontalArrow()
Returns true, if the mask implies at least one arrow in horizontal direction. |
boolean |
isVerticalArrow()
Returns true, if the mask implies at least one arrow in vertical direction. |
void |
paintIcon(Component button,
Graphics g,
int x,
int y)
Paints the icon. |
void |
setColor(Color o,
Color f,
Color b)
Sets outline, fill and background color, in that order. |
void |
setGeometry(double q,
double l,
double h,
double a,
double deg)
Changes the geometry of the displayed arrow(s). |
void |
setInsets(Insets i)
Sets additional insets. |
void |
setSize(double s)
Sets the magnification of the arrow, which is the size in pixel of the quadratic arrow box. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ACTIONCOMMAND
public static final int UP
public static final int LEFT
public static final int DOWN
public static final int RIGHT
public static final double DEFSIZE
public static final double DEFQUAD
public static final double DEFLEN
public static final double DEFHIGH
public static final double DEFHEAD
public static final double DEFANGLE
private double zoom
private double quad
private double len
private double high
private double head
private double base
private double angle
private Color outline
private Color fill
private Color back
private int mask
private Insets inset
| Constructor Detail |
|---|
public ArrowIcon(int arrows)
UP, LEFT, DOWN, and
RIGHT. Default size is DEFSIZE, which is the size
in pixel if no arrow heads are specified (shows as a
solid square)
public ArrowIcon(int arrows,
double size)
public ArrowIcon(int arrows,
double size,
double q,
double l,
double h,
double a,
double deg)
public ArrowIcon(int arrows,
double size,
double q,
double l,
double h,
double a,
double deg,
Color o,
Color f,
Color b)
| Method Detail |
|---|
public void setInsets(Insets i)
public void setGeometry(double q,
double l,
double h,
double a,
double deg)
public void setColor(Color o,
Color f,
Color b)
public void setSize(double s)
public Insets getInsets()
public boolean isHorizontalArrow()
public boolean isVerticalArrow()
public int getIconWidth()
getIconWidth in interface Iconpublic int getIconHeight()
getIconHeight in interface Icon
public void paintIcon(Component button,
Graphics g,
int x,
int y)
paintIcon in interface Icon
private Polygon getArrowPolygon(int x0,
int y0)
private int getHorizontalArrowCount()
private int getVerticalArrowCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||