public Dimension2D evaluate(Dimension2D v0, Dimension2D v1, float fraction) { double w = v0.getWidth() + ((v1.getWidth() - v0.getWidth()) * fraction); double h = v0.getHeight() + ((v1.getHeight() - v0.getHeight()) * fraction); Dimension2D value = (Dimension2D) v0.clone(); value.setSize(w, h); return value; }
/** * 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; }