public class TableList extends EventProxyContainer implements java.awt.ItemSelectable, java.awt.event.ActionListener, java.awt.event.ItemListener
TableList component presents the user with a scrolling
table list that has multiple columns. The table list can be set up so that
the user can choose either one row or multiple rows.
A TableList is an MVC-based component. The model of the TableList is
a TextListModel object, the view of the TableList is a
TextListView (TableListView) object, and the controller
of the TableList is a TextListController object.
A TableList emits a ListActionEvent and a
ListItemEvent.
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected java.awt.event.ActionListener |
actionListener |
protected static java.lang.String |
actionListenerK
Internal constant for serialization
|
static int |
AUTO_RESIZE_ALL_COLUMNS
Proportionately resize all columns when table is resized
|
static int |
AUTO_RESIZE_LAST_COLUMN
Auto resize last column only when table is resized
|
static int |
AUTO_RESIZE_OFF
Do not auto resize column when table is resized.
|
static int |
DEFAULT_BUTTON_ALIGN
The default column button alignment.
|
static RichTextStyle |
DEFAULT_TABLE_STYLE
The default table list style.
|
protected static int |
DEFAULT_VISIBLE_ROWS
The default number of visible rows is 4.
|
protected java.awt.event.ItemListener |
itemListener |
protected static java.lang.String |
itemListenerK
Internal constant for serialization
|
protected TextListController |
listController |
protected TextListModel |
listModel |
protected TextListView |
listView |
static int |
MULTIPLE_SELECTIONS
Allows AWT style multiple selections.
|
protected int |
rows |
protected ScrollPanel |
scrollPanel |
static int |
SHIFT_MULTIPLE_SELECTIONS
Allows Windows style multiple selections.
|
static int |
SINGLE_SELECTION
Allows single selection.
|
protected TableListView |
tableView |
focusTraversable| コンストラクタと説明 |
|---|
TableList(int rows,
java.lang.String[] columnTitles)
Constructs an empty table list with the specified number of visual
lines and column titles.
|
TableList(int rows,
java.lang.String[] columnTitles,
int[] columnWidths)
Constructs an empty table list with the specified number of visual
lines, column titles, and widths of the columns.
|
TableList(int rows,
java.lang.String[] columnTitles,
int[] columnAligns,
int[] columnWidths,
RichTextStyle richTextStyle)
Constructs an empty table list with the specified column titles,
alignments of the column titles, widths of the columns, and the
rich text style of the table list.
|
TableList(int rows,
java.lang.String[] columnTitles,
int[] columnWidths,
RichTextStyle richTextStyle)
Constructs an empty table list with the specified column titles,
widths of the columns, and the rich text style of the table list.
|
TableList(java.lang.String[] columnTitles)
Constructs an empty table list with the specified column titles.
|
TableList(TextListModel model,
int rows,
Button[] buttons)
Constructs a table list with the specified model, number of visual
lines, and column buttons.
|
TableList(TextListModel model,
int rows,
java.lang.String[] columnTitles)
Constructs a table list with the specified model, number of visual
lines, and column titles.
|
TableList(TextListModel model,
int rows,
java.lang.String[] columnTitles,
int[] columnAligns)
Constructs a table list with the specified model, number of visual
lines, column titles, and alignments of the column titles.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.
|
void |
addActionListener(java.awt.event.ActionListener l)
Adds the specified action listener to receive action events from
this list.
|
void |
addItem(java.lang.String[] item)
Adds the specified string row item to the end of the table list.
|
void |
addItem(java.lang.String[] item,
int index)
Adds the specified string row item to the specified row index.
|
void |
addItem(Text[] item)
Adds the specified text row item to the end of the table list.
|
void |
addItem(Text[] item,
int index)
Adds the specified text row item to the specified row index.
|
void |
addItemListener(java.awt.event.ItemListener l)
Adds the specified item listener to receive item events from this list.
|
void |
addTextItem(Text[] item)
Adds the specified text row item to the end of the table list.
|
void |
addTextItem(Text[] item,
int index)
Adds the specified text row item to the specified row index.
|
protected static Button[] |
createColumnButtons(java.lang.String[] columnTitles,
int[] columnAligns,
TextStyle textStyle)
Creates the column buttons for the table list with the specified column
titles, alignments of the column titles, and the text style of the
buttons.
|
void |
deselect(int index)
Deselects the row at the specified index.
|
int |
getAutoResizeMode()
Returns the auto resize mode of the panel.
|
Button[] |
getColumnButtons()
Returns the buttons for the column titles.
|
int |
getColumnCount()
Returns the number of columns in the list.
|
java.lang.String[] |
getColumnTitles()
Returns the column titles.
|
TextListController |
getController()
Returns the controller of this list.
|
protected java.awt.Component |
getEventSource()
Gets the event source component.
|
java.lang.String |
getItem(int index,
int column)
Returns the string item associated with the specified index (row)
and column.
|
int |
getItemCount()
Returns the number of items in the list.
|
java.lang.String[] |
getItems(int column)
Returns the string items associated with the specified column index.
|
java.awt.Dimension |
getMinimumSize()
Returns the minimum size of this table list.
|
java.awt.Dimension |
getMinimumSize(int rows)
Returns the minumum dimensions for a table list with the specified
number of visual lines.
|
TextListModel |
getModel()
Returns the model of this list.
|
java.awt.PopupMenu |
getPopupMenu()
Returns the popup menu of this list.
|
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of this table list.
|
java.awt.Dimension |
getPreferredSize(int rows)
Returns the preferred dimensions for a table list with the specified
number of visual lines.
|
java.lang.String |
getRowItem(int index)
Returns the item associated with the specified row index.
|
java.lang.String[] |
getRowItems(int index)
Returns the string items associated with the specified row index.
|
int |
getRows()
Get the number of visible lines in this table list.
|
Text |
getRowTextItem(int index)
Returns the text item associated with the specified row index.
|
Text[] |
getRowTextItems(int index)
Returns the text items associated with the specified row index.
|
int |
getScrollbarThickness()
Returns the thickness of the scroll bar.
|
int |
getSelectedIndex()
Gets the index of the selected row on the list,
|
int[] |
getSelectedIndexes()
Gets the selected row indexes on the list.
|
java.lang.Object[] |
getSelectedObjects()
Returns the selected items on the list in an array of Objects.
|
java.awt.Color |
getSelectionBackground()
Returns the selection background color.
|
java.awt.Color |
getSelectionForeground()
Returns the selection foreground color.
|
int |
getSelectionMode()
Returns the selection mode.
|
Text |
getTextItem(int index,
int column)
Returns the text item associated with the specified index (row)
and column.
|
Text[] |
getTextItems(int column)
Returns the text items associated with the specified column index.
|
TextListView |
getView()
Returns the view of this list.
|
int |
getVisibleIndex()
Gets the index of the row that was last made visible by the method
makeVisible. |
protected void |
initialize(TextListModel model,
int rows,
Button[] buttons)
Initializes the table list with the specified model, number of visual
lines, and column buttons.
|
boolean |
isClickToFocus()
Tests if the list requests the focus when the mouse is clicked.
|
boolean |
isDeselectionEnabled()
Tests if the deselection is enabled when the selection mode is a single
selection.
|
boolean |
isIndexSelected(int index)
Determines if the specified row in this scrolling list is selected.
|
boolean |
isMouseFocus()
Tests if the list requests the focus when the mouse enters the list.
|
boolean |
isMultipleMode()
Determines whether this list allows multiple selections.
|
void |
itemStateChanged(java.awt.event.ItemEvent e)
Invoked when an item's state has been changed.
|
void |
makeVisible(int index)
Makes the row at the specified index visible.
|
protected void |
processEvent(java.awt.AWTEvent e) |
void |
remove(int position)
Remove the item at the specified row position.
|
void |
remove(int[] indices)
Remove the items at the specified row indices.
|
void |
remove(int start,
int end)
Remove the items at the specified row range.
|
void |
removeActionListener(java.awt.event.ActionListener l)
Removes the specified action listener so that it no longer receives
action events from this list.
|
void |
removeAll()
Removes all items from the list.
|
void |
removeItemListener(java.awt.event.ItemListener l)
Removes the specified item listener so that it no longer receives
item events from this list.
|
void |
removeSelectedIndexes()
Remove the items at the indices of the selected rows.
|
void |
replaceItem(java.lang.String[] newValue,
int index)
Replaces the item at the specified row index with the new strings.
|
void |
replaceItem(Text[] newValue,
int index)
Replaces the item at the specified row index with the new texts.
|
void |
replaceTextItem(Text[] newValue,
int index)
Replaces the item at the specified row index with the new texts.
|
void |
select(int index)
Selects the row at the specified index in the scrolling list.
|
void |
setAutoResizeMode(int mode)
Sets the the auto resize mode of the panel.
|
void |
setBackground(java.awt.Color c)
Sets the background color of this list.
|
void |
setClickToFocus()
Makes the list request the focus when the mouse is clicked.
|
void |
setCursor(java.awt.Cursor c)
Sets the cursor of this list.
|
void |
setDeselectionEnabled(boolean b)
Makes the deselection enabled when the selection mode is a single
selection.
|
void |
setEnabled(boolean b)
Enables or disables this list.
|
void |
setFont(java.awt.Font f)
Sets the font of this list.
|
void |
setForeground(java.awt.Color c)
Sets the foreground color of this list.
|
void |
setItem(int index,
int column,
java.lang.String item)
Sets the item associated with the specified index (row) and column
to the specified string value.
|
void |
setItem(int index,
int column,
Text item)
Sets the item associated with the specified index (row) and column
to the specified text value.
|
void |
setItems(java.lang.String[][] items)
Sets the items of the list to the specified string row by column items.
|
void |
setItems(Text[][] items)
Sets the items of the list to the specified text row by column items.
|
void |
setMouseFocus()
Makes the list request the focus when the mouse enters the list.
|
void |
setMultipleMode(boolean b)
Sets the flag that determines whether this list allows multiple
selections.
|
void |
setPopupMenu(java.awt.PopupMenu menu)
Sets the popup menu of this list.
|
void |
setRows(int rows)
Sets the number of visible lines in this table list.
|
void |
setScrollbarThickness(int thickness)
Sets the thickness of the scroll bar.
|
void |
setSelectionBackground(java.awt.Color c)
Sets the selection background color.
|
void |
setSelectionForeground(java.awt.Color c)
Sets the selection foreground color.
|
void |
setSelectionMode(int mode)
Sets the selection mode.
|
void |
setTextItem(int index,
int column,
Text item)
Sets the item associated with the specified index (row) and column
to the specified text value.
|
void |
setTextItems(Text[][] items)
Sets the items of the list to the specified text row by column items.
|
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, delegateFocusEvent, delegateKeyEvent, delegateMouseEvent, focusGained, focusLost, getToolTipText, getToolTipVisual, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, setToolTipText, setToolTipText, setToolTipVisualaddNotify, bounds, disable, doLayout, enable, enable, getBounds, getFrame, getInsets, getLocation, getSize, hide, insets, isDirectNotification, isFocusTraversable, layout, location, minimumSize, postOldEvent, preferredSize, repaintNow, requestFocus, reshape, setBounds, setFocusTraversable, setVisible, show, show, size, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMousePosition, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, list, list, locate, paint, paintComponents, paramString, print, printComponents, processContainerEvent, remove, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseWheelListener, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected TextListModel listModel
protected TextListView listView
protected TableListView tableView
protected TextListController listController
protected ScrollPanel scrollPanel
protected int rows
protected transient java.awt.event.ItemListener itemListener
protected transient java.awt.event.ActionListener actionListener
public static final int SINGLE_SELECTION
public static final int MULTIPLE_SELECTIONS
public static final int SHIFT_MULTIPLE_SELECTIONS
public static final int AUTO_RESIZE_OFF
public static final int AUTO_RESIZE_LAST_COLUMN
public static final int AUTO_RESIZE_ALL_COLUMNS
public static final RichTextStyle DEFAULT_TABLE_STYLE
public static final int DEFAULT_BUTTON_ALIGN
protected static final int DEFAULT_VISIBLE_ROWS
protected static final java.lang.String itemListenerK
protected static final java.lang.String actionListenerK
public TableList(java.lang.String[] columnTitles)
columnTitles - the column titles.public TableList(int rows,
java.lang.String[] columnTitles)
rows - the number of visual lines in the table list.columnTitles - the column titles.public TableList(int rows,
java.lang.String[] columnTitles,
int[] columnWidths)
rows - the number of visual lines in the table list.columnTitles - the column titles.columnWidths - the widths of the columns, or null.Label.LEFT,
Label.CENTER,
Label.RIGHTpublic TableList(int rows,
java.lang.String[] columnTitles,
int[] columnWidths,
RichTextStyle richTextStyle)
rows - the number of visual lines in the table list.columnTitles - the column titles.columnWidths - the widths of the columns, or null.richTextStyle - the rich text style of the table list.Label.LEFT,
Label.CENTER,
Label.RIGHTpublic TableList(int rows,
java.lang.String[] columnTitles,
int[] columnAligns,
int[] columnWidths,
RichTextStyle richTextStyle)
rows - the number of visual lines in the table list.columnTitles - the column titles.columnAligns - the alignments of the column titles, or null.columnWidths - the widths of the columns, or null.richTextStyle - the rich text style of the table list.Label.LEFT,
Label.CENTER,
Label.RIGHTpublic TableList(TextListModel model, int rows, java.lang.String[] columnTitles)
model - the text list model.rows - the number of visual lines in the table list.columnTitles - the column titles.public TableList(TextListModel model, int rows, java.lang.String[] columnTitles, int[] columnAligns)
model - the text list model.rows - the number of visual lines in the table list.columnTitles - the column titles.columnAligns - the alignments of the column titles, or null.Label.LEFT,
Label.CENTER,
Label.RIGHTpublic TableList(TextListModel model, int rows, Button[] buttons)
model - the text list model.rows - the number of visual lines in the table list.buttons - the buttons for column titles.protected static Button[] createColumnButtons(java.lang.String[] columnTitles, int[] columnAligns, TextStyle textStyle)
columnTitles - the column titles.columnAligns - the alignments of the column titles.textSTyle - the text style of the buttons.Label.LEFT,
Label.CENTER,
Label.RIGHTprotected void initialize(TextListModel model, int rows, Button[] buttons)
model - the text list model.rows - the number of visual lines in the table list.buttons - the buttons for column titles.protected java.awt.Component getEventSource()
getEventSource クラス内 EventProxyContainerpublic void addItemListener(java.awt.event.ItemListener l)
addItemListener インタフェース内 java.awt.ItemSelectablel - the item listener.public void removeItemListener(java.awt.event.ItemListener l)
removeItemListener インタフェース内 java.awt.ItemSelectablel - the item listener.public void addActionListener(java.awt.event.ActionListener l)
l - the action listener.public void removeActionListener(java.awt.event.ActionListener l)
l - the action listener.public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged インタフェース内 java.awt.event.ItemListenerItemListenerpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed インタフェース内 java.awt.event.ActionListenerActionListenerprotected void processEvent(java.awt.AWTEvent e)
processEvent クラス内 java.awt.Containerpublic void setForeground(java.awt.Color c)
setForeground クラス内 java.awt.Componentpublic void setBackground(java.awt.Color c)
setBackground クラス内 java.awt.Componentpublic void setFont(java.awt.Font f)
setFont クラス内 java.awt.Containerpublic void setCursor(java.awt.Cursor c)
setCursor クラス内 java.awt.Componentpublic void setEnabled(boolean b)
setEnabled クラス内 KContainerpublic java.awt.Dimension getPreferredSize(int rows)
rows - number of visual lines in the table list.public java.awt.Dimension getPreferredSize()
getPreferredSize クラス内 KContainerpublic java.awt.Dimension getMinimumSize(int rows)
rows - number of visual lines in the table list.public java.awt.Dimension getMinimumSize()
getMinimumSize クラス内 KContainerpublic int getAutoResizeMode()
setAutoResizeMode(int)public void setAutoResizeMode(int mode)
mode - the auto resize mode.getAutoResizeMode(),
AUTO_RESIZE_OFF,
AUTO_RESIZE_LAST_COLUMN,
AUTO_RESIZE_ALL_COLUMNSpublic int getRows()
setRows(int)public void setRows(int rows)
rows - the number of visible lines in this table list.getRows()public java.lang.Object[] getSelectedObjects()
getSelectedObjects インタフェース内 java.awt.ItemSelectableItemSelectablepublic TextListModel getModel()
public TextListView getView()
public TextListController getController()
public Button[] getColumnButtons()
public java.lang.String[] getColumnTitles()
public java.awt.Color getSelectionForeground()
public void setSelectionForeground(java.awt.Color c)
getSelectionForeground()public java.awt.Color getSelectionBackground()
public void setSelectionBackground(java.awt.Color c)
getSelectionBackground()public java.awt.PopupMenu getPopupMenu()
public void setPopupMenu(java.awt.PopupMenu menu)
getPopupMenu()public boolean isClickToFocus()
true if the list requests the focus when the
mouse is clicked, false if the list requests
the focus when the mouse enters the view.isMouseFocus()public boolean isMouseFocus()
isClickToFocus()public void setClickToFocus()
isClickToFocus(),
setMouseFocus()public void setMouseFocus()
isMouseFocus(),
setClickToFocus()public boolean isDeselectionEnabled()
public void setDeselectionEnabled(boolean b)
isDeselectionEnabled()public int getSelectionMode()
public void setSelectionMode(int mode)
public boolean isMultipleMode()
true if this list allows multiple selections;
false otherwise.#setMultipleMode(int),
getSelectionMode(),
setSelectionMode(int)public void setMultipleMode(boolean b)
b - if true then multiple selections are allowed;
otherwise, only one item from the list can be selected at once.isMultipleMode(),
getSelectionMode(),
setSelectionMode(int)public int getItemCount()
public int getColumnCount()
public java.lang.String getItem(int index,
int column)
public Text getTextItem(int index, int column)
public void setItem(int index,
int column,
java.lang.String item)
public void setItem(int index,
int column,
Text item)
public void setTextItem(int index,
int column,
Text item)
public void setItems(java.lang.String[][] items)
public void setItems(Text[][] items)
public void setTextItems(Text[][] items)
public java.lang.String[] getRowItems(int index)
public Text[] getRowTextItems(int index)
public java.lang.String getRowItem(int index)
public Text getRowTextItem(int index)
public java.lang.String[] getItems(int column)
public Text[] getTextItems(int column)
public void addItem(java.lang.String[] item)
public void addItem(java.lang.String[] item,
int index)
public void addItem(Text[] item)
public void addItem(Text[] item, int index)
public void addTextItem(Text[] item)
public void addTextItem(Text[] item, int index)
public void replaceItem(java.lang.String[] newValue,
int index)
public void replaceItem(Text[] newValue, int index)
public void replaceTextItem(Text[] newValue, int index)
public void removeAll()
removeAll クラス内 java.awt.Containerpublic void remove(int position)
remove クラス内 java.awt.Containerpublic void remove(int start,
int end)
start - the starting row position, inclusive.end - the ending row position, inclusive.public void remove(int[] indices)
indices - the row indices to be removed.public void removeSelectedIndexes()
public boolean isIndexSelected(int index)
index - the row to be checked.true if the specified row has been selected;
false otherwise.public int getSelectedIndex()
-1 if no
item is selected, or if more that one row is selected.public int[] getSelectedIndexes()
public void select(int index)
index - the position of the row to select.public void deselect(int index)
If the row at the specified index is not selected, or if the index is out of range, then the operation is ignored.
index - the position of the row to deselect.public int getVisibleIndex()
makeVisible.makeVisible(int)public void makeVisible(int index)
index - the position of the row.getVisibleIndex()public int getScrollbarThickness()
public void setScrollbarThickness(int thickness)
#setScrollbarThickness()