public class VisualizePanel extends PrintablePanel
| Modifier and Type | Class and Description |
|---|---|
protected class |
VisualizePanel.PlotPanel
Inner class to handle plotting
|
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected java.awt.event.ActionListener |
listener
An optional listener that we will inform when ComboBox selections change
|
protected javax.swing.filechooser.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 javax.swing.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 javax.swing.JPanel |
m_classSurround
Panel that surrounds the class panel with a titled border
|
protected java.util.ArrayList<java.awt.Color> |
m_colorList
The list of the colors used
|
protected javax.swing.JComboBox |
m_ColourCombo
Lets the user select the attribute to use for colouring
|
protected java.awt.Color[] |
m_DefaultColors
default colours for colouring discrete class
|
protected javax.swing.JFileChooser |
m_FileChooser
file chooser for saving instances
|
protected javax.swing.JSlider |
m_Jitter
The jitter slider
|
protected javax.swing.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 javax.swing.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 java.lang.String |
m_plotName
The name of the plot (not currently displayed, but can be used in the
containing Frame or Panel)
|
protected javax.swing.JPanel |
m_plotSurround
Panel that surrounds the plot panel with a titled border
|
protected java.lang.String |
m_preferredColourDimension |
protected java.lang.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 java.lang.String |
m_preferredYDimension |
protected javax.swing.JButton |
m_saveBut
Button for the user to save the visualized set of instances
|
protected javax.swing.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 javax.swing.JButton |
m_submit
Button for the user to enter the splits.
|
protected javax.swing.JComboBox |
m_XCombo
Lets the user select the attribute for the x axis
|
protected javax.swing.JComboBox |
m_YCombo
Lets the user select the attribute for the y axis
|
m_PrinterlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
VisualizePanel()
Constructor
|
VisualizePanel(VisualizePanelListener ls)
This constructor allows a VisualizePanelListener to be set.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(java.awt.event.ActionListener act)
Add a listener for this visualize panel
|
void |
addPlot(PlotData2D newPlot)
Set a new plot to the visualize panel
|
void |
applySettings(Settings settings,
java.lang.String ownerID)
Apply settings
|
int |
getCIndex()
Get the index of the attribute selected for coloring
|
Instances |
getInstances()
Get the master plot's instances
|
java.lang.String |
getName()
Returns the name associated with this plot. "" is returned if no name is
set.
|
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(java.lang.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 |
setColourIndex(int index,
boolean enableCombo)
Set the index 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(java.lang.String plotName)
Set a name for this plot
|
void |
setShapes(java.util.ArrayList<java.util.ArrayList<java.lang.Double>> 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, setScalegetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, updateadd, 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, validateTreeaction, 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, transferFocusUpCycleprotected java.awt.Color[] m_DefaultColors
protected javax.swing.JComboBox m_XCombo
protected javax.swing.JComboBox m_YCombo
protected javax.swing.JComboBox m_ColourCombo
protected javax.swing.JComboBox m_ShapeCombo
protected javax.swing.JButton m_submit
protected javax.swing.JButton m_cancel
protected javax.swing.JButton m_openBut
protected javax.swing.JButton m_saveBut
protected javax.swing.JFileChooser m_FileChooser
protected javax.swing.filechooser.FileFilter m_ArffFilter
protected javax.swing.JLabel m_JitterLab
protected javax.swing.JSlider m_Jitter
protected VisualizePanel.PlotPanel m_plot
protected AttributePanel m_attrib
protected LegendPanel m_legendPanel
protected javax.swing.JPanel m_plotSurround
protected javax.swing.JPanel m_classSurround
protected java.awt.event.ActionListener listener
protected VisualizePanelListener m_splitListener
protected java.lang.String m_plotName
protected ClassPanel m_classPanel
protected java.util.ArrayList<java.awt.Color> m_colorList
protected java.lang.String m_preferredXDimension
protected java.lang.String m_preferredYDimension
protected java.lang.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()
public void applySettings(Settings settings, java.lang.String ownerID)
settings - the settings to applyownerID - the ID of the owner perspective, panel etc. to use when
looking up settingsprotected void openVisibleInstances(Instances insts) throws java.lang.Exception
insts - the instances to displayjava.lang.Exception - if display is not possibleprotected void openVisibleInstances()
public void setColourIndex(int index,
boolean enableCombo)
index - the index of the attribute to use for colouringenableCombo - false if the colouring combo box should be disabledpublic void setColourIndex(int index)
index - the index of the attribute to use for colouringpublic void setXIndex(int index)
throws java.lang.Exception
index - the index for the x axisjava.lang.Exception - if index is out of range.public int getXIndex()
public void setYIndex(int index)
throws java.lang.Exception
index - the index for the y axisjava.lang.Exception - if index is out of range.public int getYIndex()
public int getCIndex()
public int getSIndex()
public void setSIndex(int index)
throws java.lang.Exception
index - The index of the shape.java.lang.Exception - if index is out of range.public void addActionListener(java.awt.event.ActionListener act)
act - an ActionListenerpublic void setName(java.lang.String plotName)
setName in class java.awt.ComponentplotName - the name for the plotpublic java.lang.String getName()
getName in class java.awt.Componentpublic 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(java.util.ArrayList<java.util.ArrayList<java.lang.Double>> 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 java.lang.Exception
newPlot - the new master plotjava.lang.Exception - if the master plot could not be setpublic void addPlot(PlotData2D newPlot) throws java.lang.Exception
newPlot - the new plot to addjava.lang.Exception - if the plot could not be addedpublic VisualizePanel.PlotPanel getPlotPanel()
public static void main(java.lang.String[] args)
args - the commandline parameters