vtkFetchMIResourceUploadWidget.h

Go to the documentation of this file.
00001 #ifndef __vtkFetchMIResourceUploadWidget_h
00002 #define __vtkFetchMIResourceUploadWidget_h
00003 
00004 
00005 #include "vtkFetchMIWin32Header.h"
00006 #include "vtkFetchMIMulticolumnWidget.h"
00007 #include "vtkFetchMILogic.h"
00008 #include <string>
00009 
00010 class vtkKWPushButtonWithLabel;
00011 class vtkKWPushButton;
00012 class vtkKWMenuButton;
00013 class vtkFetchMIIcons;
00014 class vtkKWLabel;
00015 class vtkKWTopLevel;
00016 class vtkKWEntry;
00017 
00018 class VTK_FETCHMI_EXPORT vtkFetchMIResourceUploadWidget : public vtkFetchMIMulticolumnWidget
00019 {
00020   
00021 public:
00022   static vtkFetchMIResourceUploadWidget* New();
00023   vtkTypeRevisionMacro(vtkFetchMIResourceUploadWidget,vtkFetchMIMulticolumnWidget);
00024   void PrintSelf(ostream& os, vtkIndent indent);
00025 
00026   // Description:
00027   // Get methods on class members ( no Set methods required. )
00028   vtkGetObjectMacro ( SelectAllButton, vtkKWPushButton);
00029   vtkGetObjectMacro ( DeselectAllButton, vtkKWPushButton);
00030   vtkGetObjectMacro ( UploadButton, vtkKWPushButton );
00031   vtkGetObjectMacro ( ApplyTagsButton, vtkKWPushButton );
00032   vtkGetObjectMacro ( RemoveTagsButton, vtkKWPushButton );
00033   vtkGetObjectMacro ( ShowTagsForAllButton, vtkKWPushButton );
00034   vtkGetObjectMacro ( FetchMIIcons, vtkFetchMIIcons );
00035   vtkGetObjectMacro ( Logic, vtkFetchMILogic );
00036   vtkSetObjectMacro ( Logic, vtkFetchMILogic );
00037   vtkGetObjectMacro ( CurrentTagLabel, vtkKWLabel );
00038   vtkGetObjectMacro (TaggingHelpButton, vtkKWPushButton );
00039   vtkGetObjectMacro (SelectTagMenuButton, vtkKWMenuButton );
00040 
00041   vtkGetObjectMacro (NewTagWindow, vtkKWTopLevel );
00042   vtkGetObjectMacro (AddNewTagEntry, vtkKWEntry);
00043   vtkGetObjectMacro (AddNewTagButton, vtkKWPushButton);
00044   vtkGetObjectMacro (AddNewValueEntry, vtkKWEntry);
00045   vtkGetObjectMacro (AddNewValueButton, vtkKWPushButton);
00046   vtkGetObjectMacro (AddNewTagLabel, vtkKWLabel );
00047   vtkGetObjectMacro (CloseNewTagWindowButton, vtkKWPushButton);
00048 
00049   // Description:
00050   // Get/Set on a new tag name added by user.
00051   vtkGetStringMacro (NewUserTag);
00052   vtkSetStringMacro (NewUserTag);
00053   // Description:
00054   // Get/Set on a new value added for a tag by user.
00055   vtkGetStringMacro (NewUserValue);
00056   vtkSetStringMacro (NewUserValue);  
00057 
00058   vtkGetStringMacro (TagToAddValuesTo);
00059   vtkSetStringMacro (TagToAddValuesTo);
00060   
00061   vtkGetMacro ( FileNameColumn, int );
00062   vtkSetMacro ( FileNameColumn, int );
00063   vtkGetMacro ( NodeNameColumn, int );
00064   vtkSetMacro ( NodeNameColumn, int );
00065 
00066   void RaiseTaggingHelpWindow();
00067   void HandleSceneRenaming( int row, int col, const char *newname);
00068   void HandleDataRenaming( int row, int col, const char *newname);
00069   //BTX
00070   bool CheckRowFileFormatWithExtension( const char* extension, vtkStringArray* supportedFileFormats);
00071   //ETX
00072   
00073   virtual void AddNewItem ( const char *dataset, const char *dtype);
00074   //BTX
00075   using vtkFetchMIMulticolumnWidget::AddNewItem; 
00076   //ETX
00077   
00078   // Description:
00079   // alternative method to propagate events generated in GUI to logic / mrml
00080   virtual void ProcessWidgetEvents ( vtkObject *caller, unsigned long event, void *callData );
00081   
00082   // Description:
00083   // alternative method to propagate events generated in GUI to logic / mrml
00084   virtual void ProcessMRMLEvents ( vtkObject *caller, unsigned long event, void *callData );
00085   
00086   // Description:
00087   // removes observers on widgets in the class
00088   virtual void RemoveWidgetObservers ( );
00089   // Description:
00090   // adds observers on widgets in the class
00091   virtual void AddWidgetObservers ( );
00092 
00093   // Description:
00094   // add observers on color node
00095   virtual void AddMRMLObservers ( );
00096 
00097   // Description:
00098   // remove observers on color node
00099   virtual void RemoveMRMLObservers ( );
00100 
00101   // Description:
00102   // Selection methods
00103   virtual void SelectRow ( int i );
00104   virtual void DeselectRow ( int i );
00105   virtual void SelectAllItems();
00106   virtual void DeselectAllItems();
00107 
00108   // Description:
00109   // Each time the widget is clicked (select or deselect)
00110   // this method maintains a current vector of strings
00111   // of selected nodes (and scene).
00112   virtual void UpdateSelectedStorableNodes();
00113 
00114   // Description:
00115   // Methods to operate on selected items.
00116   virtual int IsItemSelected(int i );
00117   virtual void DeleteSelectedItems();
00118   virtual int GetNumberOfSelectedItems();
00119   virtual int GetNumberOfItems();
00120   virtual const char *GetNthSelectedSlicerDataType(int n);
00121   virtual const char *GetNthSelectedDataTarget(int n);
00122   virtual const char *GetNthDataTarget(int n );
00123   virtual const char *GetNthSlicerDataType(int n);
00124   void ShowTagViewCallback( );
00125 
00126   void ResetCurrentTagLabel ( );
00127   // Description:
00128   // Get/Set on CurrentTagAttribute.
00129   // CurrentTagAttribute holds the value of the tag's attribute
00130   // that will be applied to data if the ApplyTagsButton is  selected.
00131   void SetCurrentTagAttribute(const char* att);
00132   const char *GetCurrentTagAttribute();
00133   // Description:
00134   // Get/Set on CurrentTagValue.
00135   // CurrentTagValue holds the value of the tag's value
00136   // that will be applied to data if the ApplyTagsButton is  selected.
00137   void SetCurrentTagValue(const char* val);
00138   const char *GetCurrentTagValue ( );
00139   
00140   void PopulateTagMenuButtonCallback ();
00141 
00142   void DestroyNewTagWindow();
00143   void WithdrawNewTagWindow();
00144   void RaiseNewTagWindow( const char *att );
00145 
00146 
00147   // Description:
00148   // When a user adds a new value for an existing or new tag,
00149   // The appropriate tag table (for a selected web service) is
00150   // updated with that keyword/value pair. Also, the values for
00151   // CurrentTagAttribute and CurrentTagValue on the
00152   // TaggedDataList are updated.
00153   void UpdateNewUserTag (const char *att, const char *val);
00154 
00155   void ShowTagsForSelection();
00156   void SetStatusText(const char *txt);
00157 
00158   //BTX
00159   enum
00160     {
00161       TagSelectedDataEvent = 11000,
00162       RemoveTagSelectedDataEvent,
00163       ShowAllTagViewEvent,
00164       ShowSelectionTagViewEvent,
00165       UploadRequestedEvent,
00166     };
00167 
00168   std::string CurrentTagAttribute;
00169   std::string CurrentTagValue;
00170   //ETX
00171 
00172   // Description:
00173   // editing callback for the multicolumn list
00174   void RightClickListCallback(int row, int col, int x, int y);
00175 
00176   
00177  protected:
00178   vtkFetchMIResourceUploadWidget();
00179   virtual ~vtkFetchMIResourceUploadWidget();
00180 
00181   // custom buttons and icons
00182   vtkKWPushButton *UploadButton;
00183   vtkKWPushButton *SelectAllButton;
00184   vtkKWPushButton *DeselectAllButton;
00185   vtkKWPushButton *ShowTagsForAllButton;
00186   vtkKWPushButton *ApplyTagsButton;
00187   vtkKWPushButton *RemoveTagsButton;
00188   vtkKWPushButton *TaggingHelpButton;
00189   vtkKWMenuButton *SelectTagMenuButton;
00190   vtkKWLabel *CurrentTagLabel;
00191   vtkFetchMIIcons *FetchMIIcons;
00192   vtkFetchMILogic *Logic;
00193   
00194   //--- Add new Tag pop-up window
00195   vtkKWTopLevel *NewTagWindow;
00196   vtkKWEntry *AddNewTagEntry;
00197   vtkKWLabel *AddNewTagLabel;
00198   vtkKWPushButton *AddNewTagButton;
00199   vtkKWEntry *AddNewValueEntry;
00200   vtkKWPushButton *AddNewValueButton;
00201   vtkKWPushButton *CloseNewTagWindowButton;
00202 
00203   char *NewUserTag;
00204   char *NewUserValue;
00205   char *TagToAddValuesTo;
00206 
00207   int FileNameColumn;
00208   int NodeNameColumn;
00209   int SceneRow;
00210   
00211   // Description:
00212   // Create the widget.
00213   virtual void CreateWidget();
00214 
00215   // Description:
00216   // Update the widget, used when the color node id changes
00217   void UpdateWidget();
00218   
00219   void UpdateMRML();
00220 
00221   vtkFetchMIResourceUploadWidget(const vtkFetchMIResourceUploadWidget&); // Not implemented
00222   void operator=(const vtkFetchMIResourceUploadWidget&); // Not Implemented
00223 };
00224 
00225 #endif
00226 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1