def initComponents(self):
        i18n = ToolsLocator.getI18nManager()
        toolsSwingManager = ToolsSwingLocator.getToolsSwingManager()
        dataManager = DALLocator.getDataManager()
        dataSwingManager = DALSwingLocator.getSwingManager()
        taskManager = ToolsSwingLocator.getTaskStatusSwingManager()
        expSwingManager = ExpressionEvaluatorSwingLocator.getManager()
        self.btnVerAccidente.setText("")
        self.btnExportIssues.setText("")

        self.filter = expSwingManager.createExpressionPickerController(
            self.txtFilter, self.btnFilter, self.btnFilterHistory,
            self.btnFilterBookmarks)
        self.taskStatusController = taskManager.createTaskStatusController(
            self.lblTaskTitle, self.lblTaskMessage, self.pgbTaskProgress)
        self.setVisibleTaskStatus(False)

        self.tblIssues.setModel(self.report.getTableModel())
        self.report.setCellEditors(self.tblIssues)

        dataSwingManager.setStoreAction(self.btnVerAccidente, "ShowForm", True,
                                        ShowFormFromIssueActionContext(self))
        dataSwingManager.setStoreAction(self.btnExportIssues, "Export", True,
                                        ExportFromIssueActionContext(self))

        self.lblIssuesMessage.setText("")
        self.tblIssues.getSelectionModel().addListSelectionListener(
            self.issuesSelectionChanged)
        self.tblIssues.setAutoCreateRowSorter(True)
        self.btnModifyIssues.setEnabled(False)
        self.btnVerAccidente.setEnabled(False)
        self.btnExportIssues.setEnabled(False)

        self.setPreferredSize(800, 500)
def selfRegister():
    application = ApplicationLocator.getManager()
    i18n = ToolsLocator.getI18nManager()

    icon_show = File(
        gvsig.getResource(__file__, "images",
                          "fieldcalculator16x16.png")).toURI().toURL()

    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.field-calculator-tool", "action",
                              "tools-field-calculator-tool", None, icon_show)

    extension = FieldCalculatorToolExtension()

    actionManager = PluginsLocator.getActionInfoManager()
    action_show = actionManager.createAction(
        extension,
        "tools-field-calculator-tool",  # Action name
        i18n.getTranslation("_Field_Calculator_Tool"),  # Text
        "show",  # Action command
        "tools-field-calculator-tool",  # Icon name
        None,  # Accelerator
        501100000,  # Position 
        "_Field_Calculator_Tool"  # Tooltip
    )
    action_show = actionManager.registerAction(action_show)
    application.addMenu(action_show, "Table/_Field_Calculator_Tool")
    application.addTool(
        action_show,
        "table_tools")  #/ )#i18n.getTranslation("_Field_Calculator_Tool"))
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

    quickinfo_icon = File(
        gvsig.getResource(__file__, "images",
                          "sentineldownloader.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.sentineldownloader", "action",
                              "tools-sentineldownloader", None, quickinfo_icon)

    reportbypoint_extension = SentinelDownloaderExtension()
    reportbypoint_action = actionManager.createAction(
        reportbypoint_extension,
        "tools-sentineldownloader",  # Action name
        "Sentinel Downloader",  # Text
        "settool-sentineldownloader",  # Action command
        "tools-sentineldownloader",  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation("_Sentinel_Downloader")  # Tooltip
    )
    reportbypoint_action = actionManager.registerAction(reportbypoint_action)
    application.addMenu(reportbypoint_action, "tools/_Sentinel_Downloader")
    application.addSelectableTool(reportbypoint_action, "SentinelDownloader")
def selfRegister():
    application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    icon = File(getResource(__file__, "images",
                            "table-import-fields.png")).toURI().toURL()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.ImportFieldsExtension", "action",
                              "table-import-fields", None, icon)

    #
    # Creamos la accion
    extension = ImportFieldsExtension()
    actionManager = PluginsLocator.getActionInfoManager()
    action = actionManager.createAction(
        extension,
        "table-import-fields",  # Action name
        "_Import_fields",  # Text
        "table-import-fields",  # Action command
        "table-import-fields",  # Icon name
        None,  # Accelerator
        508200000,  # Position 
        "_Show_the_import_fields_dialog"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(action, "Table/_Import_fields")
def selfRegister():
  selfRegisterI18n()
  i18n = ToolsLocator.getI18nManager()
  application = ApplicationLocator.getManager()
  actionManager = PluginsLocator.getActionInfoManager()
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

  toolfinder_icon = File(gvsig.getResource(__file__,"images","toolFinder.png")).toURI().toURL()
  iconTheme.registerDefault("scripting.toolfinder", "action", "tools-toolfinder", None, toolfinder_icon) #quickinfo_icon)

  mytool_extension = ToolFinderExtension()
  mytool_action = actionManager.createAction(
    mytool_extension,
    "tools-toolfinder",   # Action name
    "Tool finder",   # Text
    "settool-toolfinder", # Action command
    "tools-toolfinder",   # Icon name
    None,                # Accelerator
    1009000000,          # Position
    i18n.getTranslation("_Tool_finder")    # Tooltip
  )
  mytool_action = actionManager.registerAction(mytool_action)

  # Añadimos la entrada en el menu herramientas
  application.addMenu(mytool_action, "tools/"+i18n.getTranslation("_Tool_finder"))
Пример #6
0
def selfRegister():
  test = TestPlayer()
  
  application = ApplicationLocator.getManager()

  icon = File(os.path.join(os.path.dirname(__file__),"testdata", "testplayer.png")).toURI().toURL()
  
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
  iconTheme.registerDefault("scripting.test-" + test.getId(), "action", "tools-test-" + test.getId(), None, icon)
  
  extension = TestExtension()
  actionManager = PluginsLocator.getActionInfoManager()
  action_show = actionManager.createAction(
    extension, 
    "tools-test-" + test.getId(), # Action name
    test.getName(), # Text
    "show", # Action command
    "tools-test-" + test.getId(), # Icon name
    None, # Accelerator
    1009100000, # Position 
    "TestPlayer-" + test.getId() # Tooltip
  )
  action_show = actionManager.registerAction(action_show)
  
  application.addMenu(action_show, "File/TestPlayer/Tests/" + test.getId())
  application.addTool(action_show, test.getId())
Пример #7
0
def selfRegister():
    application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    icon = File(getResource(__file__, "images",
                            "mobile-forms-designer.png")).toURI().toURL()
    print "ICON:", icon
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.MobileFormsExtension", "action",
                              "mobile-forms-designer", None, icon)

    #
    # Creamos la accion
    extension = MobileFormsExtension()
    actionManager = PluginsLocator.getActionInfoManager()
    action = actionManager.createAction(
        extension,
        "mobile-forms-designer",  # Action name
        "Mobile forms designer",  # Text
        "mobile-forms-designer",  # Action command
        "mobile-forms-designer",  # Icon name
        None,  # Accelerator
        650151000,  # Position 
        "_Show_mobile_forms_designer"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(action,
                        "HMachine/GvSIG Mobile-Geopaparazzi/Forms designer")
Пример #8
0
def selfRegister():
    application = ApplicationLocator.getManager()

    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    icon = File(
        getResource(__file__, "images",
                    "view-query-coordinate-capture.png")).toURI().toURL()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.CoordinateCaptureExtension", "action",
                              "view-query-coordinate-capture", None, icon)

    #
    # Creamos la accion
    extension = CoordinateCaptureExtension()
    actionManager = PluginsLocator.getActionInfoManager()
    action = actionManager.createAction(
        extension,
        "view-query-coordinate-capture",  # Action name
        "Coordinate capture",  # Text
        "view-query-coordinate-capture",  # Action command
        "view-query-coordinate-capture",  # Icon name
        None,  # Accelerator
        650700600,  # Position 
        "_Show_the_coordinate_capture"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(action, "View/Query/Coordinate capture")
def selfRegister():
  application = ApplicationLocator.getManager()

  #
  # Registramos las traducciones
  i18n = ToolsLocator.getI18nManager()
  i18n.addResourceFamily("text",File(getResource(__file__,"i18n")))

  #
  # Registramos los iconos en el tema de iconos
  icon = File(getResource(__file__,"images","view-time-add-basic-support-to-datasource.png")).toURI().toURL()
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
  iconTheme.registerDefault("scripting.addBasicTimeSupportToDatasource", "action", "view-time-add-basic-support-to-datasource", None, icon)

  #
  # Creamos la accion 
  extension = AddBasicTimeSupportToDatasourceExtension()
  actionManager = PluginsLocator.getActionInfoManager()
  action = actionManager.createAction(
    extension, 
    "view-time-add-basic-support-to-datasource", # Action name
    "Add basic support", # Text
    "view-time-add-basic-support-to-datasource", # Action command
    "view-time-add-basic-support-to-datasource", # Icon name
    None, # Accelerator
    650151000, # Position 
    "_Add_basic_time_support_to_vectorial_layer" # Tooltip
  )
  action = actionManager.registerAction(action)
  application.addMenu(action, "View/Time/_Add_basic_time_support")
Пример #10
0
def selfRegister():
    application = ApplicationLocator.getManager()
    i18n = ToolsLocator.getI18nManager()

    icon_show = File(gvsig.getResource(__file__, "images",
                                       "snap16x16.png")).toURI().toURL()

    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting.quick-snapping-tool", "action",
                              "tools-quick-snapping-tool", None, icon_show)

    extension = QuickSnappingToolExtension()

    actionManager = PluginsLocator.getActionInfoManager()
    action_show = actionManager.createAction(
        extension,
        "tools-quick-snapping-tool",  # Action name
        i18n.getTranslation("_Quick_Snapping_Tool"),  # Text
        "show",  # Action command
        "tools-quick-snapping-tool",  # Icon name
        None,  # Accelerator
        1009000000,  # Position 
        "Quick Snapping Tool"  # Tooltip
    )
    action_show = actionManager.registerAction(action_show)
    application.addTool(action_show,
                        i18n.getTranslation("_Quick_Snapping_Tool"))
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

    cadastralparcelsdownloader_icon = File(
        gvsig.getResource(__file__, "images",
                          "cadastralparcelsdownloader.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.cadastralparcelsdownloader", "action",
                              "tools-cadastralparcelsdownloader", None,
                              cadastralparcelsdownloader_icon)

    cadastralparcelsdownloader_extension = CadastralDownloaderExtension()
    cadastralparcelsdownloader_action = actionManager.createAction(
        cadastralparcelsdownloader_extension,
        "tools-cadastralparcelsdownloader",  # Action name
        "Show cadastral parcels downloader",  # Text
        "settool-cadastralparcelsdownloader",  # Action command
        "tools-cadastralparcelsdownloader",  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation("_Show_cadastral_parcels_downloader")  # Tooltip
    )
    cadastralparcelsdownloader_action = actionManager.registerAction(
        cadastralparcelsdownloader_action)

    # Añadimos la entrada "Quickinfo" en el menu herramientas
    application.addMenu(cadastralparcelsdownloader_action,
                        "tools/_cadastralparcelsdownloader")
    # Añadimos el la accion como un boton en la barra de herramientas "Quickinfo".
    application.addSelectableTool(cadastralparcelsdownloader_action,
                                  "CadastralParcelsDownloader")
Пример #12
0
  def initUI(self):
    tsl = ToolsSwingLocator.getToolsSwingManager()
    self.jslOutline.setPaintLabels(False)
    self.jslFill.setPaintLabels(False)
    self.jslLabelColor.setPaintLabels(False)
    self.pickerColorOutline = tsl.createColorPickerController(self.txtOutline, self.btnOutline, self.jslOutline)
    self.pickerColorFill = tsl.createColorPickerController(self.txtFill, self.btnFill, self.jslFill)
    self.spnWidth.setValue(1)
    self.cfonts = JComboBoxFonts()
    try:
      self.cfonts.setSelectedItem("DejaVu Sans")
      self.cfonts.setSelectedItem("Liberation Sans")
      self.cfonts.setSelectedItem("Serif")
      self.cfonts.setSelectedItem("Arial")
    except:
      pass
    self.jpn1.add(self.cfonts)
    self.jpn1.updateUI()

    self.cunits = JComboBoxUnits()
    self.jpn2.add(self.cunits)
    self.jpn2.updateUI()


    self.crefsystem = JComboBoxUnitsReferenceSystem()
    self.jpn3.add(self.crefsystem)
    self.jpn3.updateUI()
    
    
    self.spnLabelSize.setValue(12)
    self.pickerFontColor = tsl.createColorPickerController(self.txtLabelColor, self.btnLabelColor, self.jslLabelColor)

    if self.state.layer !=None:
      self.chbShowLayer.setSelected(self.state.layer.isVisible())
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

    quickinfo_icon = File(
        gvsig.getResource(__file__, "images",
                          "reportbypoint1.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.reportbypoint", "action",
                              "tools-reportbypoint", None, quickinfo_icon)

    reportbypoint_extension = ReportByPointExtension()
    reportbypoint_action = actionManager.createAction(
        reportbypoint_extension,
        "tools-reportbypoint",  # Action name
        "Show report by point",  # Text
        "settool-reportbypoint",  # Action command
        "tools-reportbypoint",  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation("_Report_by_point_info")  # Tooltip
    )
    reportbypoint_action = actionManager.registerAction(reportbypoint_action)

    # Añadimos la entrada "Report by point" en el menu herramientas
    application.addMenu(
        reportbypoint_action,
        "tools/" + i18n.getTranslation("_Report_by_point_info"))
    # Añadimos el la accion como un boton en la barra de herramientas "Quickinfo".
    application.addSelectableTool(reportbypoint_action, "ReportByPoint")
def selfRegister():
    application = ApplicationLocator.getManager()

    #
    # Registramos los iconos en el tema de iconos
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    icon = File(getResource(__file__, "images",
                            "dbeaver16x16.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.DBeaverExtension", "action",
                              "dbeaver-launch", None, icon)

    #
    # Creamos la accion
    actionManager = PluginsLocator.getActionInfoManager()
    extension = DBeaverExtension()

    action = actionManager.createAction(
        extension,
        "dbeaver-launch",  # Action name
        "DBeaver",  # Text
        "dbeaver-launch",  # Action command
        "dbeaver-launch",  # Icon name
        None,  # Accelerator
        650700600,  # Position 
        "_Show_the_DBeaver_database_administrator_tool"  # Tooltip
    )
    action = actionManager.registerAction(action)
    application.addMenu(action, "tools/DBeaver")
Пример #15
0
 def btnModifyIssues_click(self, *args):
     selectionModel = self.tblIssues.getSelectionModel()
     if selectionModel.isSelectionEmpty():
         return
     report = self.report
     store = report.getStore()
     ft = store.getDefaultFeatureType().getCopy()
     for attr in ft:
         isHidden = not attr.getTags().getBoolean("editable", False)
         attr.setHidden(isHidden)
         #print "%s.isHidden() %s" % (attr.getName(), isHidden)
     f = store.createNewFeature(ft, False)
     dynformManager = DynFormLocator.getDynFormManager()
     x = f.getAsDynObject()
     form = dynformManager.createJDynForm(ft)
     winManager = ToolsSwingLocator.getWindowManager()
     form.asJComponent().setPreferredSize(Dimension(400, 200))
     dialog = winManager.createDialog(form.asJComponent(),
                                      "Modificar incidencias", None,
                                      winManager.BUTTONS_OK_CANCEL)
     dialog.show(winManager.MODE.DIALOG)
     if dialog.getAction() == winManager.BUTTON_OK:
         form.getValues(x)
         for row in xrange(selectionModel.getMinSelectionIndex(),
                           selectionModel.getMaxSelectionIndex() + 1):
             if selectionModel.isSelectedIndex(row):
                 row = self.tblIssues.convertRowIndexToModel(row)
                 issue = report.getIssue(row).getEditable()
                 for attr in ft:
                     if not attr.isHidden():
                         issue.set(attr.getName(), f.get(attr.getName()))
                 report.putIssue(row, issue)
         report.refresh()
Пример #16
0
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

    exportmaptiles_icon = File(
        gvsig.getResource(__file__, "images",
                          "exportmaptiles.png")).toURI().toURL()
    iconTheme.registerDefault("scripting.exportmaptiles", "action",
                              "tools-exportmaptiles", None,
                              exportmaptiles_icon)

    exportmaptiles_extension = ExportMapTilesPanelExtension()
    exportmaptiles_action = actionManager.createAction(
        exportmaptiles_extension,
        "tools-exportmaptiles",  # Action name
        "Export map tiles",  # Text
        "settool-exportmaptiles",  # Action command
        "tools-exportmaptiles",  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation("_Export_map_tiles")  # Tooltip
    )
    exportmaptiles_action = actionManager.registerAction(exportmaptiles_action)

    # Añadimos la entrada "Quickinfo" en el menu herramientas
    application.addMenu(exportmaptiles_action, "tools/_ExportMapTiles")
    # Añadimos el la accion como un boton en la barra de herramientas "Quickinfo".
    application.addSelectableTool(exportmaptiles_action, "ExportMapTiles")
 def translateUI(self):
     manager = ToolsSwingLocator.getToolsSwingManager()
     for component in (self.lblType, self.lblKey, self.lblLabel,
                       self.lblValue, self.lblIsLabel, self.lblMandatory,
                       self.lblValues, self.btnClearValue, self.btnUp,
                       self.btnDown, self.btnDelete, self.btnAddEmpty,
                       self.btnAdd):
         manager.translate(component)
 def translateUI(self):
   manager = ToolsSwingLocator.getToolsSwingManager()
   for component in ( self.lblType,
       self.lblKey,
       self.lblLabel,
       self.lblMandatory
     ):
     manager.translate(component)
 def txtCodAccidente_change(self, *args):
   iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
   if self.txtCodAccidente.getText()=="":
     icon = iconTheme.get("accidentcondition-tabtick-disabled")
     self.tabPanel.setIconAt(0, icon)
   else:
     icon = iconTheme.get("accidentcondition-tabtick-enabled")
     self.tabPanel.setIconAt(0, icon)
 def initUI(self):
   toolsSwingManager = ToolsSwingLocator.getToolsSwingManager()
   self.listController = toolsSwingManager.createFilteredListController(
           self.lstActions,
           self.txtFilter,
           self.btnFilter
   )
   self.lstActions.addMouseListener(MyMouseListener(self))
   self.lblMessage.setText("")
Пример #21
0
 def btnCRS_click(self, *args):
     i18n = ToolsLocator.getI18nManager()
     title = i18n.getTranslation("_Select_the_reference_system")
     csSelect = CRSSelectPanelFactory.getUIFactory().getSelectCrsPanel(
         self.crs, True)
     ToolsSwingLocator.getWindowManager().showWindow(
         csSelect, title, WindowManager.MODE.DIALOG)
     if csSelect.isOkPressed():
         self.transform = None
         self.crs = csSelect.getProjection()
         self.txtCRS.setText(self.crs.getAbrev())
         if self.mapControl != None:
             if self.mapControl.getProjection() == self.crs:
                 self.transform = None
             else:
                 self.transform = self.mapControl.getProjection().getCT(
                     self.crs)
         self.updatePointInForm()
Пример #22
0
 def __init__(self, availableValues, readOnly=False):
     self.__component = ToolsSwingLocator.getToolsSwingManager(
     ).createDropDown(JLabel())
     self.__component.setReadOnly(readOnly)
     self.__availableValues = availableValues
     self.__dropDownModel = DefaultComboBoxModel()
     self.__lastValue = None
     for v in availableValues:
         self.__dropDownModel.addElement(v)
     self.__component.setModel(self.__dropDownModel)
Пример #23
0
  def initComponents(self):
    self.pickerFechaDesde = ToolsSwingLocator.getToolsSwingManager().createDatePickerController(self.fechaDesde, self.fechaDesdeBtn)
    self.pickerFechaHasta = ToolsSwingLocator.getToolsSwingManager().createDatePickerController(self.fechaHasta, self.fechaHastaBtn)
    
    
    tipoAccidenteModel = DefaultComboBoxModel()
    attr = self.store.getDefaultFeatureType().get("TIPO_ACC_COLISION")
    values = attr.getAvailableValues()
    tipoAccidenteModel.addElement(ListElement(u' ',u''))
    for value in values:
      element = ListElement(value.getLabel(), value.getValue())
      tipoAccidenteModel.addElement(element)
    self.tipoAccidente.setModel(tipoAccidenteModel)

    self.tipoAccidente.addActionListener(self)
    self.pickerFechaDesde.addChangeListener(self)
    self.pickerFechaHasta.addChangeListener(self)
    
    self.pickerFechaDesde.setEnabled(True)
    self.pickerFechaHasta.setEnabled(True)
Пример #24
0
 def btnHelp_click(self, *args):
     #controller = SwingController()
     #controller.setIsEmbeddedComponent(True)
     #controller.openDocument(File(getResource(__file__, "doc", "mobileforms.pdf")).toURI().toURL())
     #panel = SwingViewBuilder(controller).buildViewerPanel()
     panel = WebBrowserFactory.createWebBrowserPanel()
     panel.setPage(
         File(getResource(__file__, "doc",
                          "mobileforms.html")).toURI().toURL())
     windowManager = ToolsSwingLocator.getWindowManager()
     windowManager.showWindow(panel, getTitle(), windowManager.MODE.WINDOW)
Пример #25
0
 def checkModify(self):
   iconTheme = ToolsSwingLocator.getIconThemeManager().getDefault()
   if(self.pickerFechaDesde.isEmpty() and
     self.pickerFechaHasta.isEmpty() and
     self.tipoAccidente.getSelectedItem().getValue()==''):
       icon = iconTheme.get("accidentcondition-tabtick-disabled")
       self.tabPanel.setIconAt(self.TAB_INDEX_PANEL, icon)
       return False
   else:
       icon = iconTheme.get("accidentcondition-tabtick-enabled")
       self.tabPanel.setIconAt(self.TAB_INDEX_PANEL, icon)
       return True
Пример #26
0
    def __init__(self):
        FormPanel.__init__(self, getResource(__file__, "importFields.xml"))
        self.lastTable = None
        i18Swing = ToolsSwingLocator.getToolsSwingManager()
        self.ft1 = None
        self.ft2 = None
        self.blockedNames = []

        i18Swing.translate(self.lblImportFields)
        i18Swing.translate(self.lblTable1)
        i18Swing.translate(self.lblField1)
        i18Swing.translate(self.lblTable2)
        i18Swing.translate(self.lblField2)

        swm = DALSwingLocator.getSwingManager()

        self.pickerFields1 = swm.createAttributeDescriptorPickerController(
            self.cmbField1)
        self.pickerFields2 = swm.createAttributeDescriptorPickerController(
            self.cmbField2)
        self.messageController = ToolsSwingLocator.getToolsSwingManager(
        ).createMessageBarController(self.lblMessage, 10000)

        allDocuments = self.getAllValidDocuments(None)
        if len(allDocuments) < 2:
            logger("Not able to find 2 tables to execute the tool",
                   LOGGER_INFO)
            return
        self.cmbTable1.setModel(DefaultComboBoxModel(allDocuments))
        self.cmbTable1.setSelectedIndex(0)
        self.cmbTable1_change()
        self.ft1 = self.cmbTable1.getSelectedItem().getFeatureStore(
        ).getDefaultFeatureType()
        self.ft2 = self.cmbTable2.getSelectedItem().getFeatureStore(
        ).getDefaultFeatureType()

        self.pickerFields1.setFeatureType(self.ft1)
        self.pickerFields2.setFeatureType(self.ft2)
        self.setLayer(self.cmbTable2.getSelectedItem())
        self.regenerateTranslator()
Пример #27
0
    def initComponents(self):
        i18n = ToolsLocator.getI18nManager()
        self.connectionPicker = DALSwingLocator.getSwingManager(
        ).createJDBCConnectionPickerController(self.cboConnection,
                                               self.btnConnection)
        self.connectionPicker.addChangeListener(self.doConnectionChanged)

        taskManager = ToolsSwingLocator.getTaskStatusSwingManager()
        self.taskStatusController = taskManager.createTaskStatusController(
            self.lblTaskTitle, self.lblTaskMessage, self.pgbTaskProgress)
        self.btnAccept.setEnabled(False)
        self.setVisibleTaskStatus(False)
        self.setPreferredSize(500, 270)
def selfRegister():
    i18n = ToolsLocator.getI18nManager()
    moduleId = "sigpac2csv"
    actionName = "tools-sigpac-sigpac2csv"
    tooltip_key = i18n.getTranslation("_Convert_SIGPAC_XML_to_gvSIG_format")
    menu_entry = "tools/SIGPAC/_Convert_XML_to_gvSIG"

    extension = SIGPAC2CSVExtension()

    application = ApplicationLocator.getManager()
    actionManager = PluginsLocator.getActionInfoManager()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    #
    # Registramos las traducciones
    i18n = ToolsLocator.getI18nManager()
    i18n.addResourceFamily("text", File(getResource(__file__, "i18n")))

    #
    # Registramos los iconos en el tema de iconos
    icon = File(getResource(__file__, "images",
                            actionName + ".png")).toURI().toURL()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("scripting." + moduleId, "action", actionName,
                              None, icon)

    action = actionManager.createAction(
        extension,
        actionName,  # Action name
        tooltip_key,  # Text
        actionName,  # Action command
        actionName,  # Icon name
        None,  # Accelerator
        1009000000,  # Position
        i18n.getTranslation(tooltip_key)  # Tooltip
    )
    action = actionManager.registerAction(action)

    # Añadimos la entrada en el menu herramientas
    application.addMenu(action, menu_entry)
def selfRegister():
  iconTheme = ToolsSwingLocator.getIconThemeManager().getDefault()
  icon1 = File(getResource(__file__,"imagenes","accidentcondition-tabtick-enabled.png")).toURI().toURL()
  icon2 = File(getResource(__file__,"imagenes","accidentcondition-tabtick-disabled.png")).toURI().toURL()
  icon3 = File(getResource(__file__,"imagenes","search-simplifiedcondition-add-accumulate.png")).toURI().toURL()
  icon4 = File(getResource(__file__,"imagenes","search-simplifiedcondition-clear-accumulate.png")).toURI().toURL()
  icon5 = File(getResource(__file__,"imagenes","search-simplifiedcondition-edit-accumulate.png")).toURI().toURL()
  
  iconTheme.registerDefault("scripting.arena2reader", "action", "accidentcondition-tabtick-enabled", None, icon1)
  iconTheme.registerDefault("scripting.arena2reader", "action", "accidentcondition-tabtick-disabled", None, icon2)
  iconTheme.registerDefault("scripting.arena2reader", "action", "search-simplifiedcondition-add-accumulate", None, icon3)
  iconTheme.registerDefault("scripting.arena2reader", "action", "search-simplifiedcondition-clear-accumulate", None, icon4)
  iconTheme.registerDefault("scripting.arena2reader", "action", "search-simplifiedcondition-edit-accumulate", None, icon5)
Пример #30
0
 def showAccidentsSearch(self):
     dataSwingManager = DALSwingLocator.getSwingManager()
     dataManager = DALLocator.getDataManager()
     winManager = ToolsSwingLocator.getWindowManager()
     workspace = dataManager.getDatabaseWorkspace("ARENA2_DB")
     if workspace == None:
         msgbox("Debera conectarse al espacio de trabajo de ARENA2_DB")
         return
     repo = workspace.getStoresRepository()
     store = repo.getStore("ARENA2_ACCIDENTES")
     panel = dataSwingManager.createFeatureStoreSearchPanel(store)
     winManager.showWindow(panel.asJComponent(), "Busqueda de accidentes",
                           WindowManager.MODE.WINDOW)
def selfRegister():
  i18n = ToolsLocator.getI18nManager()
  moduleId = "SelectTableDuplicates"
  actionName = "selection-table-select-duplicatesnofirst"
  tooltip_key =  i18n.getTranslation("_Select_all_duplicates_except_the_first")
  menu_entry = "Selection/_Select_table_duplicates/_Select_all_duplicates_except_the_first"
  
  extension = SelectTableDuplicatesExtension()

  application = ApplicationLocator.getManager()
  actionManager = PluginsLocator.getActionInfoManager()
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()

  #
  # Registramos los iconos en el tema de iconos
  icon = File(getResource(__file__,"images",actionName + ".png")).toURI().toURL()
  
  iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
  iconTheme.registerDefault("scripting." + moduleId, "action", actionName, None, icon)

  action = actionManager.createAction(
    extension,
    actionName,    # Action name
    tooltip_key,   # Text
    actionName,    # Action command
    actionName,    # Icon name
    None,          # Accelerator
    300450200,     # Position
    i18n.getTranslation(tooltip_key)    # Tooltip
  )
  action = actionManager.registerAction(action)

  # Añadimos la entrada en el menu herramientas
  application.addMenu(action, menu_entry)
  # Añadimos la accion como un boton en la barra de herramientas.
  #application.addTool(action, "selection")
  application.getMainFrame().addTool(action,"selection","selection-table-duplicates");
  application.refreshMenusAndToolBars()
Пример #32
0
def selfRegister():
    application = ApplicationLocator.getManager()
    icon = File(os.path.join(os.path.dirname(__file__), "icon.png")).toURI().toURL()
    iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent()
    iconTheme.registerDefault("Games", "action", "Games", None, icon)
    gameExtension = GameExtension()
    actionManager = PluginsLocator.getActionInfoManager()
    action_show = actionManager.createAction(
        gameExtension, 
        "Games", # Action name
        "Games", # Text
        "show", # Action command
        "Games", # Icon name
        None, # Accelerator
        1009100000, # Position 
        "Games" # Tooltip
        )
    action_show = actionManager.registerAction(action_show)
    application.addTool(action_show, "Games")