Class MenuItem

java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.Group
com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
com.badlogic.gdx.scenes.scene2d.ui.Table
com.badlogic.gdx.scenes.scene2d.ui.Button
gaiasky.util.scene2d.MenuItem
All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Cullable, com.badlogic.gdx.scenes.scene2d.utils.Disableable, com.badlogic.gdx.scenes.scene2d.utils.Layout

public class MenuItem extends com.badlogic.gdx.scenes.scene2d.ui.Button
  • Nested Class Summary Link icon

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class com.badlogic.gdx.scenes.scene2d.ui.Button Link icon

    com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle

    Nested classes/interfaces inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table Link icon

    com.badlogic.gdx.scenes.scene2d.ui.Table.Debug, com.badlogic.gdx.scenes.scene2d.ui.Table.DebugRect
  • Field Summary Link icon

    Fields inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table Link icon

    backgroundBottom, backgroundLeft, backgroundRight, backgroundTop, debugActorColor, debugCellColor, debugTableColor
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.ui.Image image)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.ui.Image image, com.badlogic.gdx.scenes.scene2d.utils.ChangeListener changeListener)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.ui.Image image, MenuItem.MenuItemStyle style)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.ui.Image image, String styleName)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.ChangeListener changeListener)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.Drawable drawable)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.Drawable drawable, com.badlogic.gdx.scenes.scene2d.utils.ChangeListener changeListener)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.Drawable drawable, MenuItem.MenuItemStyle style)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.Drawable drawable, String styleName)
     
    MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, String styleName)
     
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    void
    draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
     
    com.badlogic.gdx.scenes.scene2d.ui.Image
     
    com.badlogic.gdx.scenes.scene2d.ui.Cell<?>
     
    com.badlogic.gdx.scenes.scene2d.ui.Label
     
    com.badlogic.gdx.scenes.scene2d.ui.Cell<?>
     
     
    com.badlogic.gdx.scenes.scene2d.ui.Cell<com.badlogic.gdx.scenes.scene2d.ui.Label>
     
     
     
    com.badlogic.gdx.scenes.scene2d.ui.Cell<com.badlogic.gdx.scenes.scene2d.ui.Image>
     
     
    boolean
     
    boolean
     
    void
    setGenerateDisabledImage(boolean generateDisabledImage)
    Changes generateDisabledImage property, when true that function is enabled.
    protected void
    setParent(com.badlogic.gdx.scenes.scene2d.Group parent)
     
    setShortcut(int keycode)
    Set shortcuts text displayed in this menu item.
    setShortcut(int... keycodes)
    Creates platform dependent shortcut text.
    Set shortcuts text displayed in this menu item.
    protected void
    setStage(com.badlogic.gdx.scenes.scene2d.Stage stage)
     
    void
    setStyle(com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle style)
     
    void
     
    void
     

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Button Link icon

    getBackgroundDrawable, getButtonGroup, getClickListener, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, isChecked, isDisabled, isPressed, setChecked, setDisabled, setProgrammaticChangeEvents, toggle

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Table Link icon

    add, add, add, add, add, add, add, align, background, background, bottom, center, clearChildren, clip, clip, columnDefaults, debug, debug, debugActor, debugAll, debugCell, debugTable, defaults, drawBackground, drawDebug, drawDebugBounds, getAlign, getBackground, getCell, getCells, getClip, getColumnMinWidth, getColumnPrefWidth, getColumns, getColumnWidth, getPadBottom, getPadBottomValue, getPadLeft, getPadLeftValue, getPadRight, getPadRightValue, getPadTop, getPadTopValue, getPadX, getPadY, getRow, getRowHeight, getRowMinHeight, getRowPrefHeight, getRows, getSkin, getTableDebug, hit, invalidate, layout, left, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, removeActor, removeActor, removeActorAt, reset, right, row, setBackground, setBackground, setClip, setDebug, setRound, setSkin, stack, top

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup Link icon

    childrenChanged, getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validate

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Group Link icon

    act, addActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, clear, clearChildren, computeTransform, drawChildren, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, isTransform, localToDescendantCoordinates, resetTransform, resetTransform, setCullingArea, setDebug, setTransform, swapActor, swapActor, toString

    Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor Link icon

    addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details Link icon

    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, String styleName)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.ChangeListener changeListener)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.Drawable drawable)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.Drawable drawable, com.badlogic.gdx.scenes.scene2d.utils.ChangeListener changeListener)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.Drawable drawable, String styleName)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.ui.Image image)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.ui.Image image, com.badlogic.gdx.scenes.scene2d.utils.ChangeListener changeListener)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.ui.Image image, String styleName)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.ui.Image image, MenuItem.MenuItemStyle style)
    • MenuItem Link icon

      public MenuItem(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.utils.Drawable drawable, MenuItem.MenuItemStyle style)
  • Method Details Link icon

    • getSubMenu Link icon

      public ContextMenu getSubMenu()
    • setSubMenu Link icon

      public void setSubMenu(ContextMenu subMenu)
    • setParent Link icon

      protected void setParent(com.badlogic.gdx.scenes.scene2d.Group parent)
      Overrides:
      setParent in class com.badlogic.gdx.scenes.scene2d.Actor
    • getStyle Link icon

      public MenuItem.MenuItemStyle getStyle()
      Overrides:
      getStyle in class com.badlogic.gdx.scenes.scene2d.ui.Button
    • setStyle Link icon

      public void setStyle(com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle style)
      Overrides:
      setStyle in class com.badlogic.gdx.scenes.scene2d.ui.Button
    • draw Link icon

      public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float parentAlpha)
      Overrides:
      draw in class com.badlogic.gdx.scenes.scene2d.ui.Button
    • isOver Link icon

      public boolean isOver()
      Overrides:
      isOver in class com.badlogic.gdx.scenes.scene2d.ui.Button
    • isGenerateDisabledImage Link icon

      public boolean isGenerateDisabledImage()
    • setGenerateDisabledImage Link icon

      public void setGenerateDisabledImage(boolean generateDisabledImage)
      Changes generateDisabledImage property, when true that function is enabled. When it is enabled and this MenuItem is disabled then image color will be changed to gray meaning that it is disabled, by default it is enabled.
    • getShortcut Link icon

      public CharSequence getShortcut()
    • setShortcut Link icon

      public MenuItem setShortcut(int keycode)
      Set shortcuts text displayed in this menu item. This DOES NOT set actual hot key for this menu item, it only makes shortcut text visible in item.
      Parameters:
      keycode - from Input.Keys.
    • setShortcut Link icon

      public MenuItem setShortcut(String text)
      Set shortcuts text displayed in this menu item. This DOES NOT set actual hot key for this menu item, it only makes shortcut text visible in item.
      Parameters:
      text - text that will be displayed
      Returns:
      this object for the purpose of chaining methods
    • setShortcut Link icon

      public MenuItem setShortcut(int... keycodes)
      Creates platform dependent shortcut text. Converts int keycodes to String text. Eg. Keys.CONTROL_LEFT, Keys.SHIFT_LEFT, Keys.F5 will be converted to Ctrl+Shift+F5 on Windows and Linux, and to ⌘⇧F5 on Mac.

      CONTROL_LEFT and CONTROL_RIGHT are mapped to Ctrl. The same goes for Alt (ALT_LEFT, ALT_RIGHT) and Shift (SHIFT_LEFT, SHIFT_RIGHT).

      This DOES NOT set actual hot key for this menu item, it only makes shortcut text visible in item.

      Parameters:
      keycodes - keycodes from Input.Keys that are used to create shortcut text
      Returns:
      this object for the purpose of chaining methods
    • setStage Link icon

      protected void setStage(com.badlogic.gdx.scenes.scene2d.Stage stage)
      Overrides:
      setStage in class com.badlogic.gdx.scenes.scene2d.Group
    • getImage Link icon

      public com.badlogic.gdx.scenes.scene2d.ui.Image getImage()
    • getImageCell Link icon

      public com.badlogic.gdx.scenes.scene2d.ui.Cell<?> getImageCell()
    • getLabel Link icon

      public com.badlogic.gdx.scenes.scene2d.ui.Label getLabel()
    • getLabelCell Link icon

      public com.badlogic.gdx.scenes.scene2d.ui.Cell<?> getLabelCell()
    • getText Link icon

      public CharSequence getText()
    • setText Link icon

      public void setText(CharSequence text)
    • getSubMenuIconCell Link icon

      public com.badlogic.gdx.scenes.scene2d.ui.Cell<com.badlogic.gdx.scenes.scene2d.ui.Image> getSubMenuIconCell()
    • getShortcutCell Link icon

      public com.badlogic.gdx.scenes.scene2d.ui.Cell<com.badlogic.gdx.scenes.scene2d.ui.Label> getShortcutCell()