|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsynoptic.builtin.AffineTransformData
public class AffineTransformData
An AffineTransform with input values for translation and rotation coming from user defined inputs or data sources
Nested Class Summary | |
---|---|
static class |
AffineTransformData.AffineTransformDataPropertiesNames
|
static interface |
AffineTransformData.Listener
An interface to warn the transform owner in case of transform change |
Field Summary | |
---|---|
protected java.lang.String[] |
_propertyNames
The list of properties managed by this panel |
protected double |
angleUnitScale
Scale used for angle value : 1 means radian, PI/180 means degree |
protected boolean |
dirty
True if new values have not been yet taken into account in the affine transform |
protected AffineTransformData.Listener |
listener
The listener to warn in case of new transform change |
static int |
MAX_TRANSLATION
Maximum translation value for both axes to avoid loosing shapes This default value can be overloaded thanks to user properties |
protected DoubleValueMapper |
rotationMapper
Map rotation data source value to some rotation values |
protected boolean |
rotEnabled
True if the rotation is enabled |
protected DataSource |
rotSource
The data source for the rotation |
protected long |
rotSourceIndex
The source value index to get the rotation value |
protected double |
rotValue
The rotation value |
protected boolean |
transEnabled
True if translation is activated (both axes) |
protected java.awt.geom.AffineTransform |
transform
The real affine transformation |
protected double[] |
transformBounds
An arry of values to apply transformation on |
protected boolean |
translationFirst
True to perform affine transform computation using translation first |
protected double |
transUnitScale
Translation scale factor : 1 means 1 pixel |
protected DoubleValueMapper |
txMapper
Map rotation data source value to some rotation values |
protected DataSource |
txSource
The X translation data source |
protected long |
txSourceIndex
The X translation data source index |
protected double |
txValue
The X translation value |
protected DoubleValueMapper |
tyMapper
Map rotation data source value to some rotation values |
protected DataSource |
tySource
The X translation data source |
protected long |
tySourceIndex
The Y translation data source index |
protected double |
tyValue
The Y translation value |
Constructor Summary | |
---|---|
AffineTransformData()
Create a new AffineTransformData without object listening on the changes |
|
AffineTransformData(AffineTransformData.Listener listener)
Create a new AffineTransformData with an object listening on the changes |
Method Summary | |
---|---|
void |
addListeners()
Add data listners to the used data |
AffineTransformData |
cloneTransform()
Clone the object |
AffineTransformData |
cloneTransform(boolean withDataListener)
Clone the object |
void |
DataSourceIndexRangeChanged(DataSource ds,
long startIndex,
long lastIndex)
Called when the range of valid index changed |
void |
DataSourceInfoChanged(DataSource ds,
DataInfo newInfo)
Called when the information about the data source changed |
void |
DataSourceOrderChanged(DataSource ds,
int newOrder)
If defined, called when the order of the source changed. |
void |
DataSourceReplaced(DataSource oldData,
DataSource newData)
Called when a data source is replaced by another one |
void |
DataSourceValueChanged(DataSource ds,
long minIndex,
long maxIndex)
Called when at least a value changed in the data source. |
void |
DataSourceValueRangeChanged(DataSource ds)
Called when the range of possible values changed, if defined. |
java.util.Collection |
getInnerProperties()
Get the properties of inner objects or null if none |
java.lang.String[] |
getPropertyNames()
Get the list of property names |
java.lang.Object |
getPropertyValue(java.lang.String name)
Get the value of one property given its name |
java.awt.geom.AffineTransform |
getTransform()
|
void |
notificationEnd(java.lang.Object referer)
This callback is called after all notifications were processed. |
void |
release()
Remove the data sources used by this tranform : remove the notifiers and set to null the references. |
void |
setListener(AffineTransformData.Listener listener)
Set the owner of the transform |
void |
setPropertyValue(java.lang.String name,
java.lang.Object value)
Set the value of one property given its name |
void |
updateBounds(int x1,
int y1,
int x2,
int y2,
java.awt.geom.Rectangle2D.Double bounds)
Compute the new bounds according to the intial bounds and the current transformation |
void |
updateTransform(double cx,
double cy)
Method called by the listener of the transform to update it according to new values (rotation and translation) and reference coordinates |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int MAX_TRANSLATION
protected transient java.awt.geom.AffineTransform transform
protected transient double[] transformBounds
protected transient DataSource rotSource
protected transient long rotSourceIndex
protected double rotValue
protected DoubleValueMapper rotationMapper
protected boolean rotEnabled
protected double angleUnitScale
protected transient DataSource txSource
protected transient long txSourceIndex
protected double txValue
protected DoubleValueMapper txMapper
protected transient DataSource tySource
protected transient long tySourceIndex
protected double tyValue
protected DoubleValueMapper tyMapper
protected boolean transEnabled
protected double transUnitScale
protected boolean translationFirst
protected transient boolean dirty
protected AffineTransformData.Listener listener
protected transient java.lang.String[] _propertyNames
Constructor Detail |
---|
public AffineTransformData(AffineTransformData.Listener listener)
listener
- the object to warn in case of changespublic AffineTransformData()
Method Detail |
---|
public java.awt.geom.AffineTransform getTransform()
public void setListener(AffineTransformData.Listener listener)
listener
- the object to warn when transform changespublic void release()
public void addListeners()
public AffineTransformData cloneTransform()
public AffineTransformData cloneTransform(boolean withDataListener)
withDataListener
- true to add the listeners to all the used data
public void updateBounds(int x1, int y1, int x2, int y2, java.awt.geom.Rectangle2D.Double bounds)
x1
- bounds lower left corner x coordinatey1
- bounds lower left corner y coordinatex2
- bounds top right corner x coordinatey2
- bounds top right corner x coordinatebounds
- intial bounds to be updated accordinglypublic void updateTransform(double cx, double cy)
cx
- x reference coordinate (typically the center of a shape)cy
- y reference coordinate (typically the center of a shape)public void DataSourceValueChanged(DataSource ds, long minIndex, long maxIndex)
DataSourceListener
DataSourceValueChanged
in interface DataSourceListener
ds
- The data source that changedminIndex
- Lower bound of the range where values changedmaxIndex
- Higher bound of the range where values changedpublic void DataSourceIndexRangeChanged(DataSource ds, long startIndex, long lastIndex)
DataSourceListener
DataSourceIndexRangeChanged
in interface DataSourceListener
ds
- The data source that changedstartIndex
- The new start IndexlastIndex
- The new last indexpublic void DataSourceInfoChanged(DataSource ds, DataInfo newInfo)
DataSourceListener
DataSourceInfoChanged
in interface DataSourceListener
ds
- The data source that changedpublic void DataSourceValueRangeChanged(DataSource ds)
DataSourceListener
DataSourceValueRangeChanged
in interface DataSourceListener
ds
- The data source that changedpublic void DataSourceOrderChanged(DataSource ds, int newOrder)
DataSourceListener
DataSourceOrderChanged
in interface DataSourceListener
ds
- The data source that changedpublic void DataSourceReplaced(DataSource oldData, DataSource newData)
DataSourceListener
DataSourceReplaced
in interface DataSourceListener
public void notificationEnd(java.lang.Object referer)
EndNotificationListener
notificationEnd
in interface EndNotificationListener
public java.lang.String[] getPropertyNames()
NamedProperties
getPropertyNames
in interface NamedProperties
public java.lang.Object getPropertyValue(java.lang.String name)
NamedProperties
getPropertyValue
in interface NamedProperties
name
- the name of the property to get
AbstractShape.getPropertyValue(String)
public void setPropertyValue(java.lang.String name, java.lang.Object value)
NamedProperties
setPropertyValue
in interface NamedProperties
name
- the name of the property to getvalue
- its new valueAbstractShape.setPropertyValue(String, Object)
public java.util.Collection getInnerProperties()
NamedProperties
getInnerProperties
in interface NamedProperties
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |