/** * Invokes platform specific functionality to allocate a new region. * <p> * <b>IMPORTANT:</b> This method is <em>not</em> part of the public * API for <code>Region</code>. It is marked public only so that it * can be shared within the packages provided by SWT. It is not * available on all platforms, and should never be called from * application code. * </p> * * @param device the device on which to allocate the region * @param handle the handle for the region * @return a new region object containing the specified device and handle * * @noreference This method is not intended to be referenced by clients. */ public static Region win32_new(Device device, int handle) { return new Region(device, handle); }
void setNewShape() { Region oldRegion = region; region = new Region(); region.add(getPolygon(false)); hoverShell.setRegion(region); if (oldRegion != null) { oldRegion.dispose(); } } }
@Override public void initialize(AnimationEngine engine) { Color color = getAnimationShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW); getAnimationShell().setBackground(color); // Ensure that the background won't show on the initial display shellRegion = new Region(getAnimationShell().getDisplay()); getAnimationShell().setRegion(shellRegion); }
void setNewShape() { Region oldRegion = region; region = new Region(); region.add(getPolygon(false)); hoverShell.setRegion(region); if (oldRegion != null) { oldRegion.dispose(); } } }
void setNewShape() { Region oldRegion = region; region = new Region(); region.add(getPolygon(false)); hoverShell.setRegion(region); if(oldRegion != null) { oldRegion.dispose(); } } }
private void updateRegion() { Region region = new Region(); for (Adornment adornment : adornments) { adornment.updateRegion(region); } overlayShell.setRegion(region); if (!overlayShell.getVisible()) overlayShell.setVisible(true); }
void setNewShape() { Region oldRegion = region; region = new Region(); region.add(getPolygon(false)); hoverShell.setRegion(region); if (oldRegion != null) { oldRegion.dispose(); } } }
void setNewShape() { Region oldRegion = region; region = new Region(); region.add(getPolygon(false)); hoverShell.setRegion(region); if (oldRegion != null) { oldRegion.dispose(); } } }
private void updateRegion() { Region region = new Region(); for (Adornment adornment : adornments) { adornment.updateRegion(region); } overlayShell.setRegion(region); if (!overlayShell.getVisible()) { overlayShell.setVisible(true); } }
/** * Hides the rubberband (but does not eliminate it). * <p> * Increments by one the rubberband "hide" nesting count. The rubberband * is hidden from view (but remains active) if it wasn't already hidden. * </p> */ public void hideRubberband() { if (rubberbandHiddenNestingCount++ <= 0) { Region region = new Region(); rubberband.addDamagedRegion(displayFDC, region); Rectangle r = region.getBounds(); paintCanvas.redraw(r.x, r.y, r.width, r.height, true); region.dispose(); } }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
void fillRegion(GC gc, Region region) { // NOTE: region passed in to this function will be modified Region clipping = new Region(); gc.getClipping(clipping); region.intersect(clipping); gc.setClipping(region); gc.fillRectangle(region.getBounds()); gc.setClipping(clipping); clipping.dispose(); }
/** * Clears the active rubberband selection. * <p> * Erases any rubberband objects on the screen then clears the selection. * </p> */ public void clearRubberbandSelection() { if (! isRubberbandHidden()) { Region region = new Region(); rubberband.addDamagedRegion(displayFDC, region); Rectangle r = region.getBounds(); paintCanvas.redraw(r.x, r.y, r.width, r.height, true); region.dispose(); } rubberband.clear(); }
protected void packPopup() { popupLayout.marginTop = HAH; popupLayout.marginBottom = 0; popup.pack(); Region oldRegion = region; region = new Region(); region.add(getPolygon(false)); popup.setRegion(region); Rectangle bounds = region.getBounds(); popup.setSize(bounds.width, bounds.height + 2); if (oldRegion != null) { oldRegion.dispose(); } }
static Region mirrorRegion (Region region) { if (region == null) return null; Region mirrored = new Region (region.getDevice ()); long /*int*/ rgn = region.handle; int [] nRects = new int [1]; long /*int*/ [] rects = new long /*int*/ [1]; gdk_region_get_rectangles (rgn, rects, nRects); Rectangle bounds = DPIUtil.autoScaleUp(region.getBounds ()); GdkRectangle rect = new GdkRectangle (); for (int i = 0; i < nRects [0]; i++) { OS.memmove (rect, rects[0] + (i * GdkRectangle.sizeof), GdkRectangle.sizeof); rect.x = bounds.x + bounds.width - rect.x - rect.width; OS.gdk_region_union_with_rect (mirrored.handle, rect); } if (rects [0] != 0) OS.g_free (rects [0]); return mirrored; }
static Region mirrorRegion (Region region) { if (region == null) return null; Region mirrored = new Region (region.getDevice ()); int /*long*/ rgn = region.handle; int [] nRects = new int [1]; int /*long*/ [] rects = new int /*long*/ [1]; gdk_region_get_rectangles (rgn, rects, nRects); Rectangle bounds = DPIUtil.autoScaleUp(region.getBounds ()); GdkRectangle rect = new GdkRectangle (); for (int i = 0; i < nRects [0]; i++) { OS.memmove (rect, rects[0] + (i * GdkRectangle.sizeof), GdkRectangle.sizeof); rect.x = bounds.x + bounds.width - rect.x - rect.width; OS.gdk_region_union_with_rect (mirrored.handle, rect); } if (rects [0] != 0) OS.g_free (rects [0]); return mirrored; }
private void defineRegion() { Region rgn = new Region(); for (Rectangle r : rects) { rgn.add(r); rgn.subtract(r.x + 2, r.y + 2, r.width - 4, r.height - 4); } if (feedbackShell.getRegion() != null && !feedbackShell.getRegion().isDisposed()) feedbackShell.getRegion().dispose(); feedbackShell.setRegion(rgn); feedbackShell.redraw(); display.update(); }