dsql
Class DSQLInterface

java.lang.Object
  extended bydsql.DSQLInterface
All Implemented Interfaces:
java.awt.event.ActionListener, javax.swing.event.CaretListener, java.awt.event.ComponentListener, javax.swing.event.DocumentListener, java.util.EventListener, javax.swing.event.UndoableEditListener, java.awt.event.WindowListener

public class DSQLInterface
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.ComponentListener, javax.swing.event.CaretListener, javax.swing.event.UndoableEditListener, javax.swing.event.DocumentListener, java.awt.event.WindowListener

The DSQL GUI.

Author:
Francois Paradis

Field Summary
protected static int NB_RECENT_FILES
           
protected static java.lang.String PROP_DIRECTORY
           
protected static java.lang.String PROP_FONT
           
protected static java.lang.String PROP_FONTSIZE
           
protected static java.lang.String PROP_POSX
           
protected static java.lang.String PROP_POSY
           
protected static java.lang.String PROP_RECENT
           
protected static java.lang.String PROP_SIZEX
           
protected static java.lang.String PROP_SIZEY
           
protected static java.lang.String PROP_TRACE
           
protected static java.util.Vector recentVector
           
 
Constructor Summary
DSQLInterface()
           
DSQLInterface(java.lang.String _fileName)
           
DSQLInterface(java.lang.String _fileName, int x, int y)
           
 
Method Summary
protected  boolean abortOpen()
          checks if file needs to be saved and aborts if user asks to save it and then cancels
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void caretUpdate(javax.swing.event.CaretEvent ev)
           
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
protected  boolean chooseYesNo(java.lang.String msg, java.lang.String title)
           
protected  int chooseYesNoCancel(java.lang.String msg, java.lang.String title)
           
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
protected  void createActionTable(javax.swing.text.JTextComponent textComponent)
           
protected  javax.swing.JTextArea createEditArea()
           
protected  javax.swing.JFileChooser createFileChooser()
           
protected  javax.swing.JMenuBar createMenuBar()
           
protected  javax.swing.JMenuItem createMenuItem(javax.swing.JMenu parentMenu, java.lang.String txt)
           
protected  javax.swing.JMenuItem createMenuItem(javax.swing.JMenu parentMenu, java.lang.String txt, int mnemonic)
           
protected  javax.swing.JMenuItem createMenuItem(javax.swing.JMenu parentMenu, java.lang.String txt, int mnemonic, javax.swing.KeyStroke accelerator)
           
protected  javax.swing.JRadioButtonMenuItem createRadioButtonMenuItem(javax.swing.JMenu parentMenu, javax.swing.ButtonGroup group, java.lang.String txt, java.lang.String property)
           
protected  javax.swing.JFrame createWindow(java.lang.String _fileName)
           
protected  javax.swing.Action getActionByName(java.lang.String name)
           
 java.lang.String[] getCmdLineArgs()
           
protected  java.lang.String getProperty(java.lang.String key)
           
protected  java.lang.String getProperty(java.lang.String key, java.lang.String _default)
           
protected  int getPropertyInt(java.lang.String key)
           
protected  int getPropertyInt(java.lang.String key, int _default)
           
protected  java.lang.String getSystemDirectory(java.lang.String propName)
           
protected  void insertTag(java.lang.String tag)
           
protected  void insertTag(java.lang.String tag, java.lang.String attrs)
           
protected  void insertTag(java.lang.String tag, java.lang.String attrs, java.lang.String contents)
           
protected  void insertText(java.lang.String txt)
           
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
protected  void loadProperties()
           
protected  void openFile(java.lang.String _fileName)
           
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
protected  boolean saveDialog()
           
protected  void saveFile(java.lang.String _fileName)
           
protected  void saveProperties()
           
protected  void setExecuting(DSQL _thread)
           
protected  void setFileName(java.lang.String _fileName)
           
protected  void setFont(java.lang.String font, int size)
           
protected  void setProperty(java.lang.String key, int value)
           
protected  void setProperty(java.lang.String key, java.lang.String value)
           
protected  void setTrace(java.lang.String trace)
           
protected  void setupRecentMenu()
           
protected  void showError(java.lang.String msg, java.lang.String title)
           
 void undoableEditHappened(javax.swing.event.UndoableEditEvent evt)
           
protected  boolean unsavedEdits()
           
protected  void updateCurrentDirectory(javax.swing.JFileChooser fileChooser)
           
protected  void updateRecent()
           
protected  void updateSizePosition()
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NB_RECENT_FILES

protected static final int NB_RECENT_FILES
See Also:
Constant Field Values

recentVector

protected static final java.util.Vector recentVector

PROP_POSX

protected static final java.lang.String PROP_POSX
See Also:
Constant Field Values

PROP_POSY

protected static final java.lang.String PROP_POSY
See Also:
Constant Field Values

PROP_SIZEX

protected static final java.lang.String PROP_SIZEX
See Also:
Constant Field Values

PROP_SIZEY

protected static final java.lang.String PROP_SIZEY
See Also:
Constant Field Values

PROP_FONT

protected static final java.lang.String PROP_FONT
See Also:
Constant Field Values

PROP_FONTSIZE

protected static final java.lang.String PROP_FONTSIZE
See Also:
Constant Field Values

PROP_TRACE

protected static final java.lang.String PROP_TRACE
See Also:
Constant Field Values

PROP_RECENT

protected static final java.lang.String PROP_RECENT
See Also:
Constant Field Values

PROP_DIRECTORY

protected static final java.lang.String PROP_DIRECTORY
See Also:
Constant Field Values
Constructor Detail

DSQLInterface

public DSQLInterface()

DSQLInterface

public DSQLInterface(java.lang.String _fileName)

DSQLInterface

public DSQLInterface(java.lang.String _fileName,
                     int x,
                     int y)
Method Detail

loadProperties

protected void loadProperties()

saveProperties

protected void saveProperties()

getPropertyInt

protected int getPropertyInt(java.lang.String key)

getPropertyInt

protected int getPropertyInt(java.lang.String key,
                             int _default)

getProperty

protected java.lang.String getProperty(java.lang.String key)

getProperty

protected java.lang.String getProperty(java.lang.String key,
                                       java.lang.String _default)

setProperty

protected void setProperty(java.lang.String key,
                           int value)

setProperty

protected void setProperty(java.lang.String key,
                           java.lang.String value)

getSystemDirectory

protected java.lang.String getSystemDirectory(java.lang.String propName)

createWindow

protected javax.swing.JFrame createWindow(java.lang.String _fileName)

createEditArea

protected javax.swing.JTextArea createEditArea()

createMenuBar

protected javax.swing.JMenuBar createMenuBar()

createMenuItem

protected javax.swing.JMenuItem createMenuItem(javax.swing.JMenu parentMenu,
                                               java.lang.String txt)

createMenuItem

protected javax.swing.JMenuItem createMenuItem(javax.swing.JMenu parentMenu,
                                               java.lang.String txt,
                                               int mnemonic)

createMenuItem

protected javax.swing.JMenuItem createMenuItem(javax.swing.JMenu parentMenu,
                                               java.lang.String txt,
                                               int mnemonic,
                                               javax.swing.KeyStroke accelerator)

createRadioButtonMenuItem

protected javax.swing.JRadioButtonMenuItem createRadioButtonMenuItem(javax.swing.JMenu parentMenu,
                                                                     javax.swing.ButtonGroup group,
                                                                     java.lang.String txt,
                                                                     java.lang.String property)

setFileName

protected void setFileName(java.lang.String _fileName)

insertText

protected void insertText(java.lang.String txt)

insertTag

protected void insertTag(java.lang.String tag)

insertTag

protected void insertTag(java.lang.String tag,
                         java.lang.String attrs)

insertTag

protected void insertTag(java.lang.String tag,
                         java.lang.String attrs,
                         java.lang.String contents)

createFileChooser

protected javax.swing.JFileChooser createFileChooser()

unsavedEdits

protected boolean unsavedEdits()

openFile

protected void openFile(java.lang.String _fileName)

saveFile

protected void saveFile(java.lang.String _fileName)

saveDialog

protected boolean saveDialog()

showError

protected void showError(java.lang.String msg,
                         java.lang.String title)

chooseYesNo

protected boolean chooseYesNo(java.lang.String msg,
                              java.lang.String title)

chooseYesNoCancel

protected int chooseYesNoCancel(java.lang.String msg,
                                java.lang.String title)

setFont

protected void setFont(java.lang.String font,
                       int size)

setTrace

protected void setTrace(java.lang.String trace)

setExecuting

protected void setExecuting(DSQL _thread)

updateSizePosition

protected void updateSizePosition()

updateCurrentDirectory

protected void updateCurrentDirectory(javax.swing.JFileChooser fileChooser)

updateRecent

protected void updateRecent()

setupRecentMenu

protected void setupRecentMenu()

createActionTable

protected void createActionTable(javax.swing.text.JTextComponent textComponent)

getActionByName

protected javax.swing.Action getActionByName(java.lang.String name)

abortOpen

protected boolean abortOpen()
checks if file needs to be saved and aborts if user asks to save it and then cancels


getCmdLineArgs

public java.lang.String[] getCmdLineArgs()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

caretUpdate

public void caretUpdate(javax.swing.event.CaretEvent ev)
Specified by:
caretUpdate in interface javax.swing.event.CaretListener

undoableEditHappened

public void undoableEditHappened(javax.swing.event.UndoableEditEvent evt)
Specified by:
undoableEditHappened in interface javax.swing.event.UndoableEditListener

componentHidden

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

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

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

componentShown

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

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

windowActivated

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

windowClosed

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

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

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

windowDeiconified

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

windowIconified

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

windowOpened

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