Class 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.

    • Constructor Detail

      • GralogGraphicsContext

        public GralogGraphicsContext()
    • Method Detail

      • 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 loop
        length - The length of the control points.
        color - Color of the line
        width - Line width (will be scaled according to zoom)
      • circle

        public abstract void circle​(double centerx,
                                    double centery,
                                    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)
      • 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)