deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.graphics.charts
Class ChartConfig

java.lang.Object
  extended by org.deegree.graphics.charts.ChartConfig

public class ChartConfig
extends Object

This class reads the configurations file for the charts and acts as a data class for the configurations It parses the configurations file according to a given schema and throws an exception if the parsing failed It also assigns default values to variables that are not mandatory and don't exist in the configs file

Version:
$Revision: $, $Date: 25 Apr 2008 13:50:16$
Author:
Moataz Elmasry, last edited by: $Author: elmasri$

Constructor Summary
ChartConfig(URL configsPath)
          Takes in the path to the configurations file, parses it and holds its values
 
Method Summary
 Color getGenBackgroundColor()
           
 String getGenFontFamily()
           
 double getGenFontSize()
           
 String getGenFontType()
           
 String getGenRectangleInsets()
           
 Color getPieBaseSectionColor()
           
 double getPieInteriorGap()
           
 double getPieLabelGap()
           
 Color getPieShadowColor()
           
 Color getPlotBackgroundColor()
           
 double getPlotBackgroundOpacity()
           
 double getPlotForegroundOpacity()
           
protected  Color hexToColor(String hexDecimal, float alpha)
          It converts a hexdecimal to a awt.color instance
 boolean isGenAntiAliasing()
           
 boolean isGenBorderVisible()
           
 boolean isGenTextAntiAlias()
           
 boolean isLineRenderLines()
           
 boolean isLineRenderShapes()
           
 boolean isPieCircular()
           
 boolean isPlotOutlineVisible()
           
protected  void parseConfigurations(Element root)
          This is the main parsing method.
protected  void parseGeneralChartSettings(Element chartElem)
          Parses the general settings of the configurations file.
protected  void parseLinePlotSettings(Element lineplotElem)
          Parses the Line plot settings of the configurations file.
protected  void parsePiePlotSettings(Element pieplotElem)
          Parses the Pie plot settings of the configurations file.
protected  void parsePlotSettings(Element plotElem)
          Parses the plot settings of the configurations file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartConfig

public ChartConfig(URL configsPath)
            throws SAXException,
                   IOException,
                   XMLParsingException
Takes in the path to the configurations file, parses it and holds its values

Parameters:
configsPath - XML file that contains the charts configurations
Throws:
SAXException
IOException
XMLParsingException
Method Detail

parseConfigurations

protected void parseConfigurations(Element root)
                            throws XMLParsingException
This is the main parsing method. It parses the four parts of the xml configurations file: GeneralSettings, PlotSettings, PiePlotSettings and LinePlotSettings

Parameters:
root -
Throws:
XMLParsingException

parseGeneralChartSettings

protected void parseGeneralChartSettings(Element chartElem)
                                  throws XMLParsingException
Parses the general settings of the configurations file. Refer to Resources for an example file and/or schema

Parameters:
chartElem -
Throws:
XMLParsingException

parsePlotSettings

protected void parsePlotSettings(Element plotElem)
                          throws XMLParsingException
Parses the plot settings of the configurations file. Refer to Resources for an example file and/or schema The plot is the actual chart, while everything outside it is the general settings

Parameters:
plotElem -
Throws:
XMLParsingException

parsePiePlotSettings

protected void parsePiePlotSettings(Element pieplotElem)
                             throws XMLParsingException
Parses the Pie plot settings of the configurations file. Refer to Resources for an example file and/or schema

Parameters:
pieplotElem -
Throws:
XMLParsingException

parseLinePlotSettings

protected void parseLinePlotSettings(Element lineplotElem)
                              throws XMLParsingException
Parses the Line plot settings of the configurations file. Refer to Resources for an example file and/or schema

Parameters:
lineplotElem -
Throws:
XMLParsingException

hexToColor

protected Color hexToColor(String hexDecimal,
                           float alpha)
                    throws NumberFormatException
It converts a hexdecimal to a awt.color instance

Parameters:
hexDecimal - it can start with # or not
alpha - between 0..1
Returns:
generated color
Throws:
NumberFormatException - if the given hex decimal could not be parsed.

isGenAntiAliasing

public boolean isGenAntiAliasing()
Returns:
is enabled Antialiasing for the chart

getGenBackgroundColor

public Color getGenBackgroundColor()
Returns:
Background color of the chart

isGenBorderVisible

public boolean isGenBorderVisible()
Returns:
is cart borders visible

getGenFontFamily

public String getGenFontFamily()
Returns:
font family of the chart

getGenFontSize

public double getGenFontSize()
Returns:
font size of the chart

getGenFontType

public String getGenFontType()
Returns:
font type of the chart

isPlotOutlineVisible

public boolean isPlotOutlineVisible()
Returns:
is chart outline visible

getGenRectangleInsets

public String getGenRectangleInsets()
Returns:
RectangleInsets of the chart

isGenTextAntiAlias

public boolean isGenTextAntiAlias()
Returns:
is enabled Text AntiAliasing

isLineRenderLines

public boolean isLineRenderLines()
Returns:
is enabled line rendering in Line Chart

isLineRenderShapes

public boolean isLineRenderShapes()
Returns:
is enabled shape rendering in Line Chart

getPieBaseSectionColor

public Color getPieBaseSectionColor()
Returns:
BaseSectionColor of Pie chart

isPieCircular

public boolean isPieCircular()
Returns:
is the Pie Chart circular

getPieInteriorGap

public double getPieInteriorGap()
Returns:
interior gap of the Pie chart

getPieLabelGap

public double getPieLabelGap()
Returns:
label gap of the Pie Chart

getPlotBackgroundColor

public Color getPlotBackgroundColor()
Returns:
Background color of the general plot

getPlotBackgroundOpacity

public double getPlotBackgroundOpacity()
Returns:
Background opacity of the general plot

getPlotForegroundOpacity

public double getPlotForegroundOpacity()
Returns:
Foreground opacity of the plot

getPieShadowColor

public Color getPieShadowColor()
Returns:
Shadow Color of the Pie Chart

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org