|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pbjar.jxlayer.plaf.ext.transform.DefaultTransformModel
public class DefaultTransformModel
This is an implementation of TransformModel with methods to
explicitly set transformation values.
| Constructor Summary | |
|---|---|
DefaultTransformModel()
|
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener listener)
Add a ChangeListener that will be notified when the internal
state of this model changes. |
protected void |
fireChangeEvent(Object oldValue,
Object newValue)
If {! |
AffineTransform |
getPreferredTransform(Dimension size,
org.jdesktop.jxlayer.JXLayer<?> layer)
Get a preferred AffineTransform. |
int |
getQuadrantRotation()
Get the quadrant rotation value. |
double |
getRotation()
Get the rotation value in radians as set by setRotation(double). |
double |
getScale()
Get the scale. |
double |
getShearX()
Get the shearX value as set by setShearX(double); The default
value is 0. |
double |
getShearY()
Get the shearY value as set by setShearY(double); The default
value is 0. |
AffineTransform |
getTransform(org.jdesktop.jxlayer.JXLayer<?> layer)
Return the currently active AffineTransform. |
boolean |
isMirror()
Get the mirror property. |
boolean |
isPreserveAspectRatio()
Get the preserve aspect ratio value. |
boolean |
isScaleToPreferredSize()
Get the scale to preferred size value. |
void |
removeChangeListener(ChangeListener listener)
Remove a ChangeListener. |
void |
setMirror(boolean newValue)
Set the mirror property. |
void |
setPreserveAspectRatio(boolean newValue)
Set preserve aspect ratio. |
void |
setQuadrantRotation(int newValue)
Set the rotation in quadrants. |
void |
setRotation(double newValue)
Set the rotation in radians. |
void |
setScale(double newValue)
Set a scale. |
void |
setScaleToPreferredSize(boolean newValue)
Set scaleToPreferredSize. |
void |
setShearX(double newValue)
Set the shearX value. |
void |
setShearY(double newValue)
Set the shearY value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultTransformModel()
| Method Detail |
|---|
public void addChangeListener(ChangeListener listener)
TransformModelChangeListener that will be notified when the internal
state of this model changes.
addChangeListener in interface TransformModellistener - a ChangeListenerTransformModel.removeChangeListener(ChangeListener)public double getScale()
setScale(double)
public AffineTransform getPreferredTransform(Dimension size,
org.jdesktop.jxlayer.JXLayer<?> layer)
TransformModelAffineTransform. This method will typically be
invoked by programs that calculate a preferred size.
The size argument will be used to compute anchor values for some
types of transformations. If the size argument is null a
value of (0,0) is used for the anchor.
getPreferredTransform in interface TransformModelsize - a Dimension instance to be used for an anchor or
nulllayer - the JXLayer.
AffineTransform instance or nullpublic int getQuadrantRotation()
0.
setQuadrantRotation(int)public double getRotation()
setRotation(double).
The default value is 0.
setRotation(double)public double getShearX()
setShearX(double); The default
value is 0.
setShearX(double)public double getShearY()
setShearY(double); The default
value is 0.
setShearY(double)public AffineTransform getTransform(org.jdesktop.jxlayer.JXLayer<?> layer)
AffineTransform. Recalculate if
needed.
getTransform in interface TransformModellayer - the JXLayer
AffineTransformpublic boolean isMirror()
The default value is false.
true if the transformation will mirror the view.setMirror(boolean)public boolean isPreserveAspectRatio()
The default value is true.
true if preserving aspect ratio, false otherwisesetPreserveAspectRatio(boolean)public boolean isScaleToPreferredSize()
The default value is false.
When true, the view is scaled according to the preferred scale,
regardless of the size of the JXLayer.
When false, the view is scaled to occupy as much as possible of
the size of the JXLayer.
true if scale to preferred size, false otherwisesetScaleToPreferredSize(boolean)public void removeChangeListener(ChangeListener listener)
TransformModelChangeListener.
removeChangeListener in interface TransformModellistener - a ChangeListenerTransformModel.addChangeListener(ChangeListener)public void setMirror(boolean newValue)
The default value is false
newValue - the new valueisMirror()
public void setScale(double newValue)
throws IllegalArgumentException
The scale is primarily used to calculate a preferred size. Unless ScaleToPreferredSize is set to true (see
setScaleToPreferredSize(boolean) and
isScaleToPreferredSize()), actual scaling itself is calculated
such that the view occupies as much space as possible on the
JXLayer.
The default value is 1.
newValue - the preferred scale
IllegalArgumentException - when the argument value is 0getScale()public void setPreserveAspectRatio(boolean newValue)
The default value is true.
newValue - the new valueisPreserveAspectRatio()public void setQuadrantRotation(int newValue)
0.
newValue - the number of quadrantsgetQuadrantRotation()public void setRotation(double newValue)
0.
newValue - the rotation in radiansgetRotation()public void setScaleToPreferredSize(boolean newValue)
The default value is false.
When true, the view is scaled according to the preferred scale,
regardless of the size of the JXLayer.
When false, the view is scaled to occupy as much as possible of
the size of the JXLayer.
newValue - the new valueisScaleToPreferredSize()public void setShearX(double newValue)
0.
newValue - the shear xgetShearX()public void setShearY(double newValue)
0.
newValue - the shear ygetShearY()
protected void fireChangeEvent(Object oldValue,
Object newValue)
ChangeEvent will be fired.
oldValue - an old valuenewValue - a new value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||