|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel bibliothek.gui.dock.focus.AbstractDockableSelection
public abstract class AbstractDockableSelection
This DockableSelection
is also a JPanel
. It implements the
methods needed to interact with DockableSelectionListener
. It uses
the input map
to register actions for when an arrow
key or a controlling key is pressed. This selection also observes the set
of available Dockable
s and their title-text/icon. Subclasses get
automatically informed about changes.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected javax.swing.Action |
CANCEL
Action called when the escape or return key was pressed. |
protected javax.swing.Action |
DOWN
Action called when the down arrow key was pressed. |
protected javax.swing.Action |
LEFT
Action called when the left arrow key was pressed. |
protected javax.swing.Action |
RIGHT
Action called when the right arrow key was pressed. |
protected javax.swing.Action |
SELECT
Action called when the space or enter key was pressed. |
protected javax.swing.Action |
UP
Action called when the up arrow key was pressed. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
AbstractDockableSelection()
Creates a new selection |
Method Summary | |
---|---|
void |
addDockableSelectionListener(DockableSelectionListener listener)
Adds a listener that gets informed when the state of this selection changes. |
protected void |
cancel()
Cancles this selection |
void |
close()
Called when the current selection is no longer needed either because a selection was done or was canceled. |
protected abstract void |
down()
Called when a down arrow key was pressed. |
java.awt.Component |
getComponent()
Gets the component which represents the selection. |
DockController |
getController()
Gets the currently used controller. |
boolean |
hasChoices(DockController controller)
Checks whether controller has at least two different
Dockable s which would be shown on this DockableSelection . |
protected abstract void |
iconChanged(int index,
Dockable dockable)
Called when the icon of dockable changed. |
protected abstract void |
insert(int index,
Dockable dockable)
Called when a new dockable can be selected. |
protected abstract void |
left()
Called when a left arrow key was pressed. |
void |
open(DockController controller)
Called when a new selection is about to happen. |
protected abstract void |
remove(int index,
Dockable dockable)
Called when a dockable is no longer selectable. |
void |
removeDockableSelectionListener(DockableSelectionListener listener)
Removes a listener that gets informed when the state of this selection changes. |
protected abstract void |
right()
Called when a right arrow key was pressed. |
protected void |
select()
Selects the currently selected dockable. |
protected abstract void |
select(Dockable dockable)
Called when this selection is forced to select a specific dockable. |
protected boolean |
selectable(Dockable dockable)
Decides whether dockable fits the requirements for
an element that can be selected. |
protected void |
setSelection(Dockable dockable)
Informs this selection which dockable is currently selected. |
protected abstract void |
titleChanged(int index,
Dockable dockable)
Called when the title text of dockable changed. |
protected abstract void |
up()
Called when an up arrow key was pressed. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final javax.swing.Action UP
protected final javax.swing.Action DOWN
protected final javax.swing.Action LEFT
protected final javax.swing.Action RIGHT
protected final javax.swing.Action CANCEL
protected final javax.swing.Action SELECT
Constructor Detail |
---|
public AbstractDockableSelection()
Method Detail |
---|
public void addDockableSelectionListener(DockableSelectionListener listener)
DockableSelection
addDockableSelectionListener
in interface DockableSelection
listener
- the new listenerpublic void removeDockableSelectionListener(DockableSelectionListener listener)
DockableSelection
removeDockableSelectionListener
in interface DockableSelection
listener
- the new listenerpublic boolean hasChoices(DockController controller)
DockableSelection
controller
has at least two different
Dockable
s which would be shown on this DockableSelection
.
hasChoices
in interface DockableSelection
controller
- the controller which might not have any children at all
true
if opening this DockableSelection
gives
the user a choice, false
if this selection would not show
anythingpublic java.awt.Component getComponent()
DockableSelection
getComponent
in interface DockableSelection
public void open(DockController controller)
DockableSelection
open
in interface DockableSelection
controller
- the controller for which the selection will happenpublic void close()
DockableSelection
close
in interface DockableSelection
public DockController getController()
protected boolean selectable(Dockable dockable)
dockable
fits the requirements for
an element that can be selected.
dockable
- the element to check
true
if dockable
should be shown
on this selectionprotected abstract void up()
protected abstract void down()
protected abstract void left()
protected abstract void right()
protected abstract void insert(int index, Dockable dockable)
index
- the location of the dockable in the list of all known dockables.dockable
- the new elementprotected abstract void remove(int index, Dockable dockable)
index
- the index of the removed elementdockable
- the removed elementprotected abstract void titleChanged(int index, Dockable dockable)
dockable
changed.
index
- the location of dockable
dockable
- the element whose title changedprotected abstract void iconChanged(int index, Dockable dockable)
dockable
changed.
index
- the location of dockable
dockable
- the element whose icon changedprotected abstract void select(Dockable dockable)
dockable
- the element to select, can be null
protected void setSelection(Dockable dockable)
dockable
- the currently selected dockableprotected void cancel()
protected void select()
setSelection(Dockable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |