return; String string = ( (Region) object ).getBounds().toString(); gc.drawString( string, 0, 0 ); return;
/** * 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(); } }
if ((style & SWT.NO_TRIM) == 0) return; if (region != null) { Rectangle bounds = region.getBounds (); setSize (bounds.x + bounds.width, bounds.y + bounds.height);
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(); } }
Rectangle bounds = region.getBounds (); setSize (bounds.x + bounds.width, bounds.y + bounds.height);
Rectangle bounds = region.getBounds (); setSize (bounds.x + bounds.width, bounds.y + bounds.height);
Rectangle bounds = region.getBounds (); setSize (bounds.x + bounds.width, bounds.y + bounds.height);
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; }
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 packPopup() { boolean isUnderLeft= fSnapPosition == SNAP_POSITION_UNDER_LEFT_FIELD; boolean isOverLeft= fSnapPosition == SNAP_POSITION_OVER_LEFT_FIELD; fPopupLayout.marginTop= isUnderLeft ? HAH : 0; fPopupLayout.marginBottom= isOverLeft ? HAH + 1 : 0; fPopup.pack(); Region oldRegion= fRegion; if (isUnderLeft || isOverLeft) { fRegion= new Region(); fRegion.add(getPolygon(false)); fPopup.setRegion(fRegion); Rectangle bounds= fRegion.getBounds(); fPopup.setSize(bounds.width, bounds.height + 1); } else { fRegion= null; fPopup.setRegion(null); } if (oldRegion != null) { oldRegion.dispose(); } }
private void packPopup() { if (!fSnapPositionChanged) { return; } fSnapPositionChanged= false; boolean isUnderLeft= fSnapPosition == SNAP_POSITION_UNDER_LEFT_FIELD; boolean isOverLeft= fSnapPosition == SNAP_POSITION_OVER_LEFT_FIELD; fPopupLayout.marginTop= isUnderLeft ? HAH : 0; fPopupLayout.marginBottom= isOverLeft ? HAH + 1 : 0; fPopup.pack(); Region oldRegion= fRegion; if (isUnderLeft || isOverLeft) { fRegion= new Region(); fRegion.add(getPolygon(false)); fPopup.setRegion(fRegion); Rectangle bounds= fRegion.getBounds(); fPopup.setSize(bounds.width, bounds.height + 1); } else { fRegion= null; fPopup.setRegion(null); } if (oldRegion != null) { oldRegion.dispose(); } }
private void packPopup() { if (!fSnapPositionChanged) { return; } fSnapPositionChanged= false; boolean isUnderLeft= fSnapPosition == SNAP_POSITION_UNDER_LEFT_FIELD; boolean isOverLeft= fSnapPosition == SNAP_POSITION_OVER_LEFT_FIELD; fPopupLayout.marginTop= isUnderLeft ? HAH : 0; fPopupLayout.marginBottom= isOverLeft ? HAH + 1 : 0; fPopup.pack(); Region oldRegion= fRegion; if (isUnderLeft || isOverLeft) { fRegion= new Region(); fRegion.add(getPolygon(false)); fPopup.setRegion(fRegion); Rectangle bounds= fRegion.getBounds(); fPopup.setSize(bounds.width, bounds.height + 1); } else { fRegion= null; fPopup.setRegion(null); } if (oldRegion != null) { oldRegion.dispose(); } }