Exemplo n.º 1
0
  public void loadThumbnail() {

    try {
      File rutaThumb = new File(this.getBasePath(), "thumb.png");
      thumbnail = new ImageIcon(rutaThumb.getAbsolutePath()).getImage();
    } catch (Exception e) {
      thumbnail = IconLoader.icon("app-icon.gif").getImage();
    }
  }
Exemplo n.º 2
0
  /** Creates new form CAcercaDeJDialog */
  public CAcercaDeJDialog(java.awt.Frame parent, boolean modal) {
    super(parent, modal);
    initComponents();

    IconLoader.icon("splash.png");
    SplashPanel splashPanel = new SplashPanel(splashImage(), VERSION_TEXT);
    splashPanel.setAlignmentX(0);
    splashPanel.setAlignmentY(0);
    acercaDeJPanel.add(splashPanel, 0);
    this.setTitle(MainActividad.literales.getString("CAcercaDe.tittle"));
  }
  private void jbInit() throws Exception {
    this.setLayout(null);
    lblComparacion.setText("Ver comparación IBI-PMH");
    lblComparacion.setBounds(new Rectangle(135, 20, 375, 20));
    lblImagen.setBounds(new Rectangle(15, 20, 110, 490));

    lblImagen.setIcon(IconLoader.icon("catastro.png"));
    lblImagen.setBorder(BorderFactory.createLineBorder(Color.black, 1));

    rdbNif.setText("NIF Titular:");
    rdbNif.setBounds(new Rectangle(135, 100, 90, 20));
    rdbReferencia.setText("Referencia Catastral:");
    rdbReferencia.setBounds(new Rectangle(135, 130, 140, 25));

    ButtonGroup grupoOpciones = new ButtonGroup();
    lblTermino.setText("Introduzca el término de búsqueda:");
    lblTermino.setBounds(new Rectangle(135, 60, 275, 20));
    txtNif.setBounds(new Rectangle(225, 100, 100, 20));
    lblGuion.setText("-");
    lblGuion.setBounds(new Rectangle(325, 100, 10, 20));
    txtCaracterNif.setBounds(new Rectangle(330, 100, 20, 20));
    txtReferencia.setBounds(new Rectangle(290, 130, 170, 20));
    grupoOpciones.add(rdbNif);
    grupoOpciones.add(rdbReferencia);
    rdbNif.setSelected(true);
    btnFinalizar.setText("Finalizar");
    btnFinalizar.setBounds(new Rectangle(645, 530, 90, 25));
    /*btnSiguiente.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        btnSiguiente_actionPerformed(e);
      }
    });*/
    /* btnAnterior.addActionListener(new ActionListener()
    {
      public void actionPerformed(ActionEvent e)
      {
        btnAnterior_actionPerformed(e);
      }
    });*/
    this.setSize(750, 600);
    this.add(txtReferencia, null);
    this.add(txtCaracterNif, null);
    this.add(lblGuion, null);
    this.add(txtNif, null);
    this.add(lblTermino, null);
    this.add(btnFinalizar, null);
    this.add(rdbReferencia, null);
    this.add(rdbNif, null);
    this.add(lblImagen, null);
    this.add(lblComparacion, null);
  }
Exemplo n.º 4
0
 /**
  * This method initializes jButton1
  *
  * @return javax.swing.JButton
  */
 private JButton getFlashFeatureButton() {
   if (flashFeatureButton == null) {
     flashFeatureButton = new JButton();
     if (layerViewPanel == null) flashFeatureButton.setVisible(false);
     flashFeatureButton.setIcon(IconLoader.icon("Flashlight.gif"));
     flashFeatureButton.setToolTipText(
         aplicacion.getI18nString("FieldDialog.FlashCurrentFeature"));
     flashFeatureButton.addActionListener(
         new java.awt.event.ActionListener() {
           public void actionPerformed(java.awt.event.ActionEvent e) {
             flashFeature(documentExtendedForm.getSelectedFeature());
             setDescription();
           }
         });
   }
   return flashFeatureButton;
 }
