Ejemplo n.º 1
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 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 translateUI(self):
   manager = ToolsSwingLocator.getToolsSwingManager()
   for component in ( self.lblType,
       self.lblKey,
       self.lblLabel,
       self.lblMandatory
     ):
     manager.translate(component)
 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 initUI(self):
   toolsSwingManager = ToolsSwingLocator.getToolsSwingManager()
   self.listController = toolsSwingManager.createFilteredListController(
           self.lstActions,
           self.txtFilter,
           self.btnFilter
   )
   self.lstActions.addMouseListener(MyMouseListener(self))
   self.lblMessage.setText("")
Ejemplo n.º 6
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)
Ejemplo n.º 7
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)
Ejemplo n.º 8
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()
Ejemplo n.º 9
0
 def __init__(self, layer):
     FormPanel.__init__(self, getResource(__file__, "addTimeSupport.xml"))
     self.__starTime = None
     self.__endTime = None
     self.__layer = layer
     toolsSwingManager = ToolsSwingLocator.getToolsSwingManager()
     toolsSwingManager.translate(self.lblLayer)
     toolsSwingManager.translate(self.lblTimeAttribute)
     toolsSwingManager.translate(self.lblTimeAttributeName)
     toolsSwingManager.translate(self.lblRangeOfValues)
     toolsSwingManager.translate(self.lblStarTime)
     toolsSwingManager.translate(self.lblEndTime)
     toolsSwingManager.translate(self.lblParsePattern)
     self.txtLayer.setText(layer.getName())
     self.txtTimeSupportName.setText("TimeSupport")
     featureType = self.__layer.getFeatureStore().getDefaultFeatureType()
     self.fillCombo(self.cboTimeAttribute, featureType)
     self.setPreferredSize(450, 200)
Ejemplo n.º 10
0
 def __init__(self, processPanel, parameters):
   ExportPanel.__init__(self)
   FormPanel.__init__(self, gvsig.getResource(__file__,"exportImagesPanels.xml"))
   # Translate
   toolsSwingManager = ToolsSwingLocator.getToolsSwingManager()
   toolsSwingManager.translate(self.lblFieldImages)
   toolsSwingManager.translate(self.lblImageFormat)
   toolsSwingManager.translate(self.lblOutputPathParameters)
   toolsSwingManager.translate(self.rdbOption1)
   toolsSwingManager.translate(self.rdbOption2)
   toolsSwingManager.translate(self.rdbOption3)
   
   # hay un picker para folder
   self.pickerFolder = None
   self.processPanel = processPanel
   self.params = parameters
   self.store = parameters.getSourceFeatureStore()
   self.initComponents()
    def __init__(self, layer=None):
        FormPanel.__init__(self,
                           getResource(__file__, "reportbypointpanel3.xml"))
        i18Swing = ToolsSwingLocator.getToolsSwingManager()
        i18Swing.translate(self.lblTableNameToUse)
        i18Swing.translate(self.lblFields)
        i18Swing.translate(self.chkOneRecord)
        i18Swing.translate(self.lblTypeOfReport)

        self.cboTypeReport.removeAllItems()
        i18nManager = ToolsLocator.getI18nManager()

        self.cboTypeReport.addItem(
            ReportFormatType(i18nManager.getTranslation("_By_table"), 0))
        self.cboTypeReport.addItem(
            ReportFormatType(i18nManager.getTranslation("_With_two_columns"),
                             1))

        if layer != None:
            self.setLayer(layer)
 def __init__(self):
     FormPanel.__init__(
         self, gvsig.getResource(__file__, "reportbypointpanelreport.xml"))
     i18Swing = ToolsSwingLocator.getToolsSwingManager()
     self.setPreferredSize(400, 300)
     self.txt = JTextPane()
     self.txt.setEditable(False)
     self.txt.setCaretPosition(0)
     i18Swing.setDefaultPopupMenu(self.txt)
     self.txt.setContentType("text/html")
     self.pane = JScrollPane(self.txt)
     #self.setInitHorizontalScroll()
     self.pane.setVerticalScrollBarPolicy(
         ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS)
     #self.setInitHorizontalScroll()
     #self.pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)
     #self.setInitHorizontalScroll()
     self.jplReport.setLayout(BorderLayout())
     self.jplReport.add(self.pane, BorderLayout.CENTER)
     self.setInitHorizontalScroll()
 def updateControls(self):
   i18n = ToolsLocator.getI18nManager();
   indexAttributes = self.lstActions.getSelectedIndex()
   toolsSwingManager = ToolsSwingLocator.getToolsSwingManager()
   model = toolsSwingManager.createFilteredListModel()
   actions = PluginsLocator.getActionInfoManager().getActions()
   
   for action in actions:
     #print action.getName(), action.getLabel()
     if action.getLabel()==None:
       label = action.getName()
     else: 
       label = "%s (%s)" %(i18n.getTranslation(action.getLabel()),action.getName())
     if label.startswith("_"):
       label = label.replace("_"," ").strip()
     labeled = LabeledValueImpl(label, action)
     model.addElement(labeled)
   model.setFilter(self.txtFilter.getText())
   model.sort(True)
   self.lstActions.setModel(model);
   self.lstActions.setSelectedIndex(indexAttributes);
Ejemplo n.º 14
0
  def initComponents(self):
    dialogTitle = "_Select_folder"
    fileChooserID = "idPathGMLSelector"
    seticon = True
    # Init
    ## Button group
    self.btgOptions = ButtonGroup()
    self.btgOptions.add(self.rdbOption1)
    self.btgOptions.add(self.rdbOption2)
    self.btgOptions.add(self.rdbOption3)
    ## Image format
    self.cmbImageFormat.addItem("PNG")
    self.cmbImageFormat.addItem("JPEG")
    self.cmbImageFormat.addItem("GIF")
    ## Pickers
    ### Field with image data
    swm = DALSwingLocator.getSwingManager()
    self.pickerFieldsImageData = swm.createAttributeDescriptorPickerController(self.cmbImageField)
    self.pickerFieldsPath = swm.createAttributeDescriptorPickerController(self.cmbPathField)
    self.pickerFieldsName = swm.createAttributeDescriptorPickerController(self.cmbPathFieldName)
    self.pickerFolder = ToolsSwingLocator.getToolsSwingManager().createFolderPickerController(
       self.txtPath,
       self.btnPath)
    
    eesmanager = ExpressionEvaluatorSwingLocator.getManager()
    self.pickerExp = eesmanager.createExpressionPickerController(self.txtExp, self.btnExp)

    self.pickerExpStore= swm.createFeatureStoreElement(self.store)
    self.pickerExp.addElement(self.pickerExpStore)
    # Input
    ## Layer
    allDocuments = self.getAllValidDocuments()
    if len(allDocuments)==0:
      logger("Not able to find 2 tables to execute the tool", LOGGER_INFO)
      return
    else:
      self._updateAllUI()
    def __init__(self):
        FormPanel.__init__(self, getResource(__file__, "fechadecierre.xml"))

        toolsSwingManager = ToolsSwingLocator.getToolsSwingManager()

        self.workspace = DALLocator.getDataManager().getDatabaseWorkspace(
            'ARENA2_DB')

        self.fechaPicker = toolsSwingManager.createDatePickerController(
            self.txtFechaDeCierre, self.btnFechaDeCierre)
        if self.workspace == None:
            self.fechaPicker.setEnabled(False)
            self.btnGuardar.setEnabled(False)
        else:
            fechaDeCierre = self.workspace.get(
                'CEGESEV.accidentes.fecha_de_cierre')
            if fechaDeCierre == None:
                self.fechaPicker.set(None)
            else:
                fechaDeCierre = SimpleDateFormat("dd/MM/yyyy").parse(
                    fechaDeCierre)
                self.fechaPicker.coerceAndSet(fechaDeCierre)

        self.setPreferredSize(350, 100)
 def translateUI(self):
     manager = ToolsSwingLocator.getToolsSwingManager()
     for component in (self.lblType, self.lblValue, self.lblSize,
                       self.lblUrl):
         manager.translate(component)
    def __init__(self, store, taskStatus=None, defaultField=None):
        FormPanel.__init__(
            self, gvsig.getResource(__file__, "fieldCalculatorTool.xml"))
        self.store = store
        self.taskStatus = taskStatus
        self.dialog = None
        ## Prepare bind taskTool
        if taskStatus != None:
            self.fcTaskStatus = ToolsSwingLocator.getTaskStatusSwingManager(
            ).createJTaskStatus()
            self.fcTaskStatus.setShowRemoveTaskButton(False)
            self.fcTaskStatus.bind(self.taskStatus)
        else:
            self.fcTaskStatus = None
        i18nManager = ToolsLocator.getI18nManager()

        # Update
        self.lblField.setText(i18nManager.getTranslation("_update_field"))

        # Expression
        ## Sample feature
        sampleFeature = None
        try:
            sampleFeature = store.getFeatureSelection().first()
            if sampleFeature == None:
                sampleFeature = store.first()
        except:
            logger("Not able to create Sample Feature for FieldCalculatorTool",
                   LOGGER_WARN)

        ## Set builder
        self.expBuilder = ExpressionEvaluatorSwingLocator.getManager(
        ).createJExpressionBuilder()
        if sampleFeature != None:
            dataManager = DALLocator.getDataManager()
            featureSymbolTable = dataManager.createFeatureSymbolTable()
            featureSymbolTable.setFeature(sampleFeature)
            self.expBuilder.setPreviewSymbolTable(
                featureSymbolTable.createParent())

        self.expBuilderStore = DALSwingLocator.getSwingManager(
        ).createFeatureStoreElement(self.store)
        self.expBuilder.addElement(self.expBuilderStore)

        #swingManager = ExpressionEvaluatorSwingLocator.getManager()
        #element = swingManager.createElement(
        #            DataSwingManager.FEATURE_STORE_EXPRESSION_ELEMENT,
        #            self.expBuilder,
        #            self.store)
        #self.expBuilder.addElement(element)

        # Task status
        if self.fcTaskStatus != None:
            self.pnlTaskStatus.setLayout(BorderLayout())
            self.pnlTaskStatus.add(self.fcTaskStatus.asJComponent())
            self.pnlTaskStatus.updateUI()

        # Filter picker
        self.expFilter = ExpressionEvaluatorSwingLocator.getManager(
        ).createExpressionPickerController(self.txtExp, self.btnExp)

        #swingManager = ExpressionEvaluatorSwingLocator.getManager()
        #element = swingManager.createElement(
        #            DataSwingManager.FEATURE_STORE_EXPRESSION_ELEMENT,
        #            self.expFilter,
        #            self.store)
        #self.expFilter.addElement(element)

        self.expFilterStore = DALSwingLocator.getSwingManager(
        ).createFeatureStoreElement(self.store)
        self.expFilter.addElement(self.expFilterStore)
        #self.expFilterStore.setFeatureStore(self.store)

        # Combo filter type
        options = {
            0: i18nManager.getTranslation("_use_selection"),
            1: i18nManager.getTranslation("_use_filter"),
            2: i18nManager.getTranslation("_use_all")
        }
        for op in options:
            self.cmbTypeFilter.addItem(TypeFilterCombo(options[op], op))

        if self.store.getSelection().getSize() != 0:
            self.cmbTypeFilter.setSelectedIndex(0)
        else:
            self.cmbTypeFilter.setSelectedIndex(2)

        # Combo picker field
        #self.cmbField.addItem(None)
        self.pickerField = DALSwingLocator.getSwingManager(
        ).createAttributeDescriptorPickerController(self.cmbField)
        ftype = self.store.getDefaultFeatureType()
        self.pickerField.setFeatureType(ftype)
        #noneElement=ListElement("",None)
        #self.cmbField.getModel().addElement(noneElement)

        if defaultField != None:
            self.pickerField.set(defaultField)
        else:
            self.pickerField.set(None)

        # Add history and bookmarks
        self.bookmarks = ToolsLocator.getBookmarksAndHistoryManager(
        ).getBookmarksGroup("fieldCalculatorTool")
        self.history = ToolsLocator.getBookmarksAndHistoryManager(
        ).getHistoryGroup("fieldCalculatorTool")

        self.bookmarksController = ToolsSwingLocator.getToolsSwingManager(
        ).createBookmarksController(self.bookmarks, self.btnBookmarks)
        self.historyController = ToolsSwingLocator.getToolsSwingManager(
        ).createHistoryController(self.history, self.btnHistory)

        #self.historyController.setFilter(None)

        self.historyController.addActionListener(
            BookmarksAndHistoryListener(self))
        self.bookmarksController.addActionListener(
            BookmarksAndHistoryListener(self))

        # Init defaults
        self.cmbField_change()
        self.cmbTypeFilter_change()

        self.pnl1.setLayout(BorderLayout())
        self.pnl1.add(self.expBuilder.asJComponent())
        self.pnl1.updateUI()
  def initComponents(self):

    swingManager = ToolsSwingLocator.getToolsSwingManager()
    swingManager.translate(self.tabPanel)
    swingManager.translate(self.btnClearAccumulate)
    swingManager.translate(self.btnEditAccumulate)
    swingManager.translate(self.btnAddAccumulate)
    swingManager.translate(self.lblCodAccidente)
    swingManager.translate(self.lblPuede_utilizar_porcentage_como_comodin)
    swingManager.translate(self.lblProvincia)
    swingManager.translate(self.lblTitularidad)
    swingManager.translate(self.lblCarretera)
    swingManager.translate(self.lblPkInicio)
    swingManager.translate(self.lblPkFin)
    swingManager.translate(self.lblSentido)
    swingManager.translate(self.lblFechaDesde)
    swingManager.translate(self.lblFechaHasta)
    swingManager.translate(self.lblTipoAccidente)
    swingManager.translate(self.lblCategoria)
    swingManager.translate(self.lblMortales)
    swingManager.translate(self.lblGraves)
    swingManager.translate(self.lblLeves)

    iconTheme = ToolsSwingLocator.getIconThemeManager().getDefault()
    icon = iconTheme.get("accidentcondition-tabtick-disabled")
    self.tabPanel.setIconAt(0, icon)
    self.tabPanel.setIconAt(1, icon)
    self.tabPanel.setIconAt(2, icon)
    self.tabPanel.setIconAt(3, icon)

    icon1 = iconTheme.get("search-simplifiedcondition-add-accumulate")
    icon2 = iconTheme.get("search-simplifiedcondition-clear-accumulate")
    icon3 = iconTheme.get("search-simplifiedcondition-edit-accumulate")
    
    self.btnClearAccumulate.setIcon(icon2)
    self.btnEditAccumulate.setIcon(icon3)
    self.btnAddAccumulate.setIcon(icon1)
    
    self.tabControllerCarretera = TabControllerCarretera(
        self.store,
        self.tabPanel,
        self.cboProvincia,
        self.cboTitularidad,
        self.txtCarretera,
        self.txtPkInicio,
        self.txtPkInicioUmbral,
        self.txtPkFin,
        self.txtPkFinUmbral,
        self.cboSentido)

    self.tabControllerFecha = TabControllerFecha(
      self.store,
      self.tabPanel,
      self.txtFechaDesde,
      self.btnFechaDesde,
      self.txtFechaHasta,
      self.btnFechaHasta,
      self.cboTipoAccidente)

    self.tabControllerVictimas = TabControllerVictimas( 
      self.store,
      self.tabPanel,
      self.cboCategoria,
      self.chkPeligrosas,
      self.cboMortalesOperador,
      self.txtMortales,
      self.cboOperator1,
      self.cboGravesOperador,
      self.txtGraves,
      self.cboOperator2,
      self.cboLevesOperador,
      self.txtLeves)
Ejemplo n.º 19
0
    def initComponents(self):
        i18n = ToolsLocator.getI18nManager()
        toolsSwingManager = ToolsSwingLocator.getToolsSwingManager()
        dataManager = DALLocator.getDataManager()
        dataSwingManager = DALSwingLocator.getSwingManager()
        taskManager = ToolsSwingLocator.getTaskStatusSwingManager()
        workspace = dataManager.getDatabaseWorkspace("ARENA2_DB")

        self.cltTransforms = toolsSwingManager.createJListWithCheckbox(
            self.lstTransforms)
        self.cltRules = toolsSwingManager.createJListWithCheckbox(
            self.lstRules)

        self.arena2filePicker = FilesPickerController(
            self.lstArena2Files, self.btnArena2FilesAddFile,
            self.btnArena2FilesAddFolder, self.btnArena2FilesRemoveFile)
        self.arena2filePicker.addChangeListener(self.doFileChanged)

        self.taskStatusController = taskManager.createTaskStatusController(
            self.lblTaskTitle, self.lblTaskMessage, self.pgbTaskProgress)
        self.btnImportar.setEnabled(False)
        self.btnCheckIntegrity.setEnabled(False)
        self.setVisibleTaskStatus(False)

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

        model = DefaultListModel()
        for factory in self.importManager.getTransformFactories():
            model.addElement(factory.getName())
        self.cltTransforms.setModel(model)

        model = DefaultListModel()
        for factory in self.importManager.getRuleFactories():
            model.addElement(factory.getName())
        self.cltRules.setModel(model)

        n = 0
        for factory in self.importManager.getRuleFactories():
            if factory.isSelectedByDefault():
                self.cltRules.toggleCheck(n)
            n += 1

        n = 0
        for factory in self.importManager.getTransformFactories():
            if factory.isSelectedByDefault():
                self.cltTransforms.toggleCheck(n)
            n += 1

        pool = dataManager.getDataServerExplorerPool()
        model = DefaultComboBoxModel()
        select = -1
        n = 0
        for entry in pool:
            if isinstance(entry.getExplorerParameters(),
                          JDBCServerExplorerParameters):
                conn = entry.getExplorerParameters()
                workspace = dataManager.createDatabaseWorkspaceManager(conn)
                if workspace.isValidStoresRepository():
                    model.addElement(workspace)
                    if "arena" in workspace.getId().lower():
                        select = n
                    n += 1
        self.cboWorkspace.setModel(model)
        self.cboWorkspace.setSelectedIndex(select)
        self.cboWorkspace.addActionListener(self.doFileChanged)

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

        self.report.setCellEditors(self.tblIssues)

        if workspace == None:
            self.arena2filePicker.setEnabled(False)

        self.lblIssuesMessage.setText("")
        self.tblIssues.getSelectionModel().addListSelectionListener(
            self.issuesSelectionChanged)
        self.tblIssues.setAutoCreateRowSorter(True)

        swingManager = ToolsSwingLocator.getToolsSwingManager()
        swingManager.createTableColumnAdjuster(self.tblIssues)
        self.btnVerAccidente2.setEnabled(False)
        self.btnModifyIssues.setEnabled(False)

        self.setPreferredSize(800, 500)
