public boolean execute(PlugInContext context) throws Exception {
    if (context.getLayerViewPanel() == null) {
      return false;
    }
    try {
      if (app.getBlackboard().get("temporalincidents") != null)
        app.getBlackboard().put("temporalincidents", new ArrayList<IdEdgeNetworkBean>());

      // JOptionPane.showMessageDialog(app.getMainFrame(),I18N.get("temporalIncidents","routeengine.temporalincidents.remove.removed"));
    } catch (Exception e) {
      context
          .getLayerViewPanel()
          .getContext()
          .warnUser(I18N.get("temporalIncidents", "routeengine.temporalincidents.remove.error"));
      return false;
    }
    JOptionPane.showMessageDialog(
        context.getWorkbenchFrame(),
        I18N.get("temporalIncidents", "routeengine.temporalincidents.remove.removed"));
    context
        .getLayerViewPanel()
        .getContext()
        .setStatusMessage(
            I18N.get("temporalIncidents", "routeengine.temporalincidents.remove.removed"));
    return true;
  }
  /** Inicialización del plugin para cargarlo desde el fichero workbench.properties */
  public void initialize(PlugInContext context) throws Exception {
    // para internacionalización
    Locale currentLocale = I18N.getLocaleAsObject();
    ResourceBundle bundle =
        ResourceBundle.getBundle(
            "com.geopista.ui.plugin.mobile.language.PluginMobileExtracti18n", currentLocale);
    I18N.plugInsResourceBundle.put(PluginMobileExtracti18n, bundle);

    FeatureInstaller featureInstaller = new FeatureInstaller(context.getWorkbenchContext());

    EnableCheckFactory checkFactory = context.getCheckFactory();
    featureInstaller.addMainMenuItem(
        this,
        new String[] {"Tools", MobilePluginI18NResource.GEOPISTAConfiguration_proyectMovil},
        I18N.get(PluginMobileExtracti18n, MobilePluginI18NResource.MobileModifyPlugin_text),
        false,
        null,
        new MultiEnableCheck()
            .add(checkFactory.createWindowWithLayerNamePanelMustBeActiveCheck())
            .add(checkFactory.createAdminUserCheck()));

    ((WorkbenchGuiComponent) context.getWorkbenchContext().getIWorkbench().getGuiComponent())
        .getToolBar("Movilidad")
        .addPlugIn(
            this.getIcon(),
            this,
            createEnableCheck(context.getWorkbenchContext()),
            context.getWorkbenchContext());
  }
 public void run(TaskMonitor monitor, PlugInContext context) throws Exception {
   // -- get the LM because when the Histogram will be shown, the app. focus
   //   will change and context.addLayer will not work (null pointer exc.)
   // [mmichaud 2012-04-09] to completely resolve this problem, I added the
   // new JInternalFrame is added after the addLayer method has been called
   this.currentLM = context.getLayerManager();
   monitor.allowCancellationRequests();
   if (this.selAttribute == null) {
     context.getWorkbenchFrame().warnUser(I18N.get(sNoAttributeChoosen));
     return;
   }
   javax.swing.JInternalFrame internalFrame = context.getWorkbenchFrame().getActiveInternalFrame();
   FeatureDataset result = classifyAndCreatePlot(monitor, context);
   context.getWorkbenchFrame().activateFrame(internalFrame);
   if (result == null) {
     context.getWorkbenchFrame().warnUser(I18N.get(sNotEnoughValuesWarning));
   } else if (result.size() > 0) {
     String name = this.selAttribute + "_" + this.selClassifier;
     this.currentLM.addLayer(StandardCategoryNames.WORKING, name, result);
     JInternalFrame frame = new JInternalFrame(this.sHistogram);
     frame.setLayout(new BorderLayout());
     frame.add(plot, BorderLayout.CENTER);
     frame.setClosable(true);
     frame.setResizable(true);
     frame.setMaximizable(true);
     frame.setSize(450, 450);
     context.getWorkbenchFrame().addInternalFrame(frame);
     plot = null;
   } else {
     context.getWorkbenchFrame().warnUser(sWarning);
   }
 }
  /** Inicializa los elementos del panel. */
  private void inicializaElementos() {
    buscarTodoPanel = new JPanel();
    buscarTodoPanel.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    buscarJButton =
        new JButton(
            I18N.get(
                "RegistroExpedientes",
                "Catastro.RegistroExpedientes.ExportacionMasiva.buscarJButton"));

    buscarJButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            buscarJButtonActionPerformed();
          }
        });

    exportarJButton =
        new JButton(
            I18N.get(
                "RegistroExpedientes",
                "Catastro.RegistroExpedientes.ExportacionMasiva.exportarJButton"));
    exportarTodoJButton =
        new JButton(
            I18N.get(
                "RegistroExpedientes",
                "Catastro.RegistroExpedientes.ExportacionMasiva.exportarTodoJButton"));

    cancelarJButton =
        new JButton(
            I18N.get(
                "RegistroExpedientes",
                "Catastro.RegistroExpedientes.ExportacionMasiva.cancelarJButton"));
    cancelarJButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cierraInternalFrame();
          }
        });
    recopilaDatosBD();
    inicializaPanelBuscar();
    inicializaTablaBuscar();

    buscarTodoPanel.add(
        buscarJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(285, 335, 120, 30));
    buscarTodoPanel.add(
        exportarTodoJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 580, 110, 30));
    buscarTodoPanel.add(
        exportarJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(450, 580, 80, 30));
    buscarTodoPanel.add(
        cancelarJButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 580, 80, 30));

    buscarTodoPanel.setPreferredSize(new Dimension(700, 660));
    getContentPane().add(buscarTodoPanel);
    setSize(new Dimension(700, 660));
    this.setMaximizable(false);
    int w = (this.desktop.getWidth() / 2) - (this.getWidth() / 2);
    int d = (this.desktop.getHeight() / 2) - (this.getHeight() / 2) - 30;
    this.setLocation(w, d);
    this.setMaximumSize(new Dimension(650, 660));
  }
  /** Acción realizada al pulsar el botón desasociar de la aplicación */
  private void jButtonDesasociarActionPerformed() {
    try {
      LayerOperations operaciones = new LayerOperations();

      // desasocia el dominio de la columna
      int iDeleted = operaciones.desasociarColumna(auxColumn);

      if (iDeleted > 0) {
        JOptionPane optionPane =
            new JOptionPane(
                I18N.get("GestorCapas", "general.mensaje.fin.operacion"),
                JOptionPane.INFORMATION_MESSAGE);
        JDialog dialog = optionPane.createDialog(this, "");
        dialog.show();
        Identificadores.put("DomainsModificados", true);
        jButtonAsociar.setEnabled(true);
        jButtonDesasociar.setEnabled(false);
      } else {
        JOptionPane optionPane =
            new JOptionPane(
                I18N.get("GestorCapas", "general.mensaje.error.operacion"),
                JOptionPane.ERROR_MESSAGE);
        JDialog dialog = optionPane.createDialog(this, "");
        dialog.show();
      }
      ;

      repaint();

    } catch (DataException de) {
      de.printStackTrace();
    }
  }
Example #6
0
 public DataException(Throwable cause) {
   super(cause);
   ErrorDialog.show(
       aplicacion.getMainFrame(),
       I18N.get("Importacion", "DataError.Titulo"),
       I18N.get("Importacion", "DataError.Aviso"),
       StringUtil.stackTrace(this));
 }
  public JPanel getFilePanel() {
    if (filePanel == null) {
      filePanel = new JPanel();
      filePanel.setLayout(new GridBagLayout());
      filePanel.setBorder(
          new TitledBorder(I18N.get("RegistroExpedientes", "Catastro.webservices.certificado")));

      ficheroCertificadoLabel = new JLabel();
      ficheroCertificadoLabel.setText(
          I18N.get("RegistroExpedientes", "Catastro.webservices.password.seleccione.certificado"));

      filePanel.add(
          ficheroCertificadoLabel,
          new GridBagConstraints(
              0,
              0,
              2,
              1,
              1,
              1,
              GridBagConstraints.NORTH,
              GridBagConstraints.HORIZONTAL,
              new Insets(0, 5, 0, 5),
              0,
              0));

      filePanel.add(
          getCertificadoField(),
          new GridBagConstraints(
              0,
              1,
              1,
              1,
              1,
              1,
              GridBagConstraints.NORTH,
              GridBagConstraints.BOTH,
              new Insets(10, 5, 0, 5),
              0,
              0));

      filePanel.add(
          getCertificadojButton(),
          new GridBagConstraints(
              1,
              1,
              1,
              1,
              0.01,
              1,
              GridBagConstraints.EAST,
              GridBagConstraints.NONE,
              new Insets(10, 5, 0, 5),
              0,
              0));
    }
    return filePanel;
  }
  public boolean execute(PlugInContext context, Collection<Layer> collection, File dir)
      throws Exception {
    MultiInputDialog dialog =
        new MultiInputDialog(context.getWorkbenchFrame(), LAYERS_WITHOUT_DATASOURCE, true);

    String tooltip =
        "<html>"
            + java.util.Arrays.toString(collection.toArray(new Object[0])).replaceAll(",", "<br>")
            + "</html>";

    dialog
        .addSubTitle(
            I18N.getMessage(
                "org.openjump.core.ui.plugin.file.SaveLayersWithoutDataSourcePlugIn.layers-without-datasource",
                new Object[] {new Integer(collection.size())}))
        .setToolTipText(tooltip);
    dialog
        .addLabel(
            I18N.get(
                "org.openjump.core.ui.plugin.file.SaveLayersWithoutDataSourcePlugIn.hover-the-label-to-see-the-list"))
        .setToolTipText(tooltip);
    dialog.addRadioButton(DONOTSAVE, "ACTION", true, "");
    dialog.addRadioButton(SAVEASJML, "ACTION", false, "");
    dialog.addRadioButton(SAVEASSHP, "ACTION", false, "");

    GUIUtil.centreOnWindow(dialog);
    dialog.setVisible(true);
    if (dialog.wasOKPressed()) {
      if (dialog.getBoolean(DONOTSAVE)) {
        return false;
      } else {
        // File dir = FileUtil.removeExtensionIfAny(task);
        dir.mkdir();
        for (Layer layer : collection) {
          String ext = null;
          DataSource dataSource = null;
          if (dialog.getBoolean(SAVEASJML)) {
            ext = "jml";
            dataSource =
                new com.vividsolutions.jump.io.datasource.StandardReaderWriterFileDataSource.JML();
          } else if (dialog.getBoolean(SAVEASSHP)) {
            ext = "shp";
            dataSource =
                new com.vividsolutions.jump.io.datasource.StandardReaderWriterFileDataSource
                    .Shapefile();
          }
          saveLayer(layer, dir, dataSource, ext);
        }
        return true;
      }
    } else return false;
  }
Example #9
0
  /**
   * This method initializes jPanelDatosFinca
   *
   * @return javax.swing.JPanel
   */
  private JPanel getJPanelDatosFinca() {
    if (jPanelDatosFinca == null) {
      jLabelCodigoUC = new JLabel("", JLabel.CENTER); // $NON-NLS-1$
      jLabelCodigoUC.setText(
          I18N.get("Expedientes", "expediente.panel.datosfinca.codigouc")); // $NON-NLS-1$

      GridBagLayout layout = new GridBagLayout();
      jPanelDatosFinca = new JPanel(layout);

      jPanelDatosFinca.setBorder(
          BorderFactory.createTitledBorder(
              null,
              I18N.get("Expedientes", "expediente.panel.datosfinca.titulo"),
              TitledBorder.LEADING,
              TitledBorder.TOP,
              new Font(null, Font.BOLD, 12))); // $NON-NLS-1$

      jPanelDatosFinca.add(
          getJScrollPaneFincas(),
          new GridBagConstraints(
              0,
              0,
              1,
              1,
              0.1,
              0.1,
              GridBagConstraints.CENTER,
              GridBagConstraints.BOTH,
              new Insets(0, 3, 0, 3),
              80,
              0));
      jPanelDatosFinca.add(
          getJPanelBotoneraFinca(),
          new GridBagConstraints(
              0,
              1,
              4,
              1,
              0.1,
              0.1,
              GridBagConstraints.CENTER,
              GridBagConstraints.HORIZONTAL,
              new Insets(0, 3, 0, 3),
              0,
              0));
    }
    return jPanelDatosFinca;
  }
  /**
   * Retorna un árbol con las capas seleccionadas y sus atributos
   *
   * @return javax.swing.JList
   */
  private JTree getWriteableLayerTree() {
    ArrayList<GeopistaLayer> extractLayers =
        (ArrayList<GeopistaLayer>) blackboard.get(MobileExtractPanel01.MOBILE_WRITEABLE_LAYERS);
    writeableRootNodes = getRootLayerNodes(extractLayers);
    Vector rootVector =
        new NamedVector(
            I18N.get(
                MobileExtractPlugin.PluginMobileExtracti18n,
                MobilePluginI18NResource.MobileExtractPanel03_capasEdit),
            writeableRootNodes);
    JTree tree = new JTree(rootVector);
    tree.setFont(new Font(tree.getFont().getName(), Font.BOLD, tree.getFont().getSize()));
    CheckBoxNodeRenderer renderer = new CheckBoxNodeRenderer(Color.BLUE);
    tree.setCellRenderer(renderer);
    tree.setCellEditor(new CheckBoxNodeEditor(tree));
    tree.setEditable(true);

    //		DefaultMutableTreeNode root = new DefaultMutableTreeNode("Capas");
    //	    JTree tree = new JTree(root);
    //	    DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
    //	    DefaultMutableTreeNode chosen = null;
    //	    if(extractLayers!=null){
    //			for (int i = 0; i < extractLayers.size(); i++) {
    //				geopistaLayer = extractLayers.get(i);
    //				chosen = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
    //				if (chosen == null){
    //					chosen = root;
    //				}
    //				model.insertNodeInto(getTreeNodeFromLayer(geopistaLayer), chosen, 0);
    //			}
    //	    }

    return tree;
  }
  public JButton getCertificadojButton() {
    if (certificadojButton == null) {
      certificadojButton = new JButton();

      certificadojButton.setText(
          I18N.get("RegistroExpedientes", "Catastro.webservices.password.trustStore.buscar"));

      certificadojButton.addMouseListener(
          new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent e) {

              fileCertificado = new JFileChooser();

              GeopistaFiltroFicheroFilter filter = new GeopistaFiltroFicheroFilter();
              filter.addExtension("pfx");
              filter.setDescription(
                  I18N.get("RegistroExpedientes", "Catastro.webservices.certificado.pkcs12"));
              fileCertificado.setFileFilter(filter);
              fileCertificado.setFileSelectionMode(0);
              fileCertificado.setAcceptAllFileFilterUsed(false);

              int returnVal = fileCertificado.showOpenDialog(aplicacion.getMainFrame());
              if (returnVal == JFileChooser.APPROVE_OPTION) {
                setKeystoreFile(new File(fileCertificado.getSelectedFile().getPath()));
                certificadoField.setText(getKeystoreFile().getPath());
              } else {
                certificadoField.setText("");
              }
            }
          });
    }
    return certificadojButton;
  }
  /**
   * Constructor de la clase. Inicializa todos los paneles de la pantalla y asocia los eventos para
   * ser tratados. Se le pasa por parametro un JFrame y la lista de expedientes a mostrar.
   *
   * @param desktop JFrame
   * @param exp lista de expedientes
   */
  public BusquedaExportacionMasiva(final JFrame desktop, ArrayList exp) {
    this.desktop = desktop;
    this.expedientes = exp;
    this.expedienteFiltrados = exp;
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    UtilRegistroExp.menuBarSetEnabled(false, this.desktop);
    inicializaElementos();
    addInternalFrameListener(
        new javax.swing.event.InternalFrameListener() {
          public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            cierraInternalFrame();
          }

          public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {}

          public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {}
        });
    this.setTitle(
        I18N.get(
            "RegistroExpedientes",
            "Catastro.RegistroExpedientes.ExportacionMasiva.tituloBusqueda"));
    setClosable(true);
    this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
  }
Example #13
0
  private void onZoomToRouteButtonDo() {
    if (this.pluginContext != null) {

      //			GeometryFactory geoFactory = new GeometryFactory();
      ArrayList<Geometry> geoArrayList = new ArrayList<Geometry>();
      if (this.infoRoutesStretchBeansCollection != null
          && !this.infoRoutesStretchBeansCollection.isEmpty()) {
        Iterator<InfoRouteStretchBean> it = this.infoRoutesStretchBeansCollection.iterator();
        while (it.hasNext()) {
          InfoRouteStretchBean actualStretchBean = it.next();
          if (actualStretchBean != null
              && actualStretchBean.getGeometries() != null
              && !actualStretchBean.getGeometries().isEmpty()) {
            geoArrayList.addAll(actualStretchBean.getGeometries());
          }
        }
      }
      //			GeometryCollection geoCollection = new GeometryCollection(geoArrayList.toArray(new
      // Geometry[geoArrayList.size()]), geoFactory);

      try {
        zoomToSelectedItemsPlugIn.zoom(geoArrayList, pluginContext.getLayerViewPanel());
      } catch (NoninvertibleTransformException e) {
        e.printStackTrace();
        ErrorDialog.show(
            null,
            "Error resaltar la ruta",
            I18N.get(
                "routedescription", "routeengine.route.description.error.route.not.zoom.message"),
            StringUtil.stackTrace(e));
      }
    }
  }
Example #14
0
 /**
  * This method initializes jButtonEliminarInmueble
  *
  * @return javax.swing.JButton
  */
 private JButton getJButtonEliminarInmueble() {
   if (jButtonEliminarInmueble == null) {
     jButtonEliminarInmueble = new JButton();
     jButtonEliminarInmueble.setText(
         I18N.get("Expedientes", "expediente.boton.datosinmueble.eliminar")); // $NON-NLS-1$
   }
   return jButtonEliminarInmueble;
 }
Example #15
0
 /**
  * This method initializes jButtonEliminarFinca
  *
  * @return javax.swing.JButton
  */
 private JButton getJButtonEliminarFinca() {
   if (jButtonEliminarFinca == null) {
     jButtonEliminarFinca = new JButton();
     jButtonEliminarFinca.setText(
         I18N.get("Expedientes", "expediente.boton.datosfinca.eliminar")); // $NON-NLS-1$
   }
   return jButtonEliminarFinca;
 }
Example #16
0
 /**
  * This method initializes jButtonEliminarTitular
  *
  * @return javax.swing.JButton
  */
 private JButton getJButtonEliminarTitular() {
   if (jButtonEliminarTitular == null) {
     jButtonEliminarTitular = new JButton();
     jButtonEliminarTitular.setText(
         I18N.get("Expedientes", "expediente.boton.datostitular.eliminar")); // $NON-NLS-1$
   }
   return jButtonEliminarTitular;
 }
Example #17
0
 /**
  * This method initializes jButtonEliminarLocal
  *
  * @return javax.swing.JButton
  */
 private JButton getJButtonEliminarLocal() {
   if (jButtonEliminarLocal == null) {
     jButtonEliminarLocal = new JButton();
     jButtonEliminarLocal.setText(
         I18N.get("Expedientes", "expediente.boton.datoslocal.eliminar")); // $NON-NLS-1$
   }
   return jButtonEliminarLocal;
 }
Example #18
0
 /**
  * This method initializes jButtonNuevoLocalComun
  *
  * @return javax.swing.JButton
  */
 private JButton getJButtonNuevoLocalComun() {
   if (jButtonNuevoLocalComun == null) {
     jButtonNuevoLocalComun = new JButton();
     jButtonNuevoLocalComun.setText(
         I18N.get("Expedientes", "expediente.boton.datoslocal.nuevocomun")); // $NON-NLS-1$
   }
   return jButtonNuevoLocalComun;
 }
Example #19
0
 /**
  * This method initializes jButtonVistaCultivo
  *
  * @return javax.swing.JButton
  */
 private JButton getJButtonVistaCultivo() {
   if (jButtonVistaCultivo == null) {
     jButtonVistaCultivo = new JButton();
     jButtonVistaCultivo.setText(
         I18N.get("Expedientes", "expediente.boton.datoslocal.vistacultivo")); // $NON-NLS-1$
   }
   return jButtonVistaCultivo;
 }
Example #20
0
 /**
  * This method initializes jButtonMasDatosLocales
  *
  * @return javax.swing.JButton
  */
 private JButton getJButtonMasDatosLocales() {
   if (jButtonMasDatosLocales == null) {
     jButtonMasDatosLocales = new JButton();
     jButtonMasDatosLocales.setText(
         I18N.get("Expedientes", "expediente.boton.datoslocal.masdatos")); // $NON-NLS-1$
   }
   return jButtonMasDatosLocales;
 }
Example #21
0
 public DataException(String msg) {
   super(msg);
   ErrorDialog.show(
       aplicacion.getMainFrame(),
       I18N.get("Importacion", "DataError.Titulo"),
       msg,
       StringUtil.stackTrace(this));
 }
 /**
  * Renombra las etiquetas, botones, nombre del panel, etc. Clase necesaria para implementar
  * IMultilingue
  */
 public void renombrarComponentes() {
   this.setBorder(new TitledBorder(I18N.get("RegistroExpedientes", etiqueta)));
   identificadores[0] =
       (I18N.get(
           "RegistroExpedientes",
           "Catastro.RegistroExpedientes.TablaAsociarParcelasBienesInmuebles.RefCatastralLabel"));
   identificadores[1] =
       (I18N.get(
           "RegistroExpedientes",
           "Catastro.RegistroExpedientes.TablaAsociarParcelasBienesInmuebles.tipoViaLabel"));
   identificadores[2] =
       (I18N.get(
           "RegistroExpedientes",
           "Catastro.RegistroExpedientes.TablaAsociarParcelasBienesInmuebles.NombreViaLabel"));
   identificadores[3] =
       (I18N.get(
           "RegistroExpedientes",
           "Catastro.RegistroExpedientes.TablaAsociarParcelasBienesInmuebles.NumeroLabel"));
   identificadores[4] =
       (I18N.get(
           "RegistroExpedientes",
           "Catastro.RegistroExpedientes.TablaAsociarParcelasBienesInmuebles.codigoPoligono"));
   identificadores[5] =
       (I18N.get(
           "RegistroExpedientes",
           "Catastro.RegistroExpedientes.TablaAsociarParcelasBienesInmuebles.codigoParcela"));
 }
  /**
   * Funcion que carga los datos del arrayList pasado por parametro en la tabla. Se cargan ciertos
   * datos de los expedientes pasados por parametro. Para ver las referencias se hace un instanceof
   *
   * @param expedientes Los expedientes a mostrar en la tabla
   * @param usuarios Los nombres de los usuarios de los expediente, ya que el expediente solo guarda
   *     el id usuario.
   */
  public void cargaDatosTabla(ArrayList expedientes, Hashtable usuarios) {
    editors.clear();
    String[][] datos = new String[expedientes.size()][10];
    for (int i = 0; i < expedientes.size(); i++) {
      Expediente expAux = (Expediente) expedientes.get(i);
      datos[i][0] = String.valueOf(expAux.getNumeroExpediente());
      datos[i][1] = expAux.getTipoExpediente().getCodigoTipoExpediente();
      if (expAux.isTipoTramitaExpSitFinales()) {
        // expediente de situaciones finales
        datos[i][2] =
            (I18N.get(
                "RegistroExpedientes",
                "Catastro.RegistroExpedientes.TablaBusqueda.tipoDeExpediente.situacionesFinales"));
      } else {
        // Expediente de variaciones
        datos[i][2] =
            (I18N.get(
                "RegistroExpedientes",
                "Catastro.RegistroExpedientes.TablaBusqueda.tipoDeExpediente.variaciones"));
      }
      datos[i][3] =
          Estructuras.getListaEstadosExpediente()
              .getDomainNode(String.valueOf(expAux.getIdEstado()))
              .getTerm(ConstantesCatastro.Locale);
      datos[i][4] = (String) usuarios.get(String.valueOf(expAux.getIdTecnicoCatastro()));
      datos[i][5] = String.valueOf(expAux.getFechaRegistro());
      datos[i][6] = String.valueOf(expAux.getAnnoExpedienteAdminOrigenAlteracion());
      datos[i][7] = String.valueOf(expAux.getEntidadGeneradora().getCodigo());
      ArrayList refCatas = expAux.getListaReferencias();
      if (refCatas != null && refCatas.size() > 0) {
        if (refCatas.get(0) instanceof FincaCatastro) {
          datos[i][8] = (((FincaCatastro) refCatas.get(0)).getRefFinca().getRefCatastral());
        } else if (refCatas.get(0) instanceof BienInmuebleCatastro) {
          datos[i][8] =
              (((BienInmuebleCatastro) refCatas.get(0)).getIdBienInmueble().getIdBienInmueble());
        }
      }
      rellenaRefCatas(expAux);
      datos[i][9] = expAux.getNifPresentador();
    }

    modelo.setDataVector(datos, identificadores);
    expedientesTable.setModel(modelo);
  }
  public JPanel getPasswordPanel() {
    if (passwordPanel == null) {
      passwordPanel = new JPanel();
      passwordPanel.setLayout(new GridBagLayout());
      passwordPanel.setBorder(
          new TitledBorder(I18N.get("RegistroExpedientes", "Catastro.webservices.password")));

      lblPassword = new JLabel();
      lblPassword.setText(
          I18N.get("RegistroExpedientes", "Catastro.webservices.password.certificado"));

      passwordPanel.add(
          lblPassword,
          new GridBagConstraints(
              0,
              0,
              1,
              1,
              0.1,
              1,
              GridBagConstraints.NORTH,
              GridBagConstraints.HORIZONTAL,
              new Insets(0, 5, 0, 5),
              0,
              0));

      passwordPanel.add(
          getTxtJPassword(),
          new GridBagConstraints(
              0,
              1,
              1,
              1,
              0.1,
              1,
              GridBagConstraints.NORTH,
              GridBagConstraints.HORIZONTAL,
              new Insets(10, 5, 0, 5),
              0,
              0));
    }
    return passwordPanel;
  }
  public static final void remove(List fileList, ExtensionWrapper ext, TaskMonitor monitor)
      throws Exception {
    List resourceList = ext.getResourceList();

    for (Iterator iter = fileList.iterator(); iter.hasNext(); ) {
      File file = (File) iter.next();
      if (file.isFile()) {

        if (resourceList.contains(file.getName())) {
          //                    System.out.println("will delete: " + file);

          monitor.report(
              I18N.get("deejump.pluging.manager.ExtensionHelper.Deleting-file") + " " + file);

          boolean deleted = false;

          try {
            deleted = file.delete();
          } catch (SecurityException e) {
            // TODO decide if re-throw here or handle or log??
            e.printStackTrace();
          }

          // TODO throw exc if false.

          // hmm no exception thrown?
          // file permissions?
          // bye bye
          System.out.println(
              I18N.get("deejump.pluging.manager.ExtensionHelper.deleted")
                  + " '"
                  + file
                  + "': "
                  + deleted);
          // ???? above hasn't worked, file locked? del on exited didn'T work...
          // put file on a list and finish it off?
          // inlcude in a plug-in, listener --> workbench.isclosed -> del file!
          //                     file.deleteOnExit();

        }
      }
    }
  }
  /** Acción realizada al pulsar el botón de salir de la aplicación */
  private void jButtonSalirActionPerformed() {
    String string1 = I18N.get("GestorCapas", "general.si");
    String string2 = I18N.get("GestorCapas", "general.no");
    Object[] options = {string1, string2};

    int n =
        JOptionPane.showOptionDialog(
            this,
            I18N.get("GestorCapas", "general.salir.mensaje"),
            "",
            JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            options,
            options[1]);
    if (n == JOptionPane.NO_OPTION) return;

    aplicacion.getMainFrame().dispose();
    System.exit(0);
  }
  /** Acción realizada al pulsar el botón de asociar de la aplicación */
  private void jButtonAsociarActionPerformed() {
    try {
      // Convierte com.geopista.protocol.administrador.dominios.Domain
      // en com.geopista.features.Domain

      int idDomain = Integer.parseInt(auxDomain.getIdDomain());
      String nombreDominio = auxDomain.getName();
      LayerOperations operaciones = new LayerOperations();
      Domain dominio = operaciones.obtenerDominioTipo(idDomain, nombreDominio);

      // asocia el dominio a la columna
      int iRes =
          operaciones.actualizarDominioColumna(
              auxColumn, dominio, Integer.parseInt(txtLevel.getText()));
      // auxColumn.setDomain(dominio);

      if (iRes > 0) {
        JOptionPane optionPane =
            new JOptionPane(
                I18N.get("GestorCapas", "general.mensaje.fin.operacion"),
                JOptionPane.INFORMATION_MESSAGE);
        JDialog dialog = optionPane.createDialog(this, "");
        dialog.show();

        Identificadores.put("DomainsModificados", true);
        jButtonDesasociar.setEnabled(true);
      } else {
        JOptionPane optionPane =
            new JOptionPane(
                I18N.get("GestorCapas", "general.mensaje.error.operacion"),
                JOptionPane.ERROR_MESSAGE);
        JDialog dialog = optionPane.createDialog(this, "");
        dialog.show();
      }

      repaint();

    } catch (DataException de) {
      de.printStackTrace();
    }
  }
  public void run(TaskMonitor monitor, PlugInContext context) throws Exception {

    this.setMonitor(monitor);
    this.getMonitor()
        .report(
            I18N.get("regulacionTrafico", "routeengine.trafficregulation.savingdatainfomessage"));

    // Manejar el trafficRegulation
    this.setTrafficRegualtion(StreetTrafficRegulation.BIDIRECTIONAL);

    saveTrafficRegulationInformation(context, monitor);
  }
