edu.princeton.toy
public class TImageManager extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static short |
MACHINE_SCALED_BUTTON_ENTER_OFF
The index of the unlit state of the Enter button.
|
static short |
MACHINE_SCALED_BUTTON_ENTER_ON
The index of the lit state of the Enter button.
|
static short |
MACHINE_SCALED_BUTTON_INTERRUPT_OFF
The index of the unlit state of the Interrupt button.
|
static short |
MACHINE_SCALED_BUTTON_INTERRUPT_ON
The index of the lit state of the Interrupt button.
|
static short |
MACHINE_SCALED_BUTTON_LOAD_OFF
The index of the unlit state of the Load button.
|
static short |
MACHINE_SCALED_BUTTON_LOAD_ON
The index of the lit state of the Load button.
|
static short |
MACHINE_SCALED_BUTTON_LOOK_OFF
The index of the unlit state of the Look button.
|
static short |
MACHINE_SCALED_BUTTON_LOOK_ON
The index of the lit state of the Look button.
|
static short |
MACHINE_SCALED_BUTTON_RESET_OFF
The index of the unlit state of the Reset button.
|
static short |
MACHINE_SCALED_BUTTON_RESET_ON
The index of the lit state of the Reset button.
|
static short |
MACHINE_SCALED_BUTTON_RUN_OFF
The index of the unlit state of the Run button.
|
static short |
MACHINE_SCALED_BUTTON_RUN_ON
The index of the lit state of the Run button.
|
static short |
MACHINE_SCALED_BUTTON_STEP_OFF
The index of the unlit state of the Step button.
|
static short |
MACHINE_SCALED_BUTTON_STEP_ON
The index of the lit state of the Step button.
|
static short |
MACHINE_SCALED_DIGIT_BLANK
The index of the blank LCD digit.
|
static short[] |
MACHINE_SCALED_DIGITS
The indices of the LCD Digits.
|
static byte |
MACHINE_SCALED_IMAGE_GROUP
The index of the machine scaled image group.
|
static short |
MACHINE_SCALED_LABEL_ADDR
The index of the "ADDR" label.
|
static short |
MACHINE_SCALED_LABEL_DATA
The index of the "DATA" label.
|
static short |
MACHINE_SCALED_LABEL_INSTR
The index of the "INSTR" label.
|
static short |
MACHINE_SCALED_LABEL_INWAIT
The index of the "INWAIT" label.
|
static short |
MACHINE_SCALED_LABEL_PC
The index of the "PC" label.
|
static short |
MACHINE_SCALED_LABEL_READY
The index of the "READY" label.
|
static short |
MACHINE_SCALED_LABEL_STDOUT
The index of the "STDOUT" label.
|
static short |
MACHINE_SCALED_LIGHT_OFF
The index of the unlit state of the light.
|
static short |
MACHINE_SCALED_LIGHT_ON
The index of the lit state of the light.
|
static short |
MACHINE_SCALED_SWITCH_OFF
The index of the down state of the switch.
|
static short |
MACHINE_SCALED_SWITCH_ON
The index of the up state of the switch.
|
static int[] |
MAX_SCALE
The maximum scale to which the images can be scaled.
|
static int[] |
ORIGINAL_IMAGE_SCALES
The scale by which the raw images are loaded.
|
static short |
REGULAR_UNSCALED_CHECK_SYNTAX_ICON
The index of the check syntax icon for the toolbar.
|
static short |
REGULAR_UNSCALED_DEBUG_MODE_ICON_OFF
The index of the debug mode off icon for the toolbar.
|
static short |
REGULAR_UNSCALED_DEBUG_MODE_ICON_ON
The index of the debug mode on icon for the toolbar.
|
static short |
REGULAR_UNSCALED_EDIT_MODE_ICON_OFF
The index of the edit mode off icon for the toolbar.
|
static short |
REGULAR_UNSCALED_EDIT_MODE_ICON_ON
The index of the edit mode on icon for the toolbar.
|
static short |
REGULAR_UNSCALED_FRAME_ICON_OTHER_OS
The index of the icon for the frame.
|
static short |
REGULAR_UNSCALED_FRAME_ICON_WINDOWS
The index of the icon for the frame.
|
static byte |
REGULAR_UNSCALED_IMAGE_GROUP
The index of the regular unscaled image group.
|
static short |
REGULAR_UNSCALED_INTERRUPT_ICON
The index of the interrupt icon for the toolbar.
|
static short |
REGULAR_UNSCALED_NEW_ICON
The index of the new icon for the toolbar.
|
static short |
REGULAR_UNSCALED_OPEN_EXAMPLE_ICON
The index of the open example icon for the toolbar.
|
static short |
REGULAR_UNSCALED_OPEN_ICON
The index of the open icon for the toolbar.
|
static short |
REGULAR_UNSCALED_RESET_ICON
The index of the reset icon for the toolbar.
|
static short |
REGULAR_UNSCALED_RUN_ICON
The index of the run icon for the toolbar.
|
static short |
REGULAR_UNSCALED_SAVE_ALL_ICON
The index of the save all icon for the toolbar.
|
static short |
REGULAR_UNSCALED_SAVE_AS_ICON
The index of the save as icon for the toolbar.
|
static short |
REGULAR_UNSCALED_SAVE_ICON
The index of the save icon for the toolbar.
|
static short |
REGULAR_UNSCALED_SIM_MODE_ICON_OFF
The index of the sim mode off icon for the toolbar.
|
static short |
REGULAR_UNSCALED_SIM_MODE_ICON_ON
The index of the sim mode on icon for the toolbar.
|
static short |
REGULAR_UNSCALED_STEP_ICON
The index of the step icon for the toolbar.
|
static java.lang.String[][] |
SCALED_IMAGE_PATHS
The paths to all the scaled images, relative to the root of the jar file.
|
static byte |
STARTUP_UNSCALED_IMAGE_GROUP
The index of the startup unscaled image group.
|
static short |
STARTUP_UNSCALED_SPLASH_BACKGROUND
The index of the splash window's background
|
static byte |
STDIO_SCALED_IMAGE_GROUP
The index of the stdio scaled image group.
|
static short |
STDIO_SCALED_PUNCHCARD_DISABLED
The index of the punch card in its disabled state.
|
static short |
STDIO_SCALED_PUNCHCARD_SELECTED
The index of the punch card in its selected state.
|
static short |
STDIO_SCALED_PUNCHCARD_UNSELECTED
The index of the punch card in its unselected state.
|
static java.lang.String[][] |
UNSCALED_IMAGE_PATHS
The paths to all the unscaled images, relative to the root of the jar file.
|
Modifier and Type | Method and Description |
---|---|
static javax.swing.Icon |
getIcon(byte scaledGroupId,
int scale,
short index)
Returns the requested scaled image encapsulated in an icon.
|
static javax.swing.Icon |
getIcon(byte unscaledGroupId,
short index)
Returns the requested unscaled image encapsulated in an icon.
|
static java.awt.Image |
getImage(byte scaledGroupId,
int scale,
short index)
Returns the requested scaled image.
|
static java.awt.Image |
getImage(byte unscaledGroupId,
short index)
Returns the requested unscaled image.
|
static boolean |
isPrepared(byte unscaledGroupId)
Returns wheter or not a group of unscaled images has been prepared.
|
static boolean |
isPrepared(byte scaledGroupId,
int scale)
Returns wheter or not a group of scaled images has been prepared.
|
static void |
prepare(byte unscaledGroupId)
Returns only when a group of unscaled images has been prepared.
|
static void |
prepare(byte scaledGroupId,
int scale)
Returns only when a group of scaled images has been prepared.
|
public static final java.lang.String[][] UNSCALED_IMAGE_PATHS
public static final byte STARTUP_UNSCALED_IMAGE_GROUP
public static final short STARTUP_UNSCALED_SPLASH_BACKGROUND
public static final byte REGULAR_UNSCALED_IMAGE_GROUP
public static final short REGULAR_UNSCALED_FRAME_ICON_WINDOWS
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_FRAME_ICON_OTHER_OS
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_NEW_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_OPEN_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_OPEN_EXAMPLE_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_SAVE_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_SAVE_AS_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_SAVE_ALL_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_EDIT_MODE_ICON_OFF
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_EDIT_MODE_ICON_ON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_DEBUG_MODE_ICON_OFF
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_DEBUG_MODE_ICON_ON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_SIM_MODE_ICON_OFF
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_SIM_MODE_ICON_ON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_RESET_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_STEP_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_RUN_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_INTERRUPT_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final short REGULAR_UNSCALED_CHECK_SYNTAX_ICON
getImage(byte, short)
,
Constant Field Valuespublic static final java.lang.String[][] SCALED_IMAGE_PATHS
public static final int[] ORIGINAL_IMAGE_SCALES
getImage(byte, int, short)
public static final int[] MAX_SCALE
getImage(byte, int, short)
public static final byte MACHINE_SCALED_IMAGE_GROUP
public static final short MACHINE_SCALED_BUTTON_ENTER_OFF
public static final short MACHINE_SCALED_BUTTON_ENTER_ON
public static final short MACHINE_SCALED_BUTTON_INTERRUPT_OFF
public static final short MACHINE_SCALED_BUTTON_INTERRUPT_ON
public static final short MACHINE_SCALED_BUTTON_LOAD_OFF
public static final short MACHINE_SCALED_BUTTON_LOAD_ON
public static final short MACHINE_SCALED_BUTTON_LOOK_OFF
public static final short MACHINE_SCALED_BUTTON_LOOK_ON
public static final short MACHINE_SCALED_BUTTON_RESET_OFF
public static final short MACHINE_SCALED_BUTTON_RESET_ON
public static final short MACHINE_SCALED_BUTTON_RUN_OFF
public static final short MACHINE_SCALED_BUTTON_RUN_ON
public static final short MACHINE_SCALED_BUTTON_STEP_OFF
public static final short MACHINE_SCALED_BUTTON_STEP_ON
public static final short MACHINE_SCALED_LABEL_ADDR
public static final short MACHINE_SCALED_LABEL_DATA
public static final short MACHINE_SCALED_LABEL_INSTR
public static final short MACHINE_SCALED_LABEL_INWAIT
public static final short MACHINE_SCALED_LABEL_PC
public static final short MACHINE_SCALED_LABEL_READY
public static final short MACHINE_SCALED_LABEL_STDOUT
public static final short MACHINE_SCALED_SWITCH_OFF
public static final short MACHINE_SCALED_SWITCH_ON
public static final short MACHINE_SCALED_LIGHT_OFF
public static final short MACHINE_SCALED_LIGHT_ON
public static final short MACHINE_SCALED_DIGIT_BLANK
public static final short[] MACHINE_SCALED_DIGITS
getImage(byte, int, short)
public static final byte STDIO_SCALED_IMAGE_GROUP
public static final short STDIO_SCALED_PUNCHCARD_DISABLED
public static final short STDIO_SCALED_PUNCHCARD_UNSELECTED
public static final short STDIO_SCALED_PUNCHCARD_SELECTED
public static boolean isPrepared(byte unscaledGroupId)
unscaledGroupId
- The id of the group in question. An invalid value will result in
an ArrayIndexOutOfBoundsException.STARTUP_UNSCALED_IMAGE_GROUP
,
REGULAR_UNSCALED_IMAGE_GROUP
public static boolean isPrepared(byte scaledGroupId, int scale)
scaledGroupId
- The id of the group in question. An invalid value will result in
an ArrayIndexOutOfBoundsException.scale
- The scale in question. An invalid value will result in an
ArrayIndexOutOfBoundsException.STARTUP_UNSCALED_IMAGE_GROUP
,
REGULAR_UNSCALED_IMAGE_GROUP
public static void prepare(byte unscaledGroupId)
unscaledGroupId
- The id of the group in question. An invalid value will result in
an ArrayIndexOutOfBoundsException.public static void prepare(byte scaledGroupId, int scale)
scaledGroupId
- The id of the group in question. An invalid value will result in
an ArrayIndexOutOfBoundsException.scale
- The desired scale of the image. An invalid value will result in an
ArrayIndexOutOfBoundsException.public static java.awt.Image getImage(byte unscaledGroupId, short index)
unscaledGroupId
- The id of the group to which the image belongs. An invalid value will
result in an ArrayIndexOutOfBoundsException.index
- The index of the image in that group. An invalid value will result in an
ArrayIndexOutOfBoundsException.public static javax.swing.Icon getIcon(byte unscaledGroupId, short index)
unscaledGroupId
- The id of the group to which the image belongs. An invalid value will
result in an ArrayIndexOutOfBoundsException.index
- The index of the image in that group. An invalid value will result in an
ArrayIndexOutOfBoundsException.public static java.awt.Image getImage(byte scaledGroupId, int scale, short index)
scaledGroupId
- The id of the group to which the image belongs. An invalid value will
result in an ArrayIndexOutOfBoundsException.scale
- The desired scale of the image. An invalid value will result in an
ArrayIndexOutOfBoundsException.index
- The index of the image in that group. An invalid value will result in an
ArrayIndexOutOfBoundsException.public static javax.swing.Icon getIcon(byte scaledGroupId, int scale, short index)
scaledGroupId
- The id of the group to which the image belongs. An invalid value will
result in an ArrayIndexOutOfBoundsException.scale
- The desired scale of the image. An invalid value will result in an
ArrayIndexOutOfBoundsException.index
- The index of the image in that group. An invalid value will result in an
ArrayIndexOutOfBoundsException.