|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
com.michaelbaranov.microba.common.AbstractBoundedTableModel
com.michaelbaranov.microba.common.AbstractBoundedTableModelWithSelection
com.michaelbaranov.microba.marker.DefaultMarkerModel
public class DefaultMarkerModel
A basic implementation of BoundedRangeModel
,
ListSelectionModel
and MutationModel
all in
one. Used by default by JMarkerBar
as data model, selection
model and mutation model.
MarkerBar
,
Serialized FormField Summary |
---|
Fields inherited from interface javax.swing.ListSelectionModel |
---|
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION |
Fields inherited from interface com.michaelbaranov.microba.common.BoundedTableModel |
---|
PROPERTY_LOWER_BOUND, PROPERTY_UPPER_BOUND |
Constructor Summary | |
---|---|
DefaultMarkerModel()
Constructs a DefaultMarkerModel . |
Method Summary | |
---|---|
int |
addMarkAtPosition(int position)
Adds a marker with specified position. |
java.lang.Class |
getColumnClass(int columnIndex)
This implementation returns Integer.class for
columnIndex=0. |
int |
getColumnCount()
Returns the numbar of columns in the TableModel .This
implementation always returns 1. |
java.lang.String |
getColumnName(int columnIndex)
This implementation returns "Position" for columnIndex=0. |
int |
getLowerBound()
Returns some lower bound, further describing the data. |
int |
getRowCount()
Returns the count of markers. |
int |
getUpperBound()
Returns some upper bound, further describing the data. |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the position of a marker, specified by index. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
This implementation always returns true , indicating that
all markers are movable. |
void |
removeMarkerAtIndex(int index)
Removes a marker, specified by index. |
void |
setLowerBound(int lowerBound)
Sets current lower bound. |
void |
setUpperBound(int upperBound)
Sets current upper bound. |
void |
setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
Assigns a new position to a marker, specified by index (moves the marker). |
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, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, removeTableModelListener |
Constructor Detail |
---|
public DefaultMarkerModel()
DefaultMarkerModel
.
Method Detail |
---|
public int getRowCount()
TableModel
.
getRowCount
in interface javax.swing.table.TableModel
public int getColumnCount()
TableModel
.This
implementation always returns 1.
getColumnCount
in interface javax.swing.table.TableModel
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface javax.swing.table.TableModel
rowIndex
- marker index.columnIndex
- should be 0.
setValueAt(Object, int, int)
public void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
This implementation does not check if the specified marker position lies beyond current upper and lower bounds.
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
aValue
- an Integer new position.rowIndex
- marker index.columnIndex
- should be 0.getValueAt(int, int)
public java.lang.Class getColumnClass(int columnIndex)
Integer.class
for
columnIndex=0.
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
columnIndex
- should be 0.
public java.lang.String getColumnName(int columnIndex)
"Position"
for columnIndex=0.
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
columnIndex
- should be 0.
public boolean isCellEditable(int rowIndex, int columnIndex)
true
, indicating that
all markers are movable. Override to change behaviour.
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
true
.public void removeMarkerAtIndex(int index)
TableModel
.
removeMarkerAtIndex
in interface MarkerMutationModel
index
- marker index.addMarkAtPosition(int)
public int addMarkAtPosition(int position)
TableModel
with specified position value. Returns the
index of the added mark.
This implementation does not check if the specified marker position lies beyond current upper and lower bounds.
addMarkAtPosition
in interface MarkerMutationModel
position
- position at which to insert the mark.
removeMarkerAtIndex(int)
public int getLowerBound()
BoundedTableModel
getLowerBound
in interface BoundedTableModel
setLowerBound(int)
public int getUpperBound()
BoundedTableModel
getUpperBound
in interface BoundedTableModel
setUpperBound(int)
public void setLowerBound(int lowerBound)
lowerBound
- new lower bound value.setLowerBound(int)
public void setUpperBound(int upperBound)
upperBound
- new upper bound value.getUpperBound()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |