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

Variable Index

 o MULTIPLE_SELECTIONS
Allows AWT style multiple selections.
 o SHIFT_MULTIPLE_SELECTIONS
Allows Windows style multiple selections.
 o SINGLE_SELECTION
Allows single selection.

Constructor Index

 o TextListController(TextListView)
Constructs a text list controller with the specified text list view.

Method Index

 o actionPerformed(ActionEvent)
Invoked when an action occurs.
 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this controller.
 o addItem(String[], int)
Adds the specified string row item to the specified row index.
 o addItem(Text[], int)
Adds the specified text row item to the specified row index.
 o addItemListener(ItemListener)
Adds the specified item listener to receive item events from this controller.
 o addTextItem(Text[], int)
Adds the specified text row item to the specified row index.
 o deselect(int)
Deselects the row at the specified index.
 o deselect(int, int, boolean, boolean)
Deselects the row at the specified index.
 o findTextLine()
Finds the string in the text lists.
 o findTextLine(String)
Finds the specified string in the text lists.
 o getColumnCount()
Returns the number of columns in the list.
 o getItem(int, int)
Returns the string item associated with the specified index (row) and column.
 o getItemCount()
Returns the number of items in the list.
 o getItems(int)
Returns the string items associated with the specified column index.
 o getModel()
Returns the model of this controller.
 o getPopupMenu()
Returns the popup menu of this controller.
 o getRowItem(int)
Returns the item associated with the specified row index.
 o getRowItems(int)
Returns the string items associated with the specified row index.
 o getRows()
Returns the number of visible lines in the view.
 o getRowTextItem(int)
Returns the text item associated with the specified row index.
 o getRowTextItems(int)
Returns the text items associated with the specified row index.
 o getSelectedIndex()
Returns the index of the selected row.
 o getSelectedIndexes()
Returns the indices of the selected rows.
 o getSelectedObjects()
Returns the selected items or null if no items are selected.
 o getSelectionMode()
Returns the selection mode.
 o getTextItem(int, int)
Returns the text item associated with the specified index (row) and column.
 o getTextItems(int)
Returns the text items associated with the specified column index.
 o getView()
Returns the view of this controller.
 o getVisibleIndex()
Returns the index of the row that was last made visible.
 o isDeselectionEnabled()
Tests if the deselection is enabled when the selection mode is a single selection.
 o isIndexSelected(int)
Checks if the row at the specified index is selected.
 o isMovingSelectionEnabled()
Tests if the selection follows the mouse.
 o isMultipleMode()
Checks if this controller allows multiple selections.
 o keyPressed(KeyEvent)
Invoked when a key has been pressed.
 o makeVisible(int)
Makes the row at the specified index visible.
 o mouseDragged(MouseEvent)
Invoked when the mouse button is pressed on a component and then dragged.
 o mouseMoved(MouseEvent)
Invoked when the mouse button has been moved on a component.
 o mousePressed(MouseEvent)
Invoked when the mouse has been pressed on a component.
 o mouseReleased(MouseEvent)
Invoked when the mouse has been released on a component.
 o remove(int)
Remove the item at the specified row position.
 o remove(int, int)
Remove the items at the specified row range.
 o remove(int[])
Remove the items at the specified row indices.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this controller.
 o removeAll()
Removes all items from the list.
 o removeItemListener(ItemListener)
Removes the specified item listener so it no longer receives item events from this controller.
 o removeSelectedIndexes()
Remove the items at the indices of the selected rows.
 o replaceItem(String[], int)
Replaces the item at the specified row index with the new strings.
 o replaceItem(Text[], int)
Replaces the item at the specified row index with the new texts.
 o replaceTextItem(Text[], int)
Replaces the item at the specified row index with the new texts.
 o select(int)
Selects the row at the specified index.
 o select(int, int, boolean, boolean)
Selects the row at the specified index.
 o setDeselectionEnabled(boolean)
Makes the deselection enabled when the selection mode is a single selection.
 o setItem(int, int, String)
Sets the item associated with the specified index (row) and column to the specified string value.
 o setItem(int, int, Text)
Sets the item associated with the specified index (row) and column to the specified text value.
 o setItems(String[][])
Sets the items of the list to the specified string row by column items.
 o setItems(Text[][])
Sets the items of the list to the specified text row by column items.
 o setMovingSelectionEnabled(boolean)
Makes the selection follow the mouse.
 o setMultipleMode(boolean)
Sets the flag that determines whether this controller allows multiple selections.
 o setPopupMenu(PopupMenu)
Sets the popup menu of this controller.
 o setSelectionMode(int)
Sets the selection mode.
 o setTextItem(int, int, Text)
Sets the item associated with the specified index (row) and column to the specified text value.
 o setTextItems(Text[][])
Sets the items of the list to the specified text row by column items.

Variables

 o SINGLE_SELECTION
 public static final int SINGLE_SELECTION
Allows single selection.

 o MULTIPLE_SELECTIONS
 public static final int MULTIPLE_SELECTIONS
Allows AWT style multiple selections.

 o SHIFT_MULTIPLE_SELECTIONS
 public static final int SHIFT_MULTIPLE_SELECTIONS
Allows Windows style multiple selections.

Constructors

 o TextListController
 public TextListController(TextListView view)
Constructs a text list controller with the specified text list view.

Parameters:
view - the text list view.

Methods

 o getModel
 public TextListModel getModel()
Returns the model of this controller.

 o getView
 public TextView getView()
Returns the view of this controller.

Overrides:
getView in class TextController
 o getSelectedObjects
 public Object[] getSelectedObjects()
Returns the selected items or null if no items are selected.

See Also:
ItemSelectable
 o 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
 o 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
 o addActionListener
 public void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this controller.

Parameters:
l - the action listener.
 o 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.
 o getSelectionMode
 public int getSelectionMode()
Returns the selection mode.

See Also:
setSelectionMode, SINGLE_SELECTION, MULTIPLE_SELECTIONS, SHIFT_MULTIPLE_SELECTIONS
 o setSelectionMode
 public synchronized void setSelectionMode(int mode)
Sets the selection mode.

See Also:
getSelectionMode, SINGLE_SELECTION, MULTIPLE_SELECTIONS, SHIFT_MULTIPLE_SELECTIONS
 o isDeselectionEnabled
 public boolean isDeselectionEnabled()
Tests if the deselection is enabled when the selection mode is a single selection.

See Also:
setDeselectionEnabled
 o setDeselectionEnabled
 public synchronized void setDeselectionEnabled(boolean b)
Makes the deselection enabled when the selection mode is a single selection.

See Also:
isDeselectionEnabled
 o isMovingSelectionEnabled
 public boolean isMovingSelectionEnabled()
Tests if the selection follows the mouse.

See Also:
setMovingSelectionEnabled
 o setMovingSelectionEnabled
 public synchronized void setMovingSelectionEnabled(boolean b)
Makes the selection follow the mouse.

See Also:
isMovingSelectionEnabled
 o getPopupMenu
 public PopupMenu getPopupMenu()
Returns the popup menu of this controller.

See Also:
setPopupMenu
 o setPopupMenu
 public synchronized void setPopupMenu(PopupMenu menu)
Sets the popup menu of this controller.

See Also:
getPopupMenu
 o getItemCount
 public int getItemCount()
Returns the number of items in the list.

 o getColumnCount
 public int getColumnCount()
Returns the number of columns in the list.

 o getItem
 public String getItem(int index,
                       int column)
Returns the string item associated with the specified index (row) and column.

 o getTextItem
 public Text getTextItem(int index,
                         int column)
Returns the text item associated with the specified index (row) and column.

 o 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.

 o 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.

 o 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.

 o setItems
 public synchronized void setItems(String items[][])
Sets the items of the list to the specified string row by column items.

 o setItems
 public void setItems(Text items[][])
Sets the items of the list to the specified text row by column items.

 o setTextItems
 public synchronized void setTextItems(Text items[][])
Sets the items of the list to the specified text row by column items.

 o getRowItems
 public synchronized String[] getRowItems(int index)
Returns the string items associated with the specified row index.

 o getRowTextItems
 public Text[] getRowTextItems(int index)
Returns the text items associated with the specified row index.

 o getRowItem
 public synchronized String getRowItem(int index)
Returns the item associated with the specified row index.

 o getRowTextItem
 public synchronized Text getRowTextItem(int index)
Returns the text item associated with the specified row index.

 o getItems
 public synchronized String[] getItems(int column)
Returns the string items associated with the specified column index.

 o getTextItems
 public Text[] getTextItems(int column)
Returns the text items associated with the specified column index.

 o addItem
 public synchronized void addItem(String item[],
                                  int index)
Adds the specified string row item to the specified row index.

 o addItem
 public void addItem(Text item[],
                     int index)
Adds the specified text row item to the specified row index.

 o addTextItem
 public synchronized void addTextItem(Text item[],
                                      int index)
Adds the specified text row item to the specified row index.

 o replaceItem
 public synchronized void replaceItem(String newValue[],
                                      int index)
Replaces the item at the specified row index with the new strings.

 o replaceItem
 public void replaceItem(Text newValue[],
                         int index)
Replaces the item at the specified row index with the new texts.

 o replaceTextItem
 public synchronized void replaceTextItem(Text newValue[],
                                          int index)
Replaces the item at the specified row index with the new texts.

 o removeAll
 public synchronized void removeAll()
Removes all items from the list.

 o remove
 public void remove(int position)
Remove the item at the specified row position.

 o 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.
 o remove
 public synchronized void remove(int indices[])
Remove the items at the specified row indices.

Parameters:
indices - the row indices to be removed.
 o removeSelectedIndexes
 public void removeSelectedIndexes()
Remove the items at the indices of the selected rows.

 o isIndexSelected
 public boolean isIndexSelected(int index)
Checks if the row at the specified index is selected.

 o getSelectedIndex
 public synchronized int getSelectedIndex()
Returns the index of the selected row.

 o getSelectedIndexes
 public int[] getSelectedIndexes()
Returns the indices of the selected rows.

 o select
 public void select(int index)
Selects the row at the specified index.

Parameters:
index - the position of the row to select.
 o 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.
 o deselect
 public void deselect(int index)
Deselects the row at the specified index.

Parameters:
index - the position of the row to deselect.
 o 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.
 o isMultipleMode
 public boolean isMultipleMode()
Checks if this controller allows multiple selections.

See Also:
setMultipleMode, getSelectionMode, setSelectionMode
 o setMultipleMode
 public void setMultipleMode(boolean b)
Sets the flag that determines whether this controller allows multiple selections.

See Also:
isMultipleMode, getSelectionMode, setSelectionMode
 o getVisibleIndex
 public int getVisibleIndex()
Returns the index of the row that was last made visible.

See Also:
makeVisible
 o makeVisible
 public synchronized void makeVisible(int index)
Makes the row at the specified index visible.

See Also:
getVisibleIndex
 o getRows
 public int getRows()
Returns the number of visible lines in the view.

 o mousePressed
 public void mousePressed(MouseEvent e)
Invoked when the mouse has been pressed on a component.

Overrides:
mousePressed in class TextController
See Also:
MouseListener
 o mouseReleased
 public void mouseReleased(MouseEvent e)
Invoked when the mouse has been released on a component.

Overrides:
mouseReleased in class TextController
See Also:
MouseListener
 o 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
 o 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
 o keyPressed
 public void keyPressed(KeyEvent e)
Invoked when a key has been pressed.

Overrides:
keyPressed in class TextController
See Also:
KeyListener
 o actionPerformed
 public void actionPerformed(ActionEvent e)
Invoked when an action occurs.

See Also:
ActionListener
 o findTextLine
 public void findTextLine()
Finds the string in the text lists.

 o findTextLine
 public boolean findTextLine(String str)
Finds the specified string in the text lists.


All Packages  Class Hierarchy  This Package  Previous  Next  Index