|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--vis.beans.plotter.Viewport | +--vis.beans.plotter.PieChart
Draws a pie chart.
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected java.awt.Point |
border
|
protected int[] |
borderULHC
Upper left hand corner coordinate of the border. |
protected java.lang.Class |
customizerClass
The customizer class |
protected boolean |
enableDraw
Flag that indicates whether to redraw the plot. |
protected java.awt.Font |
font
Font |
protected int |
fontSize
Font size |
protected java.awt.Color |
graphColor
Graph color |
protected int |
graphHt
Width and height of the graph. |
protected int |
graphNum
Current graph number. |
protected java.lang.String |
graphTitle
Graph title. |
protected int |
graphWid
Width and height of the graph. |
protected int |
headerHt
Hieght of the header. |
protected java.awt.Point |
headerPt
Position of the title. |
protected int |
legBoxSize
Size of the legend box. |
protected int |
legendGap
The gap between two legend strings. |
protected int |
legendGapIncr
Legend gap increment |
protected boolean |
legendOn
Legend on or off. |
protected int[] |
legendPos
Legend position. |
protected int |
legendPosXIncr
Legend position increment in X direction. |
protected int |
legendPosYIncr
Legend position increment in Y direction. |
protected int[] |
legendULHC
Upper left hand corner coordinate of the first legend string |
protected java.awt.Point |
legPt
Absolute legend position, i.e.; legendPos+incr. |
protected int |
maxPies
Maximum number of pies |
protected java.awt.Point |
orig
Origin of the graph |
protected java.awt.FontMetrics |
pFont
Font metrics |
protected int |
pieCenterXIncr
Pie center X coordinate increment |
protected int |
pieCenterYIncr
Pie center Y coordinate increment |
protected int |
pieDiaIncr
Pie diameter increment |
protected java.lang.String |
titleString
Plot title |
protected java.lang.Object |
x
Object that holds an array of X axis values. |
protected double |
xRange
X axis range of values i.e.; max - min. |
protected double |
xScale
X axis scale factor. |
protected java.lang.String[] |
xTextValues
X axis string values. |
protected java.lang.Object |
y
Object that holds an array of Y axis values. |
protected double |
yRange
Y axis range |
protected double |
yScale
Y axis scale factor. |
Fields inherited from class vis.beans.plotter.Viewport |
destGc, destImage, height, offScrGc, offScrImage, pixImage, plBeanContext, width, xMagFac, xScaleFac, yMagFac, yScaleFac |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
PieChart()
|
Method Summary | |
void |
addLegend(java.awt.Color col,
java.lang.String str)
Adds a legend. |
void |
addNotify()
|
void |
createPlotTemplate()
Creates the plot template. |
void |
draw()
Draws the pie chart on the viewport. |
void |
drawPieChart(java.lang.Object xs,
java.lang.Object y)
Draws the pie chart. |
void |
drawPlot(java.lang.Object x,
java.lang.Object y)
|
int[] |
getBorderULHC()
|
int |
getBorderULHC(int index)
|
java.lang.Class |
getCustomizerClass()
|
java.awt.Color |
getGraphColor()
|
java.lang.String |
getGraphTitle()
|
int |
getLegendGapIncr()
|
boolean |
getLegendOn()
|
int[] |
getLegendPos()
|
int |
getLegendPos(int index)
|
int |
getLegendPosXIncr()
|
int |
getLegendPosYIncr()
|
int[] |
getLegendULHC()
|
int |
getLegendULHC(int index)
|
java.awt.Dimension |
getMinimumSize()
|
java.awt.Graphics |
getOffScrGc()
|
int |
getPieCenterXIncr()
|
int |
getPieCenterYIncr()
|
int |
getPieDiaIncr()
|
java.lang.String |
getTitleString()
|
protected void |
launchCustomizer(java.lang.Class cl)
|
static java.lang.String |
launchFileDialog()
|
void |
plotPieChart(PlotEvent e)
Plots the pie chart. |
protected void |
popupMenu(int x,
int y)
|
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat f,
int pageIndex)
|
protected void |
printPlot()
|
protected void |
processMouseEvent(java.awt.event.MouseEvent e)
|
protected void |
reset()
Resets the plot viewport. |
void |
resetPieChart()
Resets the plot viewport. |
static java.lang.String |
saveAsJPEG(java.awt.image.BufferedImage bi)
|
void |
setBackground(java.awt.Color clr)
Sets the background color. |
void |
setBorderULHC(int[] br)
Sets the upper left hand corner coordinate(ULHC) of the plot border. |
void |
setBorderULHC(int index,
int xy)
Sets one of the border ULHC coordinate which is an indexed property. |
void |
setCustomizerClass(java.lang.Class cl)
Sets the customizer class. |
void |
setFont(java.awt.Font fnt)
Sets the font. |
void |
setForeground(java.awt.Color clr)
Sets the foreground color. |
void |
setGraphColor(java.awt.Color col)
Sets the graph color. |
void |
setGraphTitle(java.lang.String grTitle)
Sets the graph title. |
void |
setLegendGapIncr(int incr)
Sets the legend gap increment property. |
void |
setLegendOn(boolean onOff)
Sets the legend visibility on or of. |
void |
setLegendPos(int[] pt)
Sets the legend position which is an indexed property. |
void |
setLegendPos(int index,
int xy)
Sets the legend position which is an indexed property. |
void |
setLegendPosXIncr(int incr)
Sets the legend position increment in the X direction. |
void |
setLegendPosYIncr(int num)
Sets the legend position increment in the Y direction. |
void |
setLegendULHC(int[] pt)
This is an indexed propety that represents the legend position. |
void |
setLegendULHC(int xy,
int index)
This is a setter method that sets an element of the indexed property. |
protected void |
setParams()
Sets the pie plot viewport related parameters. |
void |
setPieCenterXIncr(int incr)
Sets the pie center x increment property. |
void |
setPieCenterYIncr(int incr)
Sets the pie center y increment property. |
void |
setPieDiaIncr(int incr)
Sets the pie diameter increment property. |
void |
setTitleString(java.lang.String title)
Sets the plot title. |
void |
setWidHt(int wd,
int hgt)
Sets width and height. |
Methods inherited from class vis.beans.plotter.Viewport |
addPropertyChangeListener, addVetoableChangeListener, createOffScrImage, getBeanContext, imagePaint, invokePrinterService, invokeSaveImageService, paintComponent, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, setOffScrGc |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.awt.Point border
protected java.awt.Point orig
protected java.awt.Point headerPt
protected int headerHt
protected double xScale
protected double yScale
protected double xRange
protected double yRange
protected int legBoxSize
protected java.awt.Point legPt
protected java.lang.Object x
protected java.lang.Object y
protected boolean enableDraw
protected java.lang.String titleString
protected java.awt.Color graphColor
protected java.awt.Font font
protected java.awt.FontMetrics pFont
protected int fontSize
protected int graphWid
protected int graphHt
protected int graphNum
protected java.lang.String graphTitle
protected java.lang.String[] xTextValues
protected boolean legendOn
protected int[] borderULHC
protected int[] legendPos
protected int legendPosXIncr
protected int legendPosYIncr
protected int legendGap
protected int legendGapIncr
protected java.lang.Class customizerClass
protected int maxPies
protected int[] legendULHC
protected int pieDiaIncr
protected int pieCenterXIncr
protected int pieCenterYIncr
Constructor Detail |
public PieChart()
Method Detail |
public void addNotify()
addNotify
in class javax.swing.JComponent
public void setLegendULHC(int[] pt)
pt
- an array of size two which holds the upper left
hand corner coordinate of the legend.public void setLegendULHC(int xy, int index)
xy
- the x or y coordinate of the legend.index
- the index of the property.public int[] getLegendULHC()
public int getLegendULHC(int index)
public void setPieDiaIncr(int incr)
incr
- the increment.public int getPieDiaIncr()
public void setPieCenterXIncr(int incr)
incr
- the increment.public int getPieCenterXIncr()
public void setPieCenterYIncr(int incr)
incr
- the increment.public int getPieCenterYIncr()
public void setLegendGapIncr(int incr)
incr
- the increment.public int getLegendGapIncr()
public void setWidHt(int wd, int hgt)
setWidHt
in class Viewport
vis.beans.plotter.Viewport
wd
- the width of the viewport.ht
- the height of the viewport.public void setBackground(java.awt.Color clr)
setBackground
in class javax.swing.JComponent
clr
- the color.public void setForeground(java.awt.Color clr)
setForeground
in class javax.swing.JComponent
clr
- the color.public void setTitleString(java.lang.String title)
title
- the plot title.public java.lang.String getTitleString()
public void setGraphTitle(java.lang.String grTitle)
grTitle
- the graph title.public java.lang.String getGraphTitle()
public void setLegendOn(boolean onOff)
onOff
- the legend is on or off.public boolean getLegendOn()
public void setFont(java.awt.Font fnt)
setFont
in class javax.swing.JComponent
fnt
- the font.public void setGraphColor(java.awt.Color col)
col
- the graph color.public java.awt.Color getGraphColor()
public void setBorderULHC(int[] br)
br
- an array of size two that holds
the x and y coordinates of upper left hand corner of the border.public int[] getBorderULHC()
public void setBorderULHC(int index, int xy)
index
- the index of the borderULHC index property.xy
- the value corresponding to the index.public int getBorderULHC(int index)
index
- the index of the borderULHC property. It can be 0 or 1.public void setLegendPos(int[] pt)
br
- an array of size two that holds
the x and y coordinates of upper left hand corner of the border.public void setLegendPos(int index, int xy)
index
- the index of the borderULHC index property.xy
- the value corresponding to the index.public int[] getLegendPos()
public int getLegendPos(int index)
index
- the index of the array.public void setLegendPosXIncr(int incr)
incr
- the increment.public int getLegendPosXIncr()
public void setLegendPosYIncr(int num)
incr
- the increment.public int getLegendPosYIncr()
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.lang.Class getCustomizerClass()
public void setCustomizerClass(java.lang.Class cl)
the
- customizer class.public void createPlotTemplate()
protected void setParams()
public void addLegend(java.awt.Color col, java.lang.String str)
col
- the color of the legend box.str
- the legend string.public void resetPieChart()
protected void processMouseEvent(java.awt.event.MouseEvent e)
processMouseEvent
in class java.awt.Component
public void plotPieChart(PlotEvent e)
e
- the PlotEvent.public java.awt.Graphics getOffScrGc()
public void drawPieChart(java.lang.Object xs, java.lang.Object y)
x
- the array of x values.y
- the array of y values.public void drawPlot(java.lang.Object x, java.lang.Object y)
x
- an array of x values. In this case, these are string values.y
- an arrya of y values.public void draw()
draw
in class Viewport
public int print(java.awt.Graphics g, java.awt.print.PageFormat f, int pageIndex)
print
in interface java.awt.print.Printable
protected void reset()
protected void popupMenu(int x, int y)
protected void printPlot()
public static java.lang.String saveAsJPEG(java.awt.image.BufferedImage bi)
public static java.lang.String launchFileDialog()
protected void launchCustomizer(java.lang.Class cl) throws java.lang.InstantiationException, java.lang.IllegalAccessException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |