public void restoreCustomProperties(Configuration pConfig) { centerPanel.setMenuVisible(pConfig.getBoolean(getPropertyPrefix() + ".menu.visible", true)); try { jAlwaysOnTopBox.setSelected(pConfig.getBoolean(getPropertyPrefix() + ".alwaysOnTop")); } catch (Exception e) { } setAlwaysOnTop(jAlwaysOnTopBox.isSelected()); }
/** Creates new form DSWorkbenchSelectionFrame */ DSWorkbenchSelectionFrame() { initComponents(); centerPanel = new GenericTestPanel(true); jSelectionPanel.add(centerPanel, BorderLayout.CENTER); centerPanel.setChildComponent(jSelectionTreePanel); buildMenu(); capabilityInfoPanel1.addActionListener(this); treeData = new LinkedList<Village>(); jSelectionTree.setCellRenderer(new NodeCellRenderer()); KeyStroke copy = KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK, false); KeyStroke bbCopy = KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK, false); KeyStroke paste = KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK, false); KeyStroke delete = KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0, false); KeyStroke cut = KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK, false); jSelectionTree.registerKeyboardAction( DSWorkbenchSelectionFrame.this, "Copy", copy, JComponent.WHEN_FOCUSED); jSelectionTree.registerKeyboardAction( DSWorkbenchSelectionFrame.this, "BBCopy", bbCopy, JComponent.WHEN_FOCUSED); jSelectionTree.registerKeyboardAction( DSWorkbenchSelectionFrame.this, "Delete", delete, JComponent.WHEN_FOCUSED); jSelectionTree.registerKeyboardAction( DSWorkbenchSelectionFrame.this, "Paste", paste, JComponent.WHEN_FOCUSED); jSelectionTree.registerKeyboardAction( DSWorkbenchSelectionFrame.this, "Cut", cut, JComponent.WHEN_FOCUSED); jSelectionTree .getActionMap() .put( "find", new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { // ignore find } }); jSelectionTree.getSelectionModel().addTreeSelectionListener(DSWorkbenchSelectionFrame.this); buildTree(); // <editor-fold defaultstate="collapsed" desc=" Init HelpSystem "> if (!Constants.DEBUG) { GlobalOptions.getHelpBroker() .enableHelpKey( getRootPane(), "pages.selection_tool", GlobalOptions.getHelpBroker().getHelpSet()); } // </editor-fold> }
private void buildMenu() { JXTaskPane editPane = new JXTaskPane(); editPane.setTitle("Bearbeiten"); JXButton filter3k = new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/3k.png"))); filter3k.setToolTipText("Wählt alle Dörfer mit weniger als 3000 Punkten"); filter3k.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { filterByPoints(3000); } }); editPane.getContentPane().add(filter3k); JXButton filter5k = new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/5k.png"))); filter5k.setToolTipText("Wählt alle Dörfer mit weniger als 5000 Punkten"); filter5k.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { filterByPoints(5000); } }); editPane.getContentPane().add(filter5k); JXButton filter7k = new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/7k.png"))); filter7k.setToolTipText("Wählt alle Dörfer mit weniger als 7000 Punkten"); filter7k.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { filterByPoints(7000); } }); editPane.getContentPane().add(filter7k); JXButton filter9k = new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/9k.png"))); filter9k.setToolTipText("Wählt alle Dörfer mit weniger als 9000 Punkten"); filter9k.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { filterByPoints(9000); } }); editPane.getContentPane().add(filter9k); jApplyCustomFilter.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { try { filterByPoints(UIHelper.parseIntFromField(jCustomPointsField, 1500)); } catch (NumberFormatException nfe) { jCustomPointsField.setText(null); } } }); editPane.getContentPane().add(jCustomPointsPanel); JXTaskPane transferPane = new JXTaskPane(); transferPane.setTitle("Übertragen"); JXButton toHtml = new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/att_HTML.png"))); toHtml.setToolTipText("Gewählte Dörfer als HTML Datei exportieren"); toHtml.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { exportAsHTML(); } }); transferPane.getContentPane().add(toHtml); JXTaskPane miscPane = new JXTaskPane(); miscPane.setTitle("Sonstiges"); JXButton structure = new JXButton(new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/branch.png"))); structure.setToolTipText("Wechsel zwischen Baumstruktur und Liste"); structure.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { switchViewType(); } }); miscPane.getContentPane().add(structure); JXButton region = new JXButton( new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/region_select.png"))); region.setToolTipText("Auswahl aller Dörfer innerhalb bestimmter Koordinaten"); region.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { showRegionSelection(); } }); miscPane.getContentPane().add(region); JXButton substract = new JXButton( new ImageIcon(DSWorkbenchTagFrame.class.getResource("/res/ui/branch_remove.png"))); substract.setToolTipText( "Abziehen aller Dörfer aus der Zwischenablage von der Liste der ausgewählten Dörfer"); substract.addMouseListener( new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { substractVillagesFromClipboard(); } }); miscPane.getContentPane().add(substract); centerPanel.setupTaskPane(editPane, transferPane, miscPane); }
public void storeCustomProperties(Configuration pConfig) { pConfig.setProperty(getPropertyPrefix() + ".menu.visible", centerPanel.isMenuVisible()); pConfig.setProperty(getPropertyPrefix() + ".alwaysOnTop", jAlwaysOnTopBox.isSelected()); }