Search in sources :

Example 1 with WrappingText

use of net.sourceforge.processdash.ui.lib.WrappingText in project processdash by dtuma.

the class EditImportDirectoryPanel method buildMainPanelContents.

protected void buildMainPanelContents() {
    DocumentListener listener = (DocumentListener) EventHandler.create(DocumentListener.class, this, "updateInstruction");
    if (instr.isUrlOnly()) {
        String chooseUrlPrompt = getString("Choose_URL");
        add(indentedComponent(2, new WrappingText(chooseUrlPrompt)));
        add(verticalSpace(1));
        url = new JTextField(instr.getURL());
        url.getDocument().addDocumentListener(listener);
        add(indentedComponent(4, url));
    } else {
        String chooseDirectoryPrompt = getString("Choose_Directory");
        add(indentedComponent(2, new WrappingText(chooseDirectoryPrompt)));
        add(verticalSpace(1));
        directory = new DirectoryChooser();
        directory.getDocument().addDocumentListener(listener);
        add(indentedComponent(4, directory));
    }
    add(verticalSpace(2));
    String choosePrefixPrompt = getString("Choose_Prefix");
    add(indentedComponent(2, new WrappingText(choosePrefixPrompt)));
    add(verticalSpace(1));
    prefix = new JTextField(instr.getPrefix());
    prefix.getDocument().addDocumentListener(listener);
    add(indentedComponent(4, prefix));
    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("");
    error.setForeground(Color.red);
    add(error);
}
Also used : DocumentListener(javax.swing.event.DocumentListener) ButtonGroup(javax.swing.ButtonGroup) Box(javax.swing.Box) WrappingText(net.sourceforge.processdash.ui.lib.WrappingText) JTextField(javax.swing.JTextField)

Example 2 with WrappingText

use of net.sourceforge.processdash.ui.lib.WrappingText in project processdash by dtuma.

the class ChoicePanel method buildMainPanelContents.

protected void buildMainPanelContents() {
    ButtonGroup buttonGroup = new ButtonGroup();
    for (int i = 0; i < choices.length; i++) {
        add(verticalSpace(2));
        String choice = choices[i];
        String title = getRelativeString("Choices." + choice + ".Title");
        String description = getOptionalRelativeString("Choices." + choice + ".Description");
        String helpTopic = getOptionalRelativeString("Choices." + choice + ".HelpTopicID_");
        JRadioButton radioButton = new JRadioButton(title);
        radioButton.setHorizontalAlignment(SwingConstants.LEFT);
        radioButton.setActionCommand(choice);
        radioButton.addActionListener(this);
        buttonGroup.add(radioButton);
        if (helpTopic != null)
            PCSH.enableHelpOnButton(radioButton, helpTopic);
        add(indentedComponent(2, radioButton));
        add(verticalSpace(1));
        if (description != null) {
            add(indentedComponent(6, new WrappingText(description)));
        }
    }
}
Also used : JRadioButton(javax.swing.JRadioButton) ButtonGroup(javax.swing.ButtonGroup) WrappingText(net.sourceforge.processdash.ui.lib.WrappingText)

Example 3 with WrappingText

use of net.sourceforge.processdash.ui.lib.WrappingText 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)

Example 4 with WrappingText

use of net.sourceforge.processdash.ui.lib.WrappingText in project processdash by dtuma.

the class WizardPanel method buildUserInterface.

protected void buildUserInterface() {
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    JLabel promptLabel = new JLabel(getRelativeString("Prompt"));
    promptLabel.setHorizontalAlignment(SwingConstants.LEFT);
    add(indentedComponent(0, promptLabel));
    add(verticalSpace(2));
    String header = getOptionalRelativeString("Header");
    if (header != null) {
        add(indentedComponent(2, new WrappingText(header)));
        add(verticalSpace(2));
    }
    buildMainPanelContents();
    add(verticalSpace(2));
    String footer = getOptionalRelativeString("Footer");
    if (footer != null) {
        add(indentedComponent(2, new WrappingText(footer)));
        add(verticalSpace(2));
    }
    add(createButtonBox());
}
Also used : BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) WrappingText(net.sourceforge.processdash.ui.lib.WrappingText)

Aggregations

WrappingText (net.sourceforge.processdash.ui.lib.WrappingText)4 ButtonGroup (javax.swing.ButtonGroup)3 Box (javax.swing.Box)2 Dimension (java.awt.Dimension)1 BoxLayout (javax.swing.BoxLayout)1 JFileChooser (javax.swing.JFileChooser)1 JLabel (javax.swing.JLabel)1 JRadioButton (javax.swing.JRadioButton)1 JScrollPane (javax.swing.JScrollPane)1 JTextField (javax.swing.JTextField)1 DocumentListener (javax.swing.event.DocumentListener)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