@Override
    public Component getListCellRendererComponent(
        final JList list,
        final Object value,
        final int index,
        final boolean isSelected,
        final boolean cellHasFocus) {
      super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);

      MethodRenderer.this.setText(" ");

      if (value instanceof IntervalStyleBuilder.METHOD) {
        METHOD mt = (METHOD) value;

        final String txt;
        switch (mt) {
          case EL:
            txt = MessageBundle.getString("el");
            break;
          case MANUAL:
            txt = MessageBundle.getString("manual");
            break;
          default:
            txt = MessageBundle.getString("qantile");
            break;
        }
        MethodRenderer.this.setText(txt);
      }
      return MethodRenderer.this;
    }
Beispiel #2
0
  private void initTree(final JContextTree tree) {

    LayerFeatureItem item = new LayerFeatureItem();
    item.actions().add(new ClearSelectionAction());
    item.actions().add(new DeleteSelectionAction());

    tree.controls().add(item);
    tree.controls().add(new NewGroupItem());
    tree.controls().add(new ZoomToLayerItem());
    tree.controls().add(new SeparatorItem());
    tree.controls().add(new SessionCommitItem());
    tree.controls().add(new SessionRollbackItem());
    tree.controls().add(new SeparatorItem());
    tree.controls().add(new DeleteItem());
    tree.controls().add(new SeparatorItem());

    LayerPropertyItem property = new LayerPropertyItem();
    List<PropertyPane> lstproperty = new ArrayList<PropertyPane>();
    lstproperty.add(new LayerGeneralPanel());
    lstproperty.add(new JLayerCRSPane());
    lstproperty.add(new JLayerDataStructurePanel());

    LayerFilterPropertyPanel filters = new LayerFilterPropertyPanel();
    filters.addPropertyPanel(MessageBundle.format("filter"), new JCQLPropertyPanel());
    lstproperty.add(filters);

    LayerStylePropertyPanel styles = new LayerStylePropertyPanel();
    styles.addPropertyPanel(MessageBundle.format("analyze"), new JSimpleStylePanel());
    styles.addPropertyPanel(
        MessageBundle.format("analyze_vector"), new JClassificationSingleStylePanel());
    styles.addPropertyPanel(
        MessageBundle.format("analyze_vector"), new JClassificationIntervalStylePanel());
    styles.addPropertyPanel(MessageBundle.format("analyze_raster"), new JColorMapPane());
    styles.addPropertyPanel(MessageBundle.format("analyze_raster"), new JCellSymbolizerPane());
    styles.addPropertyPanel(MessageBundle.format("analyze_raster"), new JIsolineSymbolizerPane());
    styles.addPropertyPanel(MessageBundle.format("sld"), new JAdvancedStylePanel());
    styles.addPropertyPanel(MessageBundle.format("sld"), new JSLDImportExportPanel());
    lstproperty.add(styles);

    property.setPropertyPanels(lstproperty);

    tree.controls().add(property);
    tree.controls().add(new ContextPropertyItem());

    tree.revalidate();
  }
 public SessionCommitAction(final FeatureMapLayer layer) {
   putValue(SMALL_ICON, ICON_SAVE);
   putValue(NAME, MessageBundle.format("sessionCommit"));
   putValue(SHORT_DESCRIPTION, MessageBundle.format("sessionCommit"));
   setLayer(layer);
 }
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jPanel2 = new javax.swing.JPanel();
    guiLblCount = new javax.swing.JLabel();
    guiLblMinimum = new javax.swing.JLabel();
    guiLblMaximum = new javax.swing.JLabel();
    guiLblSum = new javax.swing.JLabel();
    guiCount = new javax.swing.JLabel();
    guiMinimum = new javax.swing.JLabel();
    guiMaximum = new javax.swing.JLabel();
    guiSum = new javax.swing.JLabel();
    jSeparator2 = new javax.swing.JSeparator();
    guiLblMean = new javax.swing.JLabel();
    guiLblMedian = new javax.swing.JLabel();
    guiMean = new javax.swing.JLabel();
    guiMedian = new javax.swing.JLabel();
    jSeparator3 = new javax.swing.JSeparator();
    guiLblMethod = new javax.swing.JLabel();
    guiLblClasses = new javax.swing.JLabel();
    guiMethod = new javax.swing.JComboBox();
    guiClasses = new javax.swing.JSpinner();
    jSplitPane1 = new javax.swing.JSplitPane();
    jPanel1 = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    guiLblDivision = new javax.swing.JLabel();
    guiDivision = new javax.swing.JSpinner();
    guiChart = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    guiTable = new org.jdesktop.swingx.JXTable();

    jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    guiLblCount.setText(MessageBundle.getString("count")); // NOI18N

    guiLblMinimum.setText(MessageBundle.getString("minimum")); // NOI18N

    guiLblMaximum.setText(MessageBundle.getString("maximum")); // NOI18N

    guiLblSum.setText(MessageBundle.getString("sum")); // NOI18N

    guiCount.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    guiCount.setText("0");
    guiCount.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);

    guiMinimum.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    guiMinimum.setText("0");
    guiMinimum.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);

    guiMaximum.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    guiMaximum.setText("0");
    guiMaximum.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);

    guiSum.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    guiSum.setText("0");
    guiSum.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);

    jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);

    guiLblMean.setText(MessageBundle.getString("mean")); // NOI18N

    guiLblMedian.setText(MessageBundle.getString("median")); // NOI18N

    guiMean.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    guiMean.setText("0");

    guiMedian.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    guiMedian.setText("0");

    jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);

    guiLblMethod.setText(MessageBundle.getString("method")); // NOI18N

    guiLblClasses.setText(MessageBundle.getString("classes")); // NOI18N

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

    guiClasses.setModel(
        new javax.swing.SpinnerNumberModel(
            Integer.valueOf(5), Integer.valueOf(1), null, Integer.valueOf(1)));
    guiClasses.addChangeListener(
        new javax.swing.event.ChangeListener() {
          public void stateChanged(javax.swing.event.ChangeEvent evt) {
            guiClassesStateChanged(evt);
          }
        });

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel2Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(guiLblMethod)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        guiMethod,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        130,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(guiLblClasses)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        guiClasses,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        129,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        jSeparator3,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        6,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        jPanel2Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(guiLblCount)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(guiCount))
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(guiLblMean)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(guiMean))
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(guiLblMedian)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(guiMedian)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jSeparator2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        6,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        jPanel2Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(guiLblMinimum)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(guiMinimum))
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(guiLblMaximum)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(guiMaximum))
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(guiLblSum)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(guiSum)))
                    .addContainerGap(103, Short.MAX_VALUE)));

    jPanel2Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {guiClasses, guiMethod});

    jPanel2Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {guiLblClasses, guiLblMethod});

    jPanel2Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {guiLblCount, guiLblMean, guiLblMedian});

    jPanel2Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {guiLblMaximum, guiLblMinimum, guiLblSum});

    jPanel2Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {guiMaximum, guiMinimum, guiSum});

    jPanel2Layout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {guiCount, guiMean, guiMedian});

    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addGroup(
                        jPanel2Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                        jPanel2Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(guiLblMethod)
                                            .addComponent(
                                                guiMethod,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        jPanel2Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(guiLblClasses)
                                            .addComponent(
                                                guiClasses,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                        jPanel2Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(guiLblCount)
                                            .addComponent(guiCount))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        jPanel2Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(guiLblMean)
                                            .addComponent(guiMean))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        jPanel2Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(guiLblMedian)
                                            .addComponent(guiMedian)))
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                        jPanel2Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(guiLblMinimum)
                                            .addComponent(guiMinimum))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        jPanel2Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(guiLblMaximum)
                                            .addComponent(guiMaximum))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        jPanel2Layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(guiLblSum)
                                            .addComponent(guiSum))))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
            .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE));

    jSplitPane1.setBorder(null);
    jSplitPane1.setDividerLocation(225);
    jSplitPane1.setDividerSize(3);

    jPanel1.setLayout(new java.awt.BorderLayout());

    guiLblDivision.setText(MessageBundle.getString("division")); // NOI18N

    guiDivision.setModel(new javax.swing.SpinnerNumberModel(50, 1, 100, 1));
    guiDivision.addChangeListener(
        new javax.swing.event.ChangeListener() {
          public void stateChanged(javax.swing.event.ChangeEvent evt) {
            guiDivisionStateChanged(evt);
          }
        });

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(guiLblDivision)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        guiDivision,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        84,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(138, Short.MAX_VALUE)));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(guiLblDivision)
                    .addComponent(
                        guiDivision,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    jPanel1.add(jPanel3, java.awt.BorderLayout.NORTH);

    guiChart.setLayout(new java.awt.BorderLayout());
    jPanel1.add(guiChart, java.awt.BorderLayout.CENTER);

    jSplitPane1.setRightComponent(jPanel1);

    guiTable.setBorder(null);
    guiTable.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] {}));

    jScrollPane1.setViewportView(guiTable);

    jSplitPane1.setLeftComponent(jScrollPane1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                jPanel2,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(
                        jPanel2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)));
  } // </editor-fold>//GEN-END:initComponents