public class PicturePanel extends Canvas implements MouseListener, ComponentListener
setPictureFile(PictureFileData, AbstractButton, AbstractButton)
. I
did an attempt to store the Image generated for the Panel size into the
PictureFileData, to avoid to calculate the offscreenPicture each time the
user select the same file again. But it doesn't work: the applet quickly runs
out of memory, even after numerous calls of System.gc and finalize. Canvas.AccessibleAWTCanvas
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected UploadPolicy |
uploadPolicy
The current upload policy.
|
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
PicturePanel(boolean hasToStoreOffscreenPicture,
UploadPolicy uploadPolicy)
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
componentHidden(ComponentEvent arg0) |
void |
componentMoved(ComponentEvent arg0) |
void |
componentResized(ComponentEvent arg0) |
void |
componentShown(ComponentEvent arg0) |
protected void |
finalize()
Is it really useful ??
|
void |
mouseClicked(MouseEvent arg0) |
void |
mouseEntered(MouseEvent arg0) |
void |
mouseExited(MouseEvent arg0) |
void |
mousePressed(MouseEvent arg0) |
void |
mouseReleased(MouseEvent arg0) |
void |
paint(Graphics g) |
void |
rotate(int quarter)
This function adds a quarter rotation to the current picture.
|
void |
setPictureFile(PictureFileData pictureFileData,
AbstractButton button1,
AbstractButton button2)
This setter is called by
PictureFileData to set the picture that
is to be previewed. |
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
protected UploadPolicy uploadPolicy
public PicturePanel(boolean hasToStoreOffscreenPicture, UploadPolicy uploadPolicy)
hasToStoreOffscreenPicture
- uploadPolicy
- The current upload policypublic void setPictureFile(PictureFileData pictureFileData, AbstractButton button1, AbstractButton button2)
PictureFileData
to set the picture that
is to be previewed.pictureFileData
- The FileData for the image to be displayed. Null
if no picture should be displayed.button1
- A button that will be activated or not, depending of the
pictures was correctly set into the panel. May be null, if not
button is to be enabled.button2
- Another button that will be activated or not. May also be
null.public void paint(Graphics g)
paint
in class Canvas
Canvas.paint(java.awt.Graphics)
public void rotate(int quarter)
quarter
- Number of quarters (90�) the picture should rotate. 1
means rotating of 90� clockwise (?). Can be negative
(counterclockwise), more than 1...protected void finalize() throws Throwable
public void mouseClicked(MouseEvent arg0)
mouseClicked
in interface MouseListener
MouseListener.mouseClicked(java.awt.event.MouseEvent)
public void mouseEntered(MouseEvent arg0)
mouseEntered
in interface MouseListener
MouseListener.mouseEntered(java.awt.event.MouseEvent)
public void mouseExited(MouseEvent arg0)
mouseExited
in interface MouseListener
MouseListener.mouseExited(java.awt.event.MouseEvent)
public void mousePressed(MouseEvent arg0)
mousePressed
in interface MouseListener
MouseListener.mousePressed(java.awt.event.MouseEvent)
public void mouseReleased(MouseEvent arg0)
mouseReleased
in interface MouseListener
MouseListener.mouseReleased(java.awt.event.MouseEvent)
public void componentHidden(ComponentEvent arg0)
componentHidden
in interface ComponentListener
ComponentListener.componentHidden(java.awt.event.ComponentEvent)
public void componentMoved(ComponentEvent arg0)
componentMoved
in interface ComponentListener
ComponentListener.componentMoved(java.awt.event.ComponentEvent)
public void componentResized(ComponentEvent arg0)
componentResized
in interface ComponentListener
ComponentListener.componentResized(java.awt.event.ComponentEvent)
public void componentShown(ComponentEvent arg0)
componentShown
in interface ComponentListener
ComponentListener.componentShown(java.awt.event.ComponentEvent)
Copyright © 2015. All rights reserved.