public class VisualizePanel extends PrintablePanel
Modifier and Type | Class and Description |
---|---|
protected class |
VisualizePanel.PlotPanel
Inner class to handle plotting
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected ActionListener |
listener
An optional listener that we will inform when ComboBox selections
change
|
protected FileFilter |
m_ArffFilter
Filter to ensure only arff files are selected
|
protected AttributePanel |
m_attrib
The panel that displays the attributes , using color to represent
another attribute.
|
protected JButton |
m_cancel
Button for the user to remove all splits.
|
protected ClassPanel |
m_classPanel
The panel that displays the legend for the colouring attribute
|
protected JPanel |
m_classSurround
Panel that surrounds the class panel with a titled border
|
protected FastVector |
m_colorList
The list of the colors used
|
protected JComboBox |
m_ColourCombo
Lets the user select the attribute to use for colouring
|
protected Color[] |
m_DefaultColors
default colours for colouring discrete class
|
protected JFileChooser |
m_FileChooser
file chooser for saving instances
|
protected JSlider |
m_Jitter
The jitter slider
|
protected JLabel |
m_JitterLab
Label for the jitter slider
|
protected LegendPanel |
m_legendPanel
The panel that displays legend info if there is more than one plot
|
protected Logger |
m_Log
the logger
|
protected JButton |
m_openBut
Button for the user to open the visualized set of instances
|
protected VisualizePanel.PlotPanel |
m_plot
The panel that displays the plot
|
protected String |
m_plotName
The name of the plot (not currently displayed, but can be used
in the containing Frame or Panel)
|
protected JPanel |
m_plotSurround
Panel that surrounds the plot panel with a titled border
|
protected String |
m_preferredColourDimension |
protected String |
m_preferredXDimension
These hold the names of preferred columns to visualize on---if the
user has defined them in the Visualize.props file
|
protected String |
m_preferredYDimension |
protected JButton |
m_saveBut
Button for the user to save the visualized set of instances
|
protected JComboBox |
m_ShapeCombo
Lets the user select the shape they want to create for instance
selection.
|
protected boolean |
m_showAttBars
Show the attribute bar panel
|
protected boolean |
m_showClassPanel
Show the class panel
|
protected VisualizePanelListener |
m_splitListener
An optional listener that we will inform when the user creates a
split to seperate instances.
|
protected JButton |
m_submit
Button for the user to enter the splits.
|
protected JComboBox |
m_XCombo
Lets the user select the attribute for the x axis
|
protected JComboBox |
m_YCombo
Lets the user select the attribute for the y axis
|
m_Printer
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
VisualizePanel()
Constructor
|
VisualizePanel(VisualizePanelListener ls)
This constructor allows a VisualizePanelListener to be set.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener act)
Add a listener for this visualize panel
|
void |
addPlot(PlotData2D newPlot)
Set a new plot to the visualize panel
|
int |
getCIndex()
Get the index of the attribute selected for coloring
|
Instances |
getInstances()
Get the master plot's instances
|
String |
getName()
Returns the name associated with this plot.
|
VisualizePanel.PlotPanel |
getPlotPanel()
Returns the underlying plot panel.
|
boolean |
getShowAttBars()
Gets whether or not attribute bars are being displayed.
|
boolean |
getShowClassPanel()
Gets whether or not the class panel is being displayed.
|
int |
getSIndex()
Get the index of the shape selected for creating splits.
|
int |
getXIndex()
Get the index of the attribute on the x axis
|
int |
getYIndex()
Get the index of the attribute on the y axis
|
static void |
main(String[] args)
Main method for testing this class
|
protected void |
newColorAttribute(int a,
Instances i)
Sets the Colors in use for a different attrib
if it is not a nominal attrib and or does not have
more possible values then this will do nothing.
|
protected void |
openVisibleInstances()
Loads previously saved instances from a file
|
protected void |
openVisibleInstances(Instances insts)
displays the previously saved instances
|
void |
removeAllPlots()
Removes all the plots.
|
void |
setColourIndex(int index)
Sets the index used for colouring.
|
void |
setInstances(Instances inst)
Tells the panel to use a new set of instances.
|
void |
setLog(Logger newLog)
Sets the Logger to receive informational messages
|
void |
setMasterPlot(PlotData2D newPlot)
Set the master plot for the visualize panel
|
void |
setName(String plotName)
Set a name for this plot
|
void |
setShapes(FastVector l)
This will set the shapes for the instances.
|
void |
setShowAttBars(boolean sab)
Set whether the attribute bars should be shown or not.
|
void |
setShowClassPanel(boolean scp)
Set whether the class panel should be shown or not.
|
void |
setSIndex(int index)
Set the shape for creating splits.
|
void |
setUpComboBoxes(Instances inst)
initializes the comboboxes based on the data
|
void |
setXIndex(int index)
Set the index of the attribute for the x axis
|
void |
setYIndex(int index)
Set the index of the attribute for the y axis
|
getSaveDialogTitle, getWriter, getWriters, getXScale, getYScale, saveComponent, setSaveDialogTitle, setScale
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, setVisible, unregisterKeyboardAction, update
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
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, getParent, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected Color[] m_DefaultColors
protected JComboBox m_XCombo
protected JComboBox m_YCombo
protected JComboBox m_ColourCombo
protected JComboBox m_ShapeCombo
protected JButton m_submit
protected JButton m_cancel
protected JButton m_openBut
protected JButton m_saveBut
protected JFileChooser m_FileChooser
protected FileFilter m_ArffFilter
protected JLabel m_JitterLab
protected JSlider m_Jitter
protected VisualizePanel.PlotPanel m_plot
protected AttributePanel m_attrib
protected LegendPanel m_legendPanel
protected JPanel m_plotSurround
protected JPanel m_classSurround
protected ActionListener listener
protected VisualizePanelListener m_splitListener
protected String m_plotName
protected ClassPanel m_classPanel
protected FastVector m_colorList
protected String m_preferredXDimension
protected String m_preferredYDimension
protected String m_preferredColourDimension
protected boolean m_showAttBars
protected boolean m_showClassPanel
protected Logger m_Log
public VisualizePanel(VisualizePanelListener ls)
ls
- the listener to usepublic VisualizePanel()
public void setLog(Logger newLog)
newLog
- the Logger that will now get info messagespublic void setShowAttBars(boolean sab)
sab
- false if attribute bars are not to be displayed.public boolean getShowAttBars()
public void setShowClassPanel(boolean scp)
scp
- false if class panel is not to be displayedpublic boolean getShowClassPanel()
protected void openVisibleInstances(Instances insts) throws Exception
insts
- the instances to displayException
- if display is not possibleprotected void openVisibleInstances()
public void setColourIndex(int index)
index
- the index of the attribute to use for colouringpublic void setXIndex(int index) throws Exception
index
- the index for the x axisException
- if index is out of range.public int getXIndex()
public void setYIndex(int index) throws Exception
index
- the index for the y axisException
- if index is out of range.public int getYIndex()
public int getCIndex()
public int getSIndex()
public void setSIndex(int index) throws Exception
index
- The index of the shape.Exception
- if index is out of range.public void addActionListener(ActionListener act)
act
- an ActionListenerpublic void setName(String plotName)
public String getName()
public Instances getInstances()
protected void newColorAttribute(int a, Instances i)
a
- The index of the attribute to color.i
- The instances object that contains the attribute.public void setShapes(FastVector l)
l
- A list of the shapes, providing that
the objects in the lists are non editable the data will be
kept intact.public void setInstances(Instances inst)
inst
- a set of Instancespublic void setUpComboBoxes(Instances inst)
inst
- the data to base the combobox-setup onpublic void removeAllPlots()
public void setMasterPlot(PlotData2D newPlot) throws Exception
newPlot
- the new master plotException
- if the master plot could not be setpublic void addPlot(PlotData2D newPlot) throws Exception
newPlot
- the new plot to addException
- if the plot could not be addedpublic VisualizePanel.PlotPanel getPlotPanel()
public static void main(String[] args)
args
- the commandline parametersCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.