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(); } }
/** * 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); } } }
/** * Add an extra space to the right of the previously added ToolStrip element. * * @param toolStripSpacer the toolstip spacer. */ public void addSpacer(ToolStripSpacer toolStripSpacer) { Canvas canvas = new Canvas(); canvas.setWidth(1); canvas.setHeight(1); canvas.setBorder("none"); canvas.setExtraSpace(toolStripSpacer.getSpace()); addMember(canvas); }
int left = tooltip.getLeft(); int top = tooltip.getTop(); destroyTooltip(); Canvas content = new Canvas(); content.setContents(sb.toString()); int width = (int) (widest * 4.8) + 40; if (width < 150) { width = 150; content.setWidth(width); content.setAutoHeight(); content.setMargin(5); createTooltip(left, top, content);
rootLayout.setPadding(5); Canvas selectionSearch = new Canvas(); selectionSearch.setWidth100(); selectionSearch.setHeight100(); noSelection.setTooltip(messages.geometricSearchWidgetSelectionSearchNothingSelectedTooltip()); selectionSearch.addChild(mainLayout); selectionSearch.addChild(noSelection);
setPadding(10); container = new Canvas(); container.setWidth100(); container.setHeight("*");
/** * This Canvas's immediate parent, if any. <BR> Can be initialized, but any subsequent manipulation should be via * {@link com.smartgwt.client.widgets.Canvas#addChild} and {@link com.smartgwt.client.widgets.Canvas#removeChild} * calls on the parent. * * @return Canvas */ public Canvas getParentElement() { JavaScriptObject parentJS = getAttributeAsJavaScriptObject("parentElement"); if(parentJS == null) return null; Canvas canvas = (Canvas) BaseWidget.getRef(parentJS); if (canvas == null) { canvas = new Canvas(parentJS); } return canvas; }
public static Canvas getOrCreateRef(JavaScriptObject jsObj) { if(jsObj == null) return null; BaseWidget obj = BaseWidget.getRef(jsObj); if(obj != null) { return (Canvas) obj; } else { return new Canvas(jsObj); } }
/** * 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 init() { this.setWidth(this.size + 1); this.setHeight(this.size + 1); canvas.setWidth(this.size); canvas.setHeight(this.size); addMember(canvas); this.setMargin(this.margin); if (View.getView().isShowExtendedTooltip()) { this.setTooltip(this.extendedTooltip); } else { this.setTooltip(this.tooltip); } }
private Canvas createDeleteButton(final ListGridRecord ruleRecord) { Canvas delButton = new SmallButton(new Img(delImg) , "", ""); delButton.addClickHandler(createDeleteHandler(ruleRecord)); delButton.setPrompt(i18n.unsubscribeThisRule()); delButton.setLayoutAlign(CENTER); delButton.setMargin(1); return delButton; }
/** * Convenience method that sets the height to 100%. */ public void setHeight100() { setHeight("100%"); }
/** * Convenience method that sets the width to 100%. */ public void setWidth100() { setWidth("100%"); }
public Element getElement(boolean allowPreRender) { if (!isElementSet) { JavaScriptObject jsObj = getJsObj(); if (!allowPreRender) { error("This method should only be called after the component has been rendered"); } if (jsObj == null) { getOrCreateJsObj(); } Element wrapperDiv = DOM.createDiv(); DOMUtil.setID(wrapperDiv, getID() + "_wrapper"); //the wrapper div must be attached to the dom, or else this widgets children don't get //a handle to this widgets dom element (via getHandle()). For example if this self is a // HLayout and containts a Canvas and IButton child member. RootPanel.getBodyElement().appendChild(wrapperDiv); Canvas self = ((Canvas) this); //need to set properties before calling clear else the properties are not set on the jsObj (it ends up on the config) setProperty("position", Positioning.RELATIVE.getValue()); setProperty("redrawOnResize", true); setProperty("htmlElement", wrapperDiv); self.clear(); self.draw(); setElement(wrapperDiv); return wrapperDiv; } return super.getElement(); }
public void finishLoading() { loadingSpinner.hide(); } }
this.titleCol.getCanvas().setBackgroundColor(properties.getHexColor()); this.styleChanger.setTitle(timeseries.getPhenomenonId() + "@" + getStationName(timeseries)); if (timeseries.hasData()) {
protected static Canvas[] convertToCanvasArray(JavaScriptObject nativeArray) { if (nativeArray == null) { return new Canvas[]{}; } JavaScriptObject[] componentsj = JSOHelper.toArray(nativeArray); Canvas[] objects = new Canvas[componentsj.length]; for (int i = 0; i < componentsj.length; i++) { JavaScriptObject componentJS = componentsj[i]; Canvas obj = (Canvas) BaseWidget.getRef(componentJS); if (obj == null) { obj = new Canvas(componentJS); } objects[i] = obj; } return objects; }