Package hec.chart
Class HistogramChart
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jfree.chart.ChartPanel
hec.chart.HistogramChart
- All Implemented Interfaces:
ActionListener,MouseListener,MouseMotionListener,ImageObserver,MenuContainer,Printable,Serializable,EventListener,Accessible,org.jfree.chart.event.ChartChangeListener,org.jfree.chart.event.ChartProgressListener,org.jfree.chart.event.OverlayChangeListener
public class HistogramChart
extends org.jfree.chart.ChartPanel
Copyright (C) 2014 Hydrologic Engineering Center, United States Army Corps of Engineers, All
Rights Reserved HEC-Java NEXGEN Version 1.0beta
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected intprotected org.jfree.chart.JFreeChartprotected List<? extends DataContainer>protected org.jfree.chart.ChartPanelprotected intprotected Stringprotected Histogramprotected intprotected Stringprotected HistogramPlotDialogprotected intprotected booleanprotected double[]protected Stringprotected doubleprotected doubleprotected Stringstatic final intstatic final doublestatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class org.jfree.chart.ChartPanel
COPY_COMMAND, DEFAULT_BUFFER_USED, DEFAULT_HEIGHT, DEFAULT_MAXIMUM_DRAW_HEIGHT, DEFAULT_MAXIMUM_DRAW_WIDTH, DEFAULT_MINIMUM_DRAW_HEIGHT, DEFAULT_MINIMUM_DRAW_WIDTH, DEFAULT_WIDTH, DEFAULT_ZOOM_TRIGGER_DISTANCE, localizationResources, PRINT_COMMAND, PROPERTIES_COMMAND, SAVE_COMMAND, ZOOM_IN_BOTH_COMMAND, ZOOM_IN_DOMAIN_COMMAND, ZOOM_IN_RANGE_COMMAND, ZOOM_OUT_BOTH_COMMAND, ZOOM_OUT_DOMAIN_COMMAND, ZOOM_OUT_RANGE_COMMAND, ZOOM_RESET_BOTH_COMMAND, ZOOM_RESET_DOMAIN_COMMAND, ZOOM_RESET_RANGE_COMMANDFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS -
Constructor Summary
ConstructorsConstructorDescriptionHistogramChart(Histogram hist, int histType, int binType) HistogramChart(List<? extends DataContainer> pdContainers, int histType, int binType) -
Method Summary
Modifier and TypeMethodDescriptionstatic double[]analyticGaussian(double[] X) protected org.jfree.data.xy.IntervalXYDatasetcreateDataset(String histTitle, int histType) static double[]gaussianArray(int npts) static double[]gaussianArray(int npts, double shift, double scale) doubleorg.jfree.chart.JFreeChartgetChart()org.jfree.chart.ChartPanelList<? extends DataContainer>intbooleanvoidvoidvoidinit(List<? extends DataContainer> pdcList, int histType, int binType) voidinit(List<? extends DataContainer> pdcList, int histType, int binType, int curve) voidinit(List<? extends DataContainer> containers, int histType, int binType, String xAxisPlotLabels) booleanvoidvoidplot()voidvoidprotected voidreplaceYOrdinateValue(PairedDataContainer pdc, double query, double replacement) voidsetAnalyticData(double[] xA, double[] yA) voidsetBinSize(double binSize) voidsetBinSizeNoRebuild(double binSize) voidsetBinType(int type) voidsetBinTypeNoRebuild(int binType) voidsetContainers(List<? extends DataContainer> containers) voidsetDisplayHistogramDialog(boolean displayHistogramDialog) voidsetHistogramType(int type) voidsetHistogramWeightProvider(HistogramWeightProvider weightProvider) voidsetHistTool(HistogramPlotDialog histTool) voidsetNumBins(int nbins) voidsetNumBinsNoRebuild(int length) voidsetPlotAnalytic(boolean plotA) voidvoidsetXmax(double xmax) voidsetXmin(double xmin) voidvoidvoidvoidupdate()voidvoidMethods inherited from class org.jfree.chart.ChartPanel
actionPerformed, addChartMouseListener, addOverlay, chartChanged, chartProgress, createChartPrintJob, createPopupMenu, createPopupMenu, displayPopupMenu, doCopy, doEditChartProperties, doSaveAs, getAnchor, getChartRenderingInfo, getDefaultDirectoryForSaveAs, getDismissDelay, getEntityForPoint, getFillZoomRectangle, getHorizontalAxisTrace, getHorizontalTraceLine, getInitialDelay, getListeners, getMaximumDrawHeight, getMaximumDrawWidth, getMinimumDrawHeight, getMinimumDrawWidth, getPopupMenu, getRefreshBuffer, getReshowDelay, getScaleX, getScaleY, getScreenDataArea, getScreenDataArea, getToolTipText, getVerticalAxisTrace, getVerticalTraceLine, getZoomAroundAnchor, getZoomFillPaint, getZoomInFactor, getZoomOutFactor, getZoomOutlinePaint, getZoomTriggerDistance, isDomainZoomable, isEnforceFileExtensions, isMouseWheelEnabled, isRangeZoomable, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, overlayChanged, paintComponent, print, removeChartMouseListener, removeOverlay, restoreAutoBounds, restoreAutoDomainBounds, restoreAutoRangeBounds, scale, setAnchor, setChart, setDefaultDirectoryForSaveAs, setDismissDelay, setDisplayToolTips, setDomainZoomable, setEnforceFileExtensions, setFillZoomRectangle, setHorizontalAxisTrace, setHorizontalTraceLine, setInitialDelay, setMaximumDrawHeight, setMaximumDrawWidth, setMinimumDrawHeight, setMinimumDrawWidth, setMouseWheelEnabled, setMouseZoomable, setMouseZoomable, setPopupMenu, setRangeZoomable, setRefreshBuffer, setReshowDelay, setVerticalAxisTrace, setVerticalTraceLine, setZoomAroundAnchor, setZoomFillPaint, setZoomInFactor, setZoomOutFactor, setZoomOutlinePaint, setZoomTriggerDistance, translateJava2DToScreen, translateScreenToJava2D, updateUI, zoom, zoomInBoth, zoomInDomain, zoomInRange, zoomOutBoth, zoomOutDomain, zoomOutRangeMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUIMethods 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, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, updateMethods 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, validateTreeMethods 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
-
Field Details
-
COUNTS
public static final int COUNTS- See Also:
-
FREQUENCIES
public static final int FREQUENCIES- See Also:
-
NUMBER_OF_BINS
public static final int NUMBER_OF_BINS- See Also:
-
BIN_SIZE
public static final int BIN_SIZE- See Also:
-
USER_DEFINED
public static final int USER_DEFINED- See Also:
-
nBinsDefault
public static final int nBinsDefault- See Also:
-
binSizeDefault
public static final double binSizeDefault- See Also:
-
_chart
protected org.jfree.chart.JFreeChart _chart -
_values
protected double[] _values -
_nbins
protected int _nbins -
_binSize
protected double _binSize -
_xMin
protected double _xMin -
_xMax
protected double _xMax -
_histogramType
protected int _histogramType -
_binType
protected int _binType -
_hist
-
_cp
protected org.jfree.chart.ChartPanel _cp -
_dataName
-
_xLabel
-
_yLabel
-
_histTitle
-
_plotAnalytic
protected boolean _plotAnalytic -
_containers
-
_histTool
-
_curve
protected int _curve
-
-
Constructor Details
-
HistogramChart
public HistogramChart() -
HistogramChart
-
HistogramChart
- Parameters:
pdContainers- Paired data containershistType- one of COUNTS or FREQUENCIESbinType- one of NUMBER_OF_BINS or BIN_SIZE
-
-
Method Details
-
init
-
init
-
init
public void init(List<? extends DataContainer> containers, int histType, int binType, String xAxisPlotLabels) - Parameters:
containers- Paired data containershistType- one of COUNTS or FREQUENCIESbinType- one of NUMBER_OF_BINS or BIN_SIZE
-
init
- Parameters:
hist-histType-binType-
-
init
- Parameters:
hist-histType-binType-
-
setNumBins
public void setNumBins(int nbins) -
setBinSize
public void setBinSize(double binSize) -
setHistogramType
public void setHistogramType(int type) -
setBinType
public void setBinType(int type) -
setXmin
public void setXmin(double xmin) -
setXmax
public void setXmax(double xmax) -
setSeriesColor
public void setSeriesColor() -
getHistogram
-
getChart
public org.jfree.chart.JFreeChart getChart()- Overrides:
getChartin classorg.jfree.chart.ChartPanel
-
getChartPanel
public org.jfree.chart.ChartPanel getChartPanel() -
getNumBins
public int getNumBins() -
getBinSize
public double getBinSize() -
update
public void update() -
updateWithNoReconstruction
public void updateWithNoReconstruction() -
plot
public void plot() -
getImage
-
plot
-
createDataset
-
setAnalyticData
public void setAnalyticData(double[] xA, double[] yA) -
setPlotAnalytic
public void setPlotAnalytic(boolean plotA) -
hasPlotAnalytic
public boolean hasPlotAnalytic() -
plotAnalytic
public void plotAnalytic() -
gaussianArray
public static double[] gaussianArray(int npts, double shift, double scale) -
gaussianArray
public static double[] gaussianArray(int npts) -
analyticGaussian
public static double[] analyticGaussian(double[] X) -
zoomToAll
public void zoomToAll() -
replaceYOrdinateValue
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener- Overrides:
mouseClickedin classorg.jfree.chart.ChartPanel
-
showPopupPlot
public void showPopupPlot() -
setDisplayHistogramDialog
public void setDisplayHistogramDialog(boolean displayHistogramDialog) -
setBinSizeNoRebuild
public void setBinSizeNoRebuild(double binSize) -
setBinTypeNoRebuild
public void setBinTypeNoRebuild(int binType) -
setNumBinsNoRebuild
public void setNumBinsNoRebuild(int length) -
isDisplayHistogramDialog
public boolean isDisplayHistogramDialog() -
getHistTool
-
setHistTool
-
getContainers
-
setContainers
-
setYLabel
-
setYLabel
public void setYLabel() -
setHistogramWeightProvider
-