| org.netbeans.swing.tabcontrol.TabDisplayerUI org.netbeans.swing.tabcontrol.plaf.AbstractTabDisplayerUI
All known Subclasses: org.netbeans.swing.tabcontrol.plaf.BasicTabDisplayerUI, org.netbeans.swing.tabcontrol.plaf.BasicSlidingTabDisplayerUI, org.netbeans.swing.tabcontrol.plaf.ToolbarTabDisplayerUI,
AbstractTabDisplayerUI | abstract public class AbstractTabDisplayerUI extends TabDisplayerUI (Code) | | Base class for the implementations of TabDisplayerUI in this package. Uses
TabLayoutModel for managing the layout of the tabs. Defines an SPI for
UI delegates for TabDisplayer.
For most use cases, it will make more sense to subclass BasicTabDisplayerUI or
BasicScrollingTabDisplayerUI, which handle most of the logic any implementation
will need.
See Also: BasicTabDisplayerUI See Also: BasicScrollingTabDisplayerUI author: Tim Boudreau |
Method Summary | |
protected ComponentListener | createComponentListener() Create a ComponentListener that may be needed to handle resize, show,
hide, etc. | protected Font | createFont() | protected HierarchyListener | createHierarchyListener() | abstract protected TabLayoutModel | createLayoutModel() | protected ModelListener | createModelListener() Create a listener on the data model that triggers repaints on appropriate
changes. | abstract 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 PropertyChangeListener | createPropertyChangeListener() | abstract protected ChangeListener | createSelectionListener() Create a ChangeListener to be attached to the selection model. | protected SingleSelectionModel | createSelectionModel() | public int | dropIndexOfPoint(Point p) A very basic implementation of dropIndexOfPoint, which simply iterates
all of the tab rectangles to see if they contain the point. | protected void | install() Called after creating the layout model, selection model and mouse
listener, but before installing the mouse listener and selection model. | final protected void | installListeners() Installs the mouse listener returned by createMouseListener into the
control. | final public void | installUI(JComponent c) installUI is final to ensure listeners, etc. | protected void | modelChanged() Convenience method called by ModelListener.stateChanged() when the data model changes.
Eliminates the need for custom subclasses where the only purpose is to discard some
small amount of cached data. | public void | registerShortcuts(JComponent comp) | protected Point | toDropPoint(Point location) Converts a point into a point in the coordinate space of the tabs area, for
determining what index a drop operation should affect. | 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. | final protected void | uninstallListeners() Installs the mouse listener returned by createMouseListener into the
control. | final public void | uninstallUI(JComponent c) This method is final - subclasses that need to deinitialize should override
uninstall() , and remove any listeners, null any unneeded references, etc. | public void | unregisterShortcuts(JComponent comp) |
componentListener | protected ComponentListener componentListener(Code) | | Component listener - mainly used to detach listeners when the component is hidden,
and reattach them when it is shown. Also used by BasicScrollingTabDisplayerUI to
trigger re-layouts of scrolled tabs when the size of the component changes.
|
layoutModel | protected TabLayoutModel layoutModel(Code) | | Layout model, which will be initialized in installUI() by calling
createLayoutModel . The layout model provides tab coordinates.
|
modelListener | protected ModelListener modelListener(Code) | | Listener on the TabDataModel. Responsible for repainting on model changes. Note that
DefaultTabSelectionModel also listens on the model and automatically updates the
selected index if, say, tabs are inserted before the currently selected tab.
|
mouseListener | protected MouseListener mouseListener(Code) | | Mouse listener (which may optionally implement MouseWheelListener and MouseMotionListener),
which handles mouse events over the tab, triggering selection model changes, repaints, etc.
|
propertyChangeListener | protected PropertyChangeListener propertyChangeListener(Code) | | A property change listener to listen on any changes from the component which should
trigger repainting or other operations. The default implementation simply listens for
changes in the active property to trigger a repaint.
|
selectionListener | protected ChangeListener selectionListener(Code) | | A change listener which listens on the selection model and repaints as needed when
the selection changes.
|
AbstractTabDisplayerUI | public AbstractTabDisplayerUI(TabDisplayer displayer)(Code) | | Creates a new instance of AbstractTabDisplayerUI
|
createComponentListener | protected ComponentListener createComponentListener()(Code) | | Create a ComponentListener that may be needed to handle resize, show,
hide, etc. Returns null by default.
|
createLayoutModel | abstract protected TabLayoutModel createLayoutModel()(Code) | | Create an instance of TabLayoutModel which will provide coordinates for
tabs
|
createModelListener | protected ModelListener createModelListener()(Code) | | Create a listener on the data model that triggers repaints on appropriate
changes.
|
createMouseListener | abstract protected MouseListener createMouseListener()(Code) | | Create the mouse listener that will be responsible for changing the
selection on mouse events, triggering repaints on mouse enter/exit/motion, etc.
The installation code will detect if the resulting listener also implements
MouseWheelListener or MouseMotionListener, and if so, will add it as such.
A mouse listener, which may also implement MouseMotionListener and/orMouseWheelListener |
createPropertyChangeListener | protected PropertyChangeListener createPropertyChangeListener()(Code) | | Create a PropertyChangeListener which listens on any interesting
properties of the control
|
createSelectionListener | abstract protected ChangeListener createSelectionListener()(Code) | | Create a ChangeListener to be attached to the selection model. This
listener will be responsible for repainting the appropriate areas on selection changes.
A changeListener that will be notified of selection changes |
dropIndexOfPoint | public int dropIndexOfPoint(Point p)(Code) | | A very basic implementation of dropIndexOfPoint, which simply iterates
all of the tab rectangles to see if they contain the point. It is
preferred to override this and provide a more efficient implementation
unless the UI is not designed to display more than a few tabs.
Parameters: p - A point The index, or -1 if none |
install | protected void install()(Code) | | Called after creating the layout model, selection model and mouse
listener, but before installing the mouse listener and selection model.
Subclasses may use this method to do anything they need to do at ui
install time.
|
installListeners | final protected void installListeners()(Code) | | Installs the mouse listener returned by createMouseListener into the
control. If the mouse listener implements MouseMotionListener or
MouseWheelListener, it will be installed as such as well.
|
installUI | final public void installUI(JComponent c)(Code) | | installUI is final to ensure listeners, etc. are created and attached. Subclasses that
need to perform initialization on install should override install() ,
and refer to the displayer instance field, which will be initialized here.
Parameters: c - An instance of TabDisplayer |
modelChanged | protected void modelChanged()(Code) | | Convenience method called by ModelListener.stateChanged() when the data model changes.
Eliminates the need for custom subclasses where the only purpose is to discard some
small amount of cached data. The default implementation simply calls displayer.repaint() .
|
registerShortcuts | public void registerShortcuts(JComponent comp)(Code) | | Does nothing, no shortcuts
|
toDropPoint | protected Point toDropPoint(Point location)(Code) | | Converts a point into a point in the coordinate space of the tabs area, for
determining what index a drop operation should affect.
Parameters: location - A point in the coordinate space of the container A point in the coordinate space of the tab display area |
uninstall | protected void uninstall()(Code) | | Called after uninstalling the mouse listener and selection model, but
before references to that or the layout model or displayer have been
nulled. Subclasses may use this method to do any cleanup they need to do
at uninstall time.
|
uninstallListeners | final protected void uninstallListeners()(Code) | | Installs the mouse listener returned by createMouseListener into the
control. If the mouse listener implements MouseMotionListener or
MouseWheelListener, it will be removed as such as well.
|
uninstallUI | final public void uninstallUI(JComponent c)(Code) | | This method is final - subclasses that need to deinitialize should override
uninstall() , and remove any listeners, null any unneeded references, etc.
Parameters: c - |
unregisterShortcuts | public void unregisterShortcuts(JComponent comp)(Code) | | Does nothing, no shortcuts
|
|
|