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)

Constructor Index

 o AttributeVisualizationPanel()
 
 o AttributeVisualizationPanel(boolean)
 

Method Index

 o calcGraph()
 
 o getColorBox()
 
 o getColoringIndex()
Get the coloring index for the plot
 o getToolTipText(MouseEvent)
Returns "<nominal value> [<nominal value count>]" if displaying a bar plot and mouse is on some bar.
 o main(String[])
Main method to test this class from command line
 o paintComponent(Graphics)
Paints this component
 o setAttribute(int)
Tells the panel which attribute to visualize.
 o setColoringIndex(int)
Set the coloring index for the plot
 o setInstances(Instances)
Sets the instances for use

Constructor Detail

 o AttributeVisualizationPanel
public AttributeVisualizationPanel()
 o AttributeVisualizationPanel
public AttributeVisualizationPanel(boolean showColouringOption)

Method Detail

 o setInstances
public void setInstances(Instances newins)
          Sets the instances for use
Parameters:
newins - a set of Instances
 o getColorBox
public javax.swing.JComboBox getColorBox()
 o getColoringIndex
public int getColoringIndex()
          Get the coloring index for the plot
Returns:
an int value
 o setColoringIndex
public void setColoringIndex(int ci)
          Set the coloring index for the plot
Parameters:
ci - an int value
 o setAttribute
public void setAttribute(int index)
          Tells the panel which attribute to visualize.
Parameters:
index - The index of the attribute
 o calcGraph
public void calcGraph()
 o 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
     o paintComponent
    public void paintComponent(java.awt.Graphics g)
              Paints this component
    Parameters:
    g - The graphics object for this component
     o 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