00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 void TGo4TreeViewer::CreateNewHist()
00024 {
00025
00026 TGo4MainWindow *fxMainWindow=(TGo4MainWindow *)fxTGo4GUIRegistry->GetMainWindow();
00027 fxMainWindow->CreateNewHist();
00028 }
00029
00030 void TGo4TreeViewer::init()
00031 {
00032
00033 fxTGo4GUIRegistry = TGo4GUIRegistry::Instance();
00034 fxTGo4TreeViewerSlots = dynamic_cast <TGo4TreeViewerSlots *> (fxTGo4GUIRegistry->GetSlotClass("TGo4TreeViewerSlots"));
00035 if(fxTGo4TreeViewerSlots !=0) {
00036 fxTGo4TreeViewerSlots->SetGUI(this);
00037 }else{
00038 fxTGo4TreeViewerSlots = new TGo4TreeViewerSlots ("TGo4TreeViewerSlots", "Slots Class for Qt GUI", this);
00039 }
00040 fxTGo4TreeViewerStatus = dynamic_cast <TGo4TreeViewerStatus *> (fxTGo4TreeViewerSlots->GetStatus());
00041 }
00042
00043 void TGo4TreeViewer::destroy()
00044 {
00045 fxTGo4TreeViewerSlots->SetGUI(0);
00046 }
00047
00048 void TGo4TreeViewer::ClearTreeEditLines()
00049 {
00050
00051 X_LineEdit->clear();
00052 Y_LineEdit->clear();
00053 Z_LineEdit->clear();
00054 HisName_LineEdit->clear();
00055 cut_LineEdit->clear();
00056 }
00057
00058 void TGo4TreeViewer::PlotTree()
00059 {
00060
00061 QString histogramname=HisName_LineEdit->text();
00062 if(histogramname.isEmpty())
00063 histogramname=X_LineEdit->text()+Y_LineEdit->text()+Z_LineEdit->text();
00064 if( (X_LineEdit->IsRemoteDrop() && Y_LineEdit->text().isEmpty() && Z_LineEdit->text().isEmpty())
00065 || (X_LineEdit->IsRemoteDrop() && Y_LineEdit->IsRemoteDrop() && Z_LineEdit->text().isEmpty())
00066 || (X_LineEdit->IsRemoteDrop() && Y_LineEdit->IsRemoteDrop() && Z_LineEdit->IsRemoteDrop()) )
00067 {
00069 QString theTree="";
00070 TGo4RemoteBrowserSlots* fxTGo4RemoteBrowserSlots = (TGo4RemoteBrowserSlots *) fxTGo4GUIRegistry->GetSlotClass("TGo4RemoteBrowserSlots");
00071 TGo4RemoteBrowser* fxTGo4RemoteBrowser = (TGo4RemoteBrowser *) fxTGo4GUIRegistry->GetGUIClass(fxTGo4RemoteBrowserSlots);
00072 QListViewItem* SelectedItem=fxTGo4RemoteBrowser->ListViewRemote->findItem(X_LineEdit->DropedString,0);
00073 if(SelectedItem==0) SelectedItem=fxTGo4RemoteBrowser->ListViewRemote->findItem(Y_LineEdit->DropedString,0);
00074 if(SelectedItem==0) SelectedItem=fxTGo4RemoteBrowser->ListViewRemote->findItem(Z_LineEdit->DropedString,0);
00075 while(SelectedItem!=0)
00076 {
00077 if(dynamic_cast<TGo4QTreeItem *>(SelectedItem)!=0)
00078 theTree=SelectedItem->text(0).data();
00079 SelectedItem= SelectedItem->parent();
00080 }
00081 fxTGo4TreeViewerSlots->RemoteTreeDraw(theTree, X_LineEdit->text(),Y_LineEdit->text(),Z_LineEdit->text(),cut_LineEdit->text(),histogramname);
00082 }
00083 else if( (!X_LineEdit->IsRemoteDrop() && Y_LineEdit->text().isEmpty() && Z_LineEdit->text().isEmpty())
00084 || (!X_LineEdit->IsRemoteDrop() && !Y_LineEdit->IsRemoteDrop() && Z_LineEdit->text().isEmpty())
00085 || (!X_LineEdit->IsRemoteDrop() && !Y_LineEdit->IsRemoteDrop() && !Z_LineEdit->IsRemoteDrop()) )
00086 {
00088 QApplication::setOverrideCursor( Qt::WaitCursor );
00089 fxTGo4TreeViewerSlots->TreeDraw(X_LineEdit->text(),Y_LineEdit->text(),Z_LineEdit->text(),cut_LineEdit->text(),histogramname);
00090 QApplication::restoreOverrideCursor();
00091 }
00092 else
00093 {
00094 QString text="Treeviewer ambiguity between local and remote. Please clear and drop leaves again.";
00095 TGo4MainWindow *MW= dynamic_cast<TGo4MainWindow *>(fxTGo4GUIRegistry->GetMainWindow());
00096 if(MW) MW->StatusMessage(text);
00097 }
00098 }
00099
00100
00101