Package mars

Class Settings


public class Settings extends Observable
Contains various IDE settings. Persistent settings are maintained for the current user and on the current machine using Java's Preference objects. Failing that, default setting values come from Settings.properties file. If both of those fail, default values come from static arrays defined in this class. The latter can can be modified prior to instantiating Settings object. NOTE: If the Preference objects fail due to security exceptions, changes to settings will not carry over from one MARS session to the next. Actual implementation of the Preference objects is platform-dependent. For Windows, they are stored in Registry. To see, run regedit and browse to: HKEY_CURRENT_USER\Software\JavaSoft\Prefs\mars
Author:
Pete Sanderson
  • Field Details

    • EXTENDED_ASSEMBLER_ENABLED

      public static final int EXTENDED_ASSEMBLER_ENABLED
      Flag to determine whether or not program being assembled is limited to basic MIPS instructions and formats.
      See Also:
      Constant Field Values
    • BARE_MACHINE_ENABLED

      public static final int BARE_MACHINE_ENABLED
      Flag to determine whether or not program being assembled is limited to using register numbers instead of names. NOTE: Its default value is false and the IDE provides no means to change it!
      See Also:
      Constant Field Values
    • ASSEMBLE_ON_OPEN_ENABLED

      public static final int ASSEMBLE_ON_OPEN_ENABLED
      Flag to determine whether or not a file is immediately and automatically assembled upon opening. Handy when using external editors like mipster.
      See Also:
      Constant Field Values
    • ASSEMBLE_ALL_ENABLED

      public static final int ASSEMBLE_ALL_ENABLED
      Flag to determine whether only the current editor source file (enabled false) or all files in its directory (enabled true) will be assembled when assembly is selected.
      See Also:
      Constant Field Values
    • LABEL_WINDOW_VISIBILITY

      public static final int LABEL_WINDOW_VISIBILITY
      Default visibility of label window (symbol table). Default only, dynamic status maintained by ExecutePane
      See Also:
      Constant Field Values
    • DISPLAY_ADDRESSES_IN_HEX

      public static final int DISPLAY_ADDRESSES_IN_HEX
      Default setting for displaying addresses and values in hexadecimal in the Execute pane.
      See Also:
      Constant Field Values
    • DISPLAY_VALUES_IN_HEX

      public static final int DISPLAY_VALUES_IN_HEX
      See Also:
      Constant Field Values
    • EXCEPTION_HANDLER_ENABLED

      public static final int EXCEPTION_HANDLER_ENABLED
      Flag to determine whether the currently selected exception handler source file will be included in each assembly operation.
      See Also:
      Constant Field Values
    • DELAYED_BRANCHING_ENABLED

      public static final int DELAYED_BRANCHING_ENABLED
      Flag to determine whether or not delayed branching is in effect at MIPS execution. This means we simulate the pipeline and statement FOLLOWING a successful branch is executed before branch is taken. DPS 14 June 2007.
      See Also:
      Constant Field Values
    • EDITOR_LINE_NUMBERS_DISPLAYED

      public static final int EDITOR_LINE_NUMBERS_DISPLAYED
      Flag to determine whether or not the editor will display line numbers.
      See Also:
      Constant Field Values
    • WARNINGS_ARE_ERRORS

      public static final int WARNINGS_ARE_ERRORS
      Flag to determine whether or not assembler warnings are considered errors.
      See Also:
      Constant Field Values
    • PROGRAM_ARGUMENTS

      public static final int PROGRAM_ARGUMENTS
      Flag to determine whether or not to display and use program arguments
      See Also:
      Constant Field Values
    • DATA_SEGMENT_HIGHLIGHTING

      public static final int DATA_SEGMENT_HIGHLIGHTING
      Flag to control whether or not highlighting is applied to data segment window
      See Also:
      Constant Field Values
    • REGISTERS_HIGHLIGHTING

      public static final int REGISTERS_HIGHLIGHTING
      Flag to control whether or not highlighting is applied to register windows
      See Also:
      Constant Field Values
    • START_AT_MAIN

      public static final int START_AT_MAIN
      Flag to control whether or not assembler automatically initializes program counter to 'main's address
      See Also:
      Constant Field Values
    • EDITOR_CURRENT_LINE_HIGHLIGHTING

      public static final int EDITOR_CURRENT_LINE_HIGHLIGHTING
      Flag to control whether or not editor will highlight the line currently being edited
      See Also:
      Constant Field Values
    • GENERIC_TEXT_EDITOR

      public static final int GENERIC_TEXT_EDITOR
      Flag to control whether or not to use generic text editor instead of language-aware styled editor
      See Also:
      Constant Field Values
    • AUTO_INDENT

      public static final int AUTO_INDENT
      Flag to control whether or not language-aware editor will use auto-indent feature
      See Also:
      Constant Field Values
    • SELF_MODIFYING_CODE_ENABLED

      public static final int SELF_MODIFYING_CODE_ENABLED
      Flag to determine whether a program can write binary code to the text or data segment and execute that code.
      See Also:
      Constant Field Values
    • RSYNTAX_TESTING

      @Deprecated public static final int RSYNTAX_TESTING
      Deprecated.
      Flag to opt-in to use the new RSyntax-based editor. Temporary flag for testing
      See Also:
      Constant Field Values
    • defaultBooleanSettingsValues

      public static boolean[] defaultBooleanSettingsValues
      Last resort default values for boolean settings; will use only if neither the Preferences nor the properties file work. If you wish to change them, do so before instantiating the Settings object. Values are matched to keys by list position.
    • EXCEPTION_HANDLER

      public static final int EXCEPTION_HANDLER
      Current specified exception handler file (a MIPS assembly source file)
      See Also:
      Constant Field Values
    • TEXT_COLUMN_ORDER

      public static final int TEXT_COLUMN_ORDER
      Order of text segment table columns
      See Also:
      Constant Field Values
    • LABEL_SORT_STATE

      public static final int LABEL_SORT_STATE
      State for sorting label window display
      See Also:
      Constant Field Values
    • MEMORY_CONFIGURATION

      public static final int MEMORY_CONFIGURATION
      Identifier of current memory configuration
      See Also:
      Constant Field Values
    • EDITOR_TAB_SIZE

      public static final int EDITOR_TAB_SIZE
      Editor tab size in characters.
      See Also:
      Constant Field Values
    • EDITOR_POPUP_PREFIX_LENGTH

      public static final int EDITOR_POPUP_PREFIX_LENGTH
      Number of letters to be matched by editor's instruction guide before popup generated (if popup enabled)
      See Also:
      Constant Field Values
    • EDITOR_FONT

      public static final int EDITOR_FONT
      Font for the text editor
      See Also:
      Constant Field Values
    • EVEN_ROW_FONT

      public static final int EVEN_ROW_FONT
      Font for table even row background (text, data, register displays)
      See Also:
      Constant Field Values
    • ODD_ROW_FONT

      public static final int ODD_ROW_FONT
      Font for table odd row background (text, data, register displays)
      See Also:
      Constant Field Values
    • TEXTSEGMENT_HIGHLIGHT_FONT

      public static final int TEXTSEGMENT_HIGHLIGHT_FONT
      Font for table odd row foreground (text, data, register displays)
      See Also:
      Constant Field Values
    • TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_FONT

      public static final int TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_FONT
      Font for text segment delay slot highlighted background
      See Also:
      Constant Field Values
    • DATASEGMENT_HIGHLIGHT_FONT

      public static final int DATASEGMENT_HIGHLIGHT_FONT
      Font for text segment highlighted background
      See Also:
      Constant Field Values
    • REGISTER_HIGHLIGHT_FONT

      public static final int REGISTER_HIGHLIGHT_FONT
      Font for register highlighted background
      See Also:
      Constant Field Values
    • EVEN_ROW_BACKGROUND

      public static final int EVEN_ROW_BACKGROUND
      RGB color for table even row background (text, data, register displays)
      See Also:
      Constant Field Values
    • EVEN_ROW_FOREGROUND

      public static final int EVEN_ROW_FOREGROUND
      RGB color for table even row foreground (text, data, register displays)
      See Also:
      Constant Field Values
    • ODD_ROW_BACKGROUND

      public static final int ODD_ROW_BACKGROUND
      RGB color for table odd row background (text, data, register displays)
      See Also:
      Constant Field Values
    • ODD_ROW_FOREGROUND

      public static final int ODD_ROW_FOREGROUND
      RGB color for table odd row foreground (text, data, register displays)
      See Also:
      Constant Field Values
    • TEXTSEGMENT_HIGHLIGHT_BACKGROUND

      public static final int TEXTSEGMENT_HIGHLIGHT_BACKGROUND
      RGB color for text segment highlighted background
      See Also:
      Constant Field Values
    • TEXTSEGMENT_HIGHLIGHT_FOREGROUND

      public static final int TEXTSEGMENT_HIGHLIGHT_FOREGROUND
      RGB color for text segment highlighted foreground
      See Also:
      Constant Field Values
    • TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_BACKGROUND

      public static final int TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_BACKGROUND
      RGB color for text segment delay slot highlighted background
      See Also:
      Constant Field Values
    • TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_FOREGROUND

      public static final int TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_FOREGROUND
      RGB color for text segment delay slot highlighted foreground
      See Also:
      Constant Field Values
    • DATASEGMENT_HIGHLIGHT_BACKGROUND

      public static final int DATASEGMENT_HIGHLIGHT_BACKGROUND
      RGB color for text segment highlighted background
      See Also:
      Constant Field Values
    • DATASEGMENT_HIGHLIGHT_FOREGROUND

      public static final int DATASEGMENT_HIGHLIGHT_FOREGROUND
      RGB color for text segment highlighted foreground
      See Also:
      Constant Field Values
    • REGISTER_HIGHLIGHT_BACKGROUND

      public static final int REGISTER_HIGHLIGHT_BACKGROUND
      RGB color for register highlighted background
      See Also:
      Constant Field Values
    • REGISTER_HIGHLIGHT_FOREGROUND

      public static final int REGISTER_HIGHLIGHT_FOREGROUND
      RGB color for register highlighted foreground
      See Also:
      Constant Field Values
  • Constructor Details

    • Settings

      public Settings()
      Create Settings object and set to saved values. If saved values not found, will set based on defaults stored in Settings.properties file. If file problems, will set based on defaults stored in this class.
    • Settings

      public Settings(boolean gui)
      Create Settings object and set to saved values. If saved values not found, will set based on defaults stored in Settings.properties file. If file problems, will set based on defaults stored in this class.
      Parameters:
      gui - true if running the graphical IDE, false if running from command line. Ignored as of release 3.6 but retained for compatibility.
  • Method Details

    • getBackSteppingEnabled

      public boolean getBackSteppingEnabled()
      Return whether backstepping is permitted at this time. Backstepping is ability to undo execution steps one at a time. Available only in the IDE. This is not a persistent setting and is not under MARS user control.
      Returns:
      true if backstepping is permitted, false otherwise.
    • reset

      public void reset(boolean gui)
      Reset settings to default values, as described in the constructor comments.
      Parameters:
      gui - true if running from GUI IDE and false if running from command mode. Ignored as of release 3.6 but retained for compatibility.
    • setEditorSyntaxStyleByPosition

      public void setEditorSyntaxStyleByPosition(int index, SyntaxStyle syntaxStyle)
    • getEditorSyntaxStyleByPosition

      public SyntaxStyle getEditorSyntaxStyleByPosition(int index)
    • getDefaultEditorSyntaxStyleByPosition

      public SyntaxStyle getDefaultEditorSyntaxStyleByPosition(int index)
    • getBooleanSetting

      public boolean getBooleanSetting(int id)
      Fetch value of a boolean setting given its identifier.
      Parameters:
      id - int containing the setting's identifier (constants listed above)
      Returns:
      corresponding boolean setting.
      Throws:
      IllegalArgumentException - if identifier is invalid.
    • getBareMachineEnabled

      @Deprecated public boolean getBareMachineEnabled()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.BARE_MACHINE_ENABLED)
      Setting for whether user programs limited to "bare machine" formatted basic instructions. This was added 8 Aug 2006 but is fixed at false for now, due to uncertainty as to what exactly constitutes "bare machine".
      Returns:
      true if only bare machine instructions allowed, false otherwise.
    • getExtendedAssemblerEnabled

      @Deprecated public boolean getExtendedAssemblerEnabled()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.EXTENDED_ASSEMBLER_ENABLED)
      Setting for whether user programs can use pseudo-instructions or extended addressing modes or alternative instruction formats (all are implemented as pseudo-instructions).
      Returns:
      true if pseudo-instructions and formats permitted, false otherwise.
    • getAssembleOnOpenEnabled

      @Deprecated public boolean getAssembleOnOpenEnabled()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.ASSEMBLE_ON_OPEN_ENABLED)
      Setting for whether selected program will be automatically assembled upon opening. This can be useful if user employs an external editor such as MIPSter.
      Returns:
      true if file is to be automatically assembled upon opening and false otherwise.
    • getDisplayAddressesInHex

      @Deprecated public boolean getDisplayAddressesInHex()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.DISPLAY_ADDRESSES_IN_HEX)
      Setting for whether Addresses in the Execute pane will be displayed in hexadecimal.
      Returns:
      true if addresses are displayed in hexadecimal and false otherwise (decimal).
    • getDisplayValuesInHex

      @Deprecated public boolean getDisplayValuesInHex()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.DISPLAY_VALUES_IN_HEX)
      Setting for whether values in the Execute pane will be displayed in hexadecimal.
      Returns:
      true if values are displayed in hexadecimal and false otherwise (decimal).
    • getAssembleAllEnabled

      @Deprecated public boolean getAssembleAllEnabled()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.ASSEMBLE_ALL_ENABLED)
      Setting for whether the assemble operation applies only to the file currently open in the editor or whether it applies to all files in that file's directory (primitive project capability). If the "assemble on open" setting is set, this "assemble all" setting will be applied as soon as the file is opened.
      Returns:
      true if all files are to be assembled, false if only the file open in editor.
    • getExceptionHandlerEnabled

      @Deprecated public boolean getExceptionHandlerEnabled()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.EXCEPTION_HANDLER_ENABLED)
      Setting for whether the currently selected exception handler (a MIPS source file) will be automatically included in each assemble operation.
      Returns:
      true if exception handler is to be included in assemble, false otherwise.
    • getDelayedBranchingEnabled

      @Deprecated public boolean getDelayedBranchingEnabled()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.DELAYED_BRANCHING_ENABLED)
      Setting for whether delayed branching will be applied during MIPS program execution. If enabled, the statement following a successful branch will be executed and then the branch is taken! This simulates pipelining and all MIPS processors do it. However it is confusing to assembly language students so is disabled by default. SPIM does same thing.
      Returns:
      true if delayed branching is enabled, false otherwise.
    • getLabelWindowVisibility

      @Deprecated public boolean getLabelWindowVisibility()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.LABEL_WINDOW_VISIBILITY)
      Setting concerning whether or not to display the Labels Window -- symbol table.
      Returns:
      true if label window is to be displayed, false otherwise.
    • getEditorLineNumbersDisplayed

      @Deprecated public boolean getEditorLineNumbersDisplayed()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.EDITOR_LINE_NUMBERS_DISPLAYED)
      Setting concerning whether or not the editor will display line numbers.
      Returns:
      true if line numbers are to be displayed, false otherwise.
    • getWarningsAreErrors

      @Deprecated public boolean getWarningsAreErrors()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.WARNINGS_ARE_ERRORS)
      Setting concerning whether or not assembler will consider warnings to be errors.
      Returns:
      true if warnings are considered errors, false otherwise.
    • getProgramArguments

      @Deprecated public boolean getProgramArguments()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.PROGRAM_ARGUMENTS)
      Setting concerning whether or not program arguments can be entered and used.
      Returns:
      true if program arguments can be entered/used, false otherwise.
    • getDataSegmentHighlighting

      @Deprecated public boolean getDataSegmentHighlighting()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.DATA_SEGMENT_HIGHLIGHTING)
      Setting concerning whether or not highlighting is applied to Data Segment window.
      Returns:
      true if highlighting is to be applied, false otherwise.
    • getRegistersHighlighting

      @Deprecated public boolean getRegistersHighlighting()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.REGISTERS_HIGHLIGHTING)
      Setting concerning whether or not highlighting is applied to Registers, Coprocessor0, and Coprocessor1 windows.
      Returns:
      true if highlighting is to be applied, false otherwise.
    • getStartAtMain

      @Deprecated public boolean getStartAtMain()
      Deprecated.
      Use getBooleanSetting(int id) with the appropriate boolean setting ID (e.g. Settings.START_AT_MAIN)
      Setting concerning whether or not assembler will automatically initialize the program counter to address of statement labeled 'main' if defined.
      Returns:
      true if it initializes to 'main', false otherwise.
    • getExceptionHandler

      public String getExceptionHandler()
      Name of currently selected exception handler file.
      Returns:
      String pathname of current exception handler file, empty if none.
    • getMemoryConfiguration

      public String getMemoryConfiguration()
      Returns identifier of current built-in memory configuration.
      Returns:
      String identifier of current built-in memory configuration, empty if none.
    • getEditorFont

      public Font getEditorFont()
      Current editor font. Retained for compatibility but replaced by: getFontByPosition(Settings.EDITOR_FONT)
      Returns:
      Font object for current editor font.
    • getFontByPosition

      public Font getFontByPosition(int fontSettingPosition)
      Retrieve a Font setting
      Parameters:
      fontSettingPosition - constant that identifies which item
      Returns:
      Font object for given item
    • getDefaultFontByPosition

      public Font getDefaultFontByPosition(int fontSettingPosition)
      Retrieve a default Font setting
      Parameters:
      fontSettingPosition - constant that identifies which item
      Returns:
      Font object for given item
    • getTextColumnOrder

      public int[] getTextColumnOrder()
      Order of text segment display columns (there are 5, numbered 0 to 4).
      Returns:
      Array of int indicating the order. Original order is 0 1 2 3 4.
    • getCaretBlinkRate

      public int getCaretBlinkRate()
      Retrieve the caret blink rate in milliseconds. Blink rate of 0 means do not blink.
      Returns:
      int blink rate in milliseconds
    • getEditorTabSize

      public int getEditorTabSize()
      Get the tab size in characters.
      Returns:
      tab size in characters.
    • getEditorPopupPrefixLength

      public int getEditorPopupPrefixLength()
      Get number of letters to be matched by editor's instruction guide before popup generated (if popup enabled). Should be 1 or 2. If 1, the popup will be generated after first letter typed, based on all matches; if 2, the popup will be generated after second letter typed.
      Returns:
      number of letters (should be 1 or 2).
    • getDefaultEditorTabSize

      public int getDefaultEditorTabSize()
      Get the text editor default tab size in characters
      Returns:
      tab size in characters
    • getLabelSortState

      public String getLabelSortState()
      Get the saved state of the Labels Window sorting (can sort by either label or address and either ascending or descending order). Default state is 0, by ascending addresses.
      Returns:
      State value 0-7, as a String.
    • getColorSettingByKey

      public Color getColorSettingByKey(String key)
      Get Color object for specified settings key. Returns null if key is not found or its value is not a valid color encoding.
      Parameters:
      key - the Setting key
      Returns:
      corresponding Color, or null if key not found or value not valid color
    • getDefaultColorSettingByKey

      public Color getDefaultColorSettingByKey(String key)
      Get default Color value for specified settings key. Returns null if key is not found or its value is not a valid color encoding.
      Parameters:
      key - the Setting key
      Returns:
      corresponding default Color, or null if key not found or value not valid color
    • getColorSettingByPosition

      public Color getColorSettingByPosition(int position)
      Get Color object for specified settings name (a static constant). Returns null if argument invalid or its value is not a valid color encoding.
      Parameters:
      position - the Setting name (see list of static constants)
      Returns:
      corresponding Color, or null if argument invalid or value not valid color
    • getDefaultColorSettingByPosition

      public Color getDefaultColorSettingByPosition(int position)
      Get default Color object for specified settings name (a static constant). Returns null if argument invalid or its value is not a valid color encoding.
      Parameters:
      position - the Setting name (see list of static constants)
      Returns:
      corresponding default Color, or null if argument invalid or value not valid color
    • setBooleanSetting

      public void setBooleanSetting(int id, boolean value)
      Set value of a boolean setting given its id and the value.
      Parameters:
      id - int containing the setting's identifier (constants listed above)
      value - boolean value to store
      Throws:
      IllegalArgumentException - if identifier is not valid.
    • setExtendedAssemblerEnabled

      @Deprecated public void setExtendedAssemblerEnabled(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.EXTENDED_ASSEMBLER_ENABLED)
      Establish setting for whether or not pseudo-instructions and formats are permitted in user programs. User can change this setting via the IDE. If setting changes, new setting will be written to properties file.
      Parameters:
      value - True to permit, false otherwise.
    • setAssembleOnOpenEnabled

      @Deprecated public void setAssembleOnOpenEnabled(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.ASSEMBLE_ON_OPEN_ENABLED)
      Establish setting for whether a file will be automatically assembled as soon as it is opened. This is handy for those using an external text editor such as Mipster. If setting changes, new setting will be written to properties file.
      Parameters:
      value - True to automatically assemble, false otherwise.
    • setAssembleAllEnabled

      @Deprecated public void setAssembleAllEnabled(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.ASSEMBLE_ALL_ENABLED)
      Establish setting for whether a file will be assembled by itself (false) or along with all other files in its directory (true). This permits multi-file programs and a primitive "project" capability. If setting changes, new setting will be written to properties file.
      Parameters:
      value - True to assemble all, false otherwise.
    • setDisplayAddressesInHex

      @Deprecated public void setDisplayAddressesInHex(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.DISPLAY_ADDRESSES_IN_HEX)
      Establish setting for whether addresses in the Execute pane will be displayed in hexadecimal format.
      Parameters:
      value - True to display addresses in hexadecimal, false for decimal.
    • setDisplayValuesInHex

      @Deprecated public void setDisplayValuesInHex(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.DISPLAY_VALUES_IN_HEX)
      Establish setting for whether values in the Execute pane will be displayed in hexadecimal format.
      Parameters:
      value - True to display values in hexadecimal, false for decimal.
    • setLabelWindowVisibility

      @Deprecated public void setLabelWindowVisibility(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.LABEL_WINDOW_VISIBILITY)
      Establish setting for whether the labels window (i.e. symbol table) will be displayed as part of the Text Segment display. If setting changes, new setting will be written to properties file.
      Parameters:
      value - True to dispay labels window, false otherwise.
    • setExceptionHandlerEnabled

      @Deprecated public void setExceptionHandlerEnabled(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.EXCEPTION_HANDLER_ENABLED)
      Establish setting for whether the currently selected exception handler (a MIPS source file) will be automatically included in each assemble operation. If setting changes, new setting will be written to properties file.
      Parameters:
      value - True to assemble exception handler, false otherwise.
    • setDelayedBranchingEnabled

      @Deprecated public void setDelayedBranchingEnabled(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.DELAYED_BRANCHING_ENABLED)
      Establish setting for whether delayed branching will be applied during MIPS program execution. If enabled, the statement following a successful branch will be executed and then the branch is taken! This simulates pipelining and all MIPS processors do it. However it is confusing to assembly language students so is disabled by default. SPIM does same thing.
      Parameters:
      value - True to enable delayed branching, false otherwise.
    • setEditorLineNumbersDisplayed

      @Deprecated public void setEditorLineNumbersDisplayed(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.EDITOR_LINE_NUMBERS_DISPLAYED)
      Establish setting for whether line numbers will be displayed by the text editor.
      Parameters:
      value - True to display line numbers, false otherwise.
    • setWarningsAreErrors

      @Deprecated public void setWarningsAreErrors(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.WARNINGS_ARE_ERRORS)
      Establish setting for whether assembler warnings will be considered errors.
      Parameters:
      value - True to consider warnings to be errors, false otherwise.
    • setProgramArguments

      @Deprecated public void setProgramArguments(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.PROGRAM_ARGUMENTS)
      Establish setting for whether program arguments can be ented/used.
      Parameters:
      value - True if program arguments can be entered/used, false otherwise.
    • setDataSegmentHighlighting

      @Deprecated public void setDataSegmentHighlighting(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.DATA_SEGMENT_HIGHLIGHTING)
      Establish setting for whether highlighting is to be applied to Data Segment window.
      Parameters:
      value - True if highlighting is to be applied, false otherwise.
    • setRegistersHighlighting

      @Deprecated public void setRegistersHighlighting(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.REGISTERS_HIGHLIGHTING)
      Establish setting for whether highlighting is to be applied to Registers, Coprocessor0 and Coprocessor1 windows.
      Parameters:
      value - True if highlighting is to be applied, false otherwise.
    • setStartAtMain

      @Deprecated public void setStartAtMain(boolean value)
      Deprecated.
      Use setBooleanSetting(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.START_AT_MAIN)
      Establish setting for whether assembler will automatically initialize program counter to address of statement labeled 'main' if defined.
      Parameters:
      value - True if PC set to address of 'main', false otherwise.
    • setBooleanSettingNonPersistent

      public void setBooleanSettingNonPersistent(int id, boolean value)
      Temporarily establish boolean setting. This setting will NOT be written to persistent store! Currently this is used only when running MARS from the command line
      Parameters:
      id - setting identifier. These are defined for this class as static final int.
      value - True to enable the setting, false otherwise.
    • setDelayedBranchingEnabledNonPersistent

      @Deprecated public void setDelayedBranchingEnabledNonPersistent(boolean value)
      Deprecated.
      Use setBooleanSettingNonPersistent(int id, boolean value) with the appropriate boolean setting ID (e.g. Settings.DELAYED_BRANCHING_ENABLED)
      Establish setting for whether delayed branching will be applied during MIPS program execution. This setting will NOT be written to persisent store! This method should be called only to temporarily set this setting -- currently this is needed only when running MARS from the command line.
      Parameters:
      value - True to enabled delayed branching, false otherwise.
    • setExceptionHandler

      public void setExceptionHandler(String newFilename)
      Set name of exception handler file and write it to persistent storage.
      Parameters:
      newFilename - name of exception handler file
    • setMemoryConfiguration

      public void setMemoryConfiguration(String config)
      Store the identifier of the memory configuration.
      Parameters:
      config - A string that identifies the current built-in memory configuration
    • setCaretBlinkRate

      public void setCaretBlinkRate(int rate)
      Set the caret blinking rate in milliseconds. Rate of 0 means no blinking.
      Parameters:
      rate - blink rate in milliseconds
    • setEditorTabSize

      public void setEditorTabSize(int size)
      Set the tab size in characters.
      Parameters:
      size - tab size in characters.
    • setEditorPopupPrefixLength

      public void setEditorPopupPrefixLength(int length)
      Set number of letters to be matched by editor's instruction guide before popup generated (if popup enabled). Should be 1 or 2. If 1, the popup will be generated after first letter typed, based on all matches; if 2, the popup will be generated after second letter typed.
      Parameters:
      length - number of letters (should be 1 or 2).
    • setEditorFont

      public void setEditorFont(Font font)
      Set editor font to the specified Font object and write it to persistent storage. This method retained for compatibility but replaced by: setFontByPosition(Settings.EDITOR_FONT, font)
      Parameters:
      font - Font object to be used by text editor.
    • setFontByPosition

      public void setFontByPosition(int fontSettingPosition, Font font)
      Store a Font setting
      Parameters:
      fontSettingPosition - Constant that identifies the item the font goes with
      font - The font to set that item to
    • setTextColumnOrder

      public void setTextColumnOrder(int[] columnOrder)
      Store the current order of Text Segment window table columns, so the ordering can be preserved and restored.
      Parameters:
      columnOrder - An array of int indicating column order.
    • setLabelSortState

      public void setLabelSortState(String state)
      Store the current state of the Labels Window sorter. There are 8 possible states as described in LabelsWindow.java
      Parameters:
      state - The current labels window sorting state, as a String.
    • setColorSettingByKey

      public void setColorSettingByKey(String key, Color color)
      Set Color object for specified settings key. Has no effect if key is invalid.
      Parameters:
      key - the Setting key
      color - the Color to save
    • setColorSettingByPosition

      public void setColorSettingByPosition(int position, Color color)
      Set Color object for specified settings name (a static constant). Has no effect if invalid.
      Parameters:
      position - the Setting name (see list of static constants)
      color - the Color to save