Package com.algo.rendering
Class GralogGraphicsContext
- java.lang.Object
-
- com.algo.rendering.GralogGraphicsContext
-
public abstract class GralogGraphicsContext extends java.lang.Object
This class offers abstract drawing and drawing utility methods.Utilities include drawing tooltips and transparent rectangles for selection boxes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GralogGraphicsContext.Bezier
static class
GralogGraphicsContext.LineType
static class
GralogGraphicsContext.Loop
-
Constructor Summary
Constructors Constructor Description GralogGraphicsContext()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
arrow(Vector2D dir, Vector2D pos, Arrow arrowType, double scale, GralogColor color)
void
arrow(Vector2D dir, Vector2D pos, Arrow arrowType, double scale, GralogColor color, double lineWidth)
abstract void
circle(double centerx, double centery, double radius, GralogColor color)
void
circle(Vector2D center, double radius, GralogColor color)
abstract void
drawBezier(GralogGraphicsContext.Bezier curve, GralogColor color, double width, GralogGraphicsContext.LineType type)
abstract void
drawQuadratic(GralogGraphicsContext.Bezier curve, GralogColor color, double width, GralogGraphicsContext.LineType type)
abstract void
fillDiamond(double x1, double y1, double x2, double y2, GralogColor color)
void
fillOval(double x, double y, double width, double height)
abstract void
fillOval(double x, double y, double width, double height, GralogColor color)
void
fillOval(Vector2D center, double width, double height, GralogColor color)
abstract void
fillRectangle(double x1, double y1, double x2, double y2, GralogColor color)
abstract void
line(double x1, double y1, double x2, double y2, GralogColor color, double width, GralogGraphicsContext.LineType type)
void
line(Vector2D from, Vector2D to, GralogColor color, double width, GralogGraphicsContext.LineType type)
abstract void
lines(double[] x, double[] y, int count, GralogColor color, double lineWidth)
abstract void
loop(GralogGraphicsContext.Loop l, double length, double correction, GralogColor color, double width, GralogGraphicsContext.LineType type)
Draws a curved bezier line from start to end.abstract void
polygon(double[] x, double[] y, int count, GralogColor color)
abstract void
putText(double centerx, double centery, java.lang.String text, double lineHeightCm, GralogColor color)
void
putText(Vector2D center, java.lang.String text, double lineHeightCm, GralogColor color)
abstract void
selectionRectangle(java.awt.geom.Point2D from, java.awt.geom.Point2D to, java.awt.Color color)
abstract void
strokeDiamond(double x1, double y1, double x2, double y2, double strokeWidth, GralogColor color)
abstract void
strokeOval(double x, double y, double width, double height, double strokeWidth, GralogColor color)
void
strokeOval(Vector2D center, double width, double height, double strokeWidth, GralogColor color)
abstract void
strokeRectangle(double x1, double y1, double x2, double y2, double strokeWidth, GralogColor color)
abstract void
strokeRectangle(double x1, double y1, double x2, double y2, double strokeWidth, GralogGraphicsContext.LineType line)
-
-
-
Method Detail
-
line
public abstract void line(double x1, double y1, double x2, double y2, GralogColor color, double width, GralogGraphicsContext.LineType type)
-
line
public void line(Vector2D from, Vector2D to, GralogColor color, double width, GralogGraphicsContext.LineType type)
-
arrow
public abstract void arrow(Vector2D dir, Vector2D pos, Arrow arrowType, double scale, GralogColor color)
-
arrow
public void arrow(Vector2D dir, Vector2D pos, Arrow arrowType, double scale, GralogColor color, double lineWidth)
-
polygon
public abstract void polygon(double[] x, double[] y, int count, GralogColor color)
-
lines
public abstract void lines(double[] x, double[] y, int count, GralogColor color, double lineWidth)
-
loop
public abstract void loop(GralogGraphicsContext.Loop l, double length, double correction, GralogColor color, double width, GralogGraphicsContext.LineType type)
Draws a curved bezier line from start to end. The control points are positively perpendicular to the line from start to end. The length of control points can be set.Can use to draw self loops of vertices.
- Parameters:
l
- all relevant vectors of looplength
- The length of the control points.color
- Color of the linewidth
- Line width (will be scaled according to zoom)
-
circle
public abstract void circle(double centerx, double centery, double radius, GralogColor color)
-
circle
public void circle(Vector2D center, double radius, GralogColor color)
-
strokeOval
public abstract void strokeOval(double x, double y, double width, double height, double strokeWidth, GralogColor color)
-
strokeOval
public void strokeOval(Vector2D center, double width, double height, double strokeWidth, GralogColor color)
-
fillOval
public abstract void fillOval(double x, double y, double width, double height, GralogColor color)
-
fillOval
public void fillOval(Vector2D center, double width, double height, GralogColor color)
-
fillOval
public void fillOval(double x, double y, double width, double height)
-
fillRectangle
public abstract void fillRectangle(double x1, double y1, double x2, double y2, GralogColor color)
-
strokeRectangle
public abstract void strokeRectangle(double x1, double y1, double x2, double y2, double strokeWidth, GralogColor color)
-
strokeRectangle
public abstract void strokeRectangle(double x1, double y1, double x2, double y2, double strokeWidth, GralogGraphicsContext.LineType line)
-
strokeDiamond
public abstract void strokeDiamond(double x1, double y1, double x2, double y2, double strokeWidth, GralogColor color)
-
fillDiamond
public abstract void fillDiamond(double x1, double y1, double x2, double y2, GralogColor color)
-
drawBezier
public abstract void drawBezier(GralogGraphicsContext.Bezier curve, GralogColor color, double width, GralogGraphicsContext.LineType type)
-
drawQuadratic
public abstract void drawQuadratic(GralogGraphicsContext.Bezier curve, GralogColor color, double width, GralogGraphicsContext.LineType type)
-
selectionRectangle
public abstract void selectionRectangle(java.awt.geom.Point2D from, java.awt.geom.Point2D to, java.awt.Color color)
-
putText
public abstract void putText(double centerx, double centery, java.lang.String text, double lineHeightCm, GralogColor color)
-
putText
public void putText(Vector2D center, java.lang.String text, double lineHeightCm, GralogColor color)
-
-