|
Chart Builder API (beta) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--oracle.ord.media.chart.Chart | +--oracle.ord.media.chart.legend.Legend | +--oracle.ord.media.chart.piechart.PieChart | +--oracle.ord.media.chart.piechart.PieChartInteractive
PieChartInteractive is a subclass of PieChart that is used to implement interactive pie charts. This class provides methods for determining mouse entry and exit of pie slices and methods for highlighting pie slices. These methods are most useful in Java Applets and Java Applications.
The methods getSliceEntered(int x, int y), getSliceExited(int x, int y), and getSliceIndex(int x, int y) are provided to support interactive applications. These calls enable one to detect mouse entry and exit from pie slices, and subsequently initiate actions triggered by the pie slice exit or entry.
getSliceEntered() returns true if the passed (x,y) coordinate triggers a pie slice entry. Likewise, getSliceExited() returns true if the passed (x,y) coordinate triggers a pie slice exit. getSliceIndex() is used to determine the index of the pie slice located at coordinate (x,y). The sliceIndex can be subsequently used to initiate chart actions, such as pie slice highlighting.
Pie slice highlighting may be triggered by pie slice events. setSliceHighlight(int sliceIndex, Color c) alters the color of the pie slice (identified by sliceIndex). setSliceUnHighlight() restores the highlighted pie slice to its original color. Note that for a given pie chart, at most one pie slice may be highlighted an any time.
Note that slice indexes are integer values starting at 0. For example, if the pie has three slices, it will have slice indexes 0, 1, and 2.
Inner classes inherited from class oracle.ord.media.chart.legend.Legend |
Legend.LegendElement |
Inner classes inherited from class oracle.ord.media.chart.Chart |
Chart.ChartLabel |
Fields inherited from class oracle.ord.media.chart.legend.Legend |
DERIVED, EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, USERDEFINED, WEST |
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 | |
PieChartInteractive()
Constructor |
Method Summary | |
boolean |
getSliceEntered(int x,
int y)
Return true if the cursor has entered a pie slice. |
boolean |
getSliceExited(int x,
int y)
Return true if the cursor has exited a pie slice. |
int |
getSliceIndex(int x,
int y)
Return the index of the pie slice at location (x,y). |
void |
setSliceHighlight(int sliceIndex,
java.awt.Color c)
Highlight the pie slice corresponding to the specified index. |
void |
setSliceLabelHighlight(int sliceIndex,
java.awt.Color c)
Highlight the pie slice label corresponding to the specified index. |
void |
setSliceLabelUnHighlight()
Remove the highlighting of the pie slice label for any and all pie slices. |
void |
setSliceUnHighlight()
Remove the highlighting for any and all pie slices. |
Methods inherited from class oracle.ord.media.chart.legend.Legend |
getLegendAlignment, getLegendBackground, getLegendDisable, getLegendDisplaySingleSeries, getLegendEdgeColor, getLegendEdgeDisable, getLegendForeground, getLegendInside, setLegendAlignment, setLegendBackground, setLegendDisable, setLegendDisplaySingleSeries, setLegendEdgeColor, setLegendEdgeDisable, setLegendFont, setLegendForeground, setLegendInside, setLegendOffsetX, setLegendOffsetY |
Methods inherited from class oracle.ord.media.chart.Chart |
getBackground, getBorderBottom, getBorderLeft, getBorderRight, getBorderTop, getEdgeColor, getFootnote, getHeight, getMinimumSize, getPreferredSize, getRenderingHintsChart, getSize, getSubtitle, getTitle, getVersion, getWidth, isSetRenderingHintsChart, setBackground, setBorderBottom, setBorderLeft, setBorderRight, setBorderTop, setEdgeColor, setRenderingHintsChart, setTitlesForeground |
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, 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, 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, setComponentOrientation, setCursor, setDropTarget, setEnabled, setLocale, setLocation, setLocation, setName, 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 |
public PieChartInteractive()
Method Detail |
public int getSliceIndex(int x, int y) throws ChartException
x
- The screen x coordinate.y
- The screen y coordinate.ChartException
- if the PieSliceDesc is undefined.public boolean getSliceEntered(int x, int y) throws ChartException
x
- The screen x coordinate.y
- The screen y coordinate.ChartException
- if the PieSliceDesc is undefined.getSliceExited(int, int)
public boolean getSliceExited(int x, int y) throws ChartException
x
- The screen x coordinate.y
- The screen y coordinate.ChartException
- if the PieSliceDesc is undefined.getSliceEntered(int, int)
public void setSliceUnHighlight() throws ChartException
setSliceHighlight(int, Color)
public void setSliceLabelUnHighlight() throws ChartException
setSliceLabelHighlight(int, Color)
public void setSliceHighlight(int sliceIndex, java.awt.Color c) throws ChartException
sliceIndex
- Index identifying the pie slice.c
- Color to set pie slice.ChartException
- for an invalid pie slice index.setSliceUnHighlight()
public void setSliceLabelHighlight(int sliceIndex, java.awt.Color c) throws ChartException
sliceIndex
- Index identifying the pie slice.c
- Color to set pie slice label.ChartException
- for an invalid pie slice index.setSliceUnHighlight()
|
Chart Builder API (beta) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |