|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.axelwernicke.mypod.gui.GuiUtils
This class provides some helpers to remove code from the core GUI classes.
Field Summary | |
static int |
ABORT_OPTION
|
static int |
RETRY_OPTION
|
static int |
SKIP_OPTION
|
static int |
UNKNOWN_OPTION
|
Method Summary | |
static java.awt.Rectangle |
calcCenteredBounds(java.awt.Rectangle mainFrame,
java.awt.Rectangle dialog)
calculates bound to show dialog in the center of mainFrame |
static boolean |
checkVMVersion(java.awt.Component component)
Checks if the current java vm version is > 1.4 |
static java.lang.String |
formatFilesize(long filesize)
Formats filesize in bytes as appropriate to Bytes, KB, MB or GB |
static java.lang.String |
formatFilesizeKB(long filesize)
Formats filesize in bytes to KB |
static java.lang.String |
formatTime(long time)
Formats time string from seconds. |
static java.lang.String |
formatTransferSpeedKB(long filesize,
int fractionDigits)
Formats transfer speed in bytes/s to KB/s |
static java.lang.String |
formatTransferSpeedMB(long filesize,
int fractionDigits)
Formats transfer speed in bytes/s to MB/s |
static javax.swing.tree.DefaultMutableTreeNode |
getAutoPlaylistPropertyTreeModel()
Gets the tree model for autoplaylist filter properties. |
GuiUtils |
getInstance()
This is a singleton class, so use getInstance to get in instance :) |
static java.util.Hashtable |
getLookAndFeelInfo()
Gets all accasseble look and feels. |
static javax.swing.tree.DefaultMutableTreeNode |
getPlaylistPropertyTreeModel()
Gets the tree model for playlist properties. |
static java.util.Vector |
getSelectedClips(Frontend frontend)
Gets the selected clips - get current clips table view - get oids for selected clips from the view |
static java.lang.String |
getStringLocalized(java.lang.String key)
Gets a string from the resource bundle - localized for the current default language |
static java.lang.String |
getStringLocalized(java.lang.String bundle,
java.lang.String key)
Gets a string from the resource bundle - localized for the current default language |
static java.lang.String |
limitFilename(java.io.File file,
int limit)
Reformats a filename to be limited in lenght. |
static void |
setLookAndFeel(javax.swing.LookAndFeel lfClass,
java.awt.Frame frame)
Sets the look and feel for myPod. |
static void |
setLookAndFeel(java.lang.String lookAndFeelInfo,
java.awt.Frame frame)
Sets the look and feel from an info string as used in the preferences dialog class. |
static MP3MetaV2 |
showClipPropertiesDialog(Frontend frontend,
java.util.Vector clips)
Prepares and shows clip properties dialog and evaulates result. |
static void |
showHelpBrowser(java.lang.String anchor)
Shows a swing browser for a given URL |
static boolean |
showPlaylistPropertyDialog(Playlist playlist,
Frontend frontend,
Backend backend)
Creates and shows the playlist property dialog. |
static Preferences |
showPreferencesDialog(Frontend frontend,
Preferences prefs)
Prepares and shows preferences dialog and evaulates result. |
static int |
showRSADialog(java.lang.String title,
java.lang.String message)
Shows an retry, skip, abort dialog. |
static void |
updateStatusLine(Frontend frontend)
sets the status line |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int UNKNOWN_OPTION
public static final int RETRY_OPTION
public static final int SKIP_OPTION
public static final int ABORT_OPTION
Method Detail |
public GuiUtils getInstance()
public static boolean checkVMVersion(java.awt.Component component)
component
- to show the message dialog at
public static java.util.Vector getSelectedClips(Frontend frontend)
frontend
- to get the clips table view from
public static java.lang.String getStringLocalized(java.lang.String bundle, java.lang.String key)
bundle
- name of the resource bundlekey
- in the bundle
public static java.lang.String getStringLocalized(java.lang.String key)
key
- in the bundle
public static javax.swing.tree.DefaultMutableTreeNode getAutoPlaylistPropertyTreeModel()
public static javax.swing.tree.DefaultMutableTreeNode getPlaylistPropertyTreeModel()
public static boolean showPlaylistPropertyDialog(Playlist playlist, Frontend frontend, Backend backend)
playlist
- to show a property dialog forfrontend
- myPods main windowbackend
- myPods application logic
public static Preferences showPreferencesDialog(Frontend frontend, Preferences prefs)
prefs
- for myPodfrontend
- of myPod
public static MP3MetaV2 showClipPropertiesDialog(Frontend frontend, java.util.Vector clips)
clips
- clips to change properties forfrontend
- used to calculate the dialogs position
public static void updateStatusLine(Frontend frontend)
frontend
- where the status line is placedpublic static java.awt.Rectangle calcCenteredBounds(java.awt.Rectangle mainFrame, java.awt.Rectangle dialog)
mainFrame
- boundsdialog
- bounds
public static java.lang.String formatFilesize(long filesize)
filesize
- in bytes
public static java.lang.String formatFilesizeKB(long filesize)
filesize
- in bytes
public static java.lang.String formatTransferSpeedKB(long filesize, int fractionDigits)
filesize
- to format in bytesfractionDigits
- ...
public static java.lang.String formatTransferSpeedMB(long filesize, int fractionDigits)
filesize
- to format in bytesfractionDigits
- ...
public static java.lang.String formatTime(long time)
time
- to format in seconds
public static java.util.Hashtable getLookAndFeelInfo()
public static void setLookAndFeel(java.lang.String lookAndFeelInfo, java.awt.Frame frame)
lookAndFeelInfo
- describing the look and feel to setframe
- to set the look and feel forpublic static void setLookAndFeel(javax.swing.LookAndFeel lfClass, java.awt.Frame frame)
lfClass
- the look and feel class to activateframe
- root frame that is reinitialized after changing the l&fpublic static void showHelpBrowser(java.lang.String anchor)
anchor
- in the help file to show in the browserpublic static int showRSADialog(java.lang.String title, java.lang.String message)
title
- to set in the dialogmessage
- to show in the dialog
public static java.lang.String limitFilename(java.io.File file, int limit)
file
- to format path and namelimit
- max. length of formatted name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |