|
|||||||||
| 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 double |
magFactorX
|
protected double |
magFactorY
|
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 |
backgroundColor, bufferedImage, clipShape, dispGc, displayImage, displayMode, flipMode, foregroundColor, 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 the 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. |
double |
getMagFactorX()
Gets the magFactorX property. |
double |
getMagFactorY()
Gets the magFactorY 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 |
setMagFactorX(double magFactorX)
Sets the magFactorX property. |
void |
setMagFactorY(double magFactorY)
Sets the magFactorY 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 double magFactorX
protected double magFactorY
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 ImageCanvaspublic void setMagFactor(double magFactor)
ImageManipulatorsetMagFactor in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatormagFactor - the magnification factor.public double getMagFactor()
ImageManipulatorgetMagFactor in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorpublic void setMagFactorX(double magFactorX)
ImageManipulatorsetMagFactorX in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatormagFactor - the magnification factor in the X direction.public double getMagFactorX()
ImageManipulatorgetMagFactorX in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorpublic void setMagFactorY(double magFactorY)
ImageManipulatorsetMagFactorY in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatormagFactor - the magnification factor in the Y direction.public double getMagFactorY()
ImageManipulatorgetMagFactorY in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorpublic void setShearFactor(double shearFactor)
ImageManipulatorsetShearFactor in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorshearFactor - the shearFactor property.public double getShearFactor()
getShearFactor in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorpublic double getShearFactorX()
public double getShearFactorY()
public void setRotationAngle(double rotationAngle)
ImageManipulatorsetRotationAngle in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorrotationAngle - the rotation anglepublic double getRotationAngle()
ImageManipulatorgetRotationAngle in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorpublic void setPanOffset(java.awt.Point panOffset)
ImageManipulatorsetPanOffset in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorpanOffset - the offset by which the currently displayed image is moved
from the previous position.public java.awt.Point getPanOffset()
ImageManipulatorgetPanOffset in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorpublic void setInterpolationType(int interType)
ImageManipulatorsetInterpolationType in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorthe - interpolation typepublic int getInterpolationType()
getInterpolationType in interface ImageManipulatorpublic java.awt.geom.AffineTransform getTransform()
ImageManipulatorgetTransform in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorpublic void setTransform(java.awt.geom.AffineTransform at)
ImageManipulatorsetTransform in interface ImageManipulatorcom.vistech.imageviewer.ImageManipulatorthe - transform.public void setMagOn(boolean onOff)
public boolean getMagOn()
public boolean doDisplayModeAndFlip(int imageWidth,
int imageHeight)
throws ImageCanvasException
doDisplayModeAndFlip in class ImageCanvasimWid - 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)
throws ImageCanvasException
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 ImageManipulatoratx - the transformation to be applied.public void reset()
ImageCanvasreset in class ImageCanvaspublic void resetManipulation()
resetManipulation in interface ImageManipulatorpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||