com.isti.jplotresp
Class RespChartPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.isti.jplotresp.RespChartPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class RespChartPanel
extends javax.swing.JPanel

Class RespChartPanel generates and hosts the plotting of a response.

See Also:
Serialized Form

Nested Class Summary
protected static class RespChartPanel.RespXYLineAndShapeRenderer
          Class RespXYLineAndShapeRenderer extends XYLineAndShapeRenderer to support a 'showPointsFlag' parameter, define a smaller shape that is always returned via the 'getSeriesShape()' method, and show "square" shapes on the legend items.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.lang.String AMP_LABEL_STR
           
protected  AmpPhaseBlk[] amplitudePhaseBlkArray
           
protected  int ampPhaseSelIdx
           
protected  org.jfree.chart.plot.XYPlot ampPlotObj
           
protected  org.jfree.chart.ChartPanel chartPanelObj
           
protected  boolean combineAmpPhaseFlag
           
protected static java.lang.String FREQLN_LABEL_STR
           
protected  boolean logAmpFlag
           
protected  OutputGenerator outputGeneratorObj
           
protected static java.lang.String PHASE_LABEL_STR
           
protected  org.jfree.chart.plot.XYPlot plotObj
           
protected static java.awt.Shape RENDER_DEFAULT_SHAPE
           
protected static java.awt.Shape RENDER_LEGEND_SHAPE
           
protected  org.jfree.chart.plot.ValueMarker senseFreqMarker
           
protected static java.awt.Paint[] seriesPaintDefaultsArray
           
protected  boolean showFreqLineFlag
           
protected  boolean showPointsFlag
           
protected  java.lang.String title
           
protected static java.text.NumberFormat VNUMAXIS_FORMATTER
           
protected  org.jfree.chart.axis.NumberAxis xAxis
           
 
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.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RespChartPanel(OutputGenerator outGenObj, java.lang.String channelIdFName, boolean logSpacingFlag, PlotDisplayOptionPanel plotDisplayOptionPanel)
          Generates and hosts the plotting of a response.
 
Method Summary
 boolean anyAmpValuesNotPositive()
          Determines if any amplitude values are less than or equal to zero.
protected  boolean clearFreqLine()
          Clears the frequency-sensitivity line.
 void createChartPrintJob()
          Creates a print job for the chart.
protected  org.jfree.chart.plot.XYPlot createPlot(org.jfree.chart.plot.DrawingSupplier supplierObj, org.jfree.data.xy.XYDataset datasetObj, boolean ampPlotFlag, org.jfree.chart.axis.ValueAxis domainAxis)
          Create the plot.
protected  void createPlots()
          Creates the plots.
protected  org.jfree.chart.axis.NumberAxis createVerticalNumberAxis(boolean logAxisFlag, java.lang.String labelStr)
          Create a vertical number axis for the specified series.
 void doSaveAs()
          Opens a file chooser and gives the user an opportunity to save the chart in PNG format.
 void enterAmpPhaseSelection(int ampPhaseSelIdx)
          Enters new amp/phase displayed selection.
 int getAmpPhaseSelection()
          Returns the amp/phase displayed selection.
 boolean getCombineAmpPhaseFlag()
          Returns a flag indicating whether or not the amp and phase plots should be combined on the chart.
 boolean getLogAmpFlag()
          Returns a flag indicating whether or not the amplitude should be shown logarithmically.
 boolean getShowFreqLineFlag()
          Returns a flag indicating whether or not sensitivity-frequency line is shown on the chart.
 boolean getShowPointsFlag()
          Returns a flag indicating whether or not data-points are shown on the chart.
 void setCombineAmpPhaseFlag(boolean b)
          Selects if the amp and phase plots should be combined on the chart.
 void setLogAmpFlag(boolean b)
          Selects if the amplitude should be shown logarithmically.
 void setShowFreqLineFlag(boolean b)
          Selects if sensitivity-frequency line is shown on the chart.
 void setShowPointsFlag(boolean b)
          Selects if data-points are shown on the chart.
protected  void setShowPointsFlag(org.jfree.chart.plot.XYPlot plot, boolean b)
          Selects if data-points are shown on the chart.
protected  void showErrorMessage(java.lang.String msgStr)
          Displays the given error message.
protected  void showFreqLine()
          Displays the frequency-sensitivity line.
 
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, transferFocusBackward, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ampPhaseSelIdx

protected int ampPhaseSelIdx

showPointsFlag

protected boolean showPointsFlag

logAmpFlag

protected boolean logAmpFlag

combineAmpPhaseFlag

protected boolean combineAmpPhaseFlag

showFreqLineFlag

protected boolean showFreqLineFlag

title

protected final java.lang.String title

amplitudePhaseBlkArray

protected final AmpPhaseBlk[] amplitudePhaseBlkArray

outputGeneratorObj

protected final OutputGenerator outputGeneratorObj

plotObj

protected org.jfree.chart.plot.XYPlot plotObj

ampPlotObj

protected org.jfree.chart.plot.XYPlot ampPlotObj

senseFreqMarker

protected org.jfree.chart.plot.ValueMarker senseFreqMarker

xAxis

protected final org.jfree.chart.axis.NumberAxis xAxis

chartPanelObj

protected org.jfree.chart.ChartPanel chartPanelObj

