Search in sources :

Example 21 with CompoundBorder

use of javax.swing.border.CompoundBorder in project android by JetBrains.

the class RecommendedPluginVersionUpdateDialog method createSouthPanel.

@Override
@NotNull
protected JComponent createSouthPanel() {
    Action[] actions = createActions();
    List<JButton> buttons = Lists.newArrayList();
    JPanel panel = new JPanel(new BorderLayout());
    if (actions.length > 0) {
        JPanel buttonsPanel = createButtons(actions, buttons);
        panel.add(buttonsPanel, BorderLayout.CENTER);
        myButtons = buttons.toArray(new JButton[buttons.size()]);
    }
    if (getStyle() == DialogStyle.COMPACT) {
        Border line = new CustomLineBorder(OnePixelDivider.BACKGROUND, 1, 0, 0, 0);
        panel.setBorder(new CompoundBorder(line, empty(8, 12)));
    } else {
        panel.setBorder(emptyTop(8));
    }
    return panel;
}
Also used : CustomLineBorder(com.intellij.ui.border.CustomLineBorder) CompoundBorder(javax.swing.border.CompoundBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) CustomLineBorder(com.intellij.ui.border.CustomLineBorder) NotNull(org.jetbrains.annotations.NotNull)

Example 22 with CompoundBorder

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

the class ComsolConfigurationPanel method initialize.

private void initialize() {
    setLayout(new BorderLayout());
    Border margin = new EmptyBorder(5, 3, 1, 1);
    Border loweredEtchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    TitledBorder panelBorder = BorderFactory.createTitledBorder(loweredEtchedBorder, " Comsol Properties ");
    panelBorder.setTitleJustification(TitledBorder.LEFT);
    panelBorder.setTitlePosition(TitledBorder.TOP);
    panelBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
    JPanel jpanel = new JPanel();
    jpanel.setBorder(new CompoundBorder(margin, panelBorder));
    add(jpanel, BorderLayout.CENTER);
    jpanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.weighty = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridheight = 1;
    // =============================================================================
    // 
    // comsol root dir
    // 
    // =============================================================================
    int gridy = 0;
    JLabel comsolRootLabel = new JLabel("<html>Comsol Multiphysics directory (requires a local COMSOL Multiphysics installation, see <a href='http://comsol.com'>Comsol.com</a>)</html>");
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.gridwidth = 2;
    gbc.weightx = 0.5;
    // top, left bottom, right
    gbc.insets = new Insets(4, 4, 2, 4);
    jpanel.add(comsolRootLabel, gbc);
    gridy++;
    comsolRootTextField = new JTextField();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.gridwidth = 1;
    gbc.weightx = 0.5;
    gbc.ipady = 1;
    gbc.insets = new Insets(4, 4, 2, 2);
    jpanel.add(comsolRootTextField, gbc);
    comsolRootTextField.addActionListener((ActionEvent e) -> {
        VCellConfiguration.setFileProperty(PropertyLoader.comsolRootDir, new File(comsolRootTextField.getText()));
    });
    JButton findComsolButton = new JButton("Browse...");
    findComsolButton.addActionListener((ActionEvent e) -> browseComsolDirectory());
    gbc.gridx = 1;
    gbc.gridy = gridy;
    gbc.gridwidth = 1;
    gbc.weightx = 0.0;
    gbc.ipady = 0;
    gbc.insets = new Insets(3, 2, 2, 4);
    jpanel.add(findComsolButton, gbc);
    // gridy += 4;
    // gbc.gridx=0;
    // gbc.gridy=5;
    // gbc.gridwidth=2;
    // jpanel.add(new JSeparator(), gbc);
    // =============================================================================
    // 
    // comsol plugins dir
    // 
    // =============================================================================
    gridy++;
    JLabel comsolJarLabel = new JLabel("Comsol plugins directory (vcell.comsol.jardir)");
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.gridwidth = 2;
    gbc.weightx = 0.5;
    gbc.insets = new Insets(8, 4, 2, 4);
    jpanel.add(comsolJarLabel, gbc);
    gridy++;
    comsolJarTextField = new JTextField();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.gridwidth = 2;
    gbc.weightx = 0.5;
    gbc.ipady = 1;
    gbc.insets = new Insets(4, 4, 2, 4);
    jpanel.add(comsolJarTextField, gbc);
    gridy++;
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.gridwidth = 3;
    gbc.weightx = 1;
    // fake cell used for filling all the vertical empty space
    gbc.weighty = 1;
    gbc.ipady = 0;
    gbc.anchor = GridBagConstraints.WEST;
    jpanel.add(new JLabel(""), gbc);
    comsolRootTextField.addActionListener((ActionEvent e) -> {
        VCellConfiguration.setFileProperty(PropertyLoader.comsolJarDir, new File(comsolJarTextField.getText()));
    });
    initComsolValues();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) TitledBorder(javax.swing.border.TitledBorder) JTextField(javax.swing.JTextField) BorderLayout(java.awt.BorderLayout) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) TitledBorder(javax.swing.border.TitledBorder) EtchedBorder(javax.swing.border.EtchedBorder) File(java.io.File)

Example 23 with CompoundBorder

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

the class PythonConfigurationPanel method initialize.

private void initialize() {
    setLayout(new BorderLayout());
    Border margin = new EmptyBorder(5, 3, 1, 1);
    Border loweredEtchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    TitledBorder panelBorder = BorderFactory.createTitledBorder(loweredEtchedBorder, " Python Properties ");
    panelBorder.setTitleJustification(TitledBorder.LEFT);
    panelBorder.setTitlePosition(TitledBorder.TOP);
    panelBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
    JPanel jpanel = new JPanel();
    jpanel.setBorder(new CompoundBorder(margin, panelBorder));
    add(jpanel, BorderLayout.CENTER);
    jpanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.weighty = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridheight = 1;
    // CondaSupport.installInBackground();  // or not in background ... ?????
    // =============================================================================
    // 
    // python (anaconda) executable
    // 
    // =============================================================================
    int gridy = 0;
    String managedMiniconda = new File(ResourceUtil.getVcellHome(), "Miniconda").getAbsolutePath();
    String vcellPythonText = "Python is required for parameter estimation and other analysis\n\n" + "VCell manages a dedicated Miniconda python installation \n" + "at " + managedMiniconda + ".  \n" + "For more information about Miniconda, \n" + "see https://www.continuum.io\n\n";
    JTextArea vcellPythonTextArea = new JTextArea(vcellPythonText);
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.gridwidth = 2;
    gbc.weightx = 0.5;
    gbc.weighty = 1;
    // top, left bottom, right
    gbc.insets = new Insets(4, 4, 2, 4);
    jpanel.add(vcellPythonTextArea, gbc);
    gridy++;
    String providedPythonText = "Alternate Anaconda/Miniconda installation directory.";
    JLabel providedPythonLabel = new JLabel(providedPythonText);
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.gridwidth = 2;
    gbc.weightx = 0.5;
    // top, left bottom, right
    gbc.insets = new Insets(4, 4, 1, 4);
    jpanel.add(providedPythonLabel, gbc);
    gridy++;
    pythonExeTextField = new JTextField();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.gridwidth = 1;
    gbc.weightx = 0.5;
    gbc.weighty = 0.0;
    gbc.ipady = 1;
    gbc.insets = new Insets(0, 4, 2, 2);
    jpanel.add(pythonExeTextField, gbc);
    pythonExeTextField.addActionListener((ActionEvent e) -> {
        VCellConfiguration.setFileProperty(PropertyLoader.pythonExe, new File(pythonExeTextField.getText()));
    });
    JButton findPythonButton = new JButton("Browse...");
    findPythonButton.addActionListener((ActionEvent e) -> browsePythonExe());
    gbc.gridx = 1;
    gbc.gridy = gridy;
    gbc.gridwidth = 1;
    gbc.weightx = 0.0;
    gbc.ipady = 0;
    gbc.insets = new Insets(3, 2, 2, 4);
    jpanel.add(findPythonButton, gbc);
    // gridy += 4;
    // gbc.gridx=0;
    // gbc.gridy=5;
    // gbc.gridwidth=2;
    // jpanel.add(new JSeparator(), gbc);
    pythonExeTextField.addActionListener((ActionEvent e) -> {
        VCellConfiguration.setFileProperty(PropertyLoader.pythonExe, new File(pythonExeTextField.getText()));
    });
    initPythonValues();
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) JTextArea(javax.swing.JTextArea) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) TitledBorder(javax.swing.border.TitledBorder) JTextField(javax.swing.JTextField) BorderLayout(java.awt.BorderLayout) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder) EtchedBorder(javax.swing.border.EtchedBorder) File(java.io.File)

