|
|||||||||
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.Window
java.awt.Frame
ciips.animation.AlgAnimFrame
The AlgAnimFrame
class is a top-level window with a title
and border. The layout used is BorderLayout. There is a menubar
created at the north part of the panel. The drawing panel is at the
center and a commentary panel is located at the south.
This extended frame class holds a set references to the panel/frame objects used in the algorithm animation.
Frame
,
Serialized FormNested Class Summary |
Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
static int |
COMPANEL_LINES
|
static int |
UI_SELECTED
Value returned by getSelected() when user input has been selected |
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 java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
AlgAnimFrame(AlgAnimApp parentApp,
java.net.URL sourceURL)
Creates and shows the frame consists of a drawing panel, commentary panel and control panel. |
Method Summary | |
boolean |
action(java.awt.Event e,
java.lang.Object arg)
Action handler for the buttons and choice buttons in the control panel. |
void |
clearPanels()
|
void |
drawBeforeLabel(ShadowLabel label)
Shuffles the images down and draws a label on the "before" image (the one immediately preceding the current one |
void |
finishAlg()
This method is invoked at the end of the animation or when the stop button is pressed. |
AlgThread |
getAlg()
Returns the reference to the AlgThread which contains the details and execution sequences of the algorithm. |
AlgAnimApp |
getApplet()
Get the applet which contains a button to start up this window. |
BasicDrawingPanel |
getBeforeDp()
|
ComPanel |
getComPanel()
Get the commentary panel that displays messages of any type. |
DrawingPanel |
getCurrentPanel()
|
int |
getDataChoice()
Get the index of selected choice from the 'Select' pull menu. |
java.lang.String |
getDataFileName()
|
int |
getDelay()
Get the delay for highlighting text. |
java.awt.CheckboxMenuItem |
getDisableAnim()
Get the menu item which specify if the animation is disabled. |
BasicDrawingPanel[] |
getDrawingPanel()
Returns an instance of the drawing panel which is cast to its super class Panel . |
java.awt.CheckboxMenuItem |
getEnableAnim()
Get the menu item which specify if the animation is enabled. |
NamedIntList |
getNamedIntList(int k)
|
boolean[] |
getOptions()
Get the option settings |
static DrawingPanel |
getPanel()
|
BasicDrawingPanel |
getPreviousPanel()
|
java.awt.Button |
getRunItem()
Get the run button from the control panel. |
java.awt.Button |
getSkipItem()
Get the skip button from the control panel. |
java.awt.Button |
getStopItem()
Get the stop button from the control panel. |
TextFrame |
getTextFrame()
Returns an instance of the TextFrame used to set the layout
constraints and highlight certain lines of the source code. |
UIFrame |
getUIFrame()
Return a reference to the user input frame |
boolean |
handleEvent(java.awt.Event event)
Event handler of the frame. |
void |
Highlight(int n)
Highlights the specified line of the source code on the text panel. |
static void |
highlightText(int n)
|
boolean |
isNoAnim()
Obtain the status of the preferred animation style. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
|
static AlgAnimFrame |
makeAlgAnimFrame(AlgAnimApp parentApp,
java.net.URL sourceURL)
|
static void |
pause()
|
static void |
pauseSkip()
|
static void |
pauseStep()
|
java.awt.Dimension |
preferredSize()
Returns the preferred size of the frame. |
void |
restoreDrawingPanel()
Restore the drawing panel at the end of the animation or during initialization. |
void |
setDelay(int delay)
Set the delay for highlighting text. |
void |
setDimension(java.awt.Dimension size)
Sets the size of the frame. |
void |
setDrawingPanel(DrawingPanel panel)
Sets the drawing panel which is cast to its super class Panel . |
void |
setSkip(boolean skip)
Sets the attribute which indicate if the skip execution mode is current. |
void |
setStep(boolean step)
Sets the attribute which indicate if the step execution mode is current. |
void |
setText(int n,
java.lang.String s)
Sets the text string to be displayed on a specific text field on the commentary panel return from getComPanel . |
static void |
showText(int n,
java.lang.String s)
|
void |
startAlg()
Start the animation algorithm if the run or step button is pressed. |
void |
waitSkip()
This method is called when the skip execution mode is used. |
void |
waitStep()
This method is called when the step execution mode is used. |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree |
Methods inherited from class java.awt.Component |
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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, 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, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
public static int COMPANEL_LINES
public static final int UI_SELECTED
Constructor Detail |
public AlgAnimFrame(AlgAnimApp parentApp, java.net.URL sourceURL)
parentApp
- The applet which results in the creation of this framesourceURL
- The URL of the source code to be displayed on the text
frameURL
Method Detail |
public boolean[] getOptions()
public java.lang.String getDataFileName()
public java.awt.Dimension preferredSize()
public void setDimension(java.awt.Dimension size)
size
- The desired sized of the frame.public boolean handleEvent(java.awt.Event event)
public boolean action(java.awt.Event e, java.lang.Object arg)
e
- Event invokedarg
- Object that invokes the eventpublic void setText(int n, java.lang.String s)
getComPanel
.
n
- The text field to display the string. First is 0.s
- The string to be displayed.getComPanel()
public void Highlight(int n)
n
- The line to be highlighted.public void restoreDrawingPanel()
public void startAlg()
public void finishAlg()
public void waitStep()
public void waitSkip()
public void setSkip(boolean skip)
public void setStep(boolean step)
public AlgThread getAlg()
AlgThread
public UIFrame getUIFrame()
UIFrame
public void setDelay(int delay)
public int getDelay()
public AlgAnimApp getApplet()
public BasicDrawingPanel[] getDrawingPanel()
Panel
.
public BasicDrawingPanel getBeforeDp()
public void drawBeforeLabel(ShadowLabel label)
public void setDrawingPanel(DrawingPanel panel)
Panel
. This instance is used to set the GridBagConstraint
of the layout manager ??????.
DrawingPanel
public TextFrame getTextFrame()
TextFrame
used to set the layout
constraints and highlight certain lines of the source code.
TextFrame
public ComPanel getComPanel()
ComPanel
public int getDataChoice()
public java.awt.Button getSkipItem()
public java.awt.Button getRunItem()
public java.awt.Button getStopItem()
public boolean isNoAnim()
public java.awt.CheckboxMenuItem getEnableAnim()
public java.awt.CheckboxMenuItem getDisableAnim()
public DrawingPanel getCurrentPanel()
public BasicDrawingPanel getPreviousPanel()
public NamedIntList getNamedIntList(int k)
public static AlgAnimFrame makeAlgAnimFrame(AlgAnimApp parentApp, java.net.URL sourceURL)
public static void pause()
public static void pauseStep()
public static void pauseSkip()
public static void highlightText(int n)
public static void showText(int n, java.lang.String s)
public static DrawingPanel getPanel()
public void clearPanels()
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |