站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

BasicScrollingTabDisplayerUI (Tab Control) - NetBeans API Javadoc (Current Development Version)

org.netbeans.swing.tabcontrol 1.8

org.netbeans.swing.tabcontrol.plaf
Class BasicScrollingTabDisplayerUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by org.netbeans.swing.tabcontrol.TabDisplayerUI
          extended by org.netbeans.swing.tabcontrol.plaf.AbstractTabDisplayerUI
              extended by org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI
                  extended by org.netbeans.swing.tabcontrol.plaf.BasicScrollingTabDisplayerUI
Direct Known Subclasses:
AquaEditorTabDisplayerUI, GtkEditorTabDisplayerUI, MetalEditorTabDisplayerUI, WinClassicEditorTabDisplayerUI, WinVistaEditorTabDisplayerUI, WinXPEditorTabDisplayerUI

public abstract class BasicScrollingTabDisplayerUI
extends BasicTabDisplayerUI

Base class for tab displayers that have scrollable tabs.


Nested Class Summary
protected  class BasicScrollingTabDisplayerUI.ScrollingDisplayerComponentListener
           
protected  class BasicScrollingTabDisplayerUI.ScrollingHierarchyListener
           
protected  class BasicScrollingTabDisplayerUI.ScrollingTabState
           
 
Nested classes/interfaces inherited from class org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI
BasicTabDisplayerUI.BasicDisplayerMouseListener, BasicTabDisplayerUI.BasicModelListener, BasicTabDisplayerUI.BasicSelectionListener, BasicTabDisplayerUI.BasicTabState
 
Nested classes/interfaces inherited from class org.netbeans.swing.tabcontrol.plaf.AbstractTabDisplayerUI
AbstractTabDisplayerUI.DisplayerHierarchyListener, AbstractTabDisplayerUI.DisplayerPropertyChangeListener, AbstractTabDisplayerUI.ModelListener
 
Field Summary
 
Fields inherited from class org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI
defaultRenderer, repaintPolicy, tabState
 
Fields inherited from class org.netbeans.swing.tabcontrol.plaf.AbstractTabDisplayerUI
componentListener, hierarchyListener, layoutModel, modelListener, mouseListener, propertyChangeListener, selectionListener
 
Fields inherited from class org.netbeans.swing.tabcontrol.TabDisplayerUI
displayer, selectionModel
 
Constructor Summary
BasicScrollingTabDisplayerUI(TabDisplayer displayer)
          Creates a new instance of BasicScrollingTabDisplayerUI
 
Method Summary
protected  ComponentListener createComponentListener()
          Create a ComponentListener that may be needed to handle resize, show, hide, etc.
protected  HierarchyListener createHierarchyListener()
           
protected  LayoutManager createLayout()
           
protected  TabLayoutModel createLayoutModel()
          Create an instance of TabLayoutModel which will provide coordinates for tabs
protected  TabState createTabState()
          Create a TabState instance.
protected  Component getControlButtons()
           
protected  Rectangle getControlButtonsRectangle(Container parent)
           
protected  int getFirstVisibleTab()
          Scrollable implementations will override this method to provide the first visible (even if clipped) tab.
protected  int getLastVisibleTab()
          Scrollable implementations will override this method to provide the last visible (even if clipped) tab.
 Dimension getMinimumSize(JComponent c)
           
static Graphics2D getOffscreenGraphics()
          Provides an offscreen graphics context so that widths based on character size can be calculated correctly before the component is shown
 Insets getTabAreaInsets()
          Return a set of insets defining the margins into which tabs should not be painted.
protected  int getTabsAreaWidth()
          Returns the width of the tabs area
protected  void install()
          Overridden to initialize the tabState and defaultRenderer.
protected  void installControlButtons()
           
 void makeTabVisible(int tab)
          Instruct the UI to ensure that the tab at the given index is visible.
protected  void modelChanged()
          Overrides modelChanged() to clear the transient information in the state model, which may now contain tab indices that don't exist, and also to clear cached width/last-visible-tab data in the layout model, and ensure that the selected tab is visible.
protected  void processMouseWheelEvent(MouseWheelEvent e)
          Overridden to update the offset of the ScrollingTabLayoutModel on mouse wheel events
protected  ScrollingTabLayoutModel scroll()
          Convenience getter for the layout model as an instance of ScrollingTabLayoutModel
protected  void uninstall()
          Called after uninstalling the mouse listener and selection model, but before references to that or the layout model or displayer have been nulled.
 
Methods inherited from class org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI
cancelRequestAttention, createDefaultRenderer, createImageOfTab, createModelListener, createMouseListener, createPropertyChangeListener, createRepaintPolicy, createSelectionListener, dropIndexOfPoint, getExactTabIndication, getInsertTabIndication, getLastKnownMouseLocation, getTabCellRenderer, getTabRect, getTabRectForRepaint, getTabsVisibleArea, isAntialiased, paint, paintAfterTabs, paintBackground, requestAttention, tabForCoordinate
 
Methods inherited from class org.netbeans.swing.tabcontrol.plaf.AbstractTabDisplayerUI
createFont, createSelectionModel, installListeners, installUI, registerShortcuts, toDropPoint, uninstallListeners, uninstallUI, unregisterShortcuts
 
Methods inherited from class org.netbeans.swing.tabcontrol.TabDisplayerUI
getButtonIcon, postTabAction, shouldPerformAction
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getPreferredSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicScrollingTabDisplayerUI

public BasicScrollingTabDisplayerUI(TabDisplayer displayer)
Creates a new instance of BasicScrollingTabDisplayerUI

Method Detail

createLayoutModel

protected final TabLayoutModel createLayoutModel()
Description copied from class: AbstractTabDisplayerUI
Create an instance of TabLayoutModel which will provide coordinates for tabs

Specified by:
createLayoutModel in class AbstractTabDisplayerUI

createTabState

protected TabState createTabState()
Description copied from class: BasicTabDisplayerUI
Create a TabState instance. TabState manages the state of tabs - that is, which one contains the mouse, which one is pressed, and so forth, providing methods such as setMouseInTab(int tab). Its getState() method returns a bitmask of states a tab may have which affect the way it is painted.

Usage: It is expected that UIs will subclass TabState, to implement the repaint methods, and possibly override getState(int tab) to mix additional state bits into the bitmask. For example, scrollable tabs have the possible states CLIP_LEFT and CLIP_RIGHT; BasicScrollingTabDisplayerUI's implementation of this determines these states by consulting its layout model, and adds them in when appropriate.

Overrides:
createTabState in class BasicTabDisplayerUI
Returns:
An implementation of TabState
See Also:
BasicTabDisplayerUI.BasicTabState, BasicScrollingTabDisplayerUI.ScrollingTabState

createHierarchyListener

protected HierarchyListener createHierarchyListener()
Overrides:
createHierarchyListener in class AbstractTabDisplayerUI

makeTabVisible

public void makeTabVisible(int tab)
Description copied from class: TabDisplayerUI
Instruct the UI to ensure that the tab at the given index is visible. Some UIs allow scrolling or otherwise hiding tabs. The default implementation is a no-op.

Overrides:
makeTabVisible in class TabDisplayerUI
Parameters:
tab - The index of the tab that should be made visible, which should be within the range of 0 to the count of tabs in the model

getTabsAreaWidth

protected final int getTabsAreaWidth()
Returns the width of the tabs area


getTabAreaInsets

public Insets getTabAreaInsets()
Description copied from class: BasicTabDisplayerUI
Return a set of insets defining the margins into which tabs should not be painted. Subclasses that want to paint some controls to the right of the tabs should include space for those controls in these insets. If a bottom margin under the tabs is to be painted, include that as well.

Specified by:
getTabAreaInsets in class BasicTabDisplayerUI

getLastVisibleTab

protected final int getLastVisibleTab()
Description copied from class: BasicTabDisplayerUI
Scrollable implementations will override this method to provide the last visible (even if clipped) tab. The default implementation returns 0 if there is at least one tab in the data model, or -1 to indicate the model is completely empty

Overrides:
getLastVisibleTab in class BasicTabDisplayerUI

getFirstVisibleTab

protected final int getFirstVisibleTab()
Description copied from class: BasicTabDisplayerUI
Scrollable implementations will override this method to provide the first visible (even if clipped) tab. The default implementation returns 0 if there is at least one tab in the data model, or -1 to indicate the model is completely empty

Overrides:
getFirstVisibleTab in class BasicTabDisplayerUI

install

protected void install()
Description copied from class: BasicTabDisplayerUI
Overridden to initialize the tabState and defaultRenderer.

Overrides:
install in class BasicTabDisplayerUI

uninstall

protected void uninstall()
Description copied from class: AbstractTabDisplayerUI
Called after uninstalling the mouse listener and selection model, but before references to that or the layout model or displayer have been nulled. Subclasses may use this method to do any cleanup they need to do at uninstall time.

Overrides:
uninstall in class BasicTabDisplayerUI

createLayout

protected LayoutManager createLayout()

getControlButtons

protected Component getControlButtons()
Returns:
A component that holds control buttons (scroll left/right, drop down menu) that are displayed to right of the tab area.

createComponentListener

protected ComponentListener createComponentListener()
Description copied from class: AbstractTabDisplayerUI
Create a ComponentListener that may be needed to handle resize, show, hide, etc. Returns null by default.

Overrides:
createComponentListener in class AbstractTabDisplayerUI

modelChanged

protected void modelChanged()
Overrides modelChanged() to clear the transient information in the state model, which may now contain tab indices that don't exist, and also to clear cached width/last-visible-tab data in the layout model, and ensure that the selected tab is visible.

Overrides:
modelChanged in class BasicTabDisplayerUI

installControlButtons

protected void installControlButtons()

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Overrides:
getMinimumSize in class ComponentUI

scroll

protected final ScrollingTabLayoutModel scroll()
Convenience getter for the layout model as an instance of ScrollingTabLayoutModel


processMouseWheelEvent

protected void processMouseWheelEvent(MouseWheelEvent e)
Overridden to update the offset of the ScrollingTabLayoutModel on mouse wheel events

Overrides:
processMouseWheelEvent in class BasicTabDisplayerUI

getOffscreenGraphics

public static Graphics2D getOffscreenGraphics()
Provides an offscreen graphics context so that widths based on character size can be calculated correctly before the component is shown


getControlButtonsRectangle

protected Rectangle getControlButtonsRectangle(Container parent)
Returns:
Bounds for the control buttons in the tab displayer container.

org.netbeans.swing.tabcontrol 1.8

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.