Quite a bit is being changed, and I hope to be able to push the updates out tonight or tomorrow.
-
A complete rework of the Clipping System.
— Elements can now contain an infinite number clipping layers
— Clipping can now contain a defined region within the parent layer.
— Clipping is self-propagating in most cases. (addChilld, removeChild, addClippingLayer, updateClippingLayer, removeClippingLayer, etc)
— Final clipping is calculated from the inner most extents of all parent clipping.
— This allows for complex nesting scenarios that were not possible until this update. -
Window has been restructured
— There is now a content area (use addWindowContent)
— There is now an optional close button for the drag bar (use setUseCloseButton(true))
— There is now an optional collapse button for the drag bar (use setUseCollapseButton(true))
— There is now a sizeWindowToContent() method… this does require that you add Elements to the window via addWindowContent) -
Layouts have been added. The available stock Layouts are:
— MigLayout - A fairly powerful implementation of Swing’s MigLayout (grid based layout)
— FlowLayout - A horizontal line wrapping layout that allows you to use LayoutHints to control the flow
— HorizontalLayout - A layout from left to right that wraps to the parent’s bounds
— VerticalLayout- A layout the wraps after place each component.
Layouts can override element properties and resize functions (if enabled)… thus far the following is supported:
- cell (row col)
- span (x y)
- grow (x y)
- fill (x y)
- pad (x w y h)
- dock (left center right) (top center bottom)
- wrap
- min (w h)
- pref (w h)
- max (w h)
Layouts themselves have properties and behaviors as well, such as margins, resize (absolute, variable and percentage… or any combination of these depending on the cell definitions), clipping by cell (or cells depending the elements span properties)
With the addition of Layouts, the is also a constructor for every control that just requires screen as a param. The rest of the elements properties are define in LayoutHints, like so:
[java]
MigLayout layout = new MigLayout(screen, “[][60%][][][65][]”, “[][][200][][10%]”,“margins 10 10 10 10”,“clip”);
contentArea = ControlUtil.getContainer();
contentArea.setLayout(layout);
ButtonAdapter ba = new ButtonAdapter(screen);
ba.getLayoutHints().define(“cell 0 1”,“span 1 2”,“pad 2 2 2 4”,“grow true false”,“fill false true”); //etc
contentArea.addControl(ba);
contentArea.layoutChildren();
[/java]
As seen above, there is also a small control utility class for creating some common elements.
Anyways, I’ll post when the plugin has been updated.