Package mars
Class Settings
java.lang.Object
java.util.Observable
mars.Settings
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 Summary
FieldsModifier and TypeFieldDescriptionstatic int
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.static int
Flag to determine whether or not a file is immediately and automatically assembled upon opening.static int
Flag to control whether or not language-aware editor will use auto-indent featurestatic int
Flag to determine whether or not program being assembled is limited to using register numbers instead of names.static int
Caret blink rate in milliseconds, 0 means don't blink.static int
Flag to control whether or not highlighting is applied to data segment windowstatic int
RGB color for text segment highlighted backgroundstatic int
Font for text segment highlighted backgroundstatic int
RGB color for text segment highlighted foregroundstatic boolean[]
Last resort default values for boolean settings; will use only if neither the Preferences nor the properties file work.static int
Flag to determine whether or not delayed branching is in effect at MIPS execution.static int
Default setting for displaying addresses and values in hexadecimal in the Execute pane.static int
static int
Flag to control whether or not editor will highlight the line currently being editedstatic int
Font for the text editorstatic int
Flag to determine whether or not the editor will display line numbers.static int
Number of letters to be matched by editor's instruction guide before popup generated (if popup enabled)static int
Editor tab size in characters.static int
RGB color for table even row background (text, data, register displays)static int
Font for table even row background (text, data, register displays)static int
RGB color for table even row foreground (text, data, register displays)static int
Current specified exception handler file (a MIPS assembly source file)static int
Flag to determine whether the currently selected exception handler source file will be included in each assembly operation.static int
Flag to determine whether or not program being assembled is limited to basic MIPS instructions and formats.static int
Flag to control whether or not to use generic text editor instead of language-aware styled editorstatic int
State for sorting label window displaystatic int
Default visibility of label window (symbol table).static int
Identifier of current memory configurationstatic int
RGB color for table odd row background (text, data, register displays)static int
Font for table odd row background (text, data, register displays)static int
RGB color for table odd row foreground (text, data, register displays)static int
Flag to control whether or not editor will provide popup instruction guidance while typingstatic int
Flag to control whether or not simulator will use popup dialog for input syscallsstatic int
Flag to determine whether or not to display and use program argumentsstatic int
RGB color for register highlighted backgroundstatic int
Font for register highlighted backgroundstatic int
RGB color for register highlighted foregroundstatic int
Flag to control whether or not highlighting is applied to register windowsstatic int
Deprecated.static int
Flag to determine whether a program can write binary code to the text or data segment and execute that code.static int
Flag to control whether or not assembler automatically initializes program counter to 'main's addressstatic int
Order of text segment table columnsstatic int
RGB color for text segment delay slot highlighted backgroundstatic int
Font for text segment delay slot highlighted backgroundstatic int
RGB color for text segment delay slot highlighted foregroundstatic int
RGB color for text segment highlighted backgroundstatic int
Font for table odd row foreground (text, data, register displays)static int
RGB color for text segment highlighted foregroundstatic int
Flag to determine whether or not assembler warnings are considered errors. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.boolean
Return whether backstepping is permitted at this time.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.boolean
getBooleanSetting(int id)
Fetch value of a boolean setting given its identifier.int
Retrieve the caret blink rate in milliseconds.getColorSettingByKey(String key)
Get Color object for specified settings key.getColorSettingByPosition(int position)
Get Color object for specified settings name (a static constant).boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.Get default Color value for specified settings key.getDefaultColorSettingByPosition(int position)
Get default Color object for specified settings name (a static constant).getDefaultEditorSyntaxStyleByPosition(int index)
int
Get the text editor default tab size in charactersgetDefaultFontByPosition(int fontSettingPosition)
Retrieve a default Font settingboolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.Current editor font.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.int
Get number of letters to be matched by editor's instruction guide before popup generated (if popup enabled).getEditorSyntaxStyleByPosition(int index)
int
Get the tab size in characters.Name of currently selected exception handler file.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.getFontByPosition(int fontSettingPosition)
Retrieve a Font settingGet the saved state of the Labels Window sorting (can sort by either label or address and either ascending or descending order).boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.Returns identifier of current built-in memory configuration.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.int[]
Order of text segment display columns (there are 5, numbered 0 to 4).boolean
Deprecated.UsegetBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.void
reset(boolean gui)
Reset settings to default values, as described in the constructor comments.void
setAssembleAllEnabled(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setAssembleOnOpenEnabled(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setBooleanSetting(int id, boolean value)
Set value of a boolean setting given its id and the value.void
setBooleanSettingNonPersistent(int id, boolean value)
Temporarily establish boolean setting.void
setCaretBlinkRate(int rate)
Set the caret blinking rate in milliseconds.void
setColorSettingByKey(String key, Color color)
Set Color object for specified settings key.void
setColorSettingByPosition(int position, Color color)
Set Color object for specified settings name (a static constant).void
setDataSegmentHighlighting(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setDelayedBranchingEnabled(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setDelayedBranchingEnabledNonPersistent(boolean value)
Deprecated.UsesetBooleanSettingNonPersistent(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setDisplayAddressesInHex(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setDisplayValuesInHex(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setEditorFont(Font font)
Set editor font to the specified Font object and write it to persistent storage.void
setEditorLineNumbersDisplayed(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setEditorPopupPrefixLength(int length)
Set number of letters to be matched by editor's instruction guide before popup generated (if popup enabled).void
setEditorSyntaxStyleByPosition(int index, SyntaxStyle syntaxStyle)
void
setEditorTabSize(int size)
Set the tab size in characters.void
setExceptionHandler(String newFilename)
Set name of exception handler file and write it to persistent storage.void
setExceptionHandlerEnabled(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setExtendedAssemblerEnabled(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setFontByPosition(int fontSettingPosition, Font font)
Store a Font settingvoid
setLabelSortState(String state)
Store the current state of the Labels Window sorter.void
setLabelWindowVisibility(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setMemoryConfiguration(String config)
Store the identifier of the memory configuration.void
setProgramArguments(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setRegistersHighlighting(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setStartAtMain(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.void
setTextColumnOrder(int[] columnOrder)
Store the current order of Text Segment window table columns, so the ordering can be preserved and restored.void
setWarningsAreErrors(boolean value)
Deprecated.UsesetBooleanSetting(int id, boolean value)
with the appropriate boolean setting ID (e.g.Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
-
Field Details
-
EXTENDED_ASSEMBLER_ENABLED
public static final int EXTENDED_ASSEMBLER_ENABLEDFlag 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_ENABLEDFlag 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_ENABLEDFlag 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_ENABLEDFlag 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_VISIBILITYDefault 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_HEXDefault 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_ENABLEDFlag 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_ENABLEDFlag 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_DISPLAYEDFlag 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_ERRORSFlag to determine whether or not assembler warnings are considered errors.- See Also:
- Constant Field Values
-
PROGRAM_ARGUMENTS
public static final int PROGRAM_ARGUMENTSFlag 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_HIGHLIGHTINGFlag to control whether or not highlighting is applied to data segment window- See Also:
- Constant Field Values
-
REGISTERS_HIGHLIGHTING
public static final int REGISTERS_HIGHLIGHTINGFlag 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_MAINFlag 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_HIGHLIGHTINGFlag to control whether or not editor will highlight the line currently being edited- See Also:
- Constant Field Values
-
POPUP_INSTRUCTION_GUIDANCE
public static final int POPUP_INSTRUCTION_GUIDANCEFlag to control whether or not editor will provide popup instruction guidance while typing- See Also:
- Constant Field Values
-
POPUP_SYSCALL_INPUT
public static final int POPUP_SYSCALL_INPUTFlag to control whether or not simulator will use popup dialog for input syscalls- See Also:
- Constant Field Values
-
GENERIC_TEXT_EDITOR
public static final int GENERIC_TEXT_EDITORFlag 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_INDENTFlag 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_ENABLEDFlag 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.Flag to opt-in to use the new RSyntax-based editor. Temporary flag for testing- See Also:
- Constant Field Values
-
defaultBooleanSettingsValues
public static boolean[] defaultBooleanSettingsValuesLast 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_HANDLERCurrent specified exception handler file (a MIPS assembly source file)- See Also:
- Constant Field Values
-
TEXT_COLUMN_ORDER
public static final int TEXT_COLUMN_ORDEROrder of text segment table columns- See Also:
- Constant Field Values
-
LABEL_SORT_STATE
public static final int LABEL_SORT_STATEState for sorting label window display- See Also:
- Constant Field Values
-
MEMORY_CONFIGURATION
public static final int MEMORY_CONFIGURATIONIdentifier of current memory configuration- See Also:
- Constant Field Values
-
CARET_BLINK_RATE
public static final int CARET_BLINK_RATECaret blink rate in milliseconds, 0 means don't blink.- See Also:
- Constant Field Values
-
EDITOR_TAB_SIZE
public static final int EDITOR_TAB_SIZEEditor tab size in characters.- See Also:
- Constant Field Values
-
EDITOR_POPUP_PREFIX_LENGTH
public static final int EDITOR_POPUP_PREFIX_LENGTHNumber 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_FONTFont for the text editor- See Also:
- Constant Field Values
-
EVEN_ROW_FONT
public static final int EVEN_ROW_FONTFont for table even row background (text, data, register displays)- See Also:
- Constant Field Values
-
ODD_ROW_FONT
public static final int ODD_ROW_FONTFont for table odd row background (text, data, register displays)- See Also:
- Constant Field Values
-
TEXTSEGMENT_HIGHLIGHT_FONT
public static final int TEXTSEGMENT_HIGHLIGHT_FONTFont 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_FONTFont for text segment delay slot highlighted background- See Also:
- Constant Field Values
-
DATASEGMENT_HIGHLIGHT_FONT
public static final int DATASEGMENT_HIGHLIGHT_FONTFont for text segment highlighted background- See Also:
- Constant Field Values
-
REGISTER_HIGHLIGHT_FONT
public static final int REGISTER_HIGHLIGHT_FONTFont for register highlighted background- See Also:
- Constant Field Values
-
EVEN_ROW_BACKGROUND
public static final int EVEN_ROW_BACKGROUNDRGB color for table even row background (text, data, register displays)- See Also:
- Constant Field Values
-
EVEN_ROW_FOREGROUND
public static final int EVEN_ROW_FOREGROUNDRGB color for table even row foreground (text, data, register displays)- See Also:
- Constant Field Values
-
ODD_ROW_BACKGROUND
public static final int ODD_ROW_BACKGROUNDRGB color for table odd row background (text, data, register displays)- See Also:
- Constant Field Values
-
ODD_ROW_FOREGROUND
public static final int ODD_ROW_FOREGROUNDRGB color for table odd row foreground (text, data, register displays)- See Also:
- Constant Field Values
-
TEXTSEGMENT_HIGHLIGHT_BACKGROUND
public static final int TEXTSEGMENT_HIGHLIGHT_BACKGROUNDRGB color for text segment highlighted background- See Also:
- Constant Field Values
-
TEXTSEGMENT_HIGHLIGHT_FOREGROUND
public static final int TEXTSEGMENT_HIGHLIGHT_FOREGROUNDRGB color for text segment highlighted foreground- See Also:
- Constant Field Values
-
TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_BACKGROUND
public static final int TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_BACKGROUNDRGB color for text segment delay slot highlighted background- See Also:
- Constant Field Values
-
TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_FOREGROUND
public static final int TEXTSEGMENT_DELAYSLOT_HIGHLIGHT_FOREGROUNDRGB color for text segment delay slot highlighted foreground- See Also:
- Constant Field Values
-
DATASEGMENT_HIGHLIGHT_BACKGROUND
public static final int DATASEGMENT_HIGHLIGHT_BACKGROUNDRGB color for text segment highlighted background- See Also:
- Constant Field Values
-
DATASEGMENT_HIGHLIGHT_FOREGROUND
public static final int DATASEGMENT_HIGHLIGHT_FOREGROUNDRGB color for text segment highlighted foreground- See Also:
- Constant Field Values
-
REGISTER_HIGHLIGHT_BACKGROUND
public static final int REGISTER_HIGHLIGHT_BACKGROUNDRGB color for register highlighted background- See Also:
- Constant Field Values
-
REGISTER_HIGHLIGHT_FOREGROUND
public static final int REGISTER_HIGHLIGHT_FOREGROUNDRGB 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
-
getEditorSyntaxStyleByPosition
-
getDefaultEditorSyntaxStyleByPosition
-
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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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.UsegetBooleanSetting(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
Name of currently selected exception handler file.- Returns:
- String pathname of current exception handler file, empty if none.
-
getMemoryConfiguration
Returns identifier of current built-in memory configuration.- Returns:
- String identifier of current built-in memory configuration, empty if none.
-
getEditorFont
Current editor font. Retained for compatibility but replaced by:getFontByPosition(Settings.EDITOR_FONT)
- Returns:
- Font object for current editor font.
-
getFontByPosition
Retrieve a Font setting- Parameters:
fontSettingPosition
- constant that identifies which item- Returns:
- Font object for given item
-
getDefaultFontByPosition
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
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
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
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
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
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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSetting(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.UsesetBooleanSettingNonPersistent(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
Set name of exception handler file and write it to persistent storage.- Parameters:
newFilename
- name of exception handler file
-
setMemoryConfiguration
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
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
Store a Font setting- Parameters:
fontSettingPosition
- Constant that identifies the item the font goes withfont
- 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
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
Set Color object for specified settings key. Has no effect if key is invalid.- Parameters:
key
- the Setting keycolor
- the Color to save
-
setColorSettingByPosition
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
-
getBooleanSetting(int id)
with the appropriate boolean setting ID (e.g.