All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.awt.text.TextListController
java.lang.Object
|
+----jp.kyasu.awt.text.TextController
|
+----jp.kyasu.awt.text.TextListController
- public class TextListController
- extends TextController
- implements ActionListener, ItemSelectable
The TextListController
class implements a view of a MVC model
for the text list. The model of the MVC model is a TextListModel
object and the view of the MVC model is a TextListView
object.
- Version:
- 18 Dec 1998
- Author:
- Kazuki YASUMATSU
- See Also:
- TextListModel, TextListView
-
MULTIPLE_SELECTIONS
- Allows AWT style multiple selections.
-
SHIFT_MULTIPLE_SELECTIONS
- Allows Windows style multiple selections.
-
SINGLE_SELECTION
- Allows single selection.
-
TextListController(TextListView)
- Constructs a text list controller with the specified text list view.
-
actionPerformed(ActionEvent)
- Invoked when an action occurs.
-
addActionListener(ActionListener)
- Adds the specified action listener to receive action events from
this controller.
-
addItem(String[], int)
- Adds the specified string row item to the specified row index.
-
addItem(Text[], int)
- Adds the specified text row item to the specified row index.
-
addItemListener(ItemListener)
- Adds the specified item listener to receive item events from
this controller.
-
addTextItem(Text[], int)
- Adds the specified text row item to the specified row index.
-
deselect(int)
- Deselects the row at the specified index.
-
deselect(int, int, boolean, boolean)
- Deselects the row at the specified index.
-
findTextLine()
- Finds the string in the text lists.
-
findTextLine(String)
- Finds the specified string in the text lists.
-
getColumnCount()
- Returns the number of columns in the list.
-
getItem(int, int)
- Returns the string item associated with the specified index (row)
and column.
-
getItemCount()
- Returns the number of items in the list.
-
getItems(int)
- Returns the string items associated with the specified column index.
-
getModel()
- Returns the model of this controller.
-
getPopupMenu()
- Returns the popup menu of this controller.
-
getRowItem(int)
- Returns the item associated with the specified row index.
-
getRowItems(int)
- Returns the string items associated with the specified row index.
-
getRows()
- Returns the number of visible lines in the view.
-
getRowTextItem(int)
- Returns the text item associated with the specified row index.
-
getRowTextItems(int)
- Returns the text items associated with the specified row index.
-
getSelectedIndex()
- Returns the index of the selected row.
-
getSelectedIndexes()
- Returns the indices of the selected rows.
-
getSelectedObjects()
- Returns the selected items or null if no items are selected.
-
getSelectionMode()
- Returns the selection mode.
-
getTextItem(int, int)
- Returns the text item associated with the specified index (row)
and column.
-
getTextItems(int)
- Returns the text items associated with the specified column index.
-
getView()
- Returns the view of this controller.
-
getVisibleIndex()
- Returns the index of the row that was last made visible.
-
isDeselectionEnabled()
- Tests if the deselection is enabled when the selection mode is a single
selection.
-
isIndexSelected(int)
- Checks if the row at the specified index is selected.
-
isMovingSelectionEnabled()
- Tests if the selection follows the mouse.
-
isMultipleMode()
- Checks if this controller allows multiple selections.
-
keyPressed(KeyEvent)
- Invoked when a key has been pressed.
-
makeVisible(int)
- Makes the row at the specified index visible.
-
mouseDragged(MouseEvent)
- Invoked when the mouse button is pressed on a component and then dragged.
-
mouseMoved(MouseEvent)
- Invoked when the mouse button has been moved on a component.
-
mousePressed(MouseEvent)
- Invoked when the mouse has been pressed on a component.
-
mouseReleased(MouseEvent)
- Invoked when the mouse has been released on a component.
-
remove(int)
- Remove the item at the specified row position.
-
remove(int, int)
- Remove the items at the specified row range.
-
remove(int[])
- Remove the items at the specified row indices.
-
removeActionListener(ActionListener)
- Removes the specified action listener so it no longer receives action
events from this controller.
-
removeAll()
- Removes all items from the list.
-
removeItemListener(ItemListener)
- Removes the specified item listener so it no longer receives item
events from this controller.
-
removeSelectedIndexes()
- Remove the items at the indices of the selected rows.
-
replaceItem(String[], int)
- Replaces the item at the specified row index with the new strings.
-
replaceItem(Text[], int)
- Replaces the item at the specified row index with the new texts.
-
replaceTextItem(Text[], int)
- Replaces the item at the specified row index with the new texts.
-
select(int)
- Selects the row at the specified index.
-
select(int, int, boolean, boolean)
- Selects the row at the specified index.
-
setDeselectionEnabled(boolean)
- Makes the deselection enabled when the selection mode is a single
selection.
-
setItem(int, int, String)
- Sets the item associated with the specified index (row) and column
to the specified string value.
-
setItem(int, int, Text)
- Sets the item associated with the specified index (row) and column
to the specified text value.
-
setItems(String[][])
- Sets the items of the list to the specified string row by column items.
-
setItems(Text[][])
- Sets the items of the list to the specified text row by column items.
-
setMovingSelectionEnabled(boolean)
- Makes the selection follow the mouse.
-
setMultipleMode(boolean)
- Sets the flag that determines whether this controller allows
multiple selections.
-
setPopupMenu(PopupMenu)
- Sets the popup menu of this controller.
-
setSelectionMode(int)
- Sets the selection mode.
-
setTextItem(int, int, Text)
- Sets the item associated with the specified index (row) and column
to the specified text value.
-
setTextItems(Text[][])
- Sets the items of the list to the specified text row by column items.
SINGLE_SELECTION
public static final int SINGLE_SELECTION
- Allows single selection.
MULTIPLE_SELECTIONS
public static final int MULTIPLE_SELECTIONS
- Allows AWT style multiple selections.
SHIFT_MULTIPLE_SELECTIONS
public static final int SHIFT_MULTIPLE_SELECTIONS
- Allows Windows style multiple selections.
TextListController
public TextListController(TextListView view)
- Constructs a text list controller with the specified text list view.
- Parameters:
- view - the text list view.
getModel
public TextListModel getModel()
- Returns the model of this controller.
getView
public TextView getView()
- Returns the view of this controller.
- Overrides:
- getView in class TextController
getSelectedObjects
public Object[] getSelectedObjects()
- Returns the selected items or null if no items are selected.
- See Also:
- ItemSelectable
addItemListener
public void addItemListener(ItemListener l)
- Adds the specified item listener to receive item events from
this controller.
- Parameters:
- l - the item listener.
- See Also:
- ItemSelectable
removeItemListener
public void removeItemListener(ItemListener l)
- Removes the specified item listener so it no longer receives item
events from this controller.
- Parameters:
- l - the item listener.
- See Also:
- ItemSelectable
addActionListener
public void addActionListener(ActionListener l)
- Adds the specified action listener to receive action events from
this controller.
- Parameters:
- l - the action listener.
removeActionListener
public void removeActionListener(ActionListener l)
- Removes the specified action listener so it no longer receives action
events from this controller.
- Parameters:
- l - the action listener.
getSelectionMode
public int getSelectionMode()
- Returns the selection mode.
- See Also:
- setSelectionMode, SINGLE_SELECTION, MULTIPLE_SELECTIONS, SHIFT_MULTIPLE_SELECTIONS
setSelectionMode
public synchronized void setSelectionMode(int mode)
- Sets the selection mode.
- See Also:
- getSelectionMode, SINGLE_SELECTION, MULTIPLE_SELECTIONS, SHIFT_MULTIPLE_SELECTIONS
isDeselectionEnabled
public boolean isDeselectionEnabled()
- Tests if the deselection is enabled when the selection mode is a single
selection.
- See Also:
- setDeselectionEnabled
setDeselectionEnabled
public synchronized void setDeselectionEnabled(boolean b)
- Makes the deselection enabled when the selection mode is a single
selection.
- See Also:
- isDeselectionEnabled
isMovingSelectionEnabled
public boolean isMovingSelectionEnabled()
- Tests if the selection follows the mouse.
- See Also:
- setMovingSelectionEnabled
setMovingSelectionEnabled
public synchronized void setMovingSelectionEnabled(boolean b)
- Makes the selection follow the mouse.
- See Also:
- isMovingSelectionEnabled
getPopupMenu
public PopupMenu getPopupMenu()
- Returns the popup menu of this controller.
- See Also:
- setPopupMenu
setPopupMenu
public synchronized void setPopupMenu(PopupMenu menu)
- Sets the popup menu of this controller.
- See Also:
- getPopupMenu
getItemCount
public int getItemCount()
- Returns the number of items in the list.
getColumnCount
public int getColumnCount()
- Returns the number of columns in the list.
getItem
public String getItem(int index,
int column)
- Returns the string item associated with the specified index (row)
and column.
getTextItem
public Text getTextItem(int index,
int column)
- Returns the text item associated with the specified index (row)
and column.
setItem
public synchronized void setItem(int index,
int column,
String item)
- Sets the item associated with the specified index (row) and column
to the specified string value.
setItem
public void setItem(int index,
int column,
Text item)
- Sets the item associated with the specified index (row) and column
to the specified text value.
setTextItem
public synchronized void setTextItem(int index,
int column,
Text item)
- Sets the item associated with the specified index (row) and column
to the specified text value.
setItems
public synchronized void setItems(String items[][])
- Sets the items of the list to the specified string row by column items.
setItems
public void setItems(Text items[][])
- Sets the items of the list to the specified text row by column items.
setTextItems
public synchronized void setTextItems(Text items[][])
- Sets the items of the list to the specified text row by column items.
getRowItems
public synchronized String[] getRowItems(int index)
- Returns the string items associated with the specified row index.
getRowTextItems
public Text[] getRowTextItems(int index)
- Returns the text items associated with the specified row index.
getRowItem
public synchronized String getRowItem(int index)
- Returns the item associated with the specified row index.
getRowTextItem
public synchronized Text getRowTextItem(int index)
- Returns the text item associated with the specified row index.
getItems
public synchronized String[] getItems(int column)
- Returns the string items associated with the specified column index.
getTextItems
public Text[] getTextItems(int column)
- Returns the text items associated with the specified column index.
addItem
public synchronized void addItem(String item[],
int index)
- Adds the specified string row item to the specified row index.
addItem
public void addItem(Text item[],
int index)
- Adds the specified text row item to the specified row index.
addTextItem
public synchronized void addTextItem(Text item[],
int index)
- Adds the specified text row item to the specified row index.
replaceItem
public synchronized void replaceItem(String newValue[],
int index)
- Replaces the item at the specified row index with the new strings.
replaceItem
public void replaceItem(Text newValue[],
int index)
- Replaces the item at the specified row index with the new texts.
replaceTextItem
public synchronized void replaceTextItem(Text newValue[],
int index)
- Replaces the item at the specified row index with the new texts.
removeAll
public synchronized void removeAll()
- Removes all items from the list.
remove
public void remove(int position)
- Remove the item at the specified row position.
remove
public synchronized void remove(int start,
int end)
- Remove the items at the specified row range.
- Parameters:
- start - the starting row position, inclusive.
- end - the ending row position, inclusive.
remove
public synchronized void remove(int indices[])
- Remove the items at the specified row indices.
- Parameters:
- indices - the row indices to be removed.
removeSelectedIndexes
public void removeSelectedIndexes()
- Remove the items at the indices of the selected rows.
isIndexSelected
public boolean isIndexSelected(int index)
- Checks if the row at the specified index is selected.
getSelectedIndex
public synchronized int getSelectedIndex()
- Returns the index of the selected row.
getSelectedIndexes
public int[] getSelectedIndexes()
- Returns the indices of the selected rows.
select
public void select(int index)
- Selects the row at the specified index.
- Parameters:
- index - the position of the row to select.
select
public synchronized void select(int index,
int column,
boolean makeVisible,
boolean emitEvent)
- Selects the row at the specified index.
- Parameters:
- index - the position of the row to select.
- column - the position of the column to select.
- makeVisible - if true, makes the selected row visible.
- emitEvent - if true, emits the item event.
deselect
public void deselect(int index)
- Deselects the row at the specified index.
- Parameters:
- index - the position of the row to deselect.
deselect
public synchronized void deselect(int index,
int column,
boolean makeVisible,
boolean emitEvent)
- Deselects the row at the specified index.
- Parameters:
- index - the position of the row to deselect.
- column - the position of the column to deselect.
- makeVisible - if true, makes the deselected row visible.
- emitEvent - if true, emits the item event.
isMultipleMode
public boolean isMultipleMode()
- Checks if this controller allows multiple selections.
- See Also:
- setMultipleMode, getSelectionMode, setSelectionMode
setMultipleMode
public void setMultipleMode(boolean b)
- Sets the flag that determines whether this controller allows
multiple selections.
- See Also:
- isMultipleMode, getSelectionMode, setSelectionMode
getVisibleIndex
public int getVisibleIndex()
- Returns the index of the row that was last made visible.
- See Also:
- makeVisible
makeVisible
public synchronized void makeVisible(int index)
- Makes the row at the specified index visible.
- See Also:
- getVisibleIndex
getRows
public int getRows()
- Returns the number of visible lines in the view.
mousePressed
public void mousePressed(MouseEvent e)
- Invoked when the mouse has been pressed on a component.
- Overrides:
- mousePressed in class TextController
- See Also:
- MouseListener
mouseReleased
public void mouseReleased(MouseEvent e)
- Invoked when the mouse has been released on a component.
- Overrides:
- mouseReleased in class TextController
- See Also:
- MouseListener
mouseMoved
public void mouseMoved(MouseEvent e)
- Invoked when the mouse button has been moved on a component.
- Overrides:
- mouseMoved in class TextController
- See Also:
- MouseMotionListener
mouseDragged
public void mouseDragged(MouseEvent e)
- Invoked when the mouse button is pressed on a component and then dragged.
- Overrides:
- mouseDragged in class TextController
- See Also:
- MouseMotionListener
keyPressed
public void keyPressed(KeyEvent e)
- Invoked when a key has been pressed.
- Overrides:
- keyPressed in class TextController
- See Also:
- KeyListener
actionPerformed
public void actionPerformed(ActionEvent e)
- Invoked when an action occurs.
- See Also:
- ActionListener
findTextLine
public void findTextLine()
- Finds the string in the text lists.
findTextLine
public boolean findTextLine(String str)
- Finds the specified string in the text lists.
All Packages Class Hierarchy This Package Previous Next Index