Package org.basex.gui

Class GUI

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants, BaseXWindow

public final class GUI extends JFrame implements BaseXWindow
This class is the main window of the GUI. It is the central instance for user interactions.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
See Also:
  • Field Details

    • context

      public final Context context
      Database Context.
    • gopts

      public final GUIOptions gopts
      GUI options.
    • notify

      public final ViewNotifier notify
      view notifier.
    • status

      public final GUIStatus status
      Status line.
    • input

      public final GUIInput input
      Input field.
    • filter

      public final AbstractButton 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
      Indicates if a running command or operation is updating.
  • Constructor Details

    • GUI

      public GUI(Context context, GUIOptions gopts)
      Default constructor.
      Parameters:
      context - database context
      gopts - gui options
  • Method Details

    • dispose

      public void dispose()
      Overrides:
      dispose in class Window
    • saveOptions

      public void saveOptions()
      Saves the current configuration.
    • setTitle

      public void setTitle()
      Sets the window title.
    • cursor

      public void cursor(Cursor cursor)
      Sets a cursor.
      Parameters:
      cursor - cursor to be set
    • cursor

      public void cursor(Cursor cursor, boolean enforce)
      Sets a cursor, enforcing a new look if necessary.
      Parameters:
      cursor - cursor to be set
      enforce - enforce new cursor
    • simpleQuery

      public void simpleQuery(String query)
      Launches a simple single-line query. Adds the default namespace if available.
      Parameters:
      query - expression to be run
    • execute

      public void execute(Command... cmd)
      Launches the specified commands in a separate thread. Commands are ignored if an update operation takes place.
      Parameters:
      cmd - commands to be executed
    • execute

      public void execute(boolean edit, Command... cmds)
      Launches the specified commands in a separate thread. Commands are ignored if an update operation takes place.
      Parameters:
      edit - call from editor view
      cmds - commands to be executed
    • stop

      public void stop()
      Stops the current command.
    • running

      public boolean running(int id)
      Checks if a command with the specified id is still running.
      Parameters:
      id - command id
      Returns:
      result of check
    • set

      public <T extends Option<V>, V> void set(T opt, V val)
      Sets an option if its value differs from current value and displays the command in the info view.
      Type Parameters:
      T - option type
      V - value type
      Parameters:
      opt - option to be set
      val - value
    • updateLayout

      public void updateLayout()
      Refreshes the layout.
    • layoutViews

      public void layoutViews()
      Updates the view layout.
    • refreshControls

      public void refreshControls(boolean result)
      Refreshes the menu and the buttons.
      Parameters:
      result - update number of results
    • fullscreen

      public void fullscreen(boolean full)
      Turns fullscreen mode on/off.
      Parameters:
      full - fullscreen flag
    • gui

      public GUI gui()
      Description copied from interface: BaseXWindow
      Returns the GUI.
      Specified by:
      gui in interface BaseXWindow
      Returns:
      GUI
    • dialog

      public BaseXDialog dialog()
      Description copied from interface: BaseXWindow
      Returns the dialog.
      Specified by:
      dialog in interface BaseXWindow
      Returns:
      dialog (can be null)
    • component

      public GUI component()
      Description copied from interface: BaseXWindow
      Returns the window reference.
      Specified by:
      component in interface BaseXWindow
      Returns:
      window