Package rma.util

Class RMAUtil

java.lang.Object
rma.util.RMAUtil

public class RMAUtil extends Object
General Utilities Class
  • Field Details

    • CURRENT_DIRECTORY

      public static String CURRENT_DIRECTORY
  • Constructor Details

    • RMAUtil

      public RMAUtil()
  • Method Details

    • colorChooser

      public static Color colorChooser(Component parent, Color defaultColor)
    • colorChooser

      public static Color colorChooser(Component parent, Color defaultColor, String chooserTitle)
      Returns a Color chosen from the Color Chooser Dialog. Accepts a parent Frame and a default Color.
    • fileOpen

      public static File fileOpen(Frame parent, String title, String startPath, String startFile)
    • fileSave

      public static File fileSave(Frame parent, String title, String startPath, String startFile)
    • showAbout

      public static void showAbout(Frame parent, String title, String about, ImageIcon image)
    • showHelp

      public static void showHelp(Frame parent, String title, String url)
    • substringMatch

      public static boolean substringMatch(Object data, Object matchTo)
      Returns true if data.toString() starts with startWith.toString()
    • setParentModified

      public static void setParentModified(Component comp)
      when a Modifiable component get modified, set its nearest Modifiable parent to modified
    • isChildrenModified

      public static boolean isChildrenModified(Container comp)
      Return true if a child of comp is an instance of rma.lang.Modifiable and isModified() is true.
      Parameters:
      comp -
      Returns:
    • setChildrenUnmodified

      public static void setChildrenUnmodified(Container comp)
    • findButtonFromText

      public static AbstractButton findButtonFromText(Class buttonClass, String buttonText, Container container)
      find the button of buttonClass with text buttonText in the Container container or containers that container holds
    • getHwnd

      public static int getHwnd(Window win)
      Retrieves the Win32 window handle for the specified window.
      Type Parameters:
      CODE - win the window, either a Frame or Dialog, whose Win32 window handle to retrieve
      Returns:
      an int representing the Win32 window handle for the specified window title or -1 on error or not on Windows
    • setWindowAlwaysOnTop

      public static void setWindowAlwaysOnTop(Window win, boolean flag)
      Sets the specified window as the topmost window in the z-order.
      Type Parameters:
      CODE - win the window's
      CODE - flag a boolean parameter that specifies whether the window will be the topmost window in the z-order. true sets the window as the topmost window in the z-order, false sets the window behind all topmost windows.
      See Also:
      • getHwnd(java.lang.String)
    • setWindowMinimized

      public static void setWindowMinimized(Window win)
    • setWindowMaximized

      public static void setWindowMaximized(Window win)
    • getFontString

      public static String getFontString(Font f)
      return a string that Font can use in getFont() of the form [family]-[style]-[size]
    • getWindow

      public static Window getWindow(JMenuItem menuItem)
      return the window from which menuItem was launched
    • getComponentByAction

      public static Component getComponentByAction(Container container, Class actionClass)
      find a component inside container that has an action of class actionClass
    • getComponentByObject

      public static RmaJObjectCheckBoxMenuItem getComponentByObject(Container container, RmaJObjectCheckBoxMenuItem item)
      find an RmaJObjectCheckBoxMenuItem inside container that holds the same Object as item