|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.plaf.ComponentUI
org.netbeans.swing.tabcontrol.TabDisplayerUI
public abstract class TabDisplayerUI
The basic UI of a tab displayer component. Defines the API of the UI for TabDisplayers, which may be called by TabDisplayer.
AbstractTabDisplayerUI
,
BasicTabDisplayerUI
Field Summary | |
---|---|
protected TabDisplayer |
displayer
|
protected SingleSelectionModel |
selectionModel
|
Constructor Summary | |
---|---|
protected |
TabDisplayerUI(TabDisplayer displayer)
Creates a new instance of TabDisplayerUI |
Method Summary | |
---|---|
protected abstract void |
cancelRequestAttention(int tab)
|
Image |
createImageOfTab(int index)
Returns an image suitable for use in drag and drop operations, representing the tab at this index. |
protected abstract SingleSelectionModel |
createSelectionModel()
Create the selection model which will handle selection for the TabDisplayer. |
abstract int |
dropIndexOfPoint(Point p)
The index a tab would acquire if dropped at a given point |
abstract Icon |
getButtonIcon(int buttonId,
int buttonState)
|
abstract Polygon |
getExactTabIndication(int index)
Get a shape representing the exact outline of the numbered tab. |
abstract 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. |
abstract Rectangle |
getTabRect(int index,
Rectangle destination)
Configure the passed rectangle with the shape of the tab at the given index. |
void |
installUI(JComponent c)
|
void |
makeTabVisible(int index)
Instruct the UI to ensure that the tab at the given index is visible. |
void |
postTabAction(TabActionEvent e)
|
abstract void |
registerShortcuts(JComponent comp)
|
protected abstract void |
requestAttention(int tab)
|
protected boolean |
shouldPerformAction(String command,
int tab,
MouseEvent event)
Allows ActionListeners attached to the container to determine if the event should be acted on. |
abstract 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)
|
abstract void |
unregisterShortcuts(JComponent comp)
|
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SingleSelectionModel selectionModel
protected final TabDisplayer displayer
Constructor Detail |
---|
protected TabDisplayerUI(TabDisplayer displayer)
Method Detail |
---|
public void installUI(JComponent c)
installUI
in class ComponentUI
public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
public abstract Polygon getExactTabIndication(int index)
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.
public abstract Polygon getInsertTabIndication(int index)
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.
public abstract int tabForCoordinate(Point p)
public abstract Rectangle getTabRect(int index, Rectangle destination)
public Image createImageOfTab(int index)
index
- A tab index
IllegalArgumentException
- if no tab is at the passed indexprotected abstract SingleSelectionModel createSelectionModel()
protected final boolean shouldPerformAction(String command, int tab, MouseEvent event)
displayer.postActionEvent()
.
This method will create a TabActionEvent with the passed string as an
action command, and cause the displayer to fire this event. It will
return true if no listener on the displayer consumed the TabActionEvent;
consuming the event is the way a listener can veto a change, or provide
special handling for it.
command
- The action command - this should be TabDisplayer.COMMAND_SELECT
or TabDisplayer.COMMAND_CLOSE, but private contracts
between custom UIs and components are also an option.tab
- The index of the tab upon which the action should act, or
-1 if non-applicableevent
- A mouse event which initiated the action, or null
public void makeTabVisible(int index)
index
- 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
modelpublic abstract int dropIndexOfPoint(Point p)
p
- A point
public abstract void registerShortcuts(JComponent comp)
public abstract void unregisterShortcuts(JComponent comp)
protected abstract void requestAttention(int tab)
protected abstract void cancelRequestAttention(int tab)
public abstract Icon getButtonIcon(int buttonId, int buttonState)
public void postTabAction(TabActionEvent e)
|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |