|
||||||||||
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 com.alee.laf.panel.WebPanel com.alee.utils.swing.WebHeavyWeightPopup com.alee.extended.menu.WebDynamicMenu
public class WebDynamicMenu
Custom dynamic menu with pretty display/hide animations.
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected double |
angleRange
Angle which is available for menu elements. |
protected WebTimer |
animator
Animation timer. |
protected boolean |
clockwise
Menu animation direction. |
protected float |
currentProgress
Menu display progress. |
protected boolean |
displaying
Whether menu is being displayed or not. |
protected GlobalFocusListener |
focusListener
Custom global focus listener that closes menu. |
protected WindowFollowAdapter |
followAdapter
Invoker window follow adapter. |
protected DynamicMenuType |
hideType
Menu hide animation type. |
protected boolean |
hiding
Whether menu is being hidden or not. |
protected int |
hidingCause
Index of menu item that caused menu to close. |
protected java.util.List<WebDynamicMenuItem> |
items
Menu items list. |
protected java.lang.Object |
lsync
Listeners synchronization object. |
protected java.awt.event.AWTEventListener |
mouseListener
Custom global mouse listener that closes menu. |
protected java.util.List<java.lang.Runnable> |
onFullDisplay
Actions to perform on full display. |
protected java.util.List<java.lang.Runnable> |
onFullHide
Actions to perform on full hide. |
protected int |
radius
Radius of the menu background in px. |
protected double |
startingAngle
First element position angle in degrees. |
protected float |
stepProgress
Single animation step progress. |
protected java.lang.Object |
sync
Actions synchronization object. |
protected DynamicMenuType |
type
Menu animation type. |
Fields inherited from class com.alee.utils.swing.WebHeavyWeightPopup |
---|
closeOnOuterAction, followInvoker, invoker, invokerWindow, listeners, opacity, opaque, popup, window |
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 | |
---|---|
WebDynamicMenu()
Constructs new dynamic menu. |
Method Summary | |
---|---|
WebImage |
addItem(javax.swing.ImageIcon icon)
|
WebImage |
addItem(javax.swing.ImageIcon icon,
java.awt.event.ActionListener action)
|
WebImage |
addItem(WebDynamicMenuItem item)
|
protected void |
destroyMenuWindow()
Disposes old menu window. |
protected void |
displayMenuWindow(java.awt.Component invoker,
java.awt.Point location)
Creates new menu window. |
void |
fullyDisplayed()
Performs actions waiting for menu display animation finish. |
void |
fullyHidden()
Performs actions waiting for menu hide animation finish. |
DynamicMenuLayout |
getActualLayout()
Returns actual menu layout manager. |
double |
getAngleRange()
|
WebTimer |
getAnimator()
|
float |
getCurrentProgress()
|
DynamicMenuType |
getHideType()
|
int |
getHidingCause()
Returns index of menu item that caused menu to close. |
double |
getItemAngle(java.awt.Component item)
Returns menu item angle relative to vertical axis. |
double |
getItemAngle(int index)
Returns menu item angle relative to vertical axis. |
java.util.List<WebDynamicMenuItem> |
getItems()
|
int |
getRadius()
|
double |
getStartingAngle()
|
float |
getStepProgress()
|
DynamicMenuType |
getType()
|
static void |
hideAllDynamicMenus()
Hides all visible dynamic menus. |
void |
hideMenu()
Hides dynamic menu. |
void |
hideMenu(int index)
Hides dynamic menu. |
WebHeavyWeightPopup |
hidePopup()
|
static boolean |
isAnyDynamicMenuDisplayed()
Returns whether any dynamic menu is currently displayed or not. |
boolean |
isClockwise()
|
boolean |
isDisplaying()
|
boolean |
isHiding()
|
void |
onFullDisplay(java.lang.Runnable action)
Performs provided action when menu is fully displayed. |
void |
onFullHide(java.lang.Runnable action)
Performs provided action when menu is fully hidden. |
void |
setAngleRange(double angleRange)
|
void |
setClockwise(boolean clockwise)
|
void |
setHideType(DynamicMenuType hideType)
|
void |
setRadius(int radius)
|
void |
setStartingAngle(double startingAngle)
|
void |
setStepProgress(float stepProgress)
|
void |
setType(DynamicMenuType type)
|
void |
showMenu(java.awt.Component invoker,
java.awt.Point location)
Displays dynamic menu for the specified invoker location. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
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, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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 int radius
protected double startingAngle
protected double angleRange
protected float stepProgress
protected DynamicMenuType type
protected DynamicMenuType hideType
protected boolean clockwise
protected java.util.List<WebDynamicMenuItem> items
protected float currentProgress
protected final java.lang.Object sync
protected WebTimer animator
protected WindowFollowAdapter followAdapter
protected boolean displaying
protected boolean hiding
protected int hidingCause
protected java.awt.event.AWTEventListener mouseListener
protected GlobalFocusListener focusListener
protected final java.lang.Object lsync
protected final java.util.List<java.lang.Runnable> onFullDisplay
protected final java.util.List<java.lang.Runnable> onFullHide
Constructor Detail |
---|
public WebDynamicMenu()
Method Detail |
---|
public int getRadius()
public void setRadius(int radius)
public double getStartingAngle()
public void setStartingAngle(double startingAngle)
public double getAngleRange()
public void setAngleRange(double angleRange)
public float getStepProgress()
public void setStepProgress(float stepProgress)
public DynamicMenuType getType()
public void setType(DynamicMenuType type)
public DynamicMenuType getHideType()
public void setHideType(DynamicMenuType hideType)
public boolean isClockwise()
public void setClockwise(boolean clockwise)
public java.util.List<WebDynamicMenuItem> getItems()
public WebImage addItem(javax.swing.ImageIcon icon)
public WebImage addItem(javax.swing.ImageIcon icon, java.awt.event.ActionListener action)
public WebImage addItem(WebDynamicMenuItem item)
public float getCurrentProgress()
public WebTimer getAnimator()
public boolean isDisplaying()
public boolean isHiding()
public int getHidingCause()
public void showMenu(java.awt.Component invoker, java.awt.Point location)
invoker
- menu invokerlocation
- menu locationprotected void displayMenuWindow(java.awt.Component invoker, java.awt.Point location)
invoker
- menu invokerlocation
- menu locationpublic WebHeavyWeightPopup hidePopup()
hidePopup
in class WebHeavyWeightPopup
public void hideMenu()
public void hideMenu(int index)
index
- menu item that forced menu to hideprotected void destroyMenuWindow()
public void onFullDisplay(java.lang.Runnable action)
action
- action to performpublic void fullyDisplayed()
public void onFullHide(java.lang.Runnable action)
action
- action to performpublic void fullyHidden()
public double getItemAngle(java.awt.Component item)
item
- menu item
public double getItemAngle(int index)
index
- menu item index
public DynamicMenuLayout getActualLayout()
public static boolean isAnyDynamicMenuDisplayed()
public static void hideAllDynamicMenus()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |