Package paintingcanvas.drawable
Interface Anchorable<T extends Drawable<T>>
-
- All Superinterfaces:
Animatable
,Drawable<T>
,Positionable<T>
- All Known Implementing Classes:
Circle
,DrawableBase.InteractableShape
,DrawableBase.Shape
,Ellipse
,Image
,Rectangle
,Square
,Text
,Triangle
public interface Anchorable<T extends Drawable<T>> extends Drawable<T>, Positionable<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Anchor
getAnchor()
Get the current anchor of the element.void
internalSetAnchor(Anchor anchor)
default T
setAnchor(Anchor anchor)
Set the anchor of the element.-
Methods inherited from interface paintingcanvas.animation.Animatable
Modifier and Type Method Description default AnimationBuilder
colorTo(int hex, double duration)
Change the color ofthis
to the specifiedcolor
overduration
seconds.default AnimationBuilder
colorTo(int r, int g, int b, double duration)
Change the color ofthis
to the specifiedcolor
overduration
seconds.default AnimationBuilder
colorTo(int r, int g, int b, int a, double duration)
Change the color ofthis
to the specifiedcolor
overduration
seconds.default AnimationBuilder
colorTo(java.awt.Color color, double duration)
Change the color ofthis
to the specifiedcolor
overduration
seconds.default AnimationBuilder
colorTo(java.lang.String name, double duration)
Change the color ofthis
to the specifiedcolor
overduration
seconds.default AnimationBuilder
colorTo(Hue hue, double duration)
Change the color ofthis
to the specifiedcolor
overduration
seconds.Drawable<?>
drawable()
Get theDrawable
element from thisAnimatable
.default AnimationBuilder
fadeIn(double duration)
Fadethis
in overduration
seconds.default AnimationBuilder
fadeOut(double duration)
Fadethis
out overduration
seconds.default AnimationBuilder
moveBy(int x, int y, double duration)
Movethis
by the specifiedx
andy
overduration
seconds.default AnimationBuilder
moveHorizontalBy(int x, double duration)
Movethis
by the specifiedx
horizontally overduration
seconds.default AnimationBuilder
moveTo(int x, int y, double duration)
Movethis
to the specifiedx
andy
overduration
secondsdefault AnimationBuilder
moveVerticalBy(int y, double duration)
Movethis
by the specifiedy
vertically overduration
seconds.default AnimationBuilder
rotateBy(int angle, double duration)
Rotatethis
byangle
degrees overduration
seconds.default AnimationBuilder
rotateTo(int angle, double duration)
Rotatethis
to the specifiedangle
degrees overduration
seconds.
-
Methods inherited from interface paintingcanvas.drawable.Drawable
Modifier and Type Method Description default AnimationBuilder
animate()
Start animating this object.default T
bringToFront()
Brings the object in front of all other objects.java.awt.Point
center(java.awt.Graphics2D g)
Get the object's centerpointdefault Drawable<?>
drawable()
Get theDrawable
element from thisAnimatable
.default void
erase()
Erase this object from the canvas.int
getLayer()
Gets the current layer of the object.T
getThis()
T
hide()
Hide the Object.void
internalSetLayer(int layer)
void
render(java.awt.Graphics2D g)
Actually render the object itselfdefault T
sendToBack()
Puts the object behind all other objects.default T
setLayer(int layer)
Puts the object on a specific layer.T
show()
Show the Object
-
Methods inherited from interface paintingcanvas.drawable.Positionable
Modifier and Type Method Description java.awt.Point
getPos()
Get the position of the elementdouble
getRotation()
Get an elements rotationdefault int
getX()
Get the X-position of the elementdefault int
getY()
Get the Y-position of the element.double
internalGetRotation()
void
internalSetPos(int x, int y)
void
internalSetRotation(double rotation)
default T
move(int x, int y)
Moves this drawable by the specified x and y.default T
moveHorizontal(int x)
Moves this drawable by the specified x and y.default T
moveVertical(int y)
Moves this drawable by the specified x and y.default T
rotate(double rotation)
Rotate this element byrotation
degrees.default T
setPos(int x, int y)
Set the position of the element.default T
setRotation(double rotation)
Set an elements rotation torotation
degrees.default T
setX(int x)
Set the X-position of the objectdefault T
setY(int y)
Set the Y-position of the element
-
-