示例#1
0
    def contextHandler(self, index):
        
        if index == 'add tag filter':
            tagset_id = self.selected_item_tagset_id
            tagset = browser.objectcube.objectCubeService.get_tagset_by_id(tagset_id)
            tag = tagset.getTag(self.selected_item_tag_id)
            
            tagFilter = TagFilter(tag, tagset.id)
            browser.objectcube.objectCubeService.get_state().addFilter( tagFilter )
            browser.objectcube.objectCubeService.update_state()
    
            # add action
            # ADD THIS AGAIN.
            action = ActionFilter(ACTION_TAGFILTER, ACTION_ADD, tagset.id, tag.id)
            actionManager.addAction( action )

            messenger.send(CUBE_MENU_RELOAD_FILTERS)
            messenger.send('update_added_filter') 
            return 
示例#2
0
    def click_ok_button(self):
        try:
            # Get the upper and lower values from user.
            lower = int(self.txt_lowerBound.get())
            upper = int(self.txt_upperBound.get())
            
            # Create numerical range filter.
            numerical_range_filter = NumericalRangeFilter(lower, upper, self.dim.id )
            
            # Add the filter to the global.
            browser.objectcube.objectCubeService.get_state().addFilter( numerical_range_filter )
            browser.objectcube.objectCubeService.update_state()
            #State.addFilter( numerical_range_filter )
            
            # Reload the filter list.
            messenger.send(CUBE_MENU_RELOAD_FILTERS)
            self.np.remove()
            messenger.send('dialog_closing')
            #services.dialogService.notify_close()

            # Create action.
            action = ActionFilter(ACTION_TYPE_NUMERICAL_RANGEFILTER, ACTION_ADD, tagsetId=self.dim.id, lowerValue=lower, higherValue=upper )
            actionManager.addAction( action )


            
            # TODO: If there is something on the coordinate... we must reload it?
            #browser.common.coordinateService.redraw()
            #TODO: Reload everything that we have on the drawing area.
            browser.cube.cubeService.reload()
            
        
        except Exception as inst:
            # Create error message.
            dlg = ErrorDialog('Error while creating filter', 'Unable to create filter: ' + str(inst))
            dlg.draw()
            
            # Close the window.
            self.np.remove()
            messenger.send('dialog_closing')
示例#3
0
 def click_ok_button(self):        
     # Create the tag filter.
     tag = self.tags_hash[ self.tags_menu.get() ]
     tagFilter = TagFilter(tag, self.dim.id )
     
     # Add the filter to the global.
     #State.addFilter( tagFilter )
     browser.objectcube.objectCubeService.get_state().addFilter( tagFilter )
     browser.objectcube.objectCubeService.update_state()
     
     # Reload the filter menu.
     messenger.send(CUBE_MENU_RELOAD_FILTERS)
     
     # Close the window.
     self.np.remove()
     messenger.send('dialog_closing')
     
     # add action
     action = ActionFilter(ACTION_TAGFILTER, ACTION_ADD, self.dim.id, tag.id)
     actionManager.addAction( action )
     
     #TODO: Reload everything that we have on the drawing area.
     #browser.cube.cubeService.reload()
     browser.cube.cubeService.reload()