Package org.basex.gui.view
Class ViewNotifier
java.lang.Object
org.basex.gui.view.ViewNotifier
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNotifies all views of a context change.voidNotifies all views of a focus change.voidhist(boolean forward) Moves around in the internal history and notifies all views of a context change.voidinit()Notifies all views of a data reference change.voidlayout()Notifies all views of layout changes.voidNotifies all views of a selection change.voidNotifies all views of a selection change.query(boolean back) Returns the last or next query string.voidupdate()Notifies all views of updates in the data structure.
-
Field Details
-
MAXHIST
public static final int MAXHISTMaximum history size.- See Also:
-
hist
public int histHistory pointer.
-
-
Constructor Details
-
ViewNotifier
Constructor.- Parameters:
gui- reference to the main window
-
-
Method Details
-
init
public void init()Notifies all views of a data reference change. -
focus
Notifies all views of a focus change.- Parameters:
pre- focused pre valuevw- the calling view
-
mark
Notifies all views of a selection change.- Parameters:
mark- marked nodesvw- the calling view
-
mark
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 modevw- 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
Notifies all views of a context change.- Parameters:
nodes- new context set (may benullif root nodes are addressed)quick- quick switchvw- 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
Returns the last or next query string.- Parameters:
back- back/forward flag- Returns:
- query string
-