All Packages Class Hierarchy This Package Previous Next Index WEKA's home
Class weka.gui.AttributeVisualizationPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----javax.swing.JComponent
|
+----javax.swing.JPanel
|
+----weka.gui.AttributeVisualizationPanel
- public class AttributeVisualizationPanel
- extends javax.swing.JPanel
Creates a panel that shows a visualization of an
attribute in a dataset. For nominal attribute it
shows a bar plot, with each bar corresponding to
each nominal value of the attribute with its height
equal to the frequecy that value appears in the
dataset. For numeric attributes, it displays a
histogram. The number of intervals in the
histogram is 10% of the number of instances in
the dataset, otherwise number of intervals is
equal to the width of this panel in pixels minus 6
(if that 10% figure is > width).
- Version:
- $Revision: 1.10 $
- Author:
- Ashraf M. Kibriya (amk14@cs.waikato.ac.nz)
AttributeVisualizationPanel()
-
AttributeVisualizationPanel(boolean)
-
calcGraph()
-
getColorBox()
-
getColoringIndex()
- Get the coloring index for the plot
getToolTipText(MouseEvent)
- Returns "<nominal value> [<nominal value count>]"
if displaying a bar plot and mouse is on some bar.
main(String[])
- Main method to test this class from command line
paintComponent(Graphics)
- Paints this component
setAttribute(int)
- Tells the panel which attribute to visualize.
setColoringIndex(int)
- Set the coloring index for the plot
setInstances(Instances)
- Sets the instances for use
AttributeVisualizationPanel
public AttributeVisualizationPanel()
AttributeVisualizationPanel
public AttributeVisualizationPanel(boolean showColouringOption)
setInstances
public void setInstances(Instances newins)
Sets the instances for use
- Parameters:
newins - a set of Instances
getColorBox
public javax.swing.JComboBox getColorBox()
getColoringIndex
public int getColoringIndex()
Get the coloring index for the plot
- Returns:
- an
int value
setColoringIndex
public void setColoringIndex(int ci)
Set the coloring index for the plot
- Parameters:
ci - an int value
setAttribute
public void setAttribute(int index)
Tells the panel which attribute to visualize.
- Parameters:
index - The index of the attribute
calcGraph
public void calcGraph()
getToolTipText
public java.lang.String getToolTipText(java.awt.event.MouseEvent ev)
Returns "<nominal value> [<nominal value count>]"
if displaying a bar plot and mouse is on some bar.
If displaying histogram then it
returns "count <br> [<bars Range>]" if mouse is
on the first bar.
returns "count <br> (<bar's Range>]" if mouse is
on some bar other than the first one.
Otherwise it returns ""
- Parameters:
ev - The mouse event
- Overrides:
- getToolTipText in class javax.swing.JComponent
paintComponent
public void paintComponent(java.awt.Graphics g)
Paints this component
- Parameters:
g - The graphics object for this component
main
public static void main(java.lang.String args[])
Main method to test this class from command line
- Parameters:
args - The arff file and the index of the attribute to use
All Packages Class Hierarchy This Package Previous Next Index WEKA's home