AMP_LABEL_STR

protected static final java.lang.String AMP_LABEL_STR
See Also:
Constant Field Values

PHASE_LABEL_STR

protected static final java.lang.String PHASE_LABEL_STR
See Also:
Constant Field Values

FREQLN_LABEL_STR

protected static final java.lang.String FREQLN_LABEL_STR
See Also:
Constant Field Values

RENDER_DEFAULT_SHAPE

protected static final java.awt.Shape RENDER_DEFAULT_SHAPE

RENDER_LEGEND_SHAPE

protected static final java.awt.Shape RENDER_LEGEND_SHAPE

seriesPaintDefaultsArray

protected static final java.awt.Paint[] seriesPaintDefaultsArray

VNUMAXIS_FORMATTER

protected static final java.text.NumberFormat VNUMAXIS_FORMATTER
Constructor Detail

RespChartPanel

public RespChartPanel(OutputGenerator outGenObj,
                      java.lang.String channelIdFName,
                      boolean logSpacingFlag,
                      PlotDisplayOptionPanel plotDisplayOptionPanel)
Generates and hosts the plotting of a response.

Parameters:
outGenObj - output generator.
channelIdFName - channel ID fname.
logSpacingFlag - true to plot frequency values logarithmically.
plotDisplayOptionPanel - plot display option panel.
Method Detail

showErrorMessage

protected void showErrorMessage(java.lang.String msgStr)
Displays the given error message.

Parameters:
msgStr - message string.

createPlot

protected org.jfree.chart.plot.XYPlot createPlot(org.jfree.chart.plot.DrawingSupplier supplierObj,
                                                 org.jfree.data.xy.XYDataset datasetObj,
                                                 boolean ampPlotFlag,
                                                 org.jfree.chart.axis.ValueAxis domainAxis)
Create the plot.

Parameters:
supplierObj - drawing supplier to use.
datasetObj - dataset to use.
ampPlotFlag - true for amplitude plot; flag for phase plot.
domainAxis - domain axis to use, or null for none..
Returns:
A new plot object.

enterAmpPhaseSelection

public void enterAmpPhaseSelection(int ampPhaseSelIdx)
Enters new amp/phase displayed selection.

Parameters:
ampPhaseSelIdx - amp/phase display selection

getAmpPhaseSelection

public int getAmpPhaseSelection()
Returns the amp/phase displayed selection.

Returns:
The amp/phase displayed selection.

createVerticalNumberAxis

protected org.jfree.chart.axis.NumberAxis createVerticalNumberAxis(boolean logAxisFlag,
                                                                   java.lang.String labelStr)
Create a vertical number axis for the specified series.

Parameters:
logAxisFlag - true for logarithmic axis; false for linear axis.
labelStr - label string for axis.
Returns:
A new vertical number axis object.

createPlots

protected void createPlots()
Creates the plots.


setCombineAmpPhaseFlag

public void setCombineAmpPhaseFlag(boolean b)
Selects if the amp and phase plots should be combined on the chart.

Parameters:
b - true to combine amp/phase on the same plot.

getCombineAmpPhaseFlag

public boolean getCombineAmpPhaseFlag()
Returns a flag indicating whether or not the amp and phase plots should be combined on the chart.

Returns:
true if amp/phase combined on the same plot.

setShowPointsFlag

public void setShowPointsFlag(boolean b)
Selects if data-points are shown on the chart.

Parameters:
b - true to show data-points on the plot.

setShowPointsFlag

protected void setShowPointsFlag(org.jfree.chart.plot.XYPlot plot,
                                 boolean b)
Selects if data-points are shown on the chart.

Parameters:
plot - the plot.
b - true to show data-points on the plot.

getShowPointsFlag

public boolean getShowPointsFlag()
Returns a flag indicating whether or not data-points are shown on the chart.

Returns:
true if data-points are shown on the chart.

setLogAmpFlag

public void setLogAmpFlag(boolean b)
Selects if the amplitude should be shown logarithmically.

Parameters:
b - true to plot amp values logarithmically.

getLogAmpFlag

public boolean getLogAmpFlag()
Returns a flag indicating whether or not the amplitude should be shown logarithmically.

Returns:
true if amp values are shown logarithmically.

setShowFreqLineFlag

public void setShowFreqLineFlag(boolean b)
Selects if sensitivity-frequency line is shown on the chart.

Parameters:
b - true to show sensitivity-frequency line on the plot.

showFreqLine

protected void showFreqLine()
Displays the frequency-sensitivity line.


clearFreqLine

protected boolean clearFreqLine()
Clears the frequency-sensitivity line.

Returns:
true if the frequency-sensitivity line was cleared; false if not.

getShowFreqLineFlag

public boolean getShowFreqLineFlag()
Returns a flag indicating whether or not sensitivity-frequency line is shown on the chart.

Returns:
true if sensitivity-frequency line is shown on the chart.

anyAmpValuesNotPositive

public boolean anyAmpValuesNotPositive()
Determines if any amplitude values are less than or equal to zero.

Returns:
true if any amplitude values are less than or equal to zero.

createChartPrintJob

public void createChartPrintJob()
Creates a print job for the chart.


doSaveAs

public void doSaveAs()
Opens a file chooser and gives the user an opportunity to save the chart in PNG format.