Class SwingUtil
java.lang.Object
org.locationtech.jtstest.testbuilder.ui.SwingUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic FileFilter
static FileFilter
static FileFilter
static FileFilter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
chooseFilenameWithConfirm
(Component comp, JFileChooser fileChooser) static Object
static boolean
confirmOverwrite
(Component comp, File file) static Double
convertDouble
(String str) static Integer
convertInteger
(String str) static void
copyToClipboard
(Object o, boolean isFormatted) static JButton
createButton
(String title, String tip, ActionListener action) static JButton
createButton
(String title, ImageIcon icon, String tip, ActionListener action) static JButton
createButton
(String title, ImageIcon icon, String tip, ActionListener action, boolean isFocusable) static JButton
createButton
(ImageIcon icon, String tip, ActionListener action) static FileFilter
createFileFilter
(String description, String extension) Example usage:static Transferable
getContents
(Clipboard clipboard) static Double
getDouble
(JTextField txt, Double defaultVal) static Object
static Integer
getInteger
(JTextField txt, Integer defaultVal) static boolean
static boolean
static void
static void
setAntiAlias
(Graphics2D g, boolean isOn) static void
setEnabledWithBackground
(Component comp, boolean isEnabled) static void
showTab
(JTabbedPane tabPane, String tabName) static Object
static String
value
(JTextComponent txt)
-
Field Details
-
XML_FILE_FILTER
-
HTML_FILE_FILTER
-
JAVA_FILE_FILTER
-
PNG_FILE_FILTER
-
-
Constructor Details
-
SwingUtil
public SwingUtil()
-
-
Method Details
-
createFileFilter
Example usage:SwingUtil.createFileFilter("JEQL script (*.jql)", "jql")
- Parameters:
description
-extension
-- Returns:
- the file filter
-
chooseFilenameWithConfirm
- Parameters:
comp
-fileChooser
-- Returns:
- filename chosen, or null if choose was cancelled for some reason
-
confirmOverwrite
-
setEnabledWithBackground
-
coerce
-
convertInteger
-
convertDouble
-
getInteger
-
getDouble
-
value
-
value
-
copyToClipboard
-
getFromClipboard
-
getContents
-
reportException
-
createButton
-
createButton
-
createButton
-
createButton
public static JButton createButton(String title, ImageIcon icon, String tip, ActionListener action, boolean isFocusable) -
isCtlKeyPressed
-
isShiftKeyPressed
-
showTab
-
setAntiAlias
-