|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.core.node.util.ViewUtils
public final class ViewUtils
Provides helper methods mostly useful when implementing NodeViews.
| Method Summary | |
|---|---|
static JPanel |
getInFlowLayout(int alignment,
int hgap,
int vgap,
JComponent... components)
Constructs a new FlowLayout panel and adds the argument component(s) to it. |
static JPanel |
getInFlowLayout(int alignment,
JComponent... components)
Constructs a new FlowLayout panel and adds the argument component(s) to it. |
static JPanel |
getInFlowLayout(JComponent... components)
Constructs a new FlowLayout panel and adds the argument component(s) to it. |
static void |
invokeAndWaitInEDT(Runnable runMe)
Executes the specified runnable in the Swing Event Dispatch Thread. |
static Icon |
loadIcon(Class<?> className,
String path)
Convenience method to load an icon from package relative path. |
static void |
runOrInvokeLaterInEDT(Runnable runMe)
Executes the specified runnable some time in the Swing Event Dispatch Thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void invokeAndWaitInEDT(Runnable runMe)
throws InvocationTargetRuntimeException
run method of the runnable, otherwise it passes the runnable
to the EDT and waits until its run method returns.
runMe - the run method of this will be executed.
InvocationTargetRuntimeException - if the executed code throws an
exception (the cause of it is set to the exception thrown by
the executed code then), or if the execution was interrupted
in the EDT.SwingUtilities.invokeAndWait(Runnable)public static void runOrInvokeLaterInEDT(Runnable runMe)
run method and does not return until it
finishes. Otherwise it queues the argument for execution in the EDT and
returns (not waiting for the run method to finish).
runMe - the run method of this will be executed.SwingUtilities.invokeLater(Runnable)public static JPanel getInFlowLayout(JComponent... components)
components - The components to add
public static JPanel getInFlowLayout(int alignment,
JComponent... components)
alignment - The flow panel alignmentcomponents - The components to add
public static JPanel getInFlowLayout(int alignment,
int hgap,
int vgap,
JComponent... components)
alignment - The flow panel alignmenthgap - the horizontal gap between components
and between the components and the
borders of the Containervgap - the vertical gap between components
and between the components and the
borders of the Containercomponents - The components to add
public static Icon loadIcon(Class<?> className,
String path)
path. This method will
not throw an exception when the loading fails but instead return a
null icon.
className - The class object, from which to retrieve the
package, e.g. FooValue.class.path - The icon path relative to package associated with the
class argument.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||