public abstract class AbstractViewTabDisplayerUI extends TabDisplayerUI
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.
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractViewTabDisplayerUI.Controller
Listen to mouse events and handles selection behaviour and close icon
button behaviour.
|
Modifier and Type | Field and Description |
---|---|
protected AbstractViewTabDisplayerUI.Controller |
controller |
protected TabState |
tabState |
displayer, selectionModel
Constructor and Description |
---|
AbstractViewTabDisplayerUI(TabDisplayer displayer) |
Modifier and Type | Method and Description |
---|---|
protected void |
cancelRequestAttention(int tab) |
protected AbstractViewTabDisplayerUI.Controller |
createController() |
Image |
createImageOfTab(int index)
Paints the rectangle occupied by a tab into an image and returns the result
|
protected TabLayoutModel |
createLayoutModel()
Creates model to layout the tabs out within the displayer.
|
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() |
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() |
Dimension |
getMinimumSize(JComponent c) |
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 |
isHighlight(int tab) |
protected boolean |
isSelected(int index) |
void |
paint(Graphics g,
JComponent c) |
protected void |
paintDisplayerBackground(Graphics g,
JComponent c)
Paint the background when using non-stretching tabs.
|
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) |
protected void |
setAttentionHighlight(int tab,
boolean highlight)
Turn tab highlight on/off
|
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
|
autoscroll, getAutoscrollInsets, getButtonIcon, isTabBusy, makeTabVisible, postTabAction, shouldPerformAction, shouldPerformAction
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getPreferredSize, update
protected AbstractViewTabDisplayerUI.Controller controller
protected final TabState tabState
public AbstractViewTabDisplayerUI(TabDisplayer displayer)
public void installUI(JComponent c)
installUI
in class TabDisplayerUI
protected TabLayoutModel createLayoutModel()
protected void installControlButtons()
protected Component getControlButtons()
public void uninstallUI(JComponent c)
uninstallUI
in class TabDisplayerUI
protected AbstractViewTabDisplayerUI.Controller createController()
public void paint(Graphics g, JComponent c)
paint
in class ComponentUI
protected final TabDataModel getDataModel()
public final TabLayoutModel getLayoutModel()
protected final TabDisplayer getDisplayer()
protected final SingleSelectionModel getSelectionModel()
public AbstractViewTabDisplayerUI.Controller getController()
protected final boolean isSelected(int index)
protected final boolean isActive()
protected final boolean isFocused(int index)
protected final SingleSelectionModel createSelectionModel()
TabDisplayerUI
createSelectionModel
in class TabDisplayerUI
public int dropIndexOfPoint(Point p)
TabDisplayerUI
dropIndexOfPoint
in class TabDisplayerUI
p
- A pointprotected Font getTxtFont()
getTxtFont
in class TabDisplayerUI
protected final FontMetrics getTxtFontMetrics()
protected abstract void paintTabContent(Graphics g, int index, String text, 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 paintTabBackground(Graphics g, int index, int x, int y, int width, int height)
protected void paintDisplayerBackground(Graphics g, JComponent c)
g
- c
- public void unregisterShortcuts(JComponent comp)
unregisterShortcuts
in class TabDisplayerUI
public void registerShortcuts(JComponent comp)
registerShortcuts
in class TabDisplayerUI
public Polygon getExactTabIndication(int index)
TabDisplayerUI
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.getExactTabIndication
in class TabDisplayerUI
public Polygon getInsertTabIndication(int index)
TabDisplayerUI
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.
getInsertTabIndication
in class TabDisplayerUI
public Image createImageOfTab(int index)
createImageOfTab
in class TabDisplayerUI
index
- A tab indexpublic Rectangle getTabRect(int index, Rectangle destination)
TabDisplayerUI
getTabRect
in class TabDisplayerUI
public int tabForCoordinate(Point p)
TabDisplayerUI
tabForCoordinate
in class TabDisplayerUI
public Dimension getMinimumSize(JComponent c)
getMinimumSize
in class ComponentUI
protected int createRepaintPolicy()
protected boolean isAttention(int tab)
protected boolean isHighlight(int tab)
tab
- protected void requestAttention(int tab)
requestAttention
in class TabDisplayerUI
protected void cancelRequestAttention(int tab)
cancelRequestAttention
in class TabDisplayerUI
protected void setAttentionHighlight(int tab, boolean highlight)
TabDisplayerUI
setAttentionHighlight
in class TabDisplayerUI