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.
-
ColumnList()
- create a new ColumnList with no information about the columns
-
ColumnList(String[], boolean, boolean)
- create a new ColumnList, with the given columns, and given visible
rows.
-
addItem(Object[])
- ...
-
addItem(Object[], boolean)
- Adds an item to the list.
-
addItem(Object[], int)
- ...
-
delItem(Object[])
- ...
-
delItems()
- ...
-
delItems(int, int)
- ...
-
entries()
- ...
-
getCanvasBackground()
-
-
getCanvasFont()
-
-
getCanvasForeground()
-
-
getColumns()
- ...
-
getItem(int, int)
- ...
-
getListBounds()
- ...
-
getNameColumn(String)
- ...
-
getNames()
- ...
-
getRowHeight()
- get the row height of entries in the list
-
getRowY(int)
- get the Y coordinate of the upper edge of a row in the column list.
-
highlight(int)
- ...
-
insertItem(Object[], int)
- ...
-
needsRepaint()
- call repaint() on the ColumnListCanvas.
-
putItem(int, int, Object)
- ...
-
setAutoWidth(boolean)
- ...
-
setCanvasBackground(Color)
-
-
setCanvasFont(Font)
-
-
setCanvasForeground(Color)
-
-
setDisplayRows(int)
-
-
setHeaders(String[])
- ...
-
setHighlightItems(boolean)
- ...
-
setSelectable(boolean)
- ...
-
setShowHeaders(boolean)
- ...
-
setVisibleChars(int)
- Set the desired number of "visible" chars, i.e.
-
setVisibleRows(int)
- Set the desired number of rows to be displayed.
-
swapItems(int, int)
- swap the entries in two rows
-
updateView()
- redraw everything, and reevaluate the need for scroll bars
-
updateVScrollbar()
- overrides updateVScrollbar in ScrollPanel
ColumnList
public ColumnList()
- create a new ColumnList with no information about the columns
ColumnList
public ColumnList(String headers[],
boolean selectable,
boolean highlight_items)
- create a new ColumnList, with the given columns, and given visible
rows.
...
- Parameters:
- ... - ...
- Returns:
- ...
setCanvasForeground
public void setCanvasForeground(Color fg)
getCanvasForeground
public Color getCanvasForeground()
setCanvasBackground
public void setCanvasBackground(Color fg)
getCanvasBackground
public Color getCanvasBackground()
setCanvasFont
public void setCanvasFont(Font font)
getCanvasFont
public Font getCanvasFont()
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
setDisplayRows
public void setDisplayRows(int rows)
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:
- ...
setHeaders
public void setHeaders(String headers[])
- ...
- Parameters:
- ... - ...
- Returns:
- ...
setSelectable
public void setSelectable(boolean selectable)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
setHighlightItems
public void setHighlightItems(boolean highlight_items)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
setShowHeaders
public void setShowHeaders(boolean showHeaders)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
setAutoWidth
public void setAutoWidth(boolean autoWidth)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
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
addItem
public void addItem(Object values[])
- ...
- Parameters:
- ... - ...
- Returns:
- ...
addItem
public void addItem(Object values[],
int row)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
insertItem
public void insertItem(Object values[],
int row)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
delItems
public void delItems()
- ...
- Parameters:
- ... - ...
- Returns:
- ...
delItems
public void delItems(int start,
int end)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
delItem
public boolean delItem(Object values[])
- ...
- Parameters:
- ... - ...
- Returns:
- ...
highlight
public void highlight(int row)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
getListBounds
public Rectangle getListBounds()
- ...
- Parameters:
- ... - ...
- Returns:
- ...
entries
public int entries()
- ...
- Parameters:
- ... - ...
- Returns:
- ...
getColumns
public int getColumns()
- ...
- Parameters:
- ... - ...
- Returns:
- ...
getNames
public String[] getNames()
- ...
- Parameters:
- ... - ...
- Returns:
- ...
getNameColumn
public int getNameColumn(String name)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
getItem
public Object getItem(int row,
int column)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
putItem
public boolean putItem(int row,
int column,
Object value)
- ...
- Parameters:
- ... - ...
- Returns:
- ...
swapItems
public boolean swapItems(int row1,
int row2)
- swap the entries in two rows
- Parameters:
- ... - ...
- Returns:
- ...
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
getRowHeight
public int getRowHeight()
- get the row height of entries in the list
- Returns:
- height of a row
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).
updateView
public void updateView()
- redraw everything, and reevaluate the need for scroll bars
updateVScrollbar
protected void updateVScrollbar()
- overrides updateVScrollbar in ScrollPanel
- Overrides:
- updateVScrollbar in class ScrollPanel
All Packages Class Hierarchy This Package Previous Next Index