Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1)

E12063-03


oracle.dss.gauge
Class GaugeType

java.lang.Object
  extended by oracle.dss.gauge.GaugeType

Direct Known Subclasses:
DialGauge, LabelGauge, LEDGauge, StatusMeterGauge, VennGauge, VerticalStatusMeterGauge

public abstract class GaugeType
extends java.lang.Object
For internal use only. Application developers should not use this
This interface should be the base of all gauge type implementations. Each type of gauge, such as half-circle, status meter, and LED should implement this interface.

Field Summary
protected  java.awt.Rectangle _bottomLabelBounds
           
protected  java.awt.Dimension _btmLblDim
           
protected  CustomShapesParser _csParser
           
protected  GaugeEngine _engine
           
protected  java.util.ResourceBundle _gaugeBundle
           
protected  java.awt.Rectangle _gaugeFrameBounds
           
protected  boolean _hasLowerReflection
           
protected  java.awt.Rectangle _innerBounds
           
protected  GaugeLayout _layout
           
protected  java.awt.Dimension _lowerFrameDim
           
protected  java.awt.Rectangle _lowerLabelFrameBounds
           
protected  java.awt.Dimension _metLblDim
           
protected  java.awt.Rectangle _metricLabelBounds
           
protected  java.awt.geom.AffineTransform _moveTransform
           
protected  java.awt.geom.AffineTransform _scaleTransform
           
protected  java.awt.Rectangle _titleSeparatorBounds
           
protected  java.awt.Rectangle _topLabelBounds
           
protected  java.awt.Dimension _topLblDim
           
protected  java.awt.Dimension _upperFrameDim
           
protected  java.awt.Rectangle _upperLabelFrameBounds
           
protected  java.util.ResourceBundle _utilBundle
           
protected static java.lang.String DEF_TICK_LABEL
           
protected static int DIR_BOTTOM
           
protected static int DIR_LEFT
           
protected static int DIR_RIGHT
           
protected static int DIR_TOP
           
protected static int HEIGHT_LOWERLABELFRAME_REFLECTION
           
protected static int HEIGHT_TITLESEPARATOR
           
protected static java.lang.String LABEL_SPACE
           
protected static int LED_GAUGESET_GAP
           
protected static boolean m_bBlended
           
protected  java.util.Locale m_locale
           
protected static double SHADOW_OFFSET
           
protected static int TICK_MARK_LENGTH
           

 

Constructor Summary
GaugeType(GaugeEngine engine)
           

 

Method Summary
protected  java.awt.Color _blendColors(java.awt.Color a, java.awt.Color b)
           
protected  void _calcCustomShapesLabelBounds()
          Calculates and saves the bounding box for the labels and frames if they are defined in the Custom Shapes definition file.
protected  void _calcLabelDimensions(java.util.Map map, java.awt.Graphics2D g)
          Calculates and stores the dimensions of each label.
protected  java.awt.Color _getIndicatorColor(java.util.Map map, boolean autoColor)
           
protected  java.awt.Color _getIndicatorColor(java.util.Map map, boolean autoColor, int ind)
           
protected  java.awt.Rectangle _getMetricLabelBounds(java.awt.Rectangle outerBounds, java.util.Map map, java.awt.Graphics2D g)
          Returns the bounding box for the metricLabel based on the currently available information.
protected  java.awt.Rectangle _getPlotAreaBounds(java.awt.Rectangle gaugeFrameBounds, java.util.Map map, java.awt.Graphics2D g)
          Calculates and returns the bounding box of the plotArea.
protected  int _getPlotAreaCenter(java.util.Map map)
           
protected  java.awt.Rectangle _getTopLabelBounds(java.awt.Rectangle outerBounds, java.util.Map map)
          Returns the bounding box for the topLabel based on the currently available information.
protected  java.awt.Rectangle _getUpperLabelFrameBounds(java.awt.Rectangle labelBounds, java.util.Map map)
          Returns the bounding box for the upperLabelFrame based on the currently available information.
protected static boolean _hasGaugeFrame(java.util.Map map)
           
protected  java.awt.Dimension autoLayout(java.awt.Graphics2D g, java.awt.Rectangle rect, java.util.Map map)
          Figures out the size of the gauge based on the size of each component.
protected static DrawableObject createTickMark(java.awt.geom.Point2D pt, double angle, int length, java.awt.Color color, int position)
           
protected  java.util.Collection getBackgroundObject(java.util.Map map, java.awt.Rectangle outerBounds, java.awt.Shape gaugeSetClip)
          Generates a background object.
protected  int getFrameHeight(java.awt.Graphics2D g, java.awt.Font f)
          Returns the height of the label frame for a label with given font and height
protected abstract  java.util.Collection getGaugeFrameObject(java.util.Map map)
          Generates the DrawableObject instances necessary to render the frame behind the gauge.
protected abstract  java.util.Collection getGaugeLinkObject(java.util.Map map, java.awt.Rectangle outerBounds)
          Generates the DrawableObject instances necessary to render the frame behind the gauge.
protected abstract  int getGaugeRadius(int availWidth, int availHeight)
          Allows a gauge type to determine the radius of the gauge.
protected  int getGaugeSetGap(java.util.Map map, java.awt.Graphics2D g, int dir)
          Returns the space between gauges in a gaugeSet, and the space bordering each gauge.
abstract  int getGaugeType()
          Returns the type of this gauge type implementation.
protected abstract  java.util.Collection getIndicatorObject(java.util.Map map, int metricIndex)
          Generates the DrawableObject instances necessary to render an Indicator.
protected abstract  java.awt.Rectangle getInnerBounds(java.util.Map map, java.awt.Rectangle rect, int reqAboveSpace, int reqBelowSpace, int reqLeftSpace, int reqRightSpace)
          Allows a gauge type implementation to determine the area in which to draw the actual gauge.
protected  java.util.Collection getLabelObjects(java.util.Map map, java.awt.Rectangle outerBounds)
          Generates the DrawableObject instances necessary to render gauge labels.
protected abstract  int getMaxNumberOfSteps()
          Allows a customization of the maximum number of steps to use for the tick labels and marks for this gauge type.
protected abstract  DrawableObject getNoDataLabelObject(java.util.Map map)
          Generates the DrawableObject instances necessary to render a No Data label.
protected  java.util.Collection<DrawableObject> getOverlayEffectObjects(java.util.Map map)
          Generates the DrawableObject instances for any overlay effects on the gauge.
protected abstract  java.util.Collection getPlotAreaObject(java.util.Map map, int type)
          Generates the DrawableObject instances necessary to render a PlotArea.
protected static java.awt.geom.AffineTransform getScalingTransform(java.awt.Shape s, java.awt.Rectangle bounds)
          Returns a AffineTransform that will scale the Shape s so that it will fit inside of the Rectangle bounds.
protected static java.awt.geom.AffineTransform getScalingTransform(java.awt.Shape s, java.awt.Rectangle bounds, boolean flip)
          Returns a AffineTransform that will scale the Shape s so that it will fit inside of the Rectangle bounds.
protected  int getSpaceAboveGauge(java.util.Map map, java.awt.Graphics2D g)
          Calculates the space needed above the gauge based on the attributes in the given map.
protected  int getSpaceBelowGauge(java.util.Map map, java.awt.Graphics2D g)
          Calculates the space needed below the gauge based on the attributes in the given map.
protected  int getSpaceLeftOfGauge(java.util.Map map, java.awt.Graphics2D g)
          Calculates the space needed to the left of the gauge based on the attributes in the given map.
protected  int getSpaceRightOfGauge(java.util.Map map, java.awt.Graphics2D g)
          Calculates the space needed to the right of the gauge based on the attributes in the given map.
protected static java.lang.Object getThresholdAttribute(java.util.Map map, int index, java.lang.Object attr)
          Returns the intended attribute from the threshold attributes map
protected abstract  java.util.Collection getTickLabelObjects(java.util.Map map)
          Generates the DrawableObject instances necessary to render Tick Labels.
protected  int getTickLabelWidth(java.util.Map map, java.awt.Graphics2D g, java.lang.String tickType)
          Returns the width of the value of the given tick label type, or the width of the default tick label (represented by GaugeType.DEF_TICK_LABEL).
protected abstract  java.util.Collection getTickMarkObjects(java.util.Map map)
          Generates the DrawableObject instances necessary to render Tick Marks.
protected static java.awt.geom.AffineTransform getTranslateTransform(java.awt.Shape s, java.awt.Rectangle bounds, java.awt.geom.AffineTransform scale)
          Returns a AffineTransform that will translate the Shape s so that it will be centered at the center of the Rectangle bounds.
protected  void setCustomShapesParser(CustomShapesParser parser)
          Sets the GaugeType's customShapesParser.
 void setLocale(java.util.Locale loc)
          Specifies the Locale for this Gauge.
protected  void updateResourceBundle()
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

DEF_TICK_LABEL

protected static java.lang.String DEF_TICK_LABEL

LABEL_SPACE

protected static java.lang.String LABEL_SPACE

SHADOW_OFFSET

protected static double SHADOW_OFFSET

TICK_MARK_LENGTH

protected static int TICK_MARK_LENGTH

LED_GAUGESET_GAP

protected static final int LED_GAUGESET_GAP
See Also:
Constant Field Values

HEIGHT_LOWERLABELFRAME_REFLECTION

protected static final int HEIGHT_LOWERLABELFRAME_REFLECTION
See Also:
Constant Field Values

HEIGHT_TITLESEPARATOR

protected static final int HEIGHT_TITLESEPARATOR
See Also:
Constant Field Values

DIR_TOP

protected static final int DIR_TOP
See Also:
Constant Field Values

DIR_BOTTOM

protected static final int DIR_BOTTOM
See Also:
Constant Field Values

DIR_LEFT

protected static final int DIR_LEFT
See Also:
Constant Field Values

DIR_RIGHT

protected static final int DIR_RIGHT
See Also:
Constant Field Values

m_bBlended

protected static final boolean m_bBlended
See Also:
Constant Field Values

_engine

protected GaugeEngine _engine

_csParser

protected CustomShapesParser _csParser

_layout

protected GaugeLayout _layout

_innerBounds

protected java.awt.Rectangle _innerBounds

_gaugeFrameBounds

protected java.awt.Rectangle _gaugeFrameBounds

_lowerLabelFrameBounds

protected java.awt.Rectangle _lowerLabelFrameBounds

_upperLabelFrameBounds

protected java.awt.Rectangle _upperLabelFrameBounds

_bottomLabelBounds

protected java.awt.Rectangle _bottomLabelBounds

_topLabelBounds

protected java.awt.Rectangle _topLabelBounds

_metricLabelBounds

protected java.awt.Rectangle _metricLabelBounds

_titleSeparatorBounds

protected java.awt.Rectangle _titleSeparatorBounds

_btmLblDim

protected java.awt.Dimension _btmLblDim

_metLblDim

protected java.awt.Dimension _metLblDim

_topLblDim

protected java.awt.Dimension _topLblDim

_upperFrameDim

protected java.awt.Dimension _upperFrameDim

_lowerFrameDim

protected java.awt.Dimension _lowerFrameDim

_hasLowerReflection

protected boolean _hasLowerReflection

_scaleTransform

protected java.awt.geom.AffineTransform _scaleTransform

_moveTransform

protected java.awt.geom.AffineTransform _moveTransform

_gaugeBundle

protected java.util.ResourceBundle _gaugeBundle

_utilBundle

protected java.util.ResourceBundle _utilBundle

m_locale

protected java.util.Locale m_locale

Constructor Detail

GaugeType

public GaugeType(GaugeEngine engine)

Method Detail

getBackgroundObject

protected java.util.Collection getBackgroundObject(java.util.Map map,
                                                   java.awt.Rectangle outerBounds,
                                                   java.awt.Shape gaugeSetClip)
Generates a background object.
Parameters:
map - Map of attributes for this gauge
outerBounds - Rectangle in which objects can be drawn
gaugeSetClip - Shape clipping area of the entire gaugeSet
Returns:
Collection of DrawableObject instances

createTickMark

protected static DrawableObject createTickMark(java.awt.geom.Point2D pt,
                                               double angle,
                                               int length,
                                               java.awt.Color color,
                                               int position)
