com.davisor.graphics.chart
Class ChartObjectAttributes

java.lang.Object
  extended bycom.davisor.graphics.chart.ChartObjectAttributes
All Implemented Interfaces:
ChartAttributes, com.davisor.core.Dupable, java.io.Serializable
Direct Known Subclasses:
ChartXMLAttributes

public class ChartObjectAttributes
extends java.lang.Object
implements ChartAttributes

ChartObjectAttributes implements a chart attribute set where the attribute values are stored in corresponding object member variables. For more information about the attributes themselves, please see ChartAttributes interface documentation.

This object storage method is neccessary when attributes are manipulated and accessed during and before chart processing. When storing or moving the attributes, use the toString() method to convert the attributes into corresponding XML string representation.

Since:
JDK1.3
See Also:
Chart, ChartData, ChartMultiAttributes, ChartStringAttributes, ChartXMLAttributes, Serialized Form

Field Summary
protected  int M_antialiasMode
          Antialiasing mode (OFF, ON, or AUTO, defaults to AUTO).
protected  java.util.List M_axes
          Chart axes, one or more.
protected  BackRenderAttributes M_back
          Chart background area render attributes (may be null).
protected  java.lang.String M_chartType
          Requested chart image encoding mime type (may be null).
protected  java.lang.String M_contentType
          Requested chart image encoding mime type (may be null).
protected  com.davisor.graphics.codec.MimeInfo M_encoderInfo
          Chart encode info, if available (may be null).
protected  java.lang.Number M_height
          Chart height in millimeters (may be null).
protected  java.lang.String M_id
          Attribute set identity (may be null).
protected  java.lang.String M_imageParams
          Arbitrary image parameters.
protected  LegendAttributes M_legendAttributes
          Legend attributes
protected  java.util.Locale M_locale
          Chart locale (may be null).
protected  java.lang.Boolean M_multiSeriesMode
          Multiseries mode (may be null)
protected  java.lang.String M_namespace
          Shapes namespace.
protected  PlotRenderAttributes M_plot
          Chart plot area render attributes (may be null).
protected  java.lang.Number M_resolution
          Chart raster image pixels-per-millimeter resolution (may be null).
protected  java.net.URL M_urlContext
          URL address context to complete partial URL addresses (may be null).
protected  java.lang.Number M_width
          Chart width in millimeters (may be null).
 
Constructor Summary
ChartObjectAttributes()
          Default constructor.
ChartObjectAttributes(ChartObjectAttributes ca, boolean deep)
          Copy constructor with control over deep or shallow copy policy.
ChartObjectAttributes(java.lang.Number width, java.lang.Number height, java.lang.Number resolution, BackRenderAttributes back, PlotRenderAttributes plot, java.util.List axes, java.util.Locale locale, java.net.URL urlContext, java.lang.String contentType, java.lang.String chartType, java.lang.Boolean multiSeriesMode)
          Creates a new chart attributes set.
 
Method Summary
 void addChannelAttributes(ChartData data)
          Adding channels from the data This method delegates adding channel attributes to the plot render attributes.
protected  void appendXMLBodyTags(java.lang.StringBuffer xml)
          Appends a XML body tags.
protected  void appendXMLEndTag(java.lang.StringBuffer xml)
          Appends a XML tag that ends objects XML representation.
protected  void appendXMLStartTag(java.lang.StringBuffer xml)
          Appends a XML tag that starts objects XML representation.
 java.lang.Object clone()
          Makes a shallow copy of this object.
 com.davisor.core.Dupable dup()
          Makes a deep copy of this object.
 boolean equals(java.lang.Object object)
          Test if these attributes equal to given attributes.
 int getAntialiasMode()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.util.List getAxes()
          Implements a ChartAttributes interface method with a concrete implementation.
 BackRenderAttributes getBack()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.String getChartType()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.String getContentType()
          Implements a ChartAttributes interface method with a concrete implementation.
 com.davisor.graphics.codec.MimeInfo getEncoderInfo()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.Number getHeight()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.String getID()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.String getImageParams()
          Implements a ChartAttributes interface method with a concrete implementation.
 LegendAttributes getLegend()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.util.Locale getLocale()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.Boolean getMultiSeriesMode()
          Gets multiseries mode.
 java.lang.String getName(java.lang.String id)
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.String getNamespace()
          Gets the namespace for shapes.
 PlotRenderAttributes getPlot()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.Number getResolution()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.net.URL getURLContext()
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.Number getWidth()
          Implements a ChartAttributes interface method with a concrete implementation.
 boolean isArea(java.lang.String id, PlotRenderAttributes plot)
          Tests channel fill status.
 boolean isSeries(java.lang.String id)
          Deprecated. Use ChartFactory#isMultiSeriesMode instead
 void setAntialiasMode(int antialiasMode)
          Implements a ChartAttributes interface method with a concrete implementation.
 void setAntialiasMode(java.lang.String antialiasMode)
          Sets chart antialiasing mode with a keyword.
 void setBack(BackRenderAttributes back)
          Sets back area render attributes.
 void setChartType(java.lang.String chartType)
          Sets chart factory type.
 void setContentType(java.lang.String contentType)
          Implements a ChartAttributes interface method with a concrete implementation.
 void setHeight(java.lang.Number height, boolean inherit)
          Implements a ChartAttributes interface method with a concrete implementation.
 void setImageParams(java.lang.String imageParams)
          Implements a ChartAttributes interface method with a concrete implementation.
 void setLegend(LegendAttributes legend)
          Sets legend attributes.
 void setLocale(java.util.Locale locale)
          Sets chart locale.
 void setLocale(java.lang.String locale)
          Sets chart locale.
 void setMultiSeriesMode(java.lang.Boolean multiSeriesMode)
          Sets multiseries mode.
 void setNamespace(java.lang.String namespace)
          Set the namespace for shapes.
 void setPlot(PlotRenderAttributes plot)
          Sets plot area render attributes.
 void setResolution(java.lang.Number resolution)
          Implements a ChartAttributes interface method with a concrete implementation.
 void setURLContext(java.net.URL urlContext)
          Implements a ChartAttributes interface method with a concrete implementation.
 void setWidth(java.lang.Number width, boolean inherit)
          Implements a ChartAttributes interface method with a concrete implementation.
 java.lang.String toString()
          Gets chart attributes XML representation.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

M_antialiasMode

protected int M_antialiasMode
Antialiasing mode (OFF, ON, or AUTO, defaults to AUTO).


M_axes

protected java.util.List M_axes
Chart axes, one or more.


M_back

protected BackRenderAttributes M_back
Chart background area render attributes (may be null).


M_chartType

protected java.lang.String M_chartType
Requested chart image encoding mime type (may be null).


M_encoderInfo

protected com.davisor.graphics.codec.MimeInfo M_encoderInfo
Chart encode info, if available (may be null).


M_contentType

protected java.lang.String M_contentType
Requested chart image encoding mime type (may be null).


M_height

protected java.lang.Number M_height
Chart height in millimeters (may be null).


M_id

protected java.lang.String M_id
Attribute set identity (may be null).


M_imageParams

protected java.lang.String M_imageParams
Arbitrary image parameters.


M_locale

protected java.util.Locale M_locale
Chart locale (may be null).


M_multiSeriesMode

protected java.lang.Boolean M_multiSeriesMode
Multiseries mode (may be null)


M_namespace

protected java.lang.String M_namespace
Shapes namespace.


M_plot

protected PlotRenderAttributes M_plot
Chart plot area render attributes (may be null).


M_resolution

protected java.lang.Number M_resolution
Chart raster image pixels-per-millimeter resolution (may be null).


M_urlContext

protected java.net.URL M_urlContext
URL address context to complete partial URL addresses (may be null).


M_width

protected java.lang.Number M_width
Chart width in millimeters (may be null).


M_legendAttributes

protected LegendAttributes M_legendAttributes
Legend attributes

Constructor Detail

ChartObjectAttributes

public ChartObjectAttributes()
Default constructor.


ChartObjectAttributes

public ChartObjectAttributes(ChartObjectAttributes ca,
                             boolean deep)
Copy constructor with control over deep or shallow copy policy. Deep copies are completely distinct from the original object while shallow copies share the same plot, back, channel, and legend attributes, but not axes. In particular, the new object attributes copy will never share ChartAxis objects with the original source object. Please note also, that after a deep copy, the new chart axes plot render attribute instances are made to inherit new general plot attribute values.

Parameters:
ca - attributes to be copied
deep - deep copy flag
See Also:
clone(), dup()

ChartObjectAttributes

public ChartObjectAttributes(java.lang.Number width,
                             java.lang.Number height,
                             java.lang.Number resolution,
                             BackRenderAttributes back,
                             PlotRenderAttributes plot,
                             java.util.List axes,
                             java.util.Locale locale,
                             java.net.URL urlContext,
                             java.lang.String contentType,
                             java.lang.String chartType,
                             java.lang.Boolean multiSeriesMode)
Creates a new chart attributes set. The attributes include default axes, too. The chart image type is resolved by the given encoder type. If explicit information about the suitable image type is not found, TYPE_INT_RGB is used.

Parameters:
width - chart width, in millimeters (may be null)
height - chart height, in millimeters (may be null)
resolution - raster pixels-per-millimeter resolution (may be null)
back - chart background rendering attributes
plot - default plot area rendering attributes
axes - chart axes attributes
locale - chart locale (may be null)
urlContext - base URL for partial address completition (may be null)
contentType - intended chart image MIME type (may be null)
chartType - intended chart factory type (may be null)
multiSeriesMode - multiseries mode (may be null)
See Also:
MimeInfo
Method Detail

getAntialiasMode

public int getAntialiasMode()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getAntialiasMode in interface ChartAttributes
Returns:
RenderAttributes antialias code
See Also:
ChartAttributes.getAntialiasMode()

getAxes

public java.util.List getAxes()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getAxes in interface ChartAttributes
Returns:
chart axes
See Also:
ChartAttributes.getAxes()

getBack

public BackRenderAttributes getBack()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getBack in interface ChartAttributes
Returns:
chart bacground render attributes
See Also:
ChartAttributes.getBack()

getChartType

public java.lang.String getChartType()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getChartType in interface ChartAttributes
Returns:
chart factory type, or null if unset
See Also:
ChartAttributes.getChartType()

getEncoderInfo

public com.davisor.graphics.codec.MimeInfo getEncoderInfo()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getEncoderInfo in interface ChartAttributes
Returns:
chart content encoder information, which defaults to image/png encoder information if encoder has not been explicitly set
See Also:
ChartAttributes.getEncoderInfo()

getContentType

public java.lang.String getContentType()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getContentType in interface ChartAttributes
Returns:
chart content encoder MIME type (may be null)
See Also:
ChartAttributes.getContentType()

getHeight

public java.lang.Number getHeight()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getHeight in interface ChartAttributes
Returns:
chart height (may be null)
See Also:
ChartAttributes.getHeight()

getID

public java.lang.String getID()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getID in interface ChartAttributes
See Also:
ChartAttributes.getID()

getImageParams

public java.lang.String getImageParams()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getImageParams in interface ChartAttributes
Returns:
chart image encoder parameters, or null if unset
See Also:
ChartAttributes.getImageParams()

getLegend

public LegendAttributes getLegend()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getLegend in interface ChartAttributes
Returns:
legend attributes (may be null)
See Also:
ChartAttributes.getLegend()

getLocale

public java.util.Locale getLocale()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getLocale in interface ChartAttributes
Returns:
chart locale, or null if unset
See Also:
ChartAttributes.getLocale()

getMultiSeriesMode

public java.lang.Boolean getMultiSeriesMode()
Gets multiseries mode.

Specified by:
getMultiSeriesMode in interface ChartAttributes
Returns:
multi series mode, or null if unset

getName

public java.lang.String getName(java.lang.String id)
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getName in interface ChartAttributes
Returns:
channel name, or null if channel is unknown, or channel name is unset
See Also:
ChartAttributes.getName(java.lang.String)

getNamespace

public java.lang.String getNamespace()
Gets the namespace for shapes.

Specified by:
getNamespace in interface ChartAttributes
Returns:
namespace, or null if namespace is unset

getPlot

public PlotRenderAttributes getPlot()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getPlot in interface ChartAttributes
Returns:
channel plot area rendering parameters
See Also:
ChartAttributes.getPlot()

getResolution

public java.lang.Number getResolution()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getResolution in interface ChartAttributes
Returns:
pixels-per-millimeter resolution (may be null)
See Also:
ChartAttributes.getResolution()

getURLContext

public java.net.URL getURLContext()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getURLContext in interface ChartAttributes
Returns:
chart URL context for completing partial URL addresses, or null if unset
See Also:
ChartAttributes.getURLContext()

getWidth

public java.lang.Number getWidth()
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
getWidth in interface ChartAttributes
Returns:
chart width (may be null)
See Also:
ChartAttributes.getWidth()

isArea

public boolean isArea(java.lang.String id,
                      PlotRenderAttributes plot)
Tests channel fill status. If plot area or channel line paint attributes is defined, the channel is an area channel, otherwise it is not.

Specified by:
isArea in interface ChartAttributes
Parameters:
id - channel identity
plot - plot attributes to use in the test
Returns:
channel fill status
See Also:
getPlot()

isSeries

public boolean isSeries(java.lang.String id)
Deprecated. Use ChartFactory#isMultiSeriesMode instead

Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
isSeries in interface ChartAttributes
Parameters:
id - channel identity
See Also:
ChartAttributes.isSeries(java.lang.String)

setAntialiasMode

public void setAntialiasMode(int antialiasMode)
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
setAntialiasMode in interface ChartAttributes
Parameters:
antialiasMode - RenderAttributes antialias code
See Also:
setAntialiasMode(String), ChartAttributes.setAntialiasMode(int)

setContentType

public void setContentType(java.lang.String contentType)
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
setContentType in interface ChartAttributes
See Also:
ChartAttributes.setContentType(java.lang.String)

setHeight

public void setHeight(java.lang.Number height,
                      boolean inherit)
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
setHeight in interface ChartAttributes
Parameters:
height - new chart height (may be null)
inherit - should null value inherit or override old value
See Also:
ChartAttributes.getHeight()

setImageParams

public void setImageParams(java.lang.String imageParams)
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
setImageParams in interface ChartAttributes
See Also:
ChartAttributes.setImageParams(java.lang.String)

setResolution

public void setResolution(java.lang.Number resolution)
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
setResolution in interface ChartAttributes
See Also:
ChartAttributes.setResolution(java.lang.Number)

setURLContext

public void setURLContext(java.net.URL urlContext)
Implements a ChartAttributes interface method with a concrete implementation.

Specified by:
setURLContext in interface ChartAttributes
See Also:
ChartAttributes.setURLContext(java.net.URL)

setWidth

public void setWidth(java.lang.Number width,
                     boolean inherit)
Implements a ChartAttributes interface method with a concrete implementation.

If encoder info is available, and it contains a width base value greater than '1', chart width, if given, is rounded up to be an even multiple of that width base value.

Specified by:
setWidth in interface ChartAttributes
Parameters:
width - new chart width (may be null)
inherit - should null value inherit or override old value
See Also:
ChartAttributes.getWidth()

dup

public com.davisor.core.Dupable dup()
Makes a deep copy of this object.

Specified by:
dup in interface com.davisor.core.Dupable
See Also:
clone(), ChartObjectAttributes(ChartObjectAttributes,boolean)

clone

public java.lang.Object clone()
Makes a shallow copy of this object.

See Also:
dup(), ChartObjectAttributes(ChartObjectAttributes,boolean)

equals

public boolean equals(java.lang.Object object)
Test if these attributes equal to given attributes.


toString

public java.lang.String toString()
Gets chart attributes XML representation.

See Also:
ChartData.toString(), BackRenderAttributes.toString(), PlotRenderAttributes.toString(), ChartAxes.toString(), ChartXMLAttributes

setAntialiasMode

public void setAntialiasMode(java.lang.String antialiasMode)
Sets chart antialiasing mode with a keyword. The following keywords are recognized case-insensitively:

Parameters:
antialiasMode - RenderAttributes antialias keyword
See Also:
getAntialiasMode(), setAntialiasMode(int), RenderAttributes.toAntialiasMode(String)

setBack

public void setBack(BackRenderAttributes back)
Sets back area render attributes.


setChartType

public void setChartType(java.lang.String chartType)
Sets chart factory type.


setLegend

public void setLegend(LegendAttributes legend)
Sets legend attributes.


setLocale

public void setLocale(java.util.Locale locale)
Sets chart locale.

Parameters:
locale - new locale (may be null)

setLocale

public void setLocale(java.lang.String locale)
               throws com.davisor.core.InvalidParameterException
Sets chart locale.

Parameters:
locale - locale string as understood by LocaleParser.createLocale(String) (may be null)
Throws:
com.davisor.core.InvalidParameterException - if given locale string is invalid

setMultiSeriesMode

public void setMultiSeriesMode(java.lang.Boolean multiSeriesMode)
Sets multiseries mode. Usually this is determined from the number of series in the chart data, but user can set it also manually.

Parameters:
multiSeriesMode - multi series mode (may be null)
See Also:
getMultiSeriesMode(), ChartFactory.isMultiSeriesMode(com.davisor.graphics.chart.ChartData, com.davisor.graphics.chart.ChartAttributes)

setNamespace

public void setNamespace(java.lang.String namespace)
Set the namespace for shapes.


setPlot

public void setPlot(PlotRenderAttributes plot)
Sets plot area render attributes.


addChannelAttributes

public void addChannelAttributes(ChartData data)
Adding channels from the data This method delegates adding channel attributes to the plot render attributes.

Specified by:
addChannelAttributes in interface ChartAttributes
Parameters:
data - from which channels are to be added
See Also:
ChannelAttributes.getID(), ChannelAttributes.setDefaults(com.davisor.graphics.chart.ChannelAttributes)

appendXMLStartTag

protected void appendXMLStartTag(java.lang.StringBuffer xml)
Appends a XML tag that starts objects XML representation.


appendXMLEndTag

protected void appendXMLEndTag(java.lang.StringBuffer xml)
Appends a XML tag that ends objects XML representation.


appendXMLBodyTags

protected void appendXMLBodyTags(java.lang.StringBuffer xml)
Appends a XML body tags.



Copyright © 2001-2004 Davisor Oy. All Rights Reserved.