001 /* 002 * Copyright 2002 - 2007 JEuclid, http://jeuclid.sf.net 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 /* $Id: Dimension2DImpl.java,v 8afef6dd0d58 2007/09/14 08:29:58 maxberger $ */ 018 019 package net.sourceforge.jeuclid.elements.support; 020 021 import java.awt.geom.Dimension2D; 022 023 /** 024 * @version $Revision: 8afef6dd0d58 $ 025 */ 026 public class Dimension2DImpl extends Dimension2D { 027 private float width; 028 029 private float height; 030 031 /** 032 * Default Constructor. 033 * 034 * @param w 035 * new width. 036 * @param h 037 * new height. 038 */ 039 public Dimension2DImpl(final float w, final float h) { 040 this.width = w; 041 this.height = h; 042 } 043 044 /** {@inheritDoc} */ 045 @Override 046 public double getHeight() { 047 return this.height; 048 } 049 050 /** {@inheritDoc} */ 051 @Override 052 public double getWidth() { 053 return this.width; 054 055 } 056 057 /** {@inheritDoc} */ 058 @Override 059 public void setSize(final double w, final double h) { 060 this.width = (float) w; 061 this.height = (float) h; 062 } 063 }