001package com.hfg.graphics.units;
002
003//------------------------------------------------------------------------------
004/**
005 * Container for unit-independent point.
006 *
007 * @author J. Alex Taylor, hairyfatguy.com
008 */
009//------------------------------------------------------------------------------
010// com.hfg XML/HTML Coding Library
011//
012// This library is free software; you can redistribute it and/or
013// modify it under the terms of the GNU Lesser General Public
014// License as published by the Free Software Foundation; either
015// version 2.1 of the License, or (at your option) any later version.
016//
017// This library is distributed in the hope that it will be useful,
018// but WITHOUT ANY WARRANTY; without even the implied warranty of
019// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
020// Lesser General Public License for more details.
021//
022// You should have received a copy of the GNU Lesser General Public
023// License along with this library; if not, write to the Free Software
024// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
025//
026// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
027// jataylor@hairyfatguy.com
028//------------------------------------------------------------------------------
029
030
031public class GfxPoint
032{
033   private GfxSize mX;
034   private GfxSize mY;
035
036
037   //##########################################################################
038   // CONSTRUCTORS
039   //##########################################################################
040
041   //--------------------------------------------------------------------------
042   public GfxPoint()
043   {
044
045   }
046
047   //--------------------------------------------------------------------------
048   public GfxPoint(GfxSize inX, GfxSize inY)
049   {
050      mX = inX;
051      mY = inY;
052   }
053
054   //--------------------------------------------------------------------------
055   public GfxPoint(int inX, int inY, GfxUnits inUnits)
056   {
057      mX = GfxSize.allocate(inX, inUnits);
058      mY = GfxSize.allocate(inY, inUnits);
059   }
060
061   //--------------------------------------------------------------------------
062   public GfxPoint(float inX, float inY, GfxUnits inUnits)
063   {
064      mX = GfxSize.allocate(inX, inUnits);
065      mY = GfxSize.allocate(inY, inUnits);
066   }
067
068   //##########################################################################
069   // PUBLIC METHODS
070   //##########################################################################
071
072   //--------------------------------------------------------------------------
073   public GfxPoint setX(GfxSize inValue)
074   {
075      mX = inValue;
076      return this;
077   }
078
079   //--------------------------------------------------------------------------
080   public GfxSize getX()
081   {
082      return mX;
083   }
084
085
086   //--------------------------------------------------------------------------
087   public GfxPoint setY(GfxSize inValue)
088   {
089      mY = inValue;
090      return this;
091   }
092
093   //--------------------------------------------------------------------------
094   public GfxSize getY()
095   {
096      return mY;
097   }
098}