Example 24 with CompoundBorder

use of javax.swing.border.CompoundBorder in project libgdx by libgdx.

the class SettingsDialog method uiStyle.

private void uiStyle() {
    content.setBackground(new Color(36, 36, 36));
    content.setForeground(new Color(255, 255, 255));
    bottomPanel.setBackground(new Color(36, 36, 36));
    bottomPanel.setForeground(new Color(255, 255, 255));
    buttonPanel.setBackground(new Color(36, 36, 36));
    buttonPanel.setForeground(new Color(255, 255, 255));
    linkText.setForeground(new Color(20, 150, 20));
    contentPane.setBackground(new Color(36, 36, 36));
    Border line = BorderFactory.createLineBorder(new Color(80, 80, 80));
    Border empty = new EmptyBorder(4, 4, 4, 4);
    CompoundBorder border = new CompoundBorder(line, empty);
    mavenTextField.setBorder(border);
    mavenTextField.setCaretColor(new Color(255, 255, 255));
    mavenTextField.setBackground(new Color(46, 46, 46));
    mavenTextField.setForeground(new Color(255, 255, 255));
}
Also used : Color(java.awt.Color) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 25 with CompoundBorder

use of javax.swing.border.CompoundBorder in project libgdx by libgdx.

the class FlameMain method initializeComponents.