Parameters:
pt - Point at which tick mark should originate
angle - Angle at which tick mark should be drawn
length - Length of tick mark
color - Color of tick mark
position - Position of the tickMark: TLP_INTERIOR or TLP_EXTERIOR
Returns:
DrawableObject instance
For internal use only. Application developers should not use this
Generates the DrawableObject instance for a single tick mark.

getGaugeType

public abstract int getGaugeType()
Returns the type of this gauge type implementation.
Returns:
Integer representing the gauge type; valid constants are those in this class beginning with TYPE_.

getPlotAreaObject

protected abstract java.util.Collection getPlotAreaObject(java.util.Map map,
                                                          int type)
Generates the DrawableObject instances necessary to render a PlotArea.
Parameters:
map - Map of attributes for this gauge
type - Type of plot area to generate. Can be FILL_ONLY, BORDER_ONLY, and FILL_AND_BORDER
Returns:
Array of DrawableObject instances

getIndicatorObject

protected abstract java.util.Collection getIndicatorObject(java.util.Map map,
                                                           int metricIndex)
Generates the DrawableObject instances necessary to render an Indicator.
Parameters:
map - Map of attributes for this gauge
metricIndex - Index of the indicator
Returns:
Array of DrawableObject instances

getTickLabelObjects

protected abstract java.util.Collection getTickLabelObjects(java.util.Map map)
Generates the DrawableObject instances necessary to render Tick Labels.
Parameters:
map - Map of attributes for this gauge
Returns:
Array of DrawableObject instances

getTickMarkObjects

protected abstract java.util.Collection getTickMarkObjects(java.util.Map map)
Generates the DrawableObject instances necessary to render Tick Marks.
Parameters:
map - Map of attributes for this gauge
Returns:
Collection of DrawableObject instances

getGaugeFrameObject

protected abstract java.util.Collection getGaugeFrameObject(java.util.Map map)
Generates the DrawableObject instances necessary to render the frame behind the gauge.
Parameters:
map - Map of attributes for this gauge
Returns:
Collection of DrawableObject instances

getGaugeLinkObject

protected abstract java.util.Collection getGaugeLinkObject(java.util.Map map,
                                                           java.awt.Rectangle outerBounds)
Generates the DrawableObject instances necessary to render the frame behind the gauge.
Parameters:
map - Map of attributes for this gauge
outerBounds - Rectangle representing gauge and its background
Returns:
Collection of DrawableObject instances

getOverlayEffectObjects

protected java.util.Collection<DrawableObject> getOverlayEffectObjects(java.util.Map map)
Generates the DrawableObject instances for any overlay effects on the gauge.
Parameters:
map - Map of attributes for this gauge
Returns:
Array of DrawableObject instances

getThresholdAttribute

protected static java.lang.Object getThresholdAttribute(java.util.Map map,
                                                        int index,
                                                        java.lang.Object attr)
Returns the intended attribute from the threshold attributes map
Parameters:
map - Instance of Map
index - Index of threshold
attr - Attribute to retrieve
Returns:
Object Threshold attribute

getLabelObjects

protected java.util.Collection getLabelObjects(java.util.Map map,
                                               java.awt.Rectangle outerBounds)
Generates the DrawableObject instances necessary to render gauge labels.
Parameters:
map - Map of attributes for this gauge
outerBounds - Rectangle in which the entire gauge and surrounding objects are drawn
Returns:
DrawableObject instances

getNoDataLabelObject

protected abstract DrawableObject getNoDataLabelObject(java.util.Map map)
Generates the DrawableObject instances necessary to render a No Data label.
Parameters:
map - Map of attributes for this gauge
Returns:
Array of DrawableObject instances

autoLayout

protected java.awt.Dimension autoLayout(java.awt.Graphics2D g,
                                        java.awt.Rectangle rect,
                                        java.util.Map map)
Figures out the size of the gauge based on the size of each component. Each gauge type will be responsible for determining this figure, which should include the total space taken up by the gauge, including any labels around it.
Parameters:
rect - Rectangle in which to base the layout
map - attribute map

getSpaceAboveGauge

protected int getSpaceAboveGauge(java.util.Map map,
                                 java.awt.Graphics2D g)
Calculates the space needed above the gauge based on the attributes in the given map.
Parameters:
map - Map instance containing gauge attributes
g - Instance of Graphics2D to use for various font calculations
Returns:
Height in pixels of the space needed above the gauge.

getSpaceBelowGauge

protected int getSpaceBelowGauge(java.util.Map map,
                                 java.awt.Graphics2D g)
Calculates the space needed below the gauge based on the attributes in the given map.
Parameters:
map - Map instance containing gauge attributes
g - Instance of Graphics2D to use for various font calculations
Returns:
Height in pixels of the space needed below the gauge.

getSpaceLeftOfGauge

protected int getSpaceLeftOfGauge(java.util.Map map,
                                  java.awt.Graphics2D g)
Calculates the space needed to the left of the gauge based on the attributes in the given map.
Parameters:
map - Map instance containing gauge attributes
g - Instance of Graphics2D to use for various font calculations
Returns:
Height in pixels of the space needed to the left of the gauge.

getSpaceRightOfGauge

protected int getSpaceRightOfGauge(java.util.Map map,
                                   java.awt.Graphics2D g)
Calculates the space needed to the right of the gauge based on the attributes in the given map.
Parameters:
map - Map instance containing gauge attributes
g - Instance of Graphics2D to use for various font calculations
Returns:
Height in pixels of the space needed to the right of the gauge.

getGaugeSetGap

protected int getGaugeSetGap(java.util.Map map,
                             java.awt.Graphics2D g,
                             int dir)
Returns the space between gauges in a gaugeSet, and the space bordering each gauge.
Parameters:
map - Map instance containing gauge attributes
g - Instance of Graphics2D to use for various font calculations
dir - int gap for which side of the gauge
Returns:

getGaugeRadius

protected abstract int getGaugeRadius(int availWidth,
                                      int availHeight)
Allows a gauge type to determine the radius of the gauge.
Parameters:
availHeight - Integer representing the height available for drawing the actual gauge
availWidth - Integer representing the width available for drawing the actual gauge
Returns:
Integer representing the radius of the gauge.

getInnerBounds

protected abstract java.awt.Rectangle getInnerBounds(java.util.Map map,
                                                     java.awt.Rectangle rect,
                                                     int reqAboveSpace,
                                                     int reqBelowSpace,
                                                     int reqLeftSpace,
                                                     int reqRightSpace)
Allows a gauge type implementation to determine the area in which to draw the actual gauge.
Parameters:
reqRightSpace - Integer indicating the space required to the right of the gauge
reqLeftSpace - Integer indicating the space required to the left of the gauge
reqBelowSpace - Integer indicating the space required below the gauge
reqAboveSpace - Integer indicating the space required above the gauge
rect - Rectangle indicating the initial working area
Returns:
Rectangle representing the area in which to draw the gauge

getMaxNumberOfSteps

protected abstract int getMaxNumberOfSteps()
Allows a customization of the maximum number of steps to use for the tick labels and marks for this gauge type.
Returns:
Integer representing maximum number of tick steps

getTickLabelWidth

protected int getTickLabelWidth(java.util.Map map,
                                java.awt.Graphics2D g,
                                java.lang.String tickType)
Returns the width of the value of the given tick label type, or the width of the default tick label (represented by GaugeType.DEF_TICK_LABEL).
Parameters:
tickType - Type of tick label to measure; valid constants are one of the following constants in GaugeAttributes: MIN_VALUE, MAX_VALUE, and METRIC.
g - Graphics2D instance
map - Map of values for this gauge
Returns:
Width of the value of the given tick label type

setCustomShapesParser

protected void setCustomShapesParser(CustomShapesParser parser)
Sets the GaugeType's customShapesParser. When available, the CustomShapesParser is used in the rendering of most gauge subcomponents.
Parameters:
parser -
For internal use only. Application developers should not use this

getScalingTransform

protected static java.awt.geom.AffineTransform getScalingTransform(java.awt.Shape s,
                                                                   java.awt.Rectangle bounds)
Returns a AffineTransform that will scale the Shape s so that it will fit inside of the Rectangle bounds.
Parameters:
s - the shape to be modify
bounds - the bound of the shape
Returns:
the tranformation that scale the shape

getScalingTransform

protected static java.awt.geom.AffineTransform getScalingTransform(java.awt.Shape s,
                                                                   java.awt.Rectangle bounds,
                                                                   boolean flip)
