|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--gishur.awt.Symbolbar | +--gishur.awt.TraceBar
A TraceBar
is a Symbolbar
that support algorithm recording
via a Tracer
object. It uses the TraceExecutor
interface
to execute the algorithm collecting debugging information and the
TraceVisualizer
interface in order to visualize a recorded
TraceLabel
. The bar provides complete navigation through the recorded
algorithm.
The default images for the used buttons are stored at TraceSymbols
.
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static java.lang.String |
end_com
ActionEvent Label. |
static java.lang.String |
home_com
ActionEvent Label. |
static java.lang.String |
level_com
ActionEvent Label. |
static java.lang.String |
next_com
ActionEvent Label. |
static java.lang.String |
power_com
ActionEvent Label. |
static java.lang.String |
prev_com
ActionEvent Label. |
static java.lang.String |
slider_com
ActionEvent Label. |
static java.lang.String |
speed_com
ActionEvent Label. |
static java.lang.String |
start_com
ActionEvent Label. |
Fields inherited from class gishur.awt.Symbolbar |
ALIGN_LEFT, ALIGN_RIGHT, alignment, name |
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 | |
TraceBar(java.lang.String name)
|
Method Summary | |
void |
disableBar()
|
void |
doCommand(java.lang.String com)
|
void |
enableBar()
|
void |
generateMenu(java.awt.Menu menu)
Generates the standard menu bar for the TraceBar (according to
switched buttons). |
boolean |
goBackOnLevelDown()
|
float |
playbackFPS()
Returns the playback speed in frames per second. |
long |
playbackSpeed()
Returns the playback speed in milliseconds. |
void |
processActionEvent(java.awt.event.ActionEvent e)
Processes action events. |
void |
run()
The run method calls the visualization methods and controls the playback. |
void |
setButtonLabels(java.lang.String power_label,
java.lang.String start_label,
java.lang.String go_start_label,
java.lang.String prev_label,
java.lang.String slider_label,
java.lang.String next_label,
java.lang.String go_end_label,
java.lang.String level_label)
Sets the text labels of all buttons. |
void |
setButtons(boolean power,
boolean start,
boolean go_start,
boolean prev,
boolean slider,
boolean next,
boolean go_end,
boolean level,
boolean speed)
Sets the specified buttons. |
void |
setGoBackOnLevelDown(boolean gb)
|
void |
setPlaybackFPS(float fps)
Sets the playback speed in frames per second. |
void |
setPlaybackSpeed(long pause)
Sets the playback speed in milliseconds. |
void |
setTraceExecutor(TraceExecutor exec)
Sets the TraceExecutor , that manages algorithm execution. |
void |
setTraceVisualizer(TraceVisualizer visu)
Sets the TraceVisualizer for visualization of
the recorded TraceLabels . |
void |
setUseAfterLastStep(boolean al)
|
void |
setUseBeforeFirstStep(boolean bf)
|
void |
setUseThreadForExecution(boolean th)
|
void |
switchOff()
Switches the TraceBar off. |
void |
switchOn()
Switches the TraceBar on. |
boolean |
useAfterLastStep()
|
boolean |
useBeforeFirstStep()
|
boolean |
useThreadForExecution()
|
Methods inherited from class gishur.awt.Symbolbar |
add, addActionListener, addSymbolbarGrasp, clearAll, disableAll, element, element, enableAll, getBounds, getMinimumSize, getPreferredSize, getStatusTip, getToolTip, indexOf, insert, localize, paint, processEvent, processMouseEvent, processMouseMotionEvent, removeActionListener, set, stripDisabledImage, stripEnabledImage, stripImages, update |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String home_com
public static final java.lang.String end_com
public static final java.lang.String start_com
public static final java.lang.String power_com
public static final java.lang.String next_com
public static final java.lang.String prev_com
public static final java.lang.String level_com
public static final java.lang.String slider_com
public static final java.lang.String speed_com
Constructor Detail |
public TraceBar(java.lang.String name)
Method Detail |
public void setButtonLabels(java.lang.String power_label, java.lang.String start_label, java.lang.String go_start_label, java.lang.String prev_label, java.lang.String slider_label, java.lang.String next_label, java.lang.String go_end_label, java.lang.String level_label)
null
, the label will not be changed.public void setButtons(boolean power, boolean start, boolean go_start, boolean prev, boolean slider, boolean next, boolean go_end, boolean level, boolean speed)
power
- if true
then the power button will be addedstart
- if true
then the start button will be addedgo_start
- if true
then the go start button will be addedgo_prev
- if true
then the previous step button will be addedslider
- if true
then the step slider will be addednext
- if true
then the next step button will be addedgo_end
- if true
then the go end button will be addedlevel
- if true
then the level button will be addedspeed
- if true
then the speed button will be addedpublic void generateMenu(java.awt.Menu menu)
TraceBar
(according to
switched buttons).generateMenu
in class Symbolbar
menu
- the Menu
, where to add menu entries.public boolean useBeforeFirstStep()
public void setUseBeforeFirstStep(boolean bf)
public boolean useAfterLastStep()
public void setUseAfterLastStep(boolean al)
public boolean goBackOnLevelDown()
public void setGoBackOnLevelDown(boolean gb)
public boolean useThreadForExecution()
public void setUseThreadForExecution(boolean th)
public long playbackSpeed()
public void setPlaybackSpeed(long pause)
pause
- pause time between two frames in millisecondspublic void setPlaybackFPS(float fps)
fps
- frames per second for playbackpublic float playbackFPS()
public void enableBar()
public void disableBar()
public void switchOff()
TraceBar
off.public void switchOn()
TraceBar
on.public void setTraceExecutor(TraceExecutor exec)
TraceExecutor
, that manages algorithm execution.exec
- the algorithm executor to usepublic void setTraceVisualizer(TraceVisualizer visu)
TraceVisualizer
for visualization of
the recorded TraceLabels
.visu
- the TraceVisualizer
to usepublic void processActionEvent(java.awt.event.ActionEvent e)
processActionEvent
in class Symbolbar
e
- the action event to processpublic void doCommand(java.lang.String com)
public void run()
run
in interface java.lang.Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |