Class BoxPlotManager
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.stats.boxplot.BoxPlotManager
-
- All Implemented Interfaces:
PaintListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
public class BoxPlotManager extends BasePanel implements PaintListener
Class that displays box plots for a number of attributes- Version:
- $Revision$
- Author:
- msf8
- See Also:
- Serialized Form
-
-
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 Modifier and Type Field Description protected booleanm_AxisSamewhether the axis should have the same scaleprotected intm_AxisWidthwidth of the axis of each box plotprotected BaseButtonm_ButtonAddButton to add selected attribute to chosen attributes listprotected BaseButtonm_ButtonAddAllButton to add all attributes to chosen attributes listprotected BaseButtonm_ButtonFillColorButton to choose color of boxesprotected BaseButtonm_ButtonRemoveButton to remove a selected attribute from chosen attributes listprotected BaseButtonm_ButtonRemoveAllButton to remove all attributes from the chosen attributes listprotected BaseCheckBoxm_CheckBoxFillCheck box to choose if boxes should b filledprotected BaseCheckBoxm_CheckBoxSameAxisselect whether graphs have the same axisprotected Colorm_ColorColor to fill boxes withprotected SpreadSheetm_DataInstances to be graphedprotected booleanm_FillWhether boxes should be filledprotected intm_HeightHeight of graphs drawnprotected BaseListWithButtonsm_ListAvailableAttributesObject that contains a list and a group of buttons for choosing attributesprotected BaseListWithButtonsm_ListChosenAttributesObject that contains a list and a group of buttons for removing attributesprotected DefaultListModel<String>m_ModelAvailableAttributesattributes that can be chosenprotected DefaultListModel<String>m_ModelChosenAttributesattributes that have been chosenprotected intm_NumHorizontalNumber of box plots to display horizontallyprotected ParameterPanelm_PanelParamsObject that contains a set of label and component objects, aids displayingprotected JPanelm_PanelRightPanel for displaying box plotsprotected Rangem_RangeRange of box plots to display initiallyprotected JSpinnerm_SpinnerAxisWidspinner to choose the axis width of each box plotprotected JSpinnerm_SpinnerGridSpinner for choosing the number of box plots to be displayed horizontallyprotected JSpinnerm_SpinnerHeightSpinner to choose the height of each box plotprotected JSpinnerm_SpinnerWidthspinner to choose the width of each box plotprotected BaseSplitPanem_SplitPanethe split pane.protected intm_Widthwidth of graphs drawnprotected intm_WidthLeftwidth of left hand panel of the box plot manager-
Fields inherited from class adams.gui.core.BasePanel
m_FileChooser
-
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 Constructor Description BoxPlotManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAllClicked()Displays box plots for all attributesprotected voidaddClicked()adds attributes to selected attributes listprotected voidcolorChange()Color for box plots changesprotected voidfillChange(ItemEvent val)Fill boxes check box is changedprotected voidfinishInit()finishes the initialization.intgetAxisWidth()Get the width of the left axis for each boxplotintgetBoxHeight()Get the height of each box plotintgetBoxWidth()Get the width of each box plot drawnColorgetColor()Returns the color to fill the boxes with.booleangetFill()Returns whether the boxes should be filled with color.intgetNumHorizontal()Get the number of box plots to display on each rowRangegetRange()Get the range of box plots to be displayed initiallybooleangetSameAxis()get whether the box plots should all use the same axis scaleprotected voidinitGUI()Initializes the guiprotected voidinitialize()For initializing members.voidpainted(PaintEvent e)Controls the painting of the box plotsprotected voidremoveAllClicked()removes all attributes from the chosen attribute listprotected voidremoveClicked()removes attribute from selected list and places in attribute listvoidreset()Called when the fields set from the class that created this boxplotmanager objectprotected voidsameAxisChange(ItemEvent e)Sets the axis scale to be the same for each box plotvoidsetAxisWidth(int val)Set the width of the left axis for each box plotvoidsetBoxHeight(int val)Set the height of each box plot drawnvoidsetBoxWidth(int val)Set the width of each box plotvoidsetColor(Color val)Set the color to fill the boxes withvoidsetData(SpreadSheet inst)sets the instances to be displayedvoidsetFill(boolean val)Set whether the boxes should be filled with colorvoidsetNumHorizontal(int val)Set the number of box plots to display on each rowvoidsetRange(Range val)Set the range of box plots to display initiallyvoidsetSameAxis(boolean val)Set whether each box plot should have the same axis scaleprotected voidspinAxisChange(ChangeEvent e)Changes the width of the left axis on each box plotprotected voidspinHeightChange(ChangeEvent e)Changes the height of the box plotsprotected voidspinHorizontalChange(ChangeEvent e)Change the number of box plots to be displayed in each rowprotected voidspinWidthChange(ChangeEvent e)Changes the width of the box plotsprotected voidupdate()Update the display with box plots requiredprotected voidupdateButtons()Updates whether each of the buttons can be pressed depending on the selected list objectsprotected voidupdateGui()Updates the state of gui components after options have been set-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
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, 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
-
-
-
-
Field Detail
-
m_SplitPane
protected BaseSplitPane m_SplitPane
the split pane.
-
m_ModelAvailableAttributes
protected DefaultListModel<String> m_ModelAvailableAttributes
attributes that can be chosen
-
m_ModelChosenAttributes
protected DefaultListModel<String> m_ModelChosenAttributes
attributes that have been chosen
-
m_PanelRight
protected JPanel m_PanelRight
Panel for displaying box plots
-
m_Data
protected SpreadSheet m_Data
Instances to be graphed
-
m_WidthLeft
protected int m_WidthLeft
width of left hand panel of the box plot manager
-
m_Width
protected int m_Width
width of graphs drawn
-
m_Height
protected int m_Height
Height of graphs drawn
-
m_AxisWidth
protected int m_AxisWidth
width of the axis of each box plot
-
m_NumHorizontal
protected int m_NumHorizontal
Number of box plots to display horizontally
-
m_AxisSame
protected boolean m_AxisSame
whether the axis should have the same scale
-
m_Color
protected Color m_Color
Color to fill boxes with
-
m_Fill
protected boolean m_Fill
Whether boxes should be filled
-
m_SpinnerWidth
protected JSpinner m_SpinnerWidth
spinner to choose the width of each box plot
-
m_SpinnerHeight
protected JSpinner m_SpinnerHeight
Spinner to choose the height of each box plot
-
m_SpinnerAxisWid
protected JSpinner m_SpinnerAxisWid
spinner to choose the axis width of each box plot
-
m_CheckBoxSameAxis
protected BaseCheckBox m_CheckBoxSameAxis
select whether graphs have the same axis
-
m_Range
protected Range m_Range
Range of box plots to display initially
-
m_ButtonAdd
protected BaseButton m_ButtonAdd
Button to add selected attribute to chosen attributes list
-
m_ButtonAddAll
protected BaseButton m_ButtonAddAll
Button to add all attributes to chosen attributes list
-
m_ListAvailableAttributes
protected BaseListWithButtons m_ListAvailableAttributes
Object that contains a list and a group of buttons for choosing attributes
-
m_ListChosenAttributes
protected BaseListWithButtons m_ListChosenAttributes
Object that contains a list and a group of buttons for removing attributes
-
m_ButtonRemove
protected BaseButton m_ButtonRemove
Button to remove a selected attribute from chosen attributes list
-
m_ButtonRemoveAll
protected BaseButton m_ButtonRemoveAll
Button to remove all attributes from the chosen attributes list
-
m_PanelParams
protected ParameterPanel m_PanelParams
Object that contains a set of label and component objects, aids displaying
-
m_SpinnerGrid
protected JSpinner m_SpinnerGrid
Spinner for choosing the number of box plots to be displayed horizontally
-
m_CheckBoxFill
protected BaseCheckBox m_CheckBoxFill
Check box to choose if boxes should b filled
-
m_ButtonFillColor
protected BaseButton m_ButtonFillColor
Button to choose color of boxes
-
-
Method Detail
-
initialize
protected void initialize()
Description copied from class:BasePanelFor initializing members.- Overrides:
initializein classBasePanel
-
finishInit
protected void finishInit()
finishes the initialization.- Overrides:
finishInitin classBasePanel
-
setData
public void setData(SpreadSheet inst)
sets the instances to be displayed- Parameters:
inst- Instances object for displaying
-
updateButtons
protected void updateButtons()
Updates whether each of the buttons can be pressed depending on the selected list objects
-
fillChange
protected void fillChange(ItemEvent val)
Fill boxes check box is changed- Parameters:
val- the event
-
colorChange
protected void colorChange()
Color for box plots changes
-
updateGui
protected void updateGui()
Updates the state of gui components after options have been set
-
reset
public void reset()
Called when the fields set from the class that created this boxplotmanager object
-
addClicked
protected void addClicked()
adds attributes to selected attributes list
-
removeClicked
protected void removeClicked()
removes attribute from selected list and places in attribute list
-
removeAllClicked
protected void removeAllClicked()
removes all attributes from the chosen attribute list
-
addAllClicked
protected void addAllClicked()
Displays box plots for all attributes
-
spinWidthChange
protected void spinWidthChange(ChangeEvent e)
Changes the width of the box plots- Parameters:
e- The event that occurred
-
spinHeightChange
protected void spinHeightChange(ChangeEvent e)
Changes the height of the box plots- Parameters:
e- The event that occurred
-
spinAxisChange
protected void spinAxisChange(ChangeEvent e)
Changes the width of the left axis on each box plot- Parameters:
e- The event that occurred
-
spinHorizontalChange
protected void spinHorizontalChange(ChangeEvent e)
Change the number of box plots to be displayed in each row- Parameters:
e- The event that occured
-
sameAxisChange
protected void sameAxisChange(ItemEvent e)
Sets the axis scale to be the same for each box plot- Parameters:
e- The event that occured
-
setBoxWidth
public void setBoxWidth(int val)
Set the width of each box plot- Parameters:
val- Width in pixels
-
getBoxWidth
public int getBoxWidth()
Get the width of each box plot drawn- Returns:
- Width in pixels
-
setBoxHeight
public void setBoxHeight(int val)
Set the height of each box plot drawn- Parameters:
val- Height in pixels
-
getBoxHeight
public int getBoxHeight()
Get the height of each box plot- Returns:
- Height in pixels
-
setAxisWidth
public void setAxisWidth(int val)
Set the width of the left axis for each box plot- Parameters:
val- Width in pixels
-
getAxisWidth
public int getAxisWidth()
Get the width of the left axis for each boxplot- Returns:
- Width in pixels
-
setNumHorizontal
public void setNumHorizontal(int val)
Set the number of box plots to display on each row- Parameters:
val- number on each row
-
getNumHorizontal
public int getNumHorizontal()
Get the number of box plots to display on each row- Returns:
- Number in each row
-
setSameAxis
public void setSameAxis(boolean val)
Set whether each box plot should have the same axis scale- Parameters:
val- true if same axis
-
getSameAxis
public boolean getSameAxis()
get whether the box plots should all use the same axis scale- Returns:
- true if they use the same axis scale
-
setRange
public void setRange(Range val)
Set the range of box plots to display initially- Parameters:
val- Range object containing range of attributes
-
getRange
public Range getRange()
Get the range of box plots to be displayed initially- Returns:
- The range of box plots to display
-
setFill
public void setFill(boolean val)
Set whether the boxes should be filled with color- Parameters:
val- True if filled
-
getFill
public boolean getFill()
Returns whether the boxes should be filled with color.- Returns:
- true if filled
-
setColor
public void setColor(Color val)
Set the color to fill the boxes with- Parameters:
val- Color to fill
-
getColor
public Color getColor()
Returns the color to fill the boxes with.- Returns:
- the fill color
-
update
protected void update()
Update the display with box plots required
-
painted
public void painted(PaintEvent e)
Controls the painting of the box plots- Specified by:
paintedin interfacePaintListener- Parameters:
e- the event
-
-