|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapidminer.gui.tools.SwingTools
public class SwingTools
This helper class provides some static methods and properties which might be useful for several GUI classes. These methods include
| Field Summary | |
|---|---|
static java.awt.Color |
BROWN_FONT_COLOR
A brown font color. |
static java.awt.Color |
DARK_BLUE
Some color constants for Java Look and Feel. |
static java.awt.Color |
DARK_YELLOW
Some color constants for Java Look and Feel. |
static java.awt.Color |
DARKEST_BLUE
Some color constants for Java Look and Feel. |
static java.awt.Color |
DARKEST_YELLOW
Some color constants for Java Look and Feel. |
static java.awt.Color |
LIGHT_BLUE
Some color constants for Java Look and Feel. |
static java.awt.Color |
LIGHT_BROWN_FONT_COLOR
A brown font color. |
static java.awt.Color |
LIGHT_YELLOW
Some color constants for Java Look and Feel. |
static java.awt.Color |
LIGHTEST_BLUE
Some color constants for Java Look and Feel. |
static java.awt.Color |
LIGHTEST_RED
Some color constants for Java Look and Feel. |
static java.awt.Color |
LIGHTEST_YELLOW
Some color constants for Java Look and Feel. |
static java.awt.Color |
RAPID_I_BROWN
The Rapid-I brown color. |
static java.awt.Color |
RAPID_I_ORANGE
The Rapid-I orange color. |
static int |
TABLE_ROW_EXTRA_HEIGHT
Defines the extra height for each row in a table. |
static int |
TABLE_WITH_COMPONENTS_ROW_EXTRA_HEIGHT
Defines the extra height for rows in a table with components. |
static java.awt.Color |
TRANSPARENT_YELLOW
Some color constants for Java Look and Feel. |
static java.awt.Color |
VERY_DARK_BLUE
Some color constants for Java Look and Feel. |
| Constructor Summary | |
|---|---|
SwingTools()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
addLinebreaks(java.lang.String message)
Adds linebreaks after TOOL_TIP_LINE_LENGTH letters. |
static java.io.File |
chooseFile(java.awt.Component parent,
java.io.File file,
boolean open,
boolean onlyDirs,
java.lang.String extension,
java.lang.String extensionDescription)
Opens a file chooser with a reasonable start directory. |
static java.io.File |
chooseFile(java.awt.Component parent,
java.io.File file,
boolean open,
java.lang.String extension,
java.lang.String extensionDescription)
Opens a file chooser with a reasonable start directory. |
static javax.swing.JFileChooser |
createFileChooser(java.io.File file,
boolean onlyDirs,
javax.swing.filechooser.FileFilter[] fileFilters)
Creates file chooser with a reasonable start directory. |
static javax.swing.ImageIcon |
createIcon(java.lang.String iconName)
Tries to load the icon for the given resource. |
static javax.swing.ImageIcon |
createImage(java.lang.String imageName)
Tries to load the image for the given resource. |
static javax.swing.JPanel |
createTextPanel(java.lang.String title,
java.lang.String text)
Creates a panel with title and text. |
static java.util.List<java.awt.Image> |
getFrameIconList()
Returns the list of all available program icon sizes. |
static java.awt.Color |
getPointColor(double value)
Returns a color equivalent to the value of value. |
static java.awt.Color |
getPointColor(double value,
double max,
double min)
Returns a color equivalent to the value of value. |
static java.lang.String |
getStringFromClassArray(java.lang.Class[] classes)
Transforms the given class name array into a comma separated string of the short class names. |
static SyntaxStyle[] |
getSyntaxStyles()
Returns adapted syntax color and font styles matching RapidMiner colors. |
static TextAreaDefaults |
getTextAreaDefaults()
Returns JEditTextArea defaults with adapted syntax color styles. |
static java.lang.String |
html2RapidMinerText(java.lang.String html)
Replaces simple html tags and quotes by RapidMiner specific text elements. |
static java.awt.GradientPaint |
makeBluePaint(double width,
double height)
Creates a blue gradient paint. |
static java.awt.GradientPaint |
makeRedPaint(double width,
double height)
Creates a red gradient paint. |
static java.awt.GradientPaint |
makeYellowPaint(double width,
double height)
Creates a yellow gradient paint. |
static void |
setDialogIcon(javax.swing.JDialog dialog)
Returns the list of all possible frame icons. |
static void |
setFrameIcon(javax.swing.JFrame frame)
Returns the list of all possible frame icons. |
static void |
setFrameIconProvider(FrameIconProvider _frameIconProvider)
|
static void |
setIconType(java.lang.String newIconType)
|
static void |
setupFrameIcons(java.lang.String frameIconBaseName)
|
static void |
showFinalErrorMessage(java.lang.String message,
java.lang.Throwable e)
Shows the final error message dialog. |
static void |
showSimpleErrorMessage(java.lang.String message,
java.lang.Throwable e)
This is the normal method which could be used by GUI classes for errors caused by some exception (e.g. |
static void |
showVerySimpleErrorMessage(java.lang.String message)
Shows a very simple error message without any Java exception hints. |
static java.lang.String |
text2DisplayHtml(java.lang.String text)
Replaces the RapidMiner specific tag elements by normal html tags. |
static java.lang.String |
text2SimpleHtml(java.lang.String htmlText)
Replaces the RapidMiner specific tag elements by normal html tags. |
static java.lang.String |
transformToolTipText(java.lang.String description)
This method transforms the given tool tip text into HTML. |
static java.lang.String |
transformToolTipText(java.lang.String description,
boolean addHTMLTags,
int lineLength)
This method transforms the given tool tip text into HTML. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TABLE_ROW_EXTRA_HEIGHT
public static final int TABLE_WITH_COMPONENTS_ROW_EXTRA_HEIGHT
ExtendedJTable is used, this amount can be added additionally
to the amount of TABLE_ROW_EXTRA_HEIGHT which is already
added in the constructor.
public static final java.awt.Color DARKEST_YELLOW
public static final java.awt.Color DARK_YELLOW
public static final java.awt.Color LIGHT_YELLOW
public static final java.awt.Color LIGHTEST_YELLOW
public static final java.awt.Color TRANSPARENT_YELLOW
public static final java.awt.Color VERY_DARK_BLUE
public static final java.awt.Color DARKEST_BLUE
public static final java.awt.Color DARK_BLUE
public static final java.awt.Color LIGHT_BLUE
public static final java.awt.Color LIGHTEST_BLUE
public static final java.awt.Color RAPID_I_ORANGE
public static final java.awt.Color RAPID_I_BROWN
public static final java.awt.Color LIGHTEST_RED
public static final java.awt.Color BROWN_FONT_COLOR
public static final java.awt.Color LIGHT_BROWN_FONT_COLOR
| Constructor Detail |
|---|
public SwingTools()
| Method Detail |
|---|
public static void setFrameIconProvider(FrameIconProvider _frameIconProvider)
public static void setupFrameIcons(java.lang.String frameIconBaseName)
public static java.util.List<java.awt.Image> getFrameIconList()
public static void setFrameIcon(javax.swing.JFrame frame)
public static void setDialogIcon(javax.swing.JDialog dialog)
public static java.awt.GradientPaint makeRedPaint(double width,
double height)
public static java.awt.GradientPaint makeBluePaint(double width,
double height)
public static java.awt.GradientPaint makeYellowPaint(double width,
double height)
public static void setIconType(java.lang.String newIconType)
public static javax.swing.ImageIcon createIcon(java.lang.String iconName)
public static javax.swing.ImageIcon createImage(java.lang.String imageName)
public static java.lang.String transformToolTipText(java.lang.String description)
TOOL_TIP_LINE_LENGTH characters.
public static java.lang.String transformToolTipText(java.lang.String description,
boolean addHTMLTags,
int lineLength)
TOOL_TIP_LINE_LENGTH characters.
public static java.lang.String getStringFromClassArray(java.lang.Class[] classes)
public static java.lang.String addLinebreaks(java.lang.String message)
TOOL_TIP_LINE_LENGTH letters.
public static void showVerySimpleErrorMessage(java.lang.String message)
public static void showSimpleErrorMessage(java.lang.String message,
java.lang.Throwable e)
public static void showFinalErrorMessage(java.lang.String message,
java.lang.Throwable e)
public static java.io.File chooseFile(java.awt.Component parent,
java.io.File file,
boolean open,
java.lang.String extension,
java.lang.String extensionDescription)
public static java.io.File chooseFile(java.awt.Component parent,
java.io.File file,
boolean open,
boolean onlyDirs,
java.lang.String extension,
java.lang.String extensionDescription)
public static javax.swing.JFileChooser createFileChooser(java.io.File file,
boolean onlyDirs,
javax.swing.filechooser.FileFilter[] fileFilters)
if (fileChooser.showOpenDialog(parent) == JFileChooser.APPROVE_OPTION)
File selectedFile = fileChooser.getSelectedFile();
Usually, the method
chooseFile(Component, File, boolean, boolean, FileFilter[]) or
one of the convenience wrapper methods can be used to do this. This
method is only useful if one is interested, e.g., in the selected file
filter.
file - The initially selected value of the file chooser dialogonlyDirs - Only allow directories to be selectedfileFilters - List of FileFilters to use
public static javax.swing.JPanel createTextPanel(java.lang.String title,
java.lang.String text)
public static java.lang.String html2RapidMinerText(java.lang.String html)
public static java.lang.String text2DisplayHtml(java.lang.String text)
public static java.lang.String text2SimpleHtml(java.lang.String htmlText)
public static java.awt.Color getPointColor(double value)
value. The value
has to be normalized between 0 and 1.
public static java.awt.Color getPointColor(double value,
double max,
double min)
value. The value
will be normalized between 0 and 1 using the parameters max and min. Which
are the minimum and maximum of the complete dataset.
public static TextAreaDefaults getTextAreaDefaults()
public static SyntaxStyle[] getSyntaxStyles()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||