Reference for JVM version of SpaceVIL
0.3.5.8
SpaceVIL (Space of Visual Items Layout) is a cross-platform and multilingual framework for creating GUI client applications for .NET Standard, .NET Core and JVM. SpaceVIL is based on OpenGL graphic technology and GLFW. Using this framework in conjunction with .Net Core or with a JVM, you can work and create graphical client applications on Linux, Mac OS X and Windows.
|
ContextMenu is a menu for selecting one of the available options from the list that perform the assigned action. More...
Inherits com.spvessel.spacevil.Prototype, and com.spvessel.spacevil.Core.InterfaceFloating.
Public Member Functions | |
Prototype | getSender () |
Getting the item that invokes ContextMenu. More... | |
boolean | isOutsideClickClosable () |
Returns True if ContextMenu (see com.spvessel.spacevil.Core.InterfaceFloating) should closes when mouse click outside the area of ContextMenu otherwise returns False. More... | |
void | setOutsideClickClosable (boolean value) |
Setting boolean value of item's behavior when mouse click occurs outside the ContextMenu. More... | |
ContextMenu (CoreWindow handler) | |
Constructs a ContextMenu and attaches it to the specified window (see com.spvessel.spacevil.CoreWindow, com.spvessel.spacevil.ActiveWindow, com.spvessel.spacevil.DialogWindow). More... | |
ContextMenu (CoreWindow handler, MenuItem... items) | |
Constructs a ContextMenu with specified options and attaches it to the specified window (see com.spvessel.spacevil.CoreWindow, com.spvessel.spacevil.ActiveWindow, com.spvessel.spacevil.DialogWindow). More... | |
void | initElements () |
Initializing all elements in the ContextMenu. More... | |
int | getListCount () |
Getting number of options in the list. More... | |
List< InterfaceBaseItem > | getListContent () |
Getting all existing options (list of com.spvessel.spacevil.MenuItem objects). More... | |
void | addItem (InterfaceBaseItem item) |
Adding option (or any com.spvessel.spacevil.Core.InterfaceBaseItem implementation) to the ComboBoxDropDown. More... | |
boolean | removeItem (InterfaceBaseItem item) |
Removing option (or any com.spvessel.spacevil.Core.InterfaceBaseItem implementation) from the ComboBoxDropDown. More... | |
void | show (InterfaceItem sender, MouseArgs args) |
Shows the ContextMenu at the proper position. More... | |
void | show () |
Shows the ContextMenu at the position (0, 0). More... | |
void | clear () |
Remove all content in the ContextMenu. More... | |
void | hide () |
Hide the ContextMenu without destroying. More... | |
void | hide (MouseArgs args) |
Hide the ContextMenu without destroying with using specified mouse arguments. More... | |
void | setConfines () |
Overridden method for setting confines according to position and size of the ContextMenu (see Prototype.setConfines()). More... | |
void | setStyle (Style style) |
Setting style of the ContextMenu. More... | |
Public Member Functions inherited from com.spvessel.spacevil.Prototype | |
Prototype () | |
Default constructor of Prototype class. More... | |
void | release () |
Method to describe disposing item's resources if the item was removed. More... | |
void | setHandler (CoreWindow handler) |
Setting the window to which the item will belong. More... | |
CoreWindow | getHandler () |
Getting the window to which the item belongs. More... | |
String | getToolTip () |
Getting tooltip text of the item. More... | |
void | setToolTip (String text) |
Setting tooltip text of the item. More... | |
Prototype | getParent () |
Getting the parent of the item. More... | |
void | setParent (Prototype parent) |
Setting the parent of the item. More... | |
Spacing | getSpacing () |
Getting indents between children of a container type item. More... | |
void | setSpacing (Spacing spacing) |
Setting indents between children of a container type item. More... | |
void | setSpacing (int horizontal, int vertical) |
Setting indents between children of a container type item. More... | |
Indents | getPadding () |
Getting indents of an item for offset its children. More... | |
void | setPadding (Indents padding) |
Setting indents of an item to offset its children. More... | |
void | setPadding (int left, int top, int right, int bottom) |
Setting indents of an item to offset its children. More... | |
Indents | getMargin () |
Getting the indents of an item to offset itself relative to its container. More... | |
void | setMargin (Indents margin) |
Setting the indents of an item to offset itself relative to its container. More... | |
void | setMargin (int left, int top, int right, int bottom) |
Setting the indents of an item to offset itself relative to its container. More... | |
void | setBorder (Border border) |
Setting border of an item's shape. More... | |
void | setBorderFill (Color fill) |
Setting the border color of an item's shape. More... | |
Color | getBorderFill () |
Getting the border color oa an item's shape. More... | |
void | setBorderFill (int r, int g, int b) |
Setting the border color of an item's shape in byte RGB format. More... | |
void | setBorderFill (int r, int g, int b, int a) |
Setting the border color of an item's shape in byte RGB format. More... | |
void | setBorderFill (float r, float g, float b) |
Setting the border color of an item's shape in float RGB format. More... | |
void | setBorderFill (float r, float g, float b, float a) |
Setting the border color of an item's shape in float RGBA format. More... | |
void | setBorderRadius (CornerRadius radius) |
Setting radius of the border's corners. More... | |
void | setBorderRadius (int radius) |
Setting border radius with the same values for each corner of the rectangle object. More... | |
CornerRadius | getBorderRadius () |
Getting border radiuses. More... | |
void | setBorderThickness (int thickness) |
Setting border thickness of an item's shape. More... | |
int | getBorderThickness () |
Getting border thickness of an item's shape. More... | |
List< float[]> | getTriangles () |
Getting triangles of item's shape. More... | |
void | setTriangles (List< float[]> triangles) |
Setting triangles as item's shape. More... | |
void | makeShape () |
Making default item's shape. More... | |
void | setBackground (Color color) |
Setting background color of an item's shape. More... | |
void | setBackground (int r, int g, int b) |
Setting background color of an item's shape in byte RGB format. More... | |
void | setBackground (int r, int g, int b, int a) |
Setting background color of an item in byte RGBA format. More... | |
void | setBackground (float r, float g, float b) |
Setting background color of an item in float RGB format. More... | |
void | setBackground (float r, float g, float b, float a) |
Setting background color of an item in float RGBA format. More... | |
Color | getBackground () |
Getting background color of an item. More... | |
void | setItemName (String name) |
Setting the name of the item. More... | |
String | getItemName () |
Getting the name of the item. More... | |
void | setMinWidth (int width) |
Setting the minimum width limit. More... | |
int | getMinWidth () |
Getting the minimum width limit. More... | |
void | setWidth (int width) |
Setting item width. More... | |
int | getWidth () |
Getting item width. More... | |
void | setMaxWidth (int width) |
Setting the maximum width limit. More... | |
int | getMaxWidth () |
Getting the maximum width limit. More... | |
void | setMinHeight (int height) |
Setting the minimum height limit. More... | |
int | getMinHeight () |
Getting the minimum height limit. More... | |
void | setHeight (int height) |
Setting item height. More... | |
int | getHeight () |
Getting item height. More... | |
void | setMaxHeight (int height) |
Setting the maximum height limit. More... | |
int | getMaxHeight () |
Getting the maximum height limit. More... | |
void | setSize (int width, int height) |
Setting item size (width and height). More... | |
Size | getSize () |
Getting current item size. More... | |
void | setMinSize (int width, int height) |
Setting minimum item size limit (width and height limits). More... | |
Size | getMinSize () |
Getting current item minimum size limit. More... | |
void | setMaxSize (int width, int height) |
Setting maximum item size limit (width and height limits). More... | |
Size | getMaxSize () |
Getting current item maximum size limit. More... | |
void | setAlignment (List< ItemAlignment > alignment) |
Setting an alignment of an item's shape relative to its container. More... | |
void | setAlignment (ItemAlignment... alignment) |
Setting an alignment of an item's shape relative to its container. More... | |
List< ItemAlignment > | getAlignment () |
Getting an alignment of an item's shape relative to its container. More... | |
void | setSizePolicy (SizePolicy width, SizePolicy height) |
Setting the size policy of an item's shape. More... | |
void | setWidthPolicy (SizePolicy policy) |
Setting width policy of an item's shape. More... | |
SizePolicy | getWidthPolicy () |
Getting width policy of an item's shape.Can be FIXED (shape not changes its size) or EXPAND (shape is stretched to all available space). More... | |
void | setHeightPolicy (SizePolicy policy) |
Setting height policy of an item's shape. More... | |
SizePolicy | getHeightPolicy () |
Getting height policy of an item's shape.Can be FIXED (shape not changes its size) or EXPAND (shape is stretched to all available space). More... | |
void | setPosition (int x, int y) |
Setting item position. More... | |
void | setX (int x) |
Setting X coordinate of the left-top corner of a shape. More... | |
int | getX () |
Getting X coordinate of the left-top corner of a shape. More... | |
void | setY (int y) |
Setting Y coordinate of the left-top corner of a shape. More... | |
int | getY () |
Getting Y coordinate of the left-top corner of a shape. More... | |
void | setConfines (int x0, int x1, int y0, int y1) |
Setting the confines of the item relative to its parent's size and position. More... | |
Style | getCoreStyle () |
Getting the core (only appearance properties without inner styles) style of an item. More... | |
boolean | isShadowDrop () |
Getting the shadow visibility status of an item. More... | |
void | setShadowDrop (boolean value) |
Setting the shadow visibility status of an item. More... | |
void | setShadowRadius (int radius) |
Setting the specified blur radius of the shadow. More... | |
int | getShadowRadius () |
Getting the shadow blur raduis. More... | |
Color | getShadowColor () |
Getting shadow color. More... | |
void | setShadowColor (Color color) |
Setting shadow color. More... | |
Position | getShadowPos () |
Getting the offset of the shadow relative to the position of the item. More... | |
int[] | getShadowExtension () |
Getting the values of shadow extensions in pixels. More... | |
void | setShadowExtension (int wExtension, int hExtension) |
Setting the values of shadow extensions in pixels. More... | |
void | setShadow (int radius, int x, int y, Color color) |
Setting the shadow with specified blur radius, axis shifts, shadow color. More... | |
void | addItemState (ItemStateType type, ItemState state) |
Adding visual state for an item. More... | |
void | removeItemState (ItemStateType type) |
Removing visual state of an item by type. More... | |
void | removeAllItemStates () |
Removing all item visual states. More... | |
ItemState | getState (ItemStateType type) |
Getting item visual state by its type. More... | |
List< InterfaceBaseItem > | getItems () |
Getting list of the Prototype's inner items (children). More... | |
void | insertItem (InterfaceBaseItem item, int index) |
Inserting item to the container (this). More... | |
void | addItems (InterfaceBaseItem... items) |
Adding sequence of items into the container (this). More... | |
void | update (GeometryEventType type, int value) |
Updating an item size or/and position. More... | |
boolean | isDrawable () |
Getting the drawable (visibility) status of an item. More... | |
void | setDrawable (boolean value) |
Setting the drawable (visibility) status of an item. More... | |
boolean | isVisible () |
Setting the visibility status of an item. More... | |
void | setVisible (boolean value) |
Setting the visibility status of an item. More... | |
boolean | isPassEvents () |
Getting boolean value to know if this item can pass further any input events (mouse, keyboard and etc.). More... | |
boolean | isPassEvents (InputEventType e) |
Getting boolean value to know if this item can pass further the specified type of input events (mouse, keyboard and etc.). More... | |
List< InputEventType > | getPassEvents () |
Getting all allowed input events. More... | |
List< InputEventType > | GetBlockedEvents () |
Getting all blocked input events. More... | |
void | setPassEvents (boolean value) |
Setting on or off so that this item can pass further any input events (mouse, keyboard and etc.). More... | |
void | setPassEvents (boolean value, InputEventType e) |
Setting on or off so that this item can pass further the specified type of input events (mouse, keyboard and etc.). More... | |
void | setPassEvents (boolean value, List< InputEventType > events) |
Setting on or off so that this item can pass further the specified types of input events (mouse, keyboard and etc.). More... | |
void | setPassEvents (boolean value, InputEventType... events) |
Setting on or off so that this item can pass further the specified types of input events (mouse, keyboard and etc.). More... | |
boolean | isDisabled () |
Returns True if this item is disabled (non-interactive) otherwise returns False. More... | |
void | setDisabled (boolean value) |
Setting this item disabled (become non-interactive) or enabled. More... | |
boolean | isMouseHover () |
Returns True if this item is hovered otherwise returns False. More... | |
void | setMouseHover (boolean value) |
Setting this item hovered (mouse cursor located within item's shape). More... | |
boolean | isMousePressed () |
Returns True if mouse is pressed on this item (mouse cursor located within item's shape and any of the mouse button is pressed) otherwise False. More... | |
void | setMousePressed (boolean value) |
Setting True if you want that mouse is pressed on this item (mouse cursor located within item's shape and any of the mouse button is pressed) otherwise False. More... | |
boolean | isFocused () |
Returns True if this item gets focus otherwise False. More... | |
void | setFocus () |
Setting focus on this item if it is focusable. More... | |
void | setContent (List< InterfaceBaseItem > content) |
Setting content for this item. More... | |
Figure | isCustomFigure () |
Getting the custom shape if it is set. More... | |
void | setCustomFigure (Figure figure) |
Setting the custom shape to replace the default rectangle shape. More... | |
ItemHoverRule | getHoverRule () |
Getting the hovering rule of this item. More... | |
void | setHoverRule (ItemHoverRule rule) |
Setting the hovering rule for this item. More... | |
CursorImage | getCursor () |
Getting the mouse cursor image of this item. More... | |
void | setCursor (EmbeddedCursor cursor) |
Setting mouse cursor image for this item from embedded cursors. More... | |
void | setCursor (CursorImage cursor) |
Setting mouse cursor image for this item. More... | |
void | setCursor (BufferedImage bitmap) |
Creating and setting mouse cursor image for this item from specified bitmap image. More... | |
void | setCursor (BufferedImage bitmap, int width, int height) |
Creating and setting mouse cursor image for this item from specified scaled bitmap image. More... | |
Public Attributes | |
Prototype | returnFocus = null |
Property that allows to specify what item will be focused after ContextMenu is closed. More... | |
ListBox | itemList = new ListBox() |
ListBox for storing a list of options (com.spvessel.spacevil.MenuItem). More... | |
MouseButton | activeButton = MouseButton.BUTTON_RIGHT |
You can specify mouse button (see com.spvessel.spacevil.Flags.MouseButton) that is used to open ContextMenu. More... | |
Public Attributes inherited from com.spvessel.spacevil.Prototype | |
EventCommonMethodState | eventResize = new EventCommonMethodState() |
Event that is invoked when an item is resizing. More... | |
EventCommonMethodState | eventDestroy = new EventCommonMethodState() |
Event that is invoked when an item is destroyed (removed). More... | |
EventMouseMethodState | eventMouseHover = new EventMouseMethodState() |
Event that is invoked when mouse cursor enters inside an item area. More... | |
EventMouseMethodState | eventMouseLeave = new EventMouseMethodState() |
Event that is invoked when mouse cursor leaves inside an item area. More... | |
EventMouseMethodState | eventMouseClick = new EventMouseMethodState() |
Event that is invoked when mouse click (release) on an item. More... | |
EventMouseMethodState | eventMouseDoubleClick = new EventMouseMethodState() |
Event that is invoked when mouse double click on an item. More... | |
EventMouseMethodState | eventMousePress = new EventMouseMethodState() |
Event that is invoked when mouse press on an item. More... | |
EventMouseMethodState | eventMouseDrag = new EventMouseMethodState() |
Event that is invoked when mouse drag on an item. More... | |
EventMouseMethodState | eventMouseDrop = new EventMouseMethodState() |
Event that is invoked when mouse drop on an item. More... | |
EventMouseMethodState | eventScrollUp = new EventMouseMethodState() |
Event that is invoked when mouse wheel scrolls up on an item. More... | |
EventMouseMethodState | eventScrollDown = new EventMouseMethodState() |
Event that is invoked when mouse wheel scrolls down on an item. More... | |
EventKeyMethodState | eventKeyPress = new EventKeyMethodState() |
Event that is invoked when key of keyboard is pressed. More... | |
EventKeyMethodState | eventKeyRelease = new EventKeyMethodState() |
Event that is invoked when key of keyboard is released. More... | |
EventInputTextMethodState | eventTextInput = new EventInputTextMethodState() |
Event that is invoked when typing text on the keyboard. More... | |
boolean | isFocusable = true |
Item's focusable property. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from com.spvessel.spacevil.Prototype | |
void | updateState () |
Updating Prototype's state according to its ItemStateType. More... | |
void | setFocused (boolean value) |
boolean | getHoverVerification (float xpos, float ypos) |
int[] | getConfines () |
void | setState (ItemStateType state) |
ContextMenu is a menu for selecting one of the available options from the list that perform the assigned action.
ContextMenu is a floating item (see com.spvessel.spacevil.Core.InterfaceFloating and enum com.spvessel.spacevil.Flags.LayoutType) and closes when mouse click outside the ContextMenu area.
Contains ListBox.
Supports all events except drag and drop.
Notice: All floating items render above all others items.
ContextMenu does not pass any input events and invisible by default.
com.spvessel.spacevil.ContextMenu.ContextMenu | ( | CoreWindow | handler | ) |
Constructs a ContextMenu and attaches it to the specified window (see com.spvessel.spacevil.CoreWindow, com.spvessel.spacevil.ActiveWindow, com.spvessel.spacevil.DialogWindow).
ContextMenu does not pass any input events and invisible by default.
handler | Window for attaching ContextMenu. |
com.spvessel.spacevil.ContextMenu.ContextMenu | ( | CoreWindow | handler, |
MenuItem... | items | ||
) |
Constructs a ContextMenu with specified options and attaches it to the specified window (see com.spvessel.spacevil.CoreWindow, com.spvessel.spacevil.ActiveWindow, com.spvessel.spacevil.DialogWindow).
handler | Window for attaching ContextMenu. |
items | Sequence of options as com.spvessel.spacevil.MenuItem. |
void com.spvessel.spacevil.ContextMenu.addItem | ( | InterfaceBaseItem | item | ) |
Adding option (or any com.spvessel.spacevil.Core.InterfaceBaseItem implementation) to the ComboBoxDropDown.
item | Item as com.spvessel.spacevil.Core.InterfaceBaseItem. |
Reimplemented from com.spvessel.spacevil.Prototype.
void com.spvessel.spacevil.ContextMenu.clear | ( | ) |
Remove all content in the ContextMenu.
Reimplemented from com.spvessel.spacevil.Prototype.
List<InterfaceBaseItem> com.spvessel.spacevil.ContextMenu.getListContent | ( | ) |
Getting all existing options (list of com.spvessel.spacevil.MenuItem objects).
int com.spvessel.spacevil.ContextMenu.getListCount | ( | ) |
Getting number of options in the list.
Prototype com.spvessel.spacevil.ContextMenu.getSender | ( | ) |
Getting the item that invokes ContextMenu.
void com.spvessel.spacevil.ContextMenu.hide | ( | ) |
Hide the ContextMenu without destroying.
Implements com.spvessel.spacevil.Core.InterfaceFloating.
void com.spvessel.spacevil.ContextMenu.hide | ( | MouseArgs | args | ) |
Hide the ContextMenu without destroying with using specified mouse arguments.
args | Arguments as com.spvessel.spacevil.Core.MouseArgs. |
Implements com.spvessel.spacevil.Core.InterfaceFloating.
void com.spvessel.spacevil.ContextMenu.initElements | ( | ) |
Initializing all elements in the ContextMenu.
Notice: This method is mainly for overriding only. SpaceVIL calls this method if necessary and no need to call it manually.
Reimplemented from com.spvessel.spacevil.Prototype.
boolean com.spvessel.spacevil.ContextMenu.isOutsideClickClosable | ( | ) |
Returns True if ContextMenu (see com.spvessel.spacevil.Core.InterfaceFloating) should closes when mouse click outside the area of ContextMenu otherwise returns False.
Implements com.spvessel.spacevil.Core.InterfaceFloating.
boolean com.spvessel.spacevil.ContextMenu.removeItem | ( | InterfaceBaseItem | item | ) |
Removing option (or any com.spvessel.spacevil.Core.InterfaceBaseItem implementation) from the ComboBoxDropDown.
item | Item as com.spvessel.spacevil.Core.InterfaceBaseItem. |
Reimplemented from com.spvessel.spacevil.Prototype.
void com.spvessel.spacevil.ContextMenu.setConfines | ( | ) |
Overridden method for setting confines according to position and size of the ContextMenu (see Prototype.setConfines()).
Reimplemented from com.spvessel.spacevil.Prototype.
void com.spvessel.spacevil.ContextMenu.setOutsideClickClosable | ( | boolean | value | ) |
Setting boolean value of item's behavior when mouse click occurs outside the ContextMenu.
value | True: ContextMenu should become invisible if mouse click occurs outside the item. False: an item should stay visible if mouse click occurs outside the item. |
Implements com.spvessel.spacevil.Core.InterfaceFloating.
void com.spvessel.spacevil.ContextMenu.setStyle | ( | Style | style | ) |
Setting style of the ContextMenu.
Inner styles: "itemlist".
style | Style as com.spvessel.spacevil.Decorations.Style. |
Reimplemented from com.spvessel.spacevil.Prototype.
void com.spvessel.spacevil.ContextMenu.show | ( | ) |
Shows the ContextMenu at the position (0, 0).
Implements com.spvessel.spacevil.Core.InterfaceFloating.
void com.spvessel.spacevil.ContextMenu.show | ( | InterfaceItem | sender, |
MouseArgs | args | ||
) |
Shows the ContextMenu at the proper position.
sender | The item from which the show request is sent. |
args | Mouse click arguments (cursor position, mouse button, mouse button press/release, etc.). |
Implements com.spvessel.spacevil.Core.InterfaceFloating.
MouseButton com.spvessel.spacevil.ContextMenu.activeButton = MouseButton.BUTTON_RIGHT |
You can specify mouse button (see com.spvessel.spacevil.Flags.MouseButton) that is used to open ContextMenu.
Default: com.spvessel.spacevil.Flags.MouseButton.BUTTON_RIGHT.
ListBox for storing a list of options (com.spvessel.spacevil.MenuItem).
Prototype com.spvessel.spacevil.ContextMenu.returnFocus = null |
Property that allows to specify what item will be focused after ContextMenu is closed.