All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.bwt.JCMultiColumnWindow

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----jclass.bwt.JCContainer
                                   |
                                   +----jclass.bwt.JCScrolledWindow
                                           |
                                           +----jclass.bwt.JCMultiColumnWindow

public abstract class JCMultiColumnWindow
extends JCScrolledWindow
implements JCMultiColumnInterface, JCActionListener
An abstract class which is the superclass for scrollable multi-column components and their column labels.

Properties

Name Method
Background setBackground
ColumnAlignments setColumnAlignments
ColumnButtons setColumnButtons
ColumnLabels setColumnLabels
ColumnLabelSort setColumnLabelSort
ColumnLabelSortMethod setColumnLabelSortMethod
ColumnLeftMargin setColumnLeftMargin
ColumnRightMargin setColumnRightMargin
ColumnWidths setColumnWidths
Font setFont
Foreground setForeground
Insets setInsets
NumColumns setNumColumns
PreferredSize setPreferredSize
UserData setUserData

See Also:
JCOutliner, JCMultiColumnList

Variable Index

 o ASCENDING
 o comp
The component scrolled by this window.
 o DESCENDING
 o header
The column label component.
 o headerArea
The header's viewport.

Constructor Index

 o JCMultiColumnWindow()
Creates an empty window.
 o JCMultiColumnWindow(Applet, String)
Creates a window which reads parameters from the applet's HTML file.

Method Index

 o actionPerformed(JCActionEvent)
Sorts a column if the user clicks on a column heading button.
 o addNotify()
Creates the Panel's peer.
 o calcWidth(int)
Calculates the width of a column.
 o getColumnAlignment(int)
Gets a column's alignment.
 o getColumnAlignments()
Gets the column alignments.
 o getColumnLabels()
Gets the column label strings, or null if none have been set.
 o getColumnLabelSort()
Gets the windows's ColumnLabelSort value.
 o getColumnLabelSortMethod()
Gets the current ColumnLabelSortMethod value.
 o getColumnLeftMargin(int)
Gets the column's left margin value (pixels).
 o getColumnPosition(int)
Gets the physical position of the left boundary of the column (accounting for horizontal scrolling).
 o getColumnRightMargin(int)
Gets the column's right margin value (pixels).
 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 getHeader()
Gets the header for the window.
 o getMultiColumnData()
Gets the component's JCMultiColumnData instance.
 o getNumColumns()
Gets the current number of columns.
 o getViewportWidth()
Returns the larger of the viewport's and header's preferred width.
 o headerHeight()
Returns the header's preferred height.
 o headerWidth()
Returns the header's preferred width.
 o preferredHeight()
Returns the sum of the viewport's and header's preferred height.
 o reshapeHeader(int, int, int)
Sets the location and width of the header.
 o reshapeViewport(int, int, int, int)
Moves the viewport up so that its top highlight is not visible.
 o scrollHorizontal(JCAdjustmentEvent, int)
Scrolls the window horizontally to the specified value.
 o setColumnAlignment(int, int)
Sets a column's alignment.
 o setColumnAlignments(int[])
Sets the column's alignments.

HTML param name/value: "ColumnAlignments"/comma-separated list of enums

 o setColumnButtons(JCVector)
Sets a header for the window with buttons created from the specified labels.
 o setColumnButtons(String[])
Sets a header for the window with buttons created from the specified labels.
 o setColumnLabelAlignment(int, int)
Sets a column label's alignment.
 o setColumnLabels(JCVector)
Sets a header for the window with the specified labels.
 o setColumnLabels(String[])
Sets a header for the window with the specified labels.
 o setColumnLabelSort(boolean)
Specifies whether a column is sorted when its button is clicked (default: true).
 o setColumnLabelSortMethod(JCSortInterface)
Sets the method to be called during sorting.
 o setColumnLeftMargin(int, int)
Sets the column's left margin value (pixels) (default: 5).

HTML param name/value: "ColumnLeftMargins"/comma-separated list of ints, one for each column

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

HTML param name/value: "ColumnRightMargins"/comma-separated list of ints, one for each column

 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 setHeader(JCHeader)
Sets a header for the window.
 o setNumColumns(int)
Sets the current number of columns.
 o setViewport(JCMultiColumnInterface)
Sets the component which will be the viewport.
 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 ASCENDING
 public static final int ASCENDING
 o DESCENDING
 public static final int DESCENDING
 o headerArea
 protected Viewport headerArea
The header's viewport.

 o header
 protected JCHeader header
The column label component.

 o comp
 protected JCMultiColumnInterface comp
The component scrolled by this window.

Constructors

 o JCMultiColumnWindow
 public JCMultiColumnWindow()
Creates an empty window. No parameters are read from an HTML file.

 o JCMultiColumnWindow
 public JCMultiColumnWindow(Applet applet,
                            String name)
Creates a window which reads parameters from the applet's HTML file.

Parameters:
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:
getParameter

Methods

 o getHeader
 public JCHeader getHeader()
Gets the header for the window.

 o setHeader
 public void setHeader(JCHeader header)
Sets a header for the window.

See Also:
JCMultiColumnList, JCOutliner
 o getColumnLabels
 public String[] getColumnLabels()
Gets the column label strings, or null if none have been set.

See Also:
setColumnButtons, setColumnLabels, getLabels
 o setColumnLabels
 public void setColumnLabels(String labels[])
Sets a header for the window with the specified labels.

See Also:
setColumnButtons, setLabels
 o setColumnLabels
 public void setColumnLabels(JCVector labels)
Sets a header for the window with the specified labels.

See Also:
setLabels
 o setColumnButtons
 public void setColumnButtons(String labels[])
Sets a header for the window with buttons created from the specified labels.

See Also:
setColumnLabels, setButtons
 o setColumnButtons
 public void setColumnButtons(JCVector labels)
Sets a header for the window with buttons created from the specified labels.

See Also:
setButtons
 o setViewport
 protected void setViewport(JCMultiColumnInterface comp)
Sets the component which will be the viewport.

 o reshapeHeader
 protected int reshapeHeader(int x,
                             int y,
                             int w)
Sets the location and width of the header.

Overrides:
reshapeHeader in class JCScrolledWindow
 o headerHeight
 protected int headerHeight()
Returns the header's preferred height.

Overrides:
headerHeight in class JCScrolledWindow
 o headerWidth
 protected int headerWidth()
Returns the header's preferred width.

 o reshapeViewport
 protected void reshapeViewport(int x,
                                int y,
                                int w,
                                int h)
Moves the viewport up so that its top highlight is not visible.

Overrides:
reshapeViewport in class JCScrolledWindow
 o preferredHeight
 protected int preferredHeight()
Returns the sum of the viewport's and header's preferred height.

Overrides:
preferredHeight in class JCScrolledWindow
 o getViewportWidth
 protected int getViewportWidth()
Returns the larger of the viewport's and header's preferred width.

Overrides:
getViewportWidth in class JCScrolledWindow
 o setFont
 public synchronized void setFont(Font f)
Sets the font of the component. This value may be set from an HTML file using a PARAM tag with a "Font" name and a Font value.

Overrides:
setFont in class Component
See Also:
toFont
 o getColumnLabelSort
 public boolean getColumnLabelSort()
Gets the windows's ColumnLabelSort value.

See Also:
setColumnLabelSort
 o setColumnLabelSort
 public void setColumnLabelSort(boolean v)
Specifies whether a column is sorted when its button is clicked (default: true). If true, sortByColumn() will be called.

HTML param name/value: "ColumnLabelSort"/boolean

See Also:
sortByColumn
 o setColumnLabelSortMethod
 public void setColumnLabelSortMethod(JCSortInterface method)
Sets the method to be called during sorting.

Parameters:
method - an 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) (default: null). If null, the column is sorted by numerical or string comparison as applicable.
See Also:
setColumnLabelSort, JCSortInterface
 o getColumnLabelSortMethod
 public JCSortInterface getColumnLabelSortMethod()
Gets the current ColumnLabelSortMethod value.

See Also:
setColumnLabelSortMethod
 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: ASCENDING or DESCENDING
 o addNotify
 public void addNotify()
Creates the Panel's peer.

Overrides:
addNotify in class JCScrolledWindow
 o scrollHorizontal
 protected void scrollHorizontal(JCAdjustmentEvent ev,
                                 int value)
Scrolls the window horizontally to the specified value. Subclasses may override this method to provide custom behavior.

Overrides:
scrollHorizontal in class JCScrolledWindow
 o actionPerformed
 public void actionPerformed(JCActionEvent ev)
Sorts a column if the user clicks on a column heading button.

See Also:
setColumnLabelSort
 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.

HTML param name/value: "ColumnWidths"/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.

Throws: IllegalArgumentException
If the value is invalid
 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

Throws: IllegalArgumentException
If the value is invalid
 o getColumnAlignments
 public int[] getColumnAlignments()
Gets the column alignments.

 o getColumnAlignment
 public int getColumnAlignment(int col)
Gets a column's alignment.

 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
Throws: IllegalArgumentException
If the value is invalid
 o setColumnLabelAlignment
 public void setColumnLabelAlignment(int col,
                                     int align)
Sets a column label's alignment.

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

HTML param name/value: "ColumnAlignments"/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).

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

HTML param name/value: "ColumnLeftMargins"/comma-separated list of ints, one for each column

 o getColumnRightMargin
 public int getColumnRightMargin(int col)
Gets the column's right margin value (pixels).

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

HTML param name/value: "ColumnRightMargins"/comma-separated list of ints, one for each column

 o calcWidth
 public int calcWidth(int col)
Calculates the width of a column.

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


All Packages  Class Hierarchy  This Package  Previous  Next  Index