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

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

org.netbeans.swing.tabcontrol 1.8

org.netbeans.swing.tabcontrol.plaf
Class AbstractViewTabDisplayerUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by org.netbeans.swing.tabcontrol.TabDisplayerUI
          extended by org.netbeans.swing.tabcontrol.plaf.AbstractViewTabDisplayerUI
Direct Known Subclasses:
AquaViewTabDisplayerUI, GtkViewTabDisplayerUI, MetalViewTabDisplayerUI, WinClassicViewTabDisplayerUI, WinVistaViewTabDisplayerUI, WinXPViewTabDisplayerUI

public abstract class AbstractViewTabDisplayerUI
extends TabDisplayerUI

Basic UI class for view tabs - non scrollable tabbed displayer, which shows all tabs equally sized, proportionally. This class is independent on specific L&F, acts as base class for specific L&F descendants.

XXX eventually this class should be deleted and a subclass of BasicTabDisplayer can be used; currently this is simply a port of the original code to the new API. Do not introduce any new subclasses of this.


Field Summary
protected  org.netbeans.swing.tabcontrol.plaf.AbstractViewTabDisplayerUI.Controller controller
           
protected  TabState tabState
           
 
Fields inherited from class org.netbeans.swing.tabcontrol.TabDisplayerUI
displayer, selectionModel
 
Constructor Summary
AbstractViewTabDisplayerUI(TabDisplayer displayer)
           
 
Method Summary
protected  void cancelRequestAttention(int tab)
           
protected  org.netbeans.swing.tabcontrol.plaf.AbstractViewTabDisplayerUI.Controller createController()
           
 Image createImageOfTab(int index)
          Paints the rectangle occupied by a tab into an image and returns the result
protected  int createRepaintPolicy()
           
protected  SingleSelectionModel createSelectionModel()
          Create the selection model which will handle selection for the TabDisplayer.
 int dropIndexOfPoint(Point p)
          The index a tab would acquire if dropped at a given point
protected  Component getControlButtons()
           
 org.netbeans.swing.tabcontrol.plaf.AbstractViewTabDisplayerUI.Controller getController()
           
protected  TabDataModel getDataModel()
           
protected  TabDisplayer getDisplayer()
           
 Polygon getExactTabIndication(int index)
          Get a shape representing the exact outline of the numbered tab.
 Polygon getInsertTabIndication(int index)
          Get a shape representing the area of visual feedback during a drag and drop operation, which represents where a tab will be inserted if a drop operation is performed over the indicated tab.
 TabLayoutModel getLayoutModel()
           
protected  SingleSelectionModel getSelectionModel()
           
 Rectangle getTabRect(int index, Rectangle destination)
          Configure the passed rectangle with the shape of the tab at the given index.
protected  Font getTxtFont()
          Specifies font to use for text and font metrics.
protected  FontMetrics getTxtFontMetrics()
           
protected  void installControlButtons()
           
 void installUI(JComponent c)
           
protected  boolean isActive()
           
protected  boolean isAttention(int tab)
          Determine if the tab should be flashing
protected  boolean isFocused(int index)
           
protected  boolean isSelected(int index)
           
 void paint(Graphics g, JComponent c)
           
protected abstract  void paintTabBackground(Graphics g, int index, int x, int y, int width, int height)
           
protected abstract  void paintTabBorder(Graphics g, int index, int x, int y, int width, int height)
           
protected abstract  void paintTabContent(Graphics g, int index, String text, int x, int y, int width, int height)
           
 void registerShortcuts(JComponent comp)
          Registers shortcut for enable/ disable auto-hide functionality
protected  void requestAttention(int tab)
           
 int tabForCoordinate(Point p)
          Returns the index of the tab at the passed point, or -1 if no tab is at that location.
 void uninstallUI(JComponent c)
           
 void unregisterShortcuts(JComponent comp)
          Registers shortcut for enable/ disable auto-hide functionality
 
Methods inherited from class org.netbeans.swing.tabcontrol.TabDisplayerUI
getButtonIcon, makeTabVisible, postTabAction, shouldPerformAction
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controller

protected org.netbeans.swing.tabcontrol.plaf.AbstractViewTabDisplayerUI.Controller controller

tabState

protected final TabState tabState
Constructor Detail

AbstractViewTabDisplayerUI

public AbstractViewTabDisplayerUI(TabDisplayer displayer)
Method Detail

installUI

public void installUI(JComponent c)
Overrides:
installUI in class TabDisplayerUI

installControlButtons

protected void installControlButtons()

getControlButtons

protected Component getControlButtons()
Returns:
A component that holds all control buttons (maximize/restor, slide/pin, close) that are displayed in the active tab or null if control buttons are not supported.

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class TabDisplayerUI

createController

protected org.netbeans.swing.tabcontrol.plaf.AbstractViewTabDisplayerUI.Controller createController()

paint

public void paint(Graphics g,
                  JComponent c)
Overrides:
paint in class ComponentUI

getDataModel

protected final TabDataModel getDataModel()

getLayoutModel

public final TabLayoutModel getLayoutModel()

getDisplayer

protected final TabDisplayer getDisplayer()

getSelectionModel

protected final SingleSelectionModel getSelectionModel()

getController

public org.netbeans.swing.tabcontrol.plaf.AbstractViewTabDisplayerUI.Controller getController()

isSelected

protected final boolean isSelected(int index)

isActive

protected final boolean isActive()

isFocused

protected final boolean isFocused(int index)

createSelectionModel

protected final SingleSelectionModel createSelectionModel()
Description copied from class: TabDisplayerUI
Create the selection model which will handle selection for the TabDisplayer. SPI method located here because TabDisplayer.setSelectionModel is package private.

Specified by:
createSelectionModel in class TabDisplayerUI

dropIndexOfPoint

public int dropIndexOfPoint(Point p)
Description copied from class: TabDisplayerUI
The index a tab would acquire if dropped at a given point

Specified by:
dropIndexOfPoint in class TabDisplayerUI
Parameters:
p - A point
Returns:
An index which may be equal to the size of the data model

getTxtFont

protected Font getTxtFont()
Specifies font to use for text and font metrics. Subclasses may override to specify their own text font


getTxtFontMetrics

protected final FontMetrics getTxtFontMetrics()

paintTabContent

protected abstract void paintTabContent(Graphics g,
                                        int index,
                                        String text,
                                        int x,
                                        int y,
                                        int width,
                                        int height)

paintTabBorder

protected abstract void paintTabBorder(Graphics g,
                                       int index,
                                       int x,
                                       int y,
                                       int width,
                                       int height)

paintTabBackground

protected abstract void paintTabBackground(Graphics g,
                                           int index,
                                           int x,
                                           int y,
                                           int width,
                                           int height)

unregisterShortcuts

public void unregisterShortcuts(JComponent comp)
Registers shortcut for enable/ disable auto-hide functionality

Specified by:
unregisterShortcuts in class TabDisplayerUI

registerShortcuts

public void registerShortcuts(JComponent comp)
Registers shortcut for enable/ disable auto-hide functionality

Specified by:
registerShortcuts in class TabDisplayerUI

getExactTabIndication

public Polygon getExactTabIndication(int index)
Description copied from class: TabDisplayerUI
Get a shape representing the exact outline of the numbered tab. The implementations in the package will return instances of EqualPolygon from this method; other implementations may return what they want, but for performance reasons, it is highly desirable that the shape object returned honor equals() and hashCode(), as there are significant optimizations in NetBeans' drag and drop support that depend on this.

Specified by:
getExactTabIndication in class TabDisplayerUI

getInsertTabIndication

public Polygon getInsertTabIndication(int index)
Description copied from class: TabDisplayerUI
Get a shape representing the area of visual feedback during a drag and drop operation, which represents where a tab will be inserted if a drop operation is performed over the indicated tab.

The implementations in the package will return instances of EqualPolygon from this method; other implementations may return what they want, but for performance reasons, it is highly desirable that the shape object returned honor equals() and hashCode(), as there are significant optimizations in NetBeans' drag and drop support that depened on this.

Specified by:
getInsertTabIndication in class TabDisplayerUI
Returns:
Shape representing feedback shape

createImageOfTab

public Image createImageOfTab(int index)
Paints the rectangle occupied by a tab into an image and returns the result

Overrides:
createImageOfTab in class TabDisplayerUI
Parameters:
index - A tab index

getTabRect

public Rectangle getTabRect(int index,
                            Rectangle destination)
Description copied from class: TabDisplayerUI
Configure the passed rectangle with the shape of the tab at the given index.

Specified by:
getTabRect in class TabDisplayerUI

tabForCoordinate

public int tabForCoordinate(Point p)
Description copied from class: TabDisplayerUI
Returns the index of the tab at the passed point, or -1 if no tab is at that location. Note that this method may return -1 for coordinates which are within a tab as returned by getTabRect(), but are not within the visible shape of the tab as the UI paints it.

Specified by:
tabForCoordinate in class TabDisplayerUI

createRepaintPolicy

protected int createRepaintPolicy()

isAttention

protected boolean isAttention(int tab)
Determine if the tab should be flashing


requestAttention

protected void requestAttention(int tab)
Specified by:
requestAttention in class TabDisplayerUI

cancelRequestAttention

protected void cancelRequestAttention(int tab)
Specified by:
cancelRequestAttention in class TabDisplayerUI

org.netbeans.swing.tabcontrol 1.8

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