Class DefaultGradientEditorModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- com.michaelbaranov.microba.common.AbstractBoundedTableModel
-
- com.michaelbaranov.microba.common.AbstractBoundedTableModelWithSelection
-
- com.michaelbaranov.microba.gradienteditor.DefaultGradientEditorModel
-
- All Implemented Interfaces:
BoundedTableModel
,MarkerMutationModel
,java.io.Serializable
,javax.swing.ListSelectionModel
,javax.swing.table.TableModel
public class DefaultGradientEditorModel extends AbstractBoundedTableModelWithSelection implements MarkerMutationModel
A basic implementation ofAbstractBoundedTableModelWithSelection
andMarkerMutationModel
. Used by default byGradientEditor
as a color model, color selection model and color mutation model.This implementation is mutable.
- Author:
- Michael Baranov
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
COLOR_COLUMN
static int
POSITION_COLUMN
-
Fields inherited from interface com.michaelbaranov.microba.common.BoundedTableModel
PROPERTY_LOWER_BOUND, PROPERTY_UPPER_BOUND
-
-
Constructor Summary
Constructors Constructor Description DefaultGradientEditorModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addMarkAtPosition(int pos)
Called when the user requests a mark to be inserted intoJMarkerBar
.java.lang.Class
getColumnClass(int columnIndex)
int
getColumnCount()
int
getLowerBound()
Returns some lower bound, further describing the data.int
getRowCount()
int
getUpperBound()
Returns some upper bound, further describing the data.java.lang.Object
getValueAt(int rowIndex, int columnIndex)
boolean
isCellEditable(int rowIndex, int columnIndex)
void
removeMarkerAtIndex(int index)
Called when the user requests a mark to be removed fromJMarkerBar
.void
setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
-
Methods inherited from class com.michaelbaranov.microba.common.AbstractBoundedTableModelWithSelection
addListSelectionListener, addSelectionInterval, clearSelection, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, isSelectedIndex, isSelectionEmpty, removeIndexInterval, removeListSelectionListener, removeSelectionInterval, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setLeadSelectionIndex, setSelectionInterval, setSelectionMode, setValueIsAdjusting
-
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, getTableModelListeners, removeTableModelListener
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
POSITION_COLUMN
public static final int POSITION_COLUMN
- See Also:
- Constant Field Values
-
COLOR_COLUMN
public static final int COLOR_COLUMN
- See Also:
- Constant Field Values
-
-
Method Detail
-
removeMarkerAtIndex
public void removeMarkerAtIndex(int index)
Description copied from interface:MarkerMutationModel
Called when the user requests a mark to be removed fromJMarkerBar
.- Specified by:
removeMarkerAtIndex
in interfaceMarkerMutationModel
- Parameters:
index
- index of the mark to be removed.
-
addMarkAtPosition
public int addMarkAtPosition(int pos)
Description copied from interface:MarkerMutationModel
Called when the user requests a mark to be inserted intoJMarkerBar
.- Specified by:
addMarkAtPosition
in interfaceMarkerMutationModel
- Parameters:
pos
- position at which to insert the mark.- Returns:
- index of newly added mark.
-
getLowerBound
public int getLowerBound()
Description copied from interface:BoundedTableModel
Returns some lower bound, further describing the data.- Specified by:
getLowerBound
in interfaceBoundedTableModel
- Returns:
- lower bound.
-
getUpperBound
public int getUpperBound()
Description copied from interface:BoundedTableModel
Returns some upper bound, further describing the data.- Specified by:
getUpperBound
in interfaceBoundedTableModel
- Returns:
- upper bound.
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
-
getColumnClass
public java.lang.Class getColumnClass(int columnIndex)
- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classjavax.swing.table.AbstractTableModel
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
- Specified by:
getValueAt
in interfacejavax.swing.table.TableModel
-
setValueAt
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
- Specified by:
setValueAt
in interfacejavax.swing.table.TableModel
- Overrides:
setValueAt
in classjavax.swing.table.AbstractTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex)
- Specified by:
isCellEditable
in interfacejavax.swing.table.TableModel
- Overrides:
isCellEditable
in classjavax.swing.table.AbstractTableModel
-
-