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