borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.view
java.lang.Object +----java.awt.Component +----java.awt.Container +----java.awt.ScrollPane +----borland.jbcl.view.ListView +----borland.jbcl.control.ListControl
Variables Constructors Properties Methods Event Listeners
Implements VectorView, MenuContainer, ImageObserver, Serializable
The ListView component is a list box view element for developing new composite components. It requires a VectorModel data model and a VectorViewManager view manager.
See also:
Understanding model-view architecture
public ListView()Constructs a ListView component with default property values.
public int getAlignment() public void setAlignment(int alignment)Specifies the alignment (right, left, center) of the items in the list. Accepted values for the align argument are listed in borland.jbcl.util.Alignment where they are defined.
public boolean isAlwaysEdit() public void setAlwaysEdit(boolean alwaysEdit)Specifies whether the component requires a special keystroke (or other event) to go into editing mode. If alwaysEdit is true, the item editor is instantiated wherever the subfocus moves.
public boolean isAutoEdit() public void setAutoEdit(boolean autoEdit)The autoEdit property enables/disables automatic item editing in the list. By default, this property is true, and a user can edit values in any item on the list by typing a character on the keyboard. If set to false, the user must press F2 or Ctrl+Enter, or double-click to start an edit session. By default, this property is true.
public void setBackground(java.awt.Color color)
public boolean isBatchMode() public void setBatchMode(boolean batchMode)The batchMode property enables or disables all painting in the list. This is used for programmatic mass updates to the list's model, selection, or other related objects, without triggering repaint messages.
public Component getCoreComponent()Returns the contained ListCore (non-public) class instance as a Component.
public boolean isDirectDraw() public void setDirectDraw(boolean directDraw)The directDraw property enables or disables direct painting, circumventing the AWT paint queue.
public boolean isDoubleBuffer() public void setDoubleBuffer(boolean doubleBuffer)The doubleBuffer property enables or disables the double-buffered screen painting built into the list. The default is true, and the list paints all of the visible items onto an off-screen image before blitting the image onto the screen, to prevent flicker. Setting doubleBuffer to false will disable this functionality, and all ItemPainters will paint directly to the screen. This property is set to false when a user is placing a list onto a Panel (or some container) that has its own double-buffering, or if the user really likes things that flicker.
public boolean isDragSubfocus() public void setDragSubfocus(boolean dragSubfocus)The dragFocus property enables or disables dragging of the subfocus item when dragging the mouse pointer over the list (with the mouse button pressed). By default, this property is true.
public boolean isEditInPlace() public void setEditInPlace(boolean editInPlace)The editInPlace property enables or disables item editing in the list. By default, this property is true, and a user can edit values in any item on the list. If set to false, the vector data cannot by modified by the user - except through programmatic access to the list's model.
public boolean isEditing()The editing property (read only) returns true if an item is currently being edited in the list.
public void setFont(java.awt.Font font)
public void setForeground(java.awt.Color color)
public int getItemHeight() public void setItemHeight(int newHeight)When set, the view need not scan through the entire list of items, examining the height of each, to determine which item has been clicked, selected, or edited. Instead, it calculates item vertical location based on the value of itemHeight. Setting itemHeight sets uniformHeight to true.
public Insets getItemMargins() public void setItemMargins(java.awt.Insets margins)Specifies the space allowed between the actual edge of the item and the edge of its region allotted in the list.
public int getItemWidth() public void setItemWidth(int newWidth)When set, the view need not scan through the entire list of items, examining the width of each, to determine which item has been clicked, selected, or edited. Instead, it calculates item horizontal location based on the value of itemWidth. Setting itemWidth sets uniformWidth to true.
public VectorModel getModel() public void setModel(borland.jbcl.model.VectorModel vm)The model property defines the VectorModel that this list is displaying data from. If the current model is an instance of WritableVectorModel, an external user can get access to it using getWriteModel().
public boolean isPostOnEndEdit() public void setPostOnEndEdit(boolean post)Specifies whether to write changes to the model immediately upon the end of an edit. By default, postOnEndEdit is set to true.
public Dimension getPreferredSize()
public boolean isReadOnly() public void setReadOnly(boolean ro)Specifies whether the items in the list can be edited. The readOnly property returns false only if the component user sets it to false and the model being used is a WriteableVectorModel (WriteModel() returns a writable model object rather than null. Otherwise, getReadOnly returns true regardless of how it has been set.
public WritableVectorSelection getSelection() public void setSelection(borland.jbcl.model.WritableVectorSelection vs)The selection property defines a WritableVectorSelection manager. This allows multiple vector viewers to share the same selection pool - and for the list to handle selection in a generic manner. This allows users to plug in their own implemention of a selection manager to have custom selection behavior.
public boolean isShowFocus() public void setShowFocus(boolean focus)Specifies whether the component displays a dotted rectangle indicated the subfocus location.
public boolean isSnapOrigin() public void setSnapOrigin(boolean snapOrigin)The snapOrigin property controls wether or not the list will automatically snap the scroll position to align the top item with the top edge of the list. If set to false, the list will not snap the scroll position, and it will scroll smoothly with changes to the subfocus item. By default, this property is true.
public int getSubfocus() public void setSubfocus(int index)Specifies the item that has subfocus within the component.
public int getTopIndex() public void setTopIndex(int index)The topIndex property represents which item index is at the top-most of the visible items in the list. Setting this property will not move the subfocus item within the list, but will scroll the list to the appropriate position.
public boolean isUniformHeight() public void setUniformHeight(boolean uniformHeight)
Indicates whether the items in the list share a single uniform height. If uniformHeight is true, and itemHeight is null (has not been set), the view assumes that the all items have the height of the first item in the list. Setting uniformHeight to true allows the view to calculate item vertical location based on the value of itemHeight (or the height of the first item) rather than scanning throught the entire list of items.
public boolean isUniformWidth() public void setUniformWidth(boolean uniformWidth)
Indicates whether the items in the list share a single uniform width. If uniformWidth is true, and itemWidth is null (has not been set), the view assumes that the all items have the width of the first item in the list. Setting uniformWidth to true allows the view to calculate item horizontal location based on the value of itemWidth (or the width of the first item) rather than scanning throught the entire list of items.
public VectorViewManager getViewManager() public void setViewManager(borland.jbcl.model.VectorViewManager vvm)The viewManager property defines the VectorViewManager that will 'broker' ItemPainters and ItemEditors to this list.
public WritableVectorModel getWriteModel()
public void addNotify()
public void endEdit()Ends the editing of an item, marking the item editor for garbage collection. Checks the postOnEndEdit property and, if it is true, writes the change to the model.
public void endEdit(boolean post)Ends the editing of an item, marking the item editor for garbage collection. Writes the change to the model if post is true.
public Rectangle getItemRect(int index)Returns the Rectangle (in pixels) that bounds the item at the specified index. Coordinates are relative to the entire scrollable region inside of the ListView. Use getScrollPosition() and getViewportSize() to calculate relative point positions to external components.
Returns the bounding rectangle of the item.
Parameters:
public int hitTest(int y)Returns the index of the item at the Y coordinate specified. Coordinates are relative to the entire scrollable region inside of the ListView. Use getScrollPosition() and getViewportSize() to calculate relative point positions to external components.
Returns the hit index, or -1 if nothing was hit.
Parameters:
public void repaintItem(int index)Repaints the item at the passed index.
Parameters:
public void repaintItems()Repaints all items in the list.
public void requestFocus()
public void startEdit(int index)Starts an edit session at 'index'. If editInPlace is false or if readOnly is true, this method is a no-op.
Parameters:
public void addActionListener(java.awt.event.ActionListener l) public void removeActionListener(java.awt.event.ActionListener l)
public synchronized void addComponentListener(java.awt.event.ComponentListener l) public synchronized void removeComponentListener(java.awt.event.ComponentListener l)
public synchronized void addContainerListener(java.awt.event.ContainerListener l) public void removeContainerListener(java.awt.event.ContainerListener l)
public void addFocusListener(java.awt.event.FocusListener l) public void removeFocusListener(java.awt.event.FocusListener l)
public void addKeyListener(java.awt.event.KeyListener l) public void removeKeyListener(java.awt.event.KeyListener l)
public void addModelListener(borland.jbcl.model.VectorModelListener listener) public void removeModelListener(borland.jbcl.model.VectorModelListener listener)
public void addMouseListener(java.awt.event.MouseListener l) public void removeMouseListener(java.awt.event.MouseListener l)
public void addMouseMotionListener(java.awt.event.MouseMotionListener l) public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
public void addSelectionListener(borland.jbcl.model.VectorSelectionListener listener) public void removeSelectionListener(borland.jbcl.model.VectorSelectionListener listener)
public void addSubfocusListener(borland.jbcl.model.VectorSubfocusListener listener) public void removeSubfocusListener(borland.jbcl.model.VectorSubfocusListener listener)