Returns a AffineTransform that will scale the Shape s so that it will fit inside of the Rectangle bounds.
Parameters:
s - the shape to be modify
bounds - the bound of the shape
flip - whether this shape is horizontally flipped or not
Returns:
the tranformation that scale and/or flip the shape

getTranslateTransform

protected static java.awt.geom.AffineTransform getTranslateTransform(java.awt.Shape s,
                                                                     java.awt.Rectangle bounds,
                                                                     java.awt.geom.AffineTransform scale)
Returns a AffineTransform that will translate the Shape s so that it will be centered at the center of the Rectangle bounds. Optionally takes an AffineTransform that defines a scaling transformation to be applied before the translation.
Parameters:
s -
bounds -
scale -
Returns:

_calcCustomShapesLabelBounds

protected void _calcCustomShapesLabelBounds()
Calculates and saves the bounding box for the labels and frames if they are defined in the Custom Shapes definition file.

_getTopLabelBounds

protected java.awt.Rectangle _getTopLabelBounds(java.awt.Rectangle outerBounds,
                                                java.util.Map map)
Returns the bounding box for the topLabel based on the currently available information. Any bounding box obtained without first calculating the gaugeFrame and plotArea bounds should be considered tentative, and should be used for space allocation only.
Parameters:
outerBounds - Rectangle bounding box used for allocating space in the gauge
map - Map containing attribute values
Returns:

_getUpperLabelFrameBounds

protected java.awt.Rectangle _getUpperLabelFrameBounds(java.awt.Rectangle labelBounds,
                                                       java.util.Map map)
Returns the bounding box for the upperLabelFrame based on the currently available information. Any bounding box obtained without first calculating the gaugeFrame and plotArea bounds should be considered tentative, and should be used for space allocation only.
Parameters:
labelBounds - Rectangle bounding box of the contained label
map - Map containing attribute values
Returns:

_getMetricLabelBounds

protected java.awt.Rectangle _getMetricLabelBounds(java.awt.Rectangle outerBounds,
                                                   java.util.Map map,
                                                   java.awt.Graphics2D g)
Returns the bounding box for the metricLabel based on the currently available information. Any bounding box obtained without first calculating the gaugeFrame and plotArea bounds should be considered tentative, and should be used for space allocation only. This method returns null if the metric label position is LP_WITH_BOTTOM_LABEL, the metric label uses the bottomLabel bounds in that case.
Parameters:
outerBounds - Rectangle bounding box used for allocating space in the gauge
map - Map containing attribute values
Returns:

_getPlotAreaBounds

protected java.awt.Rectangle _getPlotAreaBounds(java.awt.Rectangle gaugeFrameBounds,
                                                java.util.Map map,
                                                java.awt.Graphics2D g)
Calculates and returns the bounding box of the plotArea. This method reserves space for everything inside the gaugeFrame, and returns the remaining box as the bounds of the plotArea.
Parameters:
gaugeFrameBounds -
map -
Returns:

getFrameHeight

protected int getFrameHeight(java.awt.Graphics2D g,
                             java.awt.Font f)
Returns the height of the label frame for a label with given font and height
Parameters:
g -
f -
Returns:

_hasGaugeFrame

protected static boolean _hasGaugeFrame(java.util.Map map)

_getPlotAreaCenter

protected int _getPlotAreaCenter(java.util.Map map)

_calcLabelDimensions

protected void _calcLabelDimensions(java.util.Map map,
                                    java.awt.Graphics2D g)
Calculates and stores the dimensions of each label.
Parameters:
map -
g -

_getIndicatorColor

protected java.awt.Color _getIndicatorColor(java.util.Map map,
                                            boolean autoColor)

_getIndicatorColor

protected java.awt.Color _getIndicatorColor(java.util.Map map,
                                            boolean autoColor,
                                            int ind)

_blendColors

protected java.awt.Color _blendColors(java.awt.Color a,
                                      java.awt.Color b)

setLocale

public void setLocale(java.util.Locale loc)
Specifies the Locale for this Gauge.
Parameters:
loc - The Locale for this Gauge.

updateResourceBundle

protected void updateResourceBundle()

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1)

E12063-03


Copyright © 1997, 2009, Oracle. All rights reserved.