Chart Builder API (beta)

oracle.ord.media.chart
Class Chart

java.lang.Object
  |
  +--java.awt.Component
        |
        +--oracle.ord.media.chart.Chart
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
Legend

public class Chart
extends java.awt.Component

The Chart class is the top-level Chart Builder class. This class provides methods for defining titles, subtitles, footnotes, and legends. The class also provides methods for defining the background areas of the chart.

Titles, subtitles and footnotes are implemented as subclasses of Chart, and get functions are provided to return instances of each subclass. The corresponding get functions are getTitle(), getSubtitle() and getFootnote(). For example, the following calls set the title string to "My Title", and alter the title font:

Similarly, the subtitle text could be set with:

Note that a title will not be displayed unless the user supplies a title string with the getTitle().setText() routine. The same holds true for subtitles and footnotes.

Note that titles, subtitles, and footnotes are each instances of the ChartLabel class, and thus the methods and properties of subtitle and footnote properties mirror those of titles.

The Chart class also provides methods for setting background colors:

Users can provide rendering hints that will be used when drawing charts with the setRenderingHintsChart() method. The default anti-aliasing mode for AxisChart and PieChart objects are:

See Also:
Chart.ChartLabel, AxisChart, PieChart, Serialized Form

Inner Class Summary
 class Chart.ChartLabel
          The ChartLabel class supports writing text labels in the Chart.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Chart()
           
 
Method Summary
 java.awt.Color getBackground()
          Get the background color.
 int getBorderBottom()
          Return the width of the bottom border.
 int getBorderLeft()
          Return the width of the left border.
 int getBorderRight()
          Return width of the right border.
 int getBorderTop()
          Return the width of the top border.
 java.awt.Color getEdgeColor()
          Get the color of the outer border of the chart.
 Chart.ChartLabel getFootnote()
          Return an instance of the ChartLabel class.
 int getHeight()
          Return the height of the chart.
 java.awt.Dimension getMinimumSize()
          Return the minimum size of the chart.
 java.awt.Dimension getPreferredSize()
          Return the preferred size of the chart.
 java.awt.RenderingHints getRenderingHintsChart()
          Return the rendering hints used for the chart's buffered image.
 java.awt.Dimension getSize()
          Return the size of the chart.
 Chart.ChartLabel getSubtitle()
          Return an instance of the subtitle class.
 Chart.ChartLabel getTitle()
          Return an instance of the ChartLabel class.
static java.lang.String getVersion()
          Get the version of Chart Builder.
 int getWidth()
          Return the width of the chart.
 boolean isSetRenderingHintsChart()
          Return true if setRenderingHints() has been called.
 void setBackground(java.awt.Color c)
          Set the background color.
 void setBorderBottom(int bottom)
          Set the height of the bottom border.
 void setBorderLeft(int left)
          Set the width of the left border.
 void setBorderRight(int right)
          Set the width of the right border.
 void setBorderTop(int top)
          Set the height of the top border.
 void setEdgeColor(java.awt.Color c)
          Set the color of the outer border of the chart.
 void setRenderingHintsChart(java.awt.RenderingHints hints)
          Set the rendering hints for the chart's entire buffered image.
 void setTitlesForeground(java.awt.Color c)
          Set the foreground color for the title, subtitle, and footnotes.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAccessibleContext, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Chart

public Chart()
Method Detail

setRenderingHintsChart

public void setRenderingHintsChart(java.awt.RenderingHints hints)
Set the rendering hints for the chart's entire buffered image. Note that for axis charts, specific graphics (such as LINE graphic) are rendered with anti-aliasing enabled. A separate call is provided to change the rendering hints for these specific graphics.
See Also:
AxisChart.setRenderingHintsLine(RenderingHints)

getRenderingHintsChart

public java.awt.RenderingHints getRenderingHintsChart()
Return the rendering hints used for the chart's buffered image.

isSetRenderingHintsChart

public boolean isSetRenderingHintsChart()
Return true if setRenderingHints() has been called.

getVersion

public static java.lang.String getVersion()
Get the version of Chart Builder. Needed for filing problem reports.

getTitle

public Chart.ChartLabel getTitle()
Return an instance of the ChartLabel class.

getFootnote

public Chart.ChartLabel getFootnote()
Return an instance of the ChartLabel class.

getSubtitle

public Chart.ChartLabel getSubtitle()
Return an instance of the subtitle class.

getHeight

public int getHeight()
Return the height of the chart.
Overrides:
getHeight in class java.awt.Component

getWidth

public int getWidth()
Return the width of the chart.
Overrides:
getWidth in class java.awt.Component

getSize

public java.awt.Dimension getSize()
Return the size of the chart.
Overrides:
getSize in class java.awt.Component

getPreferredSize

public java.awt.Dimension getPreferredSize()
Return the preferred size of the chart.
Overrides:
getPreferredSize in class java.awt.Component

getMinimumSize

public java.awt.Dimension getMinimumSize()
Return the minimum size of the chart.
Overrides:
getMinimumSize in class java.awt.Component

setEdgeColor

public void setEdgeColor(java.awt.Color c)
Set the color of the outer border of the chart.

getEdgeColor

public java.awt.Color getEdgeColor()
Get the color of the outer border of the chart.

getBackground

public java.awt.Color getBackground()
Get the background color.
Overrides:
getBackground in class java.awt.Component

setBackground

public void setBackground(java.awt.Color c)
Set the background color.
Overrides:
setBackground in class java.awt.Component

setTitlesForeground

public void setTitlesForeground(java.awt.Color c)
Set the foreground color for the title, subtitle, and footnotes.

setBorderLeft

public void setBorderLeft(int left)
Set the width of the left border.
Parameters:
left - The width of the left border. left must be greater than or equal to 0. For axis charts having labels on the left, the left border is automatically derived based on the attributes of the Y-axis labels.

Normally, one uses setBorderLeft() for pie charts or for axis charts that do not have Y-axis labels on the left.


setBorderRight

public void setBorderRight(int right)
Set the width of the right border.
Parameters:
right - The width of the right border. right must be greater than or equal to 0.

Normally, one uses setBorderLeft() for pie charts or for axis charts that do not have Y-axis labels on the right. For axis charts having labels on the right, the right border is automatically derived based on the attributes of the Y-axis labels.


setBorderTop

public void setBorderTop(int top)
Set the height of the top border.
Parameters:
top - The height of the top border. top must be greater than or equal to 0.

Normally, one does not call setBorderTop() for charts having titles and/or subtitles. Charts having titles and/or subtitles will have their borders generated automatically, based on the height of the fonts used for the title and/or subtitles.


setBorderBottom

public void setBorderBottom(int bottom)
Set the height of the bottom border.
Parameters:
Set - The height of the bottom border. bottom must be greater than or equal to 0.

Normally, one only uses setBorderBottom() for pie charts, not for axis charts. For axis charts, the dimensions of the bottom border are derived automatically.


getBorderLeft

public int getBorderLeft()
Return the width of the left border.

getBorderRight

public int getBorderRight()
Return width of the right border.

getBorderTop

public int getBorderTop()
Return the width of the top border.

getBorderBottom

public int getBorderBottom()
Return the width of the bottom border.

Chart Builder API (beta)