Class sunsoft.jws.visual.rt.awt.ColumnList
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sunsoft.jws.visual.rt.awt.ColumnList

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----sunsoft.jws.visual.rt.awt.VJPanel
                                   |
                                   +----sunsoft.jws.visual.rt.awt.ScrollPanel
                                           |
                                           +----sunsoft.jws.visual.rt.awt.ColumnList

public class ColumnList
extends ScrollPanel
A Widget to display data in a row/column fashion, with scrollbars etc. A ColumnList has the following features/attributes: headers: An array of Strings. The size of this array determines the number of columns in the list. There will be one additional, hidden column that can be used for any Object. The length of the header string defines the initial width of the column. To make it wider, add spaces to the end of the string. If a header field is of the form "name=header", then only the "header" part will actually be used for the visible header. The "name" part is available through getNames() or getNameColumn() selectable: If true, records can be selected with the mouse. A LIST_EVENT gets posted. highlight_items: If true, new entries will be highlighted in orange, slowly fading out. showHeaders: If set to false, the headers will not be shown.

Constructor Index

 o ColumnList()
create a new ColumnList with no information about the columns
 o ColumnList(String[], boolean, boolean)
create a new ColumnList, with the given columns, and given visible rows.

Method Index

 o addItem(Object[])
...
 o addItem(Object[], boolean)
Adds an item to the list.
 o addItem(Object[], int)
...
 o delItem(Object[])
...
 o delItems()
...
 o delItems(int, int)
...
 o entries()
...
 o getCanvasBackground()
 o getCanvasFont()
 o getCanvasForeground()
 o getColumns()
...
 o getItem(int, int)
...
 o getListBounds()
...
 o getNameColumn(String)
...
 o getNames()
...
 o getRowHeight()
get the row height of entries in the list
 o getRowY(int)
get the Y coordinate of the upper edge of a row in the column list.
 o highlight(int)
...
 o insertItem(Object[], int)
...
 o needsRepaint()
call repaint() on the ColumnListCanvas.
 o putItem(int, int, Object)
...
 o setAutoWidth(boolean)
...
 o setCanvasBackground(Color)
 o setCanvasFont(Font)
 o setCanvasForeground(Color)
 o setDisplayRows(int)
 o setHeaders(String[])
...
 o setHighlightItems(boolean)
...
 o setSelectable(boolean)
...
 o setShowHeaders(boolean)
...
 o setVisibleChars(int)
Set the desired number of "visible" chars, i.e.
 o setVisibleRows(int)
Set the desired number of rows to be displayed.
 o swapItems(int, int)
swap the entries in two rows
 o updateView()
redraw everything, and reevaluate the need for scroll bars
 o updateVScrollbar()
overrides updateVScrollbar in ScrollPanel

Constructors

 o ColumnList
  public ColumnList()
create a new ColumnList with no information about the columns
 o ColumnList
  public ColumnList(String headers[],
                    boolean selectable,
                    boolean highlight_items)
create a new ColumnList, with the given columns, and given visible rows. ...
Parameters:
... - ...
Returns:
...

Methods

 o setCanvasForeground
  public void setCanvasForeground(Color fg)
 o getCanvasForeground
  public Color getCanvasForeground()
 o setCanvasBackground
  public void setCanvasBackground(Color fg)
 o getCanvasBackground
  public Color getCanvasBackground()
 o setCanvasFont
  public void setCanvasFont(Font font)
 o getCanvasFont
  public Font getCanvasFont()
 o setVisibleRows
  public void setVisibleRows(int rows)
Set the desired number of rows to be displayed. This affects the minumumSize() and preferredSize() of the widget. The actual rows displayed by the widget depend on how the LayoutManager interprets those values.
Parameters:
rows - number of desired rows for display
 o setDisplayRows
  public void setDisplayRows(int rows)
 o setVisibleChars
  public void setVisibleChars(int chars)
Set the desired number of "visible" chars, i.e. the total width of the column list. Defaults to "all".
Parameters:
... - ...
Returns:
...
 o setHeaders
  public void setHeaders(String headers[])
...
Parameters:
... - ...
Returns:
...
 o setSelectable
  public void setSelectable(boolean selectable)
...
Parameters:
... - ...
Returns:
...
 o setHighlightItems
  public void setHighlightItems(boolean highlight_items)
...
Parameters:
... - ...
Returns:
...
 o setShowHeaders
  public void setShowHeaders(boolean showHeaders)
...
Parameters:
... - ...
Returns:
...
 o setAutoWidth
  public void setAutoWidth(boolean autoWidth)
...
Parameters:
... - ...
Returns:
...
 o addItem
  public int addItem(Object values[],
                     boolean updateView)
Adds an item to the list. If the list has no keys defined, the item will be appended at the end of the list. Otherwise, the existing entries will be searched for an entry with the same key values. If there is such an entry, it will get replaced. Otherwise, the record goes at the end.
Parameters:
values - the record
Returns:
index of new record
 o addItem
  public void addItem(Object values[])
...
Parameters:
... - ...
Returns:
...
 o addItem
  public void addItem(Object values[],
                      int row)
...
Parameters:
... - ...
Returns:
...
 o insertItem
  public void insertItem(Object values[],
                         int row)
...
Parameters:
... - ...
Returns:
...
 o delItems
  public void delItems()
...
Parameters:
... - ...
Returns:
...
 o delItems
  public void delItems(int start,
                       int end)
...
Parameters:
... - ...
Returns:
...
 o delItem
  public boolean delItem(Object values[])
...
Parameters:
... - ...
Returns:
...
 o highlight
  public void highlight(int row)
...
Parameters:
... - ...
Returns:
...
 o getListBounds
  public Rectangle getListBounds()
...
Parameters:
... - ...
Returns:
...
 o entries
  public int entries()
...
Parameters:
... - ...
Returns:
...
 o getColumns
  public int getColumns()
...
Parameters:
... - ...
Returns:
...
 o getNames
  public String[] getNames()
...
Parameters:
... - ...
Returns:
...
 o getNameColumn
  public int getNameColumn(String name)
...
Parameters:
... - ...
Returns:
...
 o getItem
  public Object getItem(int row,
                        int column)
...
Parameters:
... - ...
Returns:
...
 o putItem
  public boolean putItem(int row,
                         int column,
                         Object value)
...
Parameters:
... - ...
Returns:
...
 o swapItems
  public boolean swapItems(int row1,
                           int row2)
swap the entries in two rows
Parameters:
... - ...
Returns:
...
 o getRowY
  public int getRowY(int row)
get the Y coordinate of the upper edge of a row in the column list. Returns -1 if the row is not visible. Returns -2 is the list is not layed out yet.
Parameters:
row - index of desired row
Returns:
Y coordinage of row
 o getRowHeight
  public int getRowHeight()
get the row height of entries in the list
Returns:
height of a row
 o needsRepaint
  public void needsRepaint()
call repaint() on the ColumnListCanvas. Needed if an Object in the column list has been changed directly (without going through putItem).
 o updateView
  public void updateView()
redraw everything, and reevaluate the need for scroll bars
 o updateVScrollbar
  protected void updateVScrollbar()
overrides updateVScrollbar in ScrollPanel
Overrides:
updateVScrollbar in class ScrollPanel

All Packages  Class Hierarchy  This Package  Previous  Next  Index