class org.aswing.JMenu extends JMenuItem

An implementation of a menu -- a popup window containing JMenuItems that is displayed when the user selects an item on the JMenuBar. In addition to JMenuItems, a JMenu can also contain JSeparators.

In essence, a menu is a button with an associated JPopupMenu. When the "button" is pressed, the JPopupMenu appears. If the "button" is on the JMenuBar, the menu is a top-level window. If the "button" is another menu item, then the JPopupMenu is "pull-right" menu.

@author paling

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from JMenuItem

var accelerator:KeyType
var isExternalAction:Bool
var menuInUse:Bool
var subpath:String
function getMenuComponent():Component
function getRootPaneOwner():JRootPane
function getSubElements():Array<Dynamic>
function isInUse():Bool
function menuSelectionChanged(isIncluded:Bool):Void
function processKeyEvent(code:Int):Void
function setInUse(b:Bool):Void

Inherited from AbstractButton

var command:Command
var disabledIcon:Icon
var disabledSelectedIcon:Icon
var displayText:String
var horizontalAlignment:Int
var horizontalTextPosition:Int
var icon:Icon
var iconTextGap:Int
var iconTextGapSet:Bool
var margin:Insets
var mnemonic:Int
var mnemonicEnabled:Bool
var mnemonicIndex:Int
var model:ButtonModel
var pressedIcon:Icon
var rolloverEnabled:Bool
var rolloverIcon:Icon
var rolloverSelectedIcon:Icon
var selected:Bool
var selectedIcon:Icon
var shiftOffset:Int
var shiftOffsetSet:Bool
var text:String
var textFilters:Array<BitmapFilter>
var transitBackgroundFactor:Float
var verticalAlignment:Int
var verticalTextPosition:Int
function addActionListener(listener:Dynamic ->Void?priority:Int, ?useWeakReference:Bool):Void
function addSelectionListener(listener:Dynamic ->Void?priority:Int, ?useWeakReference:Bool):Void
function addStateListener(listener:Dynamic ->Void?priority:Int, ?useWeakReference:Bool):Void
function doClick():Void
function removeActionListener(listener:Dynamic ->Void):Void
function removeSelectionListener(listener:Dynamic ->Void):Void
function removeStateListener(listener:Dynamic ->Void):Void
function updateUI():Void
function wrapSimpleButton(btn:SimpleButton):AbstractButton

Inherited from Component

var __fieldBindings__:FieldsBindSignal
var __methodBindings__:MethodsBindSignal
var alignmentX:Float
var alignmentY:Float
var background:ASColor
var backgroundDecorator:GroundDecorator
var border:Border
var bounds:IntRectangle
var clipBounds:IntRectangle
var constraints:Dynamic
var currentSize:IntDimension
var dragEnabled:Bool
var dropTrigger:Bool
var enabled:Bool
var focusable:Bool
var focusableSet:Bool
var font:ASFont
var foreground:ASColor
var foregroundDecorator:GroundDecorator
var location:IntPoint
var maximumSize:IntDimension
var mideground:ASColor
var minimumSize:IntDimension
var opaque:Bool
var opaqueSet:Bool
var preferredSize:IntDimension
var resizerMargin:Insets
var styleProxy:Component
var styleTune:StyleTune
var toolTipText:String
var transitFocusFactor:Float
var ui:ComponentUI
var uiElement:Bool
var visibility:Bool
function addDragAcceptableInitiator(com:Component):Void
function componentToGlobal(p:IntPoint):IntPoint
function getClientProperty(key:String, ?defaultValue:Dynamic):Dynamic
function getDefaultBasicUIClass():Class<Dynamic>
function getFocusManager():FocusManager
function getGlobalLocation(?rv:IntPoint):IntPoint
function getInsets():Insets
function getInternalFocusObject():InteractiveObject
function getKeyboardManager():KeyboardManager
function getMousePosition():IntPoint
function getPaintBounds():IntRectangle
function getParent():Container
function getRootPaneAncestor():JRootPane
function getUIClassID():String
function globalToComponent(p:IntPoint):IntPoint
function hitTestMouse():Bool
function invalidate():Void
function invalidatePreferSizeCaches():Void
function isCachePreferSizes():Bool
function isDragAcceptableInitiator(com:Component):Bool
function isFocusOwner():Bool
function isFontValidated():Bool
function isOnStage():Bool
function isShowing():Bool
function isValid():Bool
function isValidateRoot():Bool
function makeFocus():Void
function pack():Void
function paintFocusRect(?force:Bool):Void
function paintImmediately():Void
function parentReAppendChildren():Void
function putClientProperty(key:String, value:Dynamic):Void
function reAppendToParent(?constraints:Dynamic):Void
function removeDragAcceptableInitiator(com:Component):Void
function removeFromContainer():Void
function repaint():Void
function repaintAndRevalidate():Void
function requestFocus():Bool
function revalidate():Void
function setCachePreferSizes(b:Bool):Void
function setClipSize(size:IntDimension):Void
function setDragAcceptableInitiatorAppraiser(func:Dynamic ->Bool):Void
function setFontValidated(b:Bool):Void
function setGlobalLocation(gp:IntPoint):Void
function transferFocus():Bool
function transferFocusBackward():Bool
function updateUI():Void
function validate():Void

Inherited from AWSprite

