//----------------------------------------------------------------------------//
//                                                                            //
//                           P o i n t F a c a d e                            //
//                                                                            //
//  Copyright (C) Herve Bitteur 2000-2006. All rights reserved.               //
//  This software is released under the terms of the GNU General Public       //
//  License. Please contact the author at herve.bitteur@laposte.net           //
//  to report bugs & suggestions.                                             //
//----------------------------------------------------------------------------//
//
package omr.util;

import java.awt.Point;

import javax.xml.bind.annotation.*;

/**
 * Class <code>PointFacade</code> is a (hopefully temporary) fix to allow Xml
 * binding of standard class Point that we cannot annotate
 *
 *
 * @author Herv&eacute Bitteur
 * @version $Id$
 */
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement(name = "point")
public class PointFacade
{
    //~ Instance fields --------------------------------------------------------

    /** The interfaced Point instance */
    private Point point;

    //~ Constructors -----------------------------------------------------------

    //-------------//
    // PointFacade //
    //-------------//
    /**
     * Creates a new instance of PointFacade
     */
    public PointFacade ()
    {
    }

    //-------------//
    // PointFacade //
    //-------------//
    /**
     * Creates a new PointFacade object.
     *
     * @param point the interfaced point
     */
    public PointFacade (Point point)
    {
        this.point = point;
    }

    //~ Methods ----------------------------------------------------------------

    //----------//
    // getPoint //
    //----------//
    /**
     * Report the interfaced point
     *
     * @return the actual point
     */
    public Point getPoint ()
    {
        return point;
    }

    //------//
    // setX //
    //------//
    @XmlElement
    public void setX (int x)
    {
        point.x = x;
    }

    //------//
    // getX //
    //------//
    public int getX ()
    {
        return point.x;
    }

    //------//
    // setY //
    //------//
    @XmlElement
    public void setY (int y)
    {
        point.y = y;
    }

    //------//
    // getY //
    //------//
    public int getY ()
    {
        return point.y;
    }
}

@@ -2084,39 +2084,41 @@
 -----//%0A    @Xml
-Element
+Attribute
 %0A    public void
@@ -2129,32 +2129,105 @@
 X (int x)%0A    %7B%0A
+        if (point == null) %7B%0A            point = new Point();%0A        %7D%0A%0A
         point.x 
@@ -2396,23 +2396,25 @@
     @Xml
-Element
+Attribute
 %0A    pub
@@ -2435,22 +2435,95 @@
 (int y)%0A
-
     %7B%0A
+        if (point == null) %7B%0A            point = new Point();%0A        %7D%0A%0A
         

Fix element vs attribute