def processExportImage(featureSet,
                       field,
                       formatName,
                       outparams,
                       taskStatus=None):
    if not formatName in ["PNG", "JPEG", "GIF"]:
        logger("Not valid format for export images", LOGGER_ERROR)
        return
    sm = ToolsSwingLocator.getToolsSwingManager()
    si = sm.createSimpleImage()
    if taskStatus != None:
        taskStatus.setRangeOfValues(0, featureSet.getSize())
    if isinstance(field, FeatureAttributeDescriptor):
        field = field.getName()
    try:
        ooption = outparams["option"]
        oparams = outparams["params"]
        n = 0
        if ooption == 1:
            for f in featureSet:
                if taskStatus != None:
                    n += 1
                    taskStatus.setCurValue(n)
                    if taskStatus.isCancellationRequested():
                        return
                value = f.get(field)
                if value == None or value == "":
                    continue
                si.set(value)
                im = si.getBufferedImage()
                if im == None:
                    logger(
                        "Not able to get Bufferded Image from field " +
                        str(field) + " value:" + str(value), LOGGER_ERROR)
                    continue
                # Save image
                ofield = oparams["field"]
                if isinstance(ofield, FeatureAttributeDescriptor):
                    ofield = ofield.getName()
                output = f.get(ofield)
                ImageIO.write(im, formatName, output)
        elif ooption == 2:
            for f in featureSet:
                if taskStatus != None:
                    n += 1
                    taskStatus.setCurValue(n)
                    if taskStatus.isCancellationRequested():
                        return
                value = f.get(field)
                if value == None or value == "":
                    continue
                si.set(value)
                im = si.getBufferedImage()
                if im == None:
                    logger(
                        "Not able to get Bufferded Image from field " +
                        str(field) + " value:" + str(value), LOGGER_ERROR)
                    continue
                ofield = oparams["field"]
                if isinstance(ofield, FeatureAttributeDescriptor):
                    ofield = ofield.getName()
                oname = f.get(ofield)
                if oname == None or oname == "": continue
                outputPath = oparams["path"].getAbsolutePath()
                output = getUniqueValueFileByField(oname, outputPath,
                                                   formatName)
                ImageIO.write(im, formatName, output)
        elif ooption == 3:
            s = ExpressionEvaluatorLocator.getManager().createSymbolTable()
            fst = DALLocator.getDataManager().createFeatureSymbolTable()
            s.addSymbolTable(fst)
            exp = oparams["expression"]
            if exp.isEmpty():
                logger("Expression is empty", LOGGER_ERROR)
                return
            for f in featureSet:
                if taskStatus != None:
                    n += 1
                    taskStatus.setCurValue(n)
                    if taskStatus.isCancellationRequested():
                        return
                value = f.get(field)
                if value == None or value == "":
                    continue
                si.set(value)
                im = si.getBufferedImage()
                fst.setFeature(f)
                output = exp.execute(s)
                outputex = output + "." + formatName.lower()
                if os.path.exists(outputex):
                    logger("Already exists: " + outputex, LOGGER_ERROR)
                    continue
                ImageIO.write(im, formatName, File(outputex))

    except:
        ex = str(sys.exc_info()[1])
        logger(
            "Not able to export: " + ex + " caused on: " +
            ex.__class__.__name__, LOGGER_ERROR)
        try:
            DisposeUtils.disposeQuietly(featureSet)
        except:
            logger("Not able dispose export images feature set", LOGGER_ERROR)