private void initializeComponents() {
    splitPane = new JSplitPane();
    splitPane.setUI(new BasicSplitPaneUI() {

        public void paint(Graphics g, JComponent jc) {
        }
    });
    splitPane.setDividerSize(4);
    getContentPane().add(splitPane, BorderLayout.CENTER);
    {
        JSplitPane rightSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        rightSplit.setUI(new BasicSplitPaneUI() {

            public void paint(Graphics g, JComponent jc) {
            }
        });
        rightSplit.setDividerSize(4);
        splitPane.add(rightSplit, JSplitPane.RIGHT);
        {
            JPanel propertiesPanel = new JPanel(new GridBagLayout());
            rightSplit.add(propertiesPanel, JSplitPane.TOP);
            propertiesPanel.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(3, 0, 6, 6), BorderFactory.createTitledBorder("Editor Properties")));
            {
                JScrollPane scroll = new JScrollPane();
                propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
                scroll.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
                {
                    editorPropertiesPanel = new JPanel(new GridBagLayout());
                    scroll.setViewportView(editorPropertiesPanel);
                    scroll.getVerticalScrollBar().setUnitIncrement(70);
                }
            }
        }
        {
            JSplitPane rightSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
            rightSplitPane.setUI(new BasicSplitPaneUI() {

                public void paint(Graphics g, JComponent jc) {
                }
            });
            rightSplitPane.setDividerSize(4);
            rightSplitPane.setDividerLocation(100);
            rightSplit.add(rightSplitPane, JSplitPane.BOTTOM);
            JPanel propertiesPanel = new JPanel(new GridBagLayout());
            rightSplitPane.add(propertiesPanel, JSplitPane.TOP);
            propertiesPanel.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(3, 0, 6, 6), BorderFactory.createTitledBorder("Influencers")));
            {
                JScrollPane scroll = new JScrollPane();
                propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
                scroll.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
                {
                    JPanel influencersPanel = new JPanel(new GridBagLayout());
                    influencerBox = new JComboBox(new DefaultComboBoxModel());
                    JButton addInfluencerButton = new JButton("Add");
                    addInfluencerButton.addActionListener(new ActionListener() {

                        @Override
                        public void actionPerformed(ActionEvent e) {
                            InfluencerWrapper wrapper = (InfluencerWrapper) influencerBox.getSelectedItem();
                            ParticleController controller = getEmitter();
                            if (controller != null)
                                addInfluencer(wrapper.type, controller);
                        }
                    });
                    influencersPanel.add(influencerBox, new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    influencersPanel.add(addInfluencerButton, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
                    scroll.setViewportView(influencersPanel);
                    scroll.getVerticalScrollBar().setUnitIncrement(70);
                }
            }
            propertiesPanel = new JPanel(new GridBagLayout());
            rightSplitPane.add(propertiesPanel, JSplitPane.BOTTOM);
            propertiesPanel.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(3, 0, 6, 6), BorderFactory.createTitledBorder("Particle Controller Components")));
            {
                JScrollPane scroll = new JScrollPane();
                propertiesPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
                scroll.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
                {
                    controllerPropertiesPanel = new JPanel(new GridBagLayout());
                    scroll.setViewportView(controllerPropertiesPanel);
                    scroll.getVerticalScrollBar().setUnitIncrement(70);
                }
            }
        }
        rightSplit.setDividerLocation(250);
    }
    {
        JSplitPane leftSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
        leftSplit.setUI(new BasicSplitPaneUI() {

            public void paint(Graphics g, JComponent jc) {
            }
        });
        leftSplit.setDividerSize(4);
        splitPane.add(leftSplit, JSplitPane.LEFT);
        {
            JPanel spacer = new JPanel(new BorderLayout());
            leftSplit.add(spacer, JSplitPane.TOP);
            spacer.add(lwjglCanvas.getCanvas());
            spacer.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 4));
        }
        {
            JPanel emittersPanel = new JPanel(new BorderLayout());
            leftSplit.add(emittersPanel, JSplitPane.BOTTOM);
            emittersPanel.setBorder(new CompoundBorder(BorderFactory.createEmptyBorder(0, 6, 6, 0), BorderFactory.createTitledBorder("Particle Controllers")));
            {
                effectPanel = new EffectPanel(this);
                emittersPanel.add(effectPanel);
            }
        }
        leftSplit.setDividerLocation(625);
    }
    splitPane.setDividerLocation(500);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) ActionEvent(java.awt.event.ActionEvent) JComponent(javax.swing.JComponent) JButton(javax.swing.JButton) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) Graphics(java.awt.Graphics) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) ParticleController(com.badlogic.gdx.graphics.g3d.particles.ParticleController) CompoundBorder(javax.swing.border.CompoundBorder) BasicSplitPaneUI(javax.swing.plaf.basic.BasicSplitPaneUI) JSplitPane(javax.swing.JSplitPane)

Aggregations

CompoundBorder (javax.swing.border.CompoundBorder)43 EmptyBorder (javax.swing.border.EmptyBorder)23 Border (javax.swing.border.Border)20 BorderLayout (java.awt.BorderLayout)14 JLabel (javax.swing.JLabel)13 JPanel (javax.swing.JPanel)13 Insets (java.awt.Insets)10 LineBorder (javax.swing.border.LineBorder)9 GridBagConstraints (java.awt.GridBagConstraints)8 GridBagLayout (java.awt.GridBagLayout)8 JButton (javax.swing.JButton)8 TitledBorder (javax.swing.border.TitledBorder)8 ActionEvent (java.awt.event.ActionEvent)7 EtchedBorder (javax.swing.border.EtchedBorder)7 CustomLineBorder (com.intellij.ui.border.CustomLineBorder)5 ActionListener (java.awt.event.ActionListener)5 File (java.io.File)5 JTextField (javax.swing.JTextField)5 NotNull (org.jetbrains.annotations.NotNull)5 Color (java.awt.Color)4