Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 2 (11.1.2.1.0)

E17492-02

oracle.dss.gauge
Class DrawableObject

java.lang.Object
  extended by oracle.dss.gauge.DrawableObject
Direct Known Subclasses:
DrawableObject.Image, DrawableObject.Label, DrawableObject.Shape, DrawableObject.Transform

public abstract class DrawableObject
extends java.lang.Object

For internal use only. Application developers should not use this
This class is the interface for which all renderable objects in a Gauge should derive. It will have the capacity to hold the parameters necessary to render this object.

Nested Class Summary
static class DrawableObject.Image
          This class defines an area.
static class DrawableObject.Label
          This class defines a label.
static class DrawableObject.Shape
          This class defines a shape.
static class DrawableObject.TickLabel
          This class defines a tick label.
static class DrawableObject.Transform
          This class defines an AffineTransform.
 
Field Summary
protected  java.awt.geom.AffineTransform m_transform
           
 
Constructor Summary
DrawableObject(int compType, java.awt.geom.AffineTransform transform)
          Provides a constructor for implementations of DrawableObject and includes the specification for an object type.
DrawableObject(int compType, int index, java.awt.geom.AffineTransform transform)
          Provides a constructor for implementations of DrawableObject and includes the specification for an object type.
DrawableObject(int compType, int index, java.util.Map map, java.awt.geom.AffineTransform transform)
          Provides a constructor for implementations of DrawableObject and includes the specification for an object type.
DrawableObject(int compType, java.util.Map map, java.awt.geom.AffineTransform transform)
          Provides a constructor for implementations of DrawableObject and includes the specification for an object type.
 
Method Summary
abstract  boolean contains(double x, double y, boolean useTruncated)
          Perform an inclusion test on the object based on the given point
 java.awt.geom.AffineTransform getAffineTransform()
          Returns the AffineTransform to apply to this object.
 int getComponentIndex()
          Returns the index of component to which this DrawableObject instance belongs.
 int getComponentType()
          Returns the type of component to which this DrawableObject instance belongs.
static java.awt.Dimension getLabelDimensions(java.awt.Graphics2D g, java.awt.Font f, java.lang.String label)
          Calculates and returns the dimensions of the given label based on the given Graphics2D object and font
static DrawableObject getLabelObject(java.awt.Graphics2D g, java.lang.String label, java.awt.Font font, java.awt.Color fontColor, java.awt.Rectangle bounds, java.lang.String labelType)
          Generates the DrawableObject instance for a Label object.
static DrawableObject.TickLabel getTickLabelObject(java.awt.Graphics2D g, java.lang.String text, java.awt.Font font, java.awt.Color fontColor, java.awt.Rectangle bounds, int tickType)
          Generates a tick label object, complete with trimmed rectangle to facilitate hit testing and prevention of overlapping labels.
 boolean isSelected()
          Returns the selection state of this object.
protected  boolean isVisible()
          Returns the visibility state of this object.
 boolean render(GaugeRenderer renderer)
          This method will render the current object onto the given instance of GaugeRenderer.
 void setSelected(boolean selected)
          Sets the selection state of this object.
protected  void setVisible(boolean visible)
          Gets the visibility state of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_transform

protected java.awt.geom.AffineTransform m_transform
Constructor Detail

DrawableObject

public DrawableObject(int compType,
                      int index,
                      java.util.Map map,
                      java.awt.geom.AffineTransform transform)
Provides a constructor for implementations of DrawableObject and includes the specification for an object type.

Parameters:
transform - Instance of AffineTransform to apply to this shape before rendering it
map - Map that contains the properties for the gauge
compType - Type of component to which this object belongs; valid values are constants in the GaugeConstants class beginning with ID_
index - The index of threshold or indicator object

DrawableObject

public DrawableObject(int compType,
                      int index,
                      java.awt.geom.AffineTransform transform)
Provides a constructor for implementations of DrawableObject and includes the specification for an object type.

Parameters:
transform - Instance of AffineTransform to apply to this shape before rendering it
compType - Type of component to which this object belongs; valid values are constants in the GaugeConstants class beginning with ID_
index - The index of threshold or indicator object

DrawableObject

public DrawableObject(int compType,
                      java.awt.geom.AffineTransform transform)
Provides a constructor for implementations of DrawableObject and includes the specification for an object type.

Parameters:
transform - Instance of AffineTransform to apply to this shape before rendering it
compType - Type of component to which this object belongs; valid values are constants in the GaugeConstants class beginning with ID_

DrawableObject

public DrawableObject(int compType,
                      java.util.Map map,
                      java.awt.geom.AffineTransform transform)
Provides a constructor for implementations of DrawableObject and includes the specification for an object type.

Parameters:
transform - Instance of AffineTransform to apply to this shape before rendering it
map - Map that contains the properties for the gauge
compType - Type of component to which this object belongs; valid values are constants in the GaugeConstants class beginning with ID_
Method Detail

getComponentType

public int getComponentType()
Returns the type of component to which this DrawableObject instance belongs.

Returns:
Component type; can be one of the constants in GaugeConstants beginning with ID_

getComponentIndex

public int getComponentIndex()
Returns the index of component to which this DrawableObject instance belongs.

Returns:
index

getAffineTransform

public java.awt.geom.AffineTransform getAffineTransform()
Returns the AffineTransform to apply to this object.

Returns:
Instance of AffineTransform to apply to this shape before rendering it

isSelected

public boolean isSelected()
Returns the selection state of this object.

Returns:
True if this object is currently selected, False if it is not selected

setSelected

public void setSelected(boolean selected)
Sets the selection state of this object.


isVisible

protected boolean isVisible()
Returns the visibility state of this object.

Returns:
True if this object is currently visible, False if it is not visible

setVisible

protected void setVisible(boolean visible)
Gets the visibility state of this object.


render

public boolean render(GaugeRenderer renderer)
This method will render the current object onto the given instance of GaugeRenderer.

Parameters:
renderer - Instance of GaugeRenderers
Returns:
True if the render was successful, False otherwise

contains

public abstract boolean contains(double x,
                                 double y,
                                 boolean useTruncated)
Perform an inclusion test on the object based on the given point

Parameters:
useTruncated - True if the truncated rectangle should be used, False otherwise
y - Double representing the Y location of the point
x - Double representing the X location of the point
Returns:
True if the point is contained within this object, False otherwise

getLabelObject

public static DrawableObject getLabelObject(java.awt.Graphics2D g,
                                            java.lang.String label,
                                            java.awt.Font font,
                                            java.awt.Color fontColor,
                                            java.awt.Rectangle bounds,
                                            java.lang.String labelType)
Generates the DrawableObject instance for a Label object.

Parameters:
labelType - Type of label; can be one of the label constants in GaugeAttributes
bounds - Bounds in which the label should be confined
font - Font object that must be non-null or no DrawableObjects will be generated
fontColor - Color object that must be non-null or no DrawableObjects will be generated
label - String to use for this label object
g - Graphics2D object to use in obtaining FontMetrics

getTickLabelObject

public static DrawableObject.TickLabel getTickLabelObject(java.awt.Graphics2D g,
                                                          java.lang.String text,
                                                          java.awt.Font font,
                                                          java.awt.Color fontColor,
                                                          java.awt.Rectangle bounds,
                                                          int tickType)
Generates a tick label object, complete with trimmed rectangle to facilitate hit testing and prevention of overlapping labels.

Parameters:
tickType - Type of tick label; can be TICK_METRIC, TICK_THRESHOLD, TICK_MIN_MAX, or TICK_INCREMENTS from the GaugeAttributes class.
bounds - Rectangle in which this label should be drawn
fontColor - Instance of Color representing the font color of this ticklabel
font - Instance of Font representing the font for this ticklabel
text - String value for this label
g - Graphics2D instance to use for setup of this label
Returns:
Instance of DrawableObject.TickLabel

getLabelDimensions

public static java.awt.Dimension getLabelDimensions(java.awt.Graphics2D g,
                                                    java.awt.Font f,
                                                    java.lang.String label)
Calculates and returns the dimensions of the given label based on the given Graphics2D object and font

Parameters:
label - String of label
f - Font object that must be non-null or no dimensions will be calculated
g - Graphics2D instance from which to retrieve FontMetrics
Returns:
Dimension object containing width and height of given label

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 2 (11.1.2.1.0)

E17492-02

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