Class Commands


  • public class Commands
    extends java.lang.Object
    Standard command actions supported by Strange Eons.
    Since:
    3.0
    Author:
    Chris Jennings
    • Field Detail

      • NEW_GAME_COMPONENT

        public static final AbstractCommand NEW_GAME_COMPONENT
        Displays a dialog that allows the user to create a new game component.
      • NEW_PROJECT

        public static final AbstractCommand NEW_PROJECT
        Displays a dialog that allows the user to create a new project.
      • OPEN

        public static final AbstractCommand OPEN
        Displays a dialog that allows the user to open game components.
      • OPEN_PROJECT

        public static final AbstractCommand OPEN_PROJECT
        Displays a dialog that allows the user to open a project.
      • CLOSE

        public static final AbstractCommand CLOSE
        Closes the active editor. If the editor has unsaved changes, the user will be given the option to save the file or cancel the command.
      • CLOSE_ALL

        public static final AbstractCommand CLOSE_ALL
        Closes all open editors. If any editor has unsaved changes, the user will be given the option to save the file or cancel the command.
      • CLOSE_PROJECT

        public static final AbstractCommand CLOSE_PROJECT
        Closes the open project, if any.
      • SAVE

        public static final DelegatedCommand SAVE
        Saves the current document in editors that support this command.
      • SAVE_AS

        public static final DelegatedCommand SAVE_AS
        Saves the current document under a new name in editors that support this command.
      • SAVE_ALL

        public static final AbstractCommand SAVE_ALL
        Saves every open editor that supports the SAVE command and has unsaved changes.
      • EXPORT

        public static final DelegatedCommand EXPORT
        Exports content from editors that support this command.
      • PRINT

        public static final DelegatedCommand PRINT
        Prints content from editors that support this command.
      • EXIT

        public static final AbstractCommand EXIT
        Exits the application after giving the user a chance to save open files with unsaved changes.
      • SPIN_OFF

        public static final DelegatedCommand SPIN_OFF
        Adds a clone of the current document to the application.
      • CLEAR

        public static final DelegatedCommand CLEAR
        Clears all content from editors that support this command.
      • CUT

        public static final DelegatedCommand CUT
        A DelegatedCommand for the clipboard cut operation. The default action will attempt to perform a cut in the active component, or your editor can handle the command itself.
      • COPY

        public static final DelegatedCommand COPY
        A DelegatedCommand for the clipboard copy operation. The default action will attempt to perform a copy in the active component, or your editor can handle the command itself.
      • PASTE

        public static final DelegatedCommand PASTE
        A DelegatedCommand for the clipboard paste operation. The default action will attempt to perform a paste in the active component, or your editor can handle the command itself.
      • SELECT_ALL

        public static final DelegatedCommand SELECT_ALL
        A DelegatedCommand for selecting all content in a component that supports selection. The default action will attempt to perform a select all in the active component, (such as a text field or a list that supports multiple selection) or your editor can handle the command itself.
      • FIND

        public static final DelegatedCommand FIND
        Activates a search tool in an editor that supports this command.
      • FIND_IN_PROJECT

        public static final AbstractCommand FIND_IN_PROJECT
        Activates the find in project field, making it visible if necessary.
      • VIEW_INK_SAVER

        public static final AbstractToggleCommand VIEW_INK_SAVER
        Enables and disables Ink Saver mode.
      • VIEW_CONTEXT_BAR

        public static final AbstractToggleCommand VIEW_CONTEXT_BAR
        Toggles visibility of the context bar.
      • VIEW_DECK_HANDLES

        public static final AbstractToggleCommand VIEW_DECK_HANDLES
        Toggles visibility of drag handles in decks.
      • VIEW_DECK_GRID

        public static final AbstractToggleCommand VIEW_DECK_GRID
        Toggles visibility of snapping grid in decks.
      • VIEW_DECK_MARGIN

        public static final AbstractToggleCommand VIEW_DECK_MARGIN
        Toggles visibility of page margins in decks.
      • VIEW_SOURCE_NAVIGATOR

        public static final AbstractToggleCommand VIEW_SOURCE_NAVIGATOR
        Toggles visibility of the source code navigator.
      • VIEW_REGION_BOXES

        public static final AbstractToggleCommand VIEW_REGION_BOXES
        Toggles visibility of region boxes on game component previews, which helps when debugging component layouts.
      • VIEW_PORTRAIT_BOXES

        public static final AbstractToggleCommand VIEW_PORTRAIT_BOXES
        Toggles visibility of region boxes on game component previews, which helps when debugging component layouts.
      • VIEW_UNSAFE_BOXES

        public static final AbstractToggleCommand VIEW_UNSAFE_BOXES
        Toggles visibility of bleed margin box on game component previews, which helps when debugging component layouts.
      • VIEW_EDGE_BOXES

        public static final AbstractToggleCommand VIEW_EDGE_BOXES
        Toggles visibility of card outline on game component previews, which helps when debugging component layouts.
      • EXPANSION_NEW

        public static final DelegatedCommand EXPANSION_NEW
        Creates a new expansion symbol.
      • EXPANSION_COPY

        public static final DelegatedCommand EXPANSION_COPY
        Copies the expansion symbol on the current component.
      • EXPANSION_PASTE

        public static final DelegatedCommand EXPANSION_PASTE
        Pastes the last-copies expansion symbol onto the current component.
      • MARKUP_ALIGNMENT

        public static final DelegatedCommand MARKUP_ALIGNMENT
        Opens a dialog that allows the user to modify the paragraph attributes of a block of markup text.
      • MARKUP_INSERT_COLOUR

        public static final DelegatedCommand MARKUP_INSERT_COLOUR
        Opens a dialog that allows the user to modify the paragraph attributes of a block of markup text.
      • MARKUP_INSERT_FONT

        public static final DelegatedCommand MARKUP_INSERT_FONT
        Opens a dialog that allows the user to modify the font attributes of a block of markup text.
      • MARKUP_BOLD

        public static final DelegatedCommand MARKUP_BOLD
        Inserts or removes bold tags around the selected text.
      • MARKUP_ITALIC

        public static final DelegatedCommand MARKUP_ITALIC
        Inserts or removes italic tags around the selected text.
      • MARKUP_UNDERLINE

        public static final DelegatedCommand MARKUP_UNDERLINE
        Inserts or removes underline tags around the selected text.
      • MARKUP_STRIKETHROUGH

        public static final DelegatedCommand MARKUP_STRIKETHROUGH
        Inserts or removes strikethrough tags around the selected text.
      • MARKUP_SUPERSCRIPT

        public static final DelegatedCommand MARKUP_SUPERSCRIPT
        Inserts or removes superscript tags around the selected text.
      • MARKUP_SUBSCRIPT

        public static final DelegatedCommand MARKUP_SUBSCRIPT
        Inserts or removes subscript tags around the selected text.
      • MARKUP_HEADING

        public static final DelegatedCommand MARKUP_HEADING
        Inserts or removes heading tags around the selected text.
      • MARKUP_SUBHEADING

        public static final DelegatedCommand MARKUP_SUBHEADING
        Inserts or removes subheading tags around the selected text.
      • MARKUP_INSERT_IMAGE

        public static final DelegatedCommand MARKUP_INSERT_IMAGE
        Opens a dialog that allows the user to select an image, a tag for which will be inserted into the markup target.
      • MARKUP_INSERT_CHARACTERS

        public static final DelegatedCommand MARKUP_INSERT_CHARACTERS
        Opens a dialog that allows the user to select an symbol or character to be inserted into the markup target.
      • MARKUP_ABBREVIATIONS

        public static final AbstractCommand MARKUP_ABBREVIATIONS
        Displays the markup abbreviation table editor.
      • TO_FRONT

        public static final DelegatedCommand TO_FRONT
        Moves the selected objects in front of other objects in a deck.
      • TO_BACK

        public static final DelegatedCommand TO_BACK
        Moves the selected objects behind other objects in a deck.
      • GROUP

        public static final DelegatedCommand GROUP
        Groups together the selected objects.
      • UNGROUP

        public static final DelegatedCommand UNGROUP
        Breaks up the selected group into separate objects.
      • ALIGN_LEFT

        public static final DelegatedCommand ALIGN_LEFT
        Aligns the selected objects to the left edge of the most recently selected object.
      • ALIGN_CENTER

        public static final DelegatedCommand ALIGN_CENTER
        Aligns the selected objects to the horizontal centre of the most recently selected object.
      • ALIGN_RIGHT

        public static final DelegatedCommand ALIGN_RIGHT
        Aligns the selected objects to the right edge of the most recently selected object.
      • ALIGN_TOP

        public static final DelegatedCommand ALIGN_TOP
        Aligns the selected objects to the top edge of the most recently selected object.
      • ALIGN_MIDDLE

        public static final DelegatedCommand ALIGN_MIDDLE
        Aligns the selected objects to the vertical middle of the most recently selected object.
      • ALIGN_BOTTOM

        public static final DelegatedCommand ALIGN_BOTTOM
        Aligns the selected objects to the bottom edge of the most recently selected object.
      • DISTRIBUTE_HORZ

        public static final DelegatedCommand DISTRIBUTE_HORZ
        Distributes the selected objects evenly across the horizontal axis.
      • DISTRIBUTE_VERT

        public static final DelegatedCommand DISTRIBUTE_VERT
        Distributes the selected objects evenly across the vertical axis.
      • TURN_LEFT

        public static final DelegatedCommand TURN_LEFT
        Turns the deck selection left.
      • TURN_RIGHT

        public static final DelegatedCommand TURN_RIGHT
        Turns the deck selection right.
      • TURN_180

        public static final DelegatedCommand TURN_180
        Turns the deck selection 180 degrees.
      • FLIP_HORZ

        public static final DelegatedCommand FLIP_HORZ
        Mirrors the deck selection horizontally.
      • FLIP_VERT

        public static final DelegatedCommand FLIP_VERT
        Mirrors the deck selection vertically.
      • CENTER_CONTENT

        public static final DelegatedCommand CENTER_CONTENT
        Centers all content on a deck page.
      • LOCK

        public static final DelegatedCommand LOCK
        Locks the selected deck items.
      • UNLOCK

        public static final DelegatedCommand UNLOCK
        Locks the selected deck items.
      • UNLOCK_ALL

        public static final DelegatedCommand UNLOCK_ALL
        Unlocks all locked deck items.
      • EDIT_PAGE_ITEM

        public static final DelegatedCommand EDIT_PAGE_ITEM
        Edits the selected an item in a deck; if the selection has more than one object in it, only the last-selected item is considered.
      • EDIT_STYLE

        public static final DelegatedCommand EDIT_STYLE
        Opens the style editor for the selected page items in a deck.
      • COPY_STYLE

        public static final DelegatedCommand COPY_STYLE
        Copy the style information for the current selection into the global style clipboard.
      • PASTE_STYLE

        public static final DelegatedCommand PASTE_STYLE
        Apply the current global style clipboard style settings to the deck selection.
      • SELECT_INVERSE

        public static final DelegatedCommand SELECT_INVERSE
        Inverts the current selection.
      • SELECT_RESTORE

        public static final DelegatedCommand SELECT_RESTORE
        Restores the previous selection in a deck.
      • RUN_FILE

        public static final DelegatedCommand RUN_FILE
        Runs the script in the active code editor.
      • DEBUG_FILE

        public static final DelegatedCommand DEBUG_FILE
        Debugs the script in the active code editor.
      • TEST_BUNDLE

        public static final AbstractCommand TEST_BUNDLE
        Tests the bundle associated with the open editor file (or project view selection).
      • MAKE_BUNDLE

        public static final AbstractCommand MAKE_BUNDLE
        Makes the bundle associated with the open editor file (or project view selection).
      • MOVE_LINES_UP

        public static final DelegatedCommand MOVE_LINES_UP
        Moves the selected lines up in a code editor.
      • MOVE_LINES_DOWN

        public static final DelegatedCommand MOVE_LINES_DOWN
        Moves the selected lines down in a code editor.
      • COMMENT_OUT

        public static final DelegatedCommand COMMENT_OUT
        Comments out the selected lines in a code editor.
      • REMOVE_TRAILING_SPACES

        public static final DelegatedCommand REMOVE_TRAILING_SPACES
        Removes trailing spaces from the ends of source lines.
      • SORT

        public static final DelegatedCommand SORT
        Sorts selected lines in a code editor.
      • COMPLETE_CODE

        public static final DelegatedCommand COMPLETE_CODE
        Opens the code completion popup in the current code editor, if available.
      • FORMAT_CODE

        public static final DelegatedCommand FORMAT_CODE
        Formats (pretty prints) the current editor content, if a suitable formatter is available.
      • CODE_ABBREVIATIONS

        public static final AbstractCommand CODE_ABBREVIATIONS
        Displays the source code abbreviation table editor.
      • CONFIGURE_UPDATES

        public static final AbstractCommand CONFIGURE_UPDATES
        Opens a dialog box that allows the user to configure update notifications.
      • PLUGIN_CATALOG

        public static final AbstractCommand PLUGIN_CATALOG
        Opens the plug-in catalog.
      • PLUGIN_MANAGER

        public static final AbstractCommand PLUGIN_MANAGER
        Opens the plug-in manager.
      • HELP

        public static final DelegatedCommand HELP
        Command that displays context-sensitive help. The command searches the component tree of the control with focus. It looks for either a component of type JHelpButton or else a component with the client property HELP_CONTEXT_PROPERTY set. If either of these is found, the help page that they describe is displayed. If no suitable page is found, then the User Manual will be displayed instead.

        The action command of the action event used to fire the command can be the name of a help page to open, either the title of a Wiki article or a URL. In this case, that page is opened directly instead of searching the component tree.

      • HELP_CONTEXT_PROPERTY

        public static final java.lang.String HELP_CONTEXT_PROPERTY
        A client property that names a Web page that shows help for that part of the interface. The property value should be a String. The value can either be the name of a page in the Wiki or else the URL of a Web page.
        See Also:
        HELP, Constant Field Values
      • HELP_USER_MANUAL

        public static final AbstractCommand HELP_USER_MANUAL
        Opens the User Manual for browsing.
      • HELP_DEV_MANUAL

        public static final AbstractCommand HELP_DEV_MANUAL
        Opens the Developer Manual for browsing.
      • HELP_TRANSLATOR_MANUAL

        public static final AbstractCommand HELP_TRANSLATOR_MANUAL
        Opens the Translation Manual for browsing.
      • HELP_DEV_JS_API

        public static final AbstractCommand HELP_DEV_JS_API
        Opens the JS API documentation for browsing.
      • HELP_DEV_JAVA_API

        public static final AbstractCommand HELP_DEV_JAVA_API
        Opens the Java API documentation for browsing.
    • Method Detail

      • findCommandable

        public static Commandable findCommandable​(AbstractCommand command)
        Returns a command handler that is currently able to handle this command by following a default search strategy. The exact strategy used to find a relevant Commandable may change in future versions, but it is guaranteed that:
        • any registered handlers will be consulted first (in order of registration)
        • the active editor (if any) will be consulted after any registered handlers
        • the main application window will be consulted last
        The first consulted command handler for which the command is currently applicable will be returned, or if no handler is found, null is returned instead.

        Note that if you wish to create a command that is delegated to a Commandable that can be discovered through this method, it is sufficient to subclass DelegatedCommand.

        Parameters:
        command - the command to find a handler for; typically this is an instance of DelegatedCommand
        Returns:
        a command handler that can currently handle the command, or null if none can be found
        Throws:
        java.lang.NullPointerException - if the command is null
      • findCommand

        public static javax.swing.JMenuItem findCommand​(javax.swing.JPopupMenu menu,
                                                        AbstractCommand command)
        Returns the item in a popup menu that will execute the specified command, or null if the menu does not contain such an item.
        Parameters:
        menu - the menu to search
        command - the command to search for
        Returns:
        the item within the menu tree that contains the command
      • findCommand

        public static javax.swing.JMenuItem findCommand​(javax.swing.JMenu menu,
                                                        AbstractCommand command)
        Returns the item in a menu that will execute the specified command, or null if the menu does not contain such an item.
        Parameters:
        menu - the menu to search
        command - the command to search for
        Returns:
        the item within the menu tree that contains the command
      • findCommand

        public static javax.swing.JMenuItem findCommand​(javax.swing.JMenuBar menu,
                                                        AbstractCommand command)
        Returns the item in a menu bar that will execute the specified command, or null if the menu does not contain such an item.
        Parameters:
        menu - the menu bar whose menus should be searched, or null to use the main application window
        command - the command to search for
        Returns:
        the item within the menu tree that contains the command