    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

##

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

##

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

##

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

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

setColumnButtons(JCVector)
  Sets a header for the window with buttons created from the specified labels.
setColumnButtons(String[])
  Sets a header for the window with buttons created from the specified labels.
setColumnButtonsStrings(String[])
  Sets a header for the window with buttons created from the specified labels.
setColumnLabelAlignment(int, int)
  Sets a column label's alignment.
setColumnLabels(JCVector)
  Sets a header for the window with the specified labels.
setColumnLabels(String[])
  Sets a header for the window with the specified labels.
setColumnLabelSort(boolean)
  Specifies whether a column is sorted when its button is clicked (default: true).
setColumnLabelSortMethod(JCSortInterface)
  Sets the method to be called during sorting.
setColumnLabelsStrings(String[])
  Sets a header for the window with the specified labels.
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

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

setColumnWidth(int, int)
  Sets the width of a column.
setColumnWidths(int[])
  Sets the list of column widths.
setFont(Font)
  Sets the font of the component.
setHeader(JCHeader)
  Sets a header for the window.
setNumColumns(int)
  Sets the current number of columns.
setViewport(JCMultiColumnInterface)
  Sets the component which will be the viewport.
sortByColumn(int, JCSortInterface)
  Sorts the rows in the list in ascending order based on a specified column, using the String equivalents of each value.
sortByColumn(int, JCSortInterface, int)
  Sorts the rows in the list based on a specified column, using the String equivalents of each value.

##

ASCENDING

     public static final int ASCENDING

DESCENDING

     public static final int DESCENDING

headerArea

     protected Viewport headerArea

  The header's viewport.

header

     protected JCHeader header

  The column label component.

comp

     protected JCMultiColumnInterface comp

  The component scrolled by this window.

##

JCMultiColumnWindow

     public JCMultiColumnWindow()

  Creates an empty window. No parameters are read from an HTML file.

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

##

getHeader

     public JCHeader getHeader()

  Gets the header for the window.

setHeader

     public void setHeader(JCHeader header)

  Sets a header for the window.

  See Also:
    JCMultiColumnList, JCOutliner

getColumnLabels

     public String[] getColumnLabels()

  Gets the column label strings, or null if none have been set.

  See Also:
    setColumnButtons, setColumnLabels, getLabels

setColumnLabelsStrings

     public void setColumnLabelsStrings(String labels[])

  Sets a header for the window with the specified labels. It is used by bean to avoid Introspection conflict.

  See Also:
    setColumnLabels, setColumnButtons, setLabels

setColumnLabels

     public void setColumnLabels(String labels[])

  Sets a header for the window with the specified labels.

  See Also:
    setColumnButtons, setLabels

setColumnLabels

     public void setColumnLabels(JCVector labels)

  Sets a header for the window with the specified labels.

  See Also:
    setLabels

setColumnButtonsStrings

     public void setColumnButtonsStrings(String labels[])

  Sets a header for the window with buttons created from the specified labels. It is used by bean to avoid Introspection conflict.

  See Also:
    setColumnLabels, setColumnButtons, setButtons

setColumnButtons

     public void setColumnButtons(String labels[])

  Sets a header for the window with buttons created from the specified labels.

  See Also:
    setColumnLabels, setButtons

setColumnButtons

     public void setColumnButtons(JCVector labels)

  Sets a header for the window with buttons created from the specified labels.

  See Also:
    setButtons

setViewport

     protected void setViewport(JCMultiColumnInterface comp)

  Sets the component which will be the viewport.

reshapeHeader

     protected int reshapeHeader(int x,
                                 int y,
                                 int w)

  Sets the location and width of the header.

  Overrides:
    reshapeHeader in class JCScrolledWindow

headerHeight

     protected int headerHeight()

  Returns the header's preferred height.

  Overrides:
    headerHeight in class JCScrolledWindow

headerWidth

     protected int headerWidth()

  Returns the header's preferred width.

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

preferredHeight

     protected int preferredHeight()

  Returns the sum of the viewport's and header's preferred height.

  Overrides:
    preferredHeight in class JCScrolledWindow

getViewportWidth

     protected int getViewportWidth()

  Returns the larger of the viewport's and header's preferred width.

  Overrides:
    getViewportWidth in class JCScrolledWindow

setFont

     public 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

getColumnLabelSort

     public boolean getColumnLabelSort()

  Gets the windows's ColumnLabelSort value.

  See Also:
    setColumnLabelSort

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

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

getColumnLabelSortMethod

     public JCSortInterface getColumnLabelSortMethod()

  Gets the current ColumnLabelSortMethod value.

  See Also:
    setColumnLabelSortMethod

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.

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

addNotify

     public void addNotify()

  Creates the Panel's peer.

  Overrides:
    addNotify in class JCScrolledWindow

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

actionPerformed

     public void actionPerformed(JCActionEvent ev)

  Sorts a column if the user clicks on a column heading button.

  See Also:
    setColumnLabelSort

getColumnWidths

     public int[] getColumnWidths()

  Gets a list of the column widths.

  See Also:
    setColumnWidths

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

getColumnWidth

     public int getColumnWidth(int col)

  Gets the current width of a column, or 0 if the column does not exist.

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

getNumColumns

     public int getNumColumns()

  Gets the current number of columns.

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

getColumnAlignments

     public int[] getColumnAlignments()

  Gets the column alignments.

getColumnAlignment

     public int getColumnAlignment(int col)

  Gets a column's alignment.

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

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

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

getColumnPosition

     public int getColumnPosition(int col)

  Gets the physical position of the left boundary of the column (accounting for horizontal scrolling).

getColumnLeftMargin

     public int getColumnLeftMargin(int col)

  Gets the column's left margin value (pixels).

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

getColumnRightMargin

     public int getColumnRightMargin(int col)

  Gets the column's right margin value (pixels).

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

calcWidth

     public int calcWidth(int col)

  Calculates the width of a column.

getMultiColumnData

     public JCMultiColumnData getMultiColumnData()

  Gets the component's JCMultiColumnData instance.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index