public class ClassColorTableModel
extends javax.swing.table.AbstractTableModel
Modifier and Type | Field and Description |
---|---|
private java.awt.Color[] |
classColors |
private java.lang.String[] |
classNames |
private boolean[] |
classSelected |
static int |
COLOR_COLUMN_INDEX |
private static java.lang.String[] |
columnTitles |
static int |
NAME_COLUMN_INDEX |
static int |
SELECT_COLUMN_INDEX |
private boolean |
selectionAllowed |
private static long |
serialVersionUID |
Constructor and Description |
---|
ClassColorTableModel() |
ClassColorTableModel(java.lang.String[] names,
java.awt.Color[] colors) |
Modifier and Type | Method and Description |
---|---|
static java.awt.image.BufferedImage |
asBufferedImage(ClassColorTableModel theModel) |
static java.awt.image.BufferedImage |
asBufferedImage(ClassColorTableModel theModel,
boolean showAllRows) |
static javax.swing.JTable |
createColorLegendTable(ClassColorTableModel theModel)
Creates a ColorLegendTable to be used with the required default listeners added.
|
private static void |
fixColumnWidth(javax.swing.JTable table,
int columnIndex,
boolean setMin,
boolean setMax) |
java.lang.String |
getClassName(int row) |
java.lang.String[] |
getClassNames() |
java.awt.Color |
getColor(int row) |
java.awt.Color[] |
getColors() |
java.lang.Class<?> |
getColumnClass(int columnIndex) |
int |
getColumnCount() |
java.lang.String |
getColumnName(int columnIndex) |
java.lang.String |
getLongestName() |
int |
getRowCount() |
java.lang.String[] |
getSelectedClasses() |
int[] |
getSelectedClassIndices() |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex) |
boolean |
isAllSelected() |
boolean |
isCellEditable(int rowIndex,
int columnIndex) |
boolean |
isSelectionAllowed() |
static void |
main(java.lang.String[] args) |
void |
setAllSelected(boolean selected) |
void |
setColumnName(int columnIndex,
java.lang.String name) |
void |
setSelected(int[] selectedClassIndices) |
void |
setSelected(int rowIndex,
boolean selected) |
void |
setSelectionAllowed(boolean selectionAllowed) |
void |
setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex) |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
private static final long serialVersionUID
public static final int NAME_COLUMN_INDEX
public static final int COLOR_COLUMN_INDEX
public static final int SELECT_COLUMN_INDEX
private static java.lang.String[] columnTitles
private final java.awt.Color[] classColors
private final java.lang.String[] classNames
private final boolean[] classSelected
private boolean selectionAllowed
public ClassColorTableModel()
public ClassColorTableModel(java.lang.String[] names, java.awt.Color[] colors)
public void setAllSelected(boolean selected)
public void setSelected(int rowIndex, boolean selected)
public int getRowCount()
public int getColumnCount()
public java.lang.String getColumnName(int columnIndex)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public void setColumnName(int columnIndex, java.lang.String name)
public java.lang.Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
public static void main(java.lang.String[] args)
public static javax.swing.JTable createColorLegendTable(ClassColorTableModel theModel)
theModel
- the ClassColorTableModel
private static void fixColumnWidth(javax.swing.JTable table, int columnIndex, boolean setMin, boolean setMax)
public boolean isAllSelected()
public java.lang.String[] getSelectedClasses()
public int[] getSelectedClassIndices()
public java.awt.Color[] getColors()
public java.awt.Color getColor(int row)
public java.lang.String[] getClassNames()
public java.lang.String getClassName(int row)
public java.lang.String getLongestName()
public boolean isSelectionAllowed()
public void setSelectionAllowed(boolean selectionAllowed)
public static java.awt.image.BufferedImage asBufferedImage(ClassColorTableModel theModel)
public static java.awt.image.BufferedImage asBufferedImage(ClassColorTableModel theModel, boolean showAllRows)
theModel
- The model to paintshowAllRows
- paint all rows or just selectedpublic void setSelected(int[] selectedClassIndices)