tapeutils.gui
Class ConversionFrame

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Frame
                  extended byjavax.swing.JFrame
                      extended bytapeutils.gui.ConversionFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, AnalysisListener, java.awt.event.ComponentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants, java.awt.event.WindowListener

public class ConversionFrame
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.ComponentListener, AnalysisListener

This class provides a utility to convert from a sample file to a (ZX81) .P file.

Author:
hldswrth
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
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 java.lang.String DIALOG_HELP_TITLE
          The listing dialog title.
static java.lang.String DIALOG_LISTING_TITLE
          The listing dialog title.
static java.lang.String DIALOG_PREFERENCES_TITLE
          The settings dialog title.
static java.lang.String DIALOG_RESULTS_TITLE
          The results dialog title.
static java.lang.String DIALOG_SETTINGS_TITLE
          The settings dialog title.
static java.lang.String FRAME_ICON_FILE
          The main frame icon.
static java.lang.String FRAME_TITLE
          The main frame title.
static java.lang.String ZX81_ROM_FILE
          The ZX81 ROM file.
 
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
ConversionFrame()
          Default Constructor.
 
Method Summary
 void about()
          Displays the about dialog.
 void actionPerformed(java.awt.event.ActionEvent evt)
          Processes an action event in the window.
 void addToolTipText(java.awt.Component parent, javax.swing.JComponent component, java.lang.String componentName)
          Get the tool tip text for the given component.
 void analysisComplete(AnalysisEvent event)
          Handle an analysis completion event.
 void closeSample(int sampleNum)
          Close the given sample file.
 void componentHidden(java.awt.event.ComponentEvent evt)
           
 void componentMoved(java.awt.event.ComponentEvent evt)
          Handle the moving of a component.
 void componentResized(java.awt.event.ComponentEvent evt)
           
 void componentShown(java.awt.event.ComponentEvent evt)
           
 javax.swing.JButton createButton(java.awt.Component parent, java.lang.String componentName, char mnemonic, boolean parentIsActionListener)
          Create a button.
 javax.swing.JCheckBox createCheckBox(java.awt.Component parent, java.lang.String componentName)
          Create a check box.
 javax.swing.JLabel createLabel(java.awt.Component parent, java.lang.String componentName)
          Create a label.
 javax.swing.JTextField createTextField(java.awt.Component parent, java.lang.String componentName, int width)
          Create a text field.
 void errorLoadingFile(java.io.File f, java.lang.Throwable exc)
          Deal with an error loading a file.
 void errorSavingFile(java.io.File f, java.lang.Throwable exc)
          Deal with an error saving a file.
 void initialize(TapeConverter converter)
          One-off initialization of the frame for the given Converter.
 void locateWindow(java.awt.Window window)
          Set the location of the window.
 void notImplemented(java.lang.String function)
          Display a function not implemented diaog.
 void saveSample(int sampleNum, boolean chooseFile)
          Save the given sample file.
 void setStartIndex(int sampleNumber, int index)
          Set the displayed index of the sample canvas(es).
 void showHelp(java.awt.Component component)
          Show the help dialog with the given component's topic.
 void showHelp(java.lang.String helpId)
          Show the help dialog with the given topic.
 void showListDialog(byte[] content)
          Show the list dialog.
 void unexpectedError(java.lang.String message)
          Display an unexpected error message.
 void unexpectedError(java.lang.String message, java.lang.Throwable exc)
          Display an unexpected exception details.
 void windowActivated(java.awt.event.WindowEvent evt)
           
 void windowClosed(java.awt.event.WindowEvent evt)
           
 void windowClosing(java.awt.event.WindowEvent evt)
          Handles window closing events.
 void windowDeactivated(java.awt.event.WindowEvent evt)
           
 void windowDeiconified(java.awt.event.WindowEvent evt)
           
 void windowIconified(java.awt.event.WindowEvent evt)
           
 void windowMoved(java.awt.Window window)
          Handle the moving of a dialog.
 void windowOpened(java.awt.event.WindowEvent evt)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, 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, 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, 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, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, transferFocusDownCycle, 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, 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, handleEvent, 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

FRAME_TITLE

public static final java.lang.String FRAME_TITLE
The main frame title.

See Also:
Constant Field Values

FRAME_ICON_FILE

public static final java.lang.String FRAME_ICON_FILE
The main frame icon.

See Also:
Constant Field Values

ZX81_ROM_FILE

public static final java.lang.String ZX81_ROM_FILE
The ZX81 ROM file.

See Also:
Constant Field Values

DIALOG_RESULTS_TITLE

public static final java.lang.String DIALOG_RESULTS_TITLE
The results dialog title.

See Also:
Constant Field Values

DIALOG_SETTINGS_TITLE

public static final java.lang.String DIALOG_SETTINGS_TITLE
The settings dialog title.

See Also:
Constant Field Values

DIALOG_PREFERENCES_TITLE

public static final java.lang.String DIALOG_PREFERENCES_TITLE
The settings dialog title.

See Also:
Constant Field Values

DIALOG_LISTING_TITLE

public static final java.lang.String DIALOG_LISTING_TITLE
The listing dialog title.

See Also:
Constant Field Values

DIALOG_HELP_TITLE

public static final java.lang.String DIALOG_HELP_TITLE
The listing dialog title.

See Also:
Constant Field Values
Constructor Detail

ConversionFrame

public ConversionFrame()
Default Constructor.

Method Detail

initialize

public void initialize(TapeConverter converter)
One-off initialization of the frame for the given Converter.

Parameters:
converter - The Tape Converter.

addToolTipText

public void addToolTipText(java.awt.Component parent,
                           javax.swing.JComponent component,
                           java.lang.String componentName)
Get the tool tip text for the given component.

Parameters:
parent -
component -
componentName -

createButton

public javax.swing.JButton createButton(java.awt.Component parent,
                                        java.lang.String componentName,
                                        char mnemonic,
                                        boolean parentIsActionListener)
Create a button.

Parameters:
parent -
componentName -
mnemonic -
parentIsActionListener -
Returns:
The button.

createCheckBox

public javax.swing.JCheckBox createCheckBox(java.awt.Component parent,
                                            java.lang.String componentName)
Create a check box.

Parameters:
parent -
componentName -
Returns:
The check box.

createTextField

public javax.swing.JTextField createTextField(java.awt.Component parent,
                                              java.lang.String componentName,
                                              int width)
Create a text field.

Parameters:
parent -
componentName -
width -
Returns:
The text field

createLabel

public javax.swing.JLabel createLabel(java.awt.Component parent,
                                      java.lang.String componentName)
Create a label.

Parameters:
parent -
componentName -
Returns:
The label

locateWindow

public void locateWindow(java.awt.Window window)
Set the location of the window.

Parameters:
window -

windowMoved

public void windowMoved(java.awt.Window window)
Handle the moving of a dialog.

Parameters:
window -

analysisComplete

public void analysisComplete(AnalysisEvent event)
Handle an analysis completion event.

Specified by:
analysisComplete in interface AnalysisListener
Parameters:
event - An object representing the event.

errorLoadingFile

public void errorLoadingFile(java.io.File f,
                             java.lang.Throwable exc)
Deal with an error loading a file.

Parameters:
f - The file
exc - The exception.

errorSavingFile

public void errorSavingFile(java.io.File f,
                            java.lang.Throwable exc)
Deal with an error saving a file.

Parameters:
f - The file
exc - The exception.

saveSample

public void saveSample(int sampleNum,
                       boolean chooseFile)
Save the given sample file.

Parameters:
sampleNum - The sample number.
chooseFile - Indicates whether to choose a file.

closeSample

public void closeSample(int sampleNum)
Close the given sample file.

Parameters:
sampleNum - The sample number.

showListDialog

public void showListDialog(byte[] content)
Show the list dialog.

Parameters:
content - The program content.

notImplemented

public void notImplemented(java.lang.String function)
Display a function not implemented diaog.

Parameters:
function -

unexpectedError

public void unexpectedError(java.lang.String message)
Display an unexpected error message.

Parameters:
message -

unexpectedError

public void unexpectedError(java.lang.String message,
                            java.lang.Throwable exc)
Display an unexpected exception details.

Parameters:
message - The error message.
exc - The exception.

setStartIndex

public void setStartIndex(int sampleNumber,
                          int index)
Set the displayed index of the sample canvas(es).

Parameters:
sampleNumber - The sample number.
index - The index.

showHelp

public void showHelp(java.lang.String helpId)
Show the help dialog with the given topic.

Parameters:
helpId - The help topic Id.

about

public void about()
Displays the about dialog.


showHelp

public void showHelp(java.awt.Component component)
Show the help dialog with the given component's topic.

Parameters:
component - the component.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Processes an action event in the window.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
evt - The event.

windowClosing

public void windowClosing(java.awt.event.WindowEvent evt)
Handles window closing events.

Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
evt - The event.

windowActivated

public void windowActivated(java.awt.event.WindowEvent evt)
Specified by:
windowActivated in interface java.awt.event.WindowListener
Parameters:
evt -

windowClosed

public void windowClosed(java.awt.event.WindowEvent evt)
Specified by:
windowClosed in interface java.awt.event.WindowListener
Parameters:
evt -

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent evt)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener
Parameters:
evt -

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent evt)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener
Parameters:
evt -

windowIconified

public void windowIconified(java.awt.event.WindowEvent evt)
Specified by:
windowIconified in interface java.awt.event.WindowListener
Parameters:
evt -

windowOpened

public void windowOpened(java.awt.event.WindowEvent evt)
Specified by:
windowOpened in interface java.awt.event.WindowListener
Parameters:
evt -

componentMoved

public void componentMoved(java.awt.event.ComponentEvent evt)
Handle the moving of a component.

Specified by:
componentMoved in interface java.awt.event.ComponentListener
Parameters:
evt -

componentResized

public void componentResized(java.awt.event.ComponentEvent evt)
Specified by:
componentResized in interface java.awt.event.ComponentListener
Parameters:
evt -

componentShown

public void componentShown(java.awt.event.ComponentEvent evt)
Specified by:
componentShown in interface java.awt.event.ComponentListener
Parameters:
evt -

componentHidden

public void componentHidden(java.awt.event.ComponentEvent evt)
Specified by:
componentHidden in interface java.awt.event.ComponentListener
Parameters:
evt -