Example usage for javax.swing SwingConstants LEFT

List of usage examples for javax.swing SwingConstants LEFT

Introduction

In this page you can find the example usage for javax.swing SwingConstants LEFT.

Prototype

int LEFT

To view the source code for javax.swing SwingConstants LEFT.

Click Source Link

Document

Box-orientation constant used to specify the left side of a box.

Usage

From source file:edu.harvard.i2b2.patientMapping.ui.PatientMappingJPanel.java

private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jLabel1 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();
    jPanel1 = new javax.swing.JPanel();
    jSaveButton = new javax.swing.JButton();
    jImportButton = new javax.swing.JButton();
    jConvertButton = new javax.swing.JButton();
    jAutoSaveCheckBox = new javax.swing.JCheckBox();
    jPanel2 = new javax.swing.JPanel();
    jRightButton = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jLeftButton = new javax.swing.JButton();
    jStartTextField = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jIncrementTextField = new javax.swing.JTextField();

    setLayout(new java.awt.GridBagLayout());

    setMinimumSize(new java.awt.Dimension(0, 0));
    jLabel1.setText("  Patient Mapping Table:");
    jLabel1.setAlignmentX(0.5F);/*from ww w.j  a  va2  s.  co  m*/
    jLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jLabel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jNameLabelMouseMoved(evt);
        }
    });
    jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseExited(java.awt.event.MouseEvent evt) {
            jNameLabelMouseExited(evt);
        }
    });
    jLabel1.addMouseListener(new DragMouseAdapter());
    jLabel1.setTransferHandler(new NameLabelTextHandler());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.ipadx = 390;
    gridBagConstraints.ipady = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 2, 0, 3);
    add(jLabel1, gridBagConstraints);

    jTable1.setModel(
            new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
    jScrollPane1.setViewportView(jTable1);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 486;
    gridBagConstraints.ipady = 160;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);
    add(jScrollPane1, gridBagConstraints);

    jPanel1.setLayout(new java.awt.GridBagLayout());

    jSaveButton.setText("Save Patient Set");
    jSaveButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jSaveButtonActionPerformed(evt);
        }
    });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.ipady = -3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 40, 1, 0);
    jPanel1.add(jSaveButton, gridBagConstraints);

    jImportButton.setText("Open Patient Set");
    jImportButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jImportButtonActionPerformed(evt);
        }
    });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.ipadx = 3;
    gridBagConstraints.ipady = -3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 21, 1, 0);
    jPanel1.add(jImportButton, gridBagConstraints);

    jConvertButton.setText("Convert Between Patient Sets");
    jConvertButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jConvertButtonActionPerformed(evt);
        }
    });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.ipady = -3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 1, 1);
    jPanel1.add(jConvertButton, gridBagConstraints);

    jAutoSaveCheckBox.setText("save patients to a file automatically");
    jAutoSaveCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jAutoSaveCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.ipadx = 33;
    gridBagConstraints.ipady = 5;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 1, 0);
    jPanel1.add(jAutoSaveCheckBox, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.ipadx = 509;
    gridBagConstraints.ipady = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(1, 11, 5, 0);
    add(jPanel1, gridBagConstraints);

    jPanel2.setLayout(new java.awt.GridBagLayout());

    jRightButton.setText(">");
    jRightButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRightButtonActionPerformed(evt);
        }
    });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 6;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 8, 5);
    //jPanel2.add(jRightButton, gridBagConstraints);

    jLabel2.setText("Patient Set Size: ---                      ");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.ipady = 6;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 17, 0, 0);
    jPanel2.add(jLabel2, gridBagConstraints);

    jLeftButton.setText("Cancel");
    jLeftButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jLeftButtonActionPerformed(evt);
        }
    });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 24, 8, 0);
    jPanel2.add(jLeftButton, gridBagConstraints);
    //jLeftButton.setBackground(Color.LIGHT_GRAY);

    jPanel2.setBackground(Color.LIGHT_GRAY);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.ipadx = 44;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 3, 0, 0);
    //jPanel2.add(jStartTextField, gridBagConstraints);

    jLabel3.setText("start:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 17, 0, 0);
    //jPanel2.add(jLabel3, gridBagConstraints);

    jLabel4.setText("increment:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 0, 0);
    //jPanel2.add(jLabel4, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 5;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.ipadx = 44;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 9, 0, 0);
    //jPanel2.add(jIncrementTextField, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.ipadx = 33;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    add(jPanel2, gridBagConstraints);

}

From source file:be.ugent.maf.cellmissy.gui.controller.analysis.doseresponse.generic.GenericDoseResponseController.java

/**
 * Initialise tables when switching to analysis card.
 *//*w ww.j  a  v a  2s. com*/
public void onDoseResponse() {
    dRInputController.initDRInputData();
    dRPanel.getInputDRButton().doClick();
    //switch shared table view
    updateModelInTable(dRInputController.getTableModel());
    dataTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT));
    updateTableInfoMessage("This table contains all conditions and their respective responses");
}

From source file:com.digitalgeneralists.assurance.ui.components.ComparisonResultPanel.java

protected void initializeComponent(ComparisonResult result) {
    if (!this.initialized) {
        this.merging = false;
        this.numberOfLines = 0;

        this.setOpaque(true);

        GridBagLayout gridbag = new GridBagLayout();
        this.setLayout(gridbag);

        this.basePanelConstraints.anchor = GridBagConstraints.WEST;
        this.basePanelConstraints.fill = GridBagConstraints.BOTH;
        this.basePanelConstraints.gridx = 0;
        this.basePanelConstraints.gridy = 0;
        this.basePanelConstraints.weightx = 1.0;
        this.basePanelConstraints.weighty = 1.0;
        this.basePanelConstraints.gridheight = 1;
        this.basePanelConstraints.gridwidth = 1;
        this.basePanelConstraints.insets = new Insets(0, 0, 0, 0);

        this.standardPanel.setOpaque(false);
        GridBagLayout basePanelGridbag = new GridBagLayout();
        this.standardPanel.setLayout(basePanelGridbag);
        this.add(this.standardPanel, this.basePanelConstraints);

        GridBagConstraints sourcePanelConstraints = new GridBagConstraints();
        sourcePanelConstraints.anchor = GridBagConstraints.WEST;
        sourcePanelConstraints.fill = GridBagConstraints.BOTH;
        sourcePanelConstraints.gridx = 0;
        sourcePanelConstraints.gridy = 0;
        sourcePanelConstraints.weightx = 0.4;
        sourcePanelConstraints.weighty = 1.0;
        sourcePanelConstraints.gridheight = 1;
        sourcePanelConstraints.gridwidth = 1;
        sourcePanelConstraints.insets = new Insets(0, 0, 0, 0);

        JPanel sourcePanel = new JPanel();
        sourcePanel.setOpaque(false);/*from   w  w  w . j  ava2  s  .  c om*/
        GridBagLayout sourcePanelGridbag = new GridBagLayout();
        sourcePanel.setLayout(sourcePanelGridbag);
        this.standardPanel.add(sourcePanel, sourcePanelConstraints);

        GridBagConstraints sourceFileLabelConstraints = new GridBagConstraints();
        sourceFileLabelConstraints.anchor = GridBagConstraints.WEST;
        sourceFileLabelConstraints.gridx = 0;
        sourceFileLabelConstraints.gridy = 0;
        sourceFileLabelConstraints.weightx = 1.0;
        sourceFileLabelConstraints.weighty = 1.0;
        sourceFileLabelConstraints.gridheight = 1;
        sourceFileLabelConstraints.gridwidth = 1;
        sourceFileLabelConstraints.insets = new Insets(5, 5, 5, 5);

        String sourcePath = "No File Specified";
        if ((result != null) && (result.getSource() != null)) {
            File sourceFile = result.getSource().getFile();
            if ((sourceFile == null) || (!sourceFile.exists())) {
                sourcePath = "File does not exist in source location.";
            } else {
                sourcePath = sourceFile.getPath();
            }
            sourceFile = null;
        }
        JLabel sourceFileLabel = new JLabel(sourcePath);
        sourcePath = null;
        sourcePanel.add(sourceFileLabel, sourceFileLabelConstraints);

        GridBagConstraints sourceAttributesPanelConstraints = new GridBagConstraints();
        sourceAttributesPanelConstraints.anchor = GridBagConstraints.WEST;
        sourceAttributesPanelConstraints.fill = GridBagConstraints.BOTH;
        sourceAttributesPanelConstraints.gridx = 0;
        sourceAttributesPanelConstraints.gridy = 1;
        sourceAttributesPanelConstraints.weightx = 1.0;
        sourceAttributesPanelConstraints.weighty = 1.0;
        sourceAttributesPanelConstraints.gridheight = 1;
        sourceAttributesPanelConstraints.gridwidth = 1;
        sourceAttributesPanelConstraints.insets = new Insets(0, 0, 0, 0);

        FileReference sourceReference = null;
        if (result != null) {
            sourceReference = result.getSource();
        }

        FileReference targetReference = null;
        if (result != null) {
            targetReference = result.getTarget();
        }

        JPanel sourceAttributesPanel = this.createFileAttributesPanel(sourceReference, targetReference,
                GridBagConstraints.WEST);
        sourcePanel.add(sourceAttributesPanel, sourceAttributesPanelConstraints);

        this.moreSourceAttributesButton.setHorizontalAlignment(SwingConstants.LEFT);
        this.moreSourceAttributesButton.setBorderPainted(false);
        this.moreSourceAttributesButton.setOpaque(false);
        this.moreSourceAttributesButton.setForeground(Color.blue);

        if (this.editable) {
            this.moreSourceAttributesButton.setText("All attributes...");
            this.moreSourceAttributesButton.addActionListener(this);
            this.moreSourceAttributesButton.setEnabled(true);
        } else {
            this.moreSourceAttributesButton.setText(" ");
            this.moreSourceAttributesButton.setEnabled(false);
        }
        this.moreSourceAttributesButton.setActionCommand(AssuranceActions.sourceAttributesAction);

        GridBagConstraints moreSourceAttributesButtonConstraints = new GridBagConstraints();
        moreSourceAttributesButtonConstraints.anchor = GridBagConstraints.WEST;
        moreSourceAttributesButtonConstraints.fill = GridBagConstraints.BOTH;
        moreSourceAttributesButtonConstraints.gridx = 0;
        moreSourceAttributesButtonConstraints.gridy = 2;
        moreSourceAttributesButtonConstraints.weightx = 1.0;
        moreSourceAttributesButtonConstraints.weighty = 1.0;
        moreSourceAttributesButtonConstraints.gridheight = 1;
        moreSourceAttributesButtonConstraints.gridwidth = 1;
        moreSourceAttributesButtonConstraints.insets = new Insets(0, 0, 0, 0);
        sourcePanel.add(this.moreSourceAttributesButton, moreSourceAttributesButtonConstraints);

        this.buildMergePanel(result);

        GridBagConstraints targetPanelConstraints = new GridBagConstraints();
        targetPanelConstraints.anchor = GridBagConstraints.EAST;
        targetPanelConstraints.fill = GridBagConstraints.BOTH;
        targetPanelConstraints.gridx = 2;
        targetPanelConstraints.gridy = 0;
        targetPanelConstraints.weightx = 0.4;
        targetPanelConstraints.weighty = 1.0;
        targetPanelConstraints.gridheight = 1;
        targetPanelConstraints.gridwidth = 1;
        targetPanelConstraints.insets = new Insets(0, 0, 0, 0);

        JPanel targetPanel = new JPanel();
        GridBagLayout targetPanelGridbag = new GridBagLayout();
        targetPanel.setOpaque(false);
        targetPanel.setLayout(targetPanelGridbag);
        this.standardPanel.add(targetPanel, targetPanelConstraints);

        GridBagConstraints targetFileLabelConstraints = new GridBagConstraints();
        targetFileLabelConstraints.anchor = GridBagConstraints.EAST;
        targetFileLabelConstraints.fill = GridBagConstraints.BOTH;
        targetFileLabelConstraints.gridx = 0;
        targetFileLabelConstraints.gridy = 0;
        targetFileLabelConstraints.weightx = 1.0;
        targetFileLabelConstraints.weighty = 1.0;
        targetFileLabelConstraints.gridheight = 1;
        targetFileLabelConstraints.gridwidth = 1;
        targetFileLabelConstraints.insets = new Insets(5, 5, 5, 5);

        // Create a label to put messages during an action event.
        String targetPath = "No File Specified";
        if ((result != null) && (result.getTarget() != null)) {
            File targetFile = result.getTarget().getFile();
            if ((targetFile == null) || (!targetFile.exists())) {
                targetPath = "File does not exist in target location.";
            } else {
                targetPath = targetFile.getPath();
            }
            targetFile = null;
        }
        JLabel targetFileLabel = new JLabel(targetPath);
        targetPath = null;
        targetPanel.add(targetFileLabel, targetFileLabelConstraints);

        GridBagConstraints targetAttributesPanelConstraints = new GridBagConstraints();
        targetAttributesPanelConstraints.anchor = GridBagConstraints.EAST;
        targetAttributesPanelConstraints.fill = GridBagConstraints.BOTH;
        targetAttributesPanelConstraints.gridx = 0;
        targetAttributesPanelConstraints.gridy = 1;
        targetAttributesPanelConstraints.weightx = 1.0;
        targetAttributesPanelConstraints.weighty = 1.0;
        targetAttributesPanelConstraints.gridheight = 1;
        targetAttributesPanelConstraints.gridwidth = 1;
        targetAttributesPanelConstraints.insets = new Insets(0, 0, 0, 0);

        JPanel targetAttributesPanel = this.createFileAttributesPanel(targetReference, sourceReference,
                GridBagConstraints.EAST);
        targetPanel.add(targetAttributesPanel, targetAttributesPanelConstraints);

        sourceReference = null;
        targetReference = null;

        this.moreTargetAttributesButton.setHorizontalAlignment(SwingConstants.RIGHT);
        this.moreTargetAttributesButton.setBorderPainted(false);
        this.moreTargetAttributesButton.setOpaque(false);
        this.moreTargetAttributesButton.setForeground(Color.blue);

        if (this.editable) {
            this.moreTargetAttributesButton.setText("All attributes...");
            this.moreTargetAttributesButton.addActionListener(this);
            this.moreTargetAttributesButton.setEnabled(true);
        } else {
            this.moreTargetAttributesButton.setText(" ");
            this.moreTargetAttributesButton.setEnabled(false);
        }
        this.moreTargetAttributesButton.setActionCommand(AssuranceActions.targetAttributesAction);

        GridBagConstraints moreTargetAttributesButtonConstraints = new GridBagConstraints();
        moreTargetAttributesButtonConstraints.anchor = GridBagConstraints.EAST;
        moreTargetAttributesButtonConstraints.fill = GridBagConstraints.BOTH;
        moreTargetAttributesButtonConstraints.gridx = 0;
        moreTargetAttributesButtonConstraints.gridy = 2;
        moreTargetAttributesButtonConstraints.weightx = 1.0;
        moreTargetAttributesButtonConstraints.weighty = 1.0;
        moreTargetAttributesButtonConstraints.gridheight = 1;
        moreTargetAttributesButtonConstraints.gridwidth = 1;
        moreTargetAttributesButtonConstraints.insets = new Insets(0, 0, 0, 0);
        targetPanel.add(this.moreTargetAttributesButton, moreTargetAttributesButtonConstraints);

        GridBagLayout mergingPanelGridbag = new GridBagLayout();
        this.mergingPanel.setLayout(mergingPanelGridbag);

        GridBagConstraints mergingLabelConstraints = new GridBagConstraints();
        mergingLabelConstraints.anchor = GridBagConstraints.NORTH;
        mergingLabelConstraints.fill = GridBagConstraints.BOTH;
        mergingLabelConstraints.gridx = 0;
        mergingLabelConstraints.gridy = 0;
        mergingLabelConstraints.weightx = 1.0;
        mergingLabelConstraints.weighty = 1.0;
        mergingLabelConstraints.gridheight = 1;
        mergingLabelConstraints.gridwidth = 1;
        mergingLabelConstraints.insets = new Insets(10, 10, 10, 10);

        this.mergingLabel.setHorizontalAlignment(JLabel.CENTER);
        mergingPanel.add(this.mergingLabel, mergingLabelConstraints);

        GridBagConstraints mergingStatusIndicatorConstraints = new GridBagConstraints();
        mergingStatusIndicatorConstraints.anchor = GridBagConstraints.SOUTH;
        mergingStatusIndicatorConstraints.fill = GridBagConstraints.BOTH;
        mergingStatusIndicatorConstraints.gridx = 0;
        mergingStatusIndicatorConstraints.gridy = 1;
        mergingStatusIndicatorConstraints.weightx = 1.0;
        mergingStatusIndicatorConstraints.weighty = 1.0;
        mergingStatusIndicatorConstraints.gridheight = 1;
        mergingStatusIndicatorConstraints.gridwidth = 1;
        mergingStatusIndicatorConstraints.insets = new Insets(10, 10, 10, 10);

        this.mergingProgressIndicator.setIndeterminate(true);

        mergingPanel.add(this.mergingProgressIndicator, mergingStatusIndicatorConstraints);

        this.addAncestorListener(new AncestorListener() {
            public void ancestorAdded(AncestorEvent event) {
                if (applicationDelegate != null) {
                    applicationDelegate.addEventObserver(ResultMergeStartedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(ResultMergeProgressEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(ResultMergeCompletedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(DeletedItemRestoreStartedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(DeletedItemRestoreProgressEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.addEventObserver(DeletedItemRestoreCompletedEvent.class,
                            (IEventObserver) event.getSource());
                }
            }

            public void ancestorRemoved(AncestorEvent event) {
                if (applicationDelegate != null) {
                    applicationDelegate.removeEventObserver(ResultMergeStartedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(ResultMergeProgressEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(ResultMergeCompletedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(DeletedItemRestoreStartedEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(DeletedItemRestoreProgressEvent.class,
                            (IEventObserver) event.getSource());
                    applicationDelegate.removeEventObserver(DeletedItemRestoreCompletedEvent.class,
                            (IEventObserver) event.getSource());
                }
            }

            public void ancestorMoved(AncestorEvent event) {
            }
        });

        this.initialized = true;
    }
}

From source file:com.rapidminer.gui.properties.OperatorPropertyPanel.java

public OperatorPropertyPanel(final MainFrame mainFrame) {
    super();// ww  w . j  av  a2  s.co  m
    this.mainFrame = mainFrame;
    breakpointButton = new BreakpointButton();
    headerLabel.setHorizontalAlignment(SwingConstants.CENTER);
    expertModeHintLabel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    expertModeHintLabel.setIcon(WARNING_ICON);
    expertModeHintLabel.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseReleased(MouseEvent e) {
            mainFrame.TOGGLE_EXPERT_MODE_ACTION.actionPerformed(null);
        }
    });
    expertModeHintLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
    expertModeHintLabel.setHorizontalAlignment(SwingConstants.LEFT);
    setupComponents();

    compatibilityLevelSpinner.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            // compatibility level
            OperatorVersion[] versionChanges = operator.getIncompatibleVersionChanges();

            // sort to have an ascending order
            Arrays.sort(versionChanges);
            if (versionChanges.length != 0) {
                OperatorVersion latestChange = versionChanges[versionChanges.length - 1];
                if (latestChange.isAtLeast(operator.getCompatibilityLevel())) {
                    compatibilityLabel.setIcon(WARNING_ICON);
                } else {
                    compatibilityLabel.setIcon(SwingTools.createIcon("16/ok.png"));
                }
            }
        }
    });
    showHelpAction = new ToggleAction(true, "show_parameter_help") {

        private static final long serialVersionUID = 1L;

        @Override
        public void actionToggled(ActionEvent e) {
            setShowParameterHelp(isSelected());
            mainFrame.getPropertyPanel().setupComponents();
        }
    };
}

From source file:edu.ku.brc.af.ui.forms.formatters.UIFormatterEditorDlg.java

@Override
public void createUI() {
    super.createUI();

    CellConstraints cc = new CellConstraints();

    orderUpBtn = createIconBtn("ReorderUp", "TCGD_MOVE_UP", new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            int inx = fieldsTbl.getSelectedRow();
            UIFieldFormatterField item = (UIFieldFormatterField) fields.get(inx);

            fields.remove(inx);//from   w  ww. jav a 2  s. c o m
            fields.insertElementAt(item, inx - 1);
            fieldsTbl.getSelectionModel().setSelectionInterval(inx - 1, inx - 1);
            selectedFormat.resetLength();

            updateEnabledState();
            updateUIEnabled();
        }
    });
    orderDwnBtn = createIconBtn("ReorderDown", "TCGD_MOVE_DOWN", new ActionListener() {
        public void actionPerformed(ActionEvent ae) {
            int inx = fieldsTbl.getSelectedRow();
            UIFieldFormatterField item = (UIFieldFormatterField) fields.get(inx);

            fields.remove(inx);
            fields.insertElementAt(item, inx + 1);
            fieldsTbl.getSelectionModel().setSelectionInterval(inx + 1, inx + 1);
            selectedFormat.resetLength();

            updateEnabledState();
            updateUIEnabled();
        }
    });

    // get formatters for field
    List<UIFieldFormatterIFace> fmtrs = new Vector<UIFieldFormatterIFace>(uiFieldFormatterMgrCache
            .getFormatterList(fieldInfo.getTableInfo().getClassObj(), fieldInfo.getName()));
    Collections.sort(fmtrs, new Comparator<UIFieldFormatterIFace>() {
        public int compare(UIFieldFormatterIFace o1, UIFieldFormatterIFace o2) {
            return o1.toPattern().compareTo(o2.toPattern());
        }
    });

    // table and field titles
    PanelBuilder tblInfoPB = new PanelBuilder(
            new FormLayout("r:p,2px,f:p:g", "p,2px,p,2px,p,10px")/*, new FormDebugPanel()*/);

    String typeStr = fieldInfo.getType();
    typeStr = typeStr.indexOf('.') > -1 ? StringUtils.substringAfterLast(fieldInfo.getType(), ".") : typeStr;

    JLabel tableTitleLbl = createI18NFormLabel("FFE_TABLE");
    JLabel tableTitleValueLbl = createLabel(fieldInfo.getTableInfo().getTitle());
    tableTitleValueLbl.setBackground(Color.WHITE);
    tableTitleValueLbl.setOpaque(true);

    JLabel fieldTitleLbl = createI18NFormLabel("FFE_FIELD");
    JLabel fieldTitleValueLbl = createLabel(fieldInfo.getTitle());
    fieldTitleValueLbl.setBackground(Color.WHITE);
    fieldTitleValueLbl.setOpaque(true);

    JLabel fieldLengthLbl = createI18NFormLabel("FFE_LENGTH");
    JLabel fieldLengthValueLbl = createLabel(Integer.toString(fieldInfo.getLength()));
    fieldLengthValueLbl.setBackground(Color.WHITE);
    fieldLengthValueLbl.setOpaque(true);

    int y = 1;
    tblInfoPB.add(tableTitleLbl, cc.xy(1, y));
    tblInfoPB.add(tableTitleValueLbl, cc.xy(3, y));
    y += 2;
    tblInfoPB.add(fieldTitleLbl, cc.xy(1, y));
    tblInfoPB.add(fieldTitleValueLbl, cc.xy(3, y));
    y += 2;
    tblInfoPB.add(fieldLengthLbl, cc.xy(1, y));
    tblInfoPB.add(fieldLengthValueLbl, cc.xy(3, y));
    y += 2;

    // sample panel
    sampleLabel = createLabel("", SwingConstants.LEFT);
    JPanel samplePanel = new JPanel();
    samplePanel.setBorder(BorderFactory.createTitledBorder(getResourceString("FFE_SAMPLE"))); //$NON-NLS-1$ 
    samplePanel.add(sampleLabel);

    // name text field
    nameTF = createTextField(20);

    // title text field
    titleTF = createTextField(20);

    byYearCB = createCheckBox(getResourceString("FFE_BY_YEAR_CHECKBOX")); //$NON-NLS-1$ 
    hookByYearCheckBoxListener();

    fieldsPanel = new EditDeleteAddPanel(getSaveAL(), getDelAL(), getAddAL());
    fieldsTbl = new JTable(fieldsModel = new FieldsTableModel());
    fieldTypeCbx = new JComboBox(FieldType.values()); // I18N
    fieldTxt = createTextField(20);
    fieldsPanel.getAddBtn().setEnabled(true);
    fieldsPanel.getEditBtn().setIcon(IconManager.getIcon("Green Arrow Up", IconManager.IconSize.Std16));
    UIHelper.makeTableHeadersCentered(fieldsTbl, true);

    fieldTxt.setDocument(new FieldDocument());

    fieldsTbl.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    int width = fieldTypeCbx.getPreferredSize().width;

    y = 1;
    PanelBuilder subPB = new PanelBuilder(new FormLayout("r:p,2px,p", "p,4px, p,4px, p,4px, p,4px"));

    subPB.add(createI18NFormLabel("FFE_NAME"), cc.xy(1, y));
    subPB.add(nameTF, cc.xy(3, y));
    y += 2;

    subPB.add(createI18NFormLabel("FFE_TITLE"), cc.xy(1, y));
    subPB.add(titleTF, cc.xy(3, y));
    y += 2;

    subPB.add(byYearCB, cc.xy(3, y));
    y += 2;

    // CardLayout for Editor Panels

    SpinnerModel retModel = new SpinnerNumberModel(1, //initial value
            1, //min
            fieldInfo.getLength(), //max
            1); //step
    sizeSpinner = new JSpinner(retModel);
    isIncChk = new JCheckBox("Is Incrementer"); // I18N

    String colDefs = "f:p:g,p,2px," + width + "px,2px,p";

    closeBtn = createClose(0);
    PanelBuilder numPB = new PanelBuilder(new FormLayout(colDefs, "p,2px,p,2px,p"));
    numPB.add(createI18NFormLabel("FFE_LENGTH"), cc.xy(2, 1));
    numPB.add(sizeSpinner, cc.xy(4, 1));
    //numPB.add(closeBtn,    cc.xy(6, 1));
    numPB.add(isIncChk, cc.xy(4, 3));

    sepCbx = new JComboBox(new String[] { "-", ".", "/", "(space)", "_" });
    closeBtn = createClose(1);
    PanelBuilder sepPB = new PanelBuilder(new FormLayout(colDefs, "p,2px,p"));
    sepPB.add(createI18NFormLabel("FFE_SEP"), cc.xy(2, 1));
    sepPB.add(sepCbx, cc.xy(4, 1));
    //sepPB.add(closeBtn, cc.xy(6, 1));

    closeBtn = createClose(2);
    PanelBuilder txtPB = new PanelBuilder(new FormLayout(colDefs, "p,2px,p"));
    txtPB.add(createI18NFormLabel("FFE_TEXT"), cc.xy(2, 1));
    txtPB.add(fieldTxt, cc.xy(4, 1));

    cardPanel = new JPanel(cardLayout);
    cardPanel.add("size", numPB.getPanel());
    cardPanel.add("text", txtPB.getPanel());
    cardPanel.add("sep", sepPB.getPanel());
    cardPanel.add("none", new JLabel(" "));

    y = 1;
    PanelBuilder leftPB = new PanelBuilder(new FormLayout("f:p:g", "t:p,10px,p,f:p:g"));
    leftPB.add(tblInfoPB.getPanel(), cc.xy(1, y));
    y += 2;
    leftPB.add(subPB.getPanel(), cc.xy(1, y));
    y += 2;

    PanelBuilder upDownPanel = new PanelBuilder(new FormLayout("p", "f:p:g, p, 2px, p, f:p:g"));
    upDownPanel.add(orderUpBtn, cc.xy(1, 2));
    upDownPanel.add(orderDwnBtn, cc.xy(1, 4));

    totLenLbl = createLabel("XXXXX");

    y = 1;
    PanelBuilder rightPB = new PanelBuilder(new FormLayout("p:g,2px,p,2px,p", "200px,2px,p,2px,p,2px,p"));
    rightPB.add(createScrollPane(fieldsTbl), cc.xywh(1, y, 3, 1));
    rightPB.add(upDownPanel.getPanel(), cc.xywh(5, y, 1, 1));
    y += 2;
    rightPB.add(totLenLbl, cc.xy(1, y));
    rightPB.add(fieldsPanel, cc.xywh(3, y, 1, 1));
    y += 2;
    rightPB.add(fieldTypeLbl = createI18NFormLabel("FFE_TYPE"), cc.xy(1, y));
    rightPB.add(fieldTypeCbx, cc.xy(3, y));
    rightPB.add(closeBtn, cc.xy(5, y));
    y += 2;
    rightPB.add(cardPanel, cc.xyw(1, y, 3));
    y += 2;

    y = 1;
    PanelBuilder pb = new PanelBuilder(new FormLayout("p:g,10px,p,10px,p:g,10px,p", "f:p:g,10px,p"));
    Color bg = getBackground();
    pb.add(new VerticalSeparator(bg.darker(), bg.brighter()), cc.xywh(3, 1, 1, 1));

    pb.add(leftPB.getPanel(), cc.xy(1, y));
    pb.add(rightPB.getPanel(), cc.xy(5, y));
    //pb.add(keyPanel,             cc.xy(7, y));     
    y += 2;
    pb.add(samplePanel, cc.xyw(1, y, 7));
    y += 2;

    setByYearSelected(selectedFormat);

    nameTF.setEditable(isNew);
    nameTF.setText(selectedFormat.getName());
    titleTF.setText(selectedFormat.getTitle());
    updateSample();

    hookTextChangeListener(nameTF, "FFE_NO_NAME", 32);
    hookTextChangeListener(titleTF, "FFE_NO_TITLE", 32);

    pb.setDefaultDialogBorder();

    contentPanel = pb.getPanel();
    mainPanel.add(contentPanel, BorderLayout.CENTER);

    updateUIEnabled();

    pack();

    enabledEditorUI(false);

    hookFieldsTblSelectionListener();

    fieldTypeCbx.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            typeChanged();
        }
    });

    sepCbx.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            fieldHasChanged = true;
            updateEnabledState();
            hasChanged = true;
            updateUIEnabled();
        }
    });

    fieldTxt.getDocument().addDocumentListener(new DocumentAdaptor() {
        @Override
        protected void changed(DocumentEvent e) {
            fieldHasChanged = true;
            updateEnabledState();
            hasChanged = true;
            updateUIEnabled();
        }
    });

    sizeSpinner.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            fieldHasChanged = true;
            updateEnabledState();
            hasChanged = true;
            updateUIEnabled();

        }
    });

    isIncChk.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            fieldHasChanged = true;
            if (!isIncChk.isSelected()) {
                byYearCB.setSelected(false);
            }
            updateEntry();
            updateUIEnabled();
            updateEnabledState();
            fieldsTbl.repaint();
        }
    });

    fieldTypeCbx.setSelectedIndex(-1);
    fieldHasChanged = false;
    updateEnabledState();
}

From source file:be.ugent.maf.cellmissy.gui.controller.analysis.doseresponse.area.AreaDRInputController.java

/**
 * Remove selected condition(s) from the dose-response analysis group
 *///from w  w  w  .  ja va 2  s  .  c  om
@Override
protected void removeFromDRAnalysis() {
    List<PlateCondition> selectedConditions = getSelectedConditions();
    for (PlateCondition selectedCondition : selectedConditions) {
        //only possible to remove if group contains selected condition
        if (plateConditionsList.contains(selectedCondition)) {
            plateConditionsList.remove(selectedCondition);
            AreaAnalysisResults areaAnalysisResults = doseResponseController.getLinearResultsAnalysisMap()
                    .get(selectedCondition);
            areaAnalysisResultsList.remove(areaAnalysisResults);
        }
    }
    //only make new analysis group if you have not removed all
    if (!plateConditionsList.isEmpty()) {
        doseResponseController.setdRAnalysisGroup(
                new AreaDoseResponseAnalysisGroup(plateConditionsList, areaAnalysisResultsList));
        //check treatments, dialog pops up if necessary
        checkTreatments(doseResponseController.getdRAnalysisGroup(), chooseTreatmentDialog);
        // populate bottom table with the analysis group
        slopesTable.setModel(createTableModel(doseResponseController.getdRAnalysisGroup()));
        slopesTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer(SwingConstants.LEFT));
    } else {
        //otherwise show new empty table
        slopesTable.setModel(new NonEditableTableModel());
    }
}

From source file:com.openbravo.pos.sales.JRetailTicketPreviewTicket.java

private JPanel getLabelPanel(String msg, Color colour) {
    JPanel panel = new JPanel();
    Font font = new Font("Verdana", Font.BOLD, 12);
    panel.setFont(font);//w ww  .j a va  2s . c o  m
    panel.setOpaque(true);
    // panel.setBackground(Color.BLUE);
    JLabel label = new JLabel(msg, JLabel.LEFT);
    label.setForeground(colour);
    label.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    panel.add(label);

    return panel;
}

From source file:edu.harvard.i2b2.query.ui.TopPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 *///from   w ww  .  j a  v  a2 s  .  c o  m
private void initComponents() {
    jAnalysisLabel = new javax.swing.JLabel();
    jNameLabel = new javax.swing.JLabel();
    jSetSizeLabel = new javax.swing.JLabel();
    jNameTextField = new javax.swing.JTextField();
    jSetSizeFiled = new javax.swing.JLabel();
    jDeleteButton = new javax.swing.JButton();
    jScrollPane1 = new ConceptTreePanel("Group 1", this);
    jRunQueryButton = new javax.swing.JButton();
    jCancelButton = new javax.swing.JButton();
    jClearGroupsButton = new javax.swing.JButton();
    jScrollPane2 = new ConceptTreePanel("Group 2", this);
    jScrollPane3 = new ConceptTreePanel("Group 3", this);
    jScrollPane4 = new javax.swing.JScrollPane();
    jPanel1 = new javax.swing.JPanel();
    // jVisitComboBox = new javax.swing.JComboBox();
    jAndOrLabel1 = new javax.swing.JLabel();
    jAndOrLabel2 = new javax.swing.JLabel();
    jMorePanelsButton = new javax.swing.JButton();
    jWorkflowToolBar = new javax.swing.JToolBar();
    // jTimelineToggleButton = new javax.swing.JToggleButton();
    jPatientCountToggleButton = new javax.swing.JToggleButton();
    // jPatientSetToggleButton = new javax.swing.JToggleButton();
    jToolbarPanel = new javax.swing.JPanel();
    jQueryNamePanel = new javax.swing.JPanel();

    // jOptionsScrollPane = new javax.swing.JScrollPane();
    jOptionsPanel = new AnalysisPanel();
    jShowTimelineCheckBox = new javax.swing.JCheckBox();
    jGetAllPatientsCheckBox = new javax.swing.JCheckBox();
    // jGetPatientCountCheckBox = new javax.swing.JCheckBox();
    // jGetPatientSetCheckBox = new javax.swing.JCheckBox();

    setLayout(null);

    // jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
    // ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jPanel1.setLayout(null);

    jPanel1.add(jScrollPane1);
    jScrollPane1.setBounds(0, 0, 180, 200);

    jPanel1.add(jScrollPane2);
    jScrollPane2.setBounds(185, 0, 180, 200);

    jPanel1.add(jScrollPane3);
    jScrollPane3.setBounds(370, 0, 180, 200);

    // jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    jAndOrLabel1.setText("and");
    // jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel1);
    // jAndOrLabel1.setBounds(190, 90, 30, 18);

    // jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    // jAndOrLabel2.setText("and");
    // jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel2);
    // jAndOrLabel2.setBounds(410, 90, 30, 18);

    jQueryNamePanel.setLayout(null);
    jQueryNamePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jNameLabel.setText(" Query Name: ");
    jNameLabel.setToolTipText("You may drag this item to workplace to save the query definition");
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jNameLabel.setBounds(2, 2, 70, 23);
    add(jNameLabel);
    // jQueryNamePanel.add(jNameLabel);
    jNameLabel.setTransferHandler(new NameLabelTextHandler());
    jNameLabel.addMouseListener(new DragMouseAdapter());
    jNameLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jNameLabelMouseMoved(evt);
        }
    });
    jNameLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseExited(java.awt.event.MouseEvent evt) {
            jNameLabelMouseExited(evt);
        }
    });

    jNameTextField.setText("");
    jNameTextField.setBounds(95, 10, 370, 20);
    jNameTextField.setEditable(false);
    jNameTextField.setDragEnabled(true);
    jNameTextField.setTransferHandler(new TransferHandler("Text"));
    // jQueryNamePanel.add(jNameTextField);
    // add(jNameTextField);
    // add(jQueryNamePanel);
    // jQueryNamePanel.setBounds(5, 5, 400, 50);

    jClearGroupsButton.setFont(new java.awt.Font("Tahoma", 1, 10));
    jClearGroupsButton.setText("X");
    jClearGroupsButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    jClearGroupsButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jClearGroupsButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    jClearGroupsButton.setToolTipText("Reset all panels");
    if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
        jClearGroupsButton.setMargin(new java.awt.Insets(-10, -15, -10, -20));
    }
    jClearGroupsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jClearGroupsButtonActionPerformed(evt);
        }
    });
    jClearGroupsButton.setBounds(600, 10, 30, 20);
    add(jClearGroupsButton);

    jAnalysisLabel.setText("Analysis Types");
    // jAnalysisLabel.setBackground(Color.WHITE);
    // jAnalysisLabel.setOpaque(true);
    jAnalysisLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jAnalysisLabel.setBounds(2, 2, 70, 23);
    jAnalysisLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAnalysisLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    add(jAnalysisLabel);

    jPanel1.setPreferredSize(new Dimension(700, 150));
    jScrollPane4.setViewportView(jPanel1);
    add(jScrollPane4);
    jScrollPane4.setBounds(20, 35, 635, 220);
    jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    // jScrollPane4.setBorder(javax.swing.BorderFactory
    // .createLineBorder(new java.awt.Color(0, 0, 0)));
    jCancelButton.setText("Cancel");
    jCancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCancelButtonActionPerformed(evt);
        }
    });
    // add(jCancelButton);
    // jCancelButton.setBounds(20, 255, 90, 23);
    // jCancelButton.setFont(new Font("Tahoma", Font.PLAIN, 10));

    jGetAllPatientsCheckBox.setText("Get Everyone");
    jGetAllPatientsCheckBox.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    // jGetAllPatientsCheckBox
    // .setBorder(new javax.swing.border.SoftBevelBorder(
    // javax.swing.border.BevelBorder.RAISED));
    jGetAllPatientsCheckBox.setBorderPainted(true);
    jGetAllPatientsCheckBox.setContentAreaFilled(false);
    jGetAllPatientsCheckBox.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jGetAllPatientsCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
    jGetAllPatientsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jGetAllPatientsCheckBox.setToolTipText("Get all the patients in datamart");
    add(jGetAllPatientsCheckBox);
    jGetAllPatientsCheckBox.setBounds(5, 255, 110, 15);
    jGetAllPatientsCheckBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jGetAllPatientsCheckBoxActionPerformed(evt);
        }
    });

    jRunQueryButton.setText("Run Query Above");
    jRunQueryButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRunQueryButtonActionPerformed(evt);
        }
    });
    add(jRunQueryButton);
    jRunQueryButton.setBounds(100, 255, 625, 23);

    jSetSizeLabel.setText(" Patient(s) returned:");
    add(jSetSizeLabel);
    jSetSizeLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jSetSizeLabel.setBounds(20, 275, 70, 23);

    // jSetSizeFiled.setText(" subjects");
    // jSetSizeFiled.setEditable(false);
    // jSetSizeFiled.setHorizontalAlignment(SwingConstants.LEFT);
    // add(jSetSizeFiled);
    // jSetSizeLabel.setBounds(20, 275, 70, 23);

    jToolbarPanel.setLayout(new java.awt.BorderLayout());

    // jWorkflowToolBar.setRollover(true);
    // jWorkflowToolBar.setInheritsPopupMenu(true);
    // jTimelineToggleButton
    // .setIcon(new javax.swing.ImageIcon(
    // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    // /jTimelineToggleButton.setText("Show TimeLine");
    // jTimelineToggleButton.setFocusPainted(false);
    // jWorkflowToolBar.add(jTimelineToggleButton);

    jPatientCountToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jPatientCountToggleButton.setText("Get Patient Count");
    jPatientCountToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jPatientCountToggleButton);

    // jPatientSetToggleButton
    // .setIcon(new javax.swing.ImageIcon(
    // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    // jPatientSetToggleButton.setText("Get Patient Set");
    // jPatientSetToggleButton.setFocusPainted(false);
    // jWorkflowToolBar.add(jPatientSetToggleButton);
    jWorkflowToolBar.setPreferredSize(new Dimension(380, 40));

    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.PAGE_START);
    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.CENTER);

    // add(jToolbarPanel);
    jToolbarPanel.setBounds(20, 130, 240, 23);

    jMorePanelsButton.setText("<html><center>Add<br>" + "<left>Group");
    jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMorePanelsButtonActionPerformed(evt);
        }
    });
    // add(jMorePanelsButton);
    // jMorePanelsButton.setBounds(655, 35, 60, 220);

    jPanel1.add(jMorePanelsButton);
    jMorePanelsButton.setBounds(550, 0, 60, 200);

    // jOptionsPanel.setLayout(null);
    // jOptionsScrollPane.setBorder(javax.swing.BorderFactory
    // .createEtchedBorder());

    // jOptionsPanel.setPreferredSize(new java.awt.Dimension(100, 100));
    jShowTimelineCheckBox.setText("Timeline");
    jShowTimelineCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jShowTimelineCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jShowTimelineCheckBox.setToolTipText("Get the patient set and display it in timeline view");
    // jOptionsPanel.add(jShowTimelineCheckBox);
    jShowTimelineCheckBox.setBounds(5, 20, 110, 15);

    // jGetPatientCountCheckBox.setText("Patient Count");
    // jGetPatientCountCheckBox.setBorder(javax.swing.BorderFactory
    // .createEmptyBorder(0, 0, 0, 0));
    // jGetPatientCountCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // jGetPatientCountCheckBox.setToolTipText("Get the patient count XML");
    // jOptionsPanel.add(jGetPatientCountCheckBox);
    // jGetPatientCountCheckBox.setBounds(5, 50, 110, 15);

    // jGetPatientSetCheckBox.setText("Patient Set");
    // jGetPatientSetCheckBox.setBorder(javax.swing.BorderFactory
    // .createEmptyBorder(0, 0, 0, 0));
    // jGetPatientSetCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // jOptionsPanel.add(jGetPatientSetCheckBox);
    // jGetPatientSetCheckBox.setBounds(10, 80, 80, 15);

    // jOptionsScrollPane.setViewportView(jOptionsPanel);

    add(jOptionsPanel);
    jOptionsPanel.setBounds(500, 30, 120, 190);

    /*
     * jDeleteButton.setText("Delete"); jDeleteButton.addActionListener(new
     * java.awt.event.ActionListener() { public void
     * actionPerformed(java.awt.event.ActionEvent evt) {
     * jDeleteButtonActionPerformed(evt); } });
     * 
     * jVisitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new
     * String[] { "Groups don't have to occur in the same visit", "Groups
     * must all occur in the same visit" })); add(jVisitComboBox);
     * jVisitComboBox.setBounds(20, 40, 240, 22);
     * 
     * //add(jDeleteButton); //jDeleteButton.setBounds(20, 10, 65, 23);
     * 
     * add(jScrollPane1); jScrollPane1.setBounds(20, 70, 170, 320);
     * 
     * jRunQueryButton.setText("Run Query");
     * jRunQueryButton.addActionListener(new java.awt.event.ActionListener()
     * { public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRunQueryButtonActionPerformed(evt); } });
     * 
     * add(jRunQueryButton); jRunQueryButton.setBounds(20, 10, 87, 23);
     * 
     * jCancelButton.setText("Remove All");
     * jCancelButton.addActionListener(new java.awt.event.ActionListener() {
     * public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRemoveAllButtonActionPerformed(evt); } });
     * 
     * add(jCancelButton); jCancelButton.setBounds(115, 10, 90, 23);
     * 
     * //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
     * ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
     * jPanel1.setLayout(null);
     * jScrollPane4.getHorizontalScrollBar().setUnitIncrement(20);
     * //jPanel1.setVisible(false);
     * 
     * //jScrollPane1.setToolTipText("scrollpane 1");
     * jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 170, 350);
     * 
     * jPanel1.add(jScrollPane2); jScrollPane2.setBounds(210, 0, 170, 350);
     */

    jAndOrLabel1.setBackground(new java.awt.Color(255, 255, 255));
    jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel1.setText("and");
    jAndOrLabel1.setToolTipText("Click to change the relationship");
    jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel1MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel1);

    jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel2.setText("and");
    jAndOrLabel2.setToolTipText("Click to change the relationship");
    jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel2MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel2);
    // jTree1.addTreeWillExpandListener(this);
    // jTree1.addTreeExpansionListener(this);
    // jScrollPane1.setViewportView(new QueryConceptTreePanel("Group 1"));
    // jScrollPane1.setToolTipText("Double click on a folder to view the
    // items inside");
    // jTree2.addTreeExpansionListener(this);
    // jScrollPane2.setViewportView(new QueryConceptTreePanel("Group 2"));
    // jTree3.addTreeExpansionListener(this);
    // treepanel = new QueryConceptTreePanel("", this);
    // jScrollPane3.setViewportView(new QueryConceptTreePanel("Group 3"));
    // jSlider1.setMajorTickSpacing(20);
    /*
     * jSlider1.setPaintTicks(true); jSlider1.setValue(0);
     * jSlider1.setMinorTickSpacing(10); jSlider1.setToolTipText("Slider on
     * left is more Sensitive Query, " + "on right is more Specific");
     * add(jSlider1); jSlider1.setBounds(380, 40, 140, 18);
     * 
     * //jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
     * jLabel1.setText("Sensitivity <"); add(jLabel1);
     * jLabel1.setBounds(290, 40, 80, 20);
     * 
     * //jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel2.setText("> Specificity"); add(jLabel2);
     * jLabel2.setBounds(525, 40, 70, 20);
     */

    dataModel.addPanel(jScrollPane1, null, 0);
    dataModel.addPanel(jScrollPane2, jAndOrLabel1, 0);
    dataModel.addPanel(jScrollPane3, jAndOrLabel2, 555);
}

From source file:edu.harvard.i2b2.query.ui.MainPanel.java

/**
 * This method is called from within the constructor to initialize the form.
 *//*from  ww  w. jav  a 2 s  . c om*/
private void initComponents() {
    jAnalysisLabel = new javax.swing.JLabel();
    jTimingLabel = new javax.swing.JLabel();
    jNameLabel = new javax.swing.JLabel();
    jSetSizeLabel = new javax.swing.JLabel();
    jNameTextField = new javax.swing.JTextField();
    jSetSizeFiled = new javax.swing.JLabel();
    jDeleteButton = new javax.swing.JButton();
    jScrollPane1 = new GroupPanel("Group 1", this);
    jRunQueryButton = new javax.swing.JButton();
    jCancelButton = new javax.swing.JButton();
    jClearGroupsButton = new javax.swing.JButton();
    jScrollPane2 = new GroupPanel("Group 2", this);
    jScrollPane3 = new GroupPanel("Group 3", this);
    jScrollPane4 = new javax.swing.JScrollPane();
    jPanel1 = new javax.swing.JPanel();
    // jVisitComboBox = new javax.swing.JComboBox();
    jAndOrLabel1 = new javax.swing.JLabel();
    jAndOrLabel2 = new javax.swing.JLabel();
    jMorePanelsButton = new javax.swing.JButton();
    jWorkflowToolBar = new javax.swing.JToolBar();
    // jTimelineToggleButton = new javax.swing.JToggleButton();
    jPatientCountToggleButton = new javax.swing.JToggleButton();
    // jPatientSetToggleButton = new javax.swing.JToggleButton();
    jToolbarPanel = new javax.swing.JPanel();
    jQueryNamePanel = new javax.swing.JPanel();

    // jOptionsScrollPane = new javax.swing.JScrollPane();
    jOptionsPanel = new AnalysisPanel();
    jTimingPanel = new TimingPanel(this.dataModel);
    jShowTimelineCheckBox = new javax.swing.JCheckBox();
    jGetAllPatientsCheckBox = new javax.swing.JCheckBox();
    // jGetPatientCountCheckBox = new javax.swing.JCheckBox();
    // jGetPatientSetCheckBox = new javax.swing.JCheckBox();

    setLayout(null);

    // jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
    // ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jPanel1.setLayout(null);

    jPanel1.add(jScrollPane1);
    jScrollPane1.setBounds(0, 0, 180, 200);

    jPanel1.add(jScrollPane2);
    jScrollPane2.setBounds(185, 0, 180, 200);

    jPanel1.add(jScrollPane3);
    jScrollPane3.setBounds(370, 0, 180, 200);

    // jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    jAndOrLabel1.setText("and");
    // jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel1);
    // jAndOrLabel1.setBounds(190, 90, 30, 18);

    // jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER)
    // ;
    // jAndOrLabel2.setText("and");
    // jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder())
    // ;
    // jPanel1.add(jAndOrLabel2);
    // jAndOrLabel2.setBounds(410, 90, 30, 18);

    jQueryNamePanel.setLayout(null);
    jQueryNamePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    jNameLabel.setText(" Query Name: ");
    jNameLabel.setToolTipText("You may drag this item to workplace to save the query definition");
    jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jNameLabel.setBounds(2, 2, 70, 23);
    add(jNameLabel);
    // jQueryNamePanel.add(jNameLabel);
    jNameLabel.setTransferHandler(new NameLabelTextHandler());
    jNameLabel.addMouseListener(new DragMouseAdapter());
    jNameLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
        public void mouseMoved(java.awt.event.MouseEvent evt) {
            jNameLabelMouseMoved(evt);
        }
    });
    jNameLabel.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseExited(java.awt.event.MouseEvent evt) {
            jNameLabelMouseExited(evt);
        }
    });

    jNameTextField.setText("");
    jNameTextField.setBounds(95, 10, 370, 20);
    jNameTextField.setEditable(false);
    jNameTextField.setDragEnabled(true);
    jNameTextField.setTransferHandler(new TransferHandler("Text"));
    // jQueryNamePanel.add(jNameTextField);
    // add(jNameTextField);
    // add(jQueryNamePanel);
    // jQueryNamePanel.setBounds(5, 5, 400, 50);

    jClearGroupsButton.setFont(new java.awt.Font("Tahoma", 1, 10));
    jClearGroupsButton.setText("X");
    jClearGroupsButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    jClearGroupsButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
    jClearGroupsButton.setMargin(new java.awt.Insets(2, 2, 2, 2));
    jClearGroupsButton.setToolTipText("Reset all panels");
    if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) {
        jClearGroupsButton.setMargin(new java.awt.Insets(-10, -15, -10, -20));
    }
    jClearGroupsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jClearGroupsButtonActionPerformed(evt);
        }
    });
    jClearGroupsButton.setBounds(600, 10, 30, 20);
    add(jClearGroupsButton);

    jAnalysisLabel.setText("Analysis Types");
    // jAnalysisLabel.setBackground(Color.WHITE);
    // jAnalysisLabel.setOpaque(true);
    jAnalysisLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jAnalysisLabel.setBounds(2, 2, 120, 23);
    jAnalysisLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAnalysisLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    add(jAnalysisLabel);

    jPanel1.setPreferredSize(new Dimension(700, 150));
    jScrollPane4.setViewportView(jPanel1);
    add(jScrollPane4);
    jScrollPane4.setBounds(20, 35, 635, 220);
    jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    // jScrollPane4.setBorder(javax.swing.BorderFactory
    // .createLineBorder(new java.awt.Color(0, 0, 0)));
    jCancelButton.setText("Cancel");
    jCancelButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCancelButtonActionPerformed(evt);
        }
    });
    // add(jCancelButton);
    // jCancelButton.setBounds(20, 255, 90, 23);
    // jCancelButton.setFont(new Font("Tahoma", Font.PLAIN, 10));

    jGetAllPatientsCheckBox.setText("Get Everyone");
    jGetAllPatientsCheckBox.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    // jGetAllPatientsCheckBox
    // .setBorder(new javax.swing.border.SoftBevelBorder(
    // javax.swing.border.BevelBorder.RAISED));
    jGetAllPatientsCheckBox.setBorderPainted(true);
    jGetAllPatientsCheckBox.setContentAreaFilled(false);
    jGetAllPatientsCheckBox.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jGetAllPatientsCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
    jGetAllPatientsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jGetAllPatientsCheckBox.setToolTipText("Get all the patients in datamart");
    add(jGetAllPatientsCheckBox);
    jGetAllPatientsCheckBox.setBounds(5, 255, 110, 15);
    jGetAllPatientsCheckBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jGetAllPatientsCheckBoxActionPerformed(evt);
        }
    });

    jRunQueryButton.setText("Run Query Above");
    jRunQueryButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jRunQueryButtonActionPerformed(evt);
        }
    });
    add(jRunQueryButton);
    jRunQueryButton.setBounds(100, 255, 625, 23);

    jSetSizeLabel.setText(" Patient(s) returned:");
    add(jSetSizeLabel);
    jSetSizeLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jSetSizeLabel.setBounds(20, 275, 70, 23);

    // jSetSizeFiled.setText(" subjects");
    // jSetSizeFiled.setEditable(false);
    // jSetSizeFiled.setHorizontalAlignment(SwingConstants.LEFT);
    // add(jSetSizeFiled);
    // jSetSizeLabel.setBounds(20, 275, 70, 23);

    jToolbarPanel.setLayout(new java.awt.BorderLayout());

    // jWorkflowToolBar.setRollover(true);
    // jWorkflowToolBar.setInheritsPopupMenu(true);
    // jTimelineToggleButton
    // .setIcon(new javax.swing.ImageIcon(
    // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    // /jTimelineToggleButton.setText("Show TimeLine");
    // jTimelineToggleButton.setFocusPainted(false);
    // jWorkflowToolBar.add(jTimelineToggleButton);

    jPatientCountToggleButton.setIcon(
            new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    jPatientCountToggleButton.setText("Get Patient Count");
    jPatientCountToggleButton.setFocusPainted(false);
    jWorkflowToolBar.add(jPatientCountToggleButton);

    // jPatientSetToggleButton
    // .setIcon(new javax.swing.ImageIcon(
    // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif"));
    // jPatientSetToggleButton.setText("Get Patient Set");
    // jPatientSetToggleButton.setFocusPainted(false);
    // jWorkflowToolBar.add(jPatientSetToggleButton);
    jWorkflowToolBar.setPreferredSize(new Dimension(380, 40));

    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.PAGE_START);
    jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.CENTER);

    // add(jToolbarPanel);
    jToolbarPanel.setBounds(20, 130, 240, 23);

    jMorePanelsButton.setText("<html><center>Add<br>" + "<left>Group");
    jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMorePanelsButtonActionPerformed(evt);
        }
    });
    // add(jMorePanelsButton);
    // jMorePanelsButton.setBounds(655, 35, 60, 220);

    jPanel1.add(jMorePanelsButton);
    jMorePanelsButton.setBounds(550, 0, 60, 200);

    // jOptionsPanel.setLayout(null);
    // jOptionsScrollPane.setBorder(javax.swing.BorderFactory
    // .createEtchedBorder());

    // jOptionsPanel.setPreferredSize(new java.awt.Dimension(100, 100));
    jShowTimelineCheckBox.setText("Timeline");
    jShowTimelineCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jShowTimelineCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jShowTimelineCheckBox.setToolTipText("Get the patient set and display it in timeline view");
    // jOptionsPanel.add(jShowTimelineCheckBox);
    jShowTimelineCheckBox.setBounds(5, 20, 110, 15);

    // jGetPatientCountCheckBox.setText("Patient Count");
    // jGetPatientCountCheckBox.setBorder(javax.swing.BorderFactory
    // .createEmptyBorder(0, 0, 0, 0));
    // jGetPatientCountCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // jGetPatientCountCheckBox.setToolTipText("Get the patient count XML");
    // jOptionsPanel.add(jGetPatientCountCheckBox);
    // jGetPatientCountCheckBox.setBounds(5, 50, 110, 15);

    // jGetPatientSetCheckBox.setText("Patient Set");
    // jGetPatientSetCheckBox.setBorder(javax.swing.BorderFactory
    // .createEmptyBorder(0, 0, 0, 0));
    // jGetPatientSetCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
    // jOptionsPanel.add(jGetPatientSetCheckBox);
    // jGetPatientSetCheckBox.setBounds(10, 80, 80, 15);

    // jOptionsScrollPane.setViewportView(jOptionsPanel);

    add(jOptionsPanel);
    jOptionsPanel.setBounds(500, 30, 120, 120);

    jTimingLabel.setText("Query Timing");
    // jAnalysisLabel.setBackground(Color.WHITE);
    // jAnalysisLabel.setOpaque(true);
    jTimingLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
    jTimingLabel.setBounds(2, 2, 120, 23);
    jTimingLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jTimingLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    add(jTimingLabel);
    jTimingLabel.setBounds(500, 30, 120, 120);

    add(jTimingPanel);
    jTimingPanel.setBounds(500, 122, 120, 70);

    /*
     * jDeleteButton.setText("Delete"); jDeleteButton.addActionListener(new
     * java.awt.event.ActionListener() { public void
     * actionPerformed(java.awt.event.ActionEvent evt) {
     * jDeleteButtonActionPerformed(evt); } });
     * 
     * jVisitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new
     * String[] { "Groups don't have to occur in the same visit", "Groups
     * must all occur in the same visit" })); add(jVisitComboBox);
     * jVisitComboBox.setBounds(20, 40, 240, 22);
     * 
     * //add(jDeleteButton); //jDeleteButton.setBounds(20, 10, 65, 23);
     * 
     * add(jScrollPane1); jScrollPane1.setBounds(20, 70, 170, 320);
     * 
     * jRunQueryButton.setText("Run Query");
     * jRunQueryButton.addActionListener(new java.awt.event.ActionListener()
     * { public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRunQueryButtonActionPerformed(evt); } });
     * 
     * add(jRunQueryButton); jRunQueryButton.setBounds(20, 10, 87, 23);
     * 
     * jCancelButton.setText("Remove All");
     * jCancelButton.addActionListener(new java.awt.event.ActionListener() {
     * public void actionPerformed(java.awt.event.ActionEvent evt) {
     * jRemoveAllButtonActionPerformed(evt); } });
     * 
     * add(jCancelButton); jCancelButton.setBounds(115, 10, 90, 23);
     * 
     * //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.
     * ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
     * jPanel1.setLayout(null);
     * jScrollPane4.getHorizontalScrollBar().setUnitIncrement(20);
     * //jPanel1.setVisible(false);
     * 
     * //jScrollPane1.setToolTipText("scrollpane 1");
     * jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 170, 350);
     * 
     * jPanel1.add(jScrollPane2); jScrollPane2.setBounds(210, 0, 170, 350);
     */

    jAndOrLabel1.setBackground(new java.awt.Color(255, 255, 255));
    jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel1.setText("and");
    jAndOrLabel1.setToolTipText("Click to change the relationship");
    jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel1MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel1);

    jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jAndOrLabel2.setText("and");
    jAndOrLabel2.setToolTipText("Click to change the relationship");
    jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jAndOrLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            jAndOrLabel2MouseClicked(evt);
        }
    });

    // jPanel1.add(jAndOrLabel2);
    // jTree1.addTreeWillExpandListener(this);
    // jTree1.addTreeExpansionListener(this);
    // jScrollPane1.setViewportView(new QueryConceptTreePanel("Group 1"));
    // jScrollPane1.setToolTipText("Double click on a folder to view the
    // items inside");
    // jTree2.addTreeExpansionListener(this);
    // jScrollPane2.setViewportView(new QueryConceptTreePanel("Group 2"));
    // jTree3.addTreeExpansionListener(this);
    // treepanel = new QueryConceptTreePanel("", this);
    // jScrollPane3.setViewportView(new QueryConceptTreePanel("Group 3"));
    // jSlider1.setMajorTickSpacing(20);
    /*
     * jSlider1.setPaintTicks(true); jSlider1.setValue(0);
     * jSlider1.setMinorTickSpacing(10); jSlider1.setToolTipText("Slider on
     * left is more Sensitive Query, " + "on right is more Specific");
     * add(jSlider1); jSlider1.setBounds(380, 40, 140, 18);
     * 
     * //jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
     * jLabel1.setText("Sensitivity <"); add(jLabel1);
     * jLabel1.setBounds(290, 40, 80, 20);
     * 
     * //jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
     * jLabel2.setText("> Specificity"); add(jLabel2);
     * jLabel2.setBounds(525, 40, 70, 20);
     */

    dataModel.addPanel(jScrollPane1, null, 0);
    dataModel.addPanel(jScrollPane2, jAndOrLabel1, 0);
    dataModel.addPanel(jScrollPane3, jAndOrLabel2, 555);
}

From source file:com.frostwire.gui.bittorrent.PartialFilesDialog.java

private void setupTitle() {
    GridBagConstraints c;// w  w  w.j a  v  a2s.c  o  m

    String title = _torrent.getUTF8Name();
    if (title == null) {
        if (_torrent.getName() != null) {
            title = StringUtils.getUTF8String(_torrent.getName());
        } else {
            title = _name.replace("_", " ").replace(".torrent", "").replace("&quot;", "\"");
        }
    }
    labelTitle = new JLabel(title);
    labelTitle.setFont(new Font("Dialog", Font.BOLD, 18));
    labelTitle.setHorizontalAlignment(SwingConstants.LEFT);
    c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 2;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.WEST;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1.0;
    c.insets = new Insets(5, 5, 5, 5);
    panel.add(labelTitle, c);
}