Search in sources :

Example 1 with SelectableHierarchyTree

use of net.sourceforge.processdash.hier.ui.SelectableHierarchyTree in project processdash by dtuma.

the class EditExportMetricsFilePanel method buildMainPanelContents.

protected void buildMainPanelContents() {
    String chooseFilePrompt = getString("Choose_File");
    add(indentedComponent(2, new WrappingText(chooseFilePrompt)));
    add(verticalSpace(1));
    file = new FileChooser();
    file.getDocument().addDocumentListener((DocumentListener) EventHandler.create(DocumentListener.class, this, "updateInstruction"));
    add(indentedComponent(4, file));
    add(verticalSpace(2));
    String choosePathsPrompt = getString("Choose_Paths");
    add(indentedComponent(2, new WrappingText(choosePathsPrompt)));
    add(verticalSpace(1));
    ProcessDashboard dashboard = ExportManager.getInstance().getProcessDashboard();
    paths = new SelectableHierarchyTree(dashboard.getHierarchy(), instr.getPaths());
    paths.addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting())
                updateInstruction();
        }
    });
    JScrollPane scrollPane = new JScrollPane(paths);
    scrollPane.setPreferredSize(new Dimension(999, 300));
    add(indentedComponent(4, scrollPane));
    if (fromManagePanel == false) {
        add(verticalSpace(2));
        String makeAutomaticPrompt = getString("Make_Automatic");
        add(indentedComponent(2, new WrappingText(makeAutomaticPrompt)));
        makeAutomatic = new ButtonGroup();
        Box autoButtonBox = Box.createHorizontalBox();
        autoButtonBox.add(createAutomaticButton("Yes"));
        autoButtonBox.add(createAutomaticButton("No"));
        add(indentedComponent(4, autoButtonBox));
    }
    add(verticalSpace(4));
    error = new WrappingText("X");
    error.setMinimumSize(error.getPreferredSize());
    error.setText("");
    error.setForeground(Color.red);
    add(error);
}
Also used : JScrollPane(javax.swing.JScrollPane) ButtonGroup(javax.swing.ButtonGroup) JFileChooser(javax.swing.JFileChooser) ProcessDashboard(net.sourceforge.processdash.ProcessDashboard) ListSelectionEvent(javax.swing.event.ListSelectionEvent) SelectableHierarchyTree(net.sourceforge.processdash.hier.ui.SelectableHierarchyTree) Box(javax.swing.Box) Dimension(java.awt.Dimension) WrappingText(net.sourceforge.processdash.ui.lib.WrappingText) ListSelectionListener(javax.swing.event.ListSelectionListener)

Aggregations

Dimension (java.awt.Dimension)1 Box (javax.swing.Box)1 ButtonGroup (javax.swing.ButtonGroup)1 JFileChooser (javax.swing.JFileChooser)1 JScrollPane (javax.swing.JScrollPane)1 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ListSelectionListener (javax.swing.event.ListSelectionListener)1 ProcessDashboard (net.sourceforge.processdash.ProcessDashboard)1 SelectableHierarchyTree (net.sourceforge.processdash.hier.ui.SelectableHierarchyTree)1 WrappingText (net.sourceforge.processdash.ui.lib.WrappingText)1