adams.gui.visualization.stats.boxplot
Class BoxPlotManager

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 adams.gui.core.BasePanel
                      extended by 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: 6313 $
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
protected  JButton m_Add
          Button to add selected attribute to chosen attributes list
protected  JButton m_AddAll
          Button to add all attributes to chosen attributes list
protected  DefaultListModel m_Attributes
          attributes that can be chosen
protected  BaseListWithButtons m_AttributesDis
          Object that contains a list and a group of buttons for choosing attributes
protected  boolean m_AxisSame
          whether the axis should have the same scale
protected  JSpinner m_AxisWidSpin
          spinner to choose the axis width of each box plot
protected  int m_AxisWidth
          width of the axis of each box plot
protected  JPanel m_Centre
          Panel for displaying box plots
protected  DefaultListModel m_Chosen
          attributes that have been chosen
protected  BaseListWithButtons m_ChosenDis
          Object that contains a list and a group of buttons for removing attributes
protected  Color m_Color
          Color to fill boxes with
protected  JButton m_Colorbutton
          Button to choose color of boxes
protected  boolean m_Fill
          Whether boxes should be filled
protected  JCheckBox m_FillCheck
          Check box to choose if boxes should b filled
protected  JSpinner m_GridSpin
          Spinner for choosing the number of box plots to be displayed horizontally
protected  int m_Height
          Height of graphs drawn
protected  JSpinner m_HeightSpin
          Spinner to choose the height of each box plot
protected  Instances m_Instances
          Instances to be graphed
protected  int m_NumHorizontal
          Number of box plots to display horizontally
protected  ParameterPanel m_PanelParams
          Object that contains a set of label and component objects, aids displaying
protected  Range m_Range
          Range of box plots to display initially
protected  JButton m_Remove
          Button to remove a selected attribute from chosen attributes list
protected  JButton m_RemoveAll
          Button to remove all attributes from the chosen attributes list
protected  JCheckBox m_SameAxis
          select whether graphs have the same axis
protected  int m_Width
          width of graphs drawn
protected  int m_WidthLeft
          width of left hand panel of the box plot manager
protected  JSpinner m_WidthSpin
          spinner to choose the width of each box plot
 
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
BoxPlotManager()
          Constructor
 
Method Summary
protected  void addAllClicked()
          Displays box plots for all attributes
protected  void addClicked()
          adds attributes to selected attributes list
protected  void colorChange()
          Color for box plots changes
protected  void fillChange(ItemEvent val)
          Fill boxes check box is changed
protected  void finishInit()
          finishes the initialization.
 int getAxisWidth()
          Get the width of the left axis for each boxplot
 int getBoxHeight()
          Get the height of each box plot
 int getBoxWidth()
          Get the width of each box plot drawn
 int getNumHorizontal()
          Get the number of box plots to display on each row
 Range getRange()
          Get the range of box plots to be displayed initially
 boolean getSameAxis()
          get whether the box plots should all use the same axis scale
protected  void initGUI()
          Initializes the gui
protected  void initialize()
           
 void painted(PaintEvent e)
          Controls the painting of the box plots
protected  void removeAllClicked()
          removes all attributes from the chosen attribute list
protected  void removeClicked()
          removes attribute from selected list and places in attribute list
 void reset()
          Called when the fields set from the class that created this boxplotmanager object
protected  void sameAxisChange(ItemEvent e)
          Sets the axis scale to be the same for each box plot
 void setAxisWidth(int val)
          Set the width of the left axis for each box plot
 void setBoxHeight(int val)
          Set the height of each box plot drawn
 void setBoxWidth(int val)
          Set the width of each box plot
 void setColor(Color val)
          Set the color to fill the boxes with
 void setFill(boolean val)
          Set whether the boxes should be filled with color
 void setInstances(Instances inst)
          sets the instances to be displayed
 void setNumHorizontal(int val)
          Set the number of box plots to display on each row
 void setRange(Range val)
          Set the range of box plots to display initially
 void setSameAxis(boolean val)
          Set whether each box plot should have the same axis scale
protected  void spinAxisChange(ChangeEvent e)
          Changes the width of the left axis on each box plot
protected  void spinHeightChange(ChangeEvent e)
          Changes the height of the box plots
protected  void spinHorizontalChange(ChangeEvent e)
          Change the number of box plots to be displayed in each row
protected  void spinWidthChange(ChangeEvent e)
          Changes the width of the box plots
protected  void update()
          Update the display with box plots required
protected  void updateButtons()
          Updates whether each of the buttons can be pressed depending on the selected list objects
protected  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, main, 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, 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, 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

m_Attributes

protected DefaultListModel m_Attributes
attributes that can be chosen


m_Chosen

protected DefaultListModel m_Chosen
attributes that have been chosen


m_Centre

protected JPanel m_Centre
Panel for displaying box plots


m_Instances

protected Instances m_Instances
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_WidthSpin

protected JSpinner m_WidthSpin
spinner to choose the width of each box plot


m_HeightSpin

protected JSpinner m_HeightSpin
Spinner to choose the height of each box plot


m_AxisWidSpin

protected JSpinner m_AxisWidSpin
spinner to choose the axis width of each box plot


m_SameAxis

protected JCheckBox m_SameAxis
select whether graphs have the same axis


m_Range

protected Range m_Range
Range of box plots to display initially


m_Add

protected JButton m_Add
Button to add selected attribute to chosen attributes list


m_AddAll

protected JButton m_AddAll
Button to add all attributes to chosen attributes list


m_AttributesDis

protected BaseListWithButtons m_AttributesDis
Object that contains a list and a group of buttons for choosing attributes


m_ChosenDis

protected BaseListWithButtons m_ChosenDis
Object that contains a list and a group of buttons for removing attributes


m_Remove

protected JButton m_Remove
Button to remove a selected attribute from chosen attributes list


m_RemoveAll

protected JButton m_RemoveAll
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_GridSpin

protected JSpinner m_GridSpin
Spinner for choosing the number of box plots to be displayed horizontally


m_FillCheck

protected JCheckBox m_FillCheck
Check box to choose if boxes should b filled


m_Colorbutton

protected JButton m_Colorbutton
Button to choose color of boxes

Constructor Detail

BoxPlotManager

public BoxPlotManager()
Constructor

Method Detail

initialize

protected void initialize()
Overrides:
initialize in class BasePanel

setInstances

public void setInstances(Instances 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


initGUI

protected void initGUI()
Initializes the gui

Overrides:
initGUI in class BasePanel

finishInit

protected void finishInit()
finishes the initialization.

Overrides:
finishInit in class BasePanel

fillChange

protected void fillChange(ItemEvent val)
Fill boxes check box is changed

Parameters:
val -

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

setColor

public void setColor(Color val)
Set the color to fill the boxes with

Parameters:
val - Color to fill

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 interface PaintListener


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.