Example #29
0
  private void onInfoRouteListMosueOver(Point point) {
    Object value = null;
    try {
      int pos = infoRouteJList.locationToIndex(point);
      value = ((DefaultListModel) infoRouteJList.getModel()).get(pos);

      if (value != null && value instanceof InfoRouteStretchBean) {
        InfoRouteStretchBean actualStretchBean = (InfoRouteStretchBean) value;
        ArrayList<Geometry> geoArrayList = new ArrayList<Geometry>();
        if (actualStretchBean != null
            && actualStretchBean.getGeometries() != null
            && !actualStretchBean.getGeometries().isEmpty()) {
          geoArrayList.addAll(actualStretchBean.getGeometries());
        }

        if (value instanceof TurnRouteStreetchBean) {
          GeometryFactory geoFactory = new GeometryFactory();
          if (((TurnRouteStreetchBean) value).getTurnNode() != null) {
            geoArrayList.add(
                geoFactory.createPoint(
                    ((XYNode) ((TurnRouteStreetchBean) value).getTurnNode()).getCoordinate()));
          }
        }

        GeometryFactory geoFactory = new GeometryFactory();
        GeometryCollection geoCollection =
            new GeometryCollection(
                geoArrayList.toArray(new Geometry[geoArrayList.size()]), geoFactory);

        pluginContext.getLayerViewPanel().flash(geoCollection);

        try {
          //					Component comp = getInfoListPanel().getComponentAt(point);
          //					 if (comp != null){
          //						comp.setBackground(Color.LIGHT_GRAY);
          //						 comp.setForeground(Color.RED);
          //					 }
        } catch (Exception e) {
          e.printStackTrace();
        }
      }

    } catch (Exception ex) {
      ex.printStackTrace();
      ErrorDialog.show(
          null,
          "Error resaltar un tramo de la ruta.",
          I18N.get(
              "routedescription", "routeengine.route.description.error.route.not.zoom.message"),
          StringUtil.stackTrace(ex));
    }
  }
  public boolean execute(PlugInContext context) throws Exception {
    this.context = context;

    this.dialog =
        new ManageNetworksDialog(
            this.context, I18N.get("delnetworks", "routeengine.deletenetworks.dialogtitle"));

    if (dialog.wasOKPressed()) {
      return false;
    }

    return false;
  }