|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPopupMenu
org.merlotxml.merlot.SizeableJPopupMenuByHeight
Nested Class Summary |
Nested classes inherited from class javax.swing.JPopupMenu |
javax.swing.JPopupMenu.AccessibleJPopupMenu, javax.swing.JPopupMenu.Separator |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected double |
maximumHeight
The maximum number height allowed in a menu |
static java.lang.String |
MORE
More Menu Text - makes changing text easier later |
protected double |
myHeight
Manually keep track of height - getPreferredSize/getSize seems to only work properly after the menu has been dispayed at least once. |
static int |
TASKBAR_HEIGHT
Take into account most window managers have a task or system bar always on top on the bottom of the screen. |
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 | |
SizeableJPopupMenuByHeight()
|
|
SizeableJPopupMenuByHeight(java.lang.String label)
|
Method Summary | |
javax.swing.JMenuItem |
add(javax.swing.Action a)
TEMPORARY - Move to State model once you get height algorithm working Differences between JMenu and JPopup menu make the algorithm somewhat tempermental and a bit unpredictable. |
javax.swing.JMenuItem |
add(javax.swing.JMenuItem menuItem)
Override the JPopupMenu functionality, try to provide illusion of a single menu. |
javax.swing.JMenuItem |
add(java.lang.String string)
Override the JPopupMenu functionality .... |
void |
addSeparator()
Override the JPopup Menu |
void |
finalize()
Additional work needed to finalize and free up memory. |
java.util.Vector |
getAllSubComponents()
Get all Components **MINUS THE MORE BUTTONS** Use vectors, they are easier to work with when working with heavily dynamic stuff. |
java.awt.Component |
getComponentAtIndex(int i)
Override the JPopupMenu functionality |
int |
getComponentIndex(java.awt.Component c)
Override the JPopupMenu functionality |
JMoreMenu |
getMoreMenu()
Convenience helper - get one of the sub-menus if you want to manipulate it directly (For Example - insert a static item.) |
javax.swing.MenuElement[] |
getSubElements()
Override the JPopupMenu functionality |
void |
insert(javax.swing.Action a,
int index)
Override the JPopupMenu functionality NOTE - CODE A MUCH MORE COMPLEX THAN I WOULD LIKE. |
void |
insert(java.awt.Component c,
int index)
Override the JPopupMenu functionality |
void |
insert(java.lang.String string,
int index)
Convenience method. |
void |
insertStatic(java.awt.Component c)
Used to forcibly insert items at the end of the primary menu. |
void |
remove(java.awt.Component c)
Override the JPopupMenu functionality. |
void |
remove(int pos)
Override the JPopupMenu functionality For simplicities sake, do not reshuffle menu for now. |
void |
removeAll()
Override JPopupMenu functionality. |
void |
setBorderPainted(boolean b)
Override the JPopupMenu functionality |
void |
setMaximumHeight(double aHeight)
Set the maximum height of this menu |
void |
setSelected(java.awt.Component c)
Override the JPopupMenu functionality |
void |
show(java.awt.Component invoker,
int x,
int y)
Show - Over the JPopupMenu functionality - try to guard against menu going off the screen. |
int |
SizeableGetItemCount()
I ran out of ideas on how to get it to be invisible, so I added some little helpers. |
Methods inherited from class javax.swing.JPopupMenu |
addPopupMenuListener, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getPopupMenuListeners, getSelectionModel, getUI, getUIClassID, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, removePopupMenuListener, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelectionModel, setUI, setVisible, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int TASKBAR_HEIGHT
public static final java.lang.String MORE
protected double myHeight
protected double maximumHeight
Constructor Detail |
public SizeableJPopupMenuByHeight()
public SizeableJPopupMenuByHeight(java.lang.String label)
Method Detail |
public void finalize()
public javax.swing.JMenuItem add(javax.swing.Action a)
public javax.swing.JMenuItem add(javax.swing.JMenuItem menuItem)
public javax.swing.JMenuItem add(java.lang.String string)
public void addSeparator()
public int getComponentIndex(java.awt.Component c)
public java.awt.Component getComponentAtIndex(int i)
public javax.swing.MenuElement[] getSubElements()
public void insert(javax.swing.Action a, int index)
public void insert(java.awt.Component c, int index)
public void insert(java.lang.String string, int index)
public void remove(java.awt.Component c)
public void remove(int pos)
public void removeAll()
public java.util.Vector getAllSubComponents()
public void show(java.awt.Component invoker, int x, int y)
public void setSelected(java.awt.Component c)
public void setBorderPainted(boolean b)
public int SizeableGetItemCount()
public void setMaximumHeight(double aHeight)
public JMoreMenu getMoreMenu()
public void insertStatic(java.awt.Component c)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |