com.smartwerkz.jupload.classic.ui
Class Decorator

java.lang.Object
  extended by com.smartwerkz.jupload.classic.ui.Decorator

public class Decorator
extends java.lang.Object

Provides labels and icons for decorating GUI components

Since:
Jan 21, 2006, 12:26:52 AM
Author:
Dominik Seifert

Field Summary
 java.awt.Color bgColor
           
 Config cfg
           
static java.text.DateFormat dateFormat
           
static java.text.NumberFormat decimalFormat
           
static java.awt.Color defaultBgColor
           
static java.awt.Color defaultFgColor
           
static java.awt.Color defaultSelectedBgColor
           
static java.awt.Color defaultSelectedFgColor
           
 java.awt.Color fgColor
           
static javax.swing.Icon folderIcon
           
 java.awt.Font font
           
 javax.swing.filechooser.FileSystemView fsv
           
 int iconHeight
           
 int iconWidth
           
static java.text.NumberFormat percentFormat
           
 java.awt.Color selectedBgColor
           
 java.awt.Color selectedFgColor
           
 boolean showFilePaths
           
 boolean showSystemicons
           
 boolean showThumbs
           
 
Constructor Summary
Decorator(Config cfg)
           
 
Method Summary
 void cancelIconLoader()
           
 javax.swing.JLabel createFolderLabel(UploadNode node)
           
 ListLabel createFolderListLabel(UploadNode node)
           
 ListLabel createIconLabel(UploadView view, UploadNode node)
           
 ListLabel createIconLabel(UploadView view, UploadNode node, int w, int h)
          Creates a label for the given node within the given view with w and h as max dimensions for the label's icon.
 javax.swing.JLabel createLabel(UploadNode node)
           
 ListLabel createListLabel(UploadNode node)
           
 void decorate(java.awt.Component c)
           
 void decorate(java.awt.Component c, boolean selected)
          Sets basic decoration to the given component.
 void decorate(java.awt.Component c, boolean colors, boolean fonts)
           
 void decorateAll(java.awt.Container cont)
          Decorates all components of the given container with the default decoration options.
 void decorateAll(java.awt.Container cont, boolean colors, boolean fonts)
          Decorates all components of the given container with the default decoration options.
 void decorateProgressLabel(java.awt.Component c, boolean selected)
          Do not change the foreground.
static java.lang.String formatDateTime(long millis)
           
static java.lang.String formatPercent(double percent)
           
static java.lang.String formatSize(int current, int total)
           
static java.lang.String formatSize(long size)
           
static java.lang.String formatSpeed(int bps)
           
static java.lang.String formatTimespan(int totalSecs)
           
static java.awt.Color getColor(java.lang.Object resourceName)
           
 javax.swing.Icon getIcon(UploadNode node, int w, int h, boolean atOnce)
           
 java.lang.String getLabelText(UploadNode n)
           
 javax.swing.Icon getUploadIcon(int status)
           
 void init()
          Load the lf infos.
 boolean initialized()
           
 void setIcon(UploadNode node, javax.swing.JLabel label, int w, int h)
          Sets the icon for the given node in the given view with w and h as max dimensions for thumbnails.
 void setIconLater(UploadNode node, UploadView view, int w, int h)
           
 void setLabelText(UploadNode n, javax.swing.JLabel label)
          Set the label's text and tooltip according to the current configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fsv

public final javax.swing.filechooser.FileSystemView fsv

showThumbs

public final boolean showThumbs

showSystemicons

public final boolean showSystemicons

showFilePaths

public final boolean showFilePaths

iconWidth

public final int iconWidth

iconHeight

public final int iconHeight

folderIcon

public static final javax.swing.Icon folderIcon

defaultBgColor

public static java.awt.Color defaultBgColor

defaultSelectedBgColor

public static java.awt.Color defaultSelectedBgColor

defaultFgColor

public static java.awt.Color defaultFgColor

defaultSelectedFgColor

public static java.awt.Color defaultSelectedFgColor

bgColor

public java.awt.Color bgColor

selectedBgColor

public java.awt.Color selectedBgColor

fgColor

public java.awt.Color fgColor

selectedFgColor

public java.awt.Color selectedFgColor

font

public java.awt.Font font

cfg

public final Config cfg

dateFormat

public static final java.text.DateFormat dateFormat

percentFormat

public static final java.text.NumberFormat percentFormat

decimalFormat

public static final java.text.NumberFormat decimalFormat
Constructor Detail

Decorator

public Decorator(Config cfg)
Method Detail

initialized

public boolean initialized()

init

public void init()
Load the lf infos.


cancelIconLoader

public void cancelIconLoader()

getColor

public static java.awt.Color getColor(java.lang.Object resourceName)

setIconLater

public void setIconLater(UploadNode node,
                         UploadView view,
                         int w,
                         int h)

setIcon

public void setIcon(UploadNode node,
                    javax.swing.JLabel label,
                    int w,
                    int h)
Sets the icon for the given node in the given view with w and h as max dimensions for thumbnails. Will return immediately and in case that it still needs caching, set the icon later.


getIcon

public javax.swing.Icon getIcon(UploadNode node,
                                int w,
                                int h,
                                boolean atOnce)

getLabelText

public java.lang.String getLabelText(UploadNode n)

setLabelText

public void setLabelText(UploadNode n,
                         javax.swing.JLabel label)
Set the label's text and tooltip according to the current configuration.


decorateAll

public void decorateAll(java.awt.Container cont)
Decorates all components of the given container with the default decoration options.


decorateAll

public void decorateAll(java.awt.Container cont,
                        boolean colors,
                        boolean fonts)
Decorates all components of the given container with the default decoration options.


decorate

public void decorate(java.awt.Component c)

decorate

public void decorate(java.awt.Component c,
                     boolean colors,
                     boolean fonts)

decorate

public void decorate(java.awt.Component c,
                     boolean selected)
Sets basic decoration to the given component.


decorateProgressLabel

public void decorateProgressLabel(java.awt.Component c,
                                  boolean selected)
Do not change the foreground.


createIconLabel

public ListLabel createIconLabel(UploadView view,
                                 UploadNode node)

createIconLabel

public ListLabel createIconLabel(UploadView view,
                                 UploadNode node,
                                 int w,
                                 int h)
Creates a label for the given node within the given view with w and h as max dimensions for the label's icon.


createFolderLabel

public javax.swing.JLabel createFolderLabel(UploadNode node)

createFolderListLabel

public ListLabel createFolderListLabel(UploadNode node)

createLabel

public javax.swing.JLabel createLabel(UploadNode node)

createListLabel

public ListLabel createListLabel(UploadNode node)

formatSize

public static java.lang.String formatSize(int current,
                                          int total)

formatSize

public static java.lang.String formatSize(long size)

formatSpeed

public static java.lang.String formatSpeed(int bps)

formatPercent

public static java.lang.String formatPercent(double percent)

formatDateTime

public static java.lang.String formatDateTime(long millis)

formatTimespan

public static java.lang.String formatTimespan(int totalSecs)

getUploadIcon

public javax.swing.Icon getUploadIcon(int status)
Returns:
an icon to indicate the given status


Copyright © 2007 smartwerkz.com. All Rights Reserved.