public class OverlayUtils extends Object
Constructor and Description |
---|
OverlayUtils() |
Modifier and Type | Method and Description |
---|---|
protected IntegerCoord2d |
canvasToViewport(IntegerCoord2d c,
Rectangle viewport) |
protected IntegerCoord2d |
canvasToViewport(MouseEvent e,
Rectangle viewport)
Needed when wishing to adapt a coordinate relative to the canvas to the viewport frame.
|
protected PolygonArray |
canvasToViewport(PolygonArray p,
Rectangle viewport) |
protected IntegerCoord2d |
canvasToViewport(Rectangle viewport,
IntegerCoord2d c) |
static void |
drawCanvasAndViewportDiagonalComparison(Chart chart,
Graphics2D g2d) |
static void |
drawChartBorder(Graphics2D g2d,
Color c,
Chart chart)
This shows a strange behaviour in the Overlay: when trying to draw a rectangle based on the CANVAS size (i.e. the window size),
the border occupies the CHART (i.e. its actual viewport).
|
static void |
drawDiagonal(Graphics2D g2d,
Color c,
int wmax,
int hmax,
boolean sysout)
Diagonal made of points from (0,0) to (wmax, hmax).
|
static void |
drawPixel(Graphics2D g2d,
Color c,
int x,
int y) |
static void |
drawPixel(Graphics2D g2d,
Color c,
int x,
int y,
int width) |
void |
drawSelection(Graphics2D g2d,
IntegerCoord2d in,
int width,
int height) |
static void |
drawText(Graphics2D g2d,
Color c,
int x,
int y,
String txt) |
protected void |
projectionStat(PolygonArray[][] array) |
protected IntegerCoord2d |
viewportToCanvas(Chart chart,
IntegerCoord2d input,
Rectangle viewport)
Needed when wishing to display a coordinate relative to the viewport.
|
public void drawSelection(Graphics2D g2d, IntegerCoord2d in, int width, int height)
public static void drawCanvasAndViewportDiagonalComparison(Chart chart, Graphics2D g2d)
public static void drawPixel(Graphics2D g2d, Color c, int x, int y, int width)
public static void drawPixel(Graphics2D g2d, Color c, int x, int y)
public static void drawText(Graphics2D g2d, Color c, int x, int y, String txt)
public static void drawChartBorder(Graphics2D g2d, Color c, Chart chart)
public static void drawDiagonal(Graphics2D g2d, Color c, int wmax, int hmax, boolean sysout)
protected IntegerCoord2d canvasToViewport(MouseEvent e, Rectangle viewport)
protected IntegerCoord2d canvasToViewport(IntegerCoord2d c, Rectangle viewport)
protected IntegerCoord2d canvasToViewport(Rectangle viewport, IntegerCoord2d c)
protected PolygonArray canvasToViewport(PolygonArray p, Rectangle viewport)
protected IntegerCoord2d viewportToCanvas(Chart chart, IntegerCoord2d input, Rectangle viewport)
protected void projectionStat(PolygonArray[][] array)
Copyright © 2016. All rights reserved.