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

MainWindow Class Reference

The MainWindow class implements Grisu's main window. More...

Inheritance diagram for MainWindow:

GDataReader List of all members.

Public Slots

void slotLoad ()
 Opens a file.

void slotSave ()
 Saves the currently displayed structure.

void showStructureSlot ()
 Shows the current data as a structure.

void showTreeSlot ()
 Shows the current data as a tree.

void doubleKlickSlot (int)
 Handles double clicks.

void deleteDataSlot ()
 Deletes the currently selected data package.

void deleteAllDataSlot (void)
 Deletes all data packages.

void closeAllSlot ()
 Closes all data windows.

void viewIsClosing (ViewCanvas *view)
 This slot is called when a view window closes.

void optionsSlot ()
 Displays the "Structure Spacing" dialog.

void compareStructuresSlot ()
 Currently not used.

void compareTreesSlot ()
 Currently not used.

void optionChangedSlot ()
 Called when an option was changed.

void toggleAutoExpandSlot (void)
 Turns the "autoexpand reentrancies" option on or off.

void toggleFitSlot (void)
 Turns the "windows fit structure size" option on or off.

void toggleHighlightSlot (void)
 Turns the "highlight structures" option on or off.

void toggleAutoOpenSlot (void)
 Turns the "automatically open windows" option on or off.

void changeNormalColorSlot ()
 Displays the color selector dialog for the element.

void changeTypeColorSlot ()
 Displays the color selector dialog for the element.

void changeTextColorSlot ()
 Displays the color selector dialog for the element.

void changeErrorColorSlot ()
 Displays the color selector dialog for the element.

void changeBackgroundColorSlot ()
 Displays the color selector dialog for the element.

void changeTreeColorSlot ()
 Displays the color selector dialog for the element.

void changeTreeLineColorSlot ()
 Displays the color selector dialog for the element.

void changeLeafColorSlot ()
 Displays the color selector dialog for the element.

void changeArcLabelColorSlot ()
 Displays the color selector dialog for the element.

void changeArcLabelBgColorSlot ()
 Displays the color selector dialog for the element.

void changeHiddenColorSlot ()
 Displays the color selector dialog for the element.

void changeMarkerColorSlot ()
 Displays the color selector dialog for the element.

void changeFoundColorSlot ()
 Displays the color selector dialog for the element.

void changeDifferentNodesColorSlot ()
 Displays the color selector dialog for the element.

void changeNormalFontSlot ()
 Displays the font selector dialog for the element.

void changeTypeFontSlot ()
 Displays the font selector dialog for the element.

void changeTextFontSlot ()
 Displays the font selector dialog for the element.

void changeErrorFontSlot ()
 Displays the font selector dialog for the element.

void changeTreeFontSlot ()
 Displays the font selector dialog for the element.

void changeLeafFontSlot ()
 Displays the font selector dialog for the element.

void changeArcLabelFontSlot ()
 Displays the font selector dialog for the element.

void listSelectionChangedSlot ()
 Called when the selection in the list of available data packages changed.

void closeEvent (QCloseEvent *ev)
 Called when the main window closes.

void aboutGrisuSlot (void)
 Displays the "About Grisu" dialog.

void aboutKDESlot (void)
 Displays the "About KDE" dialog.

void previousStructureSlot (ViewCanvas *replace)
 Replaces the currently displayed structure or tree with the next data package in the list.

void nextStructureSlot (ViewCanvas *replace)
 Replaces the currently displayed structure or tree with the previous data package in the list.

void connectionStateSlot (unsigned char status, char *hostname, int port)
 Called when the status of the socket connection has changed.


Signals

void changeColorSignal (int, QWidget *)
 Emitted when the user wants to change a color.

void changeFontSignal (int)
 Emitted when the user wants to change a font.

void optionChangedSignal ()
 Emitted when the user changed an option.


Public Member Functions

 MainWindow (QWidget *parent=0, const char *name=0)
 Initializes the main window.

 ~MainWindow ()
 Deletes the instance and all its data members and closes the socket connection.

void updateListBox ()
 Updates the list box.

ViewCanvasnewViewWindow (Document *d, int what, int x=-1, int y=-1, int w=400, int h=400)
 Opens a new view window for the given document.

void loadDataFile (const char *fileName)
 Loads a GRISU data file and creates a new view window, if the user chose to automatically open view windows.

virtual void processData (GBuffer *buffer)
 This method is called by the data exchange manager when new data has arrived.


Protected Attributes

KMenuBar * mainMenu
 Pointer to the main menu.

QPopupMenu * fileMenu
 Pointer to the File menu.

QPopupMenu * dataMenu
 Pointer to the Data menu.

QPopupMenu * helpMenu
 Pointer to the help (Info) menu.

QPopupMenu * optionMenu
 Pointer to the Options menu.

QPopupMenu * windowMenu
 Pointer to the Window menu.

QPopupMenu * colorMenu
 Pointer to the Options|Colors menu.

QPopupMenu * fontMenu
 Pointer to the Options|Font menu.

KStatusBar * statusBar
 Pointer to the status bar.

KToolBar * mainToolBar
 Pointer to the toolbar.

QListBox * listBox
 The listbox widget that displays the list of data packages.


Private Member Functions

void compareStructuresOrTrees (int what)
 Compares two structures or trees.

void deleteData (bool selOnly)
 Deletes all data and closes associated views, if necessary.


Private Attributes

Q_OBJECT QList< ViewCanvas > * views
 The list of open view windows (instances of ViewCanvas).

bool closingAll
 This is set to true while executing a "Close All Views" command.

char hostname [500]
 The name of the host Grisu is running on.

int port
 The port number which is used for the socket connection.


Detailed Description

The MainWindow class implements Grisu's main window.

All user interactions with the main window are handled in this class.

Author:
Holger Wunsch


Constructor & Destructor Documentation

MainWindow::MainWindow QWidget *  parent = 0,
const char *  name = 0
 

Initializes the main window.

Creates the menu and the toolbar, connects menu and toolbar items to slots and initializes the socket connection by calling MainWindow#initializeSocket.

Parameters:
parent the parent widget
name the window name (appears in the title bar)

MainWindow::~MainWindow  ) 
 

Deletes the instance and all its data members and closes the socket connection.


Member Function Documentation

void MainWindow::aboutGrisuSlot void   )  [slot]
 

Displays the "About Grisu" dialog.

void MainWindow::aboutKDESlot void   )  [slot]
 

Displays the "About KDE" dialog.

void MainWindow::changeArcLabelBgColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeArcLabelColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeArcLabelFontSlot  )  [slot]
 

Displays the font selector dialog for the element.

void MainWindow::changeBackgroundColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeColorSignal int  ,
QWidget * 
[signal]
 

Emitted when the user wants to change a color.

void MainWindow::changeDifferentNodesColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeErrorColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeErrorFontSlot  )  [slot]
 

Displays the font selector dialog for the element.

void MainWindow::changeFontSignal int   )  [signal]
 

Emitted when the user wants to change a font.

void MainWindow::changeFoundColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeHiddenColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeLeafColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeLeafFontSlot  )  [slot]
 

Displays the font selector dialog for the element.

void MainWindow::changeMarkerColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeNormalColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeNormalFontSlot  )  [slot]
 

Displays the font selector dialog for the element.

void MainWindow::changeTextColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeTextFontSlot  )  [slot]
 

Displays the font selector dialog for the element.

void MainWindow::changeTreeColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeTreeFontSlot  )  [slot]
 

Displays the font selector dialog for the element.

void MainWindow::changeTreeLineColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeTypeColorSlot  )  [slot]
 

Displays the color selector dialog for the element.

void MainWindow::changeTypeFontSlot  )  [slot]
 

Displays the font selector dialog for the element.

void MainWindow::closeAllSlot  )  [slot]
 

Closes all data windows.

void MainWindow::closeEvent QCloseEvent *  ev  )  [slot]
 

Called when the main window closes.

void MainWindow::compareStructuresOrTrees int  what  )  [private]
 

Compares two structures or trees.

Warning:
The built-in structure comparison algorithm is currently incomplete. See comapre.cpp.

void MainWindow::compareStructuresSlot  )  [slot]
 

Currently not used.

void MainWindow::compareTreesSlot  )  [slot]
 

Currently not used.

void MainWindow::connectionStateSlot unsigned char  status,
char *  hostname,
int  port
[slot]
 

Called when the status of the socket connection has changed.

Parameters:
status the new connection status (a GDE_STATUS_xxxx constant, see GDataExchange)
hostname the name of the host Grisu is running on
port the number of the port used in the connection.

void MainWindow::deleteAllDataSlot void   )  [slot]
 

Deletes all data packages.

void MainWindow::deleteData bool  selOnly  )  [private]
 

Deletes all data and closes associated views, if necessary.

Parameters:
selOnly If selOnly is true, only selected items in the data list will be deleted, otherwise all items will be deleted.

void MainWindow::deleteDataSlot  )  [slot]
 

Deletes the currently selected data package.

void MainWindow::doubleKlickSlot int   )  [slot]
 

Handles double clicks.

void MainWindow::listSelectionChangedSlot  )  [slot]
 

Called when the selection in the list of available data packages changed.

void MainWindow::loadDataFile const char *  fileName  ) 
 

Loads a GRISU data file and creates a new view window, if the user chose to automatically open view windows.

Parameters:
fileName the name of the data file.

ViewCanvas * MainWindow::newViewWindow Document d,
int  what,
int  x = -1,
int  y = -1,
int  w = 400,
int  h = 400
 

Opens a new view window for the given document.

Parameters:
d the document to be shown
what The way how the data should be displayed, either as a structure (DRAW_STRUC), or as a tree (DRAW_TREE).
x the X coordinate of the window
y the Y coordinate of the window
w the width of the window
h the height of the window
Returns:
a pointer to the new view window widget.

void MainWindow::nextStructureSlot ViewCanvas replace  )  [slot]
 

Replaces the currently displayed structure or tree with the previous data package in the list.

Parameters:
replace the ViewCanvas that displays the data to be replaced.

void MainWindow::optionChangedSignal  )  [signal]
 

Emitted when the user changed an option.

void MainWindow::optionChangedSlot  )  [slot]
 

Called when an option was changed.

void MainWindow::optionsSlot  )  [slot]
 

Displays the "Structure Spacing" dialog.

void MainWindow::previousStructureSlot ViewCanvas replace  )  [slot]
 

Replaces the currently displayed structure or tree with the next data package in the list.

Parameters:
replace the ViewCanvas that displays the data to be replaced.

void MainWindow::processData GBuffer buffer  )  [virtual]
 

This method is called by the data exchange manager when new data has arrived.

Implements GDataReader.

void MainWindow::showStructureSlot  )  [slot]
 

Shows the current data as a structure.

void MainWindow::showTreeSlot  )  [slot]
 

Shows the current data as a tree.

void MainWindow::slotLoad  )  [slot]
 

Opens a file.

void MainWindow::slotSave  )  [slot]
 

Saves the currently displayed structure.

void MainWindow::toggleAutoExpandSlot void   )  [slot]
 

Turns the "autoexpand reentrancies" option on or off.

void MainWindow::toggleAutoOpenSlot void   )  [slot]
 

Turns the "automatically open windows" option on or off.

void MainWindow::toggleFitSlot void   )  [slot]
 

Turns the "windows fit structure size" option on or off.

void MainWindow::toggleHighlightSlot void   )  [slot]
 

Turns the "highlight structures" option on or off.

void MainWindow::updateListBox  ) 
 

Updates the list box.

void MainWindow::viewIsClosing ViewCanvas view  )  [slot]
 

This slot is called when a view window closes.

Parameters:
view a pointer to the closing view. No operations should be carried out on this pointer.


Member Data Documentation

bool MainWindow::closingAll [private]
 

This is set to true while executing a "Close All Views" command.

QPopupMenu* MainWindow::colorMenu [protected]
 

Pointer to the Options|Colors menu.

QPopupMenu* MainWindow::dataMenu [protected]
 

Pointer to the Data menu.

QPopupMenu* MainWindow::fileMenu [protected]
 

Pointer to the File menu.

QPopupMenu* MainWindow::fontMenu [protected]
 

Pointer to the Options|Font menu.

QPopupMenu* MainWindow::helpMenu [protected]
 

Pointer to the help (Info) menu.

char MainWindow::hostname[500] [private]
 

The name of the host Grisu is running on.

QListBox* MainWindow::listBox [protected]
 

The listbox widget that displays the list of data packages.

KMenuBar* MainWindow::mainMenu [protected]
 

Pointer to the main menu.

KToolBar* MainWindow::mainToolBar [protected]
 

Pointer to the toolbar.

QPopupMenu* MainWindow::optionMenu [protected]
 

Pointer to the Options menu.

int MainWindow::port [private]
 

The port number which is used for the socket connection.

KStatusBar* MainWindow::statusBar [protected]
 

Pointer to the status bar.

Q_OBJECT QList<ViewCanvas>* MainWindow::views [private]
 

The list of open view windows (instances of ViewCanvas).

QPopupMenu* MainWindow::windowMenu [protected]
 

Pointer to the Window menu.


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