@Override public void setData( String key, Object value ) { if( !RWT.MARKUP_ENABLED.equals( key ) || !isMarkupEnabledFor( this ) ) { super.setData( key, value ); } }
@Override public void runSupport() { customImage = true; customImageID = null; drawAlpha = 255; canvas.setData("image", image); canvas.setData("ImageID", null); canvas.setData("image-left", null); canvas.setData("image-right", null); canvas.setData("drawAlpha", null); canvas.removePaintListener(paintListener); canvas.addPaintListener(paintListener); Utils.relayout(canvas); canvas.redraw(); } });
canvas.setData("drawAlpha", drawAlpha); canvas.setData("hpadding", new Long(hpadding)); canvas.setData("drawmode", drawMode); canvas.setData("delay", null); if (images == null) { canvas.setData("images", null); image = null; } else if (drawMode == DRAW_ANIMATE) { int animationDelay = ImageLoader.getInstance().getAnimationDelay(sImageID); canvas.setData("images", images); canvas.setData("ImageIndex", Long.valueOf(0)); canvas.setData("delay", new Long(animationDelay)); image = images[0]; Image imageLeft = images[0]; if (ImageLoader.isRealImage(imageLeft)) { canvas.setData("image-left", imageLeft); canvas.setData("image-right", imageRight); && drawMode != DRAW_STRETCH && drawMode != DRAW_SCALEDOWN_OR_CENTER) { canvas.setSize(imgBounds.width + hpadding, imgBounds.height); canvas.setData("oldSize", canvas.getSize()); canvas.setData("oldSize", new Point(fd.width, fd.height));
canvas.setData("color", color); } else { canvas.setData("color", properties.getColor(sPrefix + ".color")); canvas.setData("font", existingFont); } else { boolean bNewFont = false; canvas.setData("font", canvasFont); canvas.addDisposeListener(new DisposeListener() { @Override canvas.setData("Font" + suffix, canvasFont);
protected void refresh() { adjustItemNumber(); if (fInput == null) return; if (fInput.fAnnotations == null) return; if (fInput.fViewer != null) fInput.fViewer.addViewportListener(fViewportListener); fShell.setRegion(fLayouter.getShellRegion(fInput.fAnnotations.length)); Layout layout= fLayouter.getLayout(fInput.fAnnotations.length); fComposite.setLayout(layout); Control[] children= fComposite.getChildren(); for (int i= 0; i < fInput.fAnnotations.length; i++) { Canvas canvas= (Canvas) children[i]; Item item= new Item(); item.canvas= canvas; item.fAnnotation= fInput.fAnnotations[i]; canvas.setData(item); canvas.redraw(); } }
protected void refresh() { adjustItemNumber(); if (fInput == null) return; if (fInput.fAnnotations == null) return; if (fInput.fViewer != null) fInput.fViewer.addViewportListener(fViewportListener); fShell.setRegion(fLayouter.getShellRegion(fInput.fAnnotations.length)); Layout layout= fLayouter.getLayout(fInput.fAnnotations.length); fComposite.setLayout(layout); Control[] children= fComposite.getChildren(); for (int i= 0; i < fInput.fAnnotations.length; i++) { Canvas canvas= (Canvas) children[i]; Item item= new Item(); item.canvas= canvas; item.fAnnotation= fInput.fAnnotations[i]; canvas.setData(item); canvas.redraw(); } }
protected void refresh() { adjustItemNumber(); if (fInput == null) return; if (fInput.fAnnotations == null) return; if (fInput.fViewer != null) fInput.fViewer.addViewportListener(fViewportListener); fShell.setRegion(fLayouter.getShellRegion(fInput.fAnnotations.length)); Layout layout= fLayouter.getLayout(fInput.fAnnotations.length); fComposite.setLayout(layout); Control[] children= fComposite.getChildren(); for (int i= 0; i < fInput.fAnnotations.length; i++) { Canvas canvas= (Canvas) children[i]; Item item= new Item(); item.canvas= canvas; item.fAnnotation= fInput.fAnnotations[i]; canvas.setData(item); canvas.redraw(); } }
@Override public void imageDownloaded(Image image, String key, boolean returnedImmediately) { if (!returnedImmediately) { if (lblImage.isDisposed()) { return; } lblImage.setData("Image", image); Rectangle bounds = image.getBounds(); GridData gridData = (GridData) lblImage.getLayoutData(); gridData.heightHint = bounds.height + 10; gridData.widthHint = bounds.width + 16; lblImage.setLayoutData(gridData); lblImage.getShell().layout(new Control[] { lblImage }); Point computeSize = shell.computeSize(600, SWT.DEFAULT, true); shell.setSize(computeSize); } } });
cColor.setData("Index", new Integer(i));
drawable.setData("image", image);
canvas.setData("font", font); setControl(canvas); if (typeParams.length > 1) {
canvas.setData("SkinObject", this);
canvas.setData("SkinObject", this);
canvas.setData("STRINGS", new String[] {prefix+" Canvas widget"}); canvas.addPaintListener(e -> { Canvas c = (Canvas)e.widget;
overrideCanvas.setData("name", "Canvas"); overrideCanvas.getAccessible().addAccessibleListener(overrideAccessibleAdapter);
s.set("image", null); canvas.addListener(SWT.Paint, new PaintListener(s)); canvas.setData(s);