halo.userinterface.gui.guitools
Class GuiTools

java.lang.Object
  extended by halo.userinterface.gui.guitools.GuiTools

public class GuiTools
extends java.lang.Object

Class containing several tools used for Graphical User Interface

Author:
Stefanie Kaufmann

Constructor Summary
GuiTools()
           
 
Method Summary
static java.lang.String alignLabel(java.lang.String txt, int width, java.awt.FontMetrics fm)
          Formats a text for a dialog window
static java.io.File displaySaveDialog(java.awt.Component comp, java.lang.String text, javax.swing.filechooser.FileFilter filter)
          Displays a dialog that asks the user if he wants to save something into a file
static void showBrowser(java.net.URI uri, java.awt.Frame frame)
          Opens a given URI in a user defined browser
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiTools

public GuiTools()
Method Detail

alignLabel

public static java.lang.String alignLabel(java.lang.String txt,
                                          int width,
                                          java.awt.FontMetrics fm)
Formats a text for a dialog window

Parameters:
txt - The original text
width - The width of the line
fm - The font metrics
Returns:
The formatted text

displaySaveDialog

public static java.io.File displaySaveDialog(java.awt.Component comp,
                                             java.lang.String text,
                                             javax.swing.filechooser.FileFilter filter)
Displays a dialog that asks the user if he wants to save something into a file

Parameters:
comp - The mother component
text - The text of the dialog
filter - The file filter for the output file
Returns:
The file that has been chosen

showBrowser

public static void showBrowser(java.net.URI uri,
                               java.awt.Frame frame)
Opens a given URI in a user defined browser

Parameters:
uri - URI to be opened
frame - Owner frame for which it is called