/** * Sets the size of this <code>Dimension</code> object to the specified * width and height. This method is included for completeness, to parallel * the {@link java.awt.Component#getSize() getSize} method of * {@link java.awt.Component}. * * @param width the new width for the <code>Dimension</code> object * @param height the new height for the <code>Dimension</code> object */ public void setSize(final double width, final double height) { setHeight((float) height); setWidth((float) width); }
/** * Returns a string representation of the object. In general, the * <code>toString</code> method returns a string that * "textually represents" this object. The result should * be a concise but informative representation that is easy for a * person to read. * <p> * * @return a string representation of the object. */ public String toString() { return getClass().getName() + ":={width=" + getWidth() + ", height=" + getHeight() + "}"; }
/** * Creates an object based on the description. * * @return The object. */ public Object createObject() { final Dimension2D dim = new FloatDimension(); final float width = getFloatParameter("width"); final float height = getFloatParameter("height"); dim.setSize(width, height); return dim; }
/** * Returns a string representation of the object. In general, the * <code>toString</code> method returns a string that * "textually represents" this object. The result should * be a concise but informative representation that is easy for a * person to read. * <p> * * @return a string representation of the object. */ public String toString() { return getClass().getName() + ":={width=" + getWidth() + ", height=" + getHeight() + "}"; }
/** * Sets the size of this <code>Dimension</code> object to the specified * width and height. This method is included for completeness, to parallel * the {@link java.awt.Component#getSize() getSize} method of * {@link java.awt.Component}. * * @param width the new width for the <code>Dimension</code> object * @param height the new height for the <code>Dimension</code> object */ public void setSize(final double width, final double height) { setHeight((float) height); setWidth((float) width); }
/** * Returns a string representation of the object. In general, the * <code>toString</code> method returns a string that * "textually represents" this object. The result should * be a concise but informative representation that is easy for a * person to read. * <p> * * @return a string representation of the object. */ public String toString() { return getClass().getName() + ":={width=" + getWidth() + ", height=" + getHeight() + "}"; }
/** * Sets the size of this <code>Dimension</code> object to the specified * width and height. This method is included for completeness, to parallel * the {@link java.awt.Component#getSize() getSize} method of * {@link java.awt.Component}. * * @param width the new width for the <code>Dimension</code> object * @param height the new height for the <code>Dimension</code> object */ public void setSize(final double width, final double height) { setHeight((float) height); setWidth((float) width); }