Search in sources :

Example 51 with EtchedBorder

use of javax.swing.border.EtchedBorder in project mc-dev by Bukkit.

the class ServerGUI method a.

private JComponent a() {
    JPanel jpanel = new JPanel(new BorderLayout());
    jpanel.add(new GuiStatsComponent(this.c), "North");
    jpanel.add(this.b(), "Center");
    jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Stats"));
    return jpanel;
}
Also used : JPanel(javax.swing.JPanel) EtchedBorder(javax.swing.border.EtchedBorder) BorderLayout(java.awt.BorderLayout) TitledBorder(javax.swing.border.TitledBorder)

Example 52 with EtchedBorder

use of javax.swing.border.EtchedBorder in project mc-dev by Bukkit.

the class ServerGUI method b.

private JComponent b() {
    PlayerListBox playerlistbox = new PlayerListBox(this.c);
    JScrollPane jscrollpane = new JScrollPane(playerlistbox, 22, 30);
    jscrollpane.setBorder(new TitledBorder(new EtchedBorder(), "Players"));
    return jscrollpane;
}
Also used : JScrollPane(javax.swing.JScrollPane) EtchedBorder(javax.swing.border.EtchedBorder) TitledBorder(javax.swing.border.TitledBorder)

Example 53 with EtchedBorder

use of javax.swing.border.EtchedBorder in project aerospike-client-java by aerospike.

the class GuiDisplay method initialize.

/**
 * Initialize the contents of the frame.
 */
