deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.graphics.charts
Class ChartConfig

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

public class ChartConfig
extends java.lang.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(java.net.URL configsPath)
          Takes in the path to the configurations file, parses it and holds its values
 
Method Summary
 java.awt.Color getGenBackgroundColor()
           
 java.lang.String getGenFontFamily()
           
 double getGenFontSize()
           
 java.lang.String getGenFontType()
           
 java.lang.String getGenRectangleInsets()
           
 java.awt.Color getPieBaseSectionColor()
           
 double getPieInteriorGap()
           
 double getPieLabelGap()
           
 java.awt.Color getPieShadowColor()
           
 java.awt.Color getPlotBackgroundColor()
           
 double getPlotBackgroundOpacity()
           
 double getPlotForegroundOpacity()
           
protected  java.awt.Color hexToColor(java.lang.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(org.w3c.dom.Element root)
          This is the main parsing method.
protected  void parseGeneralChartSettings(org.w3c.dom.Element chartElem)
          Parses the general settings of the configurations file.
protected  void parseLinePlotSettings(org.w3c.dom.Element lineplotElem)
          Parses the Line plot settings of the configurations file.
protected  void parsePiePlotSettings(org.w3c.dom.Element pieplotElem)
          Parses the Pie plot settings of the configurations file.
protected  void parsePlotSettings(org.w3c.dom.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(java.net.URL configsPath)
            throws org.xml.sax.SAXException,
                   java.io.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:
org.xml.sax.SAXException
java.io.IOException
XMLParsingException
Method Detail

parseConfigurations

protected void parseConfigurations(org.w3c.dom.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(org.w3c.dom.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(org.w3c.dom.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(org.w3c.dom.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(org.w3c.dom.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 java.awt.Color hexToColor(java.lang.String hexDecimal,
                                    float alpha)
                             throws java.lang.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:
java.lang.NumberFormatException - if the given hex decimal could not be parsed.

isGenAntiAliasing

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

getGenBackgroundColor

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

isGenBorderVisible

public boolean isGenBorderVisible()
Returns:
is cart borders visible

getGenFontFamily

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

getGenFontSize

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

getGenFontType

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

isPlotOutlineVisible

public boolean isPlotOutlineVisible()
Returns:
is chart outline visible

getGenRectangleInsets

public java.lang.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 java.awt.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 java.awt.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 java.awt.Color getPieShadowColor()
Returns:
Shadow Color of the Pie Chart

deegree 2.5 (2011/06/29 09:44 build-8-official)

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