Class QuickUtils


  • public class QuickUtils
    extends Object
    A collection of functions for quickly creating plots and showing them in windows.

    The goal of this class is not to be polished, but to make it extremely easy to pop up a quick data plot. This can be useful during development -- e.g. to examine data for debugging purposes, or to plot timing results.

    In terms of design aesthetics, the core module might not be the ideal place for this class. However, keeping it in core allows it to be used without adding an extra dependency, which is a practically significant improvement in ease of use.

    Author:
    hogye
    • Constructor Detail

      • QuickUtils

        public QuickUtils()
    • Method Detail

      • initStandardGlimpseApp

        public static void initStandardGlimpseApp()
        Performs several init operations that are desirable for most Glimpse applications:

        This method is for convenience only. It is perfectly acceptable for an application to perform some or all of these init operations piecemeal, instead of calling this method.

        NOTE: This method should be called near the beginning of main, after the Swing LookAndFeel has been set, but before any UI components get created.

      • checkGlimpseModuleAccess

        public static void checkGlimpseModuleAccess()
      • requireSwingThread

        public static void requireSwingThread()
      • glProfileOrNull

        public static com.jogamp.opengl.GLProfile glProfileOrNull​(String glProfileName)
      • showGLWarningDialog

        public static boolean showGLWarningDialog​(String progName)
      • quickXyPlot

        public static MultiAxisPlot2D quickXyPlot​(GlimpsePainter... painters)
        Creates a MultiAxisPlot2D layout with contents that are desirable for most XY plots:
        • X and Y axes
        • GridPainter
        • CrosshairPainter (with selection box disabled)
        • BorderPainter.

        This method is for convenience only. It is perfectly acceptable for an application to perform some or all of these init operations piecemeal, instead of calling this method.

      • quickDefaultSize

        public static Dimension quickDefaultSize()
      • quickGlimpseApp

        public static JFrame quickGlimpseApp​(String appName,
                                             String glProfileName,
                                             GlimpseLayout layout,
                                             Dimension size,
                                             LookAndFeel laf)
        Similar to #quickGlimpseWindow(String, String, double, GlimpseLayout), but with behavior suitable for a single-window application. In particular, starts by calling initStandardGlimpseApp(), and warns the user if the named GLProfile is not available.

        This method is for convenience only. It is perfectly acceptable for an application to perform some or all of these init operations piecemeal, instead of calling this method.

        NOTE: If the named GLProfile is not available, and the user chooses to quit rather than continue, this method calls System.exit(int)!

      • initGlimpseOrExitJvm

        public static com.jogamp.opengl.GLProfile initGlimpseOrExitJvm​(String appName,
                                                                       String glProfileName)
        Does several things that are typically done at application startup:
        1. Calls initStandardGlimpseApp()
        2. Warns the user if the named GLProfile is not available
        3. If the user chooses to continue anyway, returns null
        4. If the user chooses NOT to continue, calls System.exit(int)