Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hsqldb.util
Class DatabaseManagerSwing  view DatabaseManagerSwing download DatabaseManagerSwing.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byjavax.swing.JApplet
                      extended byorg.hsqldb.util.DatabaseManagerSwing
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, java.awt.event.WindowListener

public class DatabaseManagerSwing
extends javax.swing.JApplet
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.KeyListener

Swing Tool for manageing a JDBC database.

             Usage: java DatabaseManagerSwing [-options]
             where options include:
              -driver   jdbc driver class
              -url           jdbc url
              -user          username used for connection
              -password  password for this user
              -dir           default directory
              -script        reads from script file

Version:
1.7.0

Nested Class Summary
 
Nested classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Nested classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
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
(package private)  boolean bHelp
           
(package private)  javax.swing.JButton butExecute
           
(package private)  java.sql.Connection cConn
           
(package private) static java.lang.String defDirectory
           
(package private) static java.lang.String defDriver
           
(package private) static java.lang.String defPassword
           
(package private) static java.lang.String defScript
           
(package private) static java.lang.String defURL
           
(package private) static java.lang.String defUser
           
(package private)  java.sql.DatabaseMetaData dMeta
           
(package private)  javax.swing.JSplitPane ewSplitPane
           
(package private)  javax.swing.JFrame fMain
           
(package private)  GridSwing gResult
           
(package private)  javax.swing.JTable gResultTable
           
(package private)  javax.swing.JScrollPane gScrollPane
           
(package private)  java.lang.String ifHuge
           
(package private) static int iMaxRecent
           
(package private)  int iRecent
           
(package private)  int iResult
           
(package private)  javax.swing.JToolBar jtoolbar
           
(package private)  long lTime
           
(package private)  javax.swing.JMenu mRecent
           
(package private) static java.lang.String NL
           
(package private)  javax.swing.JSplitPane nsSplitPane
           
(package private)  javax.swing.JPanel pResult
           
(package private)  javax.swing.tree.DefaultMutableTreeNode rootNode
           
(package private)  java.lang.String[] sRecent
           
(package private)  java.sql.Statement sStatement
           
(package private)  javax.swing.tree.DefaultTreeModel treeModel
           
(package private)  javax.swing.JScrollPane tScrollPane
           
(package private)  javax.swing.JTree tTree
           
(package private)  javax.swing.JTextArea txtCommand
           
(package private)  javax.swing.JScrollPane txtCommandScroll
           
(package private)  javax.swing.JTextArea txtResult
           
(package private)  javax.swing.JScrollPane txtResultScroll
           
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.applet.Applet
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
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
DatabaseManagerSwing()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ev)
          This method is invoked when an action occurs.
private  void addMenu(javax.swing.JMenuBar b, java.lang.String name, java.lang.String[] items)
           
private  void addMenuItems(javax.swing.JMenu f, java.lang.String[] m)
           
private  void addToRecent(java.lang.String s)
           
private  void clear()
           
private  void connect(java.sql.Connection c)
           
protected  javax.swing.JToolBar createToolBar()
           
private  void execute()
           
private  void formatResultSet(java.sql.ResultSet r)
           
 void init()
          This method is called when the applet is first loaded, before start().
private  void initGUI()
           
private  void insertTestData()
           
 void keyPressed(java.awt.event.KeyEvent k)
          This method is called when a key is pressed.
 void keyReleased(java.awt.event.KeyEvent k)
          This method is called when a key is released.
 void keyTyped(java.awt.event.KeyEvent k)
          This method is called when a key is typed.
(package private)  void main()
           
static void main(java.lang.String[] arg)
           
private  javax.swing.tree.DefaultMutableTreeNode makeNode(java.lang.Object userObject, javax.swing.tree.MutableTreeNode parent)
           
protected  void refreshTree()
           
private  void showHelp(java.lang.String[] help)
           
private  void showResultInText()
          Method declaration
private static void showUsage()
           
private  void testPerformance()
           
private  void updateResult()
           
 void windowActivated(java.awt.event.WindowEvent e)
          This method is called when a window is activated.
 void windowClosed(java.awt.event.WindowEvent e)
          This method is called when the window is closed.
 void windowClosing(java.awt.event.WindowEvent ev)
          This method is called when the user calls the system menu close function, giving the program a chance to cancel the close.
 void windowDeactivated(java.awt.event.WindowEvent e)
          This method is called when the window is deactivated.
 void windowDeiconified(java.awt.event.WindowEvent e)
          This method is called when the window is deiconified.
 void windowIconified(java.awt.event.WindowEvent e)
          This method is called when the window is iconified.
 void windowOpened(java.awt.event.WindowEvent e)
          This method is called when the window is made visible.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getPreferredSize, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, 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, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NL

static final java.lang.String NL

iMaxRecent

static int iMaxRecent

cConn

java.sql.Connection cConn

dMeta

java.sql.DatabaseMetaData dMeta

sStatement

java.sql.Statement sStatement

mRecent

javax.swing.JMenu mRecent

sRecent

java.lang.String[] sRecent

iRecent

int iRecent

txtCommand

javax.swing.JTextArea txtCommand

txtCommandScroll

javax.swing.JScrollPane txtCommandScroll

butExecute

javax.swing.JButton butExecute

tTree

javax.swing.JTree tTree

tScrollPane

javax.swing.JScrollPane tScrollPane

treeModel

javax.swing.tree.DefaultTreeModel treeModel

rootNode

javax.swing.tree.DefaultMutableTreeNode rootNode

pResult

javax.swing.JPanel pResult

lTime

long lTime

iResult

int iResult

gResult

GridSwing gResult

gResultTable

javax.swing.JTable gResultTable

gScrollPane

javax.swing.JScrollPane gScrollPane

txtResult

javax.swing.JTextArea txtResult

txtResultScroll

javax.swing.JScrollPane txtResultScroll

nsSplitPane

javax.swing.JSplitPane nsSplitPane

ewSplitPane

javax.swing.JSplitPane ewSplitPane

bHelp

boolean bHelp

fMain

javax.swing.JFrame fMain

ifHuge

java.lang.String ifHuge

jtoolbar

javax.swing.JToolBar jtoolbar

defDriver

static java.lang.String defDriver

defURL

static java.lang.String defURL

defUser

static java.lang.String defUser

defPassword

static java.lang.String defPassword

defScript

static java.lang.String defScript

defDirectory

static java.lang.String defDirectory
Constructor Detail

DatabaseManagerSwing

public DatabaseManagerSwing()
Method Detail

init

public void init()
Description copied from class: java.applet.Applet
This method is called when the applet is first loaded, before start(). The default implementation does nothing; override to do any one-time initialization.


main

public static void main(java.lang.String[] arg)

connect

private void connect(java.sql.Connection c)

showUsage

private static void showUsage()

insertTestData

private void insertTestData()

main

void main()

addMenu

private void addMenu(javax.swing.JMenuBar b,
                     java.lang.String name,
                     java.lang.String[] items)

addMenuItems

private void addMenuItems(javax.swing.JMenu f,
                          java.lang.String[] m)

keyPressed

public void keyPressed(java.awt.event.KeyEvent k)
Description copied from interface: java.awt.event.KeyListener
This method is called when a key is pressed.

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent k)
Description copied from interface: java.awt.event.KeyListener
This method is called when a key is released.

Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent k)
Description copied from interface: java.awt.event.KeyListener
This method is called when a key is typed. A key is considered typed when it and all modifiers have been pressed and released, mapping to a single virtual key.

Specified by:
keyTyped in interface java.awt.event.KeyListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ev)
Description copied from interface: java.awt.event.ActionListener
This method is invoked when an action occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

showHelp

private void showHelp(java.lang.String[] help)

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when a window is activated. Only Frames and Dialogs can be active, and the active window always contains the component with focus.

Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is deactivated.

Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is closed.

Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is deiconified.

Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is iconified.

Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is made visible.

Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent ev)
Description copied from interface: java.awt.event.WindowListener
This method is called when the user calls the system menu close function, giving the program a chance to cancel the close.

Specified by:
windowClosing in interface java.awt.event.WindowListener

clear

private void clear()

execute

private void execute()

updateResult

private void updateResult()

formatResultSet

private void formatResultSet(java.sql.ResultSet r)

testPerformance

private void testPerformance()

showResultInText

private void showResultInText()
Method declaration


addToRecent

private void addToRecent(java.lang.String s)

initGUI

private void initGUI()

makeNode

private javax.swing.tree.DefaultMutableTreeNode makeNode(java.lang.Object userObject,
                                                         javax.swing.tree.MutableTreeNode parent)

refreshTree

protected void refreshTree()

createToolBar

protected javax.swing.JToolBar createToolBar()