jfileupload.transfer.client.mdesign
Class InfoPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by jfileupload.transfer.client.mdesign.InfoPanel
All Implemented Interfaces:
java.awt.dnd.DropTargetListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, CompressListener, FilterListener, ProtocolListener, SplitListener, TransferListener

public class InfoPanel
extends javax.swing.JPanel
implements TransferListener, ProtocolListener, SplitListener, CompressListener, FilterListener, java.awt.dnd.DropTargetListener, java.awt.event.KeyListener

InfoPanel display uploads I18N messages. It also provides Drag & Drop support and paste (ctrl-v or apple-v) support.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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
protected  long amount
           
protected  java.lang.Object preprocessingfilterid
           
 
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 jfileupload.transfer.client.core.TransferListener
OTHER, UPLOAD
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
InfoPanel(Conf cnf)
          Information panel.
 
Method Summary
 void appendText(java.lang.String txt)
           
 void compressCancelled()
          Compress cancelled callback.
 void compressCompleted(java.lang.Object target, long size)
          Compress completed callback.
 void compressFailed(ClientException e)
          Compress failed callback.
 void compressStarted(java.lang.Object source, long size)
          Item compression started.
 void dataCompressed(long read)
          Data to be compressed (in bytes).
 void dataFiltered(long read)
          Data to be filtered (in bytes).
 void dataRead(long read)
          Callback on data loaded.
 void dataSplit(long read)
          Data read (in bytes)in current chunk.
 void dragEnter(java.awt.dnd.DropTargetDragEvent e)
          DnD : dragEnter implementation.
 void dragExit(java.awt.dnd.DropTargetEvent e)
          DnD : dragExit implementation.
 void dragOver(java.awt.dnd.DropTargetDragEvent e)
          DnD : dragOver implementation.
 void drop(java.awt.dnd.DropTargetDropEvent e)
          DnD : Drop implementation.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent e)
          DnD : dropActionChanged implementation.
 void filterCompleted(java.lang.Object target, java.lang.String custom)
          Filtering completed callback.
 void filterFailed(ClientException e)
          Filering failed callback.
 void filterStarted(java.lang.Object source, java.lang.String custom, java.lang.Object id)
          Filtering started.
 void filterStarting(java.lang.Object source, java.lang.String custom, java.lang.Object id)
          Filtering starting.
 javax.swing.JTextArea getTaskOutput()
           
protected  boolean isDragOk(java.awt.dnd.DropTargetDragEvent e)
          Checks if Drag allowed.
 boolean isLock()
          Return lock status for DnD.
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void paste()
          Paste data from Clipboard.
 void processDrop(java.lang.Object data)
           
 void requestSent(java.lang.Object info)
           
 void responseReceived(java.lang.Object info)
           
 void setController(TransferController controller)
           
 void setLock(boolean lock)
          Set lock status for Dnd.
 void splitCompleted(int chunkid)
          Split completed callback
 void splitFailed(int chunkid, ClientException e)
          split failed callback.
 void splitStarted(int chunkid, long chunksize)
          Split callback for a chunk.
 void splitTriggered(java.lang.Object source, long size, long chunksize, long amount, java.lang.String chunkbase)
          Overall split request callback
 void transferCancelled()
          Callback on transfer cancelling.
 void transferCompleted(java.lang.Object src, byte[] response)
          Callback from TransferListener.
 void transferDone(java.util.List files)
          Overall transfer completed.
 void transferFailed(ClientException e)
          Callback on transfer failing.
 void transferStarted(java.lang.Object source, long contentlength)
          Callback on transfer starting.
 void transferTriggered(java.util.List files, int type)
          Overall transfer started.
 void updateCaretPosition()
          Update caret position to end of text.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
 
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
 

Field Detail

preprocessingfilterid

protected java.lang.Object preprocessingfilterid

amount

protected long amount
Constructor Detail

InfoPanel

public InfoPanel(Conf cnf)
Information panel.

Method Detail

setController

public void setController(TransferController controller)

getTaskOutput

public javax.swing.JTextArea getTaskOutput()
Returns:
Returns the taskOutput.

updateCaretPosition

public void updateCaretPosition()
Update caret position to end of text.


appendText

public void appendText(java.lang.String txt)

transferTriggered

public void transferTriggered(java.util.List files,
                              int type)
Description copied from interface: TransferListener
Overall transfer started.

Specified by:
transferTriggered in interface TransferListener

transferDone

public void transferDone(java.util.List files)
Description copied from interface: TransferListener
Overall transfer completed.

Specified by:
transferDone in interface TransferListener

transferStarted

public void transferStarted(java.lang.Object source,
                            long contentlength)
Callback on transfer starting.

Specified by:
transferStarted in interface TransferListener
Parameters:
source - File to be transfered.
contentlength - length of file.

dataRead

public void dataRead(long read)
Callback on data loaded.

Specified by:
dataRead in interface TransferListener
Parameters:
read - length of data read.

transferCompleted

public void transferCompleted(java.lang.Object src,
                              byte[] response)
Callback from TransferListener.

Specified by:
transferCompleted in interface TransferListener

transferCancelled

public void transferCancelled()
Callback on transfer cancelling.

Specified by:
transferCancelled in interface TransferListener

transferFailed

public void transferFailed(ClientException e)
Callback on transfer failing.

Specified by:
transferFailed in interface TransferListener

splitTriggered

public void splitTriggered(java.lang.Object source,
                           long size,
                           long chunksize,
                           long amount,
                           java.lang.String chunkbase)
Description copied from interface: SplitListener
Overall split request callback

Specified by:
splitTriggered in interface SplitListener
Parameters:
source - File to split.
size - size of full file in bytes
chunksize - size of chunk in bytes
amount - number to chunks.
chunkbase - basename of chunk.

splitStarted

public void splitStarted(int chunkid,
                         long chunksize)
Description copied from interface: SplitListener
Split callback for a chunk.

Specified by:
splitStarted in interface SplitListener
Parameters:
chunkid - id of chunk being split.
chunksize - size of chunk being split.

dataSplit

public void dataSplit(long read)
Description copied from interface: SplitListener
Data read (in bytes)in current chunk.

Specified by:
dataSplit in interface SplitListener

splitCompleted

public void splitCompleted(int chunkid)
Description copied from interface: SplitListener
Split completed callback

Specified by:
splitCompleted in interface SplitListener

splitFailed

public void splitFailed(int chunkid,
                        ClientException e)
Description copied from interface: SplitListener
split failed callback.

Specified by:
splitFailed in interface SplitListener

compressStarted

public void compressStarted(java.lang.Object source,
                            long size)
Description copied from interface: CompressListener
Item compression started.

Specified by:
compressStarted in interface CompressListener

dataCompressed

public void dataCompressed(long read)
Description copied from interface: CompressListener
Data to be compressed (in bytes).

Specified by:
dataCompressed in interface CompressListener

compressCompleted

public void compressCompleted(java.lang.Object target,
                              long size)
Description copied from interface: CompressListener
Compress completed callback.

Specified by:
compressCompleted in interface CompressListener
size - of compressed file.

compressFailed

public void compressFailed(ClientException e)
Description copied from interface: CompressListener
Compress failed callback.

Specified by:
compressFailed in interface CompressListener

compressCancelled

public void compressCancelled()
Description copied from interface: CompressListener
Compress cancelled callback.

Specified by:
compressCancelled in interface CompressListener

filterStarting

public void filterStarting(java.lang.Object source,
                           java.lang.String custom,
                           java.lang.Object id)
Description copied from interface: FilterListener
Filtering starting.

Specified by:
filterStarting in interface FilterListener

filterStarted

public void filterStarted(java.lang.Object source,
                          java.lang.String custom,
                          java.lang.Object id)
Description copied from interface: FilterListener
Filtering started.

Specified by:
filterStarted in interface FilterListener
custom - message.

dataFiltered

public void dataFiltered(long read)
Description copied from interface: FilterListener
Data to be filtered (in bytes).

Specified by:
dataFiltered in interface FilterListener

filterCompleted

public void filterCompleted(java.lang.Object target,
                            java.lang.String custom)
Description copied from interface: FilterListener
Filtering completed callback.

Specified by:
filterCompleted in interface FilterListener
custom - message

filterFailed

public void filterFailed(ClientException e)
Description copied from interface: FilterListener
Filering failed callback.

Specified by:
filterFailed in interface FilterListener

requestSent

public void requestSent(java.lang.Object info)
Specified by:
requestSent in interface ProtocolListener

responseReceived

public void responseReceived(java.lang.Object info)
Specified by:
responseReceived in interface ProtocolListener

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent e)
DnD : dragEnter implementation.

Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent e)
DnD : dragOver implementation.

Specified by:
dragOver in interface java.awt.dnd.DropTargetListener

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent e)
DnD : dragExit implementation.

Specified by:
dragExit in interface java.awt.dnd.DropTargetListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent e)
DnD : dropActionChanged implementation.

Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener

drop

public void drop(java.awt.dnd.DropTargetDropEvent e)
DnD : Drop implementation. Adds all dropped files to the playlist.

Specified by:
drop in interface java.awt.dnd.DropTargetListener

isDragOk

protected boolean isDragOk(java.awt.dnd.DropTargetDragEvent e)
Checks if Drag allowed.


keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

processDrop

public void processDrop(java.lang.Object data)

paste

public void paste()
Paste data from Clipboard.


isLock

public boolean isLock()
Return lock status for DnD.

Returns:

setLock

public void setLock(boolean lock)
Set lock status for Dnd.

Parameters:
lock -