me.holz
Class DropboxMain

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by me.holz.DropboxMain
All Implemented Interfaces:
java.awt.dnd.DropTargetListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class DropboxMain
extends java.applet.Applet
implements java.awt.dnd.DropTargetListener

The Main class of the applet. It listens to drop events of the Drobox-label and handles all the components.

Since:
1.0
Version:
1.1, 01/13/2012
Author:
Mischa Holz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static int appletHeight
           
static int appletWidth
           
static int barHeight
           
static int barStatusLabelHeight
           
static int barStatusLabelWidth
           
static int barStatusLabelX
           
static int barStatusLabelY
           
static int barTitleLabelHeight
           
static int barTitleLabelWidth
           
static int barTitleLabelX
           
static int barTitleLabelY
           
static int cancelButtonHeight
           
static int cancelButtonWidth
           
static int cancelButtonX
           
static int cancelButtonY
           
static int dropAreaHeight
           
static int dropAreaWidth
           
static int dropAreaX
           
static int dropAreaY
           
static int progressBarHeight
           
static int progressBarLeftOffset
           
static int progressBarRightOffset
           
static int progressBarWidth
           
static int progressBarX
           
static int progressBarY
           
static int shelfWidth
           
static int shelfX
           
static int shelfY
           
 
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
DropboxMain()
           
 
Method Summary
static java.lang.String bytesForHuman(long bytes)
          Converts bytes into a human readable string.
 void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
          Implemented nop-method for dragEnter events because they are not needed by this applet.
 void dragExit(java.awt.dnd.DropTargetEvent dte)
          Implemented nop-method for dragExit events because they are not needed by this applet.
 void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
          Implemented nop-method for dragOver events because they are not needed by this applet.
 void drop(java.awt.dnd.DropTargetDropEvent dtde)
          Takes the drop events and, if they were any files dropped, adds them to the upload shelf.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
          Implemented nop-method for dropActionChanged events because they are not needed by this applet.
 void init()
          Assigns the necessary events and creates the components.
 void update(java.awt.Graphics g)
          Updates the components of the applet and sets the correct size by calling UploadStatusSehlf.
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

barHeight

public static int barHeight

appletWidth

public static int appletWidth

appletHeight

public static int appletHeight

dropAreaWidth

public static int dropAreaWidth

dropAreaHeight

public static int dropAreaHeight

dropAreaX

public static int dropAreaX

dropAreaY

public static int dropAreaY

shelfWidth

public static int shelfWidth

shelfX

public static int shelfX

shelfY

public static int shelfY

progressBarLeftOffset

public static int progressBarLeftOffset

progressBarRightOffset

public static int progressBarRightOffset

progressBarWidth

public static int progressBarWidth

progressBarHeight

public static int progressBarHeight

progressBarX

public static int progressBarX

progressBarY

public static int progressBarY

cancelButtonWidth

public static int cancelButtonWidth

cancelButtonHeight

public static int cancelButtonHeight

cancelButtonX

public static int cancelButtonX

cancelButtonY

public static int cancelButtonY

barTitleLabelX

public static int barTitleLabelX

barTitleLabelY

public static int barTitleLabelY

barTitleLabelWidth

public static int barTitleLabelWidth

barTitleLabelHeight

public static int barTitleLabelHeight

barStatusLabelX

public static int barStatusLabelX

barStatusLabelY

public static int barStatusLabelY

barStatusLabelWidth

public static int barStatusLabelWidth

barStatusLabelHeight

public static int barStatusLabelHeight
Constructor Detail

DropboxMain

public DropboxMain()
Method Detail

bytesForHuman

public static java.lang.String bytesForHuman(long bytes)
Converts bytes into a human readable string.

Parameters:
bytes - - the number of bytes
Returns:
The String in the form of "xx bytes/KB/MB/GB/TB/PT/ET"

init

public void init()
Assigns the necessary events and creates the components.

Overrides:
init in class java.applet.Applet

update

public void update(java.awt.Graphics g)
Updates the components of the applet and sets the correct size by calling UploadStatusSehlf.updateSize().

Overrides:
update in class java.awt.Container
See Also:
UploadStatusShelf

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
Implemented nop-method for dragEnter events because they are not needed by this applet.

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

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent dte)
Implemented nop-method for dragExit events because they are not needed by this applet.

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

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
Implemented nop-method for dragOver events because they are not needed by this applet.

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

drop

public void drop(java.awt.dnd.DropTargetDropEvent dtde)
Takes the drop events and, if they were any files dropped, adds them to the upload shelf.

Specified by:
drop in interface java.awt.dnd.DropTargetListener
Parameters:
dtde - the events' information
See Also:
UploadStatusShelf

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
Implemented nop-method for dropActionChanged events because they are not needed by this applet.

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