public class BoxConnector extends Object
BoxConnector
allows users to visually connect two ActiveBox
objects in a Activity.Panel
. There are two modes of operation:
drawing a line between an origin point (usually the point where the user clicks on)
and a destination point, or dragging the box from one location to another. The lines can
have arrows at its ending.Modifier and Type | Field and Description |
---|---|
boolean |
active |
boolean |
arrow |
double |
arrow_angle |
static double |
ARROW_ANGLE |
double |
arrow_l |
static double |
ARROW_L |
static BasicStroke |
BASIC_STROKE |
static Color |
DEFAULT_LINE_COLOR |
static Color |
DEFAULT_XOR_COLOR |
Point2D |
dest |
static boolean |
GROW_BUG |
float |
line_width |
static float |
LINE_WIDTH |
Color |
lineColor |
boolean |
linePainted |
Point2D |
origin |
static boolean |
USE_XOR |
Color |
xorColor |
Constructor and Description |
---|
BoxConnector(JComponent setParent)
Creates new BoxConnector
|
Modifier and Type | Method and Description |
---|---|
void |
begin(Point2D p) |
void |
begin(Point2D p,
ActiveBox setBox) |
static void |
checkOptions(Options options) |
void |
drawLine(Graphics2D g2) |
static void |
drawLine(Graphics2D g2,
Point2D origin,
Point2D dest,
boolean arrow) |
static void |
drawLine(Graphics2D g2,
Point2D origin,
Point2D dest,
boolean arrow,
Color color,
Color xorColor,
double arrow_l,
double arrowAngle,
float strokeWidth) |
void |
end() |
ActiveBox |
getBox() |
static Color |
getXORColor(Color src) |
static Color |
getXORColor(Color src,
Color against) |
static void |
growRect(Rectangle r,
int h,
int w) |
void |
moveBy(double dx,
double dy) |
void |
moveTo(Point2D p) |
void |
moveTo(Point2D p,
boolean forcePaint) |
boolean |
update(Graphics2D g2,
Rectangle dirtyRegion,
ImageObserver io) |
public static final float LINE_WIDTH
public static final BasicStroke BASIC_STROKE
public static final Color DEFAULT_LINE_COLOR
public static final Color DEFAULT_XOR_COLOR
public static final double ARROW_ANGLE
public static final double ARROW_L
public static boolean USE_XOR
public static boolean GROW_BUG
public Point2D origin
public Point2D dest
public boolean arrow
public boolean active
public boolean linePainted
public double arrow_l
public double arrow_angle
public Color lineColor
public Color xorColor
public float line_width
public BoxConnector(JComponent setParent)
public boolean update(Graphics2D g2, Rectangle dirtyRegion, ImageObserver io)
public void drawLine(Graphics2D g2)
public void moveBy(double dx, double dy)
public void moveTo(Point2D p)
public void moveTo(Point2D p, boolean forcePaint)
public void begin(Point2D p)
public ActiveBox getBox()
public void end()
public static void drawLine(Graphics2D g2, Point2D origin, Point2D dest, boolean arrow)
public static void drawLine(Graphics2D g2, Point2D origin, Point2D dest, boolean arrow, Color color, Color xorColor, double arrow_l, double arrowAngle, float strokeWidth)
public static void checkOptions(Options options)
public static void growRect(Rectangle r, int h, int w)
Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.