Package hec.gfx2d.swing.charts.pie
Class PieChartPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
hec.gfx2d.swing.charts.pie.PieChartPanel
- All Implemented Interfaces:
Roundable
,ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
Copyright (C) 2017 Hydrologic Engineering Center,
United States Army Corps of Engineers, All Rights Reserved
HEC-Java NEXGEN
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateMixture
(Color c1, Color c2, float p) double
getArcAngle
(RmaDataId sliceId) int
getBandedContourMax
(BandedColorContour contour) int
getBandedContourMin
(BandedColorContour contour) final ChartModel
getModel()
double
getSliceContour
(RmaDataId sliceId) getSliceContourType
(RmaDataId sliceId) getSliceLabelColor
(RmaDataId sliceId) getSliceLabelFont
(RmaDataId sliceId) getSliceLabelFormat
(RmaDataId sliceId) double
getSliceMaxValue
(RmaDataId sliceId) double
getSliceMinValue
(RmaDataId sliceId) int
getSliceQuality
(RmaDataId sliceId) double
getSliceRelativeMax
(RmaDataId sliceId) double
getSliceRelativeValue
(RmaDataId sliceId) final List<PieSliceView>
getSliceThresholds
(RmaDataId sliceId) getSliceUnits
(RmaDataId sliceId) double
getSliceValue
(RmaDataId sliceId) double
double
double
double
double
double
getUnits()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isSliceShowLabel
(RmaDataId sliceId) boolean
isSliceShowThresholds
(RmaDataId sliceId) boolean
isSliceShowValue
(RmaDataId sliceId) boolean
isSliceSingleColor
(RmaDataId sliceId) boolean
isSliceVisible
(RmaDataId sliceId) boolean
boolean
static void
void
double
round
(double toRound) void
void
updateCurrentTime
(Date trialTime) Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
PieChartPanel
-
-
Method Details
-
getModel
-
setTime
-
getChartView
-
updateCurrentTime
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
getSlices
-
main
-
getTotalValue
public double getTotalValue()- Returns:
- the aggregate value of all visible items in the chart
-
getTotalRelativeValue
public double getTotalRelativeValue()- Returns:
- the aggregative value of all visible items in the chart, relative to the minimums
-
getSliceValue
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the value of the slice identified at the current time
-
getSliceRelativeValue
- Parameters:
sliceId
-- Returns:
- the value of a slice relative to its minimum
-
getTotalMinValue
public double getTotalMinValue()- Returns:
- the aggregate minimum value of all visible items in the chart
-
getSliceMinValue
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the minimum value of the slice identified at the current time
-
getTotalMaxValue
public double getTotalMaxValue()- Returns:
- the aggregate maximum value of all visible items in the chart
-
getTotalRelativeMax
public double getTotalRelativeMax()- Returns:
- the aggregate maximum value of all visible items in the chart relative to their minimums
-
getSliceMaxValue
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the maximum value of the slice identified at the current time
-
getSliceRelativeMax
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the maximum value of the given item relative to its minimum
-
getQuality
public double getQuality()- Returns:
- an aggregate average of the quality of all visible items in the chart
-
getSliceQuality
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the quality rating of the data for the slice at the current time
-
getUnits
- Returns:
- the units of the first item in the chart (taken as the units for the chart as a whole)
-
getSliceUnits
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the units of the slice identified
-
getSliceIds
- Returns:
- a list of all the item ids in this chart
-
getLegendSide
- Returns:
- the side to display the legend on
-
getTitleFont
- Returns:
- the font style to display the title text with
-
getTitleFormat
- Returns:
- the format string (with replaced values) used as the title text
-
getTitleColor
- Returns:
- the color to display the title text with
-
getSubtitleFont
- Returns:
- the font style to display the subtitle with
-
getSubtitleFormat
- Returns:
- the subtitle format string (with replaced values)
-
getSubtitleColor
- Returns:
- the color to display the subtitle text with
-
isShowRadialSum
public boolean isShowRadialSum()- Returns:
- whether or not to show the radial sum on the chart
-
isSingleColorSum
public boolean isSingleColorSum()- Returns:
- whether the sum is extrapolating a single color from its contour
-
getRadialSumContour
- Returns:
- the color to display for the radial sum
-
getRadialSumContourType
- Returns:
- the type of color contour used in the display of the radial sum
-
getBandedContourMax
- Parameters:
contour
- the banded contour to retrieve the maximum value bound from- Returns:
- the maximum index used in the banded color contour
-
getBandedContourMin
- Parameters:
contour
- the banded contour to retrieve the minimum value bound from- Returns:
- the minimum index used in the banded color contour
-
isDrawClockwise
public boolean isDrawClockwise()- Returns:
- if the chart is drawing in the clockwise direction
-
getStartAngle
public double getStartAngle()- Returns:
- the unit circle starting angle, in degrees, for the first slice
-
getStartAngleMeasure
- Returns:
- the measuring style for the start angle
-
isShowThresholds
public boolean isShowThresholds()- Returns:
- whether or not to show thresholds on the chart
-
isShowThresholdText
public boolean isShowThresholdText()- Returns:
- whether or not to show thresholds text on the chart.
-
getThresholds
- Returns:
- the thresholds linked to the chart as a whole
-
round
public double round(double toRound) -
isSliceVisible
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the visibility state of the slice
-
isSliceSingleColor
- Parameters:
sliceId
- the id of the slice in question- Returns:
- whether the slice is extrapolating a single color from its contour
-
getSliceContour
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the contour used for this slice
-
getSliceContourType
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the contour type used for this slice
-
isSliceShowLabel
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the visibility state of the slice's label
-
getSliceLabelFont
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the font style used to display the slice's label
-
getSliceLabelFormat
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the format string of the slice label (with values replaced)
-
getSliceLabelColor
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the color of the slice's label text
-
isSliceShowValue
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the visibility state of the slice's exact value marker
-
isSliceShowThresholds
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the visibility state of the slice's thresholds
-
getSliceThresholds
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the list of the slice's thresholds
-
getArcAngle
- Parameters:
sliceId
- the id of the slice in question- Returns:
- the angle of a pie that the slice would take up, given that it is visible automatically corrected for clockwise or counter-clockwise drawing directions
-
createMixture
-
isTitleVisible
public boolean isTitleVisible() -
isSubtitleVisible
public boolean isSubtitleVisible() -
isRadialSumTextVisible
public boolean isRadialSumTextVisible()
-