Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ViewCanvas Class Reference

The ViewCanvas displays the window containing feature structures and trees. More...

List of all members.

Public Slots

void saveSlot ()
 Called when the user clicked on the File|Save menu item.

void redrawSlot ()
 Repaints the contents of the Canvas object, then recalulates the window size (if the 'window fits structure size' option is turned on).

void toggleFitSlot (void)
 Toggles the 'window fits structure size' option, then repaints the window.

void toggleShowHiddenSlot (void)
 Toggles the 'show hidden nodes' option, then repaints the window.

void toggleHighlightSlot (void)
 Toggles the 'highlight structures' option, then repaints the window.

void expandReentranciesSlot ()
 Calls expandReentrancies, then repaints the window.

void quitWindowSlot ()
 Closes the window.

void showTreeSlot ()
 Switches the display mode to show a tree (if tree data is available.

void showStructureSlot ()
 Switches the display mode to show a structure.

void showStructureNewWindowSlot ()
 Opens a new ViewCanvas window, then shows the document displayed in the current window in the new window as a structure.

void showTreeNewWindowSlot ()
 Opens a new ViewCanvas window, then shows the document displayed in the current window in the new window as a tree (if tree data is available.

void printSlot ()
 Prints the contents of this window.

void searchSlot ()
 Opens a find dialog.

void findSlot ()
 Starts a new search with the argument entered in the find dialog.

void findNextSlot ()
 Finds the next occurence of a search term.

void cancelSearchSlot ()
 Closes the find dialog and deletes the current Finder isnatnce.

void resetStructureSlot ()
 Resets the structure so that it is displayed in the way it was sent by the backend (with respect to expanded nodes, hidden nodes etc.).

void hideUnhidePopupSlot ()
 Called in response to a user's hide/unhide node request in a popup menu.

void expandLocalPopupSlot ()
 Called in response to a user's expand reentrancy request in a popup menu.

void optionsSlot ()
 Shows the options dialog.

void raiseMainWindowSlot (void)
 Raises the main window (shows the main window on top of all other windows).

void previousStructureSlot (void)
 Shows the previous document in the list of available documents.

void nextStructureSlot (void)
 Shows the previous document in the list of available documents.

void renderLatexSlot (void)
 Writes the currently selected data package to a LaTeX file.


Signals

void redrawSignal ()
 This signal is emitted when the window must be repainted.

void previousStructureSignal (ViewCanvas *replace)
 This signal is raised when the previous available structure is to be shown on user request.

void nextStructureSignal (ViewCanvas *replace)
 This signal is raised when the next available structure is to be shown on user request.

void closing (ViewCanvas *thisWindow)
 Emitted when this window closes.


Public Member Functions

 ViewCanvas (Document *d, int what, Options *op, QWidget *parent=0, const char *name=0)
 The constructor sets up the view window.

 ~ViewCanvas ()
 Destroys this window, and all dependent windows (find dialogs, for example).

virtual void resizeEvent (QResizeEvent *ev)
 Called in reponse to a resize event.

void redraw ()
 Redraws this window.

void expandReentrancies (GenericNode *node, NodeAddress addr, QList< int > *expRef)
 Expands the first occurrence of any reentrancy within a structure.

void expandReentranciesTreeNode (TreeNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a TreeNode.

void expandReentranciesStrucNode (StrucNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a StrucNode.

void expandReentranciesFeatvalNode (FeatvalNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a FeatvalNode.

void expandReentranciesListNode (ListNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a ListNode.

void expandReentranciesTailNode (TailNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a TailNode.

void expandReentranciesSetNode (SetNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a SetNode.

void expandReentranciesRestNode (RestNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a RestNode.

void expandReentranciesRefNode (RefNode *node, NodeAddress addr, QList< int > *expRef)
 Expands a RefNode.

void expandReentranciesFunctionNode (FunctionNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a FunctionNode.

void expandReentranciesRelationNode (RelationNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a RelationNode.

void expandReentranciesDisjunctionNode (DisjunctionNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a DisjunctionNode.

void expandReentranciesConjunctionNode (ConjunctionNode *node, NodeAddress addr, QList< int > *expRef)
 Expands all RefNodes that occur in operands of a ConjunctionNode.

bool showsDoc (Document *doc)
 Tests whether this windows displays the given document.

void contextMenuSearch (char *searchTerm, const NodeAddress addr)
 Called when the user issued a search command from a context menu.

void setStatusBarMessage (const char *message)
 Changes the status bar message.


Public Attributes

Canvascanvas
 A pointer to the Canvas that does the actual drawing.

ScrollCanvasscrollCanvas
 Takes care of scrollbars.

int showing
 The current display mode of the data (structure or tree).

KStatusBar * statusBar
 The status bar.


Protected Member Functions

void closeEvent (QCloseEvent *ce)
 Closes this window and emits a closing signal.


Private Member Functions

void saveStructure (void)
 Saves the current structure or tree after prompting the user for the file name.


Private Attributes

Q_OBJECT Documentdocument
 The document displayed in this ViewCanvas.

Optionsoptions
 An instance of the Options class that specifies the user-set visible properties.

Finderfinder
 An instance of a Finder instance, if the user issued a "find structure" command.

KMenuBar * menuBar
 The main menu.

QPopupMenu * fileMenu
 The file menu.

QPopupMenu * editMenu
 The edit menu.

QPopupMenu * dataMenu
 The data menu.

QPopupMenu * optionsMenu
 The options menu.

QPopupMenu * windowMenu
 The window menu.

KToolBar * mainToolBar
 The main toolbar.

StrucFindDialogfindDlg
 If a structure find dialog was opened by the user, this points to the instance of the dialog, otherwise NULL.


Detailed Description

The ViewCanvas displays the window containing feature structures and trees.

The ViewCanvas class is one of the two central user interface classes in Grisu. The secondary windows that display feature structures or trees are instances of ViewCanvas. All user interactions with menus and toolbars are handled in this class.

Author:
Holger Wunsch


Constructor & Destructor Documentation

ViewCanvas::ViewCanvas Document d,
int  what,
Options op,
QWidget *  parent = 0,
const char *  name = 0
 

The constructor sets up the view window.

It initializes the menus and toolbars and creates a ScrollCanvas which in turn contains a Canvas, which takes care of the actual displaying of structures and trees.

Parameters:
d the document (data package) to be shown in this window.
what specifies whether the data is to presented as structure (DRAW_STRUC), or as tree (DRAW_TREE).
op a pointer to the global options object in MainWindow (MainWindow::globalOptions)
parent the parent widget
name this widget's name

ViewCanvas::~ViewCanvas  ) 
 

Destroys this window, and all dependent windows (find dialogs, for example).


Member Function Documentation

void ViewCanvas::cancelSearchSlot  )  [slot]
 

Closes the find dialog and deletes the current Finder isnatnce.

void ViewCanvas::closeEvent QCloseEvent *  ce  )  [protected]
 

Closes this window and emits a closing signal.

Parameters:
ce the event class

void ViewCanvas::closing ViewCanvas *  thisWindow  )  [signal]
 

Emitted when this window closes.

This is used to notify Grisu's main window, which maintains a list of all open ViewCanvas windows, that this window was closed.

Parameters:
thisWindow a pointer to this.

void ViewCanvas::contextMenuSearch char *  searchTerm,
const NodeAddress  addr
 

Called when the user issued a search command from a context menu.

This will start a search beginning at the node the user clicked on.

Parameters:
searchTerm the search term (usually the attribute's or a type's name etc.)
addr the address of the node the user clicked on.

void ViewCanvas::expandLocalPopupSlot  )  [slot]
 

Called in response to a user's expand reentrancy request in a popup menu.

void ViewCanvas::expandReentrancies GenericNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands the first occurrence of any reentrancy within a structure.

Parameters:
node The node data of the node to be expanded.
addr The node address.
expRef A list of IDs of that have been expanded so far. If later in the structure, a node with an ID is encountered that is already in this list, this node won't be expanded any more.

void ViewCanvas::expandReentranciesConjunctionNode ConjunctionNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a ConjunctionNode.

Parameters:
node the ConjunctionNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesDisjunctionNode DisjunctionNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a DisjunctionNode.

Parameters:
node the DisjunctionNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesFeatvalNode FeatvalNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a FeatvalNode.

Parameters:
node the FeatvalNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesFunctionNode FunctionNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a FunctionNode.

Parameters:
node the DisjunctionNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesListNode ListNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a ListNode.

Parameters:
node the DisjunctionNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesRefNode RefNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands a RefNode.

If the node ID of this RefNode isn't in the expRef list yet, the NODEFLAG_EXPANDED flag is set on this node's DisplayableNode.

Parameters:
node the RefNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesRelationNode RelationNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a RelationNode.

Parameters:
node the DisjunctionNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesRestNode RestNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a RestNode.

Parameters:
node the DisjunctionNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesSetNode SetNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a SetNode.

Parameters:
node the DisjunctionNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesSlot  )  [slot]
 

Calls expandReentrancies, then repaints the window.

void ViewCanvas::expandReentranciesStrucNode StrucNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a StrucNode.

Parameters:
node the StrucNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesTailNode TailNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a TailNode.

Parameters:
node the DisjunctionNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::expandReentranciesTreeNode TreeNode node,
NodeAddress  addr,
QList< int > *  expRef
 

Expands all RefNodes that occur in operands of a TreeNode.

Parameters:
node the TreeNode
addr the unique node address of the displayed node
expRef a list of linkids of node that have already been expanded to avoid multiple expansion.

void ViewCanvas::findNextSlot  )  [slot]
 

Finds the next occurence of a search term.

void ViewCanvas::findSlot  )  [slot]
 

Starts a new search with the argument entered in the find dialog.

void ViewCanvas::hideUnhidePopupSlot  )  [slot]
 

Called in response to a user's hide/unhide node request in a popup menu.

void ViewCanvas::nextStructureSignal ViewCanvas *  replace  )  [signal]
 

This signal is raised when the next available structure is to be shown on user request.

Parameters:
replace must be set to this.

void ViewCanvas::nextStructureSlot void   )  [slot]
 

Shows the previous document in the list of available documents.

If tree data is available, the document is displayed as a tree, otherwise as a structure (unless the document explictly overrides this by specifying !newdata(tree) or !newdata(structure).

This will actually close the current window and open a new window with the same size and position.

void ViewCanvas::optionsSlot  )  [slot]
 

Shows the options dialog.

void ViewCanvas::previousStructureSignal ViewCanvas *  replace  )  [signal]
 

This signal is raised when the previous available structure is to be shown on user request.

Parameters:
replace must be set to this.

void ViewCanvas::previousStructureSlot void   )  [slot]
 

Shows the previous document in the list of available documents.

If tree data is available, the document is displayed as a tree, otherwise as a structure (unless the document explictly overrides this by specifying !newdata(tree) or !newdata(structure).

This will actually close the current window and open a new window with the same size and position.

void ViewCanvas::printSlot  )  [slot]
 

Prints the contents of this window.

void ViewCanvas::quitWindowSlot  )  [slot]
 

Closes the window.

void ViewCanvas::raiseMainWindowSlot void   )  [slot]
 

Raises the main window (shows the main window on top of all other windows).

void ViewCanvas::redraw  ) 
 

Redraws this window.

Does nothing but emit a redrawSignal.

void ViewCanvas::redrawSignal  )  [signal]
 

This signal is emitted when the window must be repainted.

void ViewCanvas::redrawSlot  )  [slot]
 

Repaints the contents of the Canvas object, then recalulates the window size (if the 'window fits structure size' option is turned on).

void ViewCanvas::renderLatexSlot void   )  [slot]
 

Writes the currently selected data package to a LaTeX file.

void ViewCanvas::resetStructureSlot  )  [slot]
 

Resets the structure so that it is displayed in the way it was sent by the backend (with respect to expanded nodes, hidden nodes etc.).

