All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.bwt.JCMultiColumnListComponent

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----jclass.bwt.JCComponent
                           |
                           +----jclass.bwt.JCListComponent
                                   |
                                   +----jclass.bwt.JCMultiColumnListComponent

public class JCMultiColumnListComponent
extends JCListComponent
implements JCMultiColumnInterface
A list of text and/or image items. To create a scrollable list, use a JCMultiColumnList.

See Also:
JCMultiColumnList

Variable Index

 o data
The object which maintains the multi-column data.

Constructor Index

 o JCMultiColumnListComponent()
Creates an empty list with no visible rows.
 o JCMultiColumnListComponent(int, boolean)
Creates a list with the specified number of visible lines.
 o JCMultiColumnListComponent(JCVector)
Creates a list with the specified items.
 o JCMultiColumnListComponent(JCVector, Applet, String)
Creates a list which reads parameters from the applet's HTML file.

Method Index

 o addItem(Applet, String, char)
Parses a string and adds the specified item to the end of the list.
 o addItem(String, char)
Parses a string and adds the specified item to the end of the list.
 o addNotify()
If NumColumns has not been set, it is set to the largest number of items in all items.
 o calcSize(int, boolean)
Recalculates the list's internal sizes based on the row.
 o calcWidth(int)
Calculates the width of a column for all rows.
 o draw(Graphics, Object, int, Rectangle)
Draws the value as a String, JCString or Image.
 o drawHighlight(Graphics, boolean)
Draws or clears the highlight rectangle (called by paint).
 o getColumnAlignment(int)
Gets a column's alignment (default: BWTEnum.MIDDLELEFT).
 o getColumnAlignments()
Gets the column alignments.
 o getColumnLeftMargin(int)
Gets the column's left margin value (pixels) (default: 5).
 o getColumnPosition(int)
Gets the physical position of the left boundary of the column (accounting for horizontal scrolling).
 o getColumnRightMargin(int)
 o getColumnWidth(int)
Gets the current width of a column, or 0 if the column does not exist.
 o getColumnWidths()
Gets a list of the column widths.
 o getItemsStrings()
Gets the list's values as a list of Strings.
 o getMultiColumnData()
Gets the component's JCMultiColumnData instance.
 o getNumColumns()
Gets the current number of columns.
 o getParameters()
Reads the parameter values from the HTML page using the component's applet.
 o preferredWidth()
Returns the width of the widest item.
 o setBatched(boolean)
If false (default), the component is repainted every time an item is changed.
 o setColumnAlignment(int, int)
Sets a column's alignment.
 o setColumnAlignments(int[])
Sets the column's alignments.

This value may be set from an HTML file using a PARAM tag with a "ColumnAlignments" name and a comma-separated list of enums.

 o setColumnButtons(JCVector)
If the list is a child of a JCMultiColumnList, sets a header for the window with buttons with the specified labels.
 o setColumnLabels(JCVector)
If the list is a child of a JCMultiColumnList, sets a header for the window with the specified labels.
 o setColumnLeftMargin(int, int)
Sets the column's left margin value (pixels) (default: 5).
 o setColumnRightMargin(int, int)
Sets the column's right margin value (pixels) (default: 5).

The values for all columns may be set from an HTML file using a PARAM tag with a "ColumnRightMargins" name and a comma-separated list of ints.

 o setColumnWidth(int, int)
Sets the width of a column.
 o setColumnWidths(int[])
Sets the list of column widths.
 o setFont(Font)
Sets the font of the component.
 o setItems(String[])
Sets the list's values as an array of Strings.
 o setNumColumns(int)
Sets the current number of columns.
 o sortByColumn(int, JCSortInterface)
Sorts the rows in the list in ascending order based on a specified column, using the String equivalents of each value.
 o sortByColumn(int, JCSortInterface, int)
Sorts the rows in the list based on a specified column, using the String equivalents of each value.

Variables

 o data
 protected JCMultiColumnData data
The object which maintains the multi-column data.

Constructors

 o JCMultiColumnListComponent
 public JCMultiColumnListComponent()
Creates an empty list with no visible rows. No parameters are read from an HTML file.

 o JCMultiColumnListComponent
 public JCMultiColumnListComponent(JCVector items)
Creates a list with the specified items. No parameters are read from an HTML file.

See Also:
setItems
 o JCMultiColumnListComponent
 public JCMultiColumnListComponent(JCVector items,
                                   Applet applet,
                                   String name)
Creates a list which reads parameters from the applet's HTML file.

Parameters:
items - the initial items. Each element may be a String, JCString or any object (in which case the object's toString() method is called to obtain a string).
applet - the applet whose PARAM tags are to be read
name - if this is not null, only parameters preceded by this name are read
See Also:
setItems, getParameter, JCString
 o JCMultiColumnListComponent
 public JCMultiColumnListComponent(int rows,
                                   boolean multipleSelections)
Creates a list with the specified number of visible lines.

Parameters:
rows - the number of items to show.
multipleSelections - if true then multiple selections are allowed.

Methods

 o getParameters
 protected void getParameters()
Reads the parameter values from the HTML page using the component's applet. The values will override those previously set.

Overrides:
getParameters in class JCListComponent
 o setFont
 public synchronized void setFont(Font f)
Sets the font of the component. HTML param name/value: "Font"/font

Overrides:
setFont in class JCListComponent
See Also:
toFont
 o setItems
 public void setItems(String items[])
Sets the list's values as an array of Strings. The value for each column is separated by commas.

Overrides:
setItems in class JCListComponent
 o getItemsStrings
 public synchronized String[] getItemsStrings()
Gets the list's values as a list of Strings. The value for each column is separated by commas.

Overrides:
getItemsStrings in class JCListComponent
See Also:
setItems
 o setColumnLabels
 public void setColumnLabels(JCVector labels)
If the list is a child of a JCMultiColumnList, sets a header for the window with the specified labels.

See Also:
setColumnLabels
 o setColumnButtons
 public void setColumnButtons(JCVector labels)
If the list is a child of a JCMultiColumnList, sets a header for the window with buttons with the specified labels.

See Also:
setColumnButtons
 o setBatched
 public void setBatched(boolean v)
If false (default), the component is repainted every time an item is changed. If set to true, the component is only repainted (if necessary) when the value is again set to false.

Overrides:
setBatched in class JCListComponent
 o calcSize
 protected synchronized void calcSize(int row,
                                      boolean new_row)
Recalculates the list's internal sizes based on the row.

Parameters:
new_row - whether this is a new item
Overrides:
calcSize in class JCListComponent
 o addItem
 public void addItem(String item,
                     char delim)
Parses a string and adds the specified item to the end of the list.

Parameters:
item - the item to be added. A JCVector is created using the tokens in the string.
delim - delimiter separating each token in the string
See Also:
toVector
 o addItem
 public void addItem(Applet applet,
                     String item,
                     char delim)
Parses a string and adds the specified item to the end of the list.

Parameters:
applet - the applet to be used for loading images contained in any JCStrings in the vector
item - the item to be added. A JCVector is created using the tokens in the string.
delim - delimiter separating each token in the string
See Also:
JCString
 o draw
 protected void draw(Graphics gc,
                     Object value,
                     int alignment,
                     Rectangle draw_rect)
Draws the value as a String, JCString or Image.

Parameters:
alignment - one of: BWTEnum.TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT, MIDDLECENTER, MIDDLERIGHT, BOTTOMLEFT, BOTTOMCENTER and BOTTOMRIGHT
draw_rect - rectangle within which to draw the value
Overrides:
draw in class JCListComponent
 o drawHighlight
 protected void drawHighlight(Graphics gc,
                              boolean on)
Draws or clears the highlight rectangle (called by paint).

Parameters:
on - if true, draws the highlight rectangle; otherwise clears the rect If false, draws a 1-pixel rectangle
Overrides:
drawHighlight in class JCComponent
 o addNotify
 public void addNotify()
If NumColumns has not been set, it is set to the largest number of items in all items.

Overrides:
addNotify in class JCListComponent
 o preferredWidth
 protected int preferredWidth()
Returns the width of the widest item.

Overrides:
preferredWidth in class JCListComponent
 o sortByColumn
 public void sortByColumn(int column,
                          JCSortInterface sort_if)
Sorts the rows in the list in ascending order based on a specified column, using the String equivalents of each value.

Parameters:
sort_if - An optional interface whose compare method is called during sorting, to provide a mechanism for the application to specify whether one object is greater than another (similar to qsort's compare function). If this parameter is null, the column is sorted by numerical or string comparison as applicable.
 o sortByColumn
 public void sortByColumn(int column,
                          JCSortInterface sort_if,
                          int direction)
Sorts the rows in the list based on a specified column, using the String equivalents of each value.

Parameters:
sort_if - An optional interface whose compare method is called during sorting, to provide a mechanism for the application to specify whether one object is greater than another (similar to qsort's compare function). If this parameter is null, the column is sorted by numerical or string comparison as applicable.
direction - sort direction: JCqsort.ASCENDING or DESCENDING
 o calcWidth
 public int calcWidth(int col)
Calculates the width of a column for all rows.

 o getColumnWidths
 public int[] getColumnWidths()
Gets a list of the column widths.

See Also:
setColumnWidths
 o setColumnWidths
 public void setColumnWidths(int widths[])
Sets the list of column widths. If a column's value is set to BWTEnum.VARIABLE, the width is set to the widest value in the column.

This value may be set from an HTML file using a PARAM tag with a "ColumnWidths" name and a comma-separated list of ints.

 o getColumnWidth
 public int getColumnWidth(int col)
Gets the current width of a column, or 0 if the column does not exist.

 o setColumnWidth
 public void setColumnWidth(int col,
                            int width)
Sets the width of a column. If the value is set to BWTEnum.VARIABLE, the width is set to the widest value in the column.

 o getNumColumns
 public int getNumColumns()
Gets the current number of columns.

 o setNumColumns
 public void setNumColumns(int v)
Sets the current number of columns. If set to BWTEnum.VARIABLE (default), all columns are displayed.

HTML param name/value: "NumColumns"/int

 o getColumnAlignments
 public int[] getColumnAlignments()
Gets the column alignments.

 o getColumnAlignment
 public int getColumnAlignment(int col)
Gets a column's alignment (default: BWTEnum.MIDDLELEFT).

 o setColumnAlignment
 public void setColumnAlignment(int col,
                                int align)
Sets a column's alignment.

Parameters:
alignment - one of: BWTEnum.TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT, MIDDLECENTER, MIDDLERIGHT, BOTTOMLEFT, BOTTOMCENTER and BOTTOMRIGHT
 o setColumnAlignments
 public void setColumnAlignments(int align[])
Sets the column's alignments.

This value may be set from an HTML file using a PARAM tag with a "ColumnAlignments" name and a comma-separated list of enums.

Parameters:
align - one of: BWTEnum.TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT, MIDDLECENTER, MIDDLERIGHT, BOTTOMLEFT, BOTTOMCENTER and BOTTOMRIGHT
 o getColumnPosition
 public int getColumnPosition(int col)
Gets the physical position of the left boundary of the column (accounting for horizontal scrolling).

 o getColumnLeftMargin
 public int getColumnLeftMargin(int col)
Gets the column's left margin value (pixels) (default: 5).

 o setColumnLeftMargin
 public void setColumnLeftMargin(int col,
                                 int value)
Sets the column's left margin value (pixels) (default: 5). The values for all columns may be set from an HTML file using a PARAM tag with a "ColumnLeftMargins" name and a comma-separated list of ints.

 o getColumnRightMargin
 public int getColumnRightMargin(int col)
 o setColumnRightMargin
 public void setColumnRightMargin(int col,
                                  int value)
Sets the column's right margin value (pixels) (default: 5).

The values for all columns may be set from an HTML file using a PARAM tag with a "ColumnRightMargins" name and a comma-separated list of ints.

 o getMultiColumnData
 public JCMultiColumnData getMultiColumnData()
Gets the component's JCMultiColumnData instance.


All Packages  Class Hierarchy  This Package  Previous  Next  Index