public class BoofSwingUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BoofSwingUtil.FileTypes |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
KEY_PREVIOUS_SELECTION |
static java.lang.String |
KEY_RECENT_FILES |
static double |
MAX_ZOOM |
static double |
MIN_ZOOM |
| Constructor and Description |
|---|
BoofSwingUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addToRecentFiles(java.awt.Component parent,
java.lang.String filePath) |
static void |
antialiasing(java.awt.Graphics2D g2)
Sets rendering hints that will enable antialiasing and make sub pixel rendering look good
|
static javax.swing.JButton |
button(java.lang.String name,
java.awt.event.ActionListener action) |
static javax.swing.JCheckBox |
checkbox(java.lang.String name,
boolean checked,
java.awt.event.ActionListener action) |
static void |
checkGuiThread() |
static javax.swing.JButton |
createButtonIcon(java.lang.String path,
int width,
int height,
boolean opaque) |
static javax.swing.JButton |
createButtonIconGUI(java.lang.String path,
int width,
int height) |
static javax.swing.JFormattedTextField |
createTextField(double current,
double min,
double max) |
static javax.swing.JFormattedTextField |
createTextField(int current,
int min,
int max) |
static java.io.File |
directoryUserHome() |
static java.io.File |
fileChooser(java.awt.Component parent,
boolean openFile,
java.lang.String defaultPath,
BoofSwingUtil.FileTypes... filters) |
static java.util.List<java.lang.String> |
getListOfRecentFiles(java.awt.Component parent) |
static void |
invokeNowOrLater(java.lang.Runnable r) |
static boolean |
isImage(java.io.File file)
Uses mime type to determine if it's an image or not
|
static boolean |
isRightClick(java.awt.event.MouseEvent e) |
static java.io.File |
openFileChooser(java.awt.Component parent,
BoofSwingUtil.FileTypes... filters) |
static java.io.File |
openFileChooser(java.awt.Component parent,
java.lang.String defaultPath,
BoofSwingUtil.FileTypes... filters) |
static java.lang.String[] |
openImageSetChooser(java.awt.Window parent,
OpenImageSetDialog.Mode mode,
int numberOfImages) |
static java.io.File |
saveFileChooser(java.awt.Component parent,
BoofSwingUtil.FileTypes... filters) |
static double |
selectZoomToFitInDisplay(int width,
int height)
Figures out what the scale should be to fit the window inside the default display
|
static double |
selectZoomToShowAll(javax.swing.JComponent panel,
int width,
int height)
Select a zoom which will allow the entire image to be shown in the panel
|
static void |
setMenuItemKeys(javax.swing.JMenuItem menu,
int mnmonic,
int accelerator) |
static void |
warningDialog(java.awt.Component component,
java.lang.Exception e) |
public static final java.lang.String KEY_RECENT_FILES
public static final java.lang.String KEY_PREVIOUS_SELECTION
public static final double MIN_ZOOM
public static final double MAX_ZOOM
public static boolean isRightClick(java.awt.event.MouseEvent e)
public static java.io.File saveFileChooser(java.awt.Component parent,
BoofSwingUtil.FileTypes... filters)
public static java.lang.String[] openImageSetChooser(java.awt.Window parent,
OpenImageSetDialog.Mode mode,
int numberOfImages)
public static java.io.File openFileChooser(java.awt.Component parent,
BoofSwingUtil.FileTypes... filters)
public static java.io.File openFileChooser(java.awt.Component parent,
java.lang.String defaultPath,
BoofSwingUtil.FileTypes... filters)
public static java.io.File fileChooser(java.awt.Component parent,
boolean openFile,
java.lang.String defaultPath,
BoofSwingUtil.FileTypes... filters)
public static java.util.List<java.lang.String> getListOfRecentFiles(java.awt.Component parent)
public static void addToRecentFiles(java.awt.Component parent,
java.lang.String filePath)
public static void invokeNowOrLater(java.lang.Runnable r)
public static void checkGuiThread()
public static double selectZoomToShowAll(javax.swing.JComponent panel,
int width,
int height)
public static double selectZoomToFitInDisplay(int width,
int height)
public static javax.swing.JFormattedTextField createTextField(int current,
int min,
int max)
public static javax.swing.JFormattedTextField createTextField(double current,
double min,
double max)
public static void setMenuItemKeys(javax.swing.JMenuItem menu,
int mnmonic,
int accelerator)
public static void warningDialog(java.awt.Component component,
java.lang.Exception e)
public static void antialiasing(java.awt.Graphics2D g2)
g2 - public static javax.swing.JButton createButtonIconGUI(java.lang.String path,
int width,
int height)
public static javax.swing.JButton createButtonIcon(java.lang.String path,
int width,
int height,
boolean opaque)
public static boolean isImage(java.io.File file)
public static javax.swing.JButton button(java.lang.String name,
java.awt.event.ActionListener action)
public static javax.swing.JCheckBox checkbox(java.lang.String name,
boolean checked,
java.awt.event.ActionListener action)
public static java.io.File directoryUserHome()