Class DefaultGradientModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- com.michaelbaranov.microba.common.AbstractBoundedTableModel
-
- com.michaelbaranov.microba.gradient.DefaultGradientModel
-
- All Implemented Interfaces:
BoundedTableModel,java.io.Serializable,javax.swing.table.TableModel
public class DefaultGradientModel extends AbstractBoundedTableModel
A very basic implementation ofAbstractBoundedTableModelused by default byGradientBar. This implementation has bounds 0 - 100 and is mutable.- Author:
- Michael Baranov
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.michaelbaranov.microba.common.BoundedTableModel
PROPERTY_LOWER_BOUND, PROPERTY_UPPER_BOUND
-
-
Constructor Summary
Constructors Constructor Description DefaultGradientModel()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.awt.Color color, int position)Adds a color point.voidclear()Removes all color points.java.lang.ClassgetColumnClass(int columnIndex)intgetColumnCount()intgetLowerBound()Returns some lower bound, further describing the data.intgetRowCount()intgetUpperBound()Returns some upper bound, further describing the data.java.lang.ObjectgetValueAt(int rowIndex, int columnIndex)voidremove(int index)Removes a color point at specified index.-
Methods inherited from class com.michaelbaranov.microba.common.AbstractBoundedTableModel
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Method Detail
-
getLowerBound
public int getLowerBound()
Description copied from interface:BoundedTableModelReturns some lower bound, further describing the data.- Returns:
- lower bound.
-
getUpperBound
public int getUpperBound()
Description copied from interface:BoundedTableModelReturns some upper bound, further describing the data.- Returns:
- upper bound.
-
getRowCount
public int getRowCount()
-
getColumnCount
public int getColumnCount()
-
getColumnClass
public java.lang.Class getColumnClass(int columnIndex)
- Specified by:
getColumnClassin interfacejavax.swing.table.TableModel- Overrides:
getColumnClassin classjavax.swing.table.AbstractTableModel
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
-
add
public void add(java.awt.Color color, int position)Adds a color point.- Parameters:
color-position-
-
remove
public void remove(int index)
Removes a color point at specified index.- Parameters:
index-
-
clear
public void clear()
Removes all color points.
-
-