    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class jclass.bwt.JCOutlinerComponent

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

public class JCOutlinerComponent
extends JCComponent
implements JCOutlinerInterface, JCMultiColumnInterface, JCSortInterface, JCScrollableInterface

The internal private component of a JCOutliner.

See Also:
  JCOutliner

##

actionListeners
  List of JCActionEvent listeners
BEGIN
data
  The object which maintains the multi-column data.
dataRect
default_style
DRAGDROP_ALL
DRAGDROP_NONE
DRAGDROP_SOURCE
DRAGDROP_TARGET
END
FOLDER_CLOSED
FOLDER_OPEN_ALL
FOLDER_OPEN_FOLDERS
FOLDER_OPEN_ITEMS
FOLDER_OPEN_NONE
full_node_height
itemListeners
  List of JCOutlinerEvent listeners
node_list
  List of all nodes, in drawing order.
outlinerPrinter
  Printing methods
printListeners
scrolled_window
  Parent window.
shortcut_close_icon
shortcut_open_icon
SHORTCUT_SIZE
style_list

##

JCOutlinerComponent()
  Creates an empty JCOutliner.
JCOutlinerComponent(int, boolean)
  Creates an outliner with the specified number of visible lines.
JCOutlinerComponent(JCOutlinerNode)
  Creates a new JCOutliner with the specified root node.
JCOutlinerComponent(JCOutlinerNode, Applet, String)
  Creates an outliner which reads parameters from the applet's HTML file.

##

addActionListener(JCActionListener)
  Adds the specified action listener to receive action events.
addItemListener(JCItemListener)
  Adds the specified item listener to receive node events.
addNotify()
  Creates icons and processes nodes.
addPrintListener(JCOutlinerPrintListener)
  For JDK 1.1 printing, adds the specified print listener to receive print events.
calculateNodeHeight(JCOutlinerNode)
  Calculates the height of a node (by looking at the node's style).
calculateStyleHeight(JCOutlinerNodeStyle)
  Calculates the height of a node given its style characteristics.
calcWidth(int)
  Calculates the width of a column for all nodes.
calcWidth(JCOutlinerNode, int)
  Calculates the width of a node's column, excluding the left and right margins.
checkState(int)
  Checks that a state is valid.
compare(Object, Object)
  JCSortInterface comparison method.
countAllNodes(JCOutlinerNode, JCVector)
  Returns the number of nodes and subnodes in a folder, regardless of visibility
countChildren(JCOutlinerNode)
  Returns the number of nodes and subnodes in a folder.
countPreviousRows(JCOutlinerNode)
  Returns the number of visible nodes prior to a node.
countRows(JCOutlinerNode)
  Returns the number of visible nodes and subnodes in a folder.
countRows(JCOutlinerNode, JCOutlinerNode)
  Returns the number of visible nodes between 2 nodes.
doubleClickAction(JCOutlinerNode, Event)
  Called when the node is double-clicked.
drawNode(JCOutlinerNode, boolean)
  Draws a single node.
drawNode(JCOutlinerNode, Graphics, boolean)
  Draws a single node.
drawNode(JCOutlinerNode, int, int, Graphics)
  Draws a node and its children.
drawShortcut(JCOutlinerNode, Graphics, int, int)
  Draws a folder's shortcut button.
drop(Event)
  Called when the user finishes the drag & drop operation.
dropOver(Event)
  Called as the user drags over the outliner.
eventInShortcut(Event, JCOutlinerNode)
  Returns true if the node is a folder and the event is within the folder's shortcut button.
eventToNode(Event)
  Gets the node in which the event occurred.
eventToNode(Event, boolean)
  Gets the node in which the event occurred.
findNode(char)
  Finds the first node whose label starts with the specified character, or null if none could be found.
findNode(JCOutlinerNode, int)
  Returns a visible node at a position.
folderChanged(JCOutlinerNode)
  Notifies the outliner that the number of a folder's children has changed.
getAllowMultipleSelections()
  Returns true if this outliner allows multiple selections.
getAutoSelect()
  Gets the AutoSelect value.
getBatched()
  Gets the Batched value.
getBounds(JCOutlinerNode, Rectangle)
  Gets the physical bounding rectangle of a node (icon and label) (ie adjusted for scrolling and insets).
getColumnAlignment(int)
  Gets a column's alignment.
getColumnAlignments()
  Gets the column alignments.
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.
getDefaultNodeStyle()
  Gets the default node style.
getDragAndDropPolicy()
  Gets the DragAndDropPolicy value.
getFocusNode()
  Returns the node which currently has focus, or null.
getHorizOrigin()
  Gets the horizontal origin.
getIcon(JCOutlinerNode)
  Gets the appropriate image for a node.
getMultiColumnData()
  Gets the component's JCMultiColumnData instance.
getNextNode(JCOutlinerNode)
  Returns the next node (not necessarily visible).
getNextState(JCOutlinerNode)
  Gets the folder's next state, or BWTEnum.NOVALUE if the node is not a folder.
getNextVisibleNode(JCOutlinerNode)
  Returns the next visible node, or null if none was found.
getNodeHeight()
  Gets the NodeHeight value.
getNodeIndent()
  Gets the NodeIndent value.
getNumColumns()
  Gets the current number of columns.
getNumNodes()
  Gets the current number of non-collapsed nodes (ie the number of open folders and their children).
getOutlinerPrinter()
  For JDK 1.1 printing, returns the JCOutlinerPrinter object
getParameters()
  Reads the parameter values from the HTML page using the component's applet.
getPreviousNode(JCOutlinerNode)
  Returns the previous node (not necessarily visible).
getPreviousVisibleNode(JCOutlinerNode)
  Returns the previous visible node, or null if none was found.
getRootNode()
  Gets the root node.
getRootVisible()
  Gets the RootVisible value.
getSelectedIndex()
  Gets the row of the first selected node, or BWTEnum.NOTFOUND if no node is selected.
getSelectedIndexes()
  Returns an array containing the selected indexes, or null if no nodes are selected.
getSelectedNode()
  Returns the currently selected node, or null.
getSelectedNodes()
  Returns an array of the currently selected nodes, or null if no nodes are selected.
getSelectedObjects()
  Returns the an array (length 1) containing the label of the selected node, or null if no node is selected.
getSpacing()
  Gets the spacing between items.
getStateList()
  Gets the current StateList.
getStyleList()
  Gets the current StyleList.
getTree()
  Gets the current node hierarchy as a string list.
getVertOrigin()
  Gets the vertical origin.
getVisibleNodes()
  Gets a list of the nodes which are currently displayed.
getVisibleRows()
  Returns the number of visible lines.
isDropTarget(JCOutlinerNode, JCOutlinerNode)
  Returns true if the node is a potential target for a drag & drop operation by the drag node.
isMultiSelectable(JCOutlinerNode, Event)
  Checks that a node can be multiply selected.
isVisible(JCOutlinerNode)
  Checks whether the node should be visible.
keyDown(Event, int)
  If the down arrow is hit, calls nextFocus.

  If the up arrow is hit, calls previousFocus.

  If RETURN is hit, calls setNodeState for the focus node.

  If space key is hit, selects focus node.

makeNodeVisible(JCOutlinerNode)
  Scrolls the display if necessary to make the node visible.
mouseDown(Event, int, int)
  Process mouse down events.

  If a node is clicked, setFocusNode and selectNode are called.

  If a node is double-clicked, calls doubleClickAction.

mouseDrag(Event, int, int)
mouseUp(Event, int, int)
multiSelectNode(JCOutlinerNode, Event)
  MultiSelect support Selects one or more nodes, and posts JCOutlinerEvents.
nextFocus(Event)
  Sets the focus on the next node after the current node which has focus.
paintComponent(Graphics)
  Draws all visible nodes.
paintOutliner(Graphics, Rectangle, JCOutlinerNode, int[], boolean)
  For JDK 1.1 printing, draws all visible nodes
postActionEvent(Event, int, JCOutlinerNode, int)
  Posts a JCOutlinerEvent if the node is a folder, or a JCActionEvent if the node is not a folder
preferredHeight()
  Calculates the height based on the node heights.
preferredWidth()
  Gets the subclass' preferred width (default: 100).
previousFocus(Event)
  Sets the focus on the previous node before the current node which has focus.
print()
  Prints the JCOutliner if running under JDK 1.1.
printColumnData(Graphics, Object, Rectangle, int[])
  For JDK 1.1 printing, draws the value as a String, Vector, JCString, or Image.
printNode(JCOutlinerNode, Rectangle, int[], Graphics, boolean, int)
  For JDK 1.1 printing, draws a single node
printNode(JCOutlinerNode, Rectangle, int[], int, int, Graphics, int, boolean)
  For JDK 1.1 printing, draws a node and its children.
printShortcut(JCOutlinerNode, Graphics, int, int, boolean)
  For JDK 1.1 printing, prints a folder's shortcut button.
processRootNode()
  Sets the node_list.
removeActionListener(JCActionListener)
  Removes the specified action listener so it no longer receives action events.
removeItemListener(JCItemListener)
  Removes the specified item listener so it no longer receives node events.
removePrintListener(JCOutlinerPrintListener)
  For JDK 1.1 printing, removes the specified print listener so it no longer receives print events.
repaint()
  Repaints the component if Batched is false.
selectNode(JCOutlinerNode)
  Selects a node.
selectNode(JCOutlinerNode, Event)
  Selects a node, and posts a JCOutlinerEvent.
setAllowMultipleSelections(boolean)
  Sets whether the outliner allows multiple selections.
setAutoSelect(boolean)
  If true (default), the node which currently has focus is also selected.
setBackground(Color)
  Sets the background color of the component.

  HTML param name/value: "Background"/Color

setBatched(boolean)
  If false (default), the component is repainted every time an item is changed.
setColumnAlignment(int, int)
  Sets a column's alignment.
setColumnAlignments(int[])
  Sets the column's alignments.
setColumnButtons(JCVector)
  If the outliner is a child of a JCOutliner, sets a header for the window with buttons with the specified labels.
setColumnLabels(JCVector)
  If the list is a child of a JCMultiColumnList, sets a header for the window with the specified labels.
setColumnLeftMargin(int, int)
  Sets the column's left margin value (pixels) (default: 2).
setColumnRightMargin(int, int)
  Sets the column's right margin value (pixels) (default: 2).

  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.

setColumnWidth(int, int)
  Sets the width of a column.
setColumnWidths(int[])
  Sets the list of column widths.
setDragAndDropPolicy(int)
  Sets whether the outliner can be used as a drag and/or drop site.
setFocusNode(JCOutlinerNode, Event)
  Sets a node to have the keyboard focus.
setFont(Font)
  Sets the font of the component.
setForeground(Color)
  Sets the foreground color of the component.

  HTML param name/value: "Foreground"/Color

setHorizOrigin(int)
  Sets the horizontal origin prior to scrolling.
setNodeHeight(int)
  Sets the height of each node (pixels).
setNodeIndent(int)
  Sets the indentation of each node relative to its parent (pixels) (default: 15).
setNodeState(JCOutlinerNode, int, boolean)
  Sets the state of a folder.
setNumColumns(int)
  Sets the current number of columns (default: 1).

  HTML param name/value: "NumColumns"/int

setRootNode(JCOutlinerNode)
  Sets the root node.
setRootVisible(boolean)
  If true (default), the root node is drawn.
setSpacing(int)
  Sets the spacing between items (default: 0).
setStateList(int[])
  Sets a list of values used for double-clicking on a folder or clicking it shortcut button.
setStyleList(JCOutlinerNodeStyle[])
  Sets the list of node styles.
setTree(String[])
  Sets the node hierarchy by parsing the string list.
setVertOrigin(int)
  Sets the vertical origin prior to scrolling.
setVisibleRows(int)
  Sets the number of visible rows.
shouldBeDrawn(JCOutlinerNode)
  Checks the node's folder to determine whether the node should be drawn.
sort(int, JCSortInterface, int)
  Sorts the open nodes in the list based on a specified column, using the String equivalents of each value.

##

FOLDER_CLOSED

     public static final int FOLDER_CLOSED

FOLDER_OPEN_NONE

     public static final int FOLDER_OPEN_NONE

FOLDER_OPEN_FOLDERS

     public static final int FOLDER_OPEN_FOLDERS

FOLDER_OPEN_ITEMS

     public static final int FOLDER_OPEN_ITEMS

FOLDER_OPEN_ALL

     public static final int FOLDER_OPEN_ALL

DRAGDROP_NONE

     public static final int DRAGDROP_NONE

DRAGDROP_TARGET

     public static final int DRAGDROP_TARGET

DRAGDROP_SOURCE

     public static final int DRAGDROP_SOURCE

DRAGDROP_ALL

     public static final int DRAGDROP_ALL

data

     protected OutlinerMultiColumnData data

  The object which maintains the multi-column data.

scrolled_window

     protected transient JCMultiColumnWindow scrolled_window

  Parent window.

node_list

     protected JCVector node_list

  List of all nodes, in drawing order.

style_list

     protected JCOutlinerNodeStyle style_list[]

default_style

     protected JCOutlinerNodeStyle default_style

shortcut_open_icon

     protected transient Image shortcut_open_icon

shortcut_close_icon

     protected transient Image shortcut_close_icon

SHORTCUT_SIZE

     protected static final int SHORTCUT_SIZE

BEGIN

     protected static final int BEGIN

END

     protected static final int END

full_node_height

     protected int full_node_height

itemListeners

     protected JCVector itemListeners

  List of JCOutlinerEvent listeners

actionListeners

     protected JCVector actionListeners

  List of JCActionEvent listeners

outlinerPrinter

     protected JCOutlinerPrinter outlinerPrinter

  Printing methods

printListeners

     protected JCVector printListeners

dataRect

     protected Rectangle dataRect

##

JCOutlinerComponent

     public JCOutlinerComponent()

  Creates an empty JCOutliner.

JCOutlinerComponent

     public JCOutlinerComponent(JCOutlinerNode root)

  Creates a new JCOutliner with the specified root node.

JCOutlinerComponent

     public JCOutlinerComponent(int rows,
                                boolean multipleSelections)

  Creates an outliner with the specified number of visible lines.

  Parameters:
    rows - the number of items to show. If set to 0, the outliner will attempt to show all its items.
    multipleSelections - if true then multiple selections are allowed.

JCOutlinerComponent

     public JCOutlinerComponent(JCOutlinerNode root,
                                Applet applet,
                                String name)

  Creates an outliner which reads parameters from the applet's HTML file.

  Parameters:
    root - the root node (may be null, and set later with setRootNode())
    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:
    setRootNode, getParameter, JCString

##

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 JCComponent

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 JCComponent
  See Also:
    toFont

processRootNode

     protected void processRootNode()

  Sets the node_list.

setColumnLabels

     public synchronized 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

setColumnButtons

     public synchronized void setColumnButtons(JCVector labels)

  If the outliner is a child of a JCOutliner, sets a header for the window with buttons with the specified labels.

  See Also:
    setColumnButtons

folderChanged

     public void folderChanged(JCOutlinerNode node)

  Notifies the outliner that the number of a folder's children has changed. This must be called only if the outliner has been made visible.

getRootNode

     public JCOutlinerNode getRootNode()

  Gets the root node.

  See Also:
    setRootNode

setRootNode

     public synchronized void setRootNode(JCOutlinerNode node)

  Sets the root node.

getTree

     public String[] getTree()

  Gets the current node hierarchy as a string list.

  See Also:
    setTree

setTree

     public synchronized void setTree(String s[])

  Sets the node hierarchy by parsing the string list. Each line in the list represents a node. Spaces or tabs at the start of each line specify the tree hierarchy. Lines with the same indentation level are children.

  Throws: IllegalArgumentException
    if the indentation levels are invalid

getRootVisible

     public boolean getRootVisible()

  Gets the RootVisible value.

  See Also:
    setRootVisible

setRootVisible

     public synchronized void setRootVisible(boolean v)

  If true (default), the root node is drawn.

getBatched

     public boolean getBatched()

  Gets the Batched value.

  See Also:
    setBatched

setBatched

     public synchronized 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.

getNodeHeight

     public int getNodeHeight()

  Gets the NodeHeight value.

  See Also:
    setNodeHeight

setNodeHeight

     public void setNodeHeight(int v)

  Sets the height of each node (pixels). If 0 (default), the height is determined using the largest font and image height in the list of node styles.

getNumNodes

     public int getNumNodes()

  Gets the current number of non-collapsed nodes (ie the number of open folders and their children).

getAllowMultipleSelections

     public boolean getAllowMultipleSelections()

  Returns true if this outliner allows multiple selections.

  See Also:
    setAllowMultipleSelections

setAllowMultipleSelections

     public void setAllowMultipleSelections(boolean v)

  Sets whether the outliner allows multiple selections. HTML param name/value: "AllowMultipleSelections"/boolean

  See Also:
    getAllowMultipleSelections

getAutoSelect

     public boolean getAutoSelect()

  Gets the AutoSelect value.

  See Also:
    setAutoSelect

setAutoSelect

     public synchronized void setAutoSelect(boolean v)

  If true (default), the node which currently has focus is also selected.

  See Also:
    setFocusNode, selectNode

getNodeIndent

     public int getNodeIndent()

  Gets the NodeIndent value.

  See Also:
    setNodeIndent

setNodeIndent

     public synchronized void setNodeIndent(int v)

  Sets the indentation of each node relative to its parent (pixels) (default: 15).

getStateList

     public int[] getStateList()

  Gets the current StateList.

  See Also:
    setStateList

setStateList

     public synchronized void setStateList(int list[])

  Sets a list of values used for double-clicking on a folder or clicking it shortcut button. If this list is changed, the outliner will be redrawn. The folder's state is cycled through the list. Valid values:

       FOLDER_CLOSED       Folder closed; no children visible
       FOLDER_OPEN_NONE    Folder open; no children visible
       FOLDER_OPEN_FOLDERS Folder open; only folder children visible
       FOLDER_OPEN_ITEMS   Folder open; only non-folder children visible
       FOLDER_OPEN_ALL     Folder open; all children visible

  Default value: { FOLDER_CLOSED, FOLDER_OPEN_ALL }

getStyleList

     public JCOutlinerNodeStyle[] getStyleList()

  Gets the current StyleList.

  See Also:
    setStyleList

setStyleList

     public synchronized void setStyleList(JCOutlinerNodeStyle list[])

  Sets the list of node styles. The list is only used for determining the node height if it has not been set.

  See Also:
    setNodeHeight

setForeground

     public synchronized void setForeground(Color c)

  Sets the foreground color of the component.

  HTML param name/value: "Foreground"/Color

  Overrides:
    setForeground in class JCComponent

setBackground

     public synchronized void setBackground(Color c)

  Sets the background color of the component.

  HTML param name/value: "Background"/Color

  Overrides:
    setBackground in class JCComponent

getDefaultNodeStyle

     public JCOutlinerNodeStyle getDefaultNodeStyle()

  Gets the default node style.

getSpacing

     public int getSpacing()

  Gets the spacing between items.

  See Also:
    setSpacing

setSpacing

     public synchronized void setSpacing(int v)

  Sets the spacing between items (default: 0). This value increases the HighlightThickness value.

  See Also:
    setHighlightThickness

getVisibleRows

     public int getVisibleRows()

  Returns the number of visible lines.

  See Also:
    setVisibleRows

setVisibleRows

     public synchronized void setVisibleRows(int v)

  Sets the number of visible rows. If set to 0 (default), the list will attempt to resize itself so that all its items are visible.

getSelectedIndex

     public synchronized int getSelectedIndex()

  Gets the row of the first selected node, or BWTEnum.NOTFOUND if no node is selected.

  See Also:
    selectNode

getSelectedIndexes

     public synchronized int[] getSelectedIndexes()

  Returns an array containing the selected indexes, or null if no nodes are selected.

getSelectedObjects

     public synchronized Object[] getSelectedObjects()

  Returns the an array (length 1) containing the label of the selected node, or null if no node is selected.

getSelectedNode

     public synchronized JCOutlinerNode getSelectedNode()

  Returns the currently selected node, or null.

getSelectedNodes

     public synchronized JCOutlinerNode[] getSelectedNodes()

  Returns an array of the currently selected nodes, or null if no nodes are selected.

selectNode

     public void selectNode(JCOutlinerNode node,
                            Event ev)

  Selects a node, and posts a JCOutlinerEvent.

  Parameters:
    node - if null, the currently selected node is deselected
    ev - event which caused the selection
  See Also:
    addItemListener

selectNode

     protected void selectNode(JCOutlinerNode node)

  Selects a node.

  Parameters:
    node - if null, the currently selected node is deselected

isMultiSelectable

     protected boolean isMultiSelectable(JCOutlinerNode node,
                                         Event ev)

  Checks that a node can be multiply selected.

  Parameters:
    ev - event which caused the selection
  Returns:
    false if node is null, Ctrl or Shift key was not pressed, there are currently no selected nodes, or if the node does not have the same parent as the first selected node

multiSelectNode

     public synchronized void multiSelectNode(JCOutlinerNode node,
                                              Event ev)

  MultiSelect support Selects one or more nodes, and posts JCOutlinerEvents.

  Parameters:
    node - if null, the currently selected node is deselected
    ev - event which caused the selection
  See Also:
    addItemListener

getFocusNode

     public JCOutlinerNode getFocusNode()

  Returns the node which currently has focus, or null.

setFocusNode

     public void setFocusNode(JCOutlinerNode node,
                              Event ev)

  Sets a node to have the keyboard focus.

  Parameters:
    node - if null, no the current focus node is unchanged
    ev - event which caused the focus change

getVisibleNodes

     public JCVector getVisibleNodes()

  Gets a list of the nodes which are currently displayed.

findNode

     public JCOutlinerNode findNode(char c)

  Finds the first node whose label starts with the specified character, or null if none could be found.

calculateNodeHeight

     public int calculateNodeHeight(JCOutlinerNode node)

  Calculates the height of a node (by looking at the node's style).

calculateStyleHeight

     protected int calculateStyleHeight(JCOutlinerNodeStyle style)

  Calculates the height of a node given its style characteristics.

preferredHeight

     protected int preferredHeight()

  Calculates the height based on the node heights.

  Overrides:
    preferredHeight in class JCComponent

preferredWidth

     protected int preferredWidth()

  Gets the subclass' preferred width (default: 100).

  Overrides:
    preferredWidth in class JCComponent

repaint

     public synchronized void repaint()

  Repaints the component if Batched is false.

  Overrides:
    repaint in class JCComponent
  See Also:
    setBatched

addNotify

     public void addNotify()

  Creates icons and processes nodes.

  Overrides:
    addNotify in class JCComponent

paintComponent

     protected void paintComponent(Graphics gc)

  Draws all visible nodes.

  Overrides:
    paintComponent in class JCComponent

setNodeState

     public boolean setNodeState(JCOutlinerNode node,
                                 int state,
                                 boolean notify)

  Sets the state of a folder.

  Parameters:
    node - if not a folder, no action is taken
    state - one of:

         FOLDER_CLOSED       Folder closed; no children visible
         FOLDER_OPEN_NONE    Folder open; no children visible
         FOLDER_OPEN_FOLDERS Folder open; only folder children visible
         FOLDER_OPEN_ITEMS   Folder open; only non-folder children visible
         FOLDER_OPEN_ALL     Folder open; all children visible

    notify - if true, a JCOutlinerEvent is posted for the node
  Returns:
    false if the app disallowed the state change
  Throws: IllegalArgumentException
    If the value is invalid
  See Also:
    addActionListener, addItemListener

makeNodeVisible

     public boolean makeNodeVisible(JCOutlinerNode node)

  Scrolls the display if necessary to make the node visible.

  Returns:
    false if the node could not be made visible due to its parent's state

checkState

     protected boolean checkState(int state)

  Checks that a state is valid.

getNextState

     protected int getNextState(JCOutlinerNode folder)

  Gets the folder's next state, or BWTEnum.NOVALUE if the node is not a folder.

getNextNode

     public JCOutlinerNode getNextNode(JCOutlinerNode node)

  Returns the next node (not necessarily visible).

  See Also:
    getNextVisibleNode

getNextVisibleNode

     public JCOutlinerNode getNextVisibleNode(JCOutlinerNode node)

  Returns the next visible node, or null if none was found.

getPreviousNode

     public JCOutlinerNode getPreviousNode(JCOutlinerNode node)

  Returns the previous node (not necessarily visible).

  See Also:
    getPreviousVisibleNode

getPreviousVisibleNode

     public JCOutlinerNode getPreviousVisibleNode(JCOutlinerNode node)

  Returns the previous visible node, or null if none was found.

nextFocus

     protected boolean nextFocus(Event ev)

  Sets the focus on the next node after the current node which has focus.

previousFocus

     protected boolean previousFocus(Event ev)

  Sets the focus on the previous node before the current node which has focus.

addItemListener

     public void addItemListener(JCItemListener l)

  Adds the specified item listener to receive node events. If the listener implements JCOutlinerListener (an JCItemListener subclass), it will be passed JCOutlinerEvents.

  See Also:
    JCItemEvent, JCOutlinerEvent, JCOutlinerListener

removeItemListener

     public void removeItemListener(JCItemListener l)

  Removes the specified item listener so it no longer receives node events.

addActionListener

     public void addActionListener(JCActionListener l)

  Adds the specified action listener to receive action events. Action events occur when a node is double-clicked.

  See Also:
    JCActionEvent

removeActionListener

     public void removeActionListener(JCActionListener l)

  Removes the specified action listener so it no longer receives action events.

  See Also:
    addActionListener

postActionEvent

     protected JCOutlinerEvent postActionEvent(Event ev,
                                               int stage,
                                               JCOutlinerNode node,
                                               int new_state)

  Posts a JCOutlinerEvent if the node is a folder, or a JCActionEvent if the node is not a folder

  Parameters:
    stage - BEGIN or END
  Returns:
    the posted event, or null if no itemListeners/actionListeners have been registered
  See Also:
    addActionListener, addItemListener

doubleClickAction

     protected boolean doubleClickAction(JCOutlinerNode node,
                                         Event ev)

  Called when the node is double-clicked.

keyDown

     public boolean keyDown(Event ev,
                            int key)

  If the down arrow is hit, calls nextFocus.

  If the up arrow is hit, calls previousFocus.

  If RETURN is hit, calls setNodeState for the focus node.

  If space key is hit, selects focus node.

  Overrides:
    keyDown in class JCComponent
  See Also:
    nextFocus, previousFocus, setNodeState

eventToNode

     public JCOutlinerNode eventToNode(Event ev)

  Gets the node in which the event occurred.

eventToNode

     public JCOutlinerNode eventToNode(Event ev,
                                       boolean inside)

  Gets the node in which the event occurred.

  Parameters:
    inside - if true, the event must be inside the node

eventInShortcut

     public boolean eventInShortcut(Event ev,
                                    JCOutlinerNode node)

  Returns true if the node is a folder and the event is within the folder's shortcut button.

mouseDown

     public boolean mouseDown(Event ev,
                              int x,
                              int y)

  Process mouse down events.

  If a node is clicked, setFocusNode and selectNode are called.

  If a node is double-clicked, calls doubleClickAction. If a node is a shortcut button is clicked, calls setNodeState.

  Overrides:
    mouseDown in class JCComponent
  See Also:
    setFocusNode, selectNode, doubleClickAction, setNodeState

getDragAndDropPolicy

     public int getDragAndDropPolicy()

  Gets the DragAndDropPolicy value.

  See Also:
    setDragAndDropPolicy

setDragAndDropPolicy

     public void setDragAndDropPolicy(int v)

  Sets whether the outliner can be used as a drag and/or drop site.

  Parameters:
    v - DRAGDROP_NONE (default), DRAGDROP_TARGET, DRAGDROP_SOURCE, DRAGDROP_ALL

isDropTarget

     protected boolean isDropTarget(JCOutlinerNode drag_node,
                                    JCOutlinerNode node)

  Returns true if the node is a potential target for a drag & drop operation by the drag node. It returns false if the nodes are equal, or if the drag_node is the drop node's parent.

mouseDrag

     public boolean mouseDrag(Event ev,
                              int x,
                              int y)

  Overrides:
    mouseDrag in class Component

dropOver

     public boolean dropOver(Event ev)

  Called as the user drags over the outliner.

  Returns:
    true if the drag was handled

mouseUp

     public boolean mouseUp(Event ev,
                            int x,
                            int y)

  Overrides:
    mouseUp in class Component

drop

     public boolean drop(Event ev)

  Called when the user finishes the drag & drop operation.

  Returns:
    true if the drop was handled

getBounds

     public Rectangle getBounds(JCOutlinerNode node,
                                Rectangle rect)

  Gets the physical bounding rectangle of a node (icon and label) (ie adjusted for scrolling and insets).

  Parameters:
    rect - if not null, its members are set
  Returns:
    null if rect is null, otherwise the bounding rectangle

getIcon

     protected Image getIcon(JCOutlinerNode node)

  Gets the appropriate image for a node.

shouldBeDrawn

     protected boolean shouldBeDrawn(JCOutlinerNode node)

  Checks the node's folder to determine whether the node should be drawn.

isVisible

     protected boolean isVisible(JCOutlinerNode node)

  Checks whether the node should be visible.

drawNode

     protected boolean drawNode(JCOutlinerNode node,
                                boolean clear)

  Draws a single node.

  Parameters:
    clear - if true, the node's rectangle is cleared to the background color
  Returns:
    false if the node is outside the drawing area

drawNode

     protected boolean drawNode(JCOutlinerNode node,
                                Graphics gc,
                                boolean clear)

  Draws a single node.

  Parameters:
    clear - if true, the node's rectangle is cleared to the background color
  Returns:
    false if the node is outside the drawing area

drawNode

     protected int drawNode(JCOutlinerNode node,
                            int indent,
                            int row,
                            Graphics gc)

  Draws a node and its children.

  Parameters:
    indent - indentation level at which to draw node
    row - row at which to draw node
  Returns:
    the number of rows this node took to display

drawShortcut

     protected void drawShortcut(JCOutlinerNode node,
                                 Graphics gc,
                                 int x,
                                 int y)

  Draws a folder's shortcut button.

countRows

     protected int countRows(JCOutlinerNode node)

  Returns the number of visible nodes and subnodes in a folder.

countChildren

     protected int countChildren(JCOutlinerNode node)

  Returns the number of nodes and subnodes in a folder.

countPreviousRows

     protected int countPreviousRows(JCOutlinerNode node)

  Returns the number of visible nodes prior to a node.

countRows

     protected int countRows(JCOutlinerNode from,
                             JCOutlinerNode to)

  Returns the number of visible nodes between 2 nodes.

countAllNodes

     protected int countAllNodes(JCOutlinerNode node,
                                 JCVector list)

  Returns the number of nodes and subnodes in a folder, regardless of visibility

  Parameters:
    list - if not null, the node is added to it

findNode

     protected JCOutlinerNode findNode(JCOutlinerNode node,
                                       int row)

  Returns a visible node at a position. If not present, its visible children are checked.

compare

     public boolean compare(Object o1,
                            Object o2)

  JCSortInterface comparison method. Compares nodes based on their labels.

sort

     public void sort(int column,
                      JCSortInterface sort_if,
                      int direction)

  Sorts the open nodes 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

calcWidth

     protected int calcWidth(JCOutlinerNode node,
                             int col)

  Calculates the width of a node's column, excluding the left and right margins.

calcWidth

     public int calcWidth(int col)

  Calculates the width of a column for all nodes.

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.

  This value may be set from an HTML file using a PARAM tag with a "ColumnWidths" name and a 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.

getNumColumns

     public int getNumColumns()

  Gets the current number of columns.

setNumColumns

     public void setNumColumns(int v)

  Sets the current number of columns (default: 1).

  HTML param name/value: "NumColumns"/int

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. The first column's alignment (column 0) cannot be set.

  Parameters:
    alignment - one of: BWTEnum.TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT (default), MIDDLECENTER, MIDDLERIGHT, BOTTOMLEFT, BOTTOMCENTER and BOTTOMRIGHT

setColumnAlignments

     public void setColumnAlignments(int align[])

  Sets the column's alignments. The first column's alignment (column 0) cannot be set.

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

  Parameters:
    align - one of: BWTEnum.TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT (default), 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: 2). 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.

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: 2).

  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.

getMultiColumnData

     public JCMultiColumnData getMultiColumnData()

  Gets the component's JCMultiColumnData instance.

getHorizOrigin

     public int getHorizOrigin()

  Gets the horizontal origin.

setHorizOrigin

     public void setHorizOrigin(int v)

  Sets the horizontal origin prior to scrolling.

getVertOrigin

     public int getVertOrigin()

  Gets the vertical origin.

setVertOrigin

     public void setVertOrigin(int v)

  Sets the vertical origin prior to scrolling.

getOutlinerPrinter

     public JCOutlinerPrinter getOutlinerPrinter()

  For JDK 1.1 printing, returns the JCOutlinerPrinter object

paintOutliner

     protected void paintOutliner(Graphics gc,
                                  Rectangle draw_rect,
                                  JCOutlinerNode node,
                                  int paintColumns[],
                                  boolean print_all_nodes)

  For JDK 1.1 printing, draws all visible nodes

printNode

     protected int printNode(JCOutlinerNode node,
                             Rectangle rect,
                             int paintColumns[],
                             int indent,
                             int row,
                             Graphics gc,
                             int start_row,
                             boolean print_all_nodes)

  For JDK 1.1 printing, draws a node and its children.

  Parameters:
    indent - indentation level at which to draw node
    row - row at which to draw node
  Returns:
    the number of rows this node took to display

printNode

     protected boolean printNode(JCOutlinerNode node,
                                 Rectangle rect,
                                 int paintColumns[],
                                 Graphics gc,
                                 boolean clear,
                                 int start_row)

  For JDK 1.1 printing, draws a single node

  Parameters:
    clear - if true, the node's rectangle is cleared to the background color
  Returns:
    false if the node is outside the drawing area

printColumnData

     protected void printColumnData(Graphics gc,
                                    Object value,
                                    Rectangle draw_rect,
                                    int paintColumns[])

  For JDK 1.1 printing, draws the value as a String, Vector, JCString, or Image.

  Parameters:
    draw_rect - rectangle within which to draw the value; if null, it will be calculated

printShortcut

     protected void printShortcut(JCOutlinerNode node,
                                  Graphics gc,
                                  int x,
                                  int y,
                                  boolean print_all_nodes)

  For JDK 1.1 printing, prints a folder's shortcut button.

print

     public void print()

  Prints the JCOutliner if running under JDK 1.1.

addPrintListener

     public void addPrintListener(JCOutlinerPrintListener l)

  For JDK 1.1 printing, adds the specified print listener to receive print events. Print events occur when a header or footer is printed.

  See Also:
    JCOutlinerPrintEvent

removePrintListener

     public void removePrintListener(JCOutlinerPrintListener l)

  For JDK 1.1 printing, removes the specified print listener so it no longer receives print events.

  See Also:
    addPrintListener

    All Packages  Class Hierarchy  This Package  Previous  Next  Index