//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 02NOV2008 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Sets the size of this <code>Dimension</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>Dimension</code> object */ public void SetSize(Dimension d) { Width = d.Width; Height = d.Height; }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 13JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Creates an instance of <code>Dimension</code> whose width * and height are the same as for the specified dimension. * * @param d the specified dimension for the * <code>width</code> and * <code>height</code> values */ public Dimension(Dimension d) { Width = d.Width; Height = d.Height; }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 02NOV2008 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Sets the location and size of the framing rectangle of this * <code>IShape</code> to the specified {@link Point} and * {@link Dimension}, respectively. The framing rectangle is used * by the subclasses of <code>RectangularShape</code> to define * their geometry. * @param loc the specified <code>Point</code> * @param size the specified <code>Dimension</code> */ public void SetFrame(Point loc, Dimension size) { SetFrame(loc.GetX(), loc.GetY(), size.GetWidth(), size.GetHeight()); }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 13JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Sets the location, size, angular extents, and closure type of * this arc to the specified values. * * @param loc The <CODE>Point</CODE> representing the coordinates of * the upper-left corner of the arc. * @param size The <CODE>Dimension</CODE> representing the width * and height of the full ellipse of which this arc is * a partial section. * @param angSt The starting angle of the arc in degrees. * @param angExt The angular extent of the arc in degrees. * @param closure The closure type for the arc: * {@link #OPEN}, {@link #CHORD}, or {@link #PIE}. */ public void SetArc(Point loc, Dimension size, double angSt, double angExt, int closure) { SetArc(loc.GetX(), loc.GetY(), size.GetWidth(), size.GetHeight(), angSt, angExt, closure); }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 02NOV2008 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Sets the size of this <code>Dimension</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>Dimension</code> object */ public void SetSize(Dimension d) { Width = d.Width; Height = d.Height; }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 13JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Creates an instance of <code>Dimension</code> whose width * and height are the same as for the specified dimension. * * @param d the specified dimension for the * <code>width</code> and * <code>height</code> values */ public Dimension(Dimension d) { Width = d.Width; Height = d.Height; }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 13JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Constructs a new <code>Rectangle</code> whose top left corner is * (0, 0) and whose width and height are specified * by the <code>Dimension</code> argument. * @param d a <code>Dimension</code>, specifying width and height */ public Rectangle(Dimension d) : this(0, 0, d.Width, d.Height) { }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 13JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Constructs a new <code>Rectangle</code> whose upper-left corner is * specified by the {@link Point} argument, and * whose width and height are specified by the * {@link Dimension} argument. * @param p a <code>Point</code> that is the upper-left corner of * the <code>Rectangle</code> * @param d a <code>Dimension</code>, representing the * width and height of the <code>Rectangle</code> */ public Rectangle(Point p, Dimension d) : this(p.X, p.Y, d.Width, d.Height) { }
/** * Creates a new instance of Rectangle at position (x, y) and with * predefine dimension * * @param x the x coordinate of the rectangle * @param y the y coordinate of the rectangle * @param d the {@link Dimension} of the rectangle */ public Rectangle(int x, int y, Dimension d) : this(x, y, d.Width, d.Height) { }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 13JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Constructs a new <code>Rectangle</code> whose upper-left corner is * specified as * {@code (x,y)} and whose width and height * are specified by the arguments of the same name. * @param x the specified X coordinate * @param y the specified Y coordinate * @param width the width of the <code>Rectangle</code> * @param height the height of the <code>Rectangle</code> */ public Rectangle(int x, int y, int width, int height) { X = x; Y = y; Width = width; Height = height; _size = new Dimension(width, height); }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 13JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Sets the size of this <code>Rectangle</code> to match the * specified <code>Dimension</code>. * <p> * This method is included for completeness, to parallel the * <code>setSize</code> method of <code>Component</code>. * @param d the new size for the <code>Dimension</code> object */ public void SetSize(Dimension d) { SetSize(d.Width, d.Height); }