|
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.TabbedContainerUI
public abstract class TabbedContainerUI
Basic UI for tabbed containers. Note this is distinct from the UI for the embedded tab displayer component - that where all the interesting painting logic is.
To provide an implementation of TabbedContainerUI, it is a far better idea to subclass AbstractTabbedContainerUI, BasicTabbedContainerUI, or BasicScrollingTabbedContainerUI.
Field Summary | |
---|---|
protected TabbedContainer |
container
The TabbedContainer this instance is acting as a ui delegate for. |
Constructor Summary | |
---|---|
TabbedContainerUI(TabbedContainer container)
Creates a new instance of TabbedContainerUI |
Method Summary | |
---|---|
protected abstract void |
cancelRequestAttention(int tab)
|
abstract Image |
createImageOfTab(int idx)
Create an image suitable for use in drag and drop operations, of a tab |
abstract int |
dropIndexOfPoint(Point p)
Index at which a tab would be inserted if a suitable object were dropped at this point. |
abstract Rectangle |
getContentArea()
Get a rectangle matching the area in which content is displayed |
abstract Polygon |
getExactTabIndication(int idx)
Get a polygon matching the shape of the tab |
abstract Polygon |
getInsertTabIndication(int idx)
Get a polygon indicating the insertion of a tab before the passed index, unless the index is equal to the model size, in which case it will return an indication for inserting a tab at the end. |
abstract SingleSelectionModel |
getSelectionModel()
Get the selection model that tracks and determines which tab is selected. |
abstract Rectangle |
getTabRect(int tab,
Rectangle r)
Get the bounds of a tab. |
abstract Rectangle |
getTabsArea()
Get a rectangle matching the area in which tabs are displayed |
void |
installUI(JComponent c)
|
abstract boolean |
isShowCloseButton()
|
abstract void |
makeTabVisible(int index)
Make a tab visible. |
protected abstract void |
requestAttention(int tab)
|
abstract void |
setShowCloseButton(boolean val)
|
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)
Get the tab at a given point in the coordinate space of the container. |
protected boolean |
uichange()
This method is called if TabbedContainer.updateUI() gets called after a UI delegate has been installed (in other words, the user did something like switch look and feels or switch the Windows desktop theme). |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, uninstallUI, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TabbedContainer container
Constructor Detail |
---|
public TabbedContainerUI(TabbedContainer container)
Method Detail |
---|
public void installUI(JComponent c)
installUI
in class ComponentUI
protected boolean uichange()
Normally, the only UI delegate that exists for TabbedContainer is DefaultTabbedContainerUI, so it makes no sense to replace one with another, since they do the same thing.
However, this method can be used to update the tab displayer component's UI. Subclasses are expected to override this method to call updateUI() on the displayer, or do whatever is appropriate to ensure that the UI will look right after the change - or to return true from this method, in which the entire UI delegate for the tabbed container will be replaced.
public abstract Rectangle getTabRect(int tab, Rectangle r)
tab
- A tab indexr
- A rectangle to configure with the information, or null
public abstract int tabForCoordinate(Point p)
p
- A point
public abstract void makeTabVisible(int index)
index
- A tab indexprotected 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 abstract SingleSelectionModel getSelectionModel()
public abstract Image createImageOfTab(int idx)
public abstract Polygon getExactTabIndication(int idx)
public abstract Polygon getInsertTabIndication(int idx)
idx
- A tab index
public abstract Rectangle getContentArea()
public abstract Rectangle getTabsArea()
public abstract int dropIndexOfPoint(Point p)
p
- A point
public abstract void setShowCloseButton(boolean val)
public abstract boolean isShowCloseButton()
protected abstract void requestAttention(int tab)
protected abstract void cancelRequestAttention(int tab)
|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |