org.basex.gui.view
Class ViewNotifier

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

public final class ViewNotifier
extends java.lang.Object

This class stores all views in a window and notifies views of global changes.

Author:
Workgroup DBIS, University of Konstanz 2005-09, ISC License, Christian Gruen

Field Summary
 int hist
          History pointer.
static int MAXHIST
          Maximum history size.
 
Constructor Summary
ViewNotifier(GUI main)
          Constructor.
 
Method Summary
 void add(View v)
          Adds a new view.
 void context(Nodes 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 init()
          Notifies all views of a data reference change.
 void jump(Nodes nodes)
          Notifies all views of a context switch without storing nodes in the history.
 void layout()
          Notifies all views of layout changes.
 void mark(int mode, View vw)
          Notifies all views of a selection change.
 void mark(Nodes mark, View vw)
          Notifies all views of a selection change.
 java.lang.String tooltip(boolean back)
          Returns the last or next query string.
 void update()
          Notifies all views of updates in the data structure.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAXHIST

public static final int MAXHIST
Maximum history size.

See Also:
Constant Field Values

hist

public int hist
History pointer.

Constructor Detail

ViewNotifier

public ViewNotifier(GUI main)
Constructor.

Parameters:
main - reference to the main window
Method Detail

add

public void add(View v)
Adds a new view.

Parameters:
v - view to be added

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(Nodes 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(Nodes nodes,
                        boolean quick,
                        View vw)
    Notifies all views of a context change.

    Parameters:
    nodes - new context set
    quick - quick switch
    vw - the calling view

    jump

    public void jump(Nodes nodes)
    Notifies all views of a context switch without storing nodes in the history.

    Parameters:
    nodes - new context nodes

    update

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


    layout

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


    tooltip

    public java.lang.String tooltip(boolean back)
    Returns the last or next query string.

    Parameters:
    back - back/forward flag
    Returns:
    query string