function bringToBottom(child:DisplayObject):Void
function bringToTop(child:DisplayObject):Void
function containsChild(child:DisplayObject):Bool
function getHighestIndexUnderForeground():Int
function getLowestIndexAboveBackground():Int
function isClipMasked():Bool
function setChildIndex(child:DisplayObject, index:Int):Void
function setClipMaskRect(b:IntRectangle):Void
function setClipMasked(m:Bool):Void
function toString():String

Inherited from Sprite

var buttonMode:Bool
var dropTarget:DisplayObject
var graphics:Graphics
var hitArea:Sprite
var soundTransform:SoundTransform
var useHandCursor:Bool
function startDrag(?lockCenter:Bool, ?bounds:Rectangle):Void
function startTouchDrag(touchPointID:Int, ?lockCenter:Bool, ?bounds:Rectangle):Void
function stopDrag():Void
function stopTouchDrag(touchPointID:Int):Void

Inherited from DisplayObjectContainer

var mouseChildren:Bool
var numChildren:Int
var tabChildren:Bool
var textSnapshot:TextSnapshot
function addChild(child:DisplayObject):DisplayObject
function addChildAt(child:DisplayObject, index:Int):DisplayObject
function areInaccessibleObjectsUnderPoint(point:Point):Bool
function contains(child:DisplayObject):Bool
function getChildAt(index:Int):DisplayObject
function getChildByName(name:String):DisplayObject
function getChildIndex(child:DisplayObject):Int
function getObjectsUnderPoint(point:Point):Array<DisplayObject>
function removeChild(child:DisplayObject):DisplayObject
function removeChildAt(index:Int):DisplayObject
function setChildIndex(child:DisplayObject, index:Int):Void
function swapChildren(child1:DisplayObject, child2:DisplayObject):Void
function swapChildrenAt(index1:Int, index2:Int):Void

Inherited from InteractiveObject

var accessibilityImplementation:AccessibilityImplementation
var contextMenu:ContextMenu
var doubleClickEnabled:Bool
var focusRect:Dynamic
var mouseEnabled:Bool
var tabEnabled:Bool
var tabIndex:Int

Inherited from DisplayObject

var accessibilityProperties:AccessibilityProperties
var alpha:Float
var blendMode:BlendMode
var blendShader:Shader
var cacheAsBitmap:Bool
var filters:Array<BitmapFilter>
var height:Float
var loaderInfo:LoaderInfo
var mask:DisplayObject
var mouseX:Float
var mouseY:Float
var name:String
var opaqueBackground:Null<UInt>
var parent:DisplayObjectContainer
var root:DisplayObject
var rotation:Float
var rotationX:Float
var rotationY:Float
var rotationZ:Float
var scale9Grid:Rectangle
var scaleX:Float
var scaleY:Float
var scaleZ:Float
var scrollRect:Rectangle
var stage:Stage
var transform:Transform
var visible:Bool
var width:Float
var x:Float
var y:Float
var z:Float
function getBounds(targetCoordinateSpace:DisplayObject):Rectangle
function getRect(targetCoordinateSpace:DisplayObject):Rectangle
function globalToLocal(point:Point):Point
function globalToLocal3D(point:Point):Vector3D
function hitTestObject(obj:DisplayObject):Bool
function hitTestPoint(x:Float, y:Float, ?shapeFlag:Bool):Bool
function local3DToGlobal(point3d:Vector3D):Point
function localToGlobal(point:Point):Point

Inherited from EventDispatcher

function addEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool, ?priority:Int, ?useWeakReference:Bool):Void
function dispatchEvent(event:Event):Bool
function hasEventListener(type:String):Bool
function removeEventListener(type:String, listener:Dynamic ->Void?useCapture:Bool):Void
function toString():String
function willTrigger(type:String):Bool

var delay:Int

The suggested delay, in milliseconds, before submenus are popped up or down.

Each look and feel (L&F) may determine its own policy for observing the delay property.

In most cases, the delay is not observed for top level menus or while dragging. The default for delay is 0. This method is a property of the look and feel code and is used to manage the idiosyncracies of the various UI implementations.

var popupMenuVisible:Bool

The visibility of the menu's popup. If the menu is not enabled, this method will have no effect.

function new(?text:String = '', ?icon:Icon = null): Void

function addMenuItem(s:String): JMenuItem

Creates a new menu item with the specified text and appends it to the end of this menu.

s

the string for the menu item to be added

function append(c:Component): Void

Adds a component(generally JMenuItem or JSeparator) to this menu.

function getComponent(index:Int): Component

Returns the component at position index.

n

the position of the component to be returned

returns

the component requested, or null if there is no popup menu or no component at the position.

function getComponentCount(): Int

Returns the number of components on the menu.

returns

an integer containing the number of components on the menu

function getPopupMenu(): JPopupMenu

Returns the popupMenu for the Menu

function insert(i:Int, c:Component): Void

Inserts a component(generally JMenuItem or JSeparator) to this menu.

function isMenuComponent(c:Component): Bool

Returns true if the specified component exists in the submenu hierarchy.

c

the Component to be tested

returns

true if the Component exists, false otherwise

function isTopLevelMenu(): Bool

Returns true if the menu is a 'top-level menu', that is, if it is the direct child of a menubar.

returns

true if the menu is activated from the menu bar; false if the menu is activated from a menu item on another menu

function remove(c:Component): Component

Remove the specified component.

returns

the component just removed, null if the component is not in this menu.

function removeAll(): Void

Remove all components in the menu.

function removeAt(i:Int): Component

Remove the specified index component.

i

the index of component.

returns

the component just removed. or null there is not component at this position.