Exemplo n.º 5
0
 /**
  * This method initializes jButton
  *
  * @return javax.swing.JButton
  */
 private JButton getZoomFeatureButton() {
   if (zoomFeatureButton == null) {
     zoomFeatureButton = new JButton();
     if (layerViewPanel == null) zoomFeatureButton.setVisible(false);
     zoomFeatureButton.setIcon(com.geopista.ui.images.IconLoader.icon("SmallMagnify.gif"));
     zoomFeatureButton.setToolTipText(
         aplicacion.getI18nString("FieldDialog.ZoomToCurrentFeature"));
     zoomFeatureButton.addActionListener(
         new java.awt.event.ActionListener() {
           public void actionPerformed(java.awt.event.ActionEvent e) {
             zoom(documentExtendedForm.getSelectedFeature());
             setDescription();
           }
         });
   }
   return zoomFeatureButton;
 }
Exemplo n.º 6
0
 public static ImageIcon splashImage() {
   if (splashImage == null) splashImage = IconLoader.icon("splash.png");
   return splashImage;
 }
  private void jbInit() throws Exception {
    // Leemos la conexion

    //
    //    con = getDBConnection();
    GeopistaGeneradorListadosConexionBD geopistaListados =
        new GeopistaGeneradorListadosConexionBD();

    this.setLayout(null);
    this.setSize(new Dimension(854, 500));
    jPanel1.setLayout(null);
    jPanel1.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
    lblDatosGenerales.setText(aplicacion.getI18nString("generador.app.reports.datos.generales"));
    lblModulo.setText(aplicacion.getI18nString("generador.app.reports.modulo"));
    lblCapa.setText(aplicacion.getI18nString("generador.app.reports.capa"));

    // Cargamos la lista de capas
    ArrayList capas = geopistaListados.capasGeopista();

    Iterator i = capas.iterator();
    lblDatosGenerales.setBounds(new Rectangle(135, 5, 185, 20));
    lblModulo.setBounds(new Rectangle(135, 23, 60, 25));
    lblCapa.setBounds(new Rectangle(135, 50, 45, 30));
    jPanel1.setBounds(new Rectangle(10, 15, 750, 500));
    jSeparator1.setBounds(new Rectangle(0, 135, 735, 5));
    while (i.hasNext()) {
      modeloList.addElement(i.next());
    }

    // Creamos la lista con el modelo anteriormente definido

    // --    jPanel1.setSize(new Dimension(750, 600));
    cmbModulos.setBackground(new Color(254, 255, 255));
    cmbModulos.setBounds(new Rectangle(215, 25, 520, 20));

    lstCapas.setSelectionModel(listSelectionModel1);

    lblTitulo.setText(aplicacion.getI18nString("informe.datos.seleccion.titulo.fichero"));
    lblTitulo.setBounds(new Rectangle(140, 215, 95, 15));
    txtTituloInforme.setBounds(new Rectangle(140, 230, 595, 20));

    lstCapas.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyReleased(java.awt.event.KeyEvent e) {
            String cadena = (String) lstCapas.getSelectedValue();
            lstCapas.ensureIndexIsVisible(lstCapas.getSelectedIndex());
            lstCapas.setSelectedValue((String) cadena, true);
          }
        });
    lstCapas.addMouseListener(
        new MouseListener() {
          public void mouseClicked(MouseEvent e) {
            wizardContext.inputChanged();
          }

          public void mousePressed(MouseEvent e) {}

          public void mouseReleased(MouseEvent e) {}

          public void mouseEntered(MouseEvent e) {}

          {
          }

          public void mouseExited(MouseEvent e) {}
        });

    lblDescripcion.setText(aplicacion.getI18nString("generador.app.reports.descripcion.informe"));
    lblDescripcion.setBounds(new Rectangle(140, 255, 95, 20));
    txtDescripcion.setBounds(new Rectangle(140, 280, 595, 95));
    lblOrientacion.setText(aplicacion.getI18nString("generador.app.reports.orientacion.informe"));
    lblOrientacion.setBounds(new Rectangle(135, 178, 85, 25));
    lblNombreFichero.setText(aplicacion.getI18nString("generador.app.reports.nombre.fichero"));
    lblNombreFichero.setBounds(new Rectangle(135, 145, 120, 30));
    txtNombreFichero.setBounds(new Rectangle(215, 150, 520, 20));

    //    hb.enableHelpKey(this,"encabezado",hs);
    // Ponemos a mano los Módulos , prueba
    cmbModulos.addItem(
        (String) aplicacion.getI18nString("generador.app.reports.modulo.planeamiento"));
    cmbModulos.addItem(aplicacion.getI18nString("generador.app.reports.modulo.catastro"));
    cmbModulos.addItem(aplicacion.getI18nString("generador.app.reports.modulo.informacion"));
    cmbModulos.addItem(aplicacion.getI18nString("generador.app.reports.modulo.patrimonio"));
    cmbModulos.addItem(aplicacion.getI18nString("generador.app.reports.modulo.infraestructuras"));
    // Ponemos las explicaciones de las secciones
    /*  lblExplicacionDatosInformes.setText(aplicacion.getI18nString("informe.datos.generales.explicacion.comentarios"));
    txtTituloInforme.setToolTipText(aplicacion.getI18nString("informe.datos.generales.explicacion.titulo.fichero"));
    txtDescripcion.setToolTipText(aplicacion.getI18nString("informe.datos.generales.explicacion.detalle"));
    txtNombreFichero.setToolTipText(aplicacion.getI18nString("informe.datos.generales.explicacion.nombre.fichero"));
    lblUbicacion.setText(aplicacion.getI18nString("informe.datos.generales.explicacion.ubicacion"));*/

    // Ponemos a mano la horientacion
    optVertical.setText(aplicacion.getI18nString("generador.app.reports.orientacion.vertical"));
    optHorizontal.setText(aplicacion.getI18nString("generador.app.reports.orientacion.horizontal"));

    // Nuevo Listener para ver cuando cambia la caja de texto
    txtTituloInforme.addKeyListener(
        new KeyListener() {
          public void keyTyped(KeyEvent e) {}

          public void keyPressed(KeyEvent e) {
            wizardContext.inputChanged();
          }

          public void keyReleased(KeyEvent e) {}
        });
    optVertical.setText(aplicacion.getI18nString("generador.app.reports.orientacion.vertical"));
    optVertical.setSelected(true);
    optVertical.setBounds(new Rectangle(215, 180, 125, 20));
    optVertical.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            optVertical_actionPerformed(e);
          }
        });
    optHorizontal.setText(aplicacion.getI18nString("generador.app.reports.orientacion.horizontal"));
    optHorizontal.setBounds(new Rectangle(360, 180, 135, 20));
    optHorizontal.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            optHorizontal_actionPerformed(e);
          }
        });
    jScrollPane1.setBounds(new Rectangle(215, 60, 520, 70));
    jSeparator2.setBounds(new Rectangle(5, 205, 730, 5));
    lblImagen.setBounds(new Rectangle(15, 20, 110, 490));
    lblImagen.setIcon(IconLoader.icon((String) blackboardInformes.get("tipoBanner")));
    lblImagen.setBounds(new Rectangle(15, 20, 110, 490));
    lblImagen.setBorder(BorderFactory.createLineBorder(Color.black, 1));
    lblImagen.setBorder(BorderFactory.createLineBorder(Color.black, 1));

    txtNombreFichero.addKeyListener(
        new KeyListener() {
          public void keyTyped(KeyEvent e) {}

          public void keyPressed(KeyEvent e) {
            wizardContext.inputChanged();
          }

          public void keyReleased(KeyEvent e) {}
        });

    jScrollPane1.getViewport().add(lstCapas, null);
    jPanel1.add(jSeparator2, null);
    jPanel1.add(jScrollPane1, null);
    jPanel1.add(optHorizontal, null);
    jPanel1.add(optVertical, null);
    jPanel1.add(txtTituloInforme, null);
    jPanel1.add(lblTitulo, null);
    jPanel1.add(txtDescripcion, null);
    jPanel1.add(lblDescripcion, null);
    jPanel1.add(lblOrientacion, null);
    jPanel1.add(txtNombreFichero, null);
    jPanel1.add(lblNombreFichero, null);
    jPanel1.add(jSeparator1, null);
    jPanel1.add(lblCapa, null);
    jPanel1.add(cmbModulos, null);
    jPanel1.add(lblModulo, null);
    jPanel1.add(lblDatosGenerales, null);
    this.add(lblImagen, null);
    this.add(jPanel1, null);

    // Cargamos las capas en la lista

  }
  public boolean execute(PlugInContext context) throws Exception {
    LineString a = null;
    List capasVisibles =
        context.getWorkbenchContext().getLayerNamePanel().getLayerManager().getVisibleLayers(true);

    context.getLayerViewPanel().getLayerManager().getVisibleLayers(true);
    context.getLayerNamePanel().getLayerManager().getVisibleLayers(false);

    Iterator capasVisiblesIter = capasVisibles.iterator();
    boolean cancelWhile = false;

    final LockManager lockManager =
        (LockManager)
            context
                .getActiveTaskComponent()
                .getLayerViewPanel()
                .getBlackboard()
                .get(LockManager.LOCK_MANAGER_KEY);

    while (capasVisiblesIter.hasNext()) {
      Layer capaActual = (Layer) capasVisiblesIter.next();
      Collection featuresSeleccionadas =
          context
              .getWorkbenchContext()
              .getLayerViewPanel()
              .getSelectionManager()
              .getFeaturesWithSelectedItems(capaActual);

      // Almacenamos en este ArrayList el resultado de la operacion de
      // bloqueo

      Iterator featuresSeleccionadasIter = featuresSeleccionadas.iterator();
      while (featuresSeleccionadasIter.hasNext()) {
        if (cancelWhile == true) {
          if (JOptionPane.showConfirmDialog(
                  (Component) context.getWorkbenchGuiComponent(),
                  aplicacion.getI18nString("GeopistaFeatureSchemaPlugIn.RestoFeatures"),
                  aplicacion.getI18nString("GeopistaFeatureSchemaPlugIn.EditarMultiplesEntidades"),
                  JOptionPane.YES_NO_OPTION)
              == JOptionPane.NO_OPTION) return false;
          else cancelWhile = false;
        }

        localFeature = (Feature) featuresSeleccionadasIter.next();
        String systemId = ((GeopistaFeature) localFeature).getSystemId();
        final ArrayList lockResultaArrayList = new ArrayList();
        // capa de sistema. La feature debe bloquearse
        if (capaActual instanceof GeopistaLayer
            && !((GeopistaLayer) capaActual).isLocal()
            && !((GeopistaLayer) capaActual).isExtracted()
            && capaActual.isEditable()
            && systemId != null
            && !((GeopistaFeature) localFeature).isTempID()
            && !systemId.equals("")) {

          final TaskMonitorDialog progressDialog =
              new TaskMonitorDialog(aplicacion.getMainFrame(), context.getErrorHandler());

          progressDialog.setTitle(aplicacion.getI18nString("LockFeatures"));
          progressDialog.addComponentListener(
              new ComponentAdapter() {
                public void componentShown(ComponentEvent e) {

                  // Wait for the dialog to appear before starting the
                  // task. Otherwise
                  // the task might possibly finish before the dialog
                  // appeared and the
                  // dialog would never close. [Jon Aquino]
                  new Thread(
                          new Runnable() {
                            public void run() {

                              try {

                                Integer lockID =
                                    lockManager.lockFeature(localFeature, progressDialog);
                                lockResultaArrayList.add(lockID);
                              } catch (Exception e) {

                              } finally {
                                progressDialog.setVisible(false);
                              }
                            }
                          })
                      .start();
                }
              });
          GUIUtil.centreOnWindow(progressDialog);
          progressDialog.setVisible(true);
        }

        FeatureDialog featureDialog =
            new FeatureDialog(
                GeopistaFunctionUtils.getFrame(context.getWorkbenchGuiComponent()),
                "Atributos",
                true,
                localFeature,
                context.getWorkbenchContext().getLayerViewPanel(),
                capaActual);

        Integer tempLockID = null;
        Iterator lockResultaArrayListIter = lockResultaArrayList.iterator();
        if (lockResultaArrayListIter.hasNext()) {
          tempLockID = (Integer) lockResultaArrayListIter.next();
        }
        final Integer lockID = tempLockID;

        try {

          ImageIcon icon = IconLoader.icon("logo_geopista.png");

          featureDialog.setSideBarImage(null);
        } catch (NullPointerException e) {
          e.printStackTrace();
        }

        if (capaActual instanceof GeopistaLayer) {
          String extendedForm = ((GeopistaLayer) capaActual).getFieldExtendedForm();
          if (extendedForm == null) extendedForm = "";
          if (!extendedForm.equals("")) {

            featureDialog.setExtendedForm(extendedForm);
          }
        }

        featureDialog.buildDialog();
        if ((capaActual instanceof GeopistaLayer
                && (((GeopistaLayer) capaActual).isLocal()
                    || ((GeopistaLayer) capaActual).isExtracted())
                && !capaActual.isEditable())
            || (lockID == null
                && capaActual instanceof GeopistaLayer
                && !((GeopistaLayer) capaActual).isLocal()
                && !((GeopistaLayer) capaActual).isExtracted()
                && !capaActual.isEditable()
                && systemId != null
                && !((GeopistaFeature) localFeature).isTempID()
                && !systemId.equals(""))) {
          featureDialog.setLock();
        }
        featureDialog.setVisible(true);

        // solo para GeopistaLayer

        if (featureDialog.wasOKPressed()) {
          if (capaActual.isEditable()) {

            if (capaActual instanceof GeopistaLayer
                && !((GeopistaLayer) capaActual).isLocal()
                && lockID == null) continue;
            // obtenemos la feature con los cambios introducidos por
            // el usuario
            clonefeature = featureDialog.getModifiedFeature();
            // Actualiza los parámetros
            execute(
                new UndoableCommand(getName()) {

                  public void execute() {

                    localFeature.setAttributes(clonefeature.getAttributes());
                  }

                  public void unexecute() {
                    ((GeopistaFeature) clonefeature).setFireDirtyEvents(false);
                    clonefeature.setAttributes(localFeature.getAttributes());
                    ((GeopistaFeature) clonefeature).setFireDirtyEvents(true);
                  }
                },
                context);
          }

        } else {
          // el usuario ha pedido cancelar la edición
          cancelWhile = true;
        }

        if (lockID != null) {
          final TaskMonitorDialog progressDialogFinal =
              new TaskMonitorDialog(aplicacion.getMainFrame(), context.getErrorHandler());

          progressDialogFinal.setTitle(aplicacion.getI18nString("UnlockFeatures"));
          progressDialogFinal.addComponentListener(
              new ComponentAdapter() {
                public void componentShown(ComponentEvent e) {

                  // Wait for the dialog to appear before starting
                  // the
                  // task. Otherwise
                  // the task might possibly finish before the
                  // dialog
                  // appeared and the
                  // dialog would never close. [Jon Aquino]
                  new Thread(
                          new Runnable() {
                            public void run() {

                              try {

                                lockManager.unlockFeaturesByLockId(lockID, progressDialogFinal);
                              } catch (Exception e) {

                              } finally {
                                progressDialogFinal.setVisible(false);
                              }
                            }
                          })
                      .start();
                }
              });
          GUIUtil.centreOnWindow(progressDialogFinal);
          progressDialogFinal.setVisible(true);
        }
      }
    }

    return false;
  }
Exemplo n.º 9
0
/**
 * TODO Documentación
 *
 * @author juacas
 */
public class ScaleBarConfigDialog extends JDialog {

  private javax.swing.JPanel jContentPane = null;
  private JCheckBox transparencyCheckBox = null;
  private JCheckBox areasCheckBox = null;
  private JSlider numDivisionsSlider = null;
  private JLabel jLabel = null;
  private JComboBox styleComboBox = null;
  private JLabel jLabel1 = null;
  /**
   * This method initializes jCheckBox
   *
   * @return javax.swing.JCheckBox
   */
  private JCheckBox getTransparencyCheckBox() {
    if (transparencyCheckBox == null) {
      transparencyCheckBox = new JCheckBox();
      // transparencyCheckBox.setText("ScaleBarDialog.Transparency");  // Generated
      transparencyCheckBox.setText(
          I18NPlug.get(
              PrintLayoutPlugIn.name,
              "reso.jumpPlugIn.printLayoutPlugIn.printLayoutInterface.ScaleBarDialog.Transparency"));
    }
    return transparencyCheckBox;
  }
  /**
   * This method initializes jCheckBox1
   *
   * @return javax.swing.JCheckBox
   */
  private JCheckBox getAreasCheckBox() {
    if (areasCheckBox == null) {
      areasCheckBox = new JCheckBox();
      // areasCheckBox.setText("ScaleBarDialog.Areas");  // Generated
      areasCheckBox.setText(
          I18NPlug.get(
              PrintLayoutPlugIn.name,
              "reso.jumpPlugIn.printLayoutPlugIn.printLayoutInterface.ScaleBarDialog.Areas"));
    }
    return areasCheckBox;
  }
  /**
   * This method initializes jSlider
   *
   * @return javax.swing.JSlider
   */
  private JSlider getNumDivisionsSlider() {
    if (numDivisionsSlider == null) {
      numDivisionsSlider = new JSlider();
      numDivisionsSlider.setMaximum(9); // Generated
      numDivisionsSlider.setMinimum(2); // Generated
      numDivisionsSlider.setPaintTicks(true); // Generated
      numDivisionsSlider.setPaintLabels(true); // Generated
      numDivisionsSlider.setSnapToTicks(true); // Generated
      numDivisionsSlider.setValue(3); // Generated
      numDivisionsSlider.setMinorTickSpacing(1); // Generated
      numDivisionsSlider.setPaintTrack(true); // Generated
    }
    return numDivisionsSlider;
  }
  /**
   * This method initializes jComboBox
   *
   * @return javax.swing.JComboBox
   */
  private JComboBox getStyleComboBox() {
    if (styleComboBox == null) {
      styleComboBox = new JComboBox();
      initCombo(styleComboBox);
      styleComboBox.setRenderer(
          new ListCellRenderer() {
            JLabel rep = new JLabel();

            public Component getListCellRendererComponent(
                JList arg0, Object arg1, int arg2, boolean arg3, boolean arg4) {
              ImageIcon oc = (ImageIcon) arg1;
              Image im =
                  oc.getImage()
                      .getScaledInstance(
                          oc.getIconWidth() * 30 / oc.getIconHeight(), 30, Image.SCALE_SMOOTH);
              rep.setIcon(new ImageIcon(im));
              return (JLabel) rep;
            }
          });
      styleComboBox.setEnabled(false); // Generated
    }
    return styleComboBox;
  }
  /** @param comboBox */
  private void initCombo(JComboBox comboBox) {

    comboBox.setEnabled(false);
    DefaultComboBoxModel cmodel = new DefaultComboBoxModel(scaleBarTypes);
    comboBox.setModel(cmodel);
  }

  public static Icon scaleBarTypes[] =
      new Icon[] {
        IconLoader.icon("escala1.jpg"),
        IconLoader.icon("escala2.jpg"),
        IconLoader.icon("escala3.jpg"),
        IconLoader.icon("escala4.jpg"),
        IconLoader.icon("escala5.jpg"),
      };
  private OKCancelPanel OKCancelPanel = null;
  private ScaleBarFrame sbframe;
  private JComboBox mapLinkedBomboBox = null;
  /**
   * This method initializes OKCancelPanel
   *
   * @return com.vividsolutions.jump.workbench.ui.OKCancelPanel
   */
  private OKCancelPanel getOKCancelPanel() {
    if (OKCancelPanel == null) {
      OKCancelPanel = new OKCancelPanel();
      OKCancelPanel.addActionListener(
          new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent e) {
              if (OKCancelPanel.wasOKPressed()) setFields();
              setVisible(false);
            }
          });
    }
    return OKCancelPanel;
  }
  /**
   * This method initializes jComboBox
   *
   * @return javax.swing.JComboBox
   */
  private JComboBox getMapLinkedBomboBox() {
    if (mapLinkedBomboBox == null) {
      mapLinkedBomboBox = new JComboBox();

      List elemd = sbframe.getParent().getPage().getGraphicElement();
      int cont = 1;
      for (Iterator iter = elemd.iterator(); iter.hasNext(); ) {
        GraphicElements element = (GraphicElements) iter.next();
        if (element instanceof MapFrame) {
          MapFrame map = (MapFrame) element;
          String mp = "Mapa número" + cont;
          mapLinkedBomboBox.addItem(mp);
          if (sbframe.linkedToMapNumber == cont) mapLinkedBomboBox.setSelectedItem(mp);
          cont++;
        }
      }
    }
    return mapLinkedBomboBox;
  }

  public static void main(String[] args) {
    ScaleBarConfigDialog dlg = new ScaleBarConfigDialog(null);
    dlg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    dlg.setVisible(true);
    System.exit(0);
  }
  /** This is the default constructor */
  public ScaleBarConfigDialog() {
    super();
    initialize();
  }
  /** @param object */
  public ScaleBarConfigDialog(Frame object) {
    super(object);
    initialize();
    initCombo(getStyleComboBox());
  }

  public ScaleBarConfigDialog(Frame object, ScaleBarFrame sbframe) {
    super(object);
    this.sbframe = sbframe;
    initialize();
    initCombo(getStyleComboBox());
    initFields();
  }
  /** */
  private void initFields() {
    getTransparencyCheckBox().setSelected(sbframe.getTransparency() < 255);
    getAreasCheckBox().setSelected(sbframe.isPaintingArea());
    getNumDivisionsSlider().setValue(sbframe.getIncrementCount());
  }

  private void setFields() {
    sbframe.setTransparency(getTransparencyCheckBox().isSelected() ? 128 : 255);
    sbframe.setPaintingArea(getAreasCheckBox().isSelected());
    sbframe.setIncrementCount(getNumDivisionsSlider().getValue());
    sbframe.setLinkedToMapNumber(getMapLinkedBomboBox().getSelectedIndex() + 1);
  }
  /**
   * This method initializes this
   *
   * @return void
   */
  private void initialize() {
    this.setResizable(false); // Generated
    this.setModal(true); // Generated
    this.setSize(449, 210);
    this.setContentPane(getJContentPane());
  }
  /**
   * This method initializes jContentPane
   *
   * @return javax.swing.JPanel
   */
  private javax.swing.JPanel getJContentPane() {
    if (jContentPane == null) {
      GridBagConstraints gridBagConstraints = new GridBagConstraints();
      gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; // Generated
      gridBagConstraints.gridy = 4; // Generated
      gridBagConstraints.weightx = 1.0; // Generated
      gridBagConstraints.gridx = 2; // Generated
      jLabel1 = new JLabel();
      jLabel = new JLabel();
      GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
      GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
      GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
      GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
      GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
      GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
      GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
      jContentPane = new javax.swing.JPanel();
      jContentPane.setLayout(new GridBagLayout());
      gridBagConstraints1.gridx = 1; // Generated
      gridBagConstraints1.gridy = 0; // Generated
      gridBagConstraints1.anchor = java.awt.GridBagConstraints.WEST; // Generated
      gridBagConstraints1.gridwidth = 2; // Generated
      gridBagConstraints2.gridx = 1; // Generated
      gridBagConstraints2.gridy = 1; // Generated
      gridBagConstraints2.anchor = java.awt.GridBagConstraints.WEST; // Generated
      gridBagConstraints2.gridwidth = 2; // Generated
      gridBagConstraints3.gridx = 2; // Generated
      gridBagConstraints3.gridy = 2; // Generated
      gridBagConstraints3.weightx = 1.0; // Generated
      gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL; // Generated
      gridBagConstraints4.gridx = 1; // Generated
      gridBagConstraints4.gridy = 2; // Generated
      gridBagConstraints4.anchor = java.awt.GridBagConstraints.WEST; // Generated
      jLabel.setText(
          I18NPlug.get(
              PrintLayoutPlugIn.name,
              "reso.jumpPlugIn.printLayoutPlugIn.printLayoutInterface.ScaleBarDialog.NumDivision")); // Generated
      gridBagConstraints5.gridx = 2; // Generated
      gridBagConstraints5.gridy = 3; // Generated
      gridBagConstraints5.weightx = 1.0; // Generated
      gridBagConstraints5.fill = java.awt.GridBagConstraints.HORIZONTAL; // Generated
      gridBagConstraints6.gridx = 1; // Generated
      gridBagConstraints6.gridy = 3; // Generated
      jLabel1.setText(
          I18NPlug.get(
              PrintLayoutPlugIn.name,
              "reso.jumpPlugIn.printLayoutPlugIn.printLayoutInterface.ScaleBarDialog.Style")); // Generated
      gridBagConstraints7.gridx = 1; // Generated
      gridBagConstraints7.gridy = 5; // Generated
      gridBagConstraints7.gridwidth = 2; // Generated
      jContentPane.add(getTransparencyCheckBox(), gridBagConstraints1); // Generated
      jContentPane.add(getAreasCheckBox(), gridBagConstraints2); // Generated
      jContentPane.add(getNumDivisionsSlider(), gridBagConstraints3); // Generated
      jContentPane.add(jLabel, gridBagConstraints4); // Generated
      jContentPane.add(getStyleComboBox(), gridBagConstraints5); // Generated
      jContentPane.add(jLabel1, gridBagConstraints6); // Generated
      jContentPane.add(getOKCancelPanel(), gridBagConstraints7); // Generated
      jContentPane.add(getMapLinkedBomboBox(), gridBagConstraints); // Generated
    }
    return jContentPane;
  }
} //  @jve:decl-index=0:visual-constraint="10,10"
Exemplo n.º 10
0
 /** @return Returns the thumbnail. */
 public Image getThumbnail() {
   if (thumbnail == null) {
     thumbnail = IconLoader.icon("app-icon.gif").getImage();
   }
   return thumbnail;
 }
Exemplo n.º 11
0
 public ImageIcon getIcon() {
   return IconLoader.icon("/com/geopista/ui/images/movilidad_borrar.png");
 }