private void initialize() {
    frmAerospikeExamples = new JFrame();
    frmAerospikeExamples.setTitle("Aerospike Java Client Examples");
    frmAerospikeExamples.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frmAerospikeExamples.pack();
    frmAerospikeExamples.getContentPane().setLayout(new BorderLayout(0, 0));
    splitPane = new JSplitPane();
    splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
    frmAerospikeExamples.getContentPane().add(splitPane, BorderLayout.CENTER);
    mainPanel = new JPanel();
    splitPane.setLeftComponent(mainPanel);
    mainPanel.setLayout(new BorderLayout(0, 0));
    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    runButton = new JButton("Run");
    runButton.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent ev) {
            consoleTextArea.setText("");
            run_selected_examples();
        }
    });
    buttonPanel.add(runButton);
    mainPanel.add(buttonPanel, BorderLayout.SOUTH);
    exitButton = new JButton("Quit");
    exitButton.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent arg0) {
            Container Frame = exitButton.getParent();
            do {
                Frame = Frame.getParent();
            } while (!(Frame instanceof JFrame));
            ((JFrame) Frame).dispose();
        }
    });
    buttonPanel.add(exitButton);
    sourceTextPane = new JTextArea();
    sourceTextPane.setTabSize(2);
    sourceTextPane.setEditable(false);
    scrollPane = new JScrollPane(sourceTextPane);
    scrollPane.setViewportBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    scrollPane.setPreferredSize(new Dimension(600, 100));
    mainPanel.add(scrollPane, BorderLayout.CENTER);
    connectionPanel = new JPanel();
    connectionPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    lblServerHost = new JLabel("Server Host");
    connectionPanel.add(lblServerHost);
    seedHostTextField = new JTextField();
    seedHostTextField.addKeyListener(new KeyAdapter() {

        @Override
        public void keyTyped(KeyEvent e) {
            params.host = seedHostTextField.getText();
        }
    });
    connectionPanel.add(seedHostTextField);
    seedHostTextField.setColumns(10);
    lblPort = new JLabel("Port");
    connectionPanel.add(lblPort);
    portTextField = new JTextField();
    portTextField.addFocusListener(new FocusAdapter() {

        @Override
        public void focusLost(FocusEvent arg0) {
            String newValue = namespaceTextField.getText();
            if (newValue != null && newValue != "") {
                try {
                    params.port = Integer.parseInt(newValue);
                } catch (NumberFormatException ne) {
                // ne.printStackTrace();
                }
            }
        }
    });
    connectionPanel.add(portTextField);
    portTextField.setColumns(4);
    lblusername = new JLabel("User");
    connectionPanel.add(lblusername);
    usernameTextField = new JTextField();
    usernameTextField.addKeyListener(new KeyAdapter() {

        @Override
        public void keyTyped(KeyEvent e) {
            params.user = usernameTextField.getText();
        }
    });
    connectionPanel.add(usernameTextField);
    usernameTextField.setColumns(8);
    lblpassword = new JLabel("Password");
    connectionPanel.add(lblpassword);
    passwordTextField = new JPasswordField();
    passwordTextField.addKeyListener(new KeyAdapter() {

        @Override
        public void keyTyped(KeyEvent e) {
            params.user = new String(passwordTextField.getPassword());
        }
    });
    connectionPanel.add(passwordTextField);
    passwordTextField.setColumns(8);
    lblnameSpace = new JLabel("Namespace");
    connectionPanel.add(lblnameSpace);
    namespaceTextField = new JTextField();
    namespaceTextField.addKeyListener(new KeyAdapter() {

        @Override
        public void keyTyped(KeyEvent e) {
            params.namespace = namespaceTextField.getText();
        }
    });
    connectionPanel.add(namespaceTextField);
    namespaceTextField.setColumns(8);
    lblSet = new JLabel("Set");
    connectionPanel.add(lblSet);
    txtSetTextfield = new JTextField();
    txtSetTextfield.addKeyListener(new KeyAdapter() {

        @Override
        public void keyTyped(KeyEvent e) {
            params.set = txtSetTextfield.getText();
        }
    });
    connectionPanel.add(txtSetTextfield);
    txtSetTextfield.setColumns(8);
    mainPanel.add(connectionPanel, BorderLayout.NORTH);
    examplePanel = new JPanel();
    examplePanel.setLayout(new BoxLayout(examplePanel, BoxLayout.Y_AXIS));
    exampleScrollPane = new JScrollPane(examplePanel);
    mainPanel.add(exampleScrollPane, BorderLayout.WEST);
    // init values
    seedHostTextField.setText(params.host);
    portTextField.setText(Integer.toString(params.port));
    namespaceTextField.setText(params.namespace);
    txtSetTextfield.setText(params.set);
    // int width = 785;
    int width = 1000;
    int height = 180;
    consoleTextArea = new JTextArea();
    consoleTextArea.setSize(new Dimension(width, height));
    consoleTextArea.setEditable(false);
    consoleScrollPane = new JScrollPane(consoleTextArea);
    consoleScrollPane.setPreferredSize(new Dimension(width, height));
    consoleScrollPane.setSize(new Dimension(width, height));
    splitPane.setRightComponent(consoleScrollPane);
    buttonGroup = new ButtonGroup();
    JRadioButton jrb;
    for (String example : Main.getAllExampleNames()) {
        jrb = new JRadioButton(example);
        jrb.setActionCommand(example);
        jrb.addActionListener(this);
        buttonGroup.add(jrb);
        examplePanel.add(jrb);
    }
    frmAerospikeExamples.pack();
}
Also used : JPanel(javax.swing.JPanel) FocusAdapter(java.awt.event.FocusAdapter) FlowLayout(java.awt.FlowLayout) JTextArea(javax.swing.JTextArea) JRadioButton(javax.swing.JRadioButton) KeyAdapter(java.awt.event.KeyAdapter) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) JTextField(javax.swing.JTextField) FocusEvent(java.awt.event.FocusEvent) KeyEvent(java.awt.event.KeyEvent) Container(java.awt.Container) BorderLayout(java.awt.BorderLayout) JFrame(javax.swing.JFrame) JScrollPane(javax.swing.JScrollPane) MouseEvent(java.awt.event.MouseEvent) MouseAdapter(java.awt.event.MouseAdapter) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) EtchedBorder(javax.swing.border.EtchedBorder) JPasswordField(javax.swing.JPasswordField) ButtonGroup(javax.swing.ButtonGroup) JSplitPane(javax.swing.JSplitPane)

Example 54 with EtchedBorder

use of javax.swing.border.EtchedBorder in project vcell by virtualcell.

the class BatchRunDetailsPanel method getBottomPanel.

// end of method setupToolBar()
// set up bottom component function
public JPanel getBottomPanel() {
    if (botPanel == null) {
        botPanel = new JPanel();
        botPanel.setLayout(new BorderLayout());
        botPanel.add(getParameterScrollPanel(), BorderLayout.CENTER);
        TitledBorder tb = new TitledBorder(new EtchedBorder(), "Parameters:", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Tahoma", Font.PLAIN, 11));
        botPanel.setBorder(tb);
    }
    return botPanel;
}
Also used : JPanel(javax.swing.JPanel) EtchedBorder(javax.swing.border.EtchedBorder) BorderLayout(java.awt.BorderLayout) TitledBorder(javax.swing.border.TitledBorder) Font(java.awt.Font)

Example 55 with EtchedBorder

use of javax.swing.border.EtchedBorder in project vcell by virtualcell.

the class FRAPDiffOneParamPanel method showParameterEvaluation.

public void showParameterEvaluation() {
    AsynchClientTask evaluateTask = new AsynchClientTask("Prepare to evaluate parameters ...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

        public void run(Hashtable<String, Object> hashTable) throws Exception {
            String errorStr = checkParameters();
            if (!errorStr.equals("")) {
                throw new IllegalArgumentException(errorStr);
            }
        }
    };
    AsynchClientTask showResultTask = new AsynchClientTask("Showing profile likelihood and confidence intervals ...", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        public void run(Hashtable<String, Object> hashTable) throws Exception {
            ProfileData[] profileData = frapOptData.getExpFrapStudy().getProfileData_oneDiffComponent();
            if (profileData != null && profileData.length > 0) {
                // put plotpanes of different parameters' profile likelihoods into a base panel
                JPanel basePanel = new JPanel();
                basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
                for (int i = 0; i < profileData.length; i++) {
                    ConfidenceIntervalPlotPanel plotPanel = new ConfidenceIntervalPlotPanel();
                    plotPanel.setProfileSummaryData(FRAPOptimizationUtils.getSummaryFromProfileData(profileData[i]));
                    plotPanel.setBorder(new EtchedBorder());
                    String paramName = "";
                    if (profileData[i].getProfileDataElements().size() > 0) {
                        paramName = profileData[i].getProfileDataElements().get(0).getParamName();
                    }
                    ProfileDataPanel profileDataPanel = new ProfileDataPanel(plotPanel, paramName);
                    basePanel.add(profileDataPanel);
                }
                JScrollPane scrollPane = new JScrollPane(basePanel);
                scrollPane.setAutoscrolls(true);
                scrollPane.setPreferredSize(new Dimension(620, 600));
                scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
                scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
                // show plots in a dialog
                DialogUtils.showComponentCloseDialog(FRAPDiffOneParamPanel.this, scrollPane, "Profile Likelihood of Parameters");
            }
        }
    };
    // dispatch
    ClientTaskDispatcher.dispatch(FRAPDiffOneParamPanel.this, new Hashtable<String, Object>(), new AsynchClientTask[] { evaluateTask, showResultTask }, false, true, null, true);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) BoxLayout(javax.swing.BoxLayout) ProfileData(org.vcell.optimization.ProfileData) Dimension(java.awt.Dimension) EtchedBorder(javax.swing.border.EtchedBorder) ConfidenceIntervalPlotPanel(org.vcell.optimization.gui.ConfidenceIntervalPlotPanel) ProfileDataPanel(org.vcell.optimization.gui.ProfileDataPanel)

Aggregations

EtchedBorder (javax.swing.border.EtchedBorder)116 JPanel (javax.swing.JPanel)92 JButton (javax.swing.JButton)74 JLabel (javax.swing.JLabel)74 ActionEvent (java.awt.event.ActionEvent)73 BorderLayout (java.awt.BorderLayout)72 ActionListener (java.awt.event.ActionListener)70 EmptyBorder (javax.swing.border.EmptyBorder)63 CompoundBorder (javax.swing.border.CompoundBorder)62 AbstractAction (javax.swing.AbstractAction)58 WindowAdapter (java.awt.event.WindowAdapter)55 WindowEvent (java.awt.event.WindowEvent)55 Insets (java.awt.Insets)46 GridBagConstraints (java.awt.GridBagConstraints)43 GridBagLayout (java.awt.GridBagLayout)43 JTextField (javax.swing.JTextField)40 Dimension (java.awt.Dimension)24 TitledBorder (javax.swing.border.TitledBorder)22 FlowLayout (java.awt.FlowLayout)18 JScrollPane (javax.swing.JScrollPane)17