Package boofcv.gui
Class BoofSwingUtil
- java.lang.Object
-
- boofcv.gui.BoofSwingUtil
-
public class BoofSwingUtil extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBoofSwingUtil.FileTypesstatic classBoofSwingUtil.RecentFiles
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKEY_PREVIOUS_DIRECTORYstatic java.lang.StringKEY_PREVIOUS_SELECTIONstatic java.lang.StringKEY_RECENT_FILESstatic doubleMAX_ZOOMstatic doubleMIN_ZOOM
-
Constructor Summary
Constructors Constructor Description BoofSwingUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddToRecentFiles(java.awt.Component parent, java.lang.String name, java.util.List<java.lang.String> filePaths)static voidaddToRecentFiles(java.lang.String preferenceName, java.lang.String name, java.util.List<java.lang.String> filePaths)static voidantialiasing(java.awt.Graphics2D g2)Sets rendering hints that will enable antialiasing and make sub pixel rendering look goodstatic javax.swing.JButtonbutton(java.lang.String name, java.awt.event.ActionListener action)static javax.swing.JCheckBoxcheckbox(java.lang.String name, boolean checked, java.awt.event.ActionListener action)static voidcheckGuiThread()static javax.swing.JButtoncreateButtonIcon(java.lang.String path, int width, int height, boolean opaque)static javax.swing.JButtoncreateButtonIconGUI(java.lang.String path, int width, int height)static javax.swing.JMenuItemcreateMenuItem(java.lang.String name, int mnmonic, int accelerator, boofcv.misc.BoofLambdas.Process action)static javax.swing.JMenuItemcreateMenuItem(java.lang.String name, boofcv.misc.BoofLambdas.Process action)static javax.swing.JFormattedTextFieldcreateTextField(double current, double min, double max)static javax.swing.JFormattedTextFieldcreateTextField(int current, int min, int max)static java.io.FiledirectoryUserHome()static java.io.FileensureSuffix(java.io.File f, java.lang.String suffix)static java.io.FilefileChooser(java.lang.String preferenceName, java.awt.Component parent, boolean openFile, java.lang.String defaultPath, BoofSwingUtil.FileTypes... filters)static java.io.FilefileChooserPreview(java.lang.String preferenceName, java.awt.Component parent, boolean openFile, java.lang.String defaultPath, BoofSwingUtil.FileTypes... filters)File chooser with a preview.static java.lang.StringgetDefaultPath(java.lang.Object parent, java.lang.String key)static java.util.List<BoofSwingUtil.RecentFiles>getListOfRecentFiles(java.awt.Component parent)static java.util.List<BoofSwingUtil.RecentFiles>getListOfRecentFiles(java.lang.String preferenceName)static javax.swing.JPanelgridPanel(int rows, int cols, int hgap, int vgap, java.awt.Component... children)static javax.swing.JPanelgridPanel(int cols, java.awt.Component... children)static voidinvokeNowOrLater(java.lang.Runnable r)static booleanisMiddleMouseButton(java.awt.event.MouseEvent e)static booleanisRightClick(java.awt.event.MouseEvent e)static doublemouseWheelImageZoom(double scale, java.awt.event.MouseWheelEvent e)static java.io.FileopenFileChooser(java.awt.Component parent, BoofSwingUtil.FileTypes... filters)static java.io.FileopenFileChooser(java.awt.Component parent, java.lang.String defaultPath, BoofSwingUtil.FileTypes... filters)static java.io.FileopenFileChooser(java.lang.String preferenceName, BoofSwingUtil.FileTypes... filters)Opens a file choose when there is no parent component.static java.io.FileopenFilePreview(java.awt.Component parent, BoofSwingUtil.FileTypes... filters)static java.io.FileopenFilePreview(java.lang.String preferenceName, BoofSwingUtil.FileTypes... filters)static java.lang.String[]openImageSetChooser(java.awt.Window parent, OpenImageSetDialog.Mode mode, int numberOfImages)static OpenStereoSequencesChooser.SelectedopenStereoChooser(java.awt.Window parent, boolean isSequence)static voidrecursiveEnable(javax.swing.JComponent panel, java.lang.Boolean isEnabled)static voidsaveDefaultPath(java.lang.Object parent, java.lang.String key, java.io.File file)static voidsaveDisparityDialog(javax.swing.JComponent owner, java.lang.String key, boofcv.struct.image.ImageGray d)Opens a dialog, asks the user where to save the disparity image, converts the image into a U16 format, saves it as a PNGstatic java.io.FilesaveFileChooser(java.awt.Component parent, BoofSwingUtil.FileTypes... filters)static voidsaveListSe3Dialog(java.awt.Component owner, java.lang.String key, boofcv.visualize.PointCloudViewer pcv)Opens a dialog, asks the user where to save the sequence of Se3static voidsavePointCloudDialog(java.awt.Component owner, java.lang.String key, boofcv.visualize.PointCloudViewer pcv)Opens a dialog, asks the user where to save the point cloud, then saves the point cloudstatic doubleselectZoomToFitInDisplay(int width, int height)Figures out what the scale should be to fit the window inside the default displaystatic doubleselectZoomToShowAll(javax.swing.JComponent panel, int width, int height)Select a zoom which will allow the entire image to be shown in the panelstatic voidsetMenuItemKeys(javax.swing.JMenuItem menu, int mnmonic, int accelerator)static voidwarningDialog(java.awt.Component component, java.lang.Exception e)
-
-
-
Field Detail
-
KEY_RECENT_FILES
public static final java.lang.String KEY_RECENT_FILES
- See Also:
- Constant Field Values
-
KEY_PREVIOUS_SELECTION
public static final java.lang.String KEY_PREVIOUS_SELECTION
- See Also:
- Constant Field Values
-
KEY_PREVIOUS_DIRECTORY
public static final java.lang.String KEY_PREVIOUS_DIRECTORY
- See Also:
- Constant Field Values
-
MIN_ZOOM
public static final double MIN_ZOOM
- See Also:
- Constant Field Values
-
MAX_ZOOM
public static final double MAX_ZOOM
- See Also:
- Constant Field Values
-
-
Method Detail
-
isRightClick
public static boolean isRightClick(java.awt.event.MouseEvent e)
-
isMiddleMouseButton
public static boolean isMiddleMouseButton(java.awt.event.MouseEvent e)
-
mouseWheelImageZoom
public static double mouseWheelImageZoom(double scale, java.awt.event.MouseWheelEvent e)
-
recursiveEnable
public static void recursiveEnable(javax.swing.JComponent panel, java.lang.Boolean isEnabled)
-
ensureSuffix
public static java.io.File ensureSuffix(java.io.File f, java.lang.String suffix)
-
saveFileChooser
public static java.io.File saveFileChooser(java.awt.Component parent, BoofSwingUtil.FileTypes... filters)
-
openImageSetChooser
public static java.lang.String[] openImageSetChooser(java.awt.Window parent, OpenImageSetDialog.Mode mode, int numberOfImages)
-
openStereoChooser
public static OpenStereoSequencesChooser.Selected openStereoChooser(java.awt.Window parent, boolean isSequence)
-
getDefaultPath
public static java.lang.String getDefaultPath(java.lang.Object parent, java.lang.String key)
-
saveDefaultPath
public static void saveDefaultPath(java.lang.Object parent, java.lang.String key, java.io.File file)
-
openFileChooser
public static java.io.File openFileChooser(java.lang.String preferenceName, BoofSwingUtil.FileTypes... filters)Opens a file choose when there is no parent component. Instead a string can be passed in so that the preference is specific to the application still
-
openFilePreview
public static java.io.File openFilePreview(java.lang.String preferenceName, BoofSwingUtil.FileTypes... filters)
-
openFileChooser
public static java.io.File openFileChooser(java.awt.Component parent, BoofSwingUtil.FileTypes... filters)
-
openFilePreview
public static java.io.File openFilePreview(java.awt.Component parent, BoofSwingUtil.FileTypes... filters)
-
openFileChooser
public static java.io.File openFileChooser(java.awt.Component parent, java.lang.String defaultPath, BoofSwingUtil.FileTypes... filters)
-
fileChooser
public static java.io.File fileChooser(java.lang.String preferenceName, java.awt.Component parent, boolean openFile, java.lang.String defaultPath, BoofSwingUtil.FileTypes... filters)
-
fileChooserPreview
public static java.io.File fileChooserPreview(java.lang.String preferenceName, java.awt.Component parent, boolean openFile, java.lang.String defaultPath, BoofSwingUtil.FileTypes... filters)File chooser with a preview. Work in progress for replacing the old file chooser
-
getListOfRecentFiles
public static java.util.List<BoofSwingUtil.RecentFiles> getListOfRecentFiles(java.awt.Component parent)
-
getListOfRecentFiles
public static java.util.List<BoofSwingUtil.RecentFiles> getListOfRecentFiles(java.lang.String preferenceName)
-
addToRecentFiles
public static void addToRecentFiles(java.awt.Component parent, java.lang.String name, java.util.List<java.lang.String> filePaths)
-
addToRecentFiles
public static void addToRecentFiles(java.lang.String preferenceName, java.lang.String name, java.util.List<java.lang.String> filePaths)
-
invokeNowOrLater
public static void invokeNowOrLater(java.lang.Runnable r)
-
checkGuiThread
public static void checkGuiThread()
-
selectZoomToShowAll
public 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
-
selectZoomToFitInDisplay
public static double selectZoomToFitInDisplay(int width, int height)Figures out what the scale should be to fit the window inside the default display
-
gridPanel
public static javax.swing.JPanel gridPanel(int cols, java.awt.Component... children)
-
gridPanel
public static javax.swing.JPanel gridPanel(int rows, int cols, int hgap, int vgap, java.awt.Component... children)
-
createTextField
public static javax.swing.JFormattedTextField createTextField(int current, int min, int max)
-
createTextField
public static javax.swing.JFormattedTextField createTextField(double current, double min, double max)
-
createMenuItem
public static javax.swing.JMenuItem createMenuItem(java.lang.String name, int mnmonic, int accelerator, boofcv.misc.BoofLambdas.Process action)
-
createMenuItem
public static javax.swing.JMenuItem createMenuItem(java.lang.String name, boofcv.misc.BoofLambdas.Process action)
-
setMenuItemKeys
public static void setMenuItemKeys(javax.swing.JMenuItem menu, int mnmonic, int accelerator)
-
warningDialog
public static void warningDialog(java.awt.Component component, java.lang.Exception e)
-
antialiasing
public static void antialiasing(java.awt.Graphics2D g2)
Sets rendering hints that will enable antialiasing and make sub pixel rendering look good- Parameters:
g2-
-
createButtonIconGUI
public static javax.swing.JButton createButtonIconGUI(java.lang.String path, int width, int height)
-
createButtonIcon
public static javax.swing.JButton createButtonIcon(java.lang.String path, int width, int height, boolean opaque)
-
button
public static javax.swing.JButton button(java.lang.String name, java.awt.event.ActionListener action)
-
checkbox
public static javax.swing.JCheckBox checkbox(java.lang.String name, boolean checked, java.awt.event.ActionListener action)
-
directoryUserHome
public static java.io.File directoryUserHome()
-
savePointCloudDialog
public static void savePointCloudDialog(java.awt.Component owner, java.lang.String key, boofcv.visualize.PointCloudViewer pcv)Opens a dialog, asks the user where to save the point cloud, then saves the point cloud
-
saveListSe3Dialog
public static void saveListSe3Dialog(java.awt.Component owner, java.lang.String key, boofcv.visualize.PointCloudViewer pcv)Opens a dialog, asks the user where to save the sequence of Se3
-
saveDisparityDialog
public static void saveDisparityDialog(javax.swing.JComponent owner, java.lang.String key, boofcv.struct.image.ImageGray d)Opens a dialog, asks the user where to save the disparity image, converts the image into a U16 format, saves it as a PNG
-
-