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 boolean
m_AxisSame
whether the axis should have the same scaleprotected int
m_AxisWidth
width of the axis of each box plotprotected BaseButton
m_ButtonAdd
Button to add selected attribute to chosen attributes listprotected BaseButton
m_ButtonAddAll
Button to add all attributes to chosen attributes listprotected BaseButton
m_ButtonFillColor
Button to choose color of boxesprotected BaseButton
m_ButtonRemove
Button to remove a selected attribute from chosen attributes listprotected BaseButton
m_ButtonRemoveAll
Button to remove all attributes from the chosen attributes listprotected BaseCheckBox
m_CheckBoxFill
Check box to choose if boxes should b filledprotected BaseCheckBox
m_CheckBoxSameAxis
select whether graphs have the same axisprotected Color
m_Color
Color to fill boxes withprotected SpreadSheet
m_Data
Instances to be graphedprotected boolean
m_Fill
Whether boxes should be filledprotected int
m_Height
Height of graphs drawnprotected BaseListWithButtons
m_ListAvailableAttributes
Object that contains a list and a group of buttons for choosing attributesprotected BaseListWithButtons
m_ListChosenAttributes
Object that contains a list and a group of buttons for removing attributesprotected DefaultListModel<String>
m_ModelAvailableAttributes
attributes that can be chosenprotected DefaultListModel<String>
m_ModelChosenAttributes
attributes that have been chosenprotected int
m_NumHorizontal
Number of box plots to display horizontallyprotected ParameterPanel
m_PanelParams
Object that contains a set of label and component objects, aids displayingprotected JPanel
m_PanelRight
Panel for displaying box plotsprotected Range
m_Range
Range of box plots to display initiallyprotected JSpinner
m_SpinnerAxisWid
spinner to choose the axis width of each box plotprotected JSpinner
m_SpinnerGrid
Spinner for choosing the number of box plots to be displayed horizontallyprotected JSpinner
m_SpinnerHeight
Spinner to choose the height of each box plotprotected JSpinner
m_SpinnerWidth
spinner to choose the width of each box plotprotected BaseSplitPane
m_SplitPane
the split pane.protected int
m_Width
width of graphs drawnprotected int
m_WidthLeft
width 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 void
addAllClicked()
Displays box plots for all attributesprotected void
addClicked()
adds attributes to selected attributes listprotected void
colorChange()
Color for box plots changesprotected void
fillChange(ItemEvent val)
Fill boxes check box is changedprotected void
finishInit()
finishes the initialization.int
getAxisWidth()
Get the width of the left axis for each boxplotint
getBoxHeight()
Get the height of each box plotint
getBoxWidth()
Get the width of each box plot drawnColor
getColor()
Returns the color to fill the boxes with.boolean
getFill()
Returns whether the boxes should be filled with color.int
getNumHorizontal()
Get the number of box plots to display on each rowRange
getRange()
Get the range of box plots to be displayed initiallyboolean
getSameAxis()
get whether the box plots should all use the same axis scaleprotected void
initGUI()
Initializes the guiprotected void
initialize()
For initializing members.void
painted(PaintEvent e)
Controls the painting of the box plotsprotected void
removeAllClicked()
removes all attributes from the chosen attribute listprotected void
removeClicked()
removes attribute from selected list and places in attribute listvoid
reset()
Called when the fields set from the class that created this boxplotmanager objectprotected void
sameAxisChange(ItemEvent e)
Sets the axis scale to be the same for each box plotvoid
setAxisWidth(int val)
Set the width of the left axis for each box plotvoid
setBoxHeight(int val)
Set the height of each box plot drawnvoid
setBoxWidth(int val)
Set the width of each box plotvoid
setColor(Color val)
Set the color to fill the boxes withvoid
setData(SpreadSheet inst)
sets the instances to be displayedvoid
setFill(boolean val)
Set whether the boxes should be filled with colorvoid
setNumHorizontal(int val)
Set the number of box plots to display on each rowvoid
setRange(Range val)
Set the range of box plots to display initiallyvoid
setSameAxis(boolean val)
Set whether each box plot should have the same axis scaleprotected void
spinAxisChange(ChangeEvent e)
Changes the width of the left axis on each box plotprotected void
spinHeightChange(ChangeEvent e)
Changes the height of the box plotsprotected void
spinHorizontalChange(ChangeEvent e)
Change the number of box plots to be displayed in each rowprotected void
spinWidthChange(ChangeEvent e)
Changes the width of the box plotsprotected void
update()
Update the display with box plots requiredprotected void
updateButtons()
Updates whether each of the buttons can be pressed depending on the selected list objectsprotected void
updateGui()
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:BasePanel
For initializing members.- Overrides:
initialize
in classBasePanel
-
finishInit
protected void finishInit()
finishes the initialization.- Overrides:
finishInit
in 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:
painted
in interfacePaintListener
- Parameters:
e
- the event
-
-