|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
net.jimmc.spelsim.SpelCanvas
public class SpelCanvas
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Panel |
---|
java.awt.Panel.AccessibleAWTPanel |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
ALG_FORWARD
|
static int |
ALG_FORWARD_CIRCULAR
|
static int |
ALG_TRAPEZOID
|
static int |
MAX_ALG_VALUE
|
static int |
VIEW_SCALE_BOUNDING
|
static int |
VIEW_SCALE_FIXED
|
static int |
VIEW_SCALE_PLANET
|
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
SpelCanvas(SpelSim sim)
|
Method Summary | |
---|---|
void |
addSimListener(ISimListener listener)
|
protected void |
drawBrokenElementCount(java.awt.Graphics2D g)
|
protected void |
drawScale(java.awt.Graphics2D g,
double scale)
Draw the current scale into the window. |
protected void |
drawTime(java.awt.Graphics2D g)
Draw the current time value into the window. |
int |
getAlgorithm()
|
java.lang.String |
getBrokenElementCountString()
|
Cable |
getCable()
|
double |
getCwDerating()
Get the CW derating. |
double |
getDampingFactor()
Get the damping factor. |
double |
getGroundDrag()
Get the ground drag. |
java.lang.String |
getGroundedElementCountString()
|
double |
getMaxRefreshRate()
Get the maximum refresh rate. |
Planet |
getPlanet()
|
java.awt.Dimension |
getPreferredSize()
|
java.lang.String |
getRunStatus()
|
double |
getSimStepSize()
|
double |
getSimulationSpeed()
Get the simulation speed. |
java.lang.String |
getStatusString()
|
double |
getTicksPerSecond()
Get the number of simulation ticks per second. |
double |
getTime()
|
void |
paint(java.awt.Graphics graphics)
|
void |
reset()
Reset the simulation. |
void |
run()
|
void |
setAlgorithm(int alg)
Set the step integration algorithm to use. |
void |
setCwDerating(double df)
Set the CW derating to use. |
void |
setDampingFactor(double df)
Set the damping factor to use. |
void |
setDebugOutput(boolean enabled)
Set the debug flag. |
void |
setGroundDrag(double drag)
Set the ground drag to use. |
void |
setMaxRefreshRate(double maxPerSecond)
Set the maximum refresh rate. |
void |
setPerspective(boolean perspective)
Set the perspective to use. |
void |
setSimEvents(SimEvent[] simEvents)
Set the simulation events. |
void |
setSimStepSize(double simSeconds)
Set the size of each simulation step in sim-seconds. |
void |
setTicksPerSecond(double d)
Set the number of simulation ticks we perform per second. |
void |
setViewScale(int viewScale)
Set the scale/view to use. |
protected void |
simulateEvents()
|
protected void |
simulateOneStep()
Simulate one clock tick. |
void |
start()
|
void |
step()
|
void |
stop()
|
protected void |
waitForTick()
Wait for the next simulation tick. |
Methods inherited from class java.awt.Panel |
---|
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int VIEW_SCALE_FIXED
public static final int VIEW_SCALE_BOUNDING
public static final int VIEW_SCALE_PLANET
public static final int ALG_FORWARD
public static final int ALG_FORWARD_CIRCULAR
public static final int ALG_TRAPEZOID
public static final int MAX_ALG_VALUE
Constructor Detail |
---|
public SpelCanvas(SpelSim sim)
Method Detail |
---|
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Container
public void setSimStepSize(double simSeconds)
public double getSimStepSize()
public void setTicksPerSecond(double d)
public double getTicksPerSecond()
public double getSimulationSpeed()
public void setDampingFactor(double df)
public double getDampingFactor()
public void setCwDerating(double df)
public double getCwDerating()
public void setGroundDrag(double drag)
public double getGroundDrag()
public void setMaxRefreshRate(double maxPerSecond)
public double getMaxRefreshRate()
public void setPerspective(boolean perspective)
perspective
- True to use the planet's perspective, false to
use sidereal perspective.public void setViewScale(int viewScale)
viewScale
- One of the VIEW_SCALE_* constants.public void setAlgorithm(int alg)
alg
- One of the ALG_* constants.public int getAlgorithm()
public void setDebugOutput(boolean enabled)
enabled
- True to print debug output.public void setSimEvents(SimEvent[] simEvents)
public void addSimListener(ISimListener listener)
public void start()
public void stop()
public void step()
public void reset()
public void run()
run
in interface java.lang.Runnable
protected void simulateOneStep()
protected void simulateEvents()
protected void waitForTick()
public void paint(java.awt.Graphics graphics)
paint
in class java.awt.Container
protected void drawScale(java.awt.Graphics2D g, double scale)
protected void drawTime(java.awt.Graphics2D g)
g
- The unmodified Graphics for our drawing windowpublic java.lang.String getRunStatus()
public double getTime()
public java.lang.String getBrokenElementCountString()
public java.lang.String getGroundedElementCountString()
public java.lang.String getStatusString()
protected void drawBrokenElementCount(java.awt.Graphics2D g)
public Cable getCable()
public Planet getPlanet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |