Example usage for java.awt BorderLayout EAST

List of usage examples for java.awt BorderLayout EAST

Introduction

In this page you can find the example usage for java.awt BorderLayout EAST.

Prototype

String EAST

To view the source code for java.awt BorderLayout EAST.

Click Source Link

Document

The east layout constraint (right side of container).

Usage

From source file:com.intel.stl.ui.main.view.StaDetailsPanel.java

/**
 * Description://from w ww  . ja  va 2  s . com
 * 
 * @param sourceName
 */
protected void initComponent() {
    setLayout(new BorderLayout(0, 10));
    setOpaque(false);
    setBorder(BorderFactory.createTitledBorder((Border) null));

    JPanel titlePanel = new JPanel(new BorderLayout(5, 1));
    titlePanel.setOpaque(false);
    numberLabel = ComponentFactory.getH1Label(STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.PLAIN);
    numberLabel.setHorizontalAlignment(JLabel.RIGHT);
    titlePanel.add(numberLabel, BorderLayout.CENTER);
    nameLabel = ComponentFactory.getH3Label("", Font.PLAIN);
    nameLabel.setHorizontalAlignment(JLabel.LEFT);
    nameLabel.setVerticalAlignment(JLabel.BOTTOM);
    titlePanel.add(nameLabel, BorderLayout.EAST);
    add(titlePanel, BorderLayout.NORTH);

    JPanel mainPanel = new JPanel();
    mainPanel.setOpaque(false);
    mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2));
    GridBagLayout gridBag = new GridBagLayout();
    mainPanel.setLayout(gridBag);
    GridBagConstraints gc = new GridBagConstraints();

    gc.insets = new Insets(2, 2, 2, 2);
    gc.fill = GridBagConstraints.HORIZONTAL;
    gc.weightx = 1;
    gc.gridwidth = 1;
    gc.weighty = 0;
    failedChartPanel = new ChartPanel(null);
    failedChartPanel.setPreferredSize(new Dimension(60, 20));
    mainPanel.add(failedChartPanel, gc);

    gc.fill = GridBagConstraints.BOTH;
    gc.weightx = 0;
    failedNumberLabel = ComponentFactory.getH2Label(STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.BOLD);
    failedNumberLabel.setForeground(UIConstants.INTEL_DARK_RED);
    failedNumberLabel.setHorizontalAlignment(JLabel.CENTER);
    mainPanel.add(failedNumberLabel, gc);

    gc.gridwidth = GridBagConstraints.REMAINDER;
    failedNameLabel = ComponentFactory.getH5Label(STLConstants.K0020_FAILED.getValue(), Font.PLAIN);
    failedNameLabel.setVerticalAlignment(JLabel.BOTTOM);
    mainPanel.add(failedNameLabel, gc);

    gc.fill = GridBagConstraints.HORIZONTAL;
    gc.weightx = 1;
    gc.gridwidth = 1;
    skippedChartPanel = new ChartPanel(null);
    skippedChartPanel.setPreferredSize(new Dimension(60, 20));
    mainPanel.add(skippedChartPanel, gc);

    gc.fill = GridBagConstraints.BOTH;
    gc.weightx = 0;
    skippedNumberLabel = ComponentFactory.getH2Label(STLConstants.K0039_NOT_AVAILABLE.getValue(), Font.BOLD);
    skippedNumberLabel.setForeground(UIConstants.INTEL_DARK_ORANGE);
    skippedNumberLabel.setHorizontalAlignment(JLabel.CENTER);
    mainPanel.add(skippedNumberLabel, gc);

    gc.gridwidth = GridBagConstraints.REMAINDER;
    skippedNameLabel = ComponentFactory.getH5Label(STLConstants.K0021_SKIPPED.getValue(), Font.PLAIN);
    skippedNameLabel.setVerticalAlignment(JLabel.BOTTOM);
    mainPanel.add(skippedNameLabel, gc);

    gc.weighty = 0;
    gc.fill = GridBagConstraints.NONE;
    gc.insets = new Insets(8, 2, 2, 2);
    gc.weightx = 1;
    gc.gridwidth = 1;
    gc.gridheight = types.length;
    typeChartPanel = new ChartPanel(null);
    typeChartPanel.setPreferredSize(new Dimension(80, 60));
    mainPanel.add(typeChartPanel, gc);

    typeNumberLabels = new JLabel[types.length];
    typeNameLabels = new JLabel[types.length];
    gc.fill = GridBagConstraints.BOTH;
    gc.gridheight = 1;
    gc.insets = new Insets(12, 2, 2, 2);
    for (int i = 0; i < types.length; i++) {
        if (i == 1) {
            gc.insets = new Insets(2, 2, 2, 2);
        }

        gc.weightx = 0;
        gc.gridwidth = 1;
        typeNumberLabels[i] = createNumberLabel();
        mainPanel.add(typeNumberLabels[i], gc);

        gc.gridwidth = GridBagConstraints.REMAINDER;
        typeNameLabels[i] = createNameLabel(types[i].getName());
        mainPanel.add(typeNameLabels[i], gc);
    }

    gc.fill = GridBagConstraints.BOTH;
    mainPanel.add(Box.createGlue(), gc);

    add(mainPanel, BorderLayout.CENTER);
}

From source file:com.emental.mindraider.ui.panels.ConceptAttachmentsJPanel.java

public void init() {
    JPanel pp;/*from   ww w . j a  va2 s  . c  o m*/
    setBorder(new TitledBorder(Messages.getString("ConceptJPanel.attachments")));
    setLayout(new BorderLayout());

    // button
    pp = new JPanel();
    pp.setLayout(new GridLayout(3, 1));
    JButton jbutton = new JButton("", IconsRegistry.getImageIcon("attach.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.attachLocalResourceToConcept"));
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            // some concept must be selected - select graph node according
            // to the selected concept =-> touchgraph
            // method needed
            if (conceptJPanel.getConceptResource() == null) {
                JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                        Messages.getString("ConceptJPanel.attachResourceWarning"),
                        Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
                return;
            }
            new AttachmentJDialog(conceptJPanel.getConceptResource());
        }
    });
    pp.add(jbutton);
    // @todo edit resource description
    // jbutton=new JButton("",IconsRegistry.getImageIcon("attachLink.png"));
    // jbutton.setToolTipText("Attach web resource to concept");
    // jbutton.addActionListener(new ActionListener() {
    // public void actionPerformed(ActionEvent e) {
    // }
    // });
    // pp.add(jbutton);
    // attach another concept/folder/resource... - perhaps extra frame with
    // radio
    jbutton = new JButton("", IconsRegistry.getImageIcon("launch.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.showAttachment"));
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (attachmentsTableModel.attachments != null) {
                if (attachments.getSelectedRow() == -1) {
                    JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                            Messages.getString("ConceptJPanel.selectAttachmentToLaunch"),
                            Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
                    return;
                }
                String uri = attachmentsTableModel.attachments[attachments.getSelectedRow()].getUrl();
                if (uri != null) {
                    Node node = new Node();
                    node.setLabel(uri);
                    node.setURL(uri);
                    node.setType(
                            MindRaider.spidersColorProfileRegistry.getCurrentProfile().getLiteralNodeType());
                    MindRaider.spidersGraph.handleDoubleSelect(node);
                }
            }
        }
    });
    pp.add(jbutton);
    jbutton = new JButton("", IconsRegistry.getImageIcon("explorerDiscardSmall.png"));
    jbutton.setToolTipText(Messages.getString("ConceptJPanel.removeAttachment"));
    pp.add(jbutton);
    jbutton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            if (attachmentsTableModel.attachments != null) {
                if (getAttachments().getSelectedRow() != -1) {
                    logger.debug(Messages.getString("ConceptJPanel.removingAttachment",
                            getAttachments().getSelectedRow()));
                    String attachUrl = getAttachmentsTableModel().attachments[getAttachments().getSelectedRow()]
                            .getUrl();
                    logger.debug(Messages.getString("ConceptJPanel.removingAttachmentUrl", attachUrl));
                    if (conceptJPanel.getConceptResource() != null) {
                        // check, that selected node is type of literal
                        // (helper on spiders graph)
                        MindRaider.noteCustodian.removeAttachment(
                                MindRaider.profile.getActiveOutlineUri().toString(),
                                conceptJPanel.getConceptResource(), attachUrl);
                        conceptJPanel.refresh();
                        MindRaider.spidersGraph.renderModel();
                        return;
                    }
                }
                JOptionPane.showMessageDialog(MindRaider.mainJFrame,
                        Messages.getString("ConceptJPanel.selectAttachmentToRemove"),
                        Messages.getString("ConceptJPanel.attachmentError"), JOptionPane.ERROR_MESSAGE);
            }
        }
    });
    add(pp, BorderLayout.EAST);

    // table
    attachmentsTableModel = new AttachmentsTableModel();
    attachments = new JTable(attachmentsTableModel) {

        private static final long serialVersionUID = 1L;

        public String getToolTipText(MouseEvent e) {
            String tip = null;
            java.awt.Point p = e.getPoint();
            int rowIndex = rowAtPoint(p);

            AttachmentsTableModel model = (AttachmentsTableModel) getModel();
            tip = Messages.getString("ConceptJPanel.attachmentUrl") + model.attachments[rowIndex].getUrl();
            // You can omit this part if you know you don't
            // have any renderers that supply their own tool
            // tips.
            // tip = super.getToolTipText(e);
            return tip;
        }
    };
    TableColumn column = attachments.getColumnModel().getColumn(0);
    column.setMaxWidth(50);
    attachments.setRowHeight(20);
    attachments.setAutoscrolls(true);
    attachments.setPreferredScrollableViewportSize(new Dimension(500, 70));
    JScrollPane scrollPane = new JScrollPane(attachments);
    add(scrollPane, BorderLayout.CENTER);
}

From source file:io.github.jeremgamer.editor.ManagerFrame.java

public ManagerFrame(String projectName, final JFrame parent) {
    dialog = this;

    ArrayList<BufferedImage> icons = new ArrayList<BufferedImage>();
    try {/* ww  w .  ja v  a2s.  c o m*/
        icons.add(ImageIO.read(ImageGetter.class.getResource("icon16.png")));
        icons.add(ImageIO.read(ImageGetter.class.getResource("icon32.png")));
        icons.add(ImageIO.read(ImageGetter.class.getResource("icon64.png")));
        icons.add(ImageIO.read(ImageGetter.class.getResource("icon128.png")));
    } catch (IOException e1) {
        e1.printStackTrace();
    }

    this.setIconImages((List<? extends Image>) icons);

    this.setTitle("Grer les projets");
    this.setSize(300, 200);
    this.setModal(true);
    this.setLocationRelativeTo(parent);
    this.setResizable(false);

    final JScrollPane scroll = new JScrollPane(content);
    scroll.getVerticalScrollBar().setUnitIncrement(Editor.SCROLL_SPEED);
    content.setBorder(BorderFactory.createTitledBorder(""));
    content.setLayout(new BoxLayout(content, BoxLayout.PAGE_AXIS));
    for (File project : new File("projects").listFiles()) {
        if (project.getName().equals(Editor.getProjectName())) {
            content.add(new ProjectPanel(project.getName(), true, parent, this));
        } else {
            content.add(new ProjectPanel(project.getName(), false, parent, this));
        }
    }
    try {
        final JButton add = new JButton("Crer un nouveau projet",
                new ImageIcon(ImageIO.read(ImageGetter.class.getResource("add.png"))));
        newProjectPanel.add(newProjectName);
        newProjectPanel.add(validate);

        this.setLayout(new BorderLayout());
        scroll.setBorder(null);
        this.add(scroll, BorderLayout.CENTER);
        this.add(add, BorderLayout.SOUTH);

        add.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                validate.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        dispose();
                        parent.dispose();
                        new Thread(new Runnable() {
                            public void run() {
                                window.getContentPane()
                                        .add(new JLabel("",
                                                new ImageIcon(ImageGetter.class.getResource("splash.gif")),
                                                SwingConstants.CENTER));
                                window.setBackground(new Color(0, 0, 0, 0));
                                window.setSize(300, 300);
                                window.setLocationRelativeTo(null);
                                window.setVisible(true);
                            }
                        }).start();

                        new Thread(new Runnable() {
                            public void run() {
                                new Editor(newProjectName.getText());
                                window.setVisible(false);
                            }
                        }).start();
                    }
                });
                CaretListener caretUpdate = new CaretListener() {
                    public void caretUpdate(javax.swing.event.CaretEvent e) {
                        JTextField text = (JTextField) e.getSource();
                        for (File dir : new File("projects").listFiles()) {
                            if (dir.isDirectory() && text.getText().equals(dir.getName())) {
                                validate.setEnabled(false);
                                validate.setText("Existe dj");
                                break;
                            } else {
                                validate.setEnabled(true);
                                validate.setText("Crer!");
                            }
                        }
                    }
                };
                JButton cancel = null;
                try {
                    cancel = new JButton(
                            new ImageIcon(ImageIO.read(ImageGetter.class.getResource("cancel.png"))));
                } catch (IOException e1) {
                    e1.printStackTrace();
                }
                newProjectName.addCaretListener(caretUpdate);
                remove(add);
                addPanel.setLayout(new BorderLayout());
                addPanel.add(newProjectPanel, BorderLayout.CENTER);
                addPanel.add(cancel, BorderLayout.EAST);
                add(addPanel, BorderLayout.SOUTH);
                revalidate();
                repaint();
                cancel.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent event) {
                        newProjectName.setText("");
                        remove(addPanel);
                        add(add, BorderLayout.SOUTH);
                        revalidate();
                        repaint();
                    }

                });
                newProjectName.requestFocusInWindow();
                newProjectName.requestFocus();
            }

        });
        this.setVisible(true);
    } catch (IOException e) {
        e.printStackTrace();
    }

}

From source file:Trabalho.HistogramaHSB.java

private void mostraTela() throws IOException {
    JFrame f = new JFrame("PDI - Histograma");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.add(criaHistograma(), BorderLayout.EAST);
    f.add(new JLabel(new ImageIcon(imagem)), BorderLayout.WEST);
    f.add(criaPainel(), BorderLayout.SOUTH);
    f.pack();/*from  w w w . ja  v a 2  s.com*/
    f.setLocationRelativeTo(f);
    f.setVisible(true);
}

From source file:org.eobjects.datacleaner.panels.OpenAnalysisJobPanel.java

public OpenAnalysisJobPanel(final FileObject file, final AnalyzerBeansConfiguration configuration,
        final OpenAnalysisJobActionListener openAnalysisJobActionListener) {
    super(WidgetUtils.BG_COLOR_LESS_BRIGHT, WidgetUtils.BG_COLOR_LESS_BRIGHT);
    _file = file;/*  w ww  .ja  v  a2s .c  om*/
    _openAnalysisJobActionListener = openAnalysisJobActionListener;

    setLayout(new BorderLayout());
    setBorder(WidgetUtils.BORDER_LIST_ITEM);

    final AnalysisJobMetadata metadata = getMetadata(configuration);
    final String jobName = metadata.getJobName();
    final String jobDescription = metadata.getJobDescription();
    final String datastoreName = metadata.getDatastoreName();

    final boolean isDemoJob = isDemoJob(metadata);

    final DCPanel labelListPanel = new DCPanel();
    labelListPanel.setLayout(new VerticalLayout(4));
    labelListPanel.setBorder(new EmptyBorder(4, 4, 4, 0));

    final String title;
    final String filename = file.getName().getBaseName();
    if (Strings.isNullOrEmpty(jobName)) {
        final String extension = FileFilters.ANALYSIS_XML.getExtension();
        if (filename.toLowerCase().endsWith(extension)) {
            title = filename.substring(0, filename.length() - extension.length());
        } else {
            title = filename;
        }
    } else {
        title = jobName;
    }

    final JButton titleButton = new JButton(title);
    titleButton.setFont(WidgetUtils.FONT_HEADER1);
    titleButton.setForeground(WidgetUtils.BG_COLOR_BLUE_MEDIUM);
    titleButton.setHorizontalAlignment(SwingConstants.LEFT);
    titleButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, WidgetUtils.BG_COLOR_MEDIUM));
    titleButton.setToolTipText("Open job");
    titleButton.setOpaque(false);
    titleButton.setMargin(new Insets(0, 0, 0, 0));
    titleButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    titleButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            if (isDemoDatastoreConfigured(datastoreName, configuration)) {
                _openAnalysisJobActionListener.openFile(_file);
            }
        }
    });

    final JButton executeButton = new JButton(executeIcon);
    executeButton.setOpaque(false);
    executeButton.setToolTipText("Execute job directly");
    executeButton.setMargin(new Insets(0, 0, 0, 0));
    executeButton.setBorderPainted(false);
    executeButton.setHorizontalAlignment(SwingConstants.RIGHT);
    executeButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            if (isDemoDatastoreConfigured(datastoreName, configuration)) {
                final ImageIcon executeIconLarge = ImageManager.get().getImageIcon(IconUtils.ACTION_EXECUTE);
                final String question = "Are you sure you want to execute the job\n'" + title + "'?";
                final int choice = JOptionPane.showConfirmDialog(null, question, "Execute job?",
                        JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, executeIconLarge);
                if (choice == JOptionPane.YES_OPTION) {
                    final Injector injector = _openAnalysisJobActionListener.openAnalysisJob(_file);
                    if (injector != null) {
                        final ResultWindow resultWindow = injector.getInstance(ResultWindow.class);
                        resultWindow.open();
                        resultWindow.startAnalysis();
                    }
                }
            }
        }
    });

    final DCPanel titlePanel = new DCPanel();
    titlePanel.setLayout(new BorderLayout());
    titlePanel.add(DCPanel.around(titleButton), BorderLayout.CENTER);
    titlePanel.add(executeButton, BorderLayout.EAST);

    labelListPanel.add(titlePanel);

    if (!Strings.isNullOrEmpty(jobDescription)) {
        String desc = StringUtils.replaceWhitespaces(jobDescription, " ");
        desc = StringUtils.replaceAll(desc, "  ", " ");
        final JLabel label = new JLabel(desc);
        label.setFont(WidgetUtils.FONT_SMALL);
        labelListPanel.add(label);
    }

    final Icon icon;
    {
        if (!StringUtils.isNullOrEmpty(datastoreName)) {
            final JLabel label = new JLabel(" " + datastoreName);
            label.setFont(WidgetUtils.FONT_SMALL);
            labelListPanel.add(label);

            final Datastore datastore = configuration.getDatastoreCatalog().getDatastore(datastoreName);
            if (isDemoJob) {
                icon = demoBadgeIcon;
            } else {
                icon = IconUtils.getDatastoreSpecificAnalysisJobIcon(datastore);
            }
        } else {
            icon = ImageManager.get().getImageIcon(IconUtils.MODEL_JOB, IconUtils.ICON_SIZE_LARGE);
        }
    }

    final JLabel iconLabel = new JLabel(icon);
    iconLabel.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight()));

    add(iconLabel, BorderLayout.WEST);
    add(labelListPanel, BorderLayout.CENTER);
}

From source file:au.org.ala.delta.intkey.ui.DefineButtonDialog.java

public DefineButtonDialog(Frame owner, boolean modal) {
    super(owner, modal);
    setPreferredSize(new Dimension(500, 430));

    ResourceMap resourceMap = Application.getInstance().getContext().getResourceMap(DefineButtonDialog.class);
    resourceMap.injectFields(this);
    ActionMap actionMap = Application.getInstance().getContext().getActionMap(DefineButtonDialog.class, this);

    setTitle(title);/*from  w  w  w. ja  va2  s.  c  om*/

    _okButtonPressed = false;

    _pnlButtons = new JPanel();
    getContentPane().add(_pnlButtons, BorderLayout.SOUTH);

    _btnOk = new JButton();
    _btnOk.setAction(actionMap.get("DefineButtonDialog_OK"));
    _pnlButtons.add(_btnOk);

    _btnCancel = new JButton();
    _btnCancel.setAction(actionMap.get("DefineButtonDialog_Cancel"));
    _pnlButtons.add(_btnCancel);

    _btnHelp = new JButton();
    _btnHelp.setAction(actionMap.get("DefineButtonDialog_Help"));
    _btnHelp.setEnabled(false);
    _pnlButtons.add(_btnHelp);

    _pnlMain = new JPanel();
    getContentPane().add(_pnlMain, BorderLayout.CENTER);
    _pnlMain.setLayout(new BorderLayout(5, 0));

    _pnlButtonProperties = new JPanel();
    _pnlButtonProperties.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(
            new EtchedBorder(EtchedBorder.LOWERED, null, null), new EmptyBorder(5, 5, 5, 5))));
    _pnlMain.add(_pnlButtonProperties, BorderLayout.NORTH);
    GridBagLayout gbl__pnlButtonProperties = new GridBagLayout();
    gbl__pnlButtonProperties.columnWidths = new int[] { 475, 0 };
    gbl__pnlButtonProperties.rowHeights = new int[] { 14, 23, 14, 20, 14, 20, 14, 0, 23, 23, 23, 23, 0 };
    gbl__pnlButtonProperties.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gbl__pnlButtonProperties.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, Double.MIN_VALUE };
    _pnlButtonProperties.setLayout(gbl__pnlButtonProperties);

    _lblEnterNameOf = new JLabel(enterFileNameCaption);
    _lblEnterNameOf.setHorizontalAlignment(SwingConstants.LEFT);
    GridBagConstraints gbc__lblEnterNameOf = new GridBagConstraints();
    gbc__lblEnterNameOf.anchor = GridBagConstraints.WEST;
    gbc__lblEnterNameOf.insets = new Insets(0, 0, 5, 0);
    gbc__lblEnterNameOf.gridx = 0;
    gbc__lblEnterNameOf.gridy = 0;
    _pnlButtonProperties.add(_lblEnterNameOf, gbc__lblEnterNameOf);

    _pnlFile = new JPanel();
    GridBagConstraints gbc__pnlFile = new GridBagConstraints();
    gbc__pnlFile.fill = GridBagConstraints.HORIZONTAL;
    gbc__pnlFile.insets = new Insets(0, 0, 5, 0);
    gbc__pnlFile.gridx = 0;
    gbc__pnlFile.gridy = 1;
    _pnlButtonProperties.add(_pnlFile, gbc__pnlFile);
    _pnlFile.setLayout(new BorderLayout(0, 0));

    _txtFldFileName = new JTextField();
    _pnlFile.add(_txtFldFileName, BorderLayout.CENTER);
    _txtFldFileName.setColumns(10);

    _btnBrowse = new JButton();
    _btnBrowse.setAction(actionMap.get("DefineButtonDialog_Browse"));
    _pnlFile.add(_btnBrowse, BorderLayout.EAST);

    _lblEnterTheCommands = new JLabel(enterCommandsCaption);
    _lblEnterTheCommands.setHorizontalAlignment(SwingConstants.LEFT);
    GridBagConstraints gbc__lblEnterTheCommands = new GridBagConstraints();
    gbc__lblEnterTheCommands.anchor = GridBagConstraints.WEST;
    gbc__lblEnterTheCommands.insets = new Insets(0, 0, 5, 0);
    gbc__lblEnterTheCommands.gridx = 0;
    gbc__lblEnterTheCommands.gridy = 2;
    _pnlButtonProperties.add(_lblEnterTheCommands, gbc__lblEnterTheCommands);

    _txtFldCommands = new JTextField();
    GridBagConstraints gbc__txtFldCommands = new GridBagConstraints();
    gbc__txtFldCommands.fill = GridBagConstraints.HORIZONTAL;
    gbc__txtFldCommands.insets = new Insets(0, 0, 5, 0);
    gbc__txtFldCommands.gridx = 0;
    gbc__txtFldCommands.gridy = 3;
    _pnlButtonProperties.add(_txtFldCommands, gbc__txtFldCommands);
    _txtFldCommands.setColumns(10);

    _lblEnterBriefHelp = new JLabel(enterBriefHelpCaption);
    _lblEnterBriefHelp.setAlignmentY(Component.TOP_ALIGNMENT);
    GridBagConstraints gbc__lblEnterBriefHelp = new GridBagConstraints();
    gbc__lblEnterBriefHelp.anchor = GridBagConstraints.NORTHWEST;
    gbc__lblEnterBriefHelp.insets = new Insets(0, 0, 5, 0);
    gbc__lblEnterBriefHelp.gridx = 0;
    gbc__lblEnterBriefHelp.gridy = 4;
    _pnlButtonProperties.add(_lblEnterBriefHelp, gbc__lblEnterBriefHelp);

    _txtFldBriefHelp = new JTextField();
    GridBagConstraints gbc__txtFldBriefHelp = new GridBagConstraints();
    gbc__txtFldBriefHelp.fill = GridBagConstraints.HORIZONTAL;
    gbc__txtFldBriefHelp.insets = new Insets(0, 0, 5, 0);
    gbc__txtFldBriefHelp.gridx = 0;
    gbc__txtFldBriefHelp.gridy = 5;
    _pnlButtonProperties.add(_txtFldBriefHelp, gbc__txtFldBriefHelp);
    _txtFldBriefHelp.setColumns(10);

    _lblEnterMoreDetailed = new JLabel(enterDetailedHelpCaption);
    GridBagConstraints gbc__lblEnterMoreDetailed = new GridBagConstraints();
    gbc__lblEnterMoreDetailed.anchor = GridBagConstraints.WEST;
    gbc__lblEnterMoreDetailed.insets = new Insets(0, 0, 5, 0);
    gbc__lblEnterMoreDetailed.gridx = 0;
    gbc__lblEnterMoreDetailed.gridy = 6;
    _pnlButtonProperties.add(_lblEnterMoreDetailed, gbc__lblEnterMoreDetailed);

    _txtFldDetailedHelp = new JTextField();
    GridBagConstraints gbc__txtFldDetailedHelp = new GridBagConstraints();
    gbc__txtFldDetailedHelp.insets = new Insets(0, 0, 5, 0);
    gbc__txtFldDetailedHelp.fill = GridBagConstraints.HORIZONTAL;
    gbc__txtFldDetailedHelp.gridx = 0;
    gbc__txtFldDetailedHelp.gridy = 7;
    _pnlButtonProperties.add(_txtFldDetailedHelp, gbc__txtFldDetailedHelp);
    _txtFldDetailedHelp.setColumns(10);

    _chckbxEnableOnlyIfUsedCharacters = new JCheckBox(enableOnlyIfUsedCaption);
    GridBagConstraints gbc__chckbxEnableOnlyIf = new GridBagConstraints();
    gbc__chckbxEnableOnlyIf.anchor = GridBagConstraints.WEST;
    gbc__chckbxEnableOnlyIf.insets = new Insets(0, 0, 5, 0);
    gbc__chckbxEnableOnlyIf.gridx = 0;
    gbc__chckbxEnableOnlyIf.gridy = 8;
    _pnlButtonProperties.add(_chckbxEnableOnlyIfUsedCharacters, gbc__chckbxEnableOnlyIf);

    _rdbtnEnableInAll = new JRadioButton(enableInAllModesCaption);
    GridBagConstraints gbc__rdbtnEnableInAll = new GridBagConstraints();
    gbc__rdbtnEnableInAll.anchor = GridBagConstraints.WEST;
    gbc__rdbtnEnableInAll.insets = new Insets(0, 0, 5, 0);
    gbc__rdbtnEnableInAll.gridx = 0;
    gbc__rdbtnEnableInAll.gridy = 9;
    _pnlButtonProperties.add(_rdbtnEnableInAll, gbc__rdbtnEnableInAll);

    _rdbtnEnableInNormal = new JRadioButton(enableInNormalModeCaption);
    GridBagConstraints gbc__rdbtnEnableInNormal = new GridBagConstraints();
    gbc__rdbtnEnableInNormal.anchor = GridBagConstraints.WEST;
    gbc__rdbtnEnableInNormal.insets = new Insets(0, 0, 5, 0);
    gbc__rdbtnEnableInNormal.gridx = 0;
    gbc__rdbtnEnableInNormal.gridy = 10;
    _pnlButtonProperties.add(_rdbtnEnableInNormal, gbc__rdbtnEnableInNormal);

    _rdbtnEnableInAdvanced = new JRadioButton(enableInAdvancedModeCaption);
    GridBagConstraints gbc__rdbtnEnableInAdvanced = new GridBagConstraints();
    gbc__rdbtnEnableInAdvanced.anchor = GridBagConstraints.WEST;
    gbc__rdbtnEnableInAdvanced.gridx = 0;
    gbc__rdbtnEnableInAdvanced.gridy = 11;
    _pnlButtonProperties.add(_rdbtnEnableInAdvanced, gbc__rdbtnEnableInAdvanced);

    _pnlSpaceRemoveAll = new JPanel();
    _pnlSpaceRemoveAll.setBorder(new EmptyBorder(0, 10, 0, 0));
    _pnlMain.add(_pnlSpaceRemoveAll, BorderLayout.SOUTH);
    _pnlSpaceRemoveAll.setLayout(new BoxLayout(_pnlSpaceRemoveAll, BoxLayout.Y_AXIS));

    _chckbxInsertASpace = new JCheckBox(insertSpaceCaption);
    _chckbxInsertASpace.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            _insertSpace = !_insertSpace;

            if (_insertSpace) {
                _removeAllButtons = false;
                _chckbxRemoveAllButtons.setSelected(false);
            }

            updateButtonPropertyControls();
        }
    });
    _pnlSpaceRemoveAll.add(_chckbxInsertASpace);

    _chckbxRemoveAllButtons = new JCheckBox(removeAllCaption);
    _chckbxRemoveAllButtons.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            _removeAllButtons = !_removeAllButtons;

            if (_removeAllButtons) {
                _insertSpace = false;
                _chckbxInsertASpace.setSelected(false);
            }

            updateButtonPropertyControls();
        }
    });
    _pnlSpaceRemoveAll.add(_chckbxRemoveAllButtons);

    _pnlButtonProperties.setEnabled(false);

    ButtonGroup btnGroup = new ButtonGroup();
    btnGroup.add(_rdbtnEnableInAll);
    btnGroup.add(_rdbtnEnableInNormal);
    btnGroup.add(_rdbtnEnableInAdvanced);

    _rdbtnEnableInAll.setSelected(true);
}

From source file:br.ufrgs.enq.jcosmo.ui.COSMOSACDialog.java

public COSMOSACDialog() {
    super("JCOSMO Simple");
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setLayout(new BorderLayout());

    db = COSMOSACDataBase.getInstance();

    COSMOSAC models[] = new COSMOSAC[5];
    models[0] = new COSMOSAC();
    models[1] = new COSMOPAC();
    models[2] = new COSMOSAC_SVP();
    models[3] = new COSMOSAC_G();
    models[4] = new PCMSAC();
    modelBox = new JComboBox(models);
    modelBox.addActionListener(this);

    JPanel north = new JPanel(new GridLayout(0, 2));
    add(north, BorderLayout.NORTH);
    JPanel northAba1 = new JPanel(new GridLayout(0, 4));
    JPanel northAba2 = new JPanel(new GridLayout(0, 2));

    //Where the GUI is created:
    JMenuBar menuBar;//from w ww  .  java2s. c  om
    JMenu file, help;
    JMenuItem menuItem;

    //Create the menu bar.
    menuBar = new JMenuBar();

    // the file menu
    file = new JMenu("File");
    file.setMnemonic(KeyEvent.VK_F);
    menuBar.add(file);
    menuItem = new JMenuItem("Quit", KeyEvent.VK_Q);
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.ALT_MASK));
    menuItem.setActionCommand(QUIT);
    menuItem.addActionListener(this);
    file.add(menuItem);

    // the help menu
    help = new JMenu("Help");
    file.setMnemonic(KeyEvent.VK_H);
    menuBar.add(help);
    menuItem = new JMenuItem("About", KeyEvent.VK_A);
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0));
    menuItem.setActionCommand(ABOUT);
    menuItem.addActionListener(this);
    help.add(menuItem);

    setJMenuBar(menuBar);

    listModel = new DefaultListModel();
    list = new JList(listModel);
    list.setBorder(BorderFactory.createTitledBorder("compounds"));
    list.setVisibleRowCount(2);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    JScrollPane listScrollPane = new JScrollPane(list);

    JButton addButton = new JButton("Add");
    addButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            new AddCompoundDialog(COSMOSACDialog.this);
        }
    });

    removeButton = new JButton("Remove");
    removeButton.addActionListener(this);
    visibRemove(false);

    JButton calcButton = new JButton("Calculate");
    calcButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            rebuildChart();
            rebuildSigmaProfiles();
        }
    });

    JButton refreshButton = new JButton("Refresh");
    refreshButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            rebuildSigmaProfiles();
        }
    });

    ignoreSGButton = new JCheckBox("Ignore SG");
    ignoreSGButton.setToolTipText("Toogles the ignore flag for the Staverman-Guggenheim term");
    ignoreSGButton.addActionListener(this);

    JPanel but = new JPanel(new GridLayout(0, 1));
    but.add(addButton, BorderLayout.EAST);
    but.add(removeButton, BorderLayout.EAST);
    but.add(modelBox);
    north.add(listScrollPane);
    north.add(but);

    northAba1.add(new JLabel("Temperature [K]"));
    northAba1.add(temperature = new JTextField(10));
    temperature.setText("298");

    northAba1.add(new JLabel("Sigma HB"));
    northAba1.add(sigmaHB = new JTextField(10));
    northAba1.add(new JLabel("Sigma HB2"));
    northAba1.add(sigmaHB2 = new JTextField(10));
    northAba1.add(new JLabel("Sigma HB3"));
    northAba1.add(sigmaHB3 = new JTextField(10));

    northAba1.add(new JLabel("Charge HB"));
    northAba1.add(chargeHB = new JTextField(10));

    northAba1.add(new JLabel("Sigma Disp"));
    northAba1.add(sigmaDisp = new JTextField(10));
    northAba1.add(new JLabel("Charge Disp"));
    northAba1.add(chargeDisp = new JTextField(10));

    northAba1.add(new JLabel("Beta"));
    northAba1.add(beta = new JTextField(10));
    northAba1.add(new JLabel("fpol"));
    northAba1.add(fpol = new JTextField(10));
    northAba1.add(new JLabel("Anorm"));
    northAba1.add(anorm = new JTextField(10));

    northAba1.add(ignoreSGButton);
    northAba1.add(calcButton);
    northAba2.add(new JLabel(""));
    northAba2.add(refreshButton);

    //      chart = new JLineChart();
    //      add(chart, BorderLayout.CENTER);
    //      chart.setTitle("Gamma Plot");
    //      chart.setSubtitle("");
    //      chart.setXAxisLabel("Mole Fraction, x_1");
    //      chart.setYAxisLabel("ln gamma, gE/RT");
    //      chart.setSource(getTitle());
    //      chart.setLegendPosition(LegendPosition.BOTTOM);
    //      chart.setShapesVisible(true);

    JFreeChart chart = ChartFactory.createXYLineChart(null, "Mole Fraction, x_1", "ln gamma, gE/RT", null,
            PlotOrientation.VERTICAL, true, true, false);
    plot = (XYPlot) chart.getPlot();
    plot.getDomainAxis().setAutoRange(false);
    plot.getDomainAxis().setRange(new Range(0.0, 1.0));

    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    XYLineAndShapeRenderer r = (XYLineAndShapeRenderer) plot.getRenderer();
    r.setUseFillPaint(true);
    r.setBaseFillPaint(Color.white);
    r.setBaseShapesVisible(true);

    JFreeChart sigmaProfileChart = ChartFactory.createXYLineChart(null, "sigma", "P^x", null,
            PlotOrientation.VERTICAL, true, true, false);
    sigmaProfilePlot = sigmaProfileChart.getXYPlot();
    sigmaProfilePlot.getDomainAxis().setAutoRange(false);
    sigmaProfilePlot.getDomainAxis().setRange(new Range(-0.025, 0.025));

    //      sigmaProfilePlot.setBackgroundPaint(Color.lightGray);
    //      sigmaProfilePlot.setDomainGridlinePaint(Color.white);
    //      sigmaProfilePlot.setRangeGridlinePaint(Color.white);

    JFreeChart chartSegGamma = ChartFactory.createXYLineChart(null, "sigma", "Segment Gamma", null,
            PlotOrientation.VERTICAL, true, true, false);
    plotSegGamma = (XYPlot) chartSegGamma.getPlot();

    JPanel south = new JPanel();
    south.setLayout(new FlowLayout());
    south.add(new JLabel("<html>ln &gamma;<sup>&infin;</sup><sub>1</sub>:</html>"));
    south.add(lnGammaInf1Label = new JLabel());
    south.add(new JLabel("<html>ln &gamma;<sup>&infin;</sup><sub>2</sub>:</html>"));
    south.add(lnGammaInf2Label = new JLabel());
    south.add(Box.createHorizontalStrut(20));
    south.add(new JLabel("<html>&gamma;<sup>&infin;</sup><sub>1</sub>:</html>"));
    south.add(gammaInf1Label = new JLabel());
    south.add(new JLabel("<html>&gamma;<sup>&infin;</sup><sub>2</sub>:</html>"));
    south.add(gammaInf2Label = new JLabel());

    JPanel aba1 = new JPanel(new BorderLayout());
    aba1.add(northAba1, BorderLayout.NORTH);
    JPanel chartsPanel = new JPanel(new GridLayout(0, 2));
    aba1.add(chartsPanel, BorderLayout.CENTER);
    chartsPanel.add(new ChartPanel(chart));
    chartsPanel.add(new ChartPanel(chartSegGamma));
    aba1.add(south, BorderLayout.SOUTH);

    JPanel aba2 = new JPanel(new BorderLayout());
    aba2.add(northAba2, BorderLayout.NORTH);
    aba2.add(chartPanel = new ChartPanel(sigmaProfileChart), BorderLayout.CENTER);

    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.addTab("gamma", aba1);
    tabbedPane.addTab("sigma", aba2);
    add(tabbedPane, BorderLayout.CENTER);

    //      cosmosac.setAEffPrime(6.596176570595075);
    //      cosmosac.setCoord(11.614599507917934);
    //      cosmosac.setVnorm(56.36966406129967);
    //      cosmosac.setAnorm(41.56058649432742);
    //      cosmosac.setCHB(65330.19484947528);
    //      cosmosac.setSigmaHB(0.008292411048046008);

    //Display the window.
    setSize(800, 600);
    setLocationRelativeTo(null);
    modelBox.setSelectedIndex(0);
    setVisible(true);

    // test for a mixture
    //      addList("WATER");
    //      addList("H3O+1");
    //      addList("OH-1");
    //      addList("CL-1");
    //      addList("OXYGEN");
    //      addList("sec-butylamine");
    //      addList("hydrogen-fluoride");
    //      addList("ACETONE");
    //      addList("METHANOL");
    //      addList("ACETONE.opt");
    //      addList("METHANOL.opt");
    //      addList("METHYL-ETHYL-KETONE");
    //      addList("ETHANOL");
    //      addList("N-HEPTANE");
    //      addList("PROPIONIC-ACID");
    //      addList("EMIM");
    //      addList("NTF2");
    //      addList("DCA");
    //      addList("N-OCTANE");
    addList("ETHYLENE CARBONATE");
    addList("BENZENE");
    addList("TOLUENE");
    removeButton.setEnabled(true);
}

From source file:uk.ac.babraham.SeqMonk.Filters.GeneSetFilter.GeneSetDisplay.java

public GeneSetDisplay(DataCollection dataCollection, String description, DataStore fromStore, DataStore toStore,
        Probe[] probes, Hashtable zScoreLookupTable, MappedGeneSetTTestValue[] filterResults,
        ProbeList startingProbeList, float[][] customRegressionValues, SimpleRegression simpleRegression) {

    super(SeqMonkApplication.getInstance(), "Gene Set Results");
    this.collection = dataCollection;
    this.filterResultsPVals = filterResults;
    this.startingProbeList = startingProbeList;
    this.description = description;
    this.fromStore = fromStore;
    this.toStore = toStore;
    this.probes = probes;
    this.zScoreLookupTable = zScoreLookupTable;
    this.customRegressionValues = customRegressionValues;
    this.simpleRegression = simpleRegression;
    this.addWindowListener(this);

    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

    // This is to hold the scatterPanel and its associated bits.
    plotPanel = new JPanel();
    plotPanel.setLayout(new BorderLayout());

    scatterPlotPanel = new JPanel();
    plotPanel.add(scatterPlotPanel, BorderLayout.CENTER);

    dotSizeSlider = new JSlider(JSlider.VERTICAL, 1, 100, 3);

    // This call is left in to work around a bug in the Windows 7 LAF
    // which makes the slider stupidly thin in ticks are not drawn.
    dotSizeSlider.setPaintTicks(true);//ww w  .ja  v a 2 s  .c om
    dotSizeSlider.addChangeListener(this);
    plotPanel.add(dotSizeSlider, BorderLayout.EAST);

    JPanel plotButtonPanel = new JPanel();
    plotButtonPanel.setLayout(new GridBagLayout());
    GridBagConstraints c1 = new GridBagConstraints();
    c1.insets = new Insets(2, 2, 2, 2);
    c1.gridx = 0;
    c1.gridy = 0;

    saveImageButton = new JButton("Save Image");
    saveImageButton.addActionListener(this);
    saveImageButton.setActionCommand("save_image");

    plotButtonPanel.add(saveImageButton, c1);

    c1.gridx++;
    swapPlotButton = new JToggleButton("Display standard scatterplot");
    swapPlotButton.addActionListener(this);
    swapPlotButton.setActionCommand("swap_plot");

    plotButtonPanel.add(swapPlotButton, c1);

    plotPanel.add(plotButtonPanel, BorderLayout.SOUTH);

    /** The table where the probe lists are displayed */
    tableModel = new GeneSetTableModel(filterResultsPVals);
    table = new JTable(new TableSorter(tableModel));
    table.setRowSelectionAllowed(true);
    table.addMouseListener(this);
    table.setAutoCreateRowSorter(true);
    table.getSelectionModel().addListSelectionListener(this);
    table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    // sort by z-score
    table.getRowSorter().toggleSortOrder(3);

    // Set our initial column widths
    TableColumn column = null;
    for (int i = 0; i < tableModel.getColumnCount(); i++) {
        column = table.getColumnModel().getColumn(i);
        if (i == 0) {
            column.setPreferredWidth(40);
        } else if (i == 1) {
            column.setPreferredWidth(200);
        } else {
            column.setPreferredWidth(80);
        }
    }

    JScrollPane scrollPane = new JScrollPane(table);
    JPanel tablePanel = new JPanel();

    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridBagLayout());
    GridBagConstraints c2 = new GridBagConstraints();
    c2.insets = new Insets(2, 2, 2, 2);
    c2.gridx = 0;
    c2.gridy = 0;

    selectAllButton = new JToggleButton("Select all");
    selectAllButton.addActionListener(this);
    selectAllButton.setActionCommand("select_all");

    buttonPanel.add(selectAllButton, c2);

    saveSelectedProbeListsButton = new JButton("Save selected probe lists");
    saveSelectedProbeListsButton.addActionListener(this);
    saveSelectedProbeListsButton.setActionCommand("save_selected_probelists");
    c2.gridx++;
    c2.gridx++;
    buttonPanel.add(saveSelectedProbeListsButton, c2);

    saveTableButton = new JButton("Save table");
    saveTableButton.addActionListener(this);
    saveTableButton.setActionCommand("save_table");
    c2.gridx++;
    c2.gridx++;
    buttonPanel.add(saveTableButton, c2);

    closeButton = new JButton("Close");
    closeButton.addActionListener(this);
    closeButton.setActionCommand("close");
    c2.gridx++;
    buttonPanel.add(closeButton, c2);

    tablePanel.setLayout(new BorderLayout());
    tablePanel.add(scrollPane, BorderLayout.CENTER);
    tablePanel.add(buttonPanel, BorderLayout.SOUTH);

    // sort this out 
    mainPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    mainPane.setLeftComponent(plotPanel);
    mainPane.setRightComponent(tablePanel);

    mainPane.setResizeWeight(0.6);
    mainPane.setDividerLocation(500);

    getContentPane().add(BorderLayout.CENTER, mainPane);

    if (storesQuantitated()) {

        plotPanel.remove(scatterPlotPanel);
        scatterPlotPanel = new ZScoreScatterPlotPanel(fromStore, toStore, probes, currentSelectedProbeList,
                dotSizeSlider.getValue(), zScoreLookupTable);
        plotPanel.add(scatterPlotPanel, BorderLayout.CENTER);
    }

    setSize(1000, 500);
    setVisible(true);

}

From source file:au.org.ala.delta.intkey.ui.FindInTaxaDialog.java

public FindInTaxaDialog(Intkey intkeyApp) {
    super(intkeyApp.getMainFrame(), false);
    setResizable(false);/*ww w  . ja  va2s. com*/

    ResourceMap resourceMap = Application.getInstance().getContext().getResourceMap(FindInTaxaDialog.class);
    resourceMap.injectFields(this);
    ActionMap actionMap = Application.getInstance().getContext().getActionMap(this);

    _intkeyApp = intkeyApp;

    _numMatchedTaxa = 0;
    _currentMatchedTaxon = -1;

    _findAction = actionMap.get("findTaxa");
    _nextAction = actionMap.get("nextFoundTaxon");

    this.setTitle(windowTitle);

    getContentPane().setLayout(new BorderLayout(0, 0));

    _pnlMain = new JPanel();
    _pnlMain.setBorder(new EmptyBorder(20, 20, 20, 20));
    getContentPane().add(_pnlMain, BorderLayout.CENTER);
    _pnlMain.setLayout(new BorderLayout(0, 0));

    _pnlMainTop = new JPanel();
    _pnlMain.add(_pnlMainTop, BorderLayout.NORTH);
    _pnlMainTop.setLayout(new BoxLayout(_pnlMainTop, BoxLayout.Y_AXIS));

    _lblEnterSearchString = new JLabel(enterSearchStringCaption);
    _lblEnterSearchString.setBorder(new EmptyBorder(0, 0, 5, 0));
    _lblEnterSearchString.setHorizontalAlignment(SwingConstants.LEFT);
    _lblEnterSearchString.setVerticalAlignment(SwingConstants.TOP);
    _lblEnterSearchString.setAlignmentY(Component.TOP_ALIGNMENT);
    _pnlMainTop.add(_lblEnterSearchString);

    _textField = new JTextField();
    _textField.getDocument().addDocumentListener(new DocumentListener() {

        @Override
        public void removeUpdate(DocumentEvent e) {
            reset();
        }

        @Override
        public void insertUpdate(DocumentEvent e) {
            reset();
        }

        @Override
        public void changedUpdate(DocumentEvent e) {
            reset();
        }
    });

    _pnlMainTop.add(_textField);
    _textField.setColumns(10);

    _pnlMainMiddle = new JPanel();
    _pnlMainMiddle.setBorder(new EmptyBorder(10, 0, 0, 0));
    _pnlMain.add(_pnlMainMiddle, BorderLayout.CENTER);
    _pnlMainMiddle.setLayout(new BoxLayout(_pnlMainMiddle, BoxLayout.Y_AXIS));

    _rdbtnSelectOne = new JRadioButton(selectOneCaption);
    _rdbtnSelectOne.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            reset();
        }
    });
    _pnlMainMiddle.add(_rdbtnSelectOne);

    _rdbtnSelectAll = new JRadioButton(selectAllCaption);
    _rdbtnSelectAll.setSelected(true);
    _rdbtnSelectAll.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            reset();
        }
    });
    _pnlMainMiddle.add(_rdbtnSelectAll);

    ButtonGroup radioButtonGroup = new ButtonGroup();
    radioButtonGroup.add(_rdbtnSelectOne);
    radioButtonGroup.add(_rdbtnSelectAll);

    _pnlMainBottom = new JPanel();
    _pnlMain.add(_pnlMainBottom, BorderLayout.SOUTH);
    _pnlMainBottom.setLayout(new BoxLayout(_pnlMainBottom, BoxLayout.Y_AXIS));

    _chckbxSearchSynonyms = new JCheckBox(searchSynonymsCaption);
    _chckbxSearchSynonyms.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            reset();
        }
    });

    _pnlMainBottom.add(_chckbxSearchSynonyms);

    _chckbxSearchEliminatedTaxa = new JCheckBox(searchEliminatedTaxaCaption);
    _chckbxSearchEliminatedTaxa.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            reset();
        }
    });

    _pnlMainBottom.add(_chckbxSearchEliminatedTaxa);

    _pnlButtons = new JPanel();
    _pnlButtons.setBorder(new EmptyBorder(20, 0, 0, 10));
    getContentPane().add(_pnlButtons, BorderLayout.EAST);
    _pnlButtons.setLayout(new BorderLayout(0, 0));

    _pnlInnerButtons = new JPanel();
    _pnlButtons.add(_pnlInnerButtons, BorderLayout.NORTH);
    GridBagLayout gbl_pnlInnerButtons = new GridBagLayout();
    gbl_pnlInnerButtons.columnWidths = new int[] { 0, 0 };
    gbl_pnlInnerButtons.rowHeights = new int[] { 0, 0, 0, 0 };
    gbl_pnlInnerButtons.columnWeights = new double[] { 0.0, Double.MIN_VALUE };
    gbl_pnlInnerButtons.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE };
    _pnlInnerButtons.setLayout(gbl_pnlInnerButtons);

    _btnFindNext = new JButton();
    _btnFindNext.setAction(_findAction);
    GridBagConstraints gbc_btnFind = new GridBagConstraints();
    gbc_btnFind.fill = GridBagConstraints.HORIZONTAL;
    gbc_btnFind.insets = new Insets(0, 0, 5, 0);
    gbc_btnFind.gridx = 0;
    gbc_btnFind.gridy = 0;
    _pnlInnerButtons.add(_btnFindNext, gbc_btnFind);

    _btnPrevious = new JButton();
    _btnPrevious.setAction(actionMap.get("previousFoundTaxon"));
    _btnPrevious.setEnabled(false);
    GridBagConstraints gbc_btnPrevious = new GridBagConstraints();
    gbc_btnPrevious.insets = new Insets(0, 0, 5, 0);
    gbc_btnPrevious.gridx = 0;
    gbc_btnPrevious.gridy = 1;
    _pnlInnerButtons.add(_btnPrevious, gbc_btnPrevious);

    _btnDone = new JButton();
    _btnDone.setAction(actionMap.get("findTaxaDone"));
    GridBagConstraints gbc_btnDone = new GridBagConstraints();
    gbc_btnDone.fill = GridBagConstraints.HORIZONTAL;
    gbc_btnDone.gridx = 0;
    gbc_btnDone.gridy = 2;
    _pnlInnerButtons.add(_btnDone, gbc_btnDone);

    this.pack();
    this.setLocationRelativeTo(_intkeyApp.getMainFrame());
}

From source file:com.floreantpos.ui.views.order.OrderView.java

/** This method is called from within the constructor to
 * initialize the form./*ww  w .ja  va 2 s .c  o  m*/
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
    setOpaque(false);
    setLayout(new java.awt.BorderLayout(2, 1));

    midContainer.setOpaque(false);
    midContainer.setBorder(null);
    midContainer.add(groupView, BorderLayout.NORTH);
    midContainer.add(itemView);

    add(categoryView, java.awt.BorderLayout.EAST);
    add(ticketView, java.awt.BorderLayout.WEST);
    add(midContainer, java.awt.BorderLayout.CENTER);
    add(actionButtonPanel, java.awt.BorderLayout.SOUTH);

    //      addView(GroupView.VIEW_NAME, groupView);
    //      addView(MenuItemView.VIEW_NAME, itemView);
    //      addView("VIEW_EMPTY", new com.floreantpos.swing.TransparentPanel()); //$NON-NLS-1$

    addActionButtonPanel();
    btnOrderType.setVisible(false);
    showView("VIEW_EMPTY"); //$NON-NLS-1$
}