Java Code Examples for net.miginfocom.layout.LC#flowY()
The following examples show how to use
net.miginfocom.layout.LC#flowY() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MigBoxLayoutAdapter.java From cuba with Apache License 2.0 | 5 votes |
private void updateLayoutConstraints(boolean resetExpanded) { LC lc = new LC(); lc.hideMode(2); // Invisible components will not participate in the layout at all and it will for instance not take up a grid cell lc.fill(); // always give all space to components, otherwise align doesn't work AC rowConstr = new AC(); AC colConstr = new AC(); if (direction.equals(FlowDirection.X)) { rowConstr.align("top"); lc.flowX(); if (expandedComponent != null || resetExpanded) { adjustExpanding(lc, colConstr); } } else { lc.flowY(); if (expandedComponent != null || resetExpanded) { adjustExpanding(lc, rowConstr); } } lc.setInsets(MigLayoutHelper.makeInsets(margins)); if (!spacing) { if (direction.equals(FlowDirection.X)) { lc.gridGapX("0"); } else { lc.gridGapY("0"); } } if (isDebug()) lc.debug(1000); layout.setLayoutConstraints(lc); layout.setRowConstraints(rowConstr); layout.setColumnConstraints(colConstr); }
Example 2
Source File: VclTestApp.java From cuba with Apache License 2.0 | 5 votes |
private Component createAlignTab() { JPanel box = new JPanel(); box.setFocusable(false); MigLayout boxLayout = new MigLayout("debug 1000, fill"); box.setLayout(boxLayout); JPanel panel = new JPanel(); MigLayout layout = new MigLayout("debug 1000, fill"); panel.setLayout(layout); JLabel label = new JLabel("Label"); CC cc = new CC(); cc.alignX("right").alignY("50%"); panel.add(label); layout.setComponentConstraints(label, cc); LC lc = new LC(); lc.hideMode(2); // The size of an invisible component will be set to 0, 0 and the gaps will also be set to 0 around it. lc.debug(1000); AC rowConstr = new AC(); AC colConstr = new AC(); lc.fillX(); lc.flowY(); lc.gridGapY("0"); layout.setLayoutConstraints(lc); layout.setRowConstraints(rowConstr); layout.setColumnConstraints(colConstr); box.add(panel, "height 100px, width 100px"); layout.setComponentConstraints(label, cc); return box; }