borland Packages Class Hierarchy jbcl.view Package Index
java.lang.Object +----java.awt.Component +----java.awt.Container +----com.sun.java.swing.JComponent +----com.sun.java.swing.JScrollPane +----borland.jbcl.view.TreeView +----borland.jbcl.control.TreeControl
Variables Constructors Properties Methods Event Listeners
Implements GraphView, Accessible, ScrollPaneConstants, ImageObserver, MenuContainer, Serializable
TreeView provides the behavior required for controls that display data in a tree structure such as a TreeControl.
The style property lets you select from a list of platform-specific display styles. The value of the expandByDefault property determines whether the tree is expanded when it first appears. hIndent determines the number of pixels a child node is indented beneath a parent node. Properties such as hIndent, itemMargins, itemOffset, and vgap, leftMargin, and topMargin determine the spacing used among elements of the tree hierarchy and the box in which it is displayed. snapOrigin and hSnap affect the scrolling behavior of the tree. readOnly determines whether a node can be edited. editInPlace determines whether the user can edit the node within the tree, and autoEdit determines if typing on a selected node begins the editing of that node.
public static final int STYLE_ARROWS = 0x0002A constant that specifies the style of the icons the user uses to expand and collapse the tree as inverted triangles or down arrows.
public static final int STYLE_PLUSES = 0x0001A constant that specifies the style of the icons the user uses to expand and collapse the tree as minus and plus signs.
public TreeView()Constructs a TreeView with default property values.
public int getAlignment() public void setAlignment(int alignment)Determines the alignment of the tree control: left, center, or right. alignment is not available at design time.
public boolean isAutoEdit() public void setAutoEdit(boolean autoEdit)Determines whether editing begins automatically whenever the user selects a node and begins typing. If autoEdit is true, editing begins as soon as a key is typed.
public void setBackground(java.awt.Color color)Sets the background color of the tree control.
public boolean isBatchMode() public void setBatchMode(boolean batchMode)The batchMode property enables/disables all painting in the tree. This is used for programmatic mass updates to the tree's model, selection, and so on but does not trigger repaint messages.
public Dimension getBoxSize() public void setBoxSize(java.awt.Dimension boxSize)Determines the size of the box in which the tree is drawn.
public Component getCoreComponent()Returns the contained TreeCore (non-public) class instance as a Component.
public boolean isDataToolTip() public void setDataToolTip(boolean dataToolTip)The dataToolTip property enables/disables the automatic tooltip mechanism to display the contents of the model (as text) in a tooltip window when the mouse is floating over the field. By default, this property is false. If dataToolTip is set to true, the text stored in the toolTipText property is discarded.
public boolean isDragSubfocus() public void setDragSubfocus(boolean drag)The dragSubfocus property enables or disables dragging of the subfocus cell when dragging the mouse pointer over the tree (with the mouse button pressed). By default, this property is true.
public boolean isEditing()The editing property (read-only) returns true if an item is currently being edited in the tree.
public boolean isEditInPlace() public void setEditInPlace(boolean editInPlace)The editInPlace property enables or disables item editing in the tree. By default, this property is true, meaning that a user can edit the value. If set to false, the field data cannot by modified by the user; the data can only be changed through programmatic access to the tree's model.
public ItemEditor getEditor()Returns the item editor being used or null if the tree is not being edited.
public void setEnabled(boolean enabled)Determines whether the tree view is enabled so that it can be used. If enabled is true, the view is enabled. If it is false, the view cannot become active.
public boolean isExpandByDefault() public void setExpandByDefault(boolean expand)The expandByDefault property specifies whether the tree component built with this view displays with all nodes expanded when it is first initialized. The default value is false.
public void setFont(java.awt.Font font)The font property specifies the font to use to show text items in the tree.
public void setForeground(java.awt.Color color)The foreground property specifies the color of the text, or other item, in the tree.
public boolean isGrowEditor() public void setGrowEditor(boolean growEditor)The growEditor property enables/disables the automatic sizing of a cell's item editor. In some look and feel settings, the item editors must grow vertically to properly edit the data. By default, this property is set to true.
public int getHIndent() public void setHIndent(int hIndent)Determines the interval in pixels a child node is indented beneath a parent node.
public boolean isHSnap() public void setHSnap(boolean hSnap)Determines whether the tree control scrolls automatically when the subfocus moves to an item that is originally out of view. If hSnap is true, the tree control scrolls automatically.
public Insets getItemMargins() public void setItemMargins(java.awt.Insets margins)The itemMargins property specifies the amount of space between the text and the edge of the field.
public int getItemOffset() public void setItemOffset(int itemOffset)Determines the amount of space in pixels between the node
public int getLeftMargin() public void setLeftMargin(int leftMargin)Determines the distance in pixels from the edge of the tree control hierarchy to the left edge of the box in which the tree control displays.
public GraphModel getModel() public void setModel(borland.jbcl.model.GraphModel model)Determines the data model for the component. TreeView requires a GraphModel, such as LinkedTreeContainer.
public boolean isOpaque() public void setOpaque(boolean opaque)The opaque property controls the whether objects the grid covers show through. If opaque is true, the grid is opaque and all objects it covers are not visible. The default value is true. If a texture value is set, the opaque property is automatically set to true.
public boolean isPostOnEndEdit() public void setPostOnEndEdit(boolean post)The postOnEndEdit property specifies whether a pending edit on the data provided by the model should be saved or discarded when the edit is ended. This can happen, for example, when calling setModel() when an edit is in progress. When postOnEndEdit is true, changes are saved. When false, changes are discarded. The value of postOnEndEdit defaults to true.
public Dimension getPreferredSize()The preferredSize property specifies the size that you would prefer layout managers to use for this field.
public boolean isReadOnly() public void setReadOnly(boolean readOnly)Determines whether the nodes of the tree can be edited by the user.
public WritableGraphSelection getSelection() public void setSelection(borland.jbcl.model.WritableGraphSelection selection)Holds an array of the selected node or nodes.
public boolean isShowFocus() public void setShowFocus(boolean show)The showFocus property enables or disables the painting of the focus rectangle on the items in the tree. Specifically, the showFocus property turns on or off the FOCUSED bit in the state information that is passed to the ItemPainter when the tree is painted. If an ItemPainter ignores the FOCUSED bit, this property will have no effect. By default, showFocus is true.
public boolean isShowRollover() public void setShowRollover(boolean showRollover)This property enables or disables the repainting of the rollover item. The rollover item is the item that currently has the mouse floating over it. If an ItemPainter plugged into the tree ignores the ROLLOVER bit, this property will have no effect. By default, showRollover is false.
public boolean isSnapOrigin() public void setSnapOrigin(boolean snapOrigin)The snapOrigin property controls whether or not the tree will automatically snap the scroll position to align the top item with the top edge of the tree. If set to false, the tree will not snap the scroll position, and it will scroll smoothly with changes to the subfocus item. By default, this property is true.
public int getStyle() public void setStyle(int style)Whether to show collapsed parent nodes as pluses or arrows (triangles).
public GraphLocation getSubfocus() public void setSubfocus(borland.jbcl.model.GraphLocation subfocus)The subfocus property defines the current node (defined by a GraphLocation) in the tree. This is the node that is receiving keyboard input.
public Image getTexture() public void setTexture(java.awt.Image texture)When an Image is specified as a texture value, the Image is tiled repeatedly as the background of the tree hierarchy so that the it appears the tree background has a texture.
public String getToolTipText() public void setToolTipText(java.lang.String text)Determines the text that appears in the tool tip window. Specify the text as the value of the text parameter.
public int getTopMargin() public void setTopMargin(int topMargin)Determines the distance in pixels the top of the tree hierarchy is from the top of the box in which the tree hierarchy appears.
public int getVgap() public void setVgap(int vgap)Determines the vertical distance in pixels between one item in the tree hierarchy and the next item.
public GraphViewManager getViewManager() public void setViewManager(borland.jbcl.model.GraphViewManager viewManager)Determines the view manager for a component built with this view.
public WritableGraphModel getWriteModel()A read-only property that returns the writable model object attached to this tree component, if the model object exists. If no writable model exists, this method returns null.
public void addNotify()addNotify() opens the DataSet that populates the tree view when the tree is displayed if the DataSet's autoOpen property is set. It initializes the tree if it is not already initialized.
Overrides: java.awt.Container.addNotify()
public void checkParentWindow()
public void collapse(borland.jbcl.model.GraphLocation location)Collapses from view the children of the node specified by location.
public void collapseAll(borland.jbcl.model.GraphLocation location)Collapse a particular node and all of its children.
Parameters:
protected GraphModel createDefaultModel()Creates a BasicTreeContainer.
protected WritableGraphSelection createDefaultSelection()Creates a SingleGraphSelection.
protected GraphViewManager createDefaultViewManager()Creates a BasicViewManager.
public void expand(borland.jbcl.model.GraphLocation location)Expands into view the children of the node specified by location.
public void expandAll(borland.jbcl.model.GraphLocation location)Expand a particular node and all of its children.
Parameters:
public Rectangle getNodeRect(borland.jbcl.model.GraphLocation node)Returns the rectangle where the node is to be drawn.
public boolean hasFocus()
Overrides: com.sun.java.swing.JComponent.hasFocus() Determines whether the tree has the focus. If it returns true, the grid has the focus.
public GraphLocation hitTest(int xPos, int yPos)Returns the address (GraphLocation) of the node at the coordinates specified. Coordinates are relative to the entire scrollable region inside of the TreeView.
public boolean isExpanded(borland.jbcl.model.GraphLocation location)Check if a particular node is expanded. This method returns true if the location is expanded, false if not.
Parameters:
public void refresh()Repaints the tree hierarchy.
public void repaintNode(borland.jbcl.model.GraphLocation location)Repaints the specified node.
public void repaintNodes()Repaints the tree hierarchy only if the batchMode property is false.
public void requestFocus()Requests the input focus. If the request succeeds, a FocusGained event is delivered.
Overrides: java.awt.Component.requestFocus()
public void startEdit(borland.jbcl.model.GraphLocation node)Starts an edit session at 'node'. If editInPlace is false or if readOnly is true, this method is a no-op.
Parameters:
public void toggleExpanded(borland.jbcl.model.GraphLocation location)Toggle the state of a particular node.
Parameters:
public void updateUI()
Overrides: com.sun.java.swing.JScrollPane.updateUI() Updates the user interface of the view in preparation for painting.
public void addActionListener(java.awt.event.ActionListener l) public void removeActionListener(java.awt.event.ActionListener l)
public void addAncestorListener(com.sun.java.swing.event.AncestorListener ) public void removeAncestorListener(com.sun.java.swing.event.AncestorListener )
public synchronized void addComponentListener(java.awt.event.ComponentListener ) public synchronized void removeComponentListener(java.awt.event.ComponentListener )
public synchronized void addContainerListener(java.awt.event.ContainerListener ) public void removeContainerListener(java.awt.event.ContainerListener )
public void addCustomItemListener(borland.jbcl.view.CustomItemListener l) public void removeCustomItemListener(borland.jbcl.view.CustomItemListener l)
public void addFocusListener(java.awt.event.FocusListener l) public void removeFocusListener(java.awt.event.FocusListener l)
public void addKeyListener(java.awt.event.KeyListener l) public void removeKeyListener(java.awt.event.KeyListener l)
public void addModelListener(borland.jbcl.model.GraphModelListener listener) public void removeModelListener(borland.jbcl.model.GraphModelListener listener)
public void addMouseListener(java.awt.event.MouseListener l) public void removeMouseListener(java.awt.event.MouseListener l)
public void addMouseMotionListener(java.awt.event.MouseMotionListener l) public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )
public void addSelectionListener(borland.jbcl.model.GraphSelectionListener listener) public void removeSelectionListener(borland.jbcl.model.GraphSelectionListener listener)
public void addSubfocusListener(borland.jbcl.model.GraphSubfocusListener l) public void removeSubfocusListener(borland.jbcl.model.GraphSubfocusListener l)
public void addTreeListener(borland.jbcl.view.TreeListener l) public void removeTreeListener(borland.jbcl.view.TreeListener l)
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener ) public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )