borland Packages Class Hierarchy jbcl.view Package Index
java.lang.Object +----java.awt.Component +----java.awt.Container +----com.sun.java.swing.JComponent +----borland.jbcl.view.BeanPanel +----borland.jbcl.view.TabsetView +----borland.jbcl.control.TabsetControl +----borland.jbcl.control.TabsetPanel
Variables Constructors Properties Methods Event Listeners
Implements ItemPaintSite, VectorModelListener, VectorSelectionListener, VectorView, ImageObserver, MenuContainer, Serializable, EventListener
The TabsetView component is a view element for developing new composite components that simulate a set of mutually exclusive tabs, like tabs in a notebook. You can use it to create tabbed, multi-page dialog boxes, for example. It requires a VectorModel data model and a VectorViewManager view manager.
The labels property is an array of strings that contains the labels that appear on the tabs. The tabs can appear on the top of the view or the bottom, depending on the value of the tabsOnTop property.
To add a new tab to the view, call one of the addTab() methods; one of them appends the tab to the row of tabs, and the other inserts the tab into a specified position. To remove a tab, call removeTab(). Change a specified tab with the renameTab() method.
To identify the currently selected tab or to make a tab the selected tab, use either the selectedTab property, which identifies the tab by its label, or the selectedIndex, which identifies the tab by its position in the row of tabs. To obtain the label of a specific tab, call getLabel(). To set the label of a tab, call setLabel(). The label can be any type of Object, so you can put a graphic on a label, for example.
TabsetView has several properties that affect its appearance, such as alignment, which aligns the label, itemMargins, which specifics the margins around the labels, and thickBorder, which specifies the type of border that appears around the view.
If there are more tabs than can be displayed at once in the view, two scroll buttons appear so the user can scroll to see the hidden tabs. The scrollRight() and scrollLeft() methods scroll the tabs programmatically.
To paint the view call paintComponent(). To paint a single tab only, use the repaintTab() method.
protected transient ItemPainter defaultPainter
protected transient VectorModel model
protected transient WritableVectorSelection selection
protected transient VectorViewManager viewManager
protected transient WritableVectorModel writeModel
public TabsetView()Creates a TabsetView object with no tabs.
public int getAlignment() public void setAlignment(int align)Determines the alignment of the text in the tabs. To specify an alignment, use one of the Alignment constants.
Parameters:
public boolean isClientBordered() public void setClientBordered(boolean bordered)When true, a raised border is drawn around the (non-tab) client area. The default value is false.
Parameters:
public void setEnabled(boolean enabled)Determines whether the tabset view is enabled. If the enabled parameter is true, the enabled property is true and the tabset view can be used.
public boolean isFocusAware() public void setFocusAware(boolean focusAware)Determines whether the view can receive the focus.
public void setFont(java.awt.Font font)
public Insets getItemMargins() public void setItemMargins(java.awt.Insets margins)Determines the margins around the text in the tabs.
Parameters:
public String[] getLabels() public void setLabels(java.lang.String[] labels)Determines the text of the tabs, which are called the labels. The labels property is an array of strings, so you can set all the labels of the tabs at once. Each label string must be unique.
Parameters:
public VectorModel getModel() public void setModel(borland.jbcl.model.VectorModel vm)Specifies the data model object that provides items for the component. The TabsetView component requires a vector model. This property value must be set.
Parameters:
public Dimension getPreferredSize()Returns the preferred size of the TabsetView.
public boolean isReadOnly() public void setReadOnly(boolean ro)Determines whether the user may change the data displayed in the component at runtime. The readOnly property also returns true if the model is not writable.
Parameters:
public int getSelectedIndex() public void setSelectedIndex(int index)Determines the currently selected tab. The first tab is tab number zero. If no tab is selected, getSelectedIndex returns -1.
Parameters:
public String getSelectedTab() public void setSelectedTab(java.lang.Object item)Determines the selected tab. If no tab is selected, setSelectedTab() returns null.
Parameters:
public WritableVectorSelection getSelection() public void setSelection(borland.jbcl.model.WritableVectorSelection vs)Determines the selection object that holds the currently selected tab.
Parameters:
public boolean isShowRollover() public void setShowRollover(boolean showRollover)The showRollover property enables/disables the repainting of the rollover item. The rollover item is the item that currently has the mouse cursor over it. If an item painter plugged into the tabset ignores the ROLLOVER bit, this property has no effect. By default, showRollover is false.
public Component getSiteComponent()The component hosting the tabset view.
public int getSubfocus() public void setSubfocus(int subfocus)Determines the subfocus within the TabsetView. The subfocus will always be the same as the selected tab.
Parameters:
public boolean isTabsOnTop() public void setTabsOnTop(boolean tabsOnTop)Determines whether the tabs appear on the top or bottom of the view.
Parameters:
public boolean isThickBorder() public void setThickBorder(boolean thickBorder)Determines whether a raised border is drawn around the (non-tab) client area.
Parameters:
public boolean isTransparent()Determines whether the background of the view is transparent or opaque. If transparent is true, other objects behind the tabset show through.
public VectorViewManager getViewManager() public void setViewManager(borland.jbcl.model.VectorViewManager viewManager)Determines the view manager object that handles viewer and editor selection for this component. This property must be set.
public WritableVectorModel getWriteModel()Returns the model for the TabsetView.
public void addTab(int aheadOf, java.lang.Object item)Adds a tab to the TabsetView in a specified position.
Parameters:
public void addTab(java.lang.Object item)Adds a tab after the last tab in the row of tabs.
Parameters:
protected void adjustScrollbar()Determines whether the view needs to scroll, and if so, which tabs are visible.
public void doLayout()Lays out the component and calls adjustScrollbar().
Overrides: java.awt.Container.doLayout()
public String getLabel(int index)Returns the label of the tab at the specified index. The first tab is tab number zero. getLabel() returns null if the specified index is out of range.
Parameters:
public int hitTest(int x, int y)Determines where the mouse was clicked within the view.
public Insets insets()Returns the Insets object of the view, taking into account the alignment of the tabs.
Overrides: java.awt.Container.insets()
public void paintComponent(java.awt.Graphics g)Paints or repaints the TabsetView component.
Parameters:
Overrides: borland.jbcl.view.BeanPanel.paintComponent(java.awt.Graphics)
protected boolean preProcessSubfocusEvent(borland.jbcl.model.VectorSubfocusEvent e)Determines if any listeners of the VectorSubfocusEvent will veto the event.
Parameters:
protected void processFocusEvent(java.awt.event.FocusEvent e)Calls super.processFocusEvent, then repaints the selected tab.
Parameters:
Overrides: borland.jbcl.view.BeanPanel.processFocusEvent(FocusEvent)
protected void processKeyPressed(java.awt.event.KeyEvent e)Handles the following keys when they are pressed:
Home | Selects the first tab |
Left | Selects the tab to the left |
Right | Selects the tab to the right of the currently selected tab |
End | Seleects the last tab |
Parameters:
Overrides: borland.jbcl.view.BeanPanel.processKeyPressed(KeyEvent)
protected void processMouseExited(java.awt.event.MouseEvent e)
Overrides: borland.jbcl.view.BeanPanel.processMouseExited(java.awt.event.MouseEvent)
protected void processMouseMoved(java.awt.event.MouseEvent e)
Overrides: borland.jbcl.view.BeanPanel.processMouseMoved(java.awt.event.MouseEvent)
protected void processMousePressed(java.awt.event.MouseEvent e)Selects a tab if the mouse clicks it.
Parameters:
Overrides: borland.jbcl.view.BeanPanel.processMousePressed(MouseEvent)
protected void processSubfocusEvent(borland.jbcl.model.VectorSubfocusEvent e)
public void removeTab(java.lang.Object item)Removes the specified tab from the tab view.
Parameters:
public void renameTab(java.lang.String oldName, java.lang.String newName)
Changes the label of the tab with the oldName to the newName.
Parameters:
public void repaintTab(int index)Repaints the specified tab.
Parameters:
protected boolean scrollCheck(int x, int y)Checks to see if the scrollbar needs scrolling.
Parameters:
protected void scrollLeft()Scrolls the scrollbar to the left. scrollLeft() calls adjustScrollbar()
protected void scrollRight()Scrolls the scrollbar to the right. scrollRight() calls adjustScrollbar().
protected void selectTab(int index)Selects a specified tab.
Parameters:
protected void setBorderHeight(int height)Sets the height of the border.
Parameters:
public void setLabel(int index, java.lang.Object item)Sets the label of a specified tab.
Parameters:
protected void updateTabInfo()Updates the tabInfo array that contains the tab information for each tab. Tab information includes such things as the item that labels the tab, the width of the tab, the height of the item, and so on. Each tab on the view has a corresponding TabInfo object in the tabInfo array.
public synchronized void addActionListener(java.awt.event.ActionListener l) public synchronized 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 synchronized void addFocusListener(java.awt.event.FocusListener ) public synchronized void removeFocusListener(java.awt.event.FocusListener )
public synchronized void addKeyListener(java.awt.event.KeyListener ) public synchronized void removeKeyListener(java.awt.event.KeyListener )
public void addModelListener(borland.jbcl.model.VectorModelListener l) public void removeModelListener(borland.jbcl.model.VectorModelListener l)
public synchronized void addMouseListener(java.awt.event.MouseListener ) public synchronized void removeMouseListener(java.awt.event.MouseListener )
public synchronized void addMouseMotionListener(java.awt.event.MouseMotionListener ) public synchronized void removeMouseMotionListener(java.awt.event.MouseMotionListener )
public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener ) public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener )
public void addSelectionListener(borland.jbcl.model.VectorSelectionListener l) public void removeSelectionListener(borland.jbcl.model.VectorSelectionListener l)
public void addSubfocusListener(borland.jbcl.model.VectorSubfocusListener l) public void removeSubfocusListener(borland.jbcl.model.VectorSubfocusListener l)
public synchronized void addVetoableChangeListener(java.beans.VetoableChangeListener ) public synchronized void removeVetoableChangeListener(java.beans.VetoableChangeListener )