|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.effects.ScaleDecorator
public class ScaleDecorator
Decorator that scales the painting of a component along the X and/or Y axes.
Generally speaking, decorators don't force a repaint of the component(s) they are attached to when their parameters are changed. So, if this decorator is changed after being applied to a particular component (e.g., to do a dynamic resize) then either the component.repaint() method must be called or the decorator should be removed and added again to force a repaint with the new scale.
Constructor Summary | |
---|---|
ScaleDecorator()
Creates a new ScaleDecorator with the default scaleX scaleY values of 1. |
|
ScaleDecorator(float scaleX,
float scaleY)
Creates a new ScaleDecorator with the specified scaleX and scaleY values. |
Method Summary | |
---|---|
Bounds |
getBounds(Component component)
Returns the bounding area of the decorator. |
HorizontalAlignment |
getHorizontalAlignment()
Gets the horizontal alignment of the decorator. |
float |
getScaleX()
Gets the amount by which drawing operations will be scaled along the x-axis. |
float |
getScaleY()
Gets the amount by which drawing operations will be scaled along the y-axis. |
AffineTransform |
getTransform(Component component)
Returns the transformation the decorator applies to the component's coordinate space. |
VerticalAlignment |
getVerticalAlignment()
Gets the vertical alignment of the decorator. |
Graphics2D |
prepare(Component component,
Graphics2D graphics)
Prepares the graphics context into which the component or prior decorator will paint. |
void |
repaint(Component component,
int x,
int y,
int width,
int height)
|
void |
setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
Sets the horizontal alignment of the decorator. |
void |
setScale(float scale)
Sets the amount by which drawing operations will be scaled along both the x and y axes. |
void |
setScale(float scaleX,
float scaleY)
Sets the amount by which drawing operations will be scaled along the x and y axes. |
void |
setScaleX(float scaleX)
Sets the amount by which drawing operations will be scaled along the x-axis. |
void |
setScaleX(Number scaleX)
Sets the amount by which drawing operations will be scaled along the x-axis. |
void |
setScaleY(float scaleY)
Sets the amount by which drawing operations will be scaled along the y-axis. |
void |
setScaleY(Number scaleY)
Sets the amount by which drawing operations will be scaled along the y-axis. |
void |
setVerticalAlignment(VerticalAlignment verticalAlignment)
Sets the vertical alignment of the decorator. |
void |
update()
Updates the graphics context into which the component or prior decorator was painted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScaleDecorator()
public ScaleDecorator(float scaleX, float scaleY)
scaleX
- The amount to scale the component's x-axisscaleY
- The amount to scale the component's y-axisMethod Detail |
---|
public float getScaleX()
public void setScaleX(float scaleX)
scaleX
- The amount to scale the component's x-axispublic void setScaleX(Number scaleX)
scaleX
- The amount to scale the component's x-axispublic float getScaleY()
public void setScaleY(float scaleY)
scaleY
- The amount to scale the component's y-axispublic void setScaleY(Number scaleY)
scaleY
- The amount to scale the component's y-axispublic void setScale(float scaleX, float scaleY)
scaleX
- The amount to scale the component's x-axis.scaleY
- The amount to scale the component's y-axis.public void setScale(float scale)
scale
- The amount to scale the component's x and y axes.public HorizontalAlignment getHorizontalAlignment()
public void setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
horizontalAlignment
- The horizontal alignmentpublic VerticalAlignment getVerticalAlignment()
public void setVerticalAlignment(VerticalAlignment verticalAlignment)
verticalAlignment
- The vertical alignmentpublic Graphics2D prepare(Component component, Graphics2D graphics)
Decorator
Component.paint(Graphics2D)
; decorators are called in
descending order.
prepare
in interface Decorator
public void update()
Decorator
Component.paint(Graphics2D)
; decorators are called in
ascending order.
update
in interface Decorator
public void repaint(Component component, int x, int y, int width, int height)
public Bounds getBounds(Component component)
Decorator
getBounds
in interface Decorator
public AffineTransform getTransform(Component component)
Decorator
getTransform
in interface Decorator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |