Class Location

  • All Implemented Interfaces:
    Persistable, java.io.Serializable, java.lang.Cloneable

    public class Location
    extends java.lang.Object
    implements Persistable, java.lang.Cloneable, java.io.Serializable
    Class Location represents a visual location.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Location()
      Create instance of location.
      Location​(int x, int y, java.lang.String clazz, java.lang.String id)
      Create instance of location.
      Location​(int x, int y, java.lang.String clazz, java.lang.String id, int angle)
      Create instance of location.
      Location​(int x, int y, java.lang.String clazz, java.lang.String id, int angle, double hor, double ver)
      Create instance of location.
    • Constructor Detail

      • Location

        public Location()
        Create instance of location.
      • Location

        public Location​(int x,
                        int y,
                        java.lang.String clazz,
                        java.lang.String id)
        Create instance of location.
        Parameters:
        x - x coordinate
        y - y coordinate
        clazz - Java class name
        id - object id
      • Location

        public Location​(int x,
                        int y,
                        java.lang.String clazz,
                        java.lang.String id,
                        int angle)
        Create instance of location.
        Parameters:
        x - x coordinate
        y - y coordinate
        clazz - Java class name
        id - object id
        angle - rotation angle
      • Location

        public Location​(int x,
                        int y,
                        java.lang.String clazz,
                        java.lang.String id,
                        int angle,
                        double hor,
                        double ver)
        Create instance of location.
        Parameters:
        x - x coordinate
        y - y coordinate
        clazz - Java class name
        id - object id
        angle - rotation angle
        hor - relative horizontal move
        ver - relative vertical move
    • Method Detail

      • getX

        public int getX()
        Get x coordinate.
        Returns:
        x coordinate
      • getY

        public int getY()
        Get y coordinate.
        Returns:
        y coordinate
      • getClazz

        public java.lang.String getClazz()
        Get Java class name.
        Returns:
        Java class name
      • getId

        public java.lang.String getId()
        Get object id.
        Specified by:
        getId in interface Persistable
        Returns:
        object id
      • getAngle

        public int getAngle()
        Get rotation angle.
        Returns:
        rotation angle
      • getHor

        public double getHor()
        Get relative horizontal move.
        Returns:
        horizontal move
      • getVer

        public double getVer()
        Get relative vertical move.
        Returns:
        vertical move
      • move

        public void move​(int dx,
                         int dy)
        Move locations.
        Parameters:
        dx - delta x
        dy - delta y
      • clone

        public Location clone()
        Overrides:
        clone in class java.lang.Object
      • getName

        public java.lang.String getName()
      • getType

        public java.lang.String getType()
        Description copied from interface: Persistable
        Get type (XML element name / database table name not Java class name).
        Specified by:
        getType in interface Persistable
        Returns:
        type
      • getChildren

        public java.util.List<java.util.List<Persistable>> getChildren()
        Description copied from interface: Persistable
        Get all multi value fields.
        Specified by:
        getChildren in interface Persistable
        Returns:
        list of list of persistable objects
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object