|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.vistech.imageviewer.ImageCanvas | +--com.vistech.imageviewer.ImageCanvas2D
Displays a manipulated image. This class doesn't perform image manipulation, but has several properties to hold the manipulation attributes. To manipulate an image, check out the AffineTransform attribute, concatenate it, and then check it in. Call the applyTransform() method to apply the resultinng transformation to the current image.
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected java.awt.geom.AffineTransform |
atx
|
protected java.awt.geom.AffineTransform |
dispModeAtx
|
protected java.awt.geom.AffineTransform |
flipAtx
|
protected int |
interpolationType
|
protected int |
magCenterX
|
protected int |
magCenterY
|
protected double |
magFactor
|
protected boolean |
magOn
|
protected java.awt.Point |
panOffset
|
protected boolean |
rotateOn
|
protected double |
rotationAngle
|
protected int |
rotationCenterX
|
protected int |
rotationCenterY
|
protected double |
shearFactor
|
protected boolean |
shearOn
|
protected double |
shearX
|
protected double |
shearY
|
protected java.awt.Point |
zoomOffset
|
Fields inherited from class com.vistech.imageviewer.ImageCanvas |
bufferedImage, clipShape, dispGc, displayImage, displayMode, flipMode, height, imageHeight, imageType, imageWidth, invertOn, offScrGc, offScrImage, originalImageType, paintFlag, PRINT_SIZE_ACTUAL, PRINT_SIZE_PAGE, printLoc, printMode, printSize, width |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.vistech.imageviewer.ImageDisplay |
TYPE_AWT_IMAGE, TYPE_BUFFERED_IMAGE |
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
ImageCanvas2D()
|
Method Summary | |
void |
applyTransform(java.awt.geom.AffineTransform atx)
Applies a specified transformation to the current off screen image, and then displays it on the canvas. |
protected void |
applyTransform(java.awt.image.BufferedImage bi,
java.awt.geom.AffineTransform atx)
Applies a specified transformation to an input image, and then displays it on the canvas |
static java.awt.geom.AffineTransform |
createFlipTransform(int mode,
int imageWid,
int imageHt)
Creates a flip transform. |
boolean |
doDisplayModeAndFlip(int imageWidth,
int imageHeight)
Applies the current display mode and flip mode settings to the displayed image. |
int |
getInterpolationType()
|
double |
getMagFactor()
Gets the magFactor property. |
boolean |
getMagOn()
|
java.awt.Point |
getPanOffset()
Returns the panOffset property. |
double |
getRotationAngle()
Gets the rotation angle property. |
double |
getShearFactor()
|
double |
getShearFactorX()
|
double |
getShearFactorY()
|
java.awt.geom.AffineTransform |
getTransform()
Gets the transform property. |
protected void |
init()
|
static void |
main(java.lang.String[] args)
|
void |
reset()
Paints the currently displayed image again with currently set display and flip modes |
void |
resetManipulation()
Resets the manipulation attributes. |
void |
setInterpolationType(int interType)
Sets the interpolationType property. |
void |
setMagFactor(double magFactor)
Sets the magFactor property. |
void |
setMagOn(boolean onOff)
|
void |
setPanOffset(java.awt.Point panOffset)
Gets the panOffset property. |
void |
setRotationAngle(double rotationAngle)
Sets the rotationAngle property. |
void |
setShearFactor(double shearFactor)
Sets the shearFactor property. |
void |
setTransform(java.awt.geom.AffineTransform at)
Sets the transform property. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.vistech.imageviewer.ImageDisplay |
addMouseListener, addMouseMotionListener, addPropertyChangeListener, addVetoableChangeListener, draw, getAWTImage, getBufferedImage, getDisplayedImage, getDisplayMode, getFlipMode, getImageSize, getImageType, getInvert, getOffScreenImage, paintImage, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removeVetoableChangeListener, setAWTImage, setBufferedImage, setClip, setCursor, setDisplayImage, setDisplayMode, setFlipMode, setImageType, setInvert, setOffScreenImage |
Field Detail |
protected java.awt.geom.AffineTransform atx
protected java.awt.geom.AffineTransform dispModeAtx
protected java.awt.geom.AffineTransform flipAtx
protected java.awt.Point panOffset
protected boolean magOn
protected double magFactor
protected int magCenterX
protected int magCenterY
protected java.awt.Point zoomOffset
protected double rotationAngle
protected boolean rotateOn
protected int rotationCenterX
protected int rotationCenterY
protected boolean shearOn
protected double shearFactor
protected double shearX
protected double shearY
protected int interpolationType
Constructor Detail |
public ImageCanvas2D()
Method Detail |
protected void init()
init
in class ImageCanvas
public void setMagFactor(double magFactor)
ImageManipulator
setMagFactor
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
magFactor
- the magnification factor.public double getMagFactor()
ImageManipulator
getMagFactor
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
public void setShearFactor(double shearFactor)
ImageManipulator
setShearFactor
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
shearFactor
- the shearFactor property.public double getShearFactor()
getShearFactor
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
public double getShearFactorX()
public double getShearFactorY()
public void setRotationAngle(double rotationAngle)
ImageManipulator
setRotationAngle
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
rotationAngle
- the rotation anglepublic double getRotationAngle()
ImageManipulator
getRotationAngle
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
public void setPanOffset(java.awt.Point panOffset)
ImageManipulator
setPanOffset
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
panOffset
- the offset by which the currently displayed image is moved
from the previous position.public java.awt.Point getPanOffset()
ImageManipulator
getPanOffset
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
public void setInterpolationType(int interType)
ImageManipulator
setInterpolationType
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
the
- interpolation typepublic int getInterpolationType()
getInterpolationType
in interface ImageManipulator
public java.awt.geom.AffineTransform getTransform()
ImageManipulator
getTransform
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
public void setTransform(java.awt.geom.AffineTransform at)
ImageManipulator
setTransform
in interface ImageManipulator
com.vistech.imageviewer.ImageManipulator
the
- transform.public void setMagOn(boolean onOff)
public boolean getMagOn()
public boolean doDisplayModeAndFlip(int imageWidth, int imageHeight)
doDisplayModeAndFlip
in class ImageCanvas
imWid
- the image width.imHt
- the image height.public static java.awt.geom.AffineTransform createFlipTransform(int mode, int imageWid, int imageHt)
mode
- the specified flip mode.imageWid
- the width of the BufferedImage.imageHt
- the height of the BufferedImage.protected void applyTransform(java.awt.image.BufferedImage bi, java.awt.geom.AffineTransform atx)
bi
- the buffered image to which the transformation is applied.atx
- the transformation to be applied.public void applyTransform(java.awt.geom.AffineTransform atx)
applyTransform
in interface ImageManipulator
atx
- the transformation to be applied.public void reset()
ImageCanvas
reset
in class ImageCanvas
public void resetManipulation()
resetManipulation
in interface ImageManipulator
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |