Interface Commandable

    • Method Detail

      • canPerformCommand

        boolean canPerformCommand​(AbstractCommand command)
        Returns true if the commandable wishes to handle the given command. This method defines the set of commands that the commandable responds to. The commandable might not be able to act on the command at the current moment. For example, a commandable that responds to "Cut" could return true from handlesCommand, but false from isCommandApplicable(ca.cgjennings.apps.arkham.commands.AbstractCommand) if there is currently no selection to cut.
        Parameters:
        command - the command to be performed
        Returns:
        true if this commandable wishes to handle the command (even if it cannot execute the command currently)
      • isCommandApplicable

        boolean isCommandApplicable​(AbstractCommand command)
        Returns true if the command can be performed by this commandable in its current state. If canPerformCommand(ca.cgjennings.apps.arkham.commands.AbstractCommand) would return false for this command, then this must also return false.
        Parameters:
        command - the command to be performed
        Returns:
        true if this commandable can currently perform the command