Package eu.bandm.tools.graficUtils
Class SwingTools
java.lang.Object
eu.bandm.tools.graficUtils.SwingTools
Collection of small static utility functions.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
SwingTools.EnumComboBox<E extends Enum<E>>
static class
static class
static class
Distributes tool tip text to all sub-components. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
appendFileToTextArea
(File file, JTextArea ta) static <D extends Message>
booleanask
(JFrame frame, @Opt String windowtitle, int messageType, MessageStore<D> text, String cancelbutton, String okbutton) static boolean
ask
(JFrame frame, @Opt String windowtitle, int messageType, Object[] text, String cancelbutton, String okbutton) static int
loadPngsToButtons
(JPanel container, File directory, String fileStem, int numStart, String numberFormat) Load one or more ".png" files to JButtons and append them to the end of the container.static <C extends Container>
CnearestContainer
(@Opt Component c, Class<C> cl) static void
static <D extends Message>
voidshow
(JFrame frame, @Opt String windowtitle, int messageType, MessageStore<D> text, String buttonText) static void
ATTENTION: when calling "showXXDialog()", the conversion to "Object[]" must be done explicitly, because only then "vertical stacking" is applied to the results of "toString()" separately!
-
Method Details
-
setMaximumToPreferred
-
nearestContainer
-
show
-
show
public static void show(JFrame frame, @Opt @Opt String windowtitle, int messageType, Object[] text, String buttonText) ATTENTION: when calling "showXXDialog()", the conversion to "Object[]" must be done explicitly, because only then "vertical stacking" is applied to the results of "toString()" separately! -
ask
-
ask
-
appendFileToTextArea
- Throws:
IOException
-
loadPngsToButtons
public static int loadPngsToButtons(JPanel container, File directory, String fileStem, int numStart, String numberFormat) Load one or more ".png" files to JButtons and append them to the end of the container. In case of lilypond use "-page%d" as the numberFormat.- Returns:
- -1 if ONE page without numeric extension has been loaded; otherwise the first number which could NOT be loaded (e.g. "3" if pages "1" and "2" have been successfully loaded)
-