public class NavDecorations extends Object
| Modifier and Type | Method and Description |
|---|---|
static Decoration |
center(Icon icon,
Point p)
Utility function to center a symmetric icon at a point.
|
static Decoration |
center1d(Icon icon,
boolean isY,
Point p,
Rectangle bounds)
Utility function to center one of the 1-dimensional zoom icons
about a given point on its axis.
|
static BandDecoration |
createBandDecoration(Point p1,
Point p2,
boolean xuse,
boolean yuse,
Rectangle bounds)
Returns a decoration appropriate for a 2d frame zoom.
|
static Decoration |
createCenterDecoration(Point p)
Returns a simple marker at a point.
|
static Decoration |
createDragDecoration(Point p,
double xfact,
double yfact,
boolean xuse,
boolean yuse,
Rectangle bounds)
Returns a decoration appropriate for a 2d drag zoom.
|
static Decoration |
createWheelDecoration(Point p,
double xfact,
double yfact,
boolean xuse,
boolean yuse,
Rectangle bounds)
Returns a decoration appropriate for a 2d wheel zoom.
|
static void |
drawArrow(Graphics g,
int x0,
int y0,
int x1,
int y1)
Draws a line with an arrow head at one end.
|
static Graphics2D |
prepareGraphics(Graphics g)
Sets graphics context ready for navigation decorations.
|
public static Decoration createCenterDecoration(Point p)
p - positionppublic static Decoration createWheelDecoration(Point p, double xfact, double yfact, boolean xuse, boolean yuse, Rectangle bounds)
p - reference pointxfact - X direction zoom factoryfact - Y direction zoom factorxuse - true if X zoom is in effectyuse - true if Y zoom is in effectbounds - plot region boundspublic static Decoration createDragDecoration(Point p, double xfact, double yfact, boolean xuse, boolean yuse, Rectangle bounds)
p - reference pointxfact - X direction zoom factoryfact - Y direction zoom factorxuse - true if X zoom is in effectyuse - true if Y zoom is in effectbounds - plot region boundspublic static BandDecoration createBandDecoration(Point p1, Point p2, boolean xuse, boolean yuse, Rectangle bounds)
p1 - drag start pointp2 - drag (current) end pointxuse - true if X zoom is in effectyuse - true if Y zoom is in effectbounds - plot region boundspublic static Decoration center(Icon icon, Point p)
icon - iconp - central pointpublic static Decoration center1d(Icon icon, boolean isY, Point p, Rectangle bounds)
icon - iconisY - false for X axis annotation, true for Y axis annotationp - reference pointbounds - plot boundspublic static void drawArrow(Graphics g, int x0, int y0, int x1, int y1)
g - graphics contextx0 - start X coordinatey0 - start Y coordinatex1 - end (arrow) X coordinatey1 - end (arrow) Y coordinatepublic static Graphics2D prepareGraphics(Graphics g)
g - supplied graphics contextgCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.