Class ExpanderWidget provides a simple icon widget for controlling the
expanded/collapsed state of another widget. This widget can be added to
any widget, and given an instance of ExpandableWidget, it can make that
object expand or collapse each time the icon is clicked by the user.
It is up to the ExpandableWidget implementation to determine how the
size of the widget is altered. This class provides one or more methods
for altering the widget size.
- Ajit Bhate
- Nathan Fiedler
Cache of the expanded state of ExpandableWidget instances. This
is used to restore the original state of an expandable if it is
created again, say as a result of an undo/redo operation.
The expandable (content) widget.
Creates a new instance of ExpanderWidget.
scene the Scene to contain this widget.
expandable the expandable widget this expander will control.
expanded true if widget is initially expanded, false if collapsed.
Retrieve the former expanded state of the given expandable. If
the expandable state was not cached (or the cache has been cleaned
by the garbage collector), this method returns the value of the
expandable the ExpandableWidget to query.
def default value for the expanded state.
- true if expanded, false if collapsed.
Set the expanded state of the widget.
expanded true to expand, false to collapse.
double radians = Math.PI * degrees / 180.0;
cos = Math.cos(radians / 2.0);
float y1 = (float) (height+cos*height/2) / 2;
float y2 = (float) (height-cos*height/2) / 2;