public Dimension2DDouble getArc() { return new Dimension2DDouble( roundrect.arcwidth / 2d, roundrect.archeight / 2d); }
/** * Sets the size of this <code>Dimension2DDouble</code> object to the specified size. * This method is included for completeness, to parallel the * <code>setSize</code> method defined by <code>Component</code>. * @param d the new size for this <code>Dimension2DDouble</code> object * @see Dimension2DDouble#getSize * @see java.awt.Component#setSize * @since JDK1.1 */ public void setSize(Dimension2DDouble d) { setSize(d.width, d.height); }
@Override public void keyPressed(KeyEvent evt) { SVGRectFigure owner = (SVGRectFigure) getOwner(); Dimension2DDouble oldArc = new Dimension2DDouble(owner.getArcWidth(), owner.getArcHeight()); Dimension2DDouble newArc = new Dimension2DDouble(owner.getArcWidth(), owner.getArcHeight()); switch (evt.getKeyCode()) { case KeyEvent.VK_UP: break; if (!newArc.equals(oldArc)) { owner.willChange(); owner.setArc(newArc.width, newArc.height);
/** * Gets the size of this <code>Dimension2DDouble</code> object. * This method is included for completeness, to parallel the * <code>getSize</code> method defined by <code>Component</code>. * * @return the size of this dimension, a new instance of * <code>Dimension2DDouble</code> with the same width and height * @see Dimension2DDouble#setSize * @see java.awt.Component#getSize * @since JDK1.1 */ public Dimension2DDouble getSize() { return new Dimension2DDouble(width, height); }
@Override public Dimension2DDouble getPreferredSize() { Rectangle2D.Double b = getBounds(); return new Dimension2DDouble(b.width, b.height); }
@Override public Dimension2DDouble getPreferredSize() { Rectangle2D.Double r = getBounds(); return new Dimension2DDouble(r.width, r.height); } /**
@Override public Dimension2DDouble getPreferredSize() { Rectangle2D.Double b = getBounds(); return new Dimension2DDouble(b.width, b.height); }
@Override public Dimension2DDouble getPreferredSize() { double width = Math.ceil(STROKE_WIDTH.get(this)); return new Dimension2DDouble(width, width); }
@Override public void trackStart(Point anchor, int modifiersEx) { SVGRectFigure svgRect = (SVGRectFigure) getOwner(); originalArc2D = new Dimension2DDouble(svgRect.getArcWidth(), svgRect.getArcHeight()); }
@Override public Dimension2DDouble getPreferredSize() { if (this.layouter != null) { Rectangle2D.Double r = layouter.calculateLayout(this, getStartPoint(), getEndPoint()); return new Dimension2DDouble(r.width, r.height); } else { return super.getPreferredSize(); } }
return new Dimension2DDouble(-Math.min(textRect.x, 0) + textRect.width, -Math.min(textRect.y, 0) + textRect.height);
return new Dimension2DDouble(Math.abs(textRect.x) + textRect.width, Math.abs(textRect.y) + textRect.height);
@Override public void trackEnd(Point anchor, Point lead, int modifiersEx) { final SVGRectFigure svgRect = (SVGRectFigure) getOwner(); final Dimension2DDouble oldValue = originalArc2D; final Dimension2DDouble newValue = new Dimension2DDouble(svgRect.getArcWidth(), svgRect.getArcHeight()); ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.draw.Labels"); CompositeFigureEdit edit = new CompositeFigureEdit(svgRect, labels.getString("attribute.roundRectRadius")); edit.setVerbose(true); fireUndoableEditHappened(edit); fireUndoableEditHappened(new PropertyChangeEdit(svgRect, SVGRectFigure.ARC_WIDTH_PROPERTY, oldValue.width, newValue.width)); fireUndoableEditHappened(new PropertyChangeEdit(svgRect, SVGRectFigure.ARC_HEIGHT_PROPERTY, oldValue.height, newValue.height)); fireUndoableEditHappened(edit); }