Package dk.vajhoej.model.core
Class Location
- java.lang.Object
-
- dk.vajhoej.model.core.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Location
clone()
boolean
equals(java.lang.Object o)
int
getAngle()
Get rotation angle.NameValuePairList
getAttributes()
Get all single value fields.java.util.List<java.util.List<Persistable>>
getChildren()
Get all multi value fields.java.lang.String
getClazz()
Get Java class name.double
getHor()
Get relative horizontal move.java.lang.String
getId()
Get object id.java.lang.String
getName()
java.lang.String
getType()
Get type (XML element name / database table name not Java class name).double
getVer()
Get relative vertical move.int
getX()
Get x coordinate.int
getY()
Get y coordinate.int
hashCode()
void
move(int dx, int dy)
Move locations.void
setAttributes(NameValuePairList attr)
Set all single value fields.void
setChildren(java.util.List<java.util.List<Persistable>> childs)
Set all multi value fields.java.lang.String
toString()
-
-
-
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 coordinatey
- y coordinateclazz
- Java class nameid
- 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 coordinatey
- y coordinateclazz
- Java class nameid
- object idangle
- 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 coordinatey
- y coordinateclazz
- Java class nameid
- object idangle
- rotation anglehor
- relative horizontal movever
- 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 interfacePersistable
- 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 xdy
- delta y
-
clone
public Location clone()
- Overrides:
clone
in classjava.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 interfacePersistable
- Returns:
- type
-
getAttributes
public NameValuePairList getAttributes()
Description copied from interface:Persistable
Get all single value fields.- Specified by:
getAttributes
in interfacePersistable
- Returns:
- name value pair list
-
getChildren
public java.util.List<java.util.List<Persistable>> getChildren()
Description copied from interface:Persistable
Get all multi value fields.- Specified by:
getChildren
in interfacePersistable
- Returns:
- list of list of persistable objects
-
setAttributes
public void setAttributes(NameValuePairList attr) throws ModelException
Description copied from interface:Persistable
Set all single value fields.- Specified by:
setAttributes
in interfacePersistable
- Parameters:
attr
- value pair list- Throws:
ModelException
- if problems
-
setChildren
public void setChildren(java.util.List<java.util.List<Persistable>> childs) throws ModelException
Description copied from interface:Persistable
Set all multi value fields.- Specified by:
setChildren
in interfacePersistable
- Parameters:
childs
- list of list of persistable objects- Throws:
ModelException
- if problems
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-