edu.udo.cs.yale.gui.properties
Class AttributeWeightsTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by edu.udo.cs.yale.gui.properties.AttributeWeightsTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class AttributeWeightsTableModel
extends javax.swing.table.AbstractTableModel

This table model is used by an AttributeWeightsDialog. It is used to show attribute weights created by the experiment, by the user, or were loaded from a file. Several view modes and sorting are supported.

Version:
$Id: AttributeWeightsTableModel.java,v 2.7 2006/04/05 08:57:23 ingomierswa Exp $
Author:
Ingo Mierswa
See Also:
Serialized Form

Nested Class Summary
private  class AttributeWeightsTableModel.NameComparator
           
private  class AttributeWeightsTableModel.State
           
 
Field Summary
private  java.lang.String[] attributeNames
           
private  PropertyValueCellEditor[] editors
           
private  double minWeight
           
private  boolean overwrite
           
private  int selectionCount
           
private static long serialVersionUID
           
private  java.util.Map<java.lang.String,AttributeWeightsTableModel.State> updateMap
           
static int VIEW_ALL
           
static int VIEW_EXPERIMENT
           
static int VIEW_FILE
           
static java.lang.String[] VIEW_MODES
           
static int VIEW_SELECTED
           
static int VIEW_UPDATED
           
private  int viewMode
           
private  AttributeWeights weights
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
AttributeWeightsTableModel(AttributeWeights weights)
           
 
Method Summary
 void addMouseListenerToHeaderInTable(javax.swing.JTable table)
           
 AttributeWeights getAttributeWeights()
           
 int getColumnCount()
           
 java.lang.String getColumnName(int column)
           
 double getMinWeight()
           
 int getNumberOfSelected()
           
 int getRowCount()
           
 int getTotalNumber()
           
 java.lang.Object getValueAt(int row, int column)
           
 PropertyValueCellEditor getWeightEditor(int row)
           
 boolean isCellEditable(int row, int column)
           
 void mergeWeights(AttributeWeights fileWeights)
           
 void setMinWeight(double minWeight)
           
 void setOverwriteMode(boolean overwrite)
          Indicates if values which are merge with the current weights should overwrite them.
 void setValueAt(java.lang.Object value, int row, int column)
           
 void setViewMode(int mode)
           
 void sortByColumn(int column, int direction)
           
 void updateTable()
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

VIEW_ALL

public static final int VIEW_ALL
See Also:
Constant Field Values

VIEW_FILE

public static final int VIEW_FILE
See Also:
Constant Field Values

VIEW_EXPERIMENT

public static final int VIEW_EXPERIMENT
See Also:
Constant Field Values

VIEW_UPDATED

public static final int VIEW_UPDATED
See Also:
Constant Field Values

VIEW_SELECTED

public static final int VIEW_SELECTED
See Also:
Constant Field Values

VIEW_MODES

public static final java.lang.String[] VIEW_MODES

weights

private AttributeWeights weights

attributeNames

private java.lang.String[] attributeNames

editors

private PropertyValueCellEditor[] editors

updateMap

private java.util.Map<java.lang.String,AttributeWeightsTableModel.State> updateMap

viewMode

private int viewMode

overwrite

private boolean overwrite

minWeight

private double minWeight

selectionCount

private int selectionCount
Constructor Detail

AttributeWeightsTableModel

public AttributeWeightsTableModel(AttributeWeights weights)
Method Detail

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int column)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

getRowCount

public int getRowCount()

getColumnCount

public int getColumnCount()

getColumnName

public java.lang.String getColumnName(int column)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getAttributeWeights

public AttributeWeights getAttributeWeights()

getWeightEditor

public PropertyValueCellEditor getWeightEditor(int row)

setViewMode

public void setViewMode(int mode)

setOverwriteMode

public void setOverwriteMode(boolean overwrite)
Indicates if values which are merge with the current weights should overwrite them. Please note that a value of zero always overwrites the current weight!


setMinWeight

public void setMinWeight(double minWeight)

getMinWeight

public double getMinWeight()

mergeWeights

public void mergeWeights(AttributeWeights fileWeights)

sortByColumn

public void sortByColumn(int column,
                         int direction)

getNumberOfSelected

public int getNumberOfSelected()

getTotalNumber

public int getTotalNumber()

updateTable

public void updateTable()

addMouseListenerToHeaderInTable

public void addMouseListenerToHeaderInTable(javax.swing.JTable table)


Copyright © 2001-2006