|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwjhk.jupload2.policies.DefaultUploadPolicy
wjhk.jupload2.policies.PictureUploadPolicy
public class PictureUploadPolicy
This class add handling of pictures to upload.
UploadPolicy.createTopPanel(JButton, JButton, JButton, JUploadPanel).
It contains a preview picture panel, and two additional buttons to
rotate the selected picture in one direction or the other.
| Field Summary |
|---|
| Fields inherited from class wjhk.jupload2.policies.DefaultUploadPolicy |
|---|
patternError, patternSuccess |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PictureUploadPolicy(JUploadApplet theApplet)
The standard constructor, which transmit most informations to the super.Constructor(). |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
This method handles the clicks on the rotation buttons. |
void |
beforeUpload()
Enable any action, required before an upload. |
JUploadFileChooser |
createFileChooser()
Creates the file chooser, from the default implementation, then add an accessory to preview pictures. |
FileData |
createFileData(File file,
File root)
This methods actually returns a PictureFileData instance. |
JPanel |
createTopPanel(JButton browse,
JButton remove,
JButton removeAll,
JUploadPanel jUploadPanel)
This method override the default topPanel, and adds: Two rotation buttons, to rotate the currently selected picture. |
void |
displayParameterStatus()
This method displays the applet parameter list, according to the current debugLevel. |
Icon |
fileViewGetIcon(File file)
Returns an icon, calculated from the image content. |
boolean |
getFileChooserImagePreview()
Getter for fileChooserImagePreview. |
boolean |
getHighQualityPreview()
|
int |
getMaxHeight()
|
int |
getMaxWidth()
|
float |
getPictureCompressionQuality()
|
boolean |
getPictureTransmitMetadata()
|
int |
getRealMaxHeight()
|
int |
getRealMaxWidth()
|
String |
getTargetPictureFormat()
|
boolean |
hasToStoreBufferedImage()
|
boolean |
imageUpdate(Image arg0,
int arg1,
int arg2,
int arg3,
int arg4,
int arg5)
Implementation of the ImageObserver interface |
void |
onFileDoubleClicked(FileData pictureFileData)
Open the 'big' preview dialog box. |
void |
onFileSelected(FileData fileData)
Default implementation of the UploadPolicy.onFileSelected(wjhk.jupload2.filedata.FileData). |
void |
setCursor(Cursor cursor)
Calls the DefaultUploadPolicy.setCursor(Cursor) method, then set
the picture panel specific cursor. |
void |
setFileChooserImagePreview(boolean fileChooserImagePreview)
Setter for fileChooserIconFromFileContent. |
(package private) void |
setHighQualityPreview(boolean highQualityPreview)
|
(package private) void |
setMaxHeight(int maxHeight)
|
(package private) void |
setMaxWidth(int maxWidth)
|
(package private) void |
setPictureCompressionQuality(float pictureCompressionQuality)
|
(package private) void |
setPictureTransmitMetadata(boolean pictureTransmitMetadata)
|
void |
setProperty(String prop,
String value)
This method manages the applet parameters that are specific to this class. |
(package private) void |
setRealMaxHeight(int realMaxHeight)
|
(package private) void |
setRealMaxWidth(int realMaxWidth)
|
(package private) void |
setStoreBufferedImage(boolean storeBufferedImage)
|
(package private) void |
setTargetPictureFormat(String targetPictureFormat)
|
Cursor |
setWaitCursor()
Calls the DefaultUploadPolicy.setWaitCursor() method, then erases
the picture panel specific cursor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PictureUploadPolicy(JUploadApplet theApplet)
throws JUploadException
theApplet - Reference to the current applet. Allows access to
javascript functions.
JUploadException| Method Detail |
|---|
public FileData createFileData(File file,
File root)
throws JUploadExceptionStopAddingFiles
PictureFileData instance. It
allows only pictures: if the file is not a picture, this method returns
null, thus preventing the file to be added to the list of files to be
uploaded.
createFileData in interface UploadPolicycreateFileData in class DefaultUploadPolicyfile - The file selected by the user (called once for each added
file).root - An optional toplevel directory of a hierarchy (can be null).
PictureFileData or null if file is not a
picture.
JUploadExceptionStopAddingFiles - The exception is not really an
error. It allows an easy way to indicates that the applet
should stop adding files when the user clicked on the
'Cancel' button.UploadPolicy.createFileData(File,File)
public JPanel createTopPanel(JButton browse,
JButton remove,
JButton removeAll,
JUploadPanel jUploadPanel)
createTopPanel in interface UploadPolicycreateTopPanel in class DefaultUploadPolicybrowse - The default browse button.remove - The default removeSelected button.removeAll - The default removeAll button.jUploadPanel - The panel that contains all objects.
UploadPolicy.createTopPanel(JButton, JButton,
JButton, JUploadPanel)public void actionPerformed(ActionEvent e)
DefaultUploadPolicy.
actionPerformed in interface ActionListenerActionListener.actionPerformed(java.awt.event.ActionEvent)public void onFileSelected(FileData fileData)
DefaultUploadPolicyUploadPolicy.onFileSelected(wjhk.jupload2.filedata.FileData).
Nothing's done.
onFileSelected in interface UploadPolicyonFileSelected in class DefaultUploadPolicyUploadPolicy.onFileSelected(wjhk.jupload2.filedata.FileData)public void onFileDoubleClicked(FileData pictureFileData)
onFileDoubleClicked in interface UploadPolicyonFileDoubleClicked in class DefaultUploadPolicyUploadPolicy.onFileDoubleClicked(FileData)public void beforeUpload()
UploadPolicyPictureUploadPolicy disable the rotation buttons during buttons.
beforeUpload in interface UploadPolicybeforeUpload in class DefaultUploadPolicyUploadPolicy.beforeUpload()public boolean getFileChooserImagePreview()
UploadPolicy.PROP_FILE_CHOOSER_IMAGE_PREVIEWpublic void setFileChooserImagePreview(boolean fileChooserImagePreview)
fileChooserImagePreview - new value to store, for the applet
parameter: fileChooserImagePreview.UploadPolicy.PROP_FILE_CHOOSER_IMAGE_PREVIEWpublic boolean getHighQualityPreview()
void setHighQualityPreview(boolean highQualityPreview)
highQualityPreview - the highQualityPreview to setpublic int getMaxHeight()
void setMaxHeight(int maxHeight)
maxHeight - the maxHeight to setpublic int getMaxWidth()
void setMaxWidth(int maxWidth)
maxWidth - the maxWidth to setpublic float getPictureCompressionQuality()
void setPictureCompressionQuality(float pictureCompressionQuality)
pictureCompressionQuality - The new value for picture compression.pictureCompressionQualitypublic boolean getPictureTransmitMetadata()
void setPictureTransmitMetadata(boolean pictureTransmitMetadata)
pictureTransmitMetadata - The new value for this attribute.pictureTransmitMetadatapublic int getRealMaxHeight()
void setRealMaxHeight(int realMaxHeight)
realMaxHeight - the realMaxHeight to setpublic int getRealMaxWidth()
void setRealMaxWidth(int realMaxWidth)
realMaxWidth - the realMaxWidth to setpublic boolean hasToStoreBufferedImage()
void setStoreBufferedImage(boolean storeBufferedImage)
storeBufferedImage - the storeBufferedImage to setpublic String getTargetPictureFormat()
void setTargetPictureFormat(String targetPictureFormat)
targetPictureFormat - the targetPictureFormat to set
public void setProperty(String prop,
String value)
throws JUploadException
setProperty in interface UploadPolicysetProperty in class DefaultUploadPolicyprop - The property which value should changevalue - The new value for this property. If invalid, the default
value is used.
JUploadException
JUploadExceptionStopAddingFiles - indicates that the applet
should stop strying adding the current file selection.
Useful for instance, when a user drop a directory, full of
unallowed file: it's annoying for the user to click 'Ok'
for each file in the alert box.UploadPolicy.setProperty(java.lang.String,
java.lang.String)public void displayParameterStatus()
DefaultUploadPolicyDefaultUploadPolicy.setDebugLevel(int) method. It
should be override by any subclasses, that should display its own
parameters, then call super.displayParameterStatus().
displayParameterStatus in interface UploadPolicydisplayParameterStatus in class DefaultUploadPolicyDefaultUploadPolicy.displayParameterStatus()public Cursor setWaitCursor()
DefaultUploadPolicy.setWaitCursor() method, then erases
the picture panel specific cursor.
setWaitCursor in interface UploadPolicysetWaitCursor in class DefaultUploadPolicyDefaultUploadPolicy.setCursor(Cursor)public void setCursor(Cursor cursor)
DefaultUploadPolicy.setCursor(Cursor) method, then set
the picture panel specific cursor.
setCursor in interface UploadPolicysetCursor in class DefaultUploadPolicycursor - The cursor that must be set.DefaultUploadPolicy.setCursor(Cursor)public JUploadFileChooser createFileChooser()
createFileChooser in interface UploadPolicycreateFileChooser in class DefaultUploadPolicyUploadPolicy.createFileChooser()public Icon fileViewGetIcon(File file)
fileViewGetIcon in interface UploadPolicyfileViewGetIcon in class DefaultUploadPolicyfile - The file from which the icon should represent.
UploadPolicy.fileViewGetIcon(File),
UploadPolicy.PROP_FILE_CHOOSER_ICON_FROM_FILE_CONTENT
public boolean imageUpdate(Image arg0,
int arg1,
int arg2,
int arg3,
int arg4,
int arg5)
imageUpdate in interface ImageObserverarg0 - arg1 - arg2 - arg3 - arg4 - arg5 -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||