All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.gui.CostMatrixEditor

java.lang.Object
    |
    +----weka.gui.CostMatrixEditor

public class CostMatrixEditor
extends java.lang.Object
implements java.beans.PropertyEditor
Class for editing CostMatrix objects. Brings up a custom editing panel with which the user can edit the matrix interactively, as well as save load cost matrices from files.

Version:
$Revision: 1.7 $
Author:
Richard Kirkby (rkirkby@cs.waikato.ac.nz)

Constructor Index

 o CostMatrixEditor()
Constructs a new CostMatrixEditor.

Method Index

 o addPropertyChangeListener(PropertyChangeListener)
Adds an object to the list of those that wish to be informed when the cost matrix changes.
 o getAsText()
Some objects can be represented as text, but a cost matrix cannot.
 o getCustomEditor()
Gets a GUI component with which the user can edit the cost matrix.
 o getJavaInitializationString()
Returns the Java code that generates an object the same as the one being edited.
 o getTags()
Some objects can return tags, but a cost matrix cannot.
 o getValue()
Gets the cost matrix that is being edited.
 o isPaintable()
Indicates whether the object can be represented graphically.
 o paintValue(Graphics, Rectangle)
Paints a graphical representation of the object.
 o removePropertyChangeListener(PropertyChangeListener)
Removes an object from the list of those that wish to be informed when the cost matrix changes.
 o setAsText(String)
Some objects can be represented as text, but a cost matrix cannot.
 o setValue(Object)
Sets the value of the CostMatrix to be edited.
 o supportsCustomEditor()
Indicates whether the cost matrix can be edited in a GUI, which it can.

Constructor Detail

 o CostMatrixEditor
public CostMatrixEditor()
          Constructs a new CostMatrixEditor.

Method Detail

 o setValue
public void setValue(java.lang.Object value)
          Sets the value of the CostMatrix to be edited.
Parameters:
value - a CostMatrix object to be edited
 o getValue
public java.lang.Object getValue()
          Gets the cost matrix that is being edited.
Returns:
the edited CostMatrix object
 o isPaintable
public boolean isPaintable()
          Indicates whether the object can be represented graphically. In this case it can.
Returns:
true
 o paintValue
public void paintValue(java.awt.Graphics gfx,
                       java.awt.Rectangle box)
          Paints a graphical representation of the object. For the cost matrix it prints out the text "X x X matrix", where X is the size of the matrix.
Parameters:
gfx - the graphics context to draw the representation to
box - the bounds within which the representation should fit.
 o getJavaInitializationString
public java.lang.String getJavaInitializationString()
          Returns the Java code that generates an object the same as the one being edited. Unfortunately this can't be done in a single line of code, so the code returned will only build a default cost matrix of the same size.
Returns:
the initialization string
 o getAsText
public java.lang.String getAsText()
          Some objects can be represented as text, but a cost matrix cannot.
Returns:
null
 o setAsText
public void setAsText(java.lang.String text)
          Some objects can be represented as text, but a cost matrix cannot.
Parameters:
text - ignored
Throws:
always - throws an IllegalArgumentException
 o getTags
public java.lang.String[] getTags()
          Some objects can return tags, but a cost matrix cannot.
Returns:
null
 o getCustomEditor
public java.awt.Component getCustomEditor()
          Gets a GUI component with which the user can edit the cost matrix.
Returns:
an editor GUI component
 o supportsCustomEditor
public boolean supportsCustomEditor()
          Indicates whether the cost matrix can be edited in a GUI, which it can.
Returns:
true
 o addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds an object to the list of those that wish to be informed when the cost matrix changes.
Parameters:
listener - a new listener to add to the list
 o removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes an object from the list of those that wish to be informed when the cost matrix changes.
Parameters:
listener - the listener to remove from the list

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home