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 Locationclone()booleanequals(java.lang.Object o)intgetAngle()Get rotation angle.NameValuePairListgetAttributes()Get all single value fields.java.util.List<java.util.List<Persistable>>getChildren()Get all multi value fields.java.lang.StringgetClazz()Get Java class name.doublegetHor()Get relative horizontal move.java.lang.StringgetId()Get object id.java.lang.StringgetName()java.lang.StringgetType()Get type (XML element name / database table name not Java class name).doublegetVer()Get relative vertical move.intgetX()Get x coordinate.intgetY()Get y coordinate.inthashCode()voidmove(int dx, int dy)Move locations.voidsetAttributes(NameValuePairList attr)Set all single value fields.voidsetChildren(java.util.List<java.util.List<Persistable>> childs)Set all multi value fields.java.lang.StringtoString()
-
-
-
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:
getIdin 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:
clonein classjava.lang.Object
-
getName
public java.lang.String getName()
-
getType
public java.lang.String getType()
Description copied from interface:PersistableGet type (XML element name / database table name not Java class name).- Specified by:
getTypein interfacePersistable- Returns:
- type
-
getAttributes
public NameValuePairList getAttributes()
Description copied from interface:PersistableGet all single value fields.- Specified by:
getAttributesin interfacePersistable- Returns:
- name value pair list
-
getChildren
public java.util.List<java.util.List<Persistable>> getChildren()
Description copied from interface:PersistableGet all multi value fields.- Specified by:
getChildrenin interfacePersistable- Returns:
- list of list of persistable objects
-
setAttributes
public void setAttributes(NameValuePairList attr) throws ModelException
Description copied from interface:PersistableSet all single value fields.- Specified by:
setAttributesin 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:PersistableSet all multi value fields.- Specified by:
setChildrenin interfacePersistable- Parameters:
childs- list of list of persistable objects- Throws:
ModelException- if problems
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-