com.jmex.bui
Class BPopupMenu

java.lang.Object
  extended by com.jmex.bui.BComponent
      extended by com.jmex.bui.BContainer
          extended by com.jmex.bui.BWindow
              extended by com.jmex.bui.BPopupWindow
                  extended by com.jmex.bui.BPopupMenu
All Implemented Interfaces:
Comparable<BWindow>
Direct Known Subclasses:
BComboBox.ComboPopupMenu

public class BPopupMenu
extends BPopupWindow

Displays a popup menu of items, one of which can be selected.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jmex.bui.BContainer
BContainer.ChildOp
 
Field Summary
protected  int _columns
           
 
Fields inherited from class com.jmex.bui.BWindow
_layer, _modal, _parentWindow, _root, _savedFocus, _style
 
Fields inherited from class com.jmex.bui.BContainer
_children, _layout
 
Fields inherited from class com.jmex.bui.BComponent
_alpha, _backgrounds, _bbuf, _borders, _colors, _cursor, _enabled, _height, _hover, _insets, _listeners, _parent, _preferredSize, _properties, _styleClass, _tipmouse, _tipStyle, _tiptext, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES
 
Constructor Summary
BPopupMenu(BWindow parent)
           
BPopupMenu(BWindow parent, boolean horizontal)
           
BPopupMenu(BWindow parent, int columns)
           
 
Method Summary
 void addMenuItem(BMenuItem item)
          Adds the supplied item to this menu.
 boolean dispatchEvent(BEvent event)
          Instructs this component to process the supplied event.
protected  String getDefaultStyleClass()
          Returns the default stylesheet class to be used for all instances of this component.
protected  void itemSelected(BMenuItem item, long when, int modifiers)
          Called by any child BMenuItems when they are selected.
protected  void packAndFit(int x, int y, boolean above)
          Called after we have been added to the display heirarchy to pack and position this popup window.
 void setPreferredColumns(int columns)
          Sets the preferred number of columns.
 
Methods inherited from class com.jmex.bui.BPopupWindow
popup, shouldShadeBehind
 
Methods inherited from class com.jmex.bui.BWindow
center, compareTo, dismiss, getLayer, getParentWindow, getRootNode, getStyleSheet, gotFocus, invalidate, isAdded, isModal, isOverlay, pack, pack, requestFocus, setBounds, setLayer, setModal, setParent, setParentWindow, setRootNode
 
Methods inherited from class com.jmex.bui.BContainer
add, add, add, add, applyOperation, computePreferredSize, getComponent, getComponentCount, getComponentIndex, getHitComponent, getLayoutManager, getNextFocus, getPreviousFocus, layout, remove, remove, removeAll, renderComponent, replace, setAlpha, setEnabled, setLayoutManager, setVisible, validate, wasAdded, wasRemoved
 
Methods inherited from class com.jmex.bui.BComponent
acceptsFocus, addListener, applyDefaultStates, boundsToString, changeCursor, configureStyle, createTooltipComponent, emitEvent, getAbsoluteX, getAbsoluteY, getAlpha, getBackground, getBorder, getBounds, getColor, getCursor, getFocusTarget, getHeight, getInsets, getNextFocus, getParent, getPreferredSize, getPreviousFocus, getProperty, getState, getStateCount, getStatePseudoClass, getStyleClass, getTooltipText, getWidth, getWindow, getX, getY, hasFocus, intersectScissorBox, isEnabled, isShowing, isTooltipRelativeToMouse, isValid, isVisible, removeAllListeners, removeListener, render, renderBackground, renderBorder, requestFocus, restoreScissorState, setBackground, setCursor, setLocation, setPreferredSize, setPreferredSize, setProperty, setSize, setStyleClass, setTooltipRelativeToMouse, setTooltipText, stateDidChange, updateCursor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_columns

protected int _columns
Constructor Detail

BPopupMenu

public BPopupMenu(BWindow parent)

BPopupMenu

public BPopupMenu(BWindow parent,
                  boolean horizontal)

BPopupMenu

public BPopupMenu(BWindow parent,
                  int columns)
Method Detail

addMenuItem

public void addMenuItem(BMenuItem item)
Adds the supplied item to this menu.


setPreferredColumns

public void setPreferredColumns(int columns)
Sets the preferred number of columns. Will relayout the existing menu items into the preferred number of columns, but may add more columns if the menu will not fit in the vertical space.


dispatchEvent

public boolean dispatchEvent(BEvent event)
Description copied from class: BComponent
Instructs this component to process the supplied event. If the event is not processed, it will be passed up to its parent component for processing. Derived classes should thus only call super.dispatchEvent for events that they did not "consume".

Overrides:
dispatchEvent in class BComponent
Returns:
true if this event was consumed, false if not.

getDefaultStyleClass

protected String getDefaultStyleClass()
Description copied from class: BComponent
Returns the default stylesheet class to be used for all instances of this component. Derived classes will likely want to override this method and set up a default class for their type of component.

Overrides:
getDefaultStyleClass in class BPopupWindow

packAndFit

protected void packAndFit(int x,
                          int y,
                          boolean above)
Description copied from class: BPopupWindow
Called after we have been added to the display heirarchy to pack and position this popup window.

Overrides:
packAndFit in class BPopupWindow

itemSelected

protected void itemSelected(BMenuItem item,
                            long when,
                            int modifiers)
Called by any child BMenuItems when they are selected.



Copyright © 2008 Michael Bayne. All Rights Reserved.