com.davisor.graphics.chart
Interface ChartAttributes

All Superinterfaces:
com.davisor.core.Dupable, java.io.Serializable
All Known Implementing Classes:
ChartObjectAttributes, ChartStringAttributes

public interface ChartAttributes
extends com.davisor.core.Dupable, java.io.Serializable

Chart attributes.

ChartAttributes represents chart factory settings that tell chart factories the rendering details that they should manufacture charts with. ChartAttributes is one of the three major classes that control chart generation. The two other major components are:

This documentation gives a summary description of all chart attributes and their meaning. Advanced attribute types used by many chart attributes are not, however, described herein. More information about them may be found in the reference documentation describing the corresponding attribute value classes.

Overview

Chart attributes are divided into the following attribute groups, contained in instances of the following classes:

Each attribute group contains a number of attributes, each of which affects one particular appearance aspect within the domain of the attribute group. The attributes in each group are described in the documentation of each corresponding class or interface.

Attribute value inheritance

Attributes may be spesified in several different ways and locations, as convenient for each application. The locations have a definitive priority order, which controls which attribute value will be used in case the attribute has been specified in several places. The attributes, their declaration locations and their relative priorities are listed in a separate xml reference document.

Basic attributes

Objects that implement ChartAttributes interface are expected to contain a basic set of chart attributes that control the following chart aspects:

Factory type

Chart factory type is an informative attribute only, that may be used to record the suggested factory type these attributes are designed for. However, the attribute itself has no effect on anything by itself. Instead, applications wishing to utilize this information must explicitly use the attribute value in chart factory selection process, in the way convenient for that particular application.

Use getChartType() to access the chart factory type attribute.

URL context

URL address context is used to complete partially unspecified URL addresses encountered during chart processing. Chart factories use URL addresses to access many external resources, like texture image data. With a URL context it also becomes possible to refer to resources with relative URL addresses, anchored with a URL context.

Use getURLContext() to access the chart URL context attribute.

Locale

The chart locale controls locale sensitive material formatting and parsing. A missing locale setting defaults to the system default locale.

Use getLocale() to access the chart locale attribute.

Formats

Chart attributes may also contain a set of dynamic text formatting attributes that control the generation of automatic text fields:

Graphics annotation

Graphics annotation is a general mechanism for associating hyperlink references and description texts on any graphics' shapes, lines, points, or areas. When properly encoded, graphical browsers displaying chart contents may then, for example utilize this information by allowing users to navigate to other documents by clicking annotated hotspot areas on chart contents. Another use would be to display additional information as the mouse pointer hovers over a specific content area.

Format strings themselves are tuple format patterns, which have the power to access chart data information. For details about how format patterns are constructed and how chart data fields are accessed, please see the TupleFormat and ChartData documentation.

Format patterns may also be overridden by more explicit values directly defined in the chart data. In particular, values defined in label, url, or alt data channels are preferred to format pattern. Furthermore, annotation information may also be placed in the paint attribute, in ways described in the PaintParameters and AnnotatedPaintValue documentation.

Content attributes

The chart's content attributes control the following chart content aspects:

Chart content size and resolution

The chart's content size is defined by width and height attributes, expressed in SI millimeters. If the chart is being drawn into a raster image, the size of the target raster canvas in pixels is defined by the chart content size and resolution. The default resolution is 1 pixel per millimeter.

Leaving one or both of the chart size attributes to null values will instruct the chart factories to decide suitable chart sizes by themselves. In that case, the size attributes associated with the resulting Chart will tell the chart size that the responsible factory came up with.

Chart content encoding

Content MIME type and other encoding details control in which format the final chart content is to be packed in. Chart factories need these details in advance, in order to be able to create suitable contents to draw into. In particular, it is neccessary to know beforehand if the content is to be represented in text, vector, or raster format. The details about content construction are covered in the ImageFactory documentation.

Use getContentType() and setContentType(java.lang.String) to access the chart content type attributes.

Chart content antialiasiation

The chart antialisation mode controls the preferred rendering antialisation policy. However, depending on content encoding settings and underlying Java graphics platform implementation, antialiasiation may or may not be possible or meaningfull. The antialisation mode attribute is therefore more of a recommendation setting. Available antialisation modes are:

Use getAntialiasMode() and setAntialiasMode(int) to access the chart content antialiasiation mode attributes.

Since:
JDK1.2
See Also:
AnnotatedGraphics2D, BackRenderAttributes, Chart, ChartData, ChartFactory, ColorType, FontType, ImageFactory, MimeInfo, PaintType, PlotRenderAttributes, ShapeType, StrokeType

Method Summary
 void addChannelAttributes(ChartData data)
          Copies channel attributes from the given chart data object and merges them with current channel attributes.
 int getAntialiasMode()
          Gets chart antialiasing mode.
 java.util.List getAxes()
          Gets chart axes list.
 BackRenderAttributes getBack()
          Gets back area render attributes.
 java.lang.String getChartType()
          Gets chart factory type.
 java.lang.String getContentType()
          Gets chart content MIME type.
 com.davisor.graphics.codec.MimeInfo getEncoderInfo()
          Gets chart content encoder info.
 java.lang.Number getHeight()
          Gets chart height as described by Chart.getHeight().
 java.lang.String getID()
          Gets attribute set identity.
 java.lang.String getImageParams()
          Gets the image encoder detail parameters.
 LegendAttributes getLegend()
          Gets legend rendering attributes.
 java.util.Locale getLocale()
          Gets chart locale.
 java.lang.Boolean getMultiSeriesMode()
          Gets multiseries mode.
 java.lang.String getName(java.lang.String id)
          Gets name of given channel.
 java.lang.String getNamespace()
          Gets the namespace for shapes.
 PlotRenderAttributes getPlot()
          Gets plot area render attributes.
 java.lang.Number getResolution()
          Gets chart raster image pixels-per-millimeter resolution, as described by Chart.getResolution().
 java.net.URL getURLContext()
          Gets chart base URL context.
 java.lang.Number getWidth()
          Gets chart width, as described by Chart.getWidth().
 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)
          Sets chart antialiasing mode.
 void setContentType(java.lang.String contentType)
          Sets chart content MIME type.
 void setHeight(java.lang.Number height, boolean inherit)
          Sets chart height.
 void setImageParams(java.lang.String imageParams)
          Sets parameters that control image creation and encoding.
 void setResolution(java.lang.Number resolution)
          Sets chart raster image pixels-per-millimeter resolution.
 void setURLContext(java.net.URL urlContext)
          Sets chart base URL context.
 void setWidth(java.lang.Number width, boolean inherit)
          Sets chart width.
 
Methods inherited from interface com.davisor.core.Dupable
dup
 

Method Detail

addChannelAttributes

public void addChannelAttributes(ChartData data)
Copies channel attributes from the given chart data object and merges them with current channel attributes. If the chart data contains channel attributes for channels that already have channel attributes, the channel attributes from the chart data become default values for the current attributes. New channel attributes for channels not already covered by chart attributes are added to the set of covered channels.

Parameters:
data - the ChannelAttributes.
See Also:
ChannelAttributes.getID(), ChannelAttributes.setDefaults(com.davisor.graphics.chart.ChannelAttributes)

getAntialiasMode

public int getAntialiasMode()
Gets chart antialiasing mode.

Returns:
RenderAttributes antialias code
See Also:
setAntialiasMode(int), ImageChart.setAntialiasMode(int)

getAxes

public java.util.List getAxes()
Gets chart axes list. The list contains ChartAxes objects.

Returns:
chart axes

getBack

public BackRenderAttributes getBack()
Gets back area render attributes. If back area render attributes have not yet been defined, default attributes are created, stored and returned.

Returns:
chart bacground render attributes

getChartType

public java.lang.String getChartType()
Gets chart factory type.

Returns:
chart factory type, or null if unset
See Also:
ChartFactory.getFactory(String)

getEncoderInfo

public com.davisor.graphics.codec.MimeInfo getEncoderInfo()
Gets chart content encoder info.

Returns:
chart content encoder information, which defaults to image/png encoder information if encoder has not been explicitly set

getContentType

public java.lang.String getContentType()
Gets chart content MIME type. A null value indicates that chart generator may choose freely choose appopriate content encoding method. Any other value indicates that a chart generator must use the given encoding, or otherwise emit nothing.

Returns:
chart content encoder MIME type (may be null)
See Also:
Chart.getContentType()

getHeight

public java.lang.Number getHeight()
Gets chart height as described by Chart.getHeight().

Returns:
chart height (may be null)
See Also:
getWidth(), getResolution(), Chart.getHeight()

getID

public java.lang.String getID()
Gets attribute set identity.


getImageParams

public java.lang.String getImageParams()
Gets the image encoder detail parameters.

Returns:
chart image encoder parameters, or null if unset
See Also:
setImageParams(java.lang.String), CodecFactory.getImageEncoder(java.lang.String)

getLegend

public LegendAttributes getLegend()
Gets legend rendering attributes.

Returns:
legend attributes (may be null)

getLocale

public java.util.Locale getLocale()
Gets chart locale.

Returns:
chart locale, or null if unset

getMultiSeriesMode

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

Returns:
multi series mode, or null if unset

getName

public java.lang.String getName(java.lang.String id)
Gets name of given channel.

Returns:
channel name, or null if channel is unknown, or channel name is unset
See Also:
ChannelAttributes.getName()

getNamespace

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

Returns:
namespace, or null if namespace is unset

getPlot

public PlotRenderAttributes getPlot()
Gets plot area render attributes. If plot attributes have not been defined yet, they are created now, stored and returned.

Returns:
channel plot area rendering parameters

getResolution

public java.lang.Number getResolution()
Gets chart raster image pixels-per-millimeter resolution, as described by Chart.getResolution().

Returns:
pixels-per-millimeter resolution (may be null)
See Also:
setResolution(java.lang.Number), Chart.getResolution()

getURLContext

public java.net.URL getURLContext()
Gets chart base URL context.

Returns:
chart URL context for completing partial URL addresses, or null if unset
See Also:
setURLContext(java.net.URL)

getWidth

public java.lang.Number getWidth()
Gets chart width, as described by Chart.getWidth().

Returns:
chart width (may be null)
See Also:
getHeight(), getResolution(), Chart.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.

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

Tests if a channel is a data series.

See Also:
ChannelAttributes.isSeries()

setAntialiasMode

public void setAntialiasMode(int antialiasMode)
Sets chart antialiasing mode. The mode is expected to be one of the following constants:

Parameters:
antialiasMode - RenderAttributes antialias code
See Also:
getAntialiasMode(), ImageChart.setAntialiasMode(int)

setContentType

public void setContentType(java.lang.String contentType)
Sets chart content MIME type. This will also set chart image encoder info, and corresponding image type, if possible. If not, image type is set to TYPE_INT_RGB.


setHeight

public void setHeight(java.lang.Number height,
                      boolean inherit)
Sets chart height. Missing value will either make the chart to keep the old height value, or make it undetermined. Undetermined height value invites chart factories to resolve optimal height by themselves.

Parameters:
height - new chart height (may be null)
inherit - should null value inherit or override old value
See Also:
getHeight()

setImageParams

public void setImageParams(java.lang.String imageParams)
Sets parameters that control image creation and encoding. These parameters consist of a by white space separated list of name=value pairs, which will be interpreted by ImageFactory and CodecFactory. Parameter interpretation will be image encoder spesific. Unrecognized parameters are ignored.

See Also:
ImageFactory, CodecFactory

setResolution

public void setResolution(java.lang.Number resolution)
Sets chart raster image pixels-per-millimeter resolution.

See Also:
getResolution()

setURLContext

public void setURLContext(java.net.URL urlContext)
Sets chart base URL context.

See Also:
getURLContext()

setWidth

public void setWidth(java.lang.Number width,
                     boolean inherit)
Sets chart width. Missing value will either make the chart to keep the old width value, or make it undetermined. Undetermined width value invites chart factories to resolve optimal width by themselves.

Parameters:
width - new chart width (may be null)
inherit - should null value inherit or override old value
See Also:
getWidth()


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