|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.desy.acop.video.ScaleHelper
public class ScaleHelper
ScaleHelper provides methods for converting rectangles from image coordinates to component (display) coordinates. It also keeps track of the image rectangle inside the component (which can be different than the component's rectangle if aspect ratio should be kept).
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_ACTIVE_RECTANGLE
|
static java.lang.String |
PROPERTY_AOI_ZOOM
|
static java.lang.String |
PROPERTY_COMPONENT_DIMENSION
|
static java.lang.String |
PROPERTY_IMAGE_AOI
|
static java.lang.String |
PROPERTY_IMAGE_DIMENSION
|
static java.lang.String |
PROPERTY_IMAGE_ZOOM
|
static java.lang.String |
PROPERTY_KEEP_ASPECT_RATIO
|
Constructor Summary | |
---|---|
ScaleHelper(boolean keepAspectRatio,
boolean aoiZoom,
ImageZoom imageZoom)
Constructs this ScaleHelper. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener for the specified propertyName. |
java.awt.Rectangle |
componentToImage(java.awt.geom.Rectangle2D componentRect)
Transforms a rectangle contained within the component from display coordinates to image coordinates. |
java.awt.geom.Rectangle2D |
getActiveRectangle()
Gets the active rectangle (the part of the component occupied by the displayed image). |
java.awt.Dimension |
getComponentDimension()
Gets the dimension of the component. |
java.awt.Rectangle |
getImageAoi()
Gets the image AOI rectangle. |
java.awt.Dimension |
getImageDimension()
Gets the dimension of the image. |
ImageZoom |
getImageZoom()
Gets the ImageZoom property. |
java.awt.geom.Rectangle2D |
imageToComponent(java.awt.geom.Rectangle2D rectangle)
Transforms a rectangle contained within the image from image coordinates to display coordinates within the component. |
boolean |
isAoiZoom()
Gets the AOI zoom property. |
boolean |
isKeepAspectRatio()
Gets the keep aspect ratio property. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener for the specified propertyName. |
void |
setAoiZoom(boolean aoiZoom)
Sets the AOI zoom property. |
void |
setComponentDimesnion(java.awt.Dimension componentDimension)
Sets the dimension of the component. |
void |
setImageData(java.awt.Dimension imageDimension,
java.awt.Rectangle imageAoi)
Sets the image image data (dimension and AOI). |
void |
setImageZoom(ImageZoom imageZoom)
Sets the ImageZoom property. |
void |
setKeepAspectRatio(boolean keepAspectRatio)
Sets the keep aspect ratio property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_IMAGE_AOI
public static final java.lang.String PROPERTY_IMAGE_DIMENSION
public static final java.lang.String PROPERTY_COMPONENT_DIMENSION
public static final java.lang.String PROPERTY_ACTIVE_RECTANGLE
public static final java.lang.String PROPERTY_KEEP_ASPECT_RATIO
public static final java.lang.String PROPERTY_AOI_ZOOM
public static final java.lang.String PROPERTY_IMAGE_ZOOM
Constructor Detail |
---|
public ScaleHelper(boolean keepAspectRatio, boolean aoiZoom, ImageZoom imageZoom)
keepAspectRatio
- is aspect ratio kept or notMethod Detail |
---|
public java.awt.Rectangle componentToImage(java.awt.geom.Rectangle2D componentRect)
componentRect
- the rectangle in display coordinates to transform
public java.awt.geom.Rectangle2D imageToComponent(java.awt.geom.Rectangle2D rectangle)
rectangle
- the rectangle in image coordinates to transform
public java.awt.Dimension getImageDimension()
public java.awt.Rectangle getImageAoi()
public void setImageData(java.awt.Dimension imageDimension, java.awt.Rectangle imageAoi)
imageDimension
- the imageDimension to setimageAoi
- the imageAoi to setpublic java.awt.Dimension getComponentDimension()
public void setComponentDimesnion(java.awt.Dimension componentDimension)
componentDimension
- the componentDimension to setpublic java.awt.geom.Rectangle2D getActiveRectangle()
public boolean isKeepAspectRatio()
public void setKeepAspectRatio(boolean keepAspectRatio)
keepAspectRatio
- the keepAspectRatio to setpublic boolean isAoiZoom()
public void setAoiZoom(boolean aoiZoom)
aoiZoom
- the aoiZoom to setpublic ImageZoom getImageZoom()
public void setImageZoom(ImageZoom imageZoom)
imageZoom
- the imageZoom to setpublic void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- the name of the propertylistener
- the PropertyChangeListener to addpublic void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- the name of the propertylistener
- the PropertyChangeListener to removepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to addpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the PropertyChangeListener to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |