Class ViewNotifier

java.lang.Object
org.basex.gui.view.ViewNotifier

public final class ViewNotifier extends Object
This class serves as a container for all existing views. The observer pattern is used to inform all views on user interactions.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    History pointer.
    static final int
    Maximum history size.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    context(DBNodes nodes, boolean quick, View vw)
    Notifies all views of a context change.
    void
    focus(int pre, View vw)
    Notifies all views of a focus change.
    void
    hist(boolean forward)
    Moves around in the internal history and notifies all views of a context change.
    void
    Notifies all views of a data reference change.
    void
    Notifies all views of layout changes.
    void
    mark(int mode, View vw)
    Notifies all views of a selection change.
    void
    mark(DBNodes mark, View vw)
    Notifies all views of a selection change.
    query(boolean back)
    Returns the last or next query string.
    void
    Notifies all views of updates in the data structure.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAXHIST

      public static final int MAXHIST
      Maximum history size.
      See Also:
    • hist

      public int hist
      History pointer.
  • Constructor Details

    • ViewNotifier

      public ViewNotifier(GUI gui)
      Constructor.
      Parameters:
      gui - reference to the main window
  • Method Details

    • init

      public void init()
      Notifies all views of a data reference change.
    • focus

      public void focus(int pre, View vw)
      Notifies all views of a focus change.
      Parameters:
      pre - focused pre value
      vw - the calling view
    • mark

      public void mark(DBNodes mark, View vw)
      Notifies all views of a selection change.
      Parameters:
      mark - marked nodes
      vw - the calling view
    • mark

      public void mark(int mode, View vw)
      Notifies all views of a selection change. The mode flag determines what happens:
      • 0: set currently focused node as marked node
      • 1: add currently focused node
      • 2: toggle currently focused node
      Parameters:
      mode - mark mode
      vw - the calling view
    • hist

      public void hist(boolean forward)
      Moves around in the internal history and notifies all views of a context change.
      Parameters:
      forward - move forward or backward
    • context

      public void context(DBNodes nodes, boolean quick, View vw)
      Notifies all views of a context change.
      Parameters:
      nodes - new context set (may be null if root nodes are addressed)
      quick - quick switch
      vw - the calling view
    • update

      public void update()
      Notifies all views of updates in the data structure.
    • layout

      public void layout()
      Notifies all views of layout changes.
    • query

      public String query(boolean back)
      Returns the last or next query string.
      Parameters:
      back - back/forward flag
      Returns:
      query string