public final class BasicSlidingTabDisplayerUI extends AbstractTabDisplayerUI
Note that the "sliding" is provided by an instance of FxProvider
provided in the DefaultTabbedContainerUI
, not here.
To change the appearance of the buttons, simply provide a subclass of SlidingTabDisplayerButtonUI
via UIDefaults. This class is final.
Modifier and Type | Class and Description |
---|---|
class |
BasicSlidingTabDisplayerUI.IndexButton
JToggleButton subclass which maps to an index in the data model, and displays
whatever the content of the data model at that index is.
|
protected class |
BasicSlidingTabDisplayerUI.SlidingPropertyChangeListener |
AbstractTabDisplayerUI.DisplayerHierarchyListener, AbstractTabDisplayerUI.DisplayerPropertyChangeListener, AbstractTabDisplayerUI.ModelListener
componentListener, hierarchyListener, layoutModel, modelListener, mouseListener, propertyChangeListener, selectionListener
displayer, selectionModel
Constructor and Description |
---|
BasicSlidingTabDisplayerUI(TabDisplayer displayer)
Creates a new instance of BasicSlidingTabDisplayerUI
|
Modifier and Type | Method and Description |
---|---|
void |
cancelRequestAttention(int tab) |
protected Font |
createFont() |
Image |
createImageOfTab(int index)
Paints the rectangle occupied by a tab into an image and returns the result
|
protected TabLayoutModel |
createLayoutModel()
Not used so much to determine layout as to calculate preferred sizes
here
|
protected MouseListener |
createMouseListener()
Create the mouse listener that will be responsible for changing the
selection on mouse events, triggering repaints on mouse enter/exit/motion, etc.
|
protected ChangeListener |
createSelectionListener()
Create a
ChangeListener to be attached to the selection model. |
static ComponentUI |
createUI(JComponent c) |
Icon |
getButtonIcon(int buttonId,
int buttonState) |
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.
|
Dimension |
getMinimumSize(JComponent c) |
Dimension |
getPreferredSize(JComponent c) |
Rectangle |
getTabRect(int index,
Rectangle destination)
Configure the passed rectangle with the shape of the tab at the given
index.
|
protected void |
install()
Called after creating the layout model, selection model and mouse
listener, but before installing the mouse listener and selection model.
|
protected void |
modelChanged()
Convenience method called by ModelListener.stateChanged() when the data model changes.
|
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.
|
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.
|
createComponentListener, createHierarchyListener, createModelListener, createPropertyChangeListener, createSelectionModel, dropIndexOfPoint, installListeners, installUI, registerShortcuts, toDropPoint, uninstallListeners, uninstallUI, unregisterShortcuts
autoscroll, getAutoscrollInsets, getTxtFont, isTabBusy, makeTabVisible, postTabAction, setAttentionHighlight, shouldPerformAction, shouldPerformAction
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, paint, update
public BasicSlidingTabDisplayerUI(TabDisplayer displayer)
public static ComponentUI createUI(JComponent c)
protected void install()
AbstractTabDisplayerUI
install
in class AbstractTabDisplayerUI
protected Font createFont()
createFont
in class AbstractTabDisplayerUI
protected void uninstall()
AbstractTabDisplayerUI
uninstall
in class AbstractTabDisplayerUI
public Dimension getPreferredSize(JComponent c)
getPreferredSize
in class ComponentUI
public Dimension getMinimumSize(JComponent c)
getMinimumSize
in class ComponentUI
protected TabLayoutModel createLayoutModel()
createLayoutModel
in class AbstractTabDisplayerUI
protected MouseListener createMouseListener()
AbstractTabDisplayerUI
createMouseListener
in class AbstractTabDisplayerUI
public void requestAttention(int tab)
requestAttention
in class TabDisplayerUI
public void cancelRequestAttention(int tab)
cancelRequestAttention
in class TabDisplayerUI
protected ChangeListener createSelectionListener()
AbstractTabDisplayerUI
ChangeListener
to be attached to the selection model. This
listener will be responsible for repainting the appropriate areas on selection changes.createSelectionListener
in class AbstractTabDisplayerUI
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 Rectangle getTabRect(int index, Rectangle destination)
TabDisplayerUI
getTabRect
in class TabDisplayerUI
public int tabForCoordinate(Point p)
TabDisplayerUI
tabForCoordinate
in class TabDisplayerUI
public Image createImageOfTab(int index)
createImageOfTab
in class TabDisplayerUI
index
- A tab indexprotected void modelChanged()
AbstractTabDisplayerUI
displayer.repaint()
.modelChanged
in class AbstractTabDisplayerUI
public Icon getButtonIcon(int buttonId, int buttonState)
getButtonIcon
in class TabDisplayerUI