|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.util.ToolUtil
public class ToolUtil
Contains some static classes and methods used by our various (Swing-based) tool applications.
| Nested Class Summary | |
|---|---|
static class |
ToolUtil.EditablePrefs
A simple editable object used to manipulate preferences. |
static class |
ToolUtil.WrappedTransfer
A Transferable available in two flavors: one for use within a single VM and one that
uses binary export/import to exchange data between different VMs. |
| Field Summary | |
|---|---|
static DataFlavor |
LOCAL_WRAPPED_FLAVOR
A data flavor for referenced local wrapped objects (on this VM). |
static DataFlavor |
SERIALIZED_WRAPPED_FLAVOR
A data flavor for serialized wrapped objects (from another VM). |
static DataFlavor[] |
WRAPPED_FLAVORS
The flavors for local and serialized wrapped objects. |
| Constructor Summary | |
|---|---|
ToolUtil()
|
|
| Method Summary | |
|---|---|
static void |
configureLog(String logfile)
Unless directed otherwise by a system property, redirects console output to the named log file. |
static Action |
createAction(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String command,
int mnemonic,
int accelerator)
Creates an action with the specified command, mnemonic, and (optional) accelerator. |
static Action |
createAction(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String command,
int mnemonic,
int accelerator,
int modifiers)
Creates an action with the specified command, mnemonic, and (optional) accelerator key/modifiers. |
static JButton |
createButton(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action)
Creates a button with the specified action. |
static JButton |
createButton(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
String key)
Creates a button with the specified action and translation key. |
static JCheckBoxMenuItem |
createCheckBoxMenuItem(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
int mnemonic,
int accelerator)
Creates a check box menu item with the specified action, mnemonic, and (optional) accelerator. |
static JCheckBoxMenuItem |
createCheckBoxMenuItem(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
int mnemonic,
int accelerator,
int modifiers)
Creates a check box menu item with the specified action, mnemonic, and (optional) accelerator key/modifiers. |
static DataFlavor |
createLocalFlavor(Class<?> clazz)
Creates a data flavor for transferring local references to objects of the specified class. |
static JMenu |
createMenu(com.threerings.util.MessageBundle msgs,
String name,
int mnemonic)
Creates a menu with the specified name and mnemonic. |
static JMenuItem |
createMenuItem(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
int mnemonic,
int accelerator)
Creates a menu item with the specified action, mnemonic, and (optional) accelerator. |
static JMenuItem |
createMenuItem(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
int mnemonic,
int accelerator,
int modifiers)
Creates a menu item with the specified action, mnemonic, and (optional) accelerator key/modifiers. |
static Object |
getWrappedTransferData(Transferable t)
Returns the wrapped transfer data from the supplied transferable, or null if
the wrapped flavors are not supported (or an exception occurs). |
static void |
windowAdded()
Notes that a window has been added. |
static void |
windowRemoved()
Notes that a window has been removed. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final DataFlavor LOCAL_WRAPPED_FLAVOR
public static final DataFlavor SERIALIZED_WRAPPED_FLAVOR
public static final DataFlavor[] WRAPPED_FLAVORS
| Constructor Detail |
|---|
public ToolUtil()
| Method Detail |
|---|
public static DataFlavor createLocalFlavor(Class<?> clazz)
public static Object getWrappedTransferData(Transferable t)
null if
the wrapped flavors are not supported (or an exception occurs).
public static void configureLog(String logfile)
public static JMenu createMenu(com.threerings.util.MessageBundle msgs,
String name,
int mnemonic)
public static JMenuItem createMenuItem(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
int mnemonic,
int accelerator)
public static JMenuItem createMenuItem(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
int mnemonic,
int accelerator,
int modifiers)
public static JCheckBoxMenuItem createCheckBoxMenuItem(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
int mnemonic,
int accelerator)
public static JCheckBoxMenuItem createCheckBoxMenuItem(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
int mnemonic,
int accelerator,
int modifiers)
public static Action createAction(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String command,
int mnemonic,
int accelerator)
public static Action createAction(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String command,
int mnemonic,
int accelerator,
int modifiers)
public static JButton createButton(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action)
public static JButton createButton(ActionListener listener,
com.threerings.util.MessageBundle msgs,
String action,
String key)
public static void windowAdded()
windowRemoved().
public static void windowRemoved()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||