|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchemaxon.marvin.util.SwingUtil
public class SwingUtil
Swing utility functions.
Constructor Summary | |
---|---|
SwingUtil()
|
Method Summary | ||
---|---|---|
static void |
addHyperlinkListener(javax.swing.JEditorPane editorPane)
Adds HTML link handling to an editor pane. |
|
static javax.swing.JMenu |
createMenu(java.util.ResourceBundle rc,
java.lang.String key)
Utility method to create a menu with a label specified as a resource. |
|
static javax.swing.JMenu |
createMenu(java.util.ResourceBundle rc,
java.lang.String key,
boolean mnemo)
Creates a menu with a label specified as a resource. |
|
static javax.swing.JMenuItem |
createMenuItem(java.util.ResourceBundle rc,
java.lang.String key)
Creates a menu with a label specified as a resource. |
|
static javax.swing.JMenuItem |
createMenuItem(java.util.ResourceBundle rc,
java.lang.String key,
boolean mnemo)
Creates a menu with a label specified as a resource. |
|
static javax.swing.JMenuItem |
createMenuItem(java.util.ResourceBundle rc,
java.lang.String key,
java.lang.Class what,
boolean mnemo)
Creates a menu item with a label specified as a resource. |
|
static javax.swing.JEditorPane |
createMessagePane(java.lang.String text)
Creates a message pane with HTML text content. |
|
static javax.swing.JPanel |
createSubPanel(java.lang.String title)
Creates a sub-panel with a title. |
|
static java.awt.GridBagConstraints |
createTopLeftConstraints()
Creates GridBagConstraints for the top left component. |
|
static void |
decorateSubPanel(javax.swing.JPanel panel,
java.lang.String title)
Creates border and title for a panel. |
|
static javax.swing.KeyStroke |
getCommandKeyStroke(int key)
Gets the command keystroke preferred on the current platform. |
|
static void |
initAction(javax.swing.Action action,
java.util.ResourceBundle rc,
java.lang.String key,
javax.swing.KeyStroke accel)
Initializes an action from information in a resource. |
|
static void |
initButton(javax.swing.AbstractButton b,
java.util.ResourceBundle rc,
java.lang.String key)
Utility method to initialize a button from information in a resource. |
|
static void |
initButton(javax.swing.AbstractButton b,
java.util.ResourceBundle rc,
java.lang.String key,
boolean mnemo)
Utility method to initialize a button from information in a resource. |
|
static void |
initCtrlShortcutForMac(javax.swing.JMenuItem mi)
Deprecated. does nothing. |
|
static void |
initInApplet()
Deprecated. does nothing. |
|
static
|
invokeAndWait(java.util.concurrent.Callable<T> callable)
Calls SwingUtilities.invokeLater() for a Callable by wrapping it into a FutureTask object, blocks until it is finished and returns the result (calling FutureTask.get()). |
|
static
|
invokeLater(java.util.concurrent.Callable<T> callable)
Calls SwingUtilities.invokeLater() for a Callable by wrapping it into a FutureTask object. |
|
static void |
setDefaultFont(javax.swing.JEditorPane editorPane)
Sets the SWING default font in the JEditorPane. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SwingUtil()
Method Detail |
---|
public static void initInApplet()
public static javax.swing.KeyStroke getCommandKeyStroke(int key)
key
- the key
public static javax.swing.JMenuItem createMenuItem(java.util.ResourceBundle rc, java.lang.String key, java.lang.Class what, boolean mnemo)
rc
- the resourceskey
- name of the label resourcewhat
- menu item classmnemo
- use mnemonic or not
public static javax.swing.JMenuItem createMenuItem(java.util.ResourceBundle rc, java.lang.String key, boolean mnemo)
rc
- the resourceskey
- name of the label resourcemnemo
- set the mnemonic or not
public static javax.swing.JMenuItem createMenuItem(java.util.ResourceBundle rc, java.lang.String key)
rc
- the resourceskey
- name of the label resource
public static javax.swing.JMenu createMenu(java.util.ResourceBundle rc, java.lang.String key)
rc
- the resourceskey
- name of the label resource
public static javax.swing.JMenu createMenu(java.util.ResourceBundle rc, java.lang.String key, boolean mnemo)
rc
- the resourceskey
- name of the label resourcemnemo
- set the mnemonic or not
public static void initButton(javax.swing.AbstractButton b, java.util.ResourceBundle rc, java.lang.String key)
b
- the buttonrc
- the resourceskey
- name of the resourcepublic static void initButton(javax.swing.AbstractButton b, java.util.ResourceBundle rc, java.lang.String key, boolean mnemo)
b
- the buttonrc
- the resourceskey
- name of the resourcemnemo
- set the mnemonic or notpublic static void initAction(javax.swing.Action action, java.util.ResourceBundle rc, java.lang.String key, javax.swing.KeyStroke accel)
action
- the actionrc
- the resourceskey
- name of the resourceaccel
- the accelerator or nullpublic static void initCtrlShortcutForMac(javax.swing.JMenuItem mi)
public static void decorateSubPanel(javax.swing.JPanel panel, java.lang.String title)
title
- the panel titlepublic static javax.swing.JPanel createSubPanel(java.lang.String title)
title
- the panel title
decorateSubPanel(JPanel, String)
public static java.awt.GridBagConstraints createTopLeftConstraints()
public static javax.swing.JEditorPane createMessagePane(java.lang.String text)
text
- the content, may contain HTML links
public static void setDefaultFont(javax.swing.JEditorPane editorPane)
editorPane
- the JEditorPanepublic static void addHyperlinkListener(javax.swing.JEditorPane editorPane)
editorPane
- the JEditorPanepublic static <T> java.util.concurrent.FutureTask<T> invokeLater(java.util.concurrent.Callable<T> callable)
callable
- the Callable object to be invoked on the event dispatch thread
public static <T> T invokeAndWait(java.util.concurrent.Callable<T> callable) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
callable
- the Callable object to be invoked on the event dispatch thread
java.lang.InterruptedException
java.lang.reflect.InvocationTargetException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |