Documentation of 'kcl.waterloo.actions.ActionServices' Java class
ActionServices
kcl.waterloo.actions

Class ActionServices



  • public class ActionServices
    extends java.lang.Object
    This class provides static methods for commmon menu and button actions used in various Waterloo project packages. These methods are intended primarily for use within Waterloo code - but may also be useful in user-developed menus/GUIs.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void copy(GJBasicPanel panel)
      Copies the graphics of a GJBasicPanel or subclass to the clipboard.
      static void copyAsImage(GJBasicPanel panel)
      Copies the graphics of a GJBasicPanel or subclass to the clipboard in bitmap format only.
      static javax.swing.SwingWorker<java.lang.Boolean,java.lang.Void> copyGraphics(GJBasicPanel panel)
      Copies the graphics of a GJBasicPanel or subclass to the clipboard in the background.
      static void deployAs(java.awt.Component c2) 
      static void deployAs(java.awt.Component parent, java.awt.Component c2) 
      static void editDefaults() 
      static java.awt.Component getCopyOrSaveTarget(java.awt.Component c) 
      static java.lang.String getExtension(java.lang.String s) 
      static boolean isExportFactoryPresent() 
      static boolean isUseChooser() 
      static FileWrapper open() 
      static FileWrapper open(java.awt.Component parent)
      Displays a file open dialog, loads the selected Waterloo graphics XML file and returns the details in a FileWrapper instance.
      static FileWrapper save(java.awt.Component parent, java.lang.Object o)
      Displays a file chooser and saves the specified Object to file by calling the GJEncoder save method.
      static FileWrapper save(java.lang.Object o) 
      static void saveAs(java.awt.Component c) 
      static void saveAs(java.awt.Component parent, java.awt.Component c)
      Displays a file save dialog and saves a Component in the selected format.
      static void setUseChooser(boolean aUseChooser) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isUseChooser

        public static boolean isUseChooser()
        Returns:
        the useChooser flag
      • setUseChooser

        public static void setUseChooser(boolean aUseChooser)
        Parameters:
        aUseChooser - if true, file dialogs will use the cross-platform JFileChooser. If false, a FileDialog will be used.
      • open

        public static FileWrapper open(java.awt.Component parent)
        Displays a file open dialog, loads the selected Waterloo graphics XML file and returns the details in a FileWrapper instance. If the file contains multiple objects, the contents will be an ArrayList of objects.
        Parameters:
        parent - the component whose parent Frame (if any) will be used
        Returns:
        the de-serialized file contents
      • save

        public static FileWrapper save(java.lang.Object o)
      • save

        public static FileWrapper save(java.awt.Component parent,
                                       java.lang.Object o)
        Displays a file chooser and saves the specified Object to file by calling the GJEncoder save method.
        Parameters:
        parent -
        o - Object recognizable by GJDecoder
        Returns:
        a FileWrapper
      • deployAs

        public static void deployAs(java.awt.Component c2)
      • deployAs

        public static void deployAs(java.awt.Component parent,
                                    java.awt.Component c2)
      • saveAs

        public static void saveAs(java.awt.Component c)
      • saveAs

        public static void saveAs(java.awt.Component parent,
                                  java.awt.Component c)
        Displays a file save dialog and saves a Component in the selected format.
        Parameters:
        parent -
        c - an AWT component
      • copy

        public static void copy(GJBasicPanel panel)
        Copies the graphics of a GJBasicPanel or subclass to the clipboard.
        Parameters:
        panel - a GJBasicPanel
      • copyGraphics

        public static javax.swing.SwingWorker<java.lang.Boolean,java.lang.Void> copyGraphics(GJBasicPanel panel)
        Copies the graphics of a GJBasicPanel or subclass to the clipboard in the background. Returns the associated SwingWorker.
        Parameters:
        panel - a GJBasicPanel
        Returns:
        the SwingWorker for the task
      • copyAsImage

        public static void copyAsImage(GJBasicPanel panel)
        Copies the graphics of a GJBasicPanel or subclass to the clipboard in bitmap format only.
        Parameters:
        panel - a GJBasicPanel
      • getCopyOrSaveTarget

        public static java.awt.Component getCopyOrSaveTarget(java.awt.Component c)
      • editDefaults

        public static void editDefaults()
      • isExportFactoryPresent

        public static boolean isExportFactoryPresent()
        Returns:
        the Singleton.exportFactoryPresent
      • getExtension

        public static java.lang.String getExtension(java.lang.String s)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.