Rectangle resizedRect = Geometry.copy( shellSize ); constrainRectangleToContainer( resizedRect, entireClientArea );
/** * Returns the size constraints. * * @return the size constraints or <code>null</code> if not set * @see #setSizeConstraints(int, int) */ protected final Point getSizeConstraints() { return fSizeConstraints != null ? Geometry.copy(fSizeConstraints) : null; }
/** * Returns the size constraints. * * @return the size constraints or <code>null</code> if not set * @see #setSizeConstraints(int, int) */ protected final Point getSizeConstraints() { return fSizeConstraints != null ? Geometry.copy(fSizeConstraints) : null; }
public void setRectangle(Rectangle newRect) { if (tracker == null) { return; } Rectangle[] rectArray = { Geometry.copy(newRect) }; tracker.setRectangles(rectArray); }
public Rectangle getBounds() { if (areaRectangles.isEmpty()) return new Rectangle(0, 0, 0, 0); AreaRectangle ar0 = areaRectangles.get(0); Rectangle bounds = Geometry.copy(ar0.rect); for (int i = 1; i < areaRectangles.size(); i++) { AreaRectangle ar = areaRectangles.get(i); bounds.add(ar.rect); } return bounds; }
public Rectangle getBounds() { if (areaRectangles.size() == 0) return new Rectangle(0, 0, 0, 0); AreaRectangle ar0 = areaRectangles.get(0); Rectangle bounds = Geometry.copy(ar0.rect); for (int i = 1; i < areaRectangles.size(); i++) { AreaRectangle ar = areaRectangles.get(i); bounds.add(ar.rect); } return bounds; }
return Geometry.copy(getPreferredSize()); Point result = Geometry.copy(getPreferredSize()); return Geometry.copy(preferredSize); return Geometry.copy(cachedHeight); Point result = Geometry.copy(preferredSize); result.x = widthHint; return result; return Geometry.copy(cachedHeight); return Geometry.copy(preferredSize); return Geometry.copy(cachedWidth); return Geometry.copy(cachedWidth);
return Geometry.copy(getPreferredSize()); Point result = Geometry.copy(getPreferredSize()); return Geometry.copy(preferredSize); return Geometry.copy(cachedHeight); return Geometry.copy(cachedHeight); return Geometry.copy(preferredSize); return Geometry.copy(cachedWidth); return Geometry.copy(cachedWidth);
/** * Perform any initialization you want to have happen -before- the * amination starts */ @Override public boolean jobInit(AnimationEngine engine) { if (!super.jobInit(engine)) return false; // Compute the shell's bounds Rectangle shellBounds = Geometry.copy((Rectangle) getStartRects() .get(0)); Iterator startIter = getStartRects().iterator(); Iterator endIter = getEndRects().iterator(); while (startIter.hasNext()) { shellBounds.add((Rectangle) startIter.next()); shellBounds.add((Rectangle) endIter.next()); } getAnimationShell().setBounds(shellBounds); // Making the shell visible will be slow on old video cards, so only start // the timer once it is visible. getAnimationShell().setVisible(true); return true; // OK to go... }
/** * Computes the size constraints of the information control in points based on the * default font of the given subject control as well as the size constraints in character * width. * * @param subjectControl the subject control * @param informationControl the information control whose size constraints are computed * @return the computed size constraints in points */ protected Point computeSizeConstraints(Control subjectControl, IInformationControl informationControl) { if (fSizeConstraints == null) { if (informationControl instanceof IInformationControlExtension5) { IInformationControlExtension5 iControl5= (IInformationControlExtension5) informationControl; fSizeConstraints= iControl5.computeSizeConstraints(fWidthConstraint, fHeightConstraint); if (fSizeConstraints != null) return Geometry.copy(fSizeConstraints); } if (subjectControl == null) return null; GC gc= new GC(subjectControl); gc.setFont(subjectControl.getFont()); double width= gc.getFontMetrics().getAverageCharacterWidth(); int height = gc.getFontMetrics().getHeight(); gc.dispose(); fSizeConstraints= new Point((int) (fWidthConstraint * width), fHeightConstraint * height); } return new Point(fSizeConstraints.x, fSizeConstraints.y); }
/** * Computes the size constraints of the information control in points based on the * default font of the given subject control as well as the size constraints in character * width. * * @param subjectControl the subject control * @param informationControl the information control whose size constraints are computed * @return the computed size constraints in points */ protected Point computeSizeConstraints(Control subjectControl, IInformationControl informationControl) { if (fSizeConstraints == null) { if (informationControl instanceof IInformationControlExtension5) { IInformationControlExtension5 iControl5= (IInformationControlExtension5) informationControl; fSizeConstraints= iControl5.computeSizeConstraints(fWidthConstraint, fHeightConstraint); if (fSizeConstraints != null) return Geometry.copy(fSizeConstraints); } if (subjectControl == null) return null; GC gc= new GC(subjectControl); gc.setFont(subjectControl.getFont()); int width= gc.getFontMetrics().getAverageCharWidth(); int height = gc.getFontMetrics().getHeight(); gc.dispose(); fSizeConstraints= new Point (fWidthConstraint * width, fHeightConstraint * height); } return new Point(fSizeConstraints.x, fSizeConstraints.y); }
/** * Tests whether a given mouse location is within the keep-up zone. * The hover should not be hidden as long as the mouse stays inside this zone. * * @param x the x coordinate, relative to the <em>subject control</em> * @param y the y coordinate, relative to the <em>subject control</em> * @param controlBounds the bounds of the current control * * @return <code>true</code> iff the mouse event occurred in the keep-up zone */ private boolean inKeepUpZone(int x, int y, Rectangle controlBounds) { // +-----------+ // |subjectArea| // +-----------+ // |also keepUp| // ++-----------+-------+ // | totalBounds | // +--------------------+ if (fSubjectArea.contains(x, y)) return true; Rectangle iControlBounds= fSubjectControl.getDisplay().map(null, fSubjectControl, controlBounds); Rectangle totalBounds= Geometry.copy(iControlBounds); if (totalBounds.contains(x, y)) return true; int keepUpY= fSubjectArea.y + fSubjectArea.height; Rectangle alsoKeepUp= new Rectangle(fSubjectArea.x, keepUpY, fSubjectArea.width, totalBounds.y - keepUpY); return alsoKeepUp.contains(x, y); }
/** * Tests whether a given mouse location is within the keep-up zone. * The hover should not be hidden as long as the mouse stays inside this zone. * * @param x the x coordinate, relative to the <em>subject control</em> * @param y the y coordinate, relative to the <em>subject control</em> * @param controlBounds the bounds of the current control * * @return <code>true</code> iff the mouse event occurred in the keep-up zone */ private boolean inKeepUpZone(int x, int y, Rectangle controlBounds) { // +-----------+ // |subjectArea| // +-----------+ // |also keepUp| // ++-----------+-------+ // | totalBounds | // +--------------------+ if (fSubjectArea.contains(x, y)) return true; Rectangle iControlBounds= fSubjectControl.getDisplay().map(null, fSubjectControl, controlBounds); Rectangle totalBounds= Geometry.copy(iControlBounds); if (totalBounds.contains(x, y)) return true; int keepUpY= fSubjectArea.y + fSubjectArea.height; Rectangle alsoKeepUp= new Rectangle(fSubjectArea.x, keepUpY, fSubjectArea.width, totalBounds.y - keepUpY); return alsoKeepUp.contains(x, y); }
Rectangle totalBounds= Geometry.copy(iControlBounds); if (blowUp && isReplaceInProgress()) {
Rectangle totalBounds= Geometry.copy(iControlBounds); if (blowUp && isReplaceInProgress()) {