public void enter() {
    Blackboard Identificadores = app.getBlackboard();
    ID_Inmueble = Integer.parseInt(Identificadores.get("IdInmueble").toString());

    // Mostramos los datos para el inmueble
    PatrimonioPostgre General = new PatrimonioPostgre();
    ArrayList Datos = General.DatosRegistro(ID_Inmueble);
    if (Datos == null) return;
    Iterator alIt = Datos.iterator();
    Iterator itControles = Registro.iterator();
    while (itControles.hasNext()) {
      try {
        JComponent comp = (JComponent) itControles.next();
        Object obj = alIt.next();
        if (comp instanceof JTextField)
          ((JTextField) comp).setText((obj != null) ? obj.toString() : "");
        if (comp instanceof JCheckBox) {
          String check = (obj != null) ? obj.toString() : "";
          if (check == "TRUE") {
            ((JCheckBox) comp).setSelected(true);
          } else {
            ((JCheckBox) comp).setSelected(false);
          }
        }
        if (comp instanceof JComboBox)
          ((JComboBox) comp).setSelectedItem((obj != null) ? obj.toString() : "");
      } catch (Exception A) {
        A.printStackTrace();
      }
    }
  }
示例#2
0
      public Component getTableCellRendererComponent(
          JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JLabel label =
            (JLabel)
                super.getTableCellRendererComponent(
                    table, value, isSelected, hasFocus, row, column);

        if (value instanceof Integer) {
          Icon icon = null;
          if (value.equals(2)) {
            label.setToolTipText(
                AppContext.getApplicationContext()
                    .getI18nString("alfresco.fileList.toolTip.ownAnnexation"));
            label.setIcon(iconGreenDoc);
          } else if (value.equals(1)) {
            label.setToolTipText(
                AppContext.getApplicationContext()
                    .getI18nString("alfresco.fileList.toolTip.alienAnnexation"));
            label.setIcon(iconOrangeDoc);
          } else {
            label.setToolTipText(
                AppContext.getApplicationContext()
                    .getI18nString("alfresco.fileList.toolTip.noAnnexation"));
            value = Color.red;
            label.setIcon(iconRedDoc);
          }
        }
        return label;
      }
 /**
  * Funcion que carga los datos del arrayList pasado por parametro en la tabla. En este caso son o
  * fincasCatastro o Bienes inmuebles. Se hace un instanceof para saberlo.
  *
  * @param dirRefCatas La lista de referencias del expediente
  */
 public void cargaDatosTabla(ArrayList dirRefCatas) {
   AppContext app = (AppContext) AppContext.getApplicationContext();
   Estructuras.cargarEstructura("Tipos de via normalizados de Catastro");
   String[][] datos = new String[dirRefCatas.size()][6];
   for (int i = 0; i < dirRefCatas.size(); i++) {
     DireccionLocalizacion auxDir = null;
     if (dirRefCatas.get(i) instanceof FincaCatastro) {
       FincaCatastro parcela = (FincaCatastro) dirRefCatas.get(i);
       auxDir = parcela.getDirParcela();
       datos[i][0] = parcela.getRefFinca().getRefCatastral();
     } else if (dirRefCatas.get(i) instanceof BienInmuebleCatastro) {
       BienInmuebleCatastro bien = (BienInmuebleCatastro) dirRefCatas.get(i);
       auxDir = bien.getDomicilioTributario();
       datos[i][0] = bien.getIdBienInmueble().getIdBienInmueble();
     }
     if (auxDir != null
         && Estructuras.getListaTipos().getDomainNode(auxDir.getTipoVia()) != null) {
       datos[i][1] =
           Estructuras.getListaTipos()
               .getDomainNode(auxDir.getTipoVia())
               .getTerm(app.getString(AppContext.GEOPISTA_LOCALE_KEY, "es_ES"));
     } else {
       datos[i][1] = "";
     }
     if (auxDir != null) {
       datos[i][2] = auxDir.getNombreVia();
       datos[i][3] = String.valueOf(auxDir.getPrimerNumero());
       datos[i][4] = auxDir.getCodPoligono();
       datos[i][5] = auxDir.getCodParcela();
     }
   }
   modelo.setDataVector(datos, identificadores);
   tablaRefCatasTabel.setModel(modelo);
 }
  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;
  }
  public void initialize(PlugInContext context) throws Exception {

    String pluginCategory = aplicacion.getString(toolBarCategory);
    ((WorkbenchGuiComponent) context.getWorkbenchContext().getIWorkbench().getGuiComponent())
        .getToolBar(pluginCategory)
        .addPlugIn(
            getIcon(),
            this,
            createEnableCheck(context.getWorkbenchContext()),
            context.getWorkbenchContext());

    JPopupMenu popupMenu = context.getWorkbenchGuiComponent().getLayerViewPopupMenu();

    // JPopupMenu layerNamePopupMenu = context.getWorkbenchContext().getIWorkbench()
    // .getGuiComponent()
    // .getLayerNamePopupMenu();

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

    featureInstaller.addPopupMenuItem(
        popupMenu,
        this,
        aplicacion.getI18nString(getName()),
        false,
        GUIUtil.toSmallIcon(ICON),
        createEnableCheck(context.getWorkbenchContext()));
    // null);

  }
示例#6
0
 public GeopistaMap(WorkbenchContext context) {
   // super();
   setIdMunicipio(AppContext.getIdMunicipio());
   setIdEntidad(AppContext.getIdEntidad());
   //    layerManager.setCoordinateSystem(PredefinedCoordinateSystems.createUTMNorth(30));
   layerManager.addLayerListener((LayerListener) context.getWorkbench());
 }
  public void initialize(FeatureDialogHome fd) {
    GeopistaSchema esquema = (GeopistaSchema) fd.getFeature().getSchema();

    AppContext.getApplicationContext().getBlackboard().put("featureDialog", fd);

    Object obj = fd.getFeature().getAttribute(esquema.getAttributeByColumn("id"));
    if (obj != null
        && !obj.equals("")
        && ((esquema.getGeopistalayer() != null
                && !esquema.getGeopistalayer().isExtracted()
                && !esquema.getGeopistalayer().isLocal())
            || (esquema.getGeopistalayer() == null)
                && fd.getFeature() instanceof GeopistaFeature
                && !((GeopistaFeature) fd.getFeature()).getLayer().isExtracted())) {

      String codprov = null;
      if (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codprov")) != null) {
        codprov =
            (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codprov"))).toString();
      }

      String codmunic = null;
      if (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codmunic")) != null) {
        codmunic =
            (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codmunic"))).toString();
      }

      String entidad = null;
      if (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codentidad")) != null) {
        entidad =
            (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codentidad"))).toString();
      }

      String nucleo = null;
      if (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codpoblamiento")) != null) {
        nucleo =
            (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codpoblamiento")))
                .toString();
      }

      AppContext app = (AppContext) AppContext.getApplicationContext();
      Blackboard Identificadores = app.getBlackboard();
      EdicionOperations operations = new EdicionOperations();
      Identificadores.put(
          "propiedadesnucleosencuestados1_panel",
          operations.getPanelNucleosEncuestados1EIEL(codprov, codmunic, entidad, nucleo));
      Encuestados1Panel encuestados1Panel = new Encuestados1Panel();
      encuestados1Panel.loadDataIdentificacion(codprov, codmunic, entidad, nucleo);
      encuestados1Panel.loadData();
      this.encuestados1Panel = encuestados1Panel;
      fd.addPanel(encuestados1Panel);
    }
  }
  public void initialize(FeatureDialogHome fd) {

    GeopistaSchema esquema = (GeopistaSchema) fd.getFeature().getSchema();

    Object obj = fd.getFeature().getAttribute(esquema.getAttributeByColumn("id"));
    if (obj != null
        && !obj.equals("")
        && ((esquema.getGeopistalayer() != null
                && !esquema.getGeopistalayer().isExtracted()
                && !esquema.getGeopistalayer().isLocal())
            || (esquema.getGeopistalayer() == null)
                && fd.getFeature() instanceof GeopistaFeature
                && !((GeopistaFeature) fd.getFeature()).getLayer().isExtracted())) {
      String clave = null;
      if (fd.getFeature().getAttribute(esquema.getAttributeByColumn("clave")) != null) {
        clave = (fd.getFeature().getAttribute(esquema.getAttributeByColumn("clave"))).toString();
      }

      String codprov = null;
      if (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codprov")) != null) {
        codprov =
            (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codprov"))).toString();
      }

      String codmunic = null;
      if (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codmunic")) != null) {
        codmunic =
            (fd.getFeature().getAttribute(esquema.getAttributeByColumn("codmunic"))).toString();
      }

      String orden_ca = null;
      if (fd.getFeature().getAttribute(esquema.getAttributeByColumn("orden_ca")) != null) {
        orden_ca =
            (fd.getFeature().getAttribute(esquema.getAttributeByColumn("orden_ca"))).toString();
      }

      int ID =
          Integer.parseInt(
              fd.getFeature().getAttribute(esquema.getAttributeByColumn("id")).toString());
      AppContext app = (AppContext) AppContext.getApplicationContext();
      Blackboard Identificadores = app.getBlackboard();
      Identificadores.put("ID_Captacion", ID);

      EdicionOperations operations = new EdicionOperations();
      Identificadores.put("captacion", operations.getCaptacionEIEL(ID));
      CaptacionesPanel captaciones = new CaptacionesPanel();
      captaciones.loadDataIdentificacion(clave, codprov, codmunic, orden_ca);
      captaciones.loadData();
      this.captacionesPanel = captaciones;
      fd.addPanel(captaciones);
    }
  }
 public void configure(Request request) {
   selectedStyles = (Object[]) request.getAttribute("selectedStyles");
   sldStyle = (SLDStyle) request.getAttribute("SLDStyle");
   // Para saber si estamos eligiendo fichero para una importación o exportación
   importar = (String) request.getAttribute("importar");
   layer = (Layer) request.getAttribute("Layer");
   layerName = (String) request.getAttribute("LayerName");
   String etiqueta = aplicacion.getI18nString("SLDStyle.SeleccionFichero");
   if (importar.equals("true"))
     etiqueta += aplicacion.getI18nString("SLDStyle.ImportarFicheroEstilo");
   else etiqueta += aplicacion.getI18nString("SLDStyle.ExportarFicheroEstilo");
   fileLbl.setText(etiqueta);
 }
示例#10
0
 public ViasSistemaDialog(String nomVia, String tipoVia, int codigoVia) {
   super(AppContext.getApplicationContext().getMainFrame());
   this.nomVia = nomVia;
   this.tipoVia = tipoVia;
   this.codigoVia = codigoVia;
   initialize();
 }
 public static String getUnidadTramitadoraActividades() {
   ApplicationContext app = AppContext.getApplicationContext();
   return (UNIDAD_TRAMITADORA_ACTIVIDAD.equalsIgnoreCase(
           app.getString(UNIDAD_TRAMITADORA_ACTIVIDAD))
       ? ""
       : app.getString(UNIDAD_TRAMITADORA_ACTIVIDAD));
 }
  public void execute() throws Exception {
    if (encuestados1Panel != null) {
      if (encuestados1Panel.datosMinimosYCorrectos()) {
        GeopistaLayer geopistaLayer =
            (GeopistaLayer)
                GeopistaEditorPanel.getEditor()
                    .getLayerManager()
                    .getLayer(ConstantesLocalGISEIEL.ENCUESTADOS1_LAYER);
        String idLayer = geopistaLayer.getSystemId();
        encuestados1Panel.okPressed();
        Encuestados1EIEL encuestado1 =
            (Encuestados1EIEL)
                AppContext.getApplicationContext()
                    .getBlackboard()
                    .get("propiedadesnucleosencuestados1_panel");
        ConstantesLocalGISEIEL.clienteLocalGISEIEL.insertarElemento(
            encuestados1Panel.getEncuestados1(encuestado1),
            idLayer,
            ConstantesLocalGISEIEL.ENCUESTADOS1);

        if (EditingInfoPanel.getInstance() != null
            && EditingInfoPanel.getInstance().getJPanelTree() != null
            && EditingInfoPanel.getInstance().getJPanelTree().getPatronSelected() != null) {
          if (EditingInfoPanel.getInstance()
              .getJPanelTree()
              .getPatronSelected()
              .equals(ConstantesLocalGISEIEL.ENCUESTADOS1)) {
            EditingInfoPanel.getInstance().listarDatosTabla();
          }
        }
      }
    }
  }
  /**
   * Busca el codigo de via de una parcela
   *
   * @param int parcela
   * @return String codigoVia
   */
  public String codigoVia(int parcela) {
    Connection con = null;
    PreparedStatement ps = null;
    ResultSet r = null;
    String codigovia = "";

    try {
      con = abrirConexion();
      ps = con.prepareStatement("catastroInformesCodigoVia");
      ps.setInt(1, parcela);

      if (!ps.execute()) {
      } else {
        r = ps.getResultSet();
      }

      while (r.next()) {
        codigovia = r.getString(1);
      }
      return codigovia;
    } catch (Exception ex) {
      ex.printStackTrace();
      return null;
    } // catch
    finally {
      aplicacion.closeConnection(con, ps, null, r);
    }
  }
  /**
   * Obtiene el distrito censal de una parcela
   *
   * @param int parcela, identificador de la parcela
   * @return string distrito, devuelve el distrito censal
   */
  public String distritoCensal(int parcela) // el que vale
      {
    String Datos = "";
    Connection con = null;
    PreparedStatement ps = null;
    ResultSet r = null;
    try {

      con = this.abrirConexion();
      ps = con.prepareStatement("catastroInformesDistritosCensales");
      ps.setInt(1, parcela);

      if (!ps.execute()) {
        // System.out.println("no ejecuta");
      } else {
        r = ps.getResultSet();
      }
      while (r.next()) {
        Datos = r.getString(1);
      }
      return Datos;
    } catch (Exception ex) {
      ex.printStackTrace();
      return null;
    } // catch
    finally {
      aplicacion.closeConnection(con, ps, null, r);
    }
  }
  public Connection abrirConexion() throws SQLException {
    Connection conn = null;
    try {
      // Quitamos los drivers
      Class.forName("com.geopista.sql.GEOPISTADriver");
      String sConn = aplicacion.getString(UserPreferenceConstants.LOCALGIS_DATABASE_URL);
      conn = DriverManager.getConnection(sConn);
      AppContext app = (AppContext) AppContext.getApplicationContext();
      conn = app.getConnection();
      conn.setAutoCommit(false);
    } catch (Exception e) {
      return null;
    }

    return conn;
  }
示例#16
0
 public ViasSistemaDialog(String nomVia, String tipoVia, String idMunicipio) {
   super(AppContext.getApplicationContext().getMainFrame());
   this.nomVia = nomVia;
   this.tipoVia = tipoVia;
   this.idMunicipio = idMunicipio;
   initialize();
 }
示例#17
0
  private boolean confirmClose(String action, Collection modifiedLayers) {
    if (modifiedLayers.isEmpty()) {
      return true;
    }

    JOptionPane pane =
        new JOptionPane(
            StringUtil.split(
                modifiedLayers.size()
                    + " dataset"
                    + StringUtil.s(modifiedLayers.size())
                    + " "
                    + ((modifiedLayers.size() > 1) ? "have" : "has")
                    + " been modified ("
                    + ((modifiedLayers.size() > 3) ? "e.g. " : "")
                    + StringUtil.toCommaDelimitedString(
                        new ArrayList(modifiedLayers)
                            .subList(0, Math.min(3, modifiedLayers.size())))
                    + "). Continue?",
                80),
            JOptionPane.WARNING_MESSAGE);
    pane.setOptions(new String[] {action, "Cancel"});
    pane.createDialog(this, AppContext.getMessage("GeopistaName")).setVisible(true);

    return pane.getValue().equals(action);
  }
  public String getNombreNucleo(String codentidad, String codnucleo) {

    String nombreNucleo = codentidad;
    aplicacion = (AppContext) AppContext.getApplicationContext();

    HashMap map = (HashMap) aplicacion.getBlackboard().get("HASH_NUCLEOS_MUNICIPIO");

    String claveBusqueda = codentidad + "_" + codnucleo;

    LCGNucleoEIEL nucleoEIEL = (LCGNucleoEIEL) map.get(claveBusqueda);
    if (nucleoEIEL != null) {
      nombreNucleo = "(" + claveBusqueda + ") " + nucleoEIEL.getDenominacion();
    }

    return nombreNucleo;
  }
 public static String getUnidadTramitadoraOcupaciones() {
   ApplicationContext app = AppContext.getApplicationContext();
   return (UNIDAD_TRAMITADORA_OCUPACION.equalsIgnoreCase(
           app.getString(UNIDAD_TRAMITADORA_OCUPACION))
       ? ""
       : app.getString(UNIDAD_TRAMITADORA_OCUPACION));
 }
示例#20
0
 /** Método que renombra el panel de la lista */
 public void renombrarJListComponent() {
   try {
     mejorasListaPane.renombrar(aplicacion.getI18nString("inventario.mejoras.tag1"));
   } catch (Exception e) {
   }
   ;
 }
  public boolean execute(PlugInContext context) throws Exception {
    Collection selectedCategories = context.getLayerNamePanel().getSelectedCategories();

    String actualName = aplicacion.getI18nString("GeopistaAddNewLayerPlugIn.New");

    GeopistaLayer layer =
        new GeopistaLayer(
            actualName,
            context.getLayerManager().generateLayerFillColor(),
            createBlankFeatureCollection(),
            context.getLayerManager());
    // Como es una capa creada localmente asignamos el flag isLocal a true
    layer.setLocal(true);

    // com.geopista.io.datasource.GeopistaStandarReaderWriteFileDataSource.GeoGML
    // h = new
    // com.geopista.io.datasource.GeopistaStandarReaderWriteFileDataSource.GeoGML();
    // layer.setDataSourceQuery(new DataSourceQuery());

    context
        .getLayerManager()
        .addLayer(
            selectedCategories.isEmpty()
                ? StandardCategoryNames.WORKING
                : selectedCategories.iterator().next().toString(),
            layer);

    ((EditingPlugIn) context.getWorkbenchContext().getBlackboard().get(EditingPlugIn.KEY))
        .getToolbox(context.getWorkbenchContext())
        .setVisible(true);

    return true;
  }
示例#22
0
  private boolean bajarInformeFiles(String name) {
    String path = "";
    String url = "";
    String pathDestino = "";
    String plantillasURL = getUrlServer();

    try {

      String localPath =
          aplicacion.getUserPreference(
              AppContext.PREFERENCES_DATA_PATH_KEY, AppContext.DEFAULT_DATA_PATH, true);

      path = "plantillas" + File.separator + "routes" + File.separator;
      pathDestino = localPath + aplicacion.REPORT_DIR_NAME + File.separator + path;
      plantillasURL += "/plantillas/routes/";

      // Comprobamos que el path de las plantillas exista
      if (!new File(pathDestino).exists()) {
        new File(pathDestino).mkdirs();
      }

      // bajamos la plantilla
      url = plantillasURL + name;
      pathDestino = pathDestino + name;
      reportFile = pathDestino;
      // Devolvemos verdadero si todo ha sido correcto:
      return CUtilidadesComponentes.GetURLFile(url, pathDestino, "", 0);
    } catch (Exception ex) {
      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      ex.printStackTrace(pw);
      logger.error("Exception: " + sw.toString());
      return false;
    }
  }
示例#23
0
  public void initialize(PlugInContext context) throws Exception {

    context
        .getFeatureInstaller()
        .addMainMenuItem(this, new String[] {"OpenGestorFip"}, getName(), false, null, null);

    context
        .getWorkbenchContext()
        .getIWorkbench()
        .getGuiComponent()
        .getToolBar("OpenGestorFip")
        .addPlugIn(
            getIcon(),
            this,
            createEnableCheck(context.getWorkbenchContext()),
            context.getWorkbenchContext());

    JPopupMenu popupMenu = context.getWorkbenchGuiComponent().getLayerViewPopupMenu();

    FeatureInstaller featureInstaller = new FeatureInstaller(context.getWorkbenchContext());
    featureInstaller.addPopupMenuItem(
        popupMenu,
        this,
        AppContext.getApplicationContext().getI18nString(this.getName()),
        false,
        null,
        createEnableCheck(context.getWorkbenchContext()));
  }
  public void execute() throws Exception {
    if (captacionesPanel != null) {
      if (captacionesPanel.datosMinimosYCorrectos()) {
        GeopistaLayer geopistaLayer =
            (GeopistaLayer)
                GeopistaEditorPanel.getEditor()
                    .getLayerManager()
                    .getLayer(ConstantesLocalGISEIEL.CAPTACIONES_LAYER);
        String idLayer = geopistaLayer.getSystemId();
        captacionesPanel.okPressed();
        CaptacionesEIEL captacion =
            (CaptacionesEIEL) AppContext.getApplicationContext().getBlackboard().get("captacion");
        InitEIEL.clienteLocalGISEIEL.insertarElemento(
            captacionesPanel.getCaptacion(captacion), idLayer, ConstantesLocalGISEIEL.CAPTACIONES);

        if (EditingInfoPanel.getInstance() != null
            && EditingInfoPanel.getInstance().getJPanelTree() != null
            && EditingInfoPanel.getInstance().getJPanelTree().getPatronSelected() != null) {
          if (EditingInfoPanel.getInstance()
              .getJPanelTree()
              .getPatronSelected()
              .equals(ConstantesLocalGISEIEL.CAPTACIONES)) {
            EditingInfoPanel.getInstance().listarDatosTabla();
          }
        }
      }
    }
  }
示例#25
0
 public DataException(String msg) {
   super(msg);
   ErrorDialog.show(
       aplicacion.getMainFrame(),
       I18N.get("Importacion", "DataError.Titulo"),
       msg,
       StringUtil.stackTrace(this));
 }
示例#26
0
 public DataException(Throwable cause) {
   super(cause);
   ErrorDialog.show(
       aplicacion.getMainFrame(),
       I18N.get("Importacion", "DataError.Titulo"),
       I18N.get("Importacion", "DataError.Aviso"),
       StringUtil.stackTrace(this));
 }
 /**
  * Este metodo solo se puede utilizar para la aplicacion de Inventario para el plugin interno que
  * se utiliza dentro del editor no funciona
  *
  * @return
  */
 private InventarioInternalFrame getInventarioFrame() {
   try {
     return ((InventarioInternalFrame)
         ((MainInventario) AppContext.getApplicationContext().getMainFrame()).getIFrame());
   } catch (Exception ex) {
     return null;
   }
 }
示例#28
0
    /** Constructor */
    public DragTable() {
      setShowHorizontalLines(false);
      setShowVerticalLines(false);
      setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
      setColumnModel(
          new DefaultTableColumnModel() {
            public void moveColumn(int columnIndex, int newIndex) {
              if (columnIndex == 0 || newIndex == 0) return;
              super.moveColumn(columnIndex, newIndex);
            }
          });
      // setAutoCreateColumnsFromModel(false);

      DefaultTableModel tableModel = new DefaultTableModel();
      tableModel.addColumn(
          AppContext.getApplicationContext().getI18nString("alfresco.fileList.columnName"));
      tableModel.addColumn("");
      setModel(tableModel);
      setTableColumnModel();

      setBackground(Color.WHITE);
      setDragEnabled(true);
      final DragTable dragTable = this;
      setTransferHandler(
          new TransferHandler() {

            public boolean canImport(TransferSupport support) {
              return false;
            }

            @Override
            public int getSourceActions(JComponent c) {
              return TransferHandler.COPY_OR_MOVE;
            }

            @Override
            protected Transferable createTransferable(JComponent c) {
              assert (c == dragTable);
              DefaultMutableTreeNode defaultMutableTreeNode = new DefaultMutableTreeNode();
              defaultMutableTreeNode.setUserObject(
                  (DefaultMutableTreeNode)
                      dragTable.getModel().getValueAt(dragTable.getSelectedRow(), 0));
              defaultMutableTreeNode.setAllowsChildren(false);
              defaultMutableTreeNode.setParent(null);
              draggedNode = defaultMutableTreeNode;
              return new DataHandler(
                  defaultMutableTreeNode, dragAndDropTree.dataFlavor.getMimeType());
            }

            @Override
            protected void exportDone(JComponent c, Transferable t, int act) {
              if (act == TransferHandler.MOVE) {
                dragTable.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                workDone();
              }
            }
          });
    }
示例#29
0
 public void renombrarComponentes() {
   renombrarJListComponent();
   try {
     fechaEjecucionJLabel.setText(aplicacion.getI18nString("inventario.mejoras.tag2"));
   } catch (Exception e) {
   }
   try {
     mejorasJLabel.setText(aplicacion.getI18nString("inventario.mejoras.tag3"));
   } catch (Exception e) {
   }
   try {
     addJButton.setToolTipText(aplicacion.getI18nString("inventario.mejoras.tag4"));
   } catch (Exception e) {
   }
   try {
     deleteJButton.setToolTipText(aplicacion.getI18nString("inventario.mejoras.tag5"));
   } catch (Exception e) {
   }
   try {
     editJButton.setToolTipText(aplicacion.getI18nString("inventario.mejoras.tag6"));
   } catch (Exception e) {
   }
   try {
     okJButton.setToolTipText(aplicacion.getI18nString("inventario.mejoras.tag7"));
   } catch (Exception e) {
   }
   try {
     importeJLabel.setText(aplicacion.getI18nString("inventario.mejoras.tag10"));
   } catch (Exception e) {
   }
 }
示例#30
0
public class OpenGestorPlugIn extends AbstractPlugIn {

  private static AppContext appContext = (AppContext) AppContext.getApplicationContext();

  public boolean execute(PlugInContext context) throws Exception {

    JSplitPane splitpane =
        (JSplitPane) appContext.getBlackboard().get(ConstantesGestorFIP.OPEN_GESTORFIP);

    if (splitpane.getDividerLocation() <= 1) {
      splitpane.setDividerLocation(400);
    } else {
      splitpane.setDividerLocation(0);
    }

    return true;
  }

  public void initialize(PlugInContext context) throws Exception {

    context
        .getFeatureInstaller()
        .addMainMenuItem(this, new String[] {"OpenGestorFip"}, getName(), false, null, null);

    context
        .getWorkbenchContext()
        .getIWorkbench()
        .getGuiComponent()
        .getToolBar("OpenGestorFip")
        .addPlugIn(
            getIcon(),
            this,
            createEnableCheck(context.getWorkbenchContext()),
            context.getWorkbenchContext());

    JPopupMenu popupMenu = context.getWorkbenchGuiComponent().getLayerViewPopupMenu();

    FeatureInstaller featureInstaller = new FeatureInstaller(context.getWorkbenchContext());
    featureInstaller.addPopupMenuItem(
        popupMenu,
        this,
        AppContext.getApplicationContext().getI18nString(this.getName()),
        false,
        null,
        createEnableCheck(context.getWorkbenchContext()));
  }

  public static MultiEnableCheck createEnableCheck(WorkbenchContext workbenchContext) {
    EnableCheckFactory checkFactory = new EnableCheckFactory(workbenchContext);

    return new MultiEnableCheck();
  }

  public ImageIcon getIcon() {
    return IconLoader.icon("OpenGestorFip.gif");
  }
}