ContextMenuProperties
The ContextMenuProperties
class defines styling and behavior for context menus, including colors, borders, animations, and skins. It uses a builder pattern for configuration.
This is to provide easy configuration of ContextMenu while allowing backwards compatibility.
Key Properties
backgroundColor: Menu background color (default: semi-transparent gray).
borderColor, borderWidth: Border styling (default: black, 1px).
padding, heightOffset: Spacing and vertical offset from widgets.
shadow, roundedCorners, cornerRadius: Visual effects.
hoverEffect, hoverColor: Hover interaction styling.
enableAnimations: Toggles scale animations.
skin:
Skin
instance (default:ClassicSkin
). (Learn more about Skins in the next section)
Key Methods
builder(): Creates a
Builder
for property configuration.clone(), cloneWithSkin(): Copies properties for reuse.
getBackgroundColor(), getSkin(), etc.: Property accessors.
Usage
Configure via Builder
when creating a ContextMenu
. Example:
ContextMenuProperties props = ContextMenuProperties.builder()
.backgroundColor(new Color(0, 0, 0, 200))
.build();
Last updated
Was this helpful?