public static synchronized JContextTree getContextTree() {
    if (tree == null) {
      final JContextTree tree = new JContextTree();

      // search available popup menu items
      Lookup lk = Lookups.forPath("/Puzzle/ContextTree/Actions");
      for (TreePopupItem item : lk.lookupAll(TreePopupItem.class)) {
        tree.controls().add(item);
      }

      final List<PropertyPane> configPanes = new ArrayList<PropertyPane>();

      JPropertyTree propertyTree = new JPropertyTree();

      DefaultMutableTreeNode root = new DefaultMutableTreeNode();

      // search available property panels
      lk = Lookups.forPath("/Puzzle/ContextTree/PropertyPanels");
      for (PropertyPane p : lk.lookupAll(PropertyPane.class)) {
        root.add(new DefaultMutableTreeNode(p));
      }

      // search filter panels
      DefaultMutableTreeNode filterNodes =
          new DefaultMutableTreeNode(CoreResource.getString("filter"));
      lk = Lookups.forPath("/Puzzle/ContextTree/FilterPanels");
      for (PropertyPane p : lk.lookupAll(PropertyPane.class)) {
        filterNodes.add(new DefaultMutableTreeNode(p));
      }
      root.add(filterNodes);

      // search style panels
      DefaultMutableTreeNode styleNodes =
          new DefaultMutableTreeNode(CoreResource.getString("symbology"));
      lk = Lookups.forPath("/Puzzle/ContextTree/StylePanels");
      for (PropertyPane p : lk.lookupAll(PropertyPane.class)) {
        styleNodes.add(new DefaultMutableTreeNode(p));
      }
      root.add(styleNodes);

      if (!tree.controls().isEmpty()) {
        tree.controls().add(new SeparatorItem());
      }

      LayerPropertyItem property = new LayerPropertyItem(root);
      tree.controls().add(property);

      tree.revalidate();
      tree.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
      ContextTreeTopComponent.tree = tree;
    }
    return tree;
  }
  /**
   * 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() {

    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();

    jButton1.setText(CoreResource.getString("sld_100")); // NOI18N
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            exp100(evt);
          }
        });

    jButton2.setText(CoreResource.getString("sld_110")); // NOI18N
    jButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            exp110(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton1)
                            .addComponent(jButton2))
                    .addContainerGap(163, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jButton1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButton2)
                    .addContainerGap(148, Short.MAX_VALUE)));
  } // </editor-fold>//GEN-END:initComponents
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    projectNameLabel = new JLabel();
    projectNameTextField = new JTextField();
    projectLocationLabel = new JLabel();
    projectLocationTextField = new JTextField();
    browseButton = new JButton();
    createdFolderLabel = new JLabel();
    createdFolderTextField = new JTextField();
    jLabel1 = new JLabel();

    projectNameLabel.setFont(
        projectNameLabel.getFont().deriveFont(projectNameLabel.getFont().getStyle() | Font.BOLD));
    projectNameLabel.setLabelFor(projectNameTextField);

    Mnemonics.setLocalizedText(projectNameLabel, CoreResource.getString("projectName")); // NOI18N
    projectLocationLabel.setLabelFor(projectLocationTextField);

    Mnemonics.setLocalizedText(
        projectLocationLabel, CoreResource.getString("projectLocation")); // NOI18N
    Mnemonics.setLocalizedText(browseButton, CoreResource.getString("browse"));
    browseButton.setActionCommand("BROWSE");
    browseButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            browseButtonActionPerformed(evt);
          }
        });

    createdFolderLabel.setLabelFor(createdFolderTextField);

    Mnemonics.setLocalizedText(
        createdFolderLabel, CoreResource.getString("projectFolder")); // NOI18N
    createdFolderTextField.setEditable(false);

    jLabel1.setIcon(
        new ImageIcon(
            getClass().getResource("/org/puzzle/core/resources/boussole100.png"))); // NOI18N
    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(Alignment.LEADING)
                                            .addComponent(projectLocationLabel)
                                            .addComponent(
                                                projectNameTextField,
                                                GroupLayout.DEFAULT_SIZE,
                                                279,
                                                Short.MAX_VALUE)
                                            .addComponent(projectNameLabel)
                                            .addGroup(
                                                Alignment.TRAILING,
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        projectLocationTextField,
                                                        GroupLayout.DEFAULT_SIZE,
                                                        199,
                                                        Short.MAX_VALUE)
                                                    .addPreferredGap(ComponentPlacement.RELATED)
                                                    .addComponent(browseButton))))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(createdFolderLabel)
                                    .addGap(14, 14, 14)
                                    .addComponent(
                                        createdFolderTextField,
                                        GroupLayout.DEFAULT_SIZE,
                                        281,
                                        Short.MAX_VALUE)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(projectNameLabel)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(
                                        projectNameTextField,
                                        GroupLayout.PREFERRED_SIZE,
                                        GroupLayout.DEFAULT_SIZE,
                                        GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(projectLocationLabel)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(Alignment.BASELINE)
                                            .addComponent(browseButton)
                                            .addComponent(
                                                projectLocationTextField,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.PREFERRED_SIZE))))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(Alignment.BASELINE)
                            .addComponent(createdFolderLabel)
                            .addComponent(
                                createdFolderTextField,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(143, Short.MAX_VALUE)));
  } // </editor-fold>//GEN-END:initComponents
 @Override
 public String getTitle() {
   return CoreResource.getString("sld_export");
 }
Exemple #5
0
 @Override
 public String getDisplayName() {
   return CoreResource.getString("maps");
 }
 private ContextTreeTopComponent() {
   initComponents();
   setDisplayName(CoreResource.getString("contextTree"));
   setToolTipText(CoreResource.getString("contextTreeHint"));
   setIcon(ImageUtilities.loadImage("org/puzzle/core/project/map.png", true));
 }