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 serves as a container for all existing views. The observer pattern is used to inform all views on user interactions.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 int hist
          History pointer.
static int MAXHIST
          Maximum history size.
 
Constructor Summary
ViewNotifier(GUI main)
          Constructor.
 
Method Summary
 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 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 query(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
clone, equals, finalize, 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

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:

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 (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 java.lang.String query(boolean back)
Returns the last or next query string.

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