Modifier | Constructor and Description |
---|---|
private |
GuiHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
executeByMainWorkerInEDT(Runnable task) |
static Stroke |
getCustomizedStroke(String code)
Return s new BasicStroke object with given thickness and style
|
static ImageIcon |
getDisabledIcon(ImageIcon icon)
Replies the disabled (grayed) version of the specified icon.
|
static Image |
getDisabledImage(Image image)
Replies the disabled (grayed) version of the specified image.
|
static Font |
getTitleFont()
Gets the font used to display JOSM title in about dialog and splash screen.
|
static Component |
prepareResizeableOptionPane(Component pane,
Dimension minDimension)
Attaches a
HierarchyListener to the specified Component that
will set its parent dialog resizeable. |
static void |
runInEDT(Runnable task) |
static void |
runInEDTAndWait(Runnable task) |
static Timer |
scheduleTimer(int initialDelay,
ActionListener actionListener,
boolean repeats)
Schedules a new Timer to be run in the future (once or several times).
|
static void |
setEnabledRec(Container root,
boolean enabled)
disable / enable a component and all its child components
|
static boolean |
warnUser(String title,
String content,
ImageIcon baseActionIcon,
String continueToolTip)
returns true if the user wants to cancel, false if they
want to continue
|
private GuiHelper()
public static void setEnabledRec(Container root, boolean enabled)
public static void executeByMainWorkerInEDT(Runnable task)
public static void runInEDTAndWait(Runnable task)
public static final boolean warnUser(String title, String content, ImageIcon baseActionIcon, String continueToolTip)
public static final Image getDisabledImage(Image image)
image
- The image to disablepublic static final ImageIcon getDisabledIcon(ImageIcon icon)
icon
- The icon to disablepublic static final Component prepareResizeableOptionPane(Component pane, Dimension minDimension)
HierarchyListener
to the specified Component
that
will set its parent dialog resizeable. Use it before a call to JOptionPane#showXXXXDialog
to make it resizeable.pane
- The component that will be displayedminDimension
- The minimum dimension that will be set for the dialog. Ignored if nullpane
public static final Timer scheduleTimer(int initialDelay, ActionListener actionListener, boolean repeats)
initialDelay
- milliseconds for the initial and between-event delay if repeatableactionListener
- an initial listener; can be nullrepeats
- specify false to make the timer stop after sending its first action eventpublic static Stroke getCustomizedStroke(String code)
code
- = 3.5 -> thickness=3.5px; 3.5 10 5 -> thickness=3.5px, dashed: 10px filled + 5px emptypublic static Font getTitleFont()