public class LocalizableModel extends java.lang.Object implements Localizable
Constructor and Description |
---|
LocalizableModel()
Create a localizable, set to
(0, 0) by default. |
LocalizableModel(double x,
double y)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getHeight()
Get the height.
|
int |
getLocationIntX()
Get the current rounded horizontal location.
|
int |
getLocationIntY()
Get the current rounded vertical location.
|
int |
getLocationOffsetX()
Get the horizontal offset location.
|
int |
getLocationOffsetY()
Get the vertical offset location.
|
double |
getLocationOldX()
Get the old horizontal location.
|
double |
getLocationOldY()
Get the old vertical location.
|
double |
getLocationX()
Get the current horizontal location.
|
double |
getLocationY()
Get the current vertical location.
|
int |
getWidth()
Get the width.
|
void |
moveLocation(double extrp,
double vx,
double vy)
Move location using a simple force.
|
void |
moveLocation(double extrp,
Force force,
Force... forces)
Move location using different forces.
|
void |
setLocation(double x,
double y)
Set location instantly.
|
void |
setLocationOffset(double x,
double y)
Set location offset.
|
void |
setLocationX(double x)
Set horizontal location.
|
void |
setLocationY(double y)
Set vertical location.
|
void |
setSize(int width,
int height)
Set size.
|
void |
teleport(double x,
double y)
Teleport to a new location.
|
void |
teleportX(double x)
Teleport to a new horizontal location.
|
void |
teleportY(double y)
Teleport to a new vertical location.
|
public LocalizableModel()
(0, 0)
by default.public LocalizableModel(double x, double y)
x
- The horizontal location.y
- The vertical location.public void teleport(double x, double y)
Localizable
teleport
in interface Localizable
x
- The new horizontal location.y
- The new vertical location.public void teleportX(double x)
Localizable
teleportX
in interface Localizable
x
- The new horizontal location.public void teleportY(double y)
Localizable
teleportY
in interface Localizable
y
- The new vertical location.public void moveLocation(double extrp, Force force, Force... forces)
Localizable
moveLocation
in interface Localizable
extrp
- The extrapolation value.force
- The primary force.forces
- The other forces.public void moveLocation(double extrp, double vx, double vy)
Localizable
moveLocation
in interface Localizable
extrp
- The extrapolation value.vx
- The horizontal force.vy
- The vertical force.public void setLocation(double x, double y)
Localizable
setLocation
in interface Localizable
x
- The new horizontal location.y
- The new vertical location.public void setLocationX(double x)
Localizable
setLocationX
in interface Localizable
x
- The new horizontal location.public void setLocationY(double y)
Localizable
setLocationY
in interface Localizable
y
- The new vertical location.public void setLocationOffset(double x, double y)
Localizable
setLocationOffset
in interface Localizable
x
- The new horizontal location offset.y
- The new vertical location offset.public void setSize(int width, int height)
Localizable
setSize
in interface Localizable
width
- The width.height
- The height.public double getLocationX()
Localizable
getLocationX
in interface Localizable
public double getLocationY()
Localizable
getLocationY
in interface Localizable
public int getLocationIntX()
Surface
getLocationIntX
in interface Surface
public int getLocationIntY()
Surface
getLocationIntY
in interface Surface
public double getLocationOldX()
Localizable
getLocationOldX
in interface Localizable
public double getLocationOldY()
Localizable
getLocationOldY
in interface Localizable
public int getLocationOffsetX()
Surface
getLocationOffsetX
in interface Surface
public int getLocationOffsetY()
Surface
getLocationOffsetY
in interface Surface
public int getWidth()
Surface