|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.princeton.toy.TImageManager
public class TImageManager
TImageManager is a class that manages the jpeg and gif files which Visual X-TOY uses. It maintains a group of unscaled images and a group of scaled images which are loaded an rescaled upon request only.
Field Summary | |
---|---|
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 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 String[][] |
UNSCALED_IMAGE_PATHS
The paths to all the unscaled images, relative to the root of the jar file. |
Method Summary | |
---|---|
static Icon |
getIcon(byte scaledGroupId,
int scale,
short index)
Returns the requested scaled image encapsulated in an icon. |
static Icon |
getIcon(byte unscaledGroupId,
short index)
Returns the requested unscaled image encapsulated in an icon. |
static Image |
getImage(byte scaledGroupId,
int scale,
short index)
Returns the requested scaled image. |
static 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final 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 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
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_ENTER_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_INTERRUPT_OFF
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_INTERRUPT_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_LOAD_OFF
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_LOAD_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_LOOK_OFF
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_LOOK_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_RESET_OFF
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_RESET_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_RUN_OFF
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_RUN_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_STEP_OFF
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_BUTTON_STEP_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LABEL_ADDR
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LABEL_DATA
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LABEL_INSTR
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LABEL_INWAIT
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LABEL_PC
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LABEL_READY
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LABEL_STDOUT
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_SWITCH_OFF
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_SWITCH_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LIGHT_OFF
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_LIGHT_ON
getImage(byte, int, short)
,
Constant Field Valuespublic static final short MACHINE_SCALED_DIGIT_BLANK
getImage(byte, int, short)
,
Constant Field Valuespublic 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
getImage(byte, int, short)
,
Constant Field Valuespublic static final short STDIO_SCALED_PUNCHCARD_UNSELECTED
getImage(byte, int, short)
,
Constant Field Valuespublic static final short STDIO_SCALED_PUNCHCARD_SELECTED
getImage(byte, int, short)
,
Constant Field ValuesMethod Detail |
---|
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 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 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 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 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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |