| java.lang.Object javax.swing.plaf.ComponentUI org.netbeans.swing.tabcontrol.TabbedContainerUI org.netbeans.swing.tabcontrol.plaf.DefaultTabbedContainerUI
DefaultTabbedContainerUI | public class DefaultTabbedContainerUI extends TabbedContainerUI (Code) | | Default UI implementation for tabbed containers. Manages installing the tab
contentDisplayer and content contentDisplayer components, and the
relationship between the data models and selection models of the UI.
Note that there is typically little reasons to subclass this - to affect the display
or behavior of the tabs, implement
org.netbeans.swing.tabcontrol.TabDisplayerUI ,
the UI delegate for the embedded component which displays the tabs.
author: Tim Boudreau |
Inner Class :protected class ContainerComponentListener extends ComponentAdapter | |
Inner Class :protected class SelectionListener implements ChangeListener | |
ADD_TO_GLASSPANE | final static boolean ADD_TO_GLASSPANE(Code) | | Sysprop to turn add the component being scaled to the glasspane and alter its size on a
timer to accomplish growing the component
|
EFFECTS_EVERYWHERE | final static boolean EFFECTS_EVERYWHERE(Code) | | For those who really love the sliding effect and want to see it on all
tab controls of all types
|
INCREMENT | static float INCREMENT(Code) | | |
KEY_EDITOR_CONTENT_BORDER | final public static String KEY_EDITOR_CONTENT_BORDER(Code) | | UIManager key for the border of the tab displayer in editor ui type.
|
KEY_EDITOR_OUTER_BORDER | final public static String KEY_EDITOR_OUTER_BORDER(Code) | | UIManager key for the border of the entire tabbed container in editor ui type
|
KEY_EDITOR_TABS_BORDER | final public static String KEY_EDITOR_TABS_BORDER(Code) | | UIManager key for the border of the tab displayer in editor ui type
|
KEY_SLIDING_CONTENT_BORDER | final public static String KEY_SLIDING_CONTENT_BORDER(Code) | | UIManager key for the border of the tab displayer in sliding ui type.
|
KEY_SLIDING_OUTER_BORDER | final public static String KEY_SLIDING_OUTER_BORDER(Code) | | UIManager key for the border of the entire tabbed container in sliding ui type
|
KEY_SLIDING_TABS_BORDER | final public static String KEY_SLIDING_TABS_BORDER(Code) | | UIManager key for the border of the tab displayer in sliding ui type
|
KEY_TOOLBAR_CONTENT_BORDER | final public static String KEY_TOOLBAR_CONTENT_BORDER(Code) | | UIManager key for the border of the tab displayer in toolbar ui type.
|
KEY_TOOLBAR_OUTER_BORDER | final public static String KEY_TOOLBAR_OUTER_BORDER(Code) | | UIManager key for the border of the entire tabbed container in toolbar ui type
|
KEY_TOOLBAR_TABS_BORDER | final public static String KEY_TOOLBAR_TABS_BORDER(Code) | | UIManager key for the border of the tab displayer in toolbar ui type
|
KEY_VIEW_CONTENT_BORDER | final public static String KEY_VIEW_CONTENT_BORDER(Code) | | UIManager key for the border of the tab displayer in view ui type.
|
KEY_VIEW_OUTER_BORDER | final public static String KEY_VIEW_OUTER_BORDER(Code) | | UIManager key for the border of the entire tabbed container in view ui type.
|
KEY_VIEW_TABS_BORDER | final public static String KEY_VIEW_TABS_BORDER(Code) | | UIManager key for the border of the tab displayer in view ui type.
|
NO_EFFECTS | final static boolean NO_EFFECTS(Code) | | Sysprop to turn off all sliding effects
|
NO_SCALE | final static boolean NO_SCALE(Code) | | Sysprop to turn off scaling of the slide image
|
SYNCHRONOUS_PAINTING | static boolean SYNCHRONOUS_PAINTING(Code) | | |
USE_ALPHA | final static boolean USE_ALPHA(Code) | | Also have the scaled image be partially transparent as it's drawn
|
USE_SWINGPAINTING | final static boolean USE_SWINGPAINTING(Code) | | Sysprop to turn use SwingUtilities.paintComponent() instead of an image buffer for sliding effects
|
componentListener | protected ComponentListener componentListener(Code) | | Component listener which listens on the container, and attaches/detaches listeners.
do not alter the value in this field. To provide a different implementation,
override the appropriate creation method.
|
contentDisplayer | protected JComponent contentDisplayer(Code) | | The component which displays the selected component in the tabbed container.
do not alter the value in this field. To provide a different implementation,
override the appropriate creation method.
|
contentDisplayerLayout | protected LayoutManager contentDisplayerLayout(Code) | | Layout manager which will handle layout of the tabbed container.
do not alter the value in this field. To provide a different implementation,
override the appropriate creation method.
|
modelListener | protected ComplexListDataListener modelListener(Code) | | Listener on the data model, which handles updating the contained components to keep them
in sync with the contents of the data model.
do not alter the value in this field. To provide a different implementation,
override the appropriate creation method.
See Also: TabbedContainer.setContentPolicy |
propertyChangeListener | protected PropertyChangeListener propertyChangeListener(Code) | | Property change listener which detects changes on the tabbed container, such as its active state, which
should be propagated to the tab displayer.
do not alter the value in this field. To provide a different implementation,
override the appropriate creation method.
|
selectionListener | protected ChangeListener selectionListener(Code) | | Change listener which tracks changes in the selection model and changes the displayed
component to reflect the selected tab
do not alter the value in this field. To provide a different implementation,
override the appropriate creation method.
|
slideEffectManager | protected FxProvider slideEffectManager(Code) | | FxProvider which will provide transition effects when tabs are changed. By default, only used for
TabbedContainer.TYPE_SLIDE tabs.
do not alter the value in this field. To provide a different implementation,
override the appropriate creation method.
|
tabDisplayer | protected TabDisplayer tabDisplayer(Code) | | The Displayer for the tabs. Normally an instance of TabDisplayer . To get the actual
GUI component that is showing tabs, call its getComponent() method.
do not alter the value in this field. To provide a different implementation,
override the appropriate creation method.
|
DefaultTabbedContainerUI | public DefaultTabbedContainerUI(TabbedContainer c)(Code) | | Creates a new instance of DefaultTabbedContainerUI
|
attachModelAndSelectionListeners | protected void attachModelAndSelectionListeners()(Code) | | Begin listening to the model for changes in the selection, which should
cause us to update the displayed component in the content
contentDisplayer. Listening starts when the component is first shown, and
stops when it is hidden; if you override createComponentListener() ,
you will need to call this method when the component is shown.
|
cancelRequestAttention | protected void cancelRequestAttention(int tab)(Code) | | |
createComponentListener | protected ComponentListener createComponentListener()(Code) | | Create a component listener responsible for initializing the
contentDisplayer component when the tabbed container is shown
|
createContentDisplayer | protected JPanel createContentDisplayer()(Code) | | Create the component which will contain the content (the components which
correspond to tabs). The default implementation simply returns a
vanilla, unadorned JPanel .
|
createContentDisplayerLayout | protected LayoutManager createContentDisplayerLayout()(Code) | | Creates the content contentDisplayer's layout manager, responsible for
ensuring that the correct component is on top and is the only one
showing
|
createFxProvider | protected FxProvider createFxProvider()(Code) | | Create an FxProvider instance which will provide transition effects when tabs are selected.
By default creates a no-op instance for all displayer types except TYPE_SLIDING.
An instance of FxProvider |
createImageOfTab | public Image createImageOfTab(int idx)(Code) | | |
createLayout | protected LayoutManager createLayout()(Code) | | Create the layout manager that will manage the layout of the
TabbedContainer. A TabbedContainer contains two components - the tabs
contentDisplayer, and the component contentDisplayer.
The layout manager determines the position of the tabs relative to the
contentDisplayer component which displays the tab contents.
The default implementation uses BorderLayout. If you override this, you
should probably override installDisplayer() as well.
|
createModelListener | protected ComplexListDataListener createModelListener()(Code) | | Create a listener for the TabDataModel. This listener is responsible for
keeping the state of the contained components in the displayer in sync
with the contents of the data model. Note that it is not necessary for
this listener to adjust the selection - DefaultTabSelectionModel handles
cases such as removing the selected component appropriately, so if such a
model change happens, a selection change will be immediately forthcoming
to handle it.
Note that it is important that this listener be added to the data model
after the DefaultSelectionModel has added its listener. It is
important to create the displayer component before adding this listener.
Some support for privilged listeners may be added to DefaultTabDataModel
in the future to avoid this issue entirely.
|
createPropertyChangeListener | protected PropertyChangeListener createPropertyChangeListener()(Code) | | Create a property change listener which will update the tab displayer in
accordance with property changes on the container. Currently the only
property change of interest is calls to TabbedContainer.setActive() ,
which simply cause the active state to be set on the displayer.
|
createSelectionListener | protected ChangeListener createSelectionListener()(Code) | | Create a ChangeListener which will listen to the selection model of the
tab displayer, and update the displayed component in the displayer when
the selection model changes.
|
createTabDisplayer | protected TabDisplayer createTabDisplayer()(Code) | | Create the component which will display the tabs.
|
detachModelAndSelectionListeners | protected void detachModelAndSelectionListeners()(Code) | | Stop listening to the model for changes in the selection, which should
cause us to update the displayed component in the content
contentDisplayer, and changes in the data model which can affect the
displayed component. Listening starts when the component is first shown,
and stops when it is hidden; if you override createComponentListener() ,
you will need to call this method when the component is hidden.
|
dropIndexOfPoint | public int dropIndexOfPoint(Point p)(Code) | | |
ensureSelectedComponentIsShowing | protected void ensureSelectedComponentIsShowing()(Code) | | Ensures that the component the selection model says is selected is the
one that is showing.
|
getExactTabIndication | public Polygon getExactTabIndication(int idx)(Code) | | |
getInsertTabIndication | public Polygon getInsertTabIndication(int idx)(Code) | | |
initDisplayer | protected void initDisplayer()(Code) | | Fills contentDisplayer container with components retrieved from model.
|
install | protected void install()(Code) | | Subclasses may override this method to do anything they need to do on installUI(). It will
be called after listeners, the displayer, etc. (all pseudo-final protected fields) have been
initialized.
|
installBorders | protected void installBorders()(Code) | | Installs borders on the container, content displayer and tab displayer
|
installContentDisplayer | protected void installContentDisplayer()(Code) | | Installs the content displayer component and its layout manager
|
installListeners | protected void installListeners()(Code) | | Installs a component listener on the component. Listeners on the data
model and selection model are installed when the component is shown, as
detected by the component listener.
|
installTabDisplayer | protected void installTabDisplayer()(Code) | | Installs the tab displayer component into the container. By default, installs it using the
constraint BorderLayout.NORTH .
|
installUI | final public void installUI(JComponent c)(Code) | | This method is final. Subclasses which need to provide additional initialization should override
install()
Parameters: c - A JComponent, which must == the displayer field initialized in the constructor |
isShowCloseButton | public boolean isShowCloseButton()(Code) | | |
makeTabVisible | public void makeTabVisible(int tab)(Code) | | |
requestAttention | protected void requestAttention(int tab)(Code) | | |
setShowCloseButton | public void setShowCloseButton(boolean val)(Code) | | |
showComponent | protected Component showComponent(Component c)(Code) | | Shows the passed component. This method does not communicate with
the data model in any way shape or form, it just moves the passed
component to the front. It should only be called in response to an event
from the data model or selection model.
If you override createContentDisplayerLayoutModel() to
provide your own layout manager to arrange the displayed component, you
need to override this to tell the layout (or do whatever is needed) to
change the component that is shown.
Parameters: c - The component to be shown The previously showing component, or null if no change was made |
showComponentWithFxProvider | final protected void showComponentWithFxProvider(Component c)(Code) | | Shows a component in the control, using the FxProvider created in
createFxProvider() to manage showing it. Equivalent to calling showComponent ,
but there may be a delay while the effect is performed. If no FxProvider is installed,
this will simply delegate to showComponent ; if not, the FxProvider is expected
to do that when its effect is completed.
Parameters: c - The component to be shown. |
tabForCoordinate | public int tabForCoordinate(Point p)(Code) | | |
toComp | final protected Component toComp(TabData data)(Code) | | Convenience method for fetching a component from a TabData object
via the container's ComponentConverter
|
uichange | protected boolean uichange()(Code) | | |
uninstall | protected void uninstall()(Code) | | Subclasses may override this method to do anything they need to do on uninstallUI(). It will
be called before the protected fields of the instance have been nulled.
|
uninstallDisplayers | protected void uninstallDisplayers()(Code) | | Uninstalls and nulls references to the content contentDisplayer and tab
contentDisplayer, and removes all components from the content
contentDisplayer.
|
uninstallListeners | protected void uninstallListeners()(Code) | | Uninstalls the component listener installed in installListeners()
|
uninstallUI | final public void uninstallUI(JComponent c)(Code) | | This method is final. Subclasses which need to provide additional initialization should override
uninstall()
Parameters: c - A JComponent, which must == the displayer field initialized in the constructor |
updateOrientation | final protected void updateOrientation()(Code) | | Checks the position of the tabbed container relative to its parent
window, and potentially updates its orientation client property.
See Also: TabDisplayer.PROP_ORIENTATION |
|
|