void ViewCanvas::resizeEvent QResizeEvent *  ev  )  [virtual]
 

Called in reponse to a resize event.

Parameters:
ev the event class.

void ViewCanvas::saveSlot  )  [slot]
 

Called when the user clicked on the File|Save menu item.

void ViewCanvas::saveStructure void   )  [private]
 

Saves the current structure or tree after prompting the user for the file name.

void ViewCanvas::searchSlot  )  [slot]
 

Opens a find dialog.

void ViewCanvas::setStatusBarMessage const char *  message  ) 
 

Changes the status bar message.

Parameters:
message the new message.

bool ViewCanvas::showsDoc Document doc  ) 
 

Tests whether this windows displays the given document.

Parameters:
doc the document in question
Returns:
true if this window displays the given document, false otherwise.

void ViewCanvas::showStructureNewWindowSlot  )  [slot]
 

Opens a new ViewCanvas window, then shows the document displayed in the current window in the new window as a structure.

void ViewCanvas::showStructureSlot  )  [slot]
 

Switches the display mode to show a structure.

void ViewCanvas::showTreeNewWindowSlot  )  [slot]
 

Opens a new ViewCanvas window, then shows the document displayed in the current window in the new window as a tree (if tree data is available.

If there is no tree data, a structure is displayed instead).

void ViewCanvas::showTreeSlot  )  [slot]
 

Switches the display mode to show a tree (if tree data is available.

If there is no tree data, a structure is displayed instead).

void ViewCanvas::toggleFitSlot void   )  [slot]
 

Toggles the 'window fits structure size' option, then repaints the window.

void ViewCanvas::toggleHighlightSlot void   )  [slot]
 

Toggles the 'highlight structures' option, then repaints the window.

void ViewCanvas::toggleShowHiddenSlot void   )  [slot]
 

Toggles the 'show hidden nodes' option, then repaints the window.


Member Data Documentation

Canvas* ViewCanvas::canvas
 

A pointer to the Canvas that does the actual drawing.

QPopupMenu* ViewCanvas::dataMenu [private]
 

The data menu.

Q_OBJECT Document* ViewCanvas::document [private]
 

The document displayed in this ViewCanvas.

QPopupMenu* ViewCanvas::editMenu [private]
 

The edit menu.

QPopupMenu* ViewCanvas::fileMenu [private]
 

The file menu.

StrucFindDialog* ViewCanvas::findDlg [private]
 

If a structure find dialog was opened by the user, this points to the instance of the dialog, otherwise NULL.

Finder* ViewCanvas::finder [private]
 

An instance of a Finder instance, if the user issued a "find structure" command.

Otherwise, this is NULL.

KToolBar* ViewCanvas::mainToolBar [private]
 

The main toolbar.

KMenuBar* ViewCanvas::menuBar [private]
 

The main menu.

Options* ViewCanvas::options [private]
 

An instance of the Options class that specifies the user-set visible properties.

QPopupMenu* ViewCanvas::optionsMenu [private]
 

The options menu.

ScrollCanvas* ViewCanvas::scrollCanvas
 

Takes care of scrollbars.

int ViewCanvas::showing
 

The current display mode of the data (structure or tree).

KStatusBar* ViewCanvas::statusBar
 

The status bar.

QPopupMenu* ViewCanvas::windowMenu [private]
 

The window menu.


Generated on Sun Apr 27 18:26:58 2003 for Grisu by doxygen1.3