@Override public void addWidget(UIWidget element, CCHint hint) { final ComponentWrapper cw = getWrapper(element); final String cStr = ConstraintParser.prepare(hint != null ? hint.cc : ""); CC constraint = AccessController.doPrivileged((PrivilegedAction<CC>) () -> ConstraintParser.parseComponentConstraint(cStr)); ccMap.put(cw, constraint); wrappers.put(element, cw); children.add(cw); dirty = true; }
public void setRowConstraints(String constraint) { rowConstraints = constraint; setRc(ConstraintParser.parseColumnConstraints(ConstraintParser.prepare(constraint))); }
public void setColConstraints(String constraint) { colConstraints = constraint; setCC(ConstraintParser.parseColumnConstraints(ConstraintParser.prepare(constraint))); }
public void setLayoutConstraints(String constraint) { layoutConstraints = constraint; setLc(ConstraintParser.parseLayoutConstraint(ConstraintParser.prepare(constraint))); }
/** Sets the layout constraints for the layout manager instance as a String. * <p> * See the class JavaDocs for information on how this string is formatted. * @param constr The layout constraints as a String or {@link net.miginfocom.layout.LC} representation. <code>null</code> is converted to <code>""</code> for storage. * @throws RuntimeException if the constraint was not valid. */ public void setLayoutConstraints(Object constr) { if (constr == null || constr instanceof String) { constr = ConstraintParser.prepare((String) constr); lc = ConstraintParser.parseLayoutConstraint((String) constr); } else if (constr instanceof LC) { lc = (LC) constr; } else { throw new IllegalArgumentException("Illegal constraint type: " + constr.getClass().toString()); } layoutConstraints = constr; dirty = true; }
/** Sets the column layout constraints for the layout manager instance as a String. * <p> * See the class JavaDocs for information on how this string is formatted. * @param constr The column layout constraints as a String or {@link net.miginfocom.layout.AC} representation. <code>null</code> is converted to <code>""</code> for storage. * @throws RuntimeException if the constraint was not valid. */ public void setColumnConstraints(Object constr) { if (constr == null || constr instanceof String) { constr = ConstraintParser.prepare((String) constr); colSpecs = ConstraintParser.parseColumnConstraints((String) constr); } else if (constr instanceof AC) { colSpecs = (AC) constr; } else { throw new IllegalArgumentException("Illegal constraint type: " + constr.getClass().toString()); } colConstraints = constr; dirty = true; }
/** Sets the layout constraints for the layout manager instance as a String. * <p> * See the class JavaDocs for information on how this string is formatted. * @param s The layout constraints as a String representation. <code>null</code> is converted to <code>""</code> for storage. * @throws RuntimeException if the constraint was not valid. */ public void setLayoutConstraints(Object s) { if (s == null || s instanceof String) { s = ConstraintParser.prepare((String) s); lc = ConstraintParser.parseLayoutConstraint((String) s); } else if (s instanceof LC) { lc = (LC) s; } else { throw new IllegalArgumentException("Illegal constraint type: " + s.getClass().toString()); } layoutConstraints = s; grid = null; }
/** Sets the column layout constraints for the layout manager instance as a String. * <p> * See the class JavaDocs for information on how this string is formatted. * @param constr The column layout constraints as a String representation. <code>null</code> is converted to <code>""</code> for storage. * @throws RuntimeException if the constraint was not valid. */ public void setColumnConstraints(Object constr) { if (constr == null || constr instanceof String) { constr = ConstraintParser.prepare((String) constr); colSpecs = ConstraintParser.parseColumnConstraints((String) constr); } else if (constr instanceof AC) { colSpecs = (AC) constr; } else { throw new IllegalArgumentException("Illegal constraint type: " + constr.getClass().toString()); } colConstraints = constr; grid = null; }
/** Sets the row layout constraints for the layout manager instance as a String. * <p> * See the class JavaDocs for information on how this string is formatted. * @param constr The row layout constraints as a String representation. <code>null</code> is converted to <code>""</code> for storage. * @throws RuntimeException if the constraint was not valid. */ public void setRowConstraints(Object constr) { if (constr == null || constr instanceof String) { constr = ConstraintParser.prepare((String) constr); rowSpecs = ConstraintParser.parseRowConstraints((String) constr); } else if (constr instanceof AC) { rowSpecs = (AC) constr; } else { throw new IllegalArgumentException("Illegal constraint type: " + constr.getClass().toString()); } rowConstraints = constr; grid = null; }
/** Sets the row layout constraints for the layout manager instance as a String. * <p> * See the class JavaDocs for information on how this string is formatted. * @param constr The row layout constraints as a String or {@link net.miginfocom.layout.AC} representation. <code>null</code> is converted to <code>""</code> for storage. * @throws RuntimeException if the constraint was not valid. */ public void setRowConstraints(Object constr) { if (constr == null || constr instanceof String) { constr = ConstraintParser.prepare((String) constr); rowSpecs = ConstraintParser.parseRowConstraints((String) constr); } else if (constr instanceof AC) { rowSpecs = (AC) constr; } else { throw new IllegalArgumentException("Illegal constraint type: " + constr.getClass().toString()); } rowConstraints = constr; dirty = true; }
public MigPane add(Node node, String sCc) { CC cc = ConstraintParser.parseComponentConstraint(ConstraintParser.prepare(sCc)); add(node, cc); return this; }
public MigPane add(int index, Node node, String sCc) { CC cc = ConstraintParser.parseComponentConstraint(ConstraintParser.prepare(sCc)); add(index, node, cc); return this; }
public static void setCc(Node node, String cc) { CC lCC = ConstraintParser.parseComponentConstraint( ConstraintParser.prepare( cc ) ); setCc(node, lCC); }
/** layout called in FXML on MigPane itself */ public void setLayout(String value) { this.fxmLayoutConstraints = value; setLayoutConstraints( ConstraintParser.parseLayoutConstraint( ConstraintParser.prepare( value ) ) ); } public String getLayout() { return fxmLayoutConstraints; }
/** cols called in FXML on MigPane itself */ public void setCols(String value) { this.fxmlColumConstraints = value; setColumnConstraints( ConstraintParser.parseColumnConstraints( ConstraintParser.prepare( value ) ) ); } public String getCols() { return fxmlColumConstraints; }
/** rows called in FXML on MigPane itself */ public void setRows(String value) { this.fxmlRowConstraints = value; setRowConstraints( ConstraintParser.parseRowConstraints( ConstraintParser.prepare( value ) ) ); } public String getRows() { return fxmlRowConstraints; }
/** * use the string layout constraints */ public MigPane(String layoutConstraints, String colConstraints, String rowConstraints) { super(); setLayoutConstraints(ConstraintParser.parseLayoutConstraint(ConstraintParser.prepare(layoutConstraints))); setColumnConstraints(ConstraintParser.parseColumnConstraints(ConstraintParser.prepare(colConstraints))); setRowConstraints(ConstraintParser.parseRowConstraints(ConstraintParser.prepare(rowConstraints))); construct(); }
/** Sets the constraints for the node * @param node The node. Must already be in the pane. * @param ccs The component constraints. Can be null. */ public void setComponentConstraints(Node node, String ccs) { FXComponentWrapper wrapper = new FXComponentWrapper(node); if (!wrapperToCCMap.containsKey(wrapper)) throw new IllegalArgumentException("Node not in pane: " + node); CC cc = ConstraintParser.parseComponentConstraint(ConstraintParser.prepare(ccs)); wrapperToCCMap.put(wrapper, cc); invalidateGrid(); requestLayout(); }
/** * use the string layout constraints */ public MigPane(String layoutConstraints, String colConstraints) { super(); setLayoutConstraints(ConstraintParser.parseLayoutConstraint(ConstraintParser.prepare(layoutConstraints))); setColumnConstraints(ConstraintParser.parseColumnConstraints(ConstraintParser.prepare(colConstraints))); construct(); }
/** * use the string layout constraints */ public MigPane(String layoutConstraints) { super(); setLayoutConstraints(ConstraintParser.parseLayoutConstraint(ConstraintParser.prepare(layoutConstraints))); construct(); }