com.smartwerkz.jupload.classic.ui
Class JUploadGui

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.smartwerkz.jupload.classic.ui.JUploadGui
All Implemented Interfaces:
UI, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JUploadGui
extends javax.swing.JComponent
implements UI

The basic JUpload GUI within a simple Swing container which can be added either to the applet itself or to another Container of choice (for example a JFrame).

Since:
Jan 26, 2006, 2:08:21 AM
Author:
Dominik Seifert
See Also:
Serialized Form

Nested Class Summary
 class JUploadGui.PopupMenu
           
 
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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
JUploadGui(JUpload jupload)
           
 
Method Summary
 UploadImageFile addFile(java.lang.String name, java.lang.String ext, ImageData data)
          Inserts a single Picture as new UploadFile.
 void addFiles(java.io.File[] files)
          Inserts an array of Files into the currently selected directory node.
 void addFiles(java.util.List files)
          Inserts a invalidFileList of Files into the currently selected directory node.
 void addImage(java.awt.image.BufferedImage img, java.lang.String defaultName, java.lang.String titleMsg)
          Adds an image as a new virtual file to the uploadtree after querying the user for its name.
 void addNodes(UploadNode[] nodes)
          Inserts a invalidFileList of Files into the currently selected directory node.
 void clickAdd()
          Shows the normal file chooser to let the user add new files.
 void clickAddFolder()
           
 void convertImages(UploadNode[] nodes)
          Queries the user for sufficient information and performs the conversion.
 void copyToClipboard(UploadNode[] nodes)
          Copies the given items to the clipboard
 java.awt.Point getCenteredLocation(java.awt.Dimension d)
           
 UploadNode getCurrentFolder()
           
 PreviewFileChooser getFileChooser()
           
 OptionPanel getOptionPanel()
           
 ResponsePanel getResponsePanel()
           
 UploadTreeDisplayer getTreeDisplayer()
          Returns the current treedisplayer.
 boolean hasTreeDisplayer()
           
 void installLF()
          Install the L&F from the config values
 boolean isDefaultTreeDisplayer()
          Indicates wether the treeDisplayer is the default one (which is of type UploadViewPanel).
 void pasteClipboard()
          Tries to add (if available) images or files from the clipboard to the tree.
 void pasteClipboardImage()
          Tries to add (if available) an image from the clipboard to the tree.
static int queryConfirm(java.awt.Component parent, java.lang.String title, java.lang.String msg, int msgType)
           
 int queryConfirm(java.lang.String title, java.lang.String msg, int msgType)
           
static java.lang.String queryFormat(java.awt.Component parent, java.lang.String title, java.lang.String defValue)
           
 java.lang.String queryFormat(java.lang.String title, java.lang.String defValue)
           
 int queryInt(java.lang.String msgKey, java.lang.String titleKey, int defaultVal, boolean allowNegative)
          Queries the user for an int, will show the message of the given msgKey and return defaultVal if no valid value was entered.
 void queryScreenCaptureDelay()
           
 java.lang.String queryString(java.lang.String msg)
           
 java.lang.String queryString(java.lang.String msg, java.lang.String initValue)
           
static java.lang.String queryString(java.lang.String msg, java.lang.String initValue, java.awt.Component parent)
           
 java.lang.String queryString(java.lang.String msg, java.lang.String title, java.lang.String initValue)
           
static java.lang.String queryString(java.lang.String msg, java.lang.String title, java.lang.String initValue, java.awt.Component parent)
           
protected  void registerDefaultAuthProviders()
           
 void remove(UploadNode[] selected)
          Will remove the given files after asking the user.
 void save(UploadNode[] nodes)
          Queries for a directory and saves the currently nodes files to disk.
 void save(UploadNode[] nodes, java.io.File dir)
          Saves the given files to the given dir.
 void setCaptureDelay(int secs)
           
 void setLookAndFeel(java.lang.String className)
           
 void setOptionPanel(OptionPanel optionPanel)
           
 void setTreeDisplayer(UploadTreeDisplayer gui)
           
 void showError(java.lang.String string)
          shows an error message to the user
static void showError(java.lang.String string, java.awt.Component parent)
          shows an error message to the user
 void showError(java.lang.String string, java.lang.String title)
          shows an error message to the user
static void showError(java.lang.String string, java.lang.String title, java.awt.Component parent)
          shows an error message to the user
 void showGeneralPopup(int x, int y)
          Shows the general popup at th given screen location.
 void showWarning(java.lang.String string)
          shows a warning to the user
static void showWarning(java.lang.String string, java.awt.Component parent)
          shows a warning to the user
static void showWarning(java.lang.String string, java.lang.String title, java.awt.Component parent)
          shows a warning to the user
 void statusMessage(java.lang.Object o)
           
 void takeJUploadScreenshot()
           
 void takeScreenshot()
           
 void takeScreenshot(boolean onlyJUpload)
           
 void updateAllComponentTrees()
          Used when changing the L&F
 
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, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, 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, imageUpdate, 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, 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
 

Constructor Detail

JUploadGui

public JUploadGui(JUpload jupload)
Method Detail

installLF

public void installLF()
Install the L&F from the config values


updateAllComponentTrees

public void updateAllComponentTrees()
Used when changing the L&F


setLookAndFeel

public void setLookAndFeel(java.lang.String className)
                    throws java.lang.Exception
Throws:
java.lang.Exception

getFileChooser

public PreviewFileChooser getFileChooser()

getTreeDisplayer

public UploadTreeDisplayer getTreeDisplayer()
Returns the current treedisplayer. By default this is an UploadViewPanel but can be easily changed.


setTreeDisplayer

public void setTreeDisplayer(UploadTreeDisplayer gui)

hasTreeDisplayer

public boolean hasTreeDisplayer()

isDefaultTreeDisplayer

public boolean isDefaultTreeDisplayer()
Indicates wether the treeDisplayer is the default one (which is of type UploadViewPanel).


getOptionPanel

public OptionPanel getOptionPanel()
Returns:
The OptionPanel containing all user-customizable options.

setOptionPanel

public void setOptionPanel(OptionPanel optionPanel)

clickAdd

public void clickAdd()
Shows the normal file chooser to let the user add new files.


showGeneralPopup

public void showGeneralPopup(int x,
                             int y)
Shows the general popup at th given screen location. If the provided parameters are negative, the center of this GUI-container is used.

Parameters:
x -
y -

getCurrentFolder

public UploadNode getCurrentFolder()
Returns:
The currently selected directory of the treeDisplayer or the UploadTree's root in case that the displayer or its current directory is null.

addImage

public void addImage(java.awt.image.BufferedImage img,
                     java.lang.String defaultName,
                     java.lang.String titleMsg)
              throws java.io.IOException
Adds an image as a new virtual file to the uploadtree after querying the user for its name.

Throws:
java.io.IOException

save

public void save(UploadNode[] nodes)
Queries for a directory and saves the currently nodes files to disk.


save

public void save(UploadNode[] nodes,
                 java.io.File dir)
Saves the given files to the given dir.


getCenteredLocation

public java.awt.Point getCenteredLocation(java.awt.Dimension d)
Returns:
A point that represents the top left for this dimension being centered within this gui.

queryConfirm

public int queryConfirm(java.lang.String title,
                        java.lang.String msg,
                        int msgType)

queryConfirm

public static int queryConfirm(java.awt.Component parent,
                               java.lang.String title,
                               java.lang.String msg,
                               int msgType)

queryString

public java.lang.String queryString(java.lang.String msg)

queryString

public java.lang.String queryString(java.lang.String msg,
                                    java.lang.String initValue)

queryString

public java.lang.String queryString(java.lang.String msg,
                                    java.lang.String title,
                                    java.lang.String initValue)

queryString

public static java.lang.String queryString(java.lang.String msg,
                                           java.lang.String initValue,
                                           java.awt.Component parent)

queryString

public static java.lang.String queryString(java.lang.String msg,
                                           java.lang.String title,
                                           java.lang.String initValue,
                                           java.awt.Component parent)

queryFormat

public java.lang.String queryFormat(java.lang.String title,
                                    java.lang.String defValue)

queryFormat

public static java.lang.String queryFormat(java.awt.Component parent,
                                           java.lang.String title,
                                           java.lang.String defValue)

statusMessage

public void statusMessage(java.lang.Object o)

queryInt

public int queryInt(java.lang.String msgKey,
                    java.lang.String titleKey,
                    int defaultVal,
                    boolean allowNegative)
Queries the user for an int, will show the message of the given msgKey and return defaultVal if no valid value was entered.


showError

public void showError(java.lang.String string)
shows an error message to the user


showError

public void showError(java.lang.String string,
                      java.lang.String title)
shows an error message to the user


showError

public static void showError(java.lang.String string,
                             java.awt.Component parent)
shows an error message to the user


showError

public static void showError(java.lang.String string,
                             java.lang.String title,
                             java.awt.Component parent)
shows an error message to the user


showWarning

public void showWarning(java.lang.String string)
shows a warning to the user


showWarning

public static void showWarning(java.lang.String string,
                               java.awt.Component parent)
shows a warning to the user


showWarning

public static void showWarning(java.lang.String string,
                               java.lang.String title,
                               java.awt.Component parent)
shows a warning to the user


getResponsePanel

public ResponsePanel getResponsePanel()

addFiles

public void addFiles(java.util.List files)
Inserts a invalidFileList of Files into the currently selected directory node.


addFiles

public void addFiles(java.io.File[] files)
Inserts an array of Files into the currently selected directory node.


addFile

public UploadImageFile addFile(java.lang.String name,
                               java.lang.String ext,
                               ImageData data)
Inserts a single Picture as new UploadFile.


addNodes

public void addNodes(UploadNode[] nodes)
Inserts a invalidFileList of Files into the currently selected directory node.


clickAddFolder

public void clickAddFolder()

remove

public void remove(UploadNode[] selected)
Will remove the given files after asking the user.


pasteClipboard

public void pasteClipboard()
Tries to add (if available) images or files from the clipboard to the tree.


copyToClipboard

public void copyToClipboard(UploadNode[] nodes)
Copies the given items to the clipboard


pasteClipboardImage

public void pasteClipboardImage()
Tries to add (if available) an image from the clipboard to the tree.


convertImages

public void convertImages(UploadNode[] nodes)
Queries the user for sufficient information and performs the conversion. Does not convert if the format is set through by configuration.


setCaptureDelay

public void setCaptureDelay(int secs)

takeJUploadScreenshot

public void takeJUploadScreenshot()

takeScreenshot

public void takeScreenshot()

takeScreenshot

public void takeScreenshot(boolean onlyJUpload)

queryScreenCaptureDelay

public void queryScreenCaptureDelay()

registerDefaultAuthProviders

protected void registerDefaultAuthProviders()


Copyright © 2007 smartwerkz.com. All Rights Reserved.