org.jperdian.rss2
Class RssHelper

java.lang.Object
  |
  +--org.jperdian.rss2.RssHelper

public class RssHelper
extends java.lang.Object

Several small helpers

Author:
Christian Robert

Constructor Summary
RssHelper()
           
 
Method Summary
static java.lang.String computeFileSizeString(long bytes)
          Computes the title for the given file size
static java.lang.String computeTimeString(long time)
          Formats the given time span
static javax.swing.JButton createButton(char mnemonic, javax.swing.Action action, javax.swing.Icon icon)
          Creates a JButton
static javax.swing.JMenuItem createMenuItem(javax.swing.Action action, javax.swing.Icon icon)
          Creates a JMenuItem
static java.awt.Image getImage(java.io.File file)
          Gets the image from the given File
static java.awt.Image getResourceImage(java.lang.String imageName)
          Creates an image icon for the given name.
static javax.swing.Icon getResourceImageIcon(java.lang.String imageName)
          Creates a text for the given name.
static java.lang.String getResourceText(java.lang.String imageName)
          Creates an image icon for the given name.
static java.awt.Image scaleImageProportional(java.awt.Image sourceImage, java.awt.Dimension maxDimension, boolean highQuality)
           
static java.awt.Image waitFor(java.awt.Image image)
          Wait until the image has been loaded completely
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RssHelper

public RssHelper()
Method Detail

getResourceText

public static java.lang.String getResourceText(java.lang.String imageName)
Creates an image icon for the given name. The image for this icon must be located in the resource path "org/jperdian/rss2/res/images"


getResourceImageIcon

public static javax.swing.Icon getResourceImageIcon(java.lang.String imageName)
Creates a text for the given name. The text must be located in the resource path "braintags/elacarte/imageassist/res/texts"


getResourceImage

public static java.awt.Image getResourceImage(java.lang.String imageName)
Creates an image icon for the given name. The image for this icon must be located in the resource path "org/jperdian/rss2/res/images"


getImage

public static java.awt.Image getImage(java.io.File file)
                               throws java.io.IOException
Gets the image from the given File

java.io.IOException

scaleImageProportional

public static java.awt.Image scaleImageProportional(java.awt.Image sourceImage,
                                                    java.awt.Dimension maxDimension,
                                                    boolean highQuality)

waitFor

public static java.awt.Image waitFor(java.awt.Image image)
Wait until the image has been loaded completely


computeFileSizeString

public static java.lang.String computeFileSizeString(long bytes)
Computes the title for the given file size


computeTimeString

public static java.lang.String computeTimeString(long time)
Formats the given time span


createMenuItem

public static javax.swing.JMenuItem createMenuItem(javax.swing.Action action,
                                                   javax.swing.Icon icon)
Creates a JMenuItem

Parameters:
action - the action to be performed
icon - the icon to be used

createButton

public static javax.swing.JButton createButton(char mnemonic,
                                               javax.swing.Action action,
                                               javax.swing.Icon icon)
Creates a JButton

Parameters:
action - the action to be performed
icon - the icon to be used