|
| static String | truncate (final String label, final int width, final FontMetrics metrics) |
| |
| static void | drawDot (final Graphics2D g2, final Color color, final int x0, final int y0, final double r) |
| |
| static void | drawEllipse (final Graphics2D g2, final double x0, final double y0) |
| |
| static void | drawDiamond (final Graphics2D g2, final Color color, final double x0, final double y0, final double r) |
| |
| static void | drawTriangle (final Graphics2D g2, final Color color, final int x0, final int y0, final int w, final int h2, final boolean reverse) |
| |
| static void | drawTriangle (final Graphics2D g2, final Color color, final int x0, final int y0, final int w, final int h2, final boolean reverse, final double rotation) |
| |
| static void | drawUpwardTriangle (final Graphics2D g2, final Color color, final int x0, final int y0, final int w2, final int h) |
| |
| static int | getCenteringOffset (final int n, final int w) |
| |
| static Dimension | getLabelDimension (final String text, final Font font) |
| |
Renderer utilities
- Author
- Bernard Bou
◆ Utils()
| grammarscope.browser.renderer.Utils.Utils |
( |
| ) |
|
|
private |
◆ drawDiamond()
| static void grammarscope.browser.renderer.Utils.drawDiamond |
( |
final Graphics2D |
g2, |
|
|
final Color |
color, |
|
|
final double |
x0, |
|
|
final double |
y0, |
|
|
final double |
r |
|
) |
| |
|
static |
Draw diamond
- Parameters
-
| g2 | graphics context |
| color | color |
| x0 | x coordinate |
| y0 | y coordinate |
| r | radius |
◆ drawDot()
| static void grammarscope.browser.renderer.Utils.drawDot |
( |
final Graphics2D |
g2, |
|
|
final Color |
color, |
|
|
final int |
x0, |
|
|
final int |
y0, |
|
|
final double |
r |
|
) |
| |
|
static |
Draw dot
- Parameters
-
| g2 | graphics context |
| color | color |
| x0 | x coordinate |
| y0 | y coordinate |
| r | radius |
◆ drawEllipse()
| static void grammarscope.browser.renderer.Utils.drawEllipse |
( |
final Graphics2D |
g2, |
|
|
final double |
x0, |
|
|
final double |
y0 |
|
) |
| |
|
static |
Draw ellipse
- Parameters
-
| g2 | graphics context |
| x0 | x coordinate |
| y0 | y coordinate |
◆ drawTriangle() [1/2]
| static void grammarscope.browser.renderer.Utils.drawTriangle |
( |
final Graphics2D |
g2, |
|
|
final Color |
color, |
|
|
final int |
x0, |
|
|
final int |
y0, |
|
|
final int |
w, |
|
|
final int |
h2, |
|
|
final boolean |
reverse |
|
) |
| |
|
static |
Draw triangle
- Parameters
-
| g2 | graphics context |
| color | color |
| x0 | x coordinate |
| y0 | y coordinate |
| w | arrow width |
| h2 | arrow half height |
| reverse | reverse |
◆ drawTriangle() [2/2]
| static void grammarscope.browser.renderer.Utils.drawTriangle |
( |
final Graphics2D |
g2, |
|
|
final Color |
color, |
|
|
final int |
x0, |
|
|
final int |
y0, |
|
|
final int |
w, |
|
|
final int |
h2, |
|
|
final boolean |
reverse, |
|
|
final double |
rotation |
|
) |
| |
|
static |
- Parameters
-
| g2 | graphics context |
| color | color |
| x0 | x coordinate |
| y0 | y coordinate |
| w | arrow width |
| h2 | arrow half height |
| reverse | reverse |
| rotation | rotation of triangle |
◆ drawUpwardTriangle()
| static void grammarscope.browser.renderer.Utils.drawUpwardTriangle |
( |
final Graphics2D |
g2, |
|
|
final Color |
color, |
|
|
final int |
x0, |
|
|
final int |
y0, |
|
|
final int |
w2, |
|
|
final int |
h |
|
) |
| |
|
static |
Draw triangle
- Parameters
-
| g2 | graphics context |
| color | color |
| x0 | x coordinate |
| y0 | y coordinate |
| w2 | arrow half width |
| h | arrow height |
◆ getCenteringOffset()
| static int grammarscope.browser.renderer.Utils.getCenteringOffset |
( |
final int |
n, |
|
|
final int |
w |
|
) |
| |
|
static |
Get centering offset for a node with n edges and given x2
- Parameters
-
| n | number of incoming and outgoing nodes |
| w | x2 |
- Returns
- centering offset for a node with n edges
◆ getLabelDimension()
| static Dimension grammarscope.browser.renderer.Utils.getLabelDimension |
( |
final String |
text, |
|
|
final Font |
font |
|
) |
| |
|
static |
Get label dimensions
- Parameters
-
- Returns
- dimension
◆ truncate()
| static String grammarscope.browser.renderer.Utils.truncate |
( |
final String |
label, |
|
|
final int |
width, |
|
|
final FontMetrics |
metrics |
|
) |
| |
|
static |
Truncate label to width
- Parameters
-
| label | label |
| width | width |
| metrics | font metrics |
- Returns
- truncate label
The documentation for this class was generated from the following file:
- grammarscope/browser/src/main/java/grammarscope/browser/renderer/Utils.java