com.ontimize.util.gis.client.gui.render
Class RenderingUtilities

java.lang.Object
  extended by com.ontimize.util.gis.client.gui.render.RenderingUtilities

public class RenderingUtilities
extends java.lang.Object


Constructor Summary
RenderingUtilities()
           
 
Method Summary
protected static java.awt.Shape getCircleShape(double[] centerLocation, double size)
          Get circle shape given the given size and center location
static java.awt.Rectangle getClipBoundsForGeometry(com.vividsolutions.jts.geom.Geometry geom, com.vividsolutions.jts.geom.Envelope boundingBox, java.awt.Rectangle panelRect, double strokeWidth)
          Get clip bounds for the given geometry based on the actual gis panel parameters
static java.lang.String getColorHexString(java.awt.Color color)
          Get color representation on hexadecimal code
protected static java.awt.Shape getCrossShape(double[] centerLocation, double size)
          Get cross shape given the given size and center location
static java.awt.Color getFillColorForValues(IGisRule rule, java.util.Map<java.lang.String,java.lang.Object> recordValues)
          Get fill color for the current data obtained from the color maps definition
static java.awt.Polygon getPolygonFromGeom(com.vividsolutions.jts.geom.Geometry geom, com.vividsolutions.jts.geom.Envelope boundingBox, java.awt.Rectangle panelBounds)
           
static java.lang.String[] getShapeNamesArray()
          Get the set of well-known names of possible point shapes
static java.awt.Shape getShapeToRender(double[] centerLocation, double size, java.lang.String wellKnownName)
          Get shape to render for a point in the gis panel
protected static java.awt.Shape getSquareShape(double[] centerLocation, double size)
          Get square shape given the given size and center location
protected static java.awt.Shape getStarShape(double[] centerLocation, double size)
          Get star shape given the given size and center location
static java.awt.Color getStrokeColorForValues(IGisRule rule, java.util.Map<java.lang.String,java.lang.Object> recordValues)
          Get stroke color for the current data obtained from the color maps definition
protected static java.awt.Shape getTriangleShape(double[] centerLocation, double size)
          Get triangle shape given the given size and center location
protected static java.awt.Shape getXShape(double[] centerLocation, double size)
          Get X shape given the given size and center location
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderingUtilities

public RenderingUtilities()
Method Detail

getClipBoundsForGeometry

public static java.awt.Rectangle getClipBoundsForGeometry(com.vividsolutions.jts.geom.Geometry geom,
                                                          com.vividsolutions.jts.geom.Envelope boundingBox,
                                                          java.awt.Rectangle panelRect,
                                                          double strokeWidth)
Get clip bounds for the given geometry based on the actual gis panel parameters

Parameters:
geom - Geometry to calculate bounds
boundingBox - Map bounding box area
panelRect - Map panel bounds
strokeWidth - Stroke width
Returns:
Geometry clip bounds

getColorHexString

public static java.lang.String getColorHexString(java.awt.Color color)
Get color representation on hexadecimal code

Parameters:
color - Color
Returns:
Color hexadecimal code

getPolygonFromGeom

public static java.awt.Polygon getPolygonFromGeom(com.vividsolutions.jts.geom.Geometry geom,
                                                  com.vividsolutions.jts.geom.Envelope boundingBox,
                                                  java.awt.Rectangle panelBounds)
Parameters:
geom - Interest geometry
boundingBox - Map viewer area
panelBounds - Map viewer dimension
Returns:
Polygon

getFillColorForValues

public static java.awt.Color getFillColorForValues(IGisRule rule,
                                                   java.util.Map<java.lang.String,java.lang.Object> recordValues)
Get fill color for the current data obtained from the color maps definition

Parameters:
rule - Style rule
recordValues - Data record
Returns:
Style fill color

getStrokeColorForValues

public static java.awt.Color getStrokeColorForValues(IGisRule rule,
                                                     java.util.Map<java.lang.String,java.lang.Object> recordValues)
Get stroke color for the current data obtained from the color maps definition

Parameters:
rule - Style rule
recordValues - Data record
Returns:
Style stroke color

getShapeNamesArray

public static java.lang.String[] getShapeNamesArray()
Get the set of well-known names of possible point shapes

Returns:
Array of well-known names

getShapeToRender

public static java.awt.Shape getShapeToRender(double[] centerLocation,
                                              double size,
                                              java.lang.String wellKnownName)
Get shape to render for a point in the gis panel

Parameters:
centerLocation - Center location of the point to render
size - Size of the point
wellKnownName - Name of the shape to create: "star", "square", "circle", "cross", "triangle" or "x"
Returns:
Shape to render

getSquareShape

protected static java.awt.Shape getSquareShape(double[] centerLocation,
                                               double size)
Get square shape given the given size and center location


getCircleShape

protected static java.awt.Shape getCircleShape(double[] centerLocation,
                                               double size)
Get circle shape given the given size and center location


getCrossShape

protected static java.awt.Shape getCrossShape(double[] centerLocation,
                                              double size)
Get cross shape given the given size and center location


getTriangleShape

protected static java.awt.Shape getTriangleShape(double[] centerLocation,
                                                 double size)
Get triangle shape given the given size and center location


getStarShape

protected static java.awt.Shape getStarShape(double[] centerLocation,
                                             double size)
Get star shape given the given size and center location


getXShape

protected static java.awt.Shape getXShape(double[] centerLocation,
                                          double size)
Get X shape given the given size and center location