lt.monarch.chart.util
Class ShapePainter

java.lang.Object
  extended by lt.monarch.chart.util.ShapePainter

public abstract class ShapePainter
extends java.lang.Object

Class used to paint the shape toFill and outline. It gets the required colors and other entityStyle from the style sheet and paints the shape accordingly.


Constructor Summary
Constructor and Description
ShapePainter()
           
 
Method Summary
Modifier and Type Method and Description
static Polygon2D calculateSelection(Line2D contour)
          Calculate 2 pixels thick outline around chart line
static Polygon2D calculateSelection(Polygon2D contour)
          Calculate 4 pixels thick outline around chart line
static java.awt.Image loadImage(java.lang.String imagePath)
          Loads image from specified path
static java.awt.Image loadImage(java.net.URL imageURL)
          Loads image from specified URL
static void paint(AbstractGraphics g, AbstractPaintTags tag, PaintMode paintMode, Primitive shape, Style style)
          Paints shape with fill and outline.
static void paint(AbstractGraphics g, AbstractPaintTags tag, PaintMode paintMode, Primitive shape, Style style, int index)
          Paints shape toFill and outline
static void paintFill(AbstractGraphics g, AbstractPaintTags tag, PaintMode paintMode, Primitive shape, Style style)
          Paint the polygon with fill.
static boolean paintFill(AbstractGraphics g, AbstractPaintTags tag, PaintMode paintMode, Primitive shape, Style style, int index)
          Paint the polygon toFill
static void paintOutline(AbstractGraphics g, AbstractPaintTags tag, Primitive shape, Style style)
          Paints the polygon outline.
static void paintOutline(AbstractGraphics g, AbstractPaintTags tag, Primitive shape, Style style, int index)
          Paints the polygon outline
static void paintOutlines(AbstractGraphics g, AbstractPaintTags tag, java.util.List<? extends Primitive> shapes, int shapeCount, Style style)
          Render outlines of many primitives with the same tag and style.
static void paintSurface(AbstractGraphics g, AbstractPaintTags tag, java.util.ArrayList<Polygon3D> shapes, java.util.ArrayList<java.awt.Color> colors, PaintMode paintMode, Style style)
          Paints the surface, specialized method for surfaces, which have lots of shapes and not that many states
static void paintSurfaceFrame(AbstractGraphics g, AbstractPaintTags tag, java.util.ArrayList<Polygon3D> shapes, Style style)
          Paints surface outline, specialized method for surfaces, which have lots of shapes and not that many states
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapePainter

public ShapePainter()
Method Detail

paintFill

public static boolean paintFill(AbstractGraphics g,
                                AbstractPaintTags tag,
                                PaintMode paintMode,
                                Primitive shape,
                                Style style,
                                int index)
Paint the polygon toFill

Parameters:
g - graphics context
tag - color tag, which specifies what colors to use
paintMode - painting mode
shape - shape to paint
style - style of the series
index - data point index
Returns:
was the fill painted

paintFill

public static void paintFill(AbstractGraphics g,
                             AbstractPaintTags tag,
                             PaintMode paintMode,
                             Primitive shape,
                             Style style)
Paint the polygon with fill. No index is required.

Parameters:
g - graphics context
tag - color tag, which specifies what colors to use
paintMode - painting mode
shape - shape to paint
style - style of the series

paintOutline

public static void paintOutline(AbstractGraphics g,
                                AbstractPaintTags tag,
                                Primitive shape,
                                Style style,
                                int index)
Paints the polygon outline

Parameters:
g - graphics context
tag - color tag, which specifies what colors to use
shape - shape to paint
style - style of the series
index - data point index

paintOutline

public static void paintOutline(AbstractGraphics g,
                                AbstractPaintTags tag,
                                Primitive shape,
                                Style style)
Paints the polygon outline. No index is required.

Parameters:
g - graphics context
tag - color tag, which specifies what colors to use
shape - shape to paint
style - style of the series

paintOutlines

public static void paintOutlines(AbstractGraphics g,
                                 AbstractPaintTags tag,
                                 java.util.List<? extends Primitive> shapes,
                                 int shapeCount,
                                 Style style)
Render outlines of many primitives with the same tag and style.

Parameters:
g - graphics context
tag - style tag
shapes - shapes to paint
shapeCount - number of shapes to use
style - style to use

paint

public static void paint(AbstractGraphics g,
                         AbstractPaintTags tag,
                         PaintMode paintMode,
                         Primitive shape,
                         Style style,
                         int index)
Paints shape toFill and outline

Parameters:
g - graphics context
tag - color tag, which specifies what colors to use
paintMode - painting mode
shape - shape to paint
style - style of the series
index - data point index

paint

public static void paint(AbstractGraphics g,
                         AbstractPaintTags tag,
                         PaintMode paintMode,
                         Primitive shape,
                         Style style)
Paints shape with fill and outline. No index required

Parameters:
g - graphics context
tag - color tag, which specifies what colors to use
paintMode - painting mode
shape - shape to paint
style - style of the series

loadImage

public static java.awt.Image loadImage(java.lang.String imagePath)
                                throws java.io.IOException
Loads image from specified path

Parameters:
imagePath - image path string
Returns:
Image object
Throws:
java.io.IOException - if any error occurs while loading

loadImage

public static java.awt.Image loadImage(java.net.URL imageURL)
                                throws java.io.IOException
Loads image from specified URL

Parameters:
imageURL - image URL
Returns:
Image object
Throws:
java.io.IOException - if any error occurs while loading

calculateSelection

public static Polygon2D calculateSelection(Polygon2D contour)
Calculate 4 pixels thick outline around chart line


calculateSelection

public static Polygon2D calculateSelection(Line2D contour)
Calculate 2 pixels thick outline around chart line


paintSurface

public static void paintSurface(AbstractGraphics g,
                                AbstractPaintTags tag,
                                java.util.ArrayList<Polygon3D> shapes,
                                java.util.ArrayList<java.awt.Color> colors,
                                PaintMode paintMode,
                                Style style)
Paints the surface, specialized method for surfaces, which have lots of shapes and not that many states

Parameters:
g - graphics context
tag - color tag, which specifies what colors to use
shapes - polygons to paint
colors - polygon colors
paintMode - painting mode
style - style of the series

paintSurfaceFrame

public static void paintSurfaceFrame(AbstractGraphics g,
                                     AbstractPaintTags tag,
                                     java.util.ArrayList<Polygon3D> shapes,
                                     Style style)
Paints surface outline, specialized method for surfaces, which have lots of shapes and not that many states

Parameters:
g - graphics context
tag - color tag, which specifies what colors to use
shapes - polygons to paint
style - style of the series