|
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
org.netbeans.swing.tabcontrol.plaf.AbstractTabDisplayerUI
public abstract class AbstractTabDisplayerUI
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.
Nested Class Summary | |
---|---|
protected class |
AbstractTabDisplayerUI.DisplayerHierarchyListener
A hierarchy listener which registers the component with ToolTipManager when displayed, and de-registers it when hidden |
protected class |
AbstractTabDisplayerUI.DisplayerPropertyChangeListener
A property change listener which will repaint the selected tab when the "active" property changes on the tab displayer |
protected class |
AbstractTabDisplayerUI.ModelListener
Simple implementation of a listener on a TabDataModel. |
Field Summary | |
---|---|
protected ComponentListener |
componentListener
Component listener - mainly used to detach listeners when the component is hidden, and reattach them when it is shown. |
protected HierarchyListener |
hierarchyListener
|
protected TabLayoutModel |
layoutModel
Layout model, which will be initialized in installUI() by calling
createLayoutModel . |
protected AbstractTabDisplayerUI.ModelListener |
modelListener
Listener on the TabDataModel. |
protected MouseListener |
mouseListener
Mouse listener (which may optionally implement MouseWheelListener and MouseMotionListener), which handles mouse events over the tab, triggering selection model changes, repaints, etc. |
protected PropertyChangeListener |
propertyChangeListener
A property change listener to listen on any changes from the component which should trigger repainting or other operations. |
protected ChangeListener |
selectionListener
A change listener which listens on the selection model and repaints as needed when the selection changes. |
Fields inherited from class org.netbeans.swing.tabcontrol.TabDisplayerUI |
---|
displayer, selectionModel |
Constructor Summary | |
---|---|
AbstractTabDisplayerUI(TabDisplayer displayer)
Creates a new instance of AbstractTabDisplayerUI |
Method Summary | |
---|---|
protected ComponentListener |
createComponentListener()
Create a ComponentListener that may be needed to handle resize, show, hide, etc. |
protected Font |
createFont()
|
protected HierarchyListener |
createHierarchyListener()
|
protected abstract TabLayoutModel |
createLayoutModel()
Create an instance of TabLayoutModel which will provide coordinates for tabs |
protected AbstractTabDisplayerUI.ModelListener |
createModelListener()
Create a listener on the data model that triggers repaints on appropriate changes. |
protected abstract 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()
Create a PropertyChangeListener which listens on any interesting properties of the control |
protected abstract ChangeListener |
createSelectionListener()
Create a ChangeListener to be attached to the selection model. |
protected SingleSelectionModel |
createSelectionModel()
Creates an instance of DefaultTabSelectionModel |
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. |
protected void |
installListeners()
Installs the mouse listener returned by createMouseListener into the control. |
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. |
void |
registerShortcuts(JComponent comp)
Does nothing, no shortcuts |
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. |
protected void |
uninstallListeners()
Installs the mouse listener returned by createMouseListener into the control. |
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. |
void |
unregisterShortcuts(JComponent comp)
Does nothing, no shortcuts |
Methods inherited from class org.netbeans.swing.tabcontrol.TabDisplayerUI |
---|
cancelRequestAttention, createImageOfTab, getButtonIcon, getExactTabIndication, getInsertTabIndication, getTabRect, makeTabVisible, postTabAction, requestAttention, shouldPerformAction, tabForCoordinate |
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 TabLayoutModel layoutModel
installUI()
by calling
createLayoutModel
. The layout model provides tab coordinates.
protected MouseListener mouseListener
protected ComponentListener componentListener
protected PropertyChangeListener propertyChangeListener
active
property to trigger a repaint.
protected AbstractTabDisplayerUI.ModelListener modelListener
protected ChangeListener selectionListener
protected HierarchyListener hierarchyListener
Constructor Detail |
---|
public AbstractTabDisplayerUI(TabDisplayer displayer)
Method Detail |
---|
public final void installUI(JComponent c)
install()
,
and refer to the displayer
instance field, which will be initialized here.
installUI
in class TabDisplayerUI
c
- An instance of TabDisplayerpublic final void uninstallUI(JComponent c)
uninstall()
, and remove any listeners, null any unneeded references, etc.
uninstallUI
in class TabDisplayerUI
c
- protected void install()
protected void uninstall()
protected final void installListeners()
protected final void uninstallListeners()
protected HierarchyListener createHierarchyListener()
protected abstract TabLayoutModel createLayoutModel()
protected abstract MouseListener createMouseListener()
protected abstract ChangeListener createSelectionListener()
ChangeListener
to be attached to the selection model. This
listener will be responsible for repainting the appropriate areas on selection changes.
protected Font createFont()
protected AbstractTabDisplayerUI.ModelListener createModelListener()
protected ComponentListener createComponentListener()
protected PropertyChangeListener createPropertyChangeListener()
protected SingleSelectionModel createSelectionModel()
DefaultTabSelectionModel
createSelectionModel
in class TabDisplayerUI
public int dropIndexOfPoint(Point p)
dropIndexOfPoint
in class TabDisplayerUI
p
- A point
protected void modelChanged()
displayer.repaint()
.
protected Point toDropPoint(Point location)
location
- A point in the coordinate space of the container
public void unregisterShortcuts(JComponent comp)
unregisterShortcuts
in class TabDisplayerUI
public void registerShortcuts(JComponent comp)
registerShortcuts
in class TabDisplayerUI
|
org.netbeans.swing.tabcontrol 1.8 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |