|
Copyright 2012-04-26 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.monte.media.gui.ImagePanel
public class ImagePanel
Displays images on a panel.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
ANAMORPH_PIXEL_ASPECT
Pixel aspect policy: Use Anamoprh 16:9 pixel aspect (=16/9*4/5=1.4222). |
static int |
EXACT_PIXEL_ASPECT
Pixel aspect policy: Preserve the exact pixel aspect. |
static int |
IGNORE_PIXEL_ASPECT
Pixel aspect policy: Ignore pixel aspect. |
static int |
ROUNDED_PIXEL_ASPECT
Pixel aspect policy: Preserves only extreme pixel aspects, where one dimension is a multiple of the other dimension. |
static int |
SCALE_TO_IMAGE_ASPECT
Image scaling policy: Scale to panel but keep the image aspect. |
static int |
SCALE_TO_IMAGE_SIZE
Image scaling policy: Scale as defined by #setAspectRatio and the image aspect. |
static int |
SCALE_TO_VIEW_SIZE
Image scaling policy: Scale to panel size. |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ImagePanel()
|
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener who is interested in changes of this object. |
double |
getAspectRatioX()
Gets the horizontal scale factor that is used to scale images shown in this image panel. |
double |
getAspectRatioY()
Gets the vertical scale factor that is used to scale images shown in this image panel. |
java.awt.Image |
getImage()
Gets the image that is displayed in this image panel. |
int |
getImageScalePolicy()
Returns the image scale policy. |
int |
getPixelAspectPolicy()
Returns the pixel aspect policy. |
double |
getPixelAspectX()
Gets the horizontal pixel aspect of the image according to the pixel aspect policy that is in affect. |
double |
getPixelAspectY()
Gets the vertical pixel aspect of the image according to the pixel aspect policy that is in effect. |
java.awt.Dimension |
getPreferredImageSize()
Gets the preferred image size. |
java.awt.Dimension |
getPreferredSize()
Gets the preferred size of this image panel. |
java.awt.RenderingHints |
getRenderingHints()
Gets the rendering hints. |
java.awt.Dimension |
getScaledImageSize()
Gets the scaled and pixel aspect corrected image size. |
double |
getScaleFactor()
Gets the scale factor. |
java.awt.image.BufferedImage |
getTexture()
Gets the backdrop paint. |
boolean |
imageUpdate(java.awt.Image img,
int flags,
int x,
int y,
int w,
int h)
XXX Netscape gets very slow when painting all SOMEBITS of an image. |
void |
paintComponent(java.awt.Graphics gr)
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a previously registered listener. |
void |
setAspectRatio(double ratioX,
double ratioY)
Sets the aspect ratio. |
protected void |
setAspectRatio0(double ratioX,
double ratioY)
|
void |
setImage(java.awt.Image image)
Sets the image and displays it in this image panel. |
void |
setImageScalePolicy(int policy)
Sets the image scale policy. |
void |
setMessage(java.lang.String message)
|
void |
setPixelAspectPolicy(int policy)
Sets the pixel aspect policy. |
void |
setRenderingHints(java.awt.RenderingHints newValue)
Sets the rendering hints. |
void |
setScaleFactor(double scaleFactor)
Sets the scale factor. |
void |
setTexture(java.awt.image.BufferedImage newValue)
Sets the texture for the backdrop paint. |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int IGNORE_PIXEL_ASPECT
public static final int ROUNDED_PIXEL_ASPECT
public static final int EXACT_PIXEL_ASPECT
public static final int ANAMORPH_PIXEL_ASPECT
public static final int SCALE_TO_IMAGE_SIZE
public static final int SCALE_TO_VIEW_SIZE
public static final int SCALE_TO_IMAGE_ASPECT
| Constructor Detail |
|---|
public ImagePanel()
| Method Detail |
|---|
public void paintComponent(java.awt.Graphics gr)
paintComponent in class javax.swing.JComponentpublic void setPixelAspectPolicy(int policy)
policy - PixelAspectPolicy must be one of IGNORE_PIXEL_ASPECT,
ROUNDED_PIXEL_ASPECT, EXACT_PIXEL_ASPECT.
java.lang.IllegalArgumentException - When passing invalid policy.public int getPixelAspectPolicy()
public void setImageScalePolicy(int policy)
public int getImageScalePolicy()
public double getPixelAspectX()
public double getPixelAspectY()
public java.awt.Dimension getPreferredImageSize()
public java.awt.Dimension getScaledImageSize()
public void setImage(java.awt.Image image)
public java.awt.Image getImage()
public void setTexture(java.awt.image.BufferedImage newValue)
public java.awt.image.BufferedImage getTexture()
public void setScaleFactor(double scaleFactor)
scaleFactor - The scale factor.public double getScaleFactor()
public void setRenderingHints(java.awt.RenderingHints newValue)
newValue - The new rendering hints.public java.awt.RenderingHints getRenderingHints()
public void setAspectRatio(double ratioX,
double ratioY)
ratioX - Horizontal scale factor.ratioY - Vertical scale factor.
protected void setAspectRatio0(double ratioX,
double ratioY)
public double getAspectRatioX()
public double getAspectRatioY()
public java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in class java.awt.Containerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in class java.awt.Componentpublic void setMessage(java.lang.String message)
public boolean imageUpdate(java.awt.Image img,
int flags,
int x,
int y,
int w,
int h)
imageUpdate in interface java.awt.image.ImageObserverimageUpdate in class java.awt.Component
|
Copyright 2012-04-26 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||