Class AttributePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ScrollPaneConstants

public class AttributePanel extends JScrollPane
This panel displays one dimensional views of the attributes in a dataset. Colouring is done on the basis of a column in the dataset or an auxiliary array (useful for colouring cluster predictions).
Version:
$Revision: 15168 $
Author:
Malcolm Ware (mfw4@cs.waikato.ac.nz), Mark Hall (mhall@cs.waikato.ac.nz)
See Also:
  • Constructor Details

    • AttributePanel

      public AttributePanel()
    • AttributePanel

      public AttributePanel(Color background)
      This constructs an attributePanel.
  • Method Details

    • applySettings

      public void applySettings(Settings settings, String ownerID)
      Apply settings
      Parameters:
      settings - the settings to apply
      ownerID - the ID of owner perspective, panel. Used when looking up our settings
    • addAttributePanelListener

      public void addAttributePanelListener(AttributePanelListener a)
      Add a listener to the list of things listening to this panel
      Parameters:
      a - the listener to notify when attribute bars are clicked on
    • setCindex

      public void setCindex(int c, double h, double l)
      Set the index of the attribute by which to colour the data. Updates the number of entries in the colour list if there are more values for this new attribute than previous ones.
      Parameters:
      c - the index of the attribute to colour on
      h - maximum value of this attribute
      l - minimum value of this attribute
    • setCindex

      public void setCindex(int c)
      Set the index of the attribute by which to colour the data. Updates the number of entries in the colour list if there are more values for this new attribute than previous ones.
      Parameters:
      c - the index of the attribute to colour on
    • setColours

      public void setColours(ArrayList<Color> cols)
      Sets a list of colours to use for colouring data points
      Parameters:
      cols - a list of java.awt.Color
    • setInstances

      public void setInstances(Instances ins) throws Exception
      This sets the instances to be drawn into the attribute panel
      Parameters:
      ins - The instances.
      Throws:
      Exception
    • setX

      public void setX(int x)
      shows which bar is the current x attribute.
      Parameters:
      x - The attributes index.
    • setY

      public void setY(int y)
      shows which bar is the current y attribute.
      Parameters:
      y - The attributes index.
    • main

      public static void main(String[] args)
      Main method for testing this class.
      Parameters:
      args - first argument should be an arff file. Second argument can be an optional class col