public class DefaultTextListModel extends java.lang.Object implements TextListModel, java.io.Serializable
DefaultTextListModel class is a default implementation
of the TextListModel interface.| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected int |
columns
The number of columns.
|
protected boolean |
isTable
True if the model is used in table.
|
protected java.util.Vector |
listModelListeners
The list model listeners of the text list model.
|
protected int[] |
selected
The selected indexes of the text list model.
|
protected TextList |
textList
The text list of the text list model.
|
| コンストラクタと説明 |
|---|
DefaultTextListModel()
Constructs a one column text list model with the default rich text
style.
|
DefaultTextListModel(int[] colWidths)
Constructs a text list model with the specified column widths.
|
DefaultTextListModel(int columns,
int[] colWidths)
Constructs a text list model with the specified number of columns
and column widths.
|
DefaultTextListModel(int columns,
int[] colWidths,
RichTextStyle richTextStyle)
Constructs a text list model with the specified number of columns,
column widths, and rich text style.
|
DefaultTextListModel(RichTextStyle richTextStyle)
Constructs a one column text list model with the specified rich text
style.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addListModelListener(ListModelListener listener)
Adds the specified list model listener to receive list model events
from this text list model.
|
int[] |
addSelection(int start,
int end)
Changes the selection to be the set union of the current selection
and indices in the specified range.
|
protected VArray |
createSelectedVArray() |
int |
getColumnCount()
Returns the number of columns in the list.
|
int[] |
getColumnWidths()
Returns the column widths of the list.
|
java.lang.Object |
getItem(int index,
int column)
Returns the item associated with the specified index (row) and column.
|
int |
getItemCount()
Returns the number of items in the list.
|
java.lang.Object[] |
getItems(int column)
Returns the items in the specified column index.
|
java.lang.Object[] |
getRowItems(int index)
Returns the items associated with the specified row index.
|
protected Text |
getRowText(int index)
Returns the text associated with the specified row index.
|
int |
getSelectedCount()
Returns the number of selected rows.
|
int[] |
getSelectedIndexes()
Returns the indices of the selected rows.
|
TextList |
getTextList()
Returns the text list of this text list model.
|
boolean |
isIndexSelected(int index)
Checks if the row at the specified index is selected.
|
protected void |
notifyListModelListeners(ListModelEvent event)
Notifies the specified list model event to the list model listeners.
|
void |
removeListModelListener(ListModelListener listener)
Removes the specified list model listener so it no longer receives
list model events from this text list model.
|
int[] |
removeSelection(int start,
int end)
Changes the selection to be the set difference of the current
selection and indices in the specified range.
|
void |
replaceItems(int begin,
int end,
java.lang.Object[][] items)
Replaces the items in the specified range with the specified items.
|
protected void |
replaceItems(int begin,
int end,
Text[] items)
Replaces the items in the specified range with the specified row items.
|
void |
setColumnWidths(int[] colWidths)
Sets the column widths of the list to the specified widths.
|
void |
setItem(int index,
int column,
java.lang.Object value)
Sets the item associated with the specified index (row) and column
to the specified value.
|
int[][] |
setSelection(int start,
int end)
Changes the selection to be the specified range.
|
void |
setTextStyle(TextStyle textStyle)
Sets the text style of this text list model.
|
protected TextList textList
protected int columns
protected boolean isTable
protected int[] selected
protected transient java.util.Vector listModelListeners
public DefaultTextListModel()
public DefaultTextListModel(RichTextStyle richTextStyle)
richTextStyle - the rich text style.public DefaultTextListModel(int[] colWidths)
colWidths - the column widths.public DefaultTextListModel(int columns,
int[] colWidths)
columns - the number of columns.colWidths - the column widths.public DefaultTextListModel(int columns,
int[] colWidths,
RichTextStyle richTextStyle)
columns - the number of columns.colWidths - the column widths.richTextStyle - the rich text style.public TextList getTextList()
getTextList インタフェース内 TextListModelpublic void setTextStyle(TextStyle textStyle)
setTextStyle インタフェース内 TextListModeltextStyle - the text style.public void addListModelListener(ListModelListener listener)
addListModelListener インタフェース内 ListModellistener - the list model listener.public void removeListModelListener(ListModelListener listener)
removeListModelListener インタフェース内 ListModellistener - the list model listener.protected void notifyListModelListeners(ListModelEvent event)
public int getColumnCount()
getColumnCount インタフェース内 ListModelpublic int[] getColumnWidths()
getColumnWidths インタフェース内 ListModelpublic void setColumnWidths(int[] colWidths)
setColumnWidths インタフェース内 ListModelcolWidths - the column widths.public int getItemCount()
getItemCount インタフェース内 ListModelpublic java.lang.Object getItem(int index,
int column)
public void setItem(int index,
int column,
java.lang.Object value)
public java.lang.Object[] getRowItems(int index)
getRowItems インタフェース内 ListModelindex - the row position of the items.public java.lang.Object[] getItems(int column)
public void replaceItems(int begin,
int end,
java.lang.Object[][] items)
replaceItems インタフェース内 ListModelbegin - the beginning index to replace, inclusive.end - the ending index to replace, exclusive.items - the replacement row by column items.public int getSelectedCount()
getSelectedCount インタフェース内 ListModelpublic boolean isIndexSelected(int index)
isIndexSelected インタフェース内 ListModelindex - the row position to be checked.true if the specified row has been selected;
false otherwise.public int[] getSelectedIndexes()
getSelectedIndexes インタフェース内 ListModelpublic int[][] setSelection(int start,
int end)
setSelection インタフェース内 ListModelstart - the starting index to select, inclusive.end - the ending index to select, inclusive.null if the
selection has not been changed.public int[] addSelection(int start,
int end)
addSelection インタフェース内 ListModelstart - the starting index to select, inclusive.end - the ending index to select, inclusive.null if the selection has not been changed.public int[] removeSelection(int start,
int end)
removeSelection インタフェース内 ListModelstart - the starting index to select, inclusive.end - the ending index to select, inclusive.null if the selection has not been changed.protected Text getRowText(int index)
protected void replaceItems(int begin,
int end,
Text[] items)
begin - the beginning index to replace, inclusive.end - the ending index to replace, exclusive.items - the replacement row items.protected VArray createSelectedVArray()