/** Constructor a box by assigning an array of children. * * @param children an array of children to be added * @since 2.4.0 */ public Box(String orient, Component[] children) { this(orient); if (children != null) for (int j = 0; j < children.length; ++j) appendChild(children[j]); }
/** Returns the orient (the same as {@link #getMold}). * <p>Default: "vertical". */ public String getOrient() { return getMold(); }
/** Returns whether it is a vertical box. * @since 3.0.0 */ public boolean isVertical() { return "vertical".equals(getOrient()); }
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Box self = (Box) comp; final String uuid = self.getUuid(); final String spacing = self.getSpacing(); String spstyle = null; .write(self.getOuterAttrs()).write(self.getInnerAttrs()) .writeln(" cellpadding=\"0\" cellspacing=\"0\">"); for (Iterator it = self.getChildren().iterator(); it.hasNext();) { final Component child = (Component)it.next(); wh.write("<tr id=\"").write(child.getUuid()).write("!chdextr\"") .write(self.getChildOuterAttrs(child)).write(">\n<td") .write(self.getChildInnerAttrs(child)) .write(">").write(child).writeln("</td></tr>"); .write("!chdextr2\" class=\"").write(self.getZclass()).write("-sep\"");
public void render(Component comp, Writer out) throws IOException { final SmartWriter wh = new SmartWriter(out); final Box self = (Box) comp; final String uuid = self.getUuid(); final String spacing = self.getSpacing(); String spstyle = null; .write(self.getOuterAttrs()).write(self.getInnerAttrs()) .writeln(" cellpadding=\"0\" cellspacing=\"0\">") .write("<tr id=\"").write(uuid).writeln("!cave\"") .write(self.getCaveAttrs()).write('>'); for (Iterator it = self.getChildren().iterator(); it.hasNext();) { final Component child = (Component)it.next(); wh.write("<td id=\"").write(child.getUuid()).write("!chdextr\"") .write(self.getChildOuterAttrs(child)) .write(self.getChildInnerAttrs(child)).write(">") .write(child) .writeln("</td>"); .write("!chdextr2\" class=\"").write(self.getZclass()).write("-sep\"");
/** Returns whether it is a horizontal box. * @since 3.0.0 */ public boolean isHorizontal() { return "horizontal".equals(getOrient()); }
/** Returns the orientation of the splitter. * It is the same as the parent's orientation ({@link Box#getOrient}. */ public String getOrient() { final Box box = (Box) getParent(); return box != null ? box.getOrient() : "vertical"; }