org.basex.gui
Class GUI

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by org.basex.gui.AGUI
                          extended by org.basex.gui.GUI
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public final class GUI
extends AGUI

This class is the main window of the GUI. It is the central instance for user interactions.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 BaseXBack buttons
          Button panel.
 EditorView editor
          Search view.
 BaseXButton filter
          Filter button.
 boolean fullscreen
          Fullscreen flag.
 InfoView info
          Info view.
 InfoListener infoListener
          Info listener.
 GUIInput input
          Input field.
 BaseXBack nav
          Navigation/input panel.
 ViewNotifier notify
          View Manager.
 boolean painting
          Painting flag; if activated, interactive operations are skipped.
static PasswordReader READER
          Password reader.
 GUIStatus status
          Status line.
 boolean updating
          Updating flag; if activated, operations accessing the data are skipped.
 
Fields inherited from class org.basex.gui.AGUI
context, gprop
 
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
GUI(Context ctx, GUIProp gprops)
          Default constructor.
 
Method Summary
 void dispose()
           
 void execute(boolean edit, Command... cmd)
          Launches the specified commands in a separate thread.
 void execute(Command cmd)
          Launches the specified command in a separate thread.
 void fullscreen()
          Turns fullscreen mode on/off.
 void fullscreen(boolean full)
          Turns fullscreen mode on/off.
 void layoutViews()
          Updates the view layout.
 void refreshControls()
          Refreshes the menu and the buttons.
 void set(java.lang.Object[] pr, java.lang.Object val)
          Sets a property and displays the command in the info view.
 void stop()
          Stops the current process.
 void updateControl(javax.swing.JComponent comp, boolean show, java.lang.String layout)
          Updates the control panel.
 void updateLayout()
          Refreshes the layout.
 void xquery(java.lang.String qu, boolean edit)
          Launches a query.
 
Methods inherited from class org.basex.gui.AGUI
cursor, cursor, setTitle
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, 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, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

notify

public final ViewNotifier notify
View Manager.


status

public final GUIStatus status
Status line.


input

public final GUIInput input
Input field.


filter

public final BaseXButton filter
Filter button.


editor

public final EditorView editor
Search view.


info

public final InfoView info
Info view.


painting

public boolean painting
Painting flag; if activated, interactive operations are skipped.


updating

public boolean updating
Updating flag; if activated, operations accessing the data are skipped.


fullscreen

public boolean fullscreen
Fullscreen flag.


buttons

public final BaseXBack buttons
Button panel.


nav

public final BaseXBack nav
Navigation/input panel.


READER

public static final PasswordReader READER
Password reader.


infoListener

public final InfoListener infoListener
Info listener.

Constructor Detail

GUI

public GUI(Context ctx,
           GUIProp gprops)
Default constructor.

Parameters:
ctx - database context
gprops - gui properties
Method Detail

dispose

public void dispose()
Overrides:
dispose in class java.awt.Window

xquery

public void xquery(java.lang.String qu,
                   boolean edit)
Launches a query. Adds the default namespace, if available. The command is ignored if an update operation takes place.

Parameters:
qu - query to be run
edit - editor panel

execute

public void execute(Command cmd)
Launches the specified command in a separate thread. The command is ignored if an update operation takes place.

Parameters:
cmd - command to be launched

execute

public void execute(boolean edit,
                    Command... cmd)
Launches the specified commands in a separate thread. The command is ignored if an update operation takes place.

Parameters:
edit - call from editor view
cmd - command to be launched

stop

public void stop()
Stops the current process.


set

public void set(java.lang.Object[] pr,
                java.lang.Object val)
Sets a property and displays the command in the info view.

Parameters:
pr - property to be set
val - value

updateLayout

public void updateLayout()
Refreshes the layout.


updateControl

public void updateControl(javax.swing.JComponent comp,
                          boolean show,
                          java.lang.String layout)
Updates the control panel.

Parameters:
comp - component to be updated
show - true if component is visible
layout - component layout

layoutViews

public void layoutViews()
Updates the view layout.


refreshControls

public void refreshControls()
Refreshes the menu and the buttons.


fullscreen

public void fullscreen()
Turns fullscreen mode on/off.


fullscreen

public void fullscreen(boolean full)
Turns fullscreen mode on/off.

Parameters:
full - fullscreen mode