|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame aim4.gui.Viewer
public class Viewer
The viewer is a Graphical User Interface (GUI) that allows a user to run the AIM Simulator while watching the vehicles in real time.
Nested Class Summary | |
---|---|
class |
Viewer.SimThread
The simulation thread that holds the simulation process. |
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static double |
DEFAULT_SIM_SPEED
The number of simulation seconds per GUI second. |
static double |
DEFAULT_TARGET_FRAME_RATE
The number of screen updates per GUI second. |
static boolean |
IS_SHOW_IM_DEBUG_SHAPES_BY_DEFAULT
Whether or not the IM Shapes are shown by default. |
static boolean |
IS_SHOW_SIMULATION_TIME
Whether or not the current simulation time is shown on screen. |
static boolean |
IS_SHOW_VIN_BY_DEFAULT
Whether or not the simulator shows the vin of the vehicles on screen. |
static double |
TURBO_SIM_SPEED
The simulation speed (simulation seconds per GUI second) at or beyond which the turbo mode is on (i.e., the simulation will run as fast as possible) |
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Viewer(BasicSimSetup initSimSetup)
Create a new viewer object. |
|
Viewer(BasicSimSetup initSimSetup,
boolean isRunNow)
Create a new viewer object. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
Simulator |
getSimulator()
Get the simulator object. |
void |
highlightVehicle(int vin)
Highlight a vehicle immediately. |
void |
itemStateChanged(ItemEvent e)
|
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
void |
keyTyped(KeyEvent e)
|
void |
mouseClicked(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
setTargetFrameRate(double targetFrameRate)
Set the target frame rate. |
void |
setTargetSimSpeed(double simSpeed)
Set the target simulation speed. |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
public static final boolean IS_SHOW_SIMULATION_TIME
public static final boolean IS_SHOW_VIN_BY_DEFAULT
public static final boolean IS_SHOW_IM_DEBUG_SHAPES_BY_DEFAULT
public static final double DEFAULT_SIM_SPEED
TURBO_SIM_SPEED
, the simulation will run as fast as
possible.
public static final double DEFAULT_TARGET_FRAME_RATE
public static final double TURBO_SIM_SPEED
Constructor Detail |
---|
public Viewer(BasicSimSetup initSimSetup)
initSimSetup
- the initial simulation setuppublic Viewer(BasicSimSetup initSimSetup, boolean isRunNow)
initSimSetup
- the initial simulation setupisRunNow
- whether or not the simulation is run immediatelyMethod Detail |
---|
public Simulator getSimulator()
public void setTargetSimSpeed(double simSpeed)
simSpeed
- set the target simulation speedpublic void setTargetFrameRate(double targetFrameRate)
targetFrameRate
- the target frame ratepublic void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void itemStateChanged(ItemEvent e)
itemStateChanged
in interface ItemListener
public void highlightVehicle(int vin)
highlightVehicle
in interface ViewerDebugView
vin
- the VIN number of the vehicle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |