/** * Adds newChild as a child of this widget, set up a named object reference (i.e., this[name]) to the new widget if * name argument is provided, and draw the child if this widget has been drawn already. <P> If newChild has a parent * it will be removed from it. If it has a master, it will be detached from it if the master is a child of a * different parent. If newChild has peers, they'll be added to this widget as children as well. * * @param newChild new child canvas to add */ public void addChild(Widget widget) { if (widget instanceof Canvas) { addChild((Canvas) widget); } else { addChild(new WidgetCanvas(widget)); } }
private void addStep(WizardStepPanel step) { step.setVisible(false); container.addChild(step); steps.put(step.getName(), step); }
/** * Array of all Canvii that are immediate children of this Canvas. <p><b>Note : </b> This is an advanced * setting</p> * * @param children children Default value is null */ public void setChildren(Canvas... children) { if(!isDrawn()) { setAttribute("children", children, false); } else { for (int i = 0; i < children.length; i++) { Canvas child = children[i]; addChild(child); } } }
private Canvas getLoadingImg() { Canvas c = new Canvas(); c.setMargin(4); c.setWidth(26); c.setHeight(26); c.addChild(new Img(WidgetLayout.iconAjaxLoading16, 16, 16)); return c; }
private void createTooltip(int x, int y, Canvas content) { if (mapWidget != null) { tooltip = new Canvas(); tooltip.setBackgroundColor("white"); tooltip.setShowShadow(true); tooltip.setOpacity(85); tooltip.setBorder("thin solid #AAAAAA"); if (content != null) { tooltip.addChild(content); } else { tooltip.addChild(getLoadingImg()); } tooltip.setAutoWidth(); tooltip.setAutoHeight(); tooltip.hide(); tooltip.draw(); // need this to get correct size of tooltip placeTooltip(x, y); tooltip.show(); } }
loaders.addMember(requestCounter); c.addChild(loaders);