public class Selector extends JWindow implements LayoutManager
The animation behaviour of selectors can be controlled globally via static method calls. This way the animation can be turned off if not desired.
Modifier and Type | Class and Description |
---|---|
static class |
Selector.Location
An enumator used for indicating where the selector window will be shown.
|
JWindow.AccessibleJWindow
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Selector(String title,
JComponent parentComponent,
JComponent contentComponent,
Selector.Location location)
Constructs a new selector window.
|
Selector(String title,
JComponent parentComponent,
Selector.Location location)
Constructs a new selector window without specifying a content component.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutComponent(String name,
Component comp) |
JLabel |
getCloseSelectorLabel()
Returns the label used for closing the selector.
|
JComponent |
getContentComponent()
Returns the component that is shown as the selector 'content'.
|
JPanel |
getFooterPanel()
Returns the panel used as a footer in the bottom of the selector.
|
static int |
getGlobalAnimationDuration()
Returns the duration used for the show / hide animation.
|
JPanel |
getHeaderPanel()
Returns the panel that contains the title label and the close icon.
|
JComponent |
getParentComponent()
Returns the parent component, which is the component to which the
selector window gets hooked.
|
Selector.Location |
getSelectorLocation()
Returns the location where the selector will appear (above, below, to the
left, or to the right of the parent component).
|
JLabel |
getTitleLabel()
Returns the label used for displaying the title of the selector window.
|
boolean |
isAnimationEnabled()
Returns the flag that individually determines whether the selector will
use an animation to show or hide itself.
|
boolean |
isAutoHideEnabled()
Determines if the selector will be automatically hidden when the selector
window looses its focus.
|
static boolean |
isGlobalAnimationEnabled()
Returns the (global) flag for signalling whether all selectors will use
an animation when showing up or hiding.
|
static boolean |
isGlobalAutoHideEnabled()
Determines whether selectors will be automatically hidden when the
selector windows loose their focus.
|
void |
layoutContainer(Container parent) |
Dimension |
minimumLayoutSize(Container parent) |
Dimension |
preferredLayoutSize(Container parent) |
void |
removeLayoutComponent(Component comp) |
void |
setAnimationEnabled(boolean enabled)
Sets the flag that individually determines whether the selector will use
an animation to show or hide itself.
|
void |
setAutoHideEnabled(boolean enabled)
Specifies whether the selector will be automatically hidden when the
selector window looses its focus.
|
void |
setContentComponent(JComponent comp)
Sets the content of the selector window.
|
static void |
setGlobalAnimationDuration(int duration)
Sets the duration used for the show / hide animation.
|
static void |
setGlobalAnimationEnabled(boolean enabled)
Specifies whether the selector windows will use animations when showing
or hiding themselves.
|
static void |
setGlobalAutoHideEnabled(boolean enabled)
Specifies globally whether selectors will be automatically hidden when
the selector windows loose their focus.
|
void |
setVisible(boolean b)
Overrides the standard method in order to implement a nice looking
animation (slide in / out) of the selector window.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update, windowInit
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBackground, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setOpacity, setShape, setSize, setSize, setType, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public Selector(String title, JComponent parentComponent, JComponent contentComponent, Selector.Location location)
title
- the title of the selector windowparentComponent
- the parent component to which the selector gets hookedcontentComponent
- the content component that will be shown inside the selectorlocation
- the location where the selector window will be shownpublic Selector(String title, JComponent parentComponent, Selector.Location location)
setContentComponent(JComponent)
to set the component before
the selector gets shown for the first time.title
- the title of the selector windowparentComponent
- the parent component to which the selector gets hookedlocation
- the location where the selector window will be shownpublic void setAutoHideEnabled(boolean enabled)
enabled
- if TRUE the selector window will automatically hidepublic boolean isAutoHideEnabled()
public void setContentComponent(JComponent comp)
comp
- the content componentpublic JComponent getContentComponent()
public void setVisible(boolean b)
setVisible
in class Window
setAnimationEnabled(boolean)
,
setGlobalAnimationEnabled(boolean)
public boolean isAnimationEnabled()
public void setAnimationEnabled(boolean enabled)
enabled
- if TRUE if the selector window uses an animation to show or
hide itselfpublic JComponent getParentComponent()
public void addLayoutComponent(String name, Component comp)
addLayoutComponent
in interface LayoutManager
public void layoutContainer(Container parent)
layoutContainer
in interface LayoutManager
public Dimension minimumLayoutSize(Container parent)
minimumLayoutSize
in interface LayoutManager
public Dimension preferredLayoutSize(Container parent)
preferredLayoutSize
in interface LayoutManager
public void removeLayoutComponent(Component comp)
removeLayoutComponent
in interface LayoutManager
public Selector.Location getSelectorLocation()
public JLabel getTitleLabel()
public JPanel getHeaderPanel()
public static boolean isGlobalAnimationEnabled()
public static void setGlobalAnimationEnabled(boolean enabled)
enabled
- if TRUE all selectors will use animationspublic static int getGlobalAnimationDuration()
public static void setGlobalAnimationDuration(int duration)
duration
- the duration of the show / hide animationpublic static void setGlobalAutoHideEnabled(boolean enabled)
enabled
- if TRUE then all selector windows will automatically hidepublic static boolean isGlobalAutoHideEnabled()
public JPanel getFooterPanel()
public JLabel getCloseSelectorLabel()
Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.