Example usage for javax.swing SwingConstants VERTICAL

List of usage examples for javax.swing SwingConstants VERTICAL

Introduction

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

Prototype

int VERTICAL

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

Click Source Link

Document

Vertical orientation.

Usage

From source file:com.willwinder.ugs.nbp.setupwizard.panels.WizardPanelStepCalibration.java

private void addHeaderRow(JPanel panel) {
    Font labelHeaderFont = new Font(Font.SANS_SERIF, Font.BOLD, 16);
    JLabel headerLabel = new JLabel(Localization.getString("platform.plugin.setupwizard.move"), JLabel.CENTER);
    headerLabel.setFont(labelHeaderFont);
    panel.add(headerLabel, "growx, spanx 3, gapbottom 5, gaptop 7");
    panel.add(new JSeparator(SwingConstants.VERTICAL), "spany 5, gapleft 5, gapright 5, wmin 10, grow");

    headerLabel = new JLabel(Localization.getString("platform.plugin.setupwizard.measure"), JLabel.CENTER);
    headerLabel.setFont(labelHeaderFont);
    panel.add(headerLabel, "growx, spanx 2, gapbottom 5, gaptop 7");
    panel.add(new JSeparator(SwingConstants.VERTICAL), "spany 5, gapleft 5, gapright 5, wmin 10, grow");

    headerLabel = new JLabel(Localization.getString("platform.plugin.setupwizard.calibrate"), JLabel.CENTER);
    headerLabel.setFont(labelHeaderFont);
    panel.add(headerLabel, "growx, spanx 3, wrap, gapbottom 5, gaptop 7");
}

From source file:strobe.spectroscopy.StrobeSpectroscopy.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from w w w. j a v a  2  s  .c  o m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    //        initListOfCOMports();
    stepper.initSerial();

    fileChooser = new javax.swing.JFileChooser();
    graphPanel = new javax.swing.JPanel();
    controlPanel = new javax.swing.JPanel();
    btnStart = new javax.swing.JButton();
    btnPause = new javax.swing.JButton();
    btnStop = new javax.swing.JButton();
    spr1 = new javax.swing.JSeparator();
    tbtnBackward = new javax.swing.JToggleButton();
    tbtnForward = new javax.swing.JToggleButton();
    spr2 = new javax.swing.JSeparator();
    jPanel1 = new javax.swing.JPanel();
    cBoxSpeed = new javax.swing.JComboBox<>();
    spr4 = new javax.swing.JSeparator();
    cBoxResolution = new javax.swing.JComboBox<>();
    spr3 = new javax.swing.JSeparator();
    cBoxFromWavelength = new javax.swing.JComboBox<>();
    cBoxToWavelength = new javax.swing.JComboBox<>();
    spr5 = new javax.swing.JSeparator();
    btnSetZero = new javax.swing.JButton();
    btnSetMark = new javax.swing.JButton();
    strobeMenuBar = new javax.swing.JMenuBar();
    menuFile = new javax.swing.JMenu();
    menuFileOpen = new javax.swing.JMenuItem();
    menuFileSave = new javax.swing.JMenuItem();
    menuFileExit = new javax.swing.JMenuItem();
    settingMenu = new javax.swing.JMenu();
    menuAbout = new javax.swing.JMenu();
    menuAboutAbout = new javax.swing.JMenuItem();

    fileChooser.setAcceptAllFileFilterUsed(false);

    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setTitle("Strobe-spectroscopy");
    setIconImage(new javax.swing.ImageIcon(getClass().getResource("/icons/iconFrame.png")).getImage());
    setLocationByPlatform(true);
    setMinimumSize(new java.awt.Dimension(800, 550));
    setName("strobeFrame"); // NOI18N
    setPreferredSize(new java.awt.Dimension(800, 550));

    controlPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)));
    controlPanel.setLayout(new javax.swing.BoxLayout(controlPanel, javax.swing.BoxLayout.X_AXIS));

    btnStart.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconStart.png"))); // NOI18N
    btnStart.setToolTipText("Start measurement");
    btnStart.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnStartActionPerformed(evt);
        }
    });
    controlPanel.add(btnStart);

    btnPause.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconPause.png"))); // NOI18N
    btnPause.setToolTipText("Pause measurement");
    btnPause.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnPauseActionPerformed(evt);
        }
    });
    controlPanel.add(btnPause);

    btnStop.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconStop.png"))); // NOI18N
    btnStop.setToolTipText("Stop measurement");
    btnStop.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnStopActionPerformed(evt);
        }
    });
    controlPanel.add(btnStop);

    spr1.setForeground(new java.awt.Color(255, 255, 255));
    spr1.setOrientation(javax.swing.SwingConstants.VERTICAL);
    spr1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    spr1.setMaximumSize(new java.awt.Dimension(5, 0));
    spr1.setPreferredSize(new java.awt.Dimension(5, 0));
    spr1.setRequestFocusEnabled(false);
    controlPanel.add(spr1);
    spr1.getAccessibleContext().setAccessibleDescription("");

    tbtnBackward.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconBackward.png"))); // NOI18N
    tbtnBackward.setToolTipText("Backwar spinning of the driver, while pressed.");
    tbtnBackward.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            tbtnBackwardActionPerformed(evt);
        }
    });
    controlPanel.add(tbtnBackward);

    tbtnForward.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/iconForward.png"))); // NOI18N
    tbtnForward.setToolTipText("Forward spinning of the drive, while pressed.");
    tbtnForward.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            tbtnForwardActionPerformed(evt);
        }
    });
    controlPanel.add(tbtnForward);

    spr2.setForeground(new java.awt.Color(255, 255, 255));
    spr2.setOrientation(javax.swing.SwingConstants.VERTICAL);
    spr2.setAlignmentX(1.0F);
    spr2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    spr2.setMaximumSize(new java.awt.Dimension(5, 0));
    spr2.setPreferredSize(new java.awt.Dimension(5, 0));
    spr2.setRequestFocusEnabled(false);
    controlPanel.add(spr2);

    jPanel1.setLayout(new javax.swing.BoxLayout(jPanel1, javax.swing.BoxLayout.LINE_AXIS));

    cBoxSpeed.setToolTipText("");
    cBoxSpeed.setMinimumSize(new java.awt.Dimension(50, 20));
    cBoxSpeed.setPreferredSize(new java.awt.Dimension(50, 20));
    jPanel1.add(cBoxSpeed);

    spr4.setForeground(new java.awt.Color(255, 255, 255));
    spr4.setOrientation(javax.swing.SwingConstants.VERTICAL);
    spr4.setAlignmentX(1.0F);
    spr4.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    spr4.setMaximumSize(new java.awt.Dimension(5, 0));
    spr4.setPreferredSize(new java.awt.Dimension(5, 0));
    spr4.setRequestFocusEnabled(false);
    jPanel1.add(spr4);

    cBoxResolution.setAutoscrolls(true);
    cBoxResolution.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    cBoxResolution.setMinimumSize(new java.awt.Dimension(50, 20));
    cBoxResolution.setPreferredSize(new java.awt.Dimension(50, 20));
    cBoxResolution.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cBoxResolutionActionPerformed(evt);
        }
    });
    jPanel1.add(cBoxResolution);

    controlPanel.add(jPanel1);

    spr3.setForeground(new java.awt.Color(255, 255, 255));
    spr3.setOrientation(javax.swing.SwingConstants.VERTICAL);
    spr3.setAlignmentX(1.0F);
    spr3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    spr3.setMaximumSize(new java.awt.Dimension(5, 0));
    spr3.setPreferredSize(new java.awt.Dimension(5, 0));
    spr3.setRequestFocusEnabled(false);
    controlPanel.add(spr3);

    cBoxFromWavelength.setEditable(true);
    cBoxFromWavelength.setAutoscrolls(true);
    controlPanel.add(cBoxFromWavelength);

    cBoxToWavelength.setEditable(true);
    cBoxToWavelength.setAutoscrolls(true);
    cBoxToWavelength.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cBoxToWavelengthActionPerformed(evt);
        }
    });
    controlPanel.add(cBoxToWavelength);

    spr5.setForeground(new java.awt.Color(255, 255, 255));
    spr5.setOrientation(javax.swing.SwingConstants.VERTICAL);
    spr5.setAlignmentX(1.0F);
    spr5.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    spr5.setMaximumSize(new java.awt.Dimension(5, 0));
    spr5.setPreferredSize(new java.awt.Dimension(5, 0));
    spr5.setRequestFocusEnabled(false);
    controlPanel.add(spr5);

    btnSetZero.setText("Set zero");
    btnSetZero.setToolTipText("Set zero imput signal level to subtract thermal noise");
    btnSetZero.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSetZeroActionPerformed(evt);
        }
    });
    controlPanel.add(btnSetZero);

    btnSetMark.setText("Mark");
    btnSetMark.setToolTipText("Set a mark on the input graph");
    btnSetMark.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSetMarkActionPerformed(evt);
        }
    });
    controlPanel.add(btnSetMark);

    getContentPane().add(controlPanel, java.awt.BorderLayout.SOUTH);

    menuFile.setText("File");
    menuFile.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuFileActionPerformed(evt);
        }
    });

    menuFileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,
            java.awt.event.InputEvent.CTRL_MASK));
    menuFileOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/open.png"))); // NOI18N
    menuFileOpen.setText("Open");
    menuFileOpen.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuFileOpenActionPerformed(evt);
        }
    });
    menuFile.add(menuFileOpen);

    menuFileSave.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            java.awt.event.InputEvent.CTRL_MASK));
    menuFileSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/save.png"))); // NOI18N
    menuFileSave.setText("Save");
    menuFileSave.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuFileSaveActionPerformed(evt);
        }
    });
    menuFile.add(menuFileSave);

    menuFileExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.CTRL_MASK));
    menuFileExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/close.png"))); // NOI18N
    menuFileExit.setText("Exit");
    menuFileExit.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuFileExitActionPerformed(evt);
        }
    });
    menuFile.add(menuFileExit);

    strobeMenuBar.add(menuFile);

    settingMenu.setText("Settings");
    strobeMenuBar.add(settingMenu);

    menuAbout.setText("About");

    menuAboutAbout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/info.png"))); // NOI18N
    menuAboutAbout.setText("About");
    menuAboutAbout.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuAboutAboutActionPerformed(evt);
        }
    });
    menuAbout.add(menuAboutAbout);

    //chartPanel.setPreferredSize( new java.awt.Dimension(graphPanel.getMinimumSize()));

    chartPanel.setMaximumSize(new Dimension(3000, 2000));
    graphPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Spectrum"));

    graphPanel.add(chartPanel);
    graphPanel.setLayout(new GridLayout(0, 1));
    getContentPane().add(graphPanel, java.awt.BorderLayout.CENTER);

    chartRenderer.setSeriesPaint(0, Color.RED);
    chartRenderer.setSeriesStroke(0, new BasicStroke(2.0f));
    plot.setRenderer(chartRenderer);
    plot.datasetChanged(new DatasetChangeEvent(graphChart, dataSet));
    marker.setPaint(Color.red);
    plot.addDomainMarker(marker);

    strobeMenuBar.add(menuAbout);

    setJMenuBar(strobeMenuBar);

    pack();
}

From source file:org.jfree.demo.DrawStringDemo.java

/**
 * Creates the content for tab 2.//from w ww  .  ja va 2  s  . c om
 *
 * @return The content panel.
 */
private JPanel createTab2Content() {
    JPanel content = new JPanel(new BorderLayout());
    JPanel controls = new JPanel();
    controls.add(new JLabel("Text anchor: "));
    this.combo2 = new JComboBox();
    populateTextAnchorCombo(this.combo2);
    this.combo2.setActionCommand("combo2.changed");
    this.combo2.addActionListener(this);
    controls.add(this.combo2);
    controls.add(new JLabel("Rotation anchor: "));
    this.combo3 = new JComboBox();
    populateTextAnchorCombo(this.combo3);
    this.combo3.setActionCommand("combo3.changed");
    this.combo3.addActionListener(this);
    controls.add(this.combo3);
    this.slider = new JSlider(SwingConstants.VERTICAL, 0, 360, 0);
    this.slider.setMajorTickSpacing(45);
    this.slider.setMinorTickSpacing(5);
    this.slider.setPaintLabels(true);
    this.slider.setPaintTicks(true);
    this.slider.setPaintTrack(true);
    this.slider.addChangeListener(this);
    content.add(controls, BorderLayout.NORTH);
    content.add(this.slider, BorderLayout.WEST);
    this.drawStringPanel2 = new DrawStringPanel("Rotated Text", true);
    content.add(this.drawStringPanel2);
    return content;
}

From source file:net.sf.jabref.gui.PreviewPanel.java

private JToolBar createToolBar() {
    JToolBar toolBar = new OSXCompatibleToolbar(SwingConstants.VERTICAL);
    toolBar.setMargin(new Insets(0, 0, 0, 2));
    toolBar.setFloatable(false);//from  w  w w .  j  a va  2s.co  m

    // Add actions (and thus buttons)
    toolBar.add(this.closeAction);
    toolBar.addSeparator();
    toolBar.add(this.copyPreviewAction);
    toolBar.addSeparator();
    toolBar.add(this.printAction);

    Component[] comps = toolBar.getComponents();

    for (Component comp : comps) {
        ((JComponent) comp).setOpaque(false);
    }

    return toolBar;
}

From source file:net.sf.jabref.gui.preftabs.TableColumnsTab.java

/**
 * Customization of external program paths.
 *
 * @param prefs a <code>JabRefPreferences</code> value
 *//*from w  ww  .  j  a  va 2  s  .c o  m*/
public TableColumnsTab(JabRefPreferences prefs, JabRefFrame frame) {
    this.prefs = prefs;
    this.frame = frame;
    setLayout(new BorderLayout());

    TableModel tm = new AbstractTableModel() {

        @Override
        public int getRowCount() {
            return rowCount;
        }

        @Override
        public int getColumnCount() {
            return 2;
        }

        @Override
        public Object getValueAt(int row, int column) {
            int internalRow = row;
            if (internalRow == 0) {
                return column == 0 ? InternalBibtexFields.NUMBER_COL : String.valueOf(ncWidth);
            }
            internalRow--;
            if (internalRow >= tableRows.size()) {
                return "";
            }
            Object rowContent = tableRows.get(internalRow);
            if (rowContent == null) {
                return "";
            }
            TableRow tr = (TableRow) rowContent;
            // Only two columns
            if (column == 0) {
                return tr.getName();
            } else {
                return tr.getLength() > 0 ? Integer.toString(tr.getLength()) : "";
            }
        }

        @Override
        public String getColumnName(int col) {
            return col == 0 ? Localization.lang("Field name") : Localization.lang("Column width");
        }

        @Override
        public Class<?> getColumnClass(int column) {
            if (column == 0) {
                return String.class;
            }
            return Integer.class;
        }

        @Override
        public boolean isCellEditable(int row, int col) {
            return !((row == 0) && (col == 0));
        }

        @Override
        public void setValueAt(Object value, int row, int col) {
            tableChanged = true;
            // Make sure the vector is long enough.
            while (row >= tableRows.size()) {
                tableRows.add(new TableRow("", -1));
            }

            if ((row == 0) && (col == 1)) {
                ncWidth = Integer.parseInt(value.toString());
                return;
            }

            TableRow rowContent = tableRows.get(row - 1);

            if (col == 0) {
                rowContent.setName(value.toString());
                if ("".equals(getValueAt(row, 1))) {
                    setValueAt(String.valueOf(BibtexSingleField.DEFAULT_FIELD_LENGTH), row, 1);
                }
            } else {
                if (value == null) {
                    rowContent.setLength(-1);
                } else {
                    rowContent.setLength(Integer.parseInt(value.toString()));
                }
            }
        }

    };

    colSetup = new JTable(tm);
    TableColumnModel cm = colSetup.getColumnModel();
    cm.getColumn(0).setPreferredWidth(140);
    cm.getColumn(1).setPreferredWidth(80);

    FormLayout layout = new FormLayout("1dlu, 8dlu, left:pref, 4dlu, fill:pref", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    JPanel pan = new JPanel();
    JPanel tabPanel = new JPanel();
    tabPanel.setLayout(new BorderLayout());
    JScrollPane sp = new JScrollPane(colSetup, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    colSetup.setPreferredScrollableViewportSize(new Dimension(250, 200));
    sp.setMinimumSize(new Dimension(250, 300));
    tabPanel.add(sp, BorderLayout.CENTER);
    JToolBar toolBar = new OSXCompatibleToolbar(SwingConstants.VERTICAL);
    toolBar.setFloatable(false);
    AddRowAction addRow = new AddRowAction();
    DeleteRowAction deleteRow = new DeleteRowAction();
    MoveRowUpAction moveUp = new MoveRowUpAction();
    MoveRowDownAction moveDown = new MoveRowDownAction();
    toolBar.setBorder(null);
    toolBar.add(addRow);
    toolBar.add(deleteRow);
    toolBar.addSeparator();
    toolBar.add(moveUp);
    toolBar.add(moveDown);
    tabPanel.add(toolBar, BorderLayout.EAST);

    fileColumn = new JCheckBox(Localization.lang("Show file column"));
    urlColumn = new JCheckBox(Localization.lang("Show URL/DOI column"));
    preferUrl = new JRadioButton(Localization.lang("Show URL first"));
    preferDoi = new JRadioButton(Localization.lang("Show DOI first"));
    ButtonGroup preferUrlDoiGroup = new ButtonGroup();
    preferUrlDoiGroup.add(preferUrl);
    preferUrlDoiGroup.add(preferDoi);

    urlColumn.addChangeListener(arg0 -> {
        preferUrl.setEnabled(urlColumn.isSelected());
        preferDoi.setEnabled(urlColumn.isSelected());
    });
    arxivColumn = new JCheckBox(Localization.lang("Show ArXiv column"));

    Collection<ExternalFileType> fileTypes = ExternalFileTypes.getInstance().getExternalFileTypeSelection();
    String[] fileTypeNames = new String[fileTypes.size()];
    int i = 0;
    for (ExternalFileType fileType : fileTypes) {
        fileTypeNames[i++] = fileType.getName();
    }
    listOfFileColumns = new JList<>(fileTypeNames);
    JScrollPane listOfFileColumnsScrollPane = new JScrollPane(listOfFileColumns);
    listOfFileColumns.setVisibleRowCount(3);
    extraFileColumns = new JCheckBox(Localization.lang("Show extra columns"));
    extraFileColumns.addChangeListener(arg0 -> listOfFileColumns.setEnabled(extraFileColumns.isSelected()));

    /*** begin: special table columns and special fields ***/

    JButton helpButton = new HelpAction(Localization.lang("Help on special fields"), HelpFile.SPECIAL_FIELDS)
            .getHelpButton();

    rankingColumn = new JCheckBox(Localization.lang("Show rank"));
    qualityColumn = new JCheckBox(Localization.lang("Show quality"));
    priorityColumn = new JCheckBox(Localization.lang("Show priority"));
    relevanceColumn = new JCheckBox(Localization.lang("Show relevance"));
    printedColumn = new JCheckBox(Localization.lang("Show printed status"));
    readStatusColumn = new JCheckBox(Localization.lang("Show read status"));

    // "sync keywords" and "write special" fields may be configured mutually exclusive only
    // The implementation supports all combinations (TRUE+TRUE and FALSE+FALSE, even if the latter does not make sense)
    // To avoid confusion, we opted to make the setting mutually exclusive
    syncKeywords = new JRadioButton(Localization.lang("Synchronize with keywords"));
    writeSpecialFields = new JRadioButton(
            Localization.lang("Write values of special fields as separate fields to BibTeX"));
    ButtonGroup group = new ButtonGroup();
    group.add(syncKeywords);
    group.add(writeSpecialFields);

    specialFieldsEnabled = new JCheckBox(Localization.lang("Enable special fields"));
    specialFieldsEnabled.addChangeListener(event -> {
        boolean isEnabled = specialFieldsEnabled.isSelected();
        rankingColumn.setEnabled(isEnabled);
        qualityColumn.setEnabled(isEnabled);
        priorityColumn.setEnabled(isEnabled);
        relevanceColumn.setEnabled(isEnabled);
        printedColumn.setEnabled(isEnabled);
        readStatusColumn.setEnabled(isEnabled);
        syncKeywords.setEnabled(isEnabled);
        writeSpecialFields.setEnabled(isEnabled);
    });

    builder.appendSeparator(Localization.lang("Special table columns"));
    builder.nextLine();
    builder.append(pan);

    DefaultFormBuilder specialTableColumnsBuilder = new DefaultFormBuilder(
            new FormLayout("8dlu, 8dlu, 8cm, 8dlu, 8dlu, left:pref:grow",
                    "pref, pref, pref, pref, pref, pref, pref, pref, pref, pref, pref, pref, pref"));
    CellConstraints cc = new CellConstraints();

    specialTableColumnsBuilder.add(specialFieldsEnabled, cc.xyw(1, 1, 3));
    specialTableColumnsBuilder.add(rankingColumn, cc.xyw(2, 2, 2));
    specialTableColumnsBuilder.add(relevanceColumn, cc.xyw(2, 3, 2));
    specialTableColumnsBuilder.add(qualityColumn, cc.xyw(2, 4, 2));
    specialTableColumnsBuilder.add(priorityColumn, cc.xyw(2, 5, 2));
    specialTableColumnsBuilder.add(printedColumn, cc.xyw(2, 6, 2));
    specialTableColumnsBuilder.add(readStatusColumn, cc.xyw(2, 7, 2));
    specialTableColumnsBuilder.add(syncKeywords, cc.xyw(2, 10, 2));
    specialTableColumnsBuilder.add(writeSpecialFields, cc.xyw(2, 11, 2));
    specialTableColumnsBuilder.add(helpButton, cc.xyw(1, 12, 2));

    specialTableColumnsBuilder.add(fileColumn, cc.xyw(5, 1, 2));
    specialTableColumnsBuilder.add(urlColumn, cc.xyw(5, 2, 2));
    specialTableColumnsBuilder.add(preferUrl, cc.xy(6, 3));
    specialTableColumnsBuilder.add(preferDoi, cc.xy(6, 4));
    specialTableColumnsBuilder.add(arxivColumn, cc.xyw(5, 5, 2));

    specialTableColumnsBuilder.add(extraFileColumns, cc.xyw(5, 6, 2));
    specialTableColumnsBuilder.add(listOfFileColumnsScrollPane, cc.xywh(5, 7, 2, 6));

    builder.append(specialTableColumnsBuilder.getPanel());
    builder.nextLine();

    /*** end: special table columns and special fields ***/

    builder.appendSeparator(Localization.lang("Entry table columns"));
    builder.nextLine();
    builder.append(pan);
    builder.append(tabPanel);
    builder.nextLine();
    builder.append(pan);
    JButton buttonWidth = new JButton(new UpdateWidthsAction());
    JButton buttonOrder = new JButton(new UpdateOrderAction());
    builder.append(buttonWidth);
    builder.nextLine();
    builder.append(pan);
    builder.append(buttonOrder);
    builder.nextLine();
    builder.append(pan);
    builder.nextLine();
    pan = builder.getPanel();
    pan.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    add(pan, BorderLayout.CENTER);
}

From source file:com.diversityarrays.kdxplore.curate.MarkerPanelManager.java

public MarkerPanelManager(Trial trial, CurationTableModel curationTableModel, JTable curationTable,
        TitledTablePanelWithResizeControls curationTablePanel, Transformer<TraitInstance, Color> ticp,
        CurationTableSelectionModel ctsm) {
    this.table = curationTable;
    this.curationTableModel = curationTableModel;
    this.traitInstanceColorProvider = ticp;
    this.curationTableSelectionModel = ctsm;

    traitNameStyle = trial.getTraitNameStyle();

    curationTablePanel.scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);

    markerPanel = new MarkerPanel(curationTablePanel.scrollPane, SwingConstants.VERTICAL);
    Component corner = curationTablePanel.scrollPane.getCorner(JScrollPane.UPPER_RIGHT_CORNER);
    if (corner != null) {
        markerPanel.setHeaderComponent(corner);
    }/*from w  ww  .j  av a  2s. c  om*/

    markerPanel.addMarkerMouseClickHandler(mmch);

    // Initialise the table selection marker
    Color selfill = curationTable.getSelectionBackground();

    tableSelectionMarkerGroup = new TableSelectionMarkerGroup(curationTable, selfill);
    markerGroups.add(tableSelectionMarkerGroup);
    markerPanel.addMarkerGroup(tableSelectionMarkerGroup);

    // Then amend the UI
    curationTablePanel.add(markerPanel, BorderLayout.EAST);

    curationTableModel.addPropertyChangeListener(CurationTableModel.PROPERTY_TRAIT_INSTANCES,
            traitInstancesPropertyChangeListener);

    curationTableSelectionModel.addChangeListener(selectionChangeListener);
}

From source file:com.projity.pm.graphic.chart.TimeChartPanel.java

public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) {
    return (orientation == SwingConstants.VERTICAL) ? visibleRect.height : visibleRect.width;
}

From source file:ar.edu.uns.cs.vyglab.arq.rockar.gui.JFrameControlPanel.java

private void initGUI() {
    try {//  w w  w .j  av  a  2 s.  c  om
        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        this.setIconImage(new ImageIcon(getClass().getClassLoader()
                .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/splash/purple-monkey32.png"))
                        .getImage());
        this.setTitle("Rock.AR v2.0");
        this.addComponentListener(new ComponentAdapter() {
            public void componentResized(ComponentEvent evt) {
                thisComponentResized(evt);
            }
        });
        this.addWindowListener(new WindowAdapter() {
            public void windowClosed(WindowEvent evt) {
                thisWindowClosed(evt);
            }
        });
        {
            jPanelSouth = new JPanel();
            BorderLayout jPanelSouthLayout = new BorderLayout();
            getContentPane().add(jPanelSouth, BorderLayout.SOUTH);
            jPanelSouth.setLayout(jPanelSouthLayout);
            {
                jLabelInformation = new JLabel();
                jPanelSouth.add(jLabelInformation, BorderLayout.CENTER);
                jLabelInformation.setText(DataCenter.langResource.getString("control_information_label"));
                jLabelInformation.setOpaque(true);
                jLabelInformation.setBackground(new java.awt.Color(241, 191, 101));
            }
        }
        {
            jPanelCenter = new JPanel();
            GridLayout jPanelCenterLayout = new GridLayout(1, 1);
            jPanelCenterLayout.setHgap(5);
            jPanelCenterLayout.setVgap(5);
            jPanelCenterLayout.setColumns(1);
            getContentPane().add(jPanelCenter, BorderLayout.CENTER);
            jPanelCenter.setLayout(jPanelCenterLayout);
            {
                jPanelWest = new JPanel();
                BorderLayout jPanelWestLayout = new BorderLayout();
                jPanelCenter.add(jPanelWest);
                jPanelWest.setLayout(jPanelWestLayout);
                jPanelWest.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                {
                    jToolBarMineralTable = new JToolBar();
                    jToolBarMineralTable.setLayout(new FlowLayout(FlowLayout.LEFT));
                    jPanelWest.add(jToolBarMineralTable, BorderLayout.NORTH);
                    jToolBarMineralTable.setFloatable(false);
                    jToolBarMineralTable.setFocusable(false);
                    {
                        jButtonNew = new JButton();
                        jToolBarMineralTable.add(jButtonNew);
                        jButtonNew.setIcon(new ImageIcon(getClass().getClassLoader().getResource(
                                "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/Actions-tab-new-icon.png")));
                        jButtonNew.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                jButtonNewActionPerformed(evt);
                            }
                        });
                    }
                    {
                        jButtonOpen = new JButton();
                        jToolBarMineralTable.add(jButtonOpen);
                        jButtonOpen.setIcon(new ImageIcon(getClass().getClassLoader()
                                .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/open.png")));
                        jButtonOpen.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                jButtonOpenActionPerformed(evt);
                            }
                        });
                    }
                    {
                        jButtonSave = new JButton();
                        jToolBarMineralTable.add(jButtonSave);
                        jButtonSave.setIcon(new ImageIcon(getClass().getClassLoader()
                                .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/save.png")));
                        jButtonSave.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                jButtonSaveActionPerformed(evt);
                            }
                        });
                    }
                    {
                        jSeparator1 = new JSeparator();
                        jToolBarMineralTable.add(jSeparator1);
                        jSeparator1.setOrientation(SwingConstants.VERTICAL);
                        jSeparator1.setSize(5, 44);
                        jSeparator1.setPreferredSize(new java.awt.Dimension(5, 44));
                    }
                    {
                        jButtonAdd = new JButton();
                        jToolBarMineralTable.add(jButtonAdd);
                        jButtonAdd.setIcon(new ImageIcon(getClass().getClassLoader()
                                .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/add.png")));
                        jButtonAdd.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                jButtonAddActionPerformed(evt);
                            }
                        });
                    }
                    {
                        jButtonEdit = new JButton();
                        jToolBarMineralTable.add(jButtonEdit);
                        jButtonEdit.setIcon(new ImageIcon(getClass().getClassLoader()
                                .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/modify.png")));
                        jButtonEdit.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                jButtonEditActionPerformed(evt);
                            }
                        });
                    }
                    {
                        jButtonRemove = new JButton();
                        jToolBarMineralTable.add(jButtonRemove);
                        jButtonRemove.setIcon(new ImageIcon(getClass().getClassLoader()
                                .getResource("ar/edu/uns/cs/vyglab/arq/rockar/resources/images/remove.png")));
                        jButtonRemove.addActionListener(new ActionListener() {
                            public void actionPerformed(ActionEvent evt) {
                                jButtonRemoveActionPerformed(evt);
                            }
                        });
                    }
                }
                {
                    jLabelMineralTableInformation = new JLabel();
                    jPanelWest.add(jLabelMineralTableInformation, BorderLayout.SOUTH);
                    jLabelMineralTableInformation
                            .setText(DataCenter.langResource.getString("total_counted_table"));
                    jLabelMineralTableInformation.setHorizontalAlignment(SwingConstants.LEFT);
                    jLabelMineralTableInformation.setBackground(new java.awt.Color(255, 212, 133));
                    jLabelMineralTableInformation.setOpaque(true);
                }
                {
                    jScrollPaneMineralTable = new JScrollPane();
                    jPanelWest.add(jScrollPaneMineralTable, BorderLayout.CENTER);
                    {
                        jTableMineralsModel = new RockTableModel(
                                new String[] { DataCenter.langResource.getString("keyvalue_table"),
                                        DataCenter.langResource.getString("name_table"),
                                        DataCenter.langResource.getString("color_table"),
                                        DataCenter.langResource.getString("counted_table"),
                                        DataCenter.langResource.getString("area_table") },
                                0);
                        //                     jTableMineralsModel.addRow(new Object[] {
                        //                           0, "x?", Color.gray, 0,
                        //                           "0.00" });
                        jTableMinerals = new JReadOnlyTable();
                        jScrollPaneMineralTable.setViewportView(jTableMinerals);
                        jTableMinerals.setModel(jTableMineralsModel);
                        jTableMinerals.setDefaultRenderer(Color.class, new ColorRenderer(true));
                        TableCellRenderer centerRenderer = new CenterRenderer();
                        TableColumn column = jTableMinerals.getColumnModel().getColumn(0);
                        column.setCellRenderer(centerRenderer);
                        column = jTableMinerals.getColumnModel().getColumn(1);
                        column.setCellRenderer(centerRenderer);
                        column = jTableMinerals.getColumnModel().getColumn(3);
                        column.setCellRenderer(centerRenderer);
                        column = jTableMinerals.getColumnModel().getColumn(4);
                        column.setCellRenderer(centerRenderer);

                    }
                }
            }
            {
                jPanelEast = new JPanel();
                jPanelCenter.add(jPanelEast);
                GridLayout jPanelEastLayout = new GridLayout(2, 1);
                jPanelEastLayout.setHgap(5);
                jPanelEastLayout.setVgap(5);
                jPanelEastLayout.setColumns(1);
                jPanelEast.setLayout(jPanelEastLayout);
                {
                    jPanelTop = new JPanel();
                    BorderLayout jPanelTopLayout = new BorderLayout();
                    jPanelEast.add(jPanelTop);
                    jPanelTop.setLayout(jPanelTopLayout);
                    jPanelTop.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                    {
                        jToolBarStats = new JToolBar();
                        jPanelTop.add(jToolBarStats, BorderLayout.NORTH);
                        jToolBarStats.setFloatable(false);
                        jToolBarStats.setFocusable(false);
                        {
                            jButtonExportStats = new JButton();
                            jButtonExportStats.addActionListener(new ActionListener() {
                                public void actionPerformed(ActionEvent arg0) {
                                    saveChartAsImage();
                                }
                            });
                            //jToolBarStats.add(jButtonExportStats);
                            jButtonExportStats.setIcon(new ImageIcon(getClass().getClassLoader().getResource(
                                    "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/export-graph.png")));
                        }
                        {
                            jButtonExportExcel = new JButton();
                            //jToolBarStats.add(jButtonExportExcel);
                            //jToolBarMineralTable.add(jButtonExportExcel);
                            jButtonExportExcel.setIcon(new ImageIcon(getClass().getClassLoader().getResource(
                                    "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/excel-icon.png")));
                            jButtonExportExcel.addActionListener(new ActionListener() {
                                public void actionPerformed(ActionEvent arg0) {
                                    exportToExcel();
                                }
                            });
                        }
                        {
                            jButtonExportAll = new JButton();
                            //jToolBarStats.add(jButtonExportAll);
                            jButtonExportAll.setIcon(new ImageIcon(getClass().getClassLoader().getResource(
                                    "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/Mimetypes-application-vnd-ms-excel-icon.png")));
                        }
                    }
                    {

                    }
                }
                {
                    jPanelBottom = new JPanel();
                    BorderLayout jPanelBottomLayout = new BorderLayout();
                    jPanelEast.add(jPanelBottom);
                    jPanelBottom.setLayout(jPanelBottomLayout);
                    jPanelBottom.setBorder(new LineBorder(new java.awt.Color(0, 0, 0), 1, false));
                    {
                        jToolBarOverview = new JToolBar();
                        jPanelBottom.add(jToolBarOverview, BorderLayout.NORTH);
                        jToolBarOverview.setFloatable(false);
                        jToolBarOverview.setFocusable(false);
                        {
                            jButtonExportOverview = new JButton();
                            jToolBarOverview.add(jButtonExportOverview);
                            jButtonExportOverview.setIcon(new ImageIcon(getClass().getClassLoader().getResource(
                                    "ar/edu/uns/cs/vyglab/arq/rockar/resources/images/export-graph.png")));
                            jButtonExportOverview.addActionListener(new ActionListener() {
                                public void actionPerformed(ActionEvent arg0) {
                                    exportOverview();
                                }
                            });
                        }
                    }
                    {
                        jPanelOverviewContent = new JPanel();
                        jPanelBottom.add(jPanelOverviewContent, BorderLayout.CENTER);
                        jPanelOverviewContent.setLayout(new GridBagLayout());
                        this.jLabelOverview = new JLabel();
                        jPanelOverviewContent.add(this.jLabelOverview);
                    }
                }
            }
        }
        pack();
        this.setSize(800, 600);
    } catch (Exception e) {
        //add your error handling code here
        e.printStackTrace();
    }
}

From source file:esmska.gui.AboutFrame.java

/** This method is called from within the constructor to
 * initialize the form./*  w w  w .ja  v  a 2 s.co 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() {

    jLabel1 = new JLabel();
    jLabel2 = new JLabel();
    jLabel3 = new JLabel();
    creditsButton = new JButton();
    closeButton = new JButton();
    licenseButton = new JButton();
    jLabel5 = new JLabel();
    jLabel4 = new JLabel();
    jLabel6 = new JLabel();
    jLabel7 = new JLabel();
    jLabel8 = new JLabel();
    homeHyperlink = new JXHyperlink();
    supportHyperlink = new JXHyperlink();

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    ResourceBundle bundle = ResourceBundle.getBundle("esmska/resources/l10n"); // NOI18N
    setTitle(bundle.getString("AboutFrame.title")); // NOI18N
    setLocationByPlatform(true);

    jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel1.setIcon(new ImageIcon(getClass().getResource("/esmska/resources/esmska.png"))); // NOI18N
    jLabel1.setFocusable(false);

    jLabel2.setFont(jLabel2.getFont().deriveFont(jLabel2.getFont().getStyle() | Font.BOLD,
            jLabel2.getFont().getSize() + 22));
    jLabel2.setHorizontalAlignment(SwingConstants.CENTER);
    Mnemonics.setLocalizedText(jLabel2, "Esmska " + config.getLatestVersion());
    jLabel2.setFocusable(false);

    jLabel3.setHorizontalAlignment(SwingConstants.CENTER);
    Mnemonics.setLocalizedText(jLabel3, bundle.getString("AboutFrame.jLabel3.text")); // NOI18N
    jLabel3.setFocusable(false);

    creditsButton.setIcon(new ImageIcon(getClass().getResource("/esmska/resources/about-22.png"))); // NOI18N
    Mnemonics.setLocalizedText(creditsButton, bundle.getString("AboutFrame.creditsButton.text"));
    creditsButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            creditsButtonActionPerformed(evt);
        }
    });

    closeButton.setIcon(new ImageIcon(getClass().getResource("/esmska/resources/close-22.png"))); // NOI18N
    Mnemonics.setLocalizedText(closeButton, bundle.getString("Close_"));
    closeButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            closeButtonActionPerformed(evt);
        }
    });
    Mnemonics.setLocalizedText(licenseButton, bundle.getString("AboutFrame.licenseButton.text"));
    licenseButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            licenseButtonActionPerformed(evt);
        }
    });

    jLabel5.setFont(jLabel5.getFont().deriveFont(jLabel5.getFont().getSize() - 2f));
    jLabel5.setHorizontalAlignment(SwingConstants.CENTER);
    jLabel5.setIcon(new ImageIcon(getClass().getResource("/esmska/resources/copyleft-12.png"))); // NOI18N
    Mnemonics.setLocalizedText(jLabel5, bundle.getString("AboutFrame.jLabel5.text")); // NOI18N
    jLabel5.setFocusable(false);

    setURI(homeHyperlink, Links.getURI(Links.HOMEPAGE));
    Mnemonics.setLocalizedText(homeHyperlink, l10n.getString("AboutFrame.homeHyperlink.text"));
    homeHyperlink.setToolTipText(l10n.getString("AboutFrame.homeHyperlink.toolTipText")); // NOI18N
    setURI(supportHyperlink, Links.getURI(Links.DONATE));
    Mnemonics.setLocalizedText(supportHyperlink, l10n.getString("AboutFrame.supportHyperlink.text"));
    supportHyperlink.setToolTipText(l10n.getString("AboutFrame.supportHyperlink.toolTipText")); // NOI18N
    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING).addGroup(layout
            .createSequentialGroup().addContainerGap()
            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                    .addComponent(jLabel5, Alignment.CENTER, GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                    .addComponent(homeHyperlink, Alignment.CENTER, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addComponent(supportHyperlink, Alignment.CENTER, GroupLayout.PREFERRED_SIZE,
                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, Alignment.CENTER, GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                    .addComponent(jLabel2, Alignment.CENTER, GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                    .addComponent(jLabel1, Alignment.CENTER, GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup().addComponent(creditsButton)
                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(licenseButton)
                            .addPreferredGap(ComponentPlacement.RELATED, 151, Short.MAX_VALUE)
                            .addComponent(closeButton))
                    .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel4, GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)
                            .addGap(108, 108, 108)
                            .addComponent(jLabel6, GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel8, GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE)
                            .addGap(138, 138, 138)
                            .addComponent(jLabel7, GroupLayout.DEFAULT_SIZE, 156, Short.MAX_VALUE)))
            .addContainerGap()));

    layout.linkSize(SwingConstants.HORIZONTAL, new Component[] { closeButton, creditsButton, licenseButton });

    layout.setVerticalGroup(
            layout.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING,
                    layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addGap(18, 18, 18)
                            .addComponent(jLabel2).addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(jLabel3).addPreferredGap(ComponentPlacement.UNRELATED)
                            .addComponent(jLabel5).addGap(18, 18, 18)
                            .addGroup(layout.createParallelGroup(Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(jLabel4).addComponent(jLabel6))
                                            .addPreferredGap(ComponentPlacement.RELATED)
                                            .addGroup(layout.createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(jLabel7).addComponent(jLabel8)))
                                    .addComponent(homeHyperlink, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addComponent(supportHyperlink, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
                            .addGroup(layout.createParallelGroup(Alignment.BASELINE).addComponent(creditsButton)
                                    .addComponent(closeButton).addComponent(licenseButton))
                            .addContainerGap()));

    layout.linkSize(SwingConstants.VERTICAL, new Component[] { jLabel4, jLabel6 });

    layout.linkSize(SwingConstants.VERTICAL, new Component[] { closeButton, creditsButton, licenseButton });

    pack();
}

From source file:client.ui.FilePane.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*from  w ww  .  j  av  a2  s  . c  o m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    fileButtonPane = new JPanel();
    uploadFileButton = new JButton();
    downloadFileButton = new JButton();
    deleteFileButton = new JButton();
    renameFileButton = new JButton();
    authorizationButton = new JButton();
    jSeparator1 = new JSeparator();
    addNoteButton = new JButton();
    deleteNoteButton = new JButton();
    jSeparator2 = new JSeparator();
    targetIDField = new JTextField();
    searchUserButton = new JButton();
    returnButton = new JButton();
    jSeparator3 = new JSeparator();
    refreshButton = new JButton();
    jSeparator4 = new JSeparator();
    changePasswdButton = new JButton();
    fileSplitPane = new JSplitPane();
    jSplitPane2 = new JSplitPane();
    fileInfoScroll = new JScrollPane();
    fileInfoTable = new JTable();
    noteDisplayScroll = new JScrollPane();
    noteTable = new JTable();
    jSplitPane1 = new JSplitPane();
    fileDisplayScroll = new JScrollPane();
    fileContentArea = new JTextArea();
    noteInputScroll = new JScrollPane();
    noteInputArea = new JTextArea();

    FormListener formListener = new FormListener();

    setForeground(new Color(240, 240, 240));
    setFont(new Font("", 0, 12)); // NOI18N
    setMaximumSize(new Dimension(1366, 768));
    setPreferredSize(new Dimension(1366, 700));

    fileButtonPane.setMaximumSize(new Dimension(32767, 50));
    fileButtonPane.setMinimumSize(new Dimension(404, 50));

    uploadFileButton.setFont(new Font("", 0, 12)); // NOI18N
    uploadFileButton.setText("");
    uploadFileButton.setActionCommand("JButton1");
    uploadFileButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    uploadFileButton.setBorderPainted(false);
    uploadFileButton.setContentAreaFilled(false);
    uploadFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    uploadFileButton.setFocusPainted(false);
    uploadFileButton.setMaximumSize(new Dimension(30, 20));
    uploadFileButton.setMinimumSize(new Dimension(30, 20));
    uploadFileButton.addMouseListener(formListener);
    uploadFileButton.addActionListener(formListener);

    downloadFileButton.setFont(new Font("", 0, 12)); // NOI18N
    downloadFileButton.setText("");
    downloadFileButton.setActionCommand("JButton1");
    downloadFileButton.setBorder(null);
    downloadFileButton.setBorderPainted(false);
    downloadFileButton.setContentAreaFilled(false);
    downloadFileButton.setEnabled(false);
    downloadFileButton.setFocusPainted(false);
    downloadFileButton.setMaximumSize(new Dimension(30, 20));
    downloadFileButton.setMinimumSize(new Dimension(30, 20));
    downloadFileButton.setPreferredSize(new Dimension(30, 20));
    downloadFileButton.addMouseListener(formListener);
    downloadFileButton.addActionListener(formListener);

    deleteFileButton.setFont(new Font("", 0, 12)); // NOI18N
    deleteFileButton.setText("");
    deleteFileButton.setBorder(null);
    deleteFileButton.setBorderPainted(false);
    deleteFileButton.setContentAreaFilled(false);
    deleteFileButton.setEnabled(false);
    deleteFileButton.setFocusPainted(false);
    deleteFileButton.addMouseListener(formListener);
    deleteFileButton.addActionListener(formListener);

    renameFileButton.setFont(new Font("", 0, 12)); // NOI18N
    renameFileButton.setText("???");
    renameFileButton.setBorder(null);
    renameFileButton.setBorderPainted(false);
    renameFileButton.setContentAreaFilled(false);
    renameFileButton.setEnabled(false);
    renameFileButton.setFocusPainted(false);
    renameFileButton.addMouseListener(formListener);
    renameFileButton.addActionListener(formListener);

    authorizationButton.setFont(new Font("", 0, 12)); // NOI18N
    authorizationButton.setText("??");
    authorizationButton.setBorder(null);
    authorizationButton.setBorderPainted(false);
    authorizationButton.setContentAreaFilled(false);
    authorizationButton.setEnabled(false);
    authorizationButton.setFocusPainted(false);
    authorizationButton.addMouseListener(formListener);
    authorizationButton.addActionListener(formListener);

    jSeparator1.setOrientation(SwingConstants.VERTICAL);

    addNoteButton.setFont(new Font("", 0, 12)); // NOI18N
    addNoteButton.setText("");
    addNoteButton.setActionCommand("JButton1");
    addNoteButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    addNoteButton.setBorderPainted(false);
    addNoteButton.setContentAreaFilled(false);
    addNoteButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    addNoteButton.setEnabled(false);
    addNoteButton.setFocusPainted(false);
    addNoteButton.setMaximumSize(new Dimension(30, 20));
    addNoteButton.setMinimumSize(new Dimension(30, 20));
    addNoteButton.addMouseListener(formListener);
    addNoteButton.addActionListener(formListener);

    deleteNoteButton.setFont(new Font("", 0, 12)); // NOI18N
    deleteNoteButton.setText("");
    deleteNoteButton.setActionCommand("JButton1");
    deleteNoteButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    deleteNoteButton.setBorderPainted(false);
    deleteNoteButton.setContentAreaFilled(false);
    deleteNoteButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    deleteNoteButton.setEnabled(false);
    deleteNoteButton.setFocusPainted(false);
    deleteNoteButton.setMaximumSize(new Dimension(30, 20));
    deleteNoteButton.setMinimumSize(new Dimension(30, 20));
    deleteNoteButton.addMouseListener(formListener);
    deleteNoteButton.addActionListener(formListener);

    jSeparator2.setOrientation(SwingConstants.VERTICAL);

    targetIDField.setFont(new Font("", 0, 12)); // NOI18N

    searchUserButton.setFont(new Font("", 0, 12)); // NOI18N
    searchUserButton.setText("");
    searchUserButton.setActionCommand("JButton1");
    searchUserButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    searchUserButton.setBorderPainted(false);
    searchUserButton.setContentAreaFilled(false);
    searchUserButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    searchUserButton.setFocusPainted(false);
    searchUserButton.setMaximumSize(new Dimension(30, 20));
    searchUserButton.setMinimumSize(new Dimension(30, 20));
    searchUserButton.addMouseListener(formListener);
    searchUserButton.addActionListener(formListener);

    returnButton.setFont(new Font("", 0, 12)); // NOI18N
    returnButton.setText("");
    returnButton.setActionCommand("JButton1");
    returnButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    returnButton.setBorderPainted(false);
    returnButton.setContentAreaFilled(false);
    returnButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    returnButton.setFocusPainted(false);
    returnButton.setMaximumSize(new Dimension(30, 20));
    returnButton.setMinimumSize(new Dimension(30, 20));
    returnButton.addMouseListener(formListener);
    returnButton.addActionListener(formListener);

    jSeparator3.setOrientation(SwingConstants.VERTICAL);

    refreshButton.setFont(new Font("", 0, 12)); // NOI18N
    refreshButton.setText("");
    refreshButton.setActionCommand("JButton1");
    refreshButton.setBorder(null);
    refreshButton.setBorderPainted(false);
    refreshButton.setContentAreaFilled(false);
    refreshButton.setFocusPainted(false);
    refreshButton.setMaximumSize(new Dimension(30, 20));
    refreshButton.setMinimumSize(new Dimension(30, 20));
    refreshButton.setPreferredSize(new Dimension(30, 20));
    refreshButton.addMouseListener(formListener);
    refreshButton.addActionListener(formListener);

    jSeparator4.setOrientation(SwingConstants.VERTICAL);

    changePasswdButton.setFont(new Font("", 0, 12)); // NOI18N
    changePasswdButton.setText("?");
    changePasswdButton.setActionCommand("JButton1");
    changePasswdButton.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
    changePasswdButton.setBorderPainted(false);
    changePasswdButton.setContentAreaFilled(false);
    changePasswdButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    changePasswdButton.setFocusPainted(false);
    changePasswdButton.setMaximumSize(new Dimension(30, 20));
    changePasswdButton.setMinimumSize(new Dimension(30, 20));
    changePasswdButton.addMouseListener(formListener);
    changePasswdButton.addActionListener(formListener);

    GroupLayout fileButtonPaneLayout = new GroupLayout(fileButtonPane);
    fileButtonPane.setLayout(fileButtonPaneLayout);
    fileButtonPaneLayout.setHorizontalGroup(fileButtonPaneLayout
            .createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(fileButtonPaneLayout.createSequentialGroup()
                    .addComponent(uploadFileButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(downloadFileButton, GroupLayout.PREFERRED_SIZE, 46,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(deleteFileButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(renameFileButton, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(authorizationButton, GroupLayout.PREFERRED_SIZE, 63,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSeparator1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(addNoteButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(deleteNoteButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSeparator2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(targetIDField, GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(searchUserButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(returnButton, GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSeparator3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(refreshButton, GroupLayout.PREFERRED_SIZE, 46, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jSeparator4, GroupLayout.PREFERRED_SIZE, 2, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(changePasswdButton,
                            GroupLayout.PREFERRED_SIZE, 63, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(18, Short.MAX_VALUE)));
    fileButtonPaneLayout.setVerticalGroup(fileButtonPaneLayout
            .createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING,
                    fileButtonPaneLayout.createSequentialGroup().addContainerGap().addGroup(fileButtonPaneLayout
                            .createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jSeparator4)
                            .addGroup(fileButtonPaneLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE)
                                    .addGroup(fileButtonPaneLayout
                                            .createParallelGroup(GroupLayout.Alignment.TRAILING)
                                            .addComponent(changePasswdButton, GroupLayout.PREFERRED_SIZE, 25,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGroup(fileButtonPaneLayout
                                                    .createParallelGroup(GroupLayout.Alignment.LEADING)
                                                    .addComponent(refreshButton, GroupLayout.PREFERRED_SIZE, 25,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addGroup(fileButtonPaneLayout
                                                            .createParallelGroup(
                                                                    GroupLayout.Alignment.TRAILING, false)
                                                            .addComponent(jSeparator2)
                                                            .addGroup(fileButtonPaneLayout
                                                                    .createParallelGroup(
                                                                            GroupLayout.Alignment.BASELINE)
                                                                    .addComponent(addNoteButton,
                                                                            GroupLayout.PREFERRED_SIZE, 25,
                                                                            GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(deleteNoteButton,
                                                                            GroupLayout.PREFERRED_SIZE, 25,
                                                                            GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jSeparator1)
                                                            .addGroup(fileButtonPaneLayout
                                                                    .createParallelGroup(
                                                                            GroupLayout.Alignment.BASELINE)
                                                                    .addComponent(downloadFileButton,
                                                                            GroupLayout.PREFERRED_SIZE, 25,
                                                                            GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(deleteFileButton,
                                                                            GroupLayout.PREFERRED_SIZE, 25,
                                                                            GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(renameFileButton,
                                                                            GroupLayout.PREFERRED_SIZE, 25,
                                                                            GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(authorizationButton,
                                                                            GroupLayout.PREFERRED_SIZE, 25,
                                                                            GroupLayout.PREFERRED_SIZE)
                                                                    .addComponent(uploadFileButton,
                                                                            GroupLayout.PREFERRED_SIZE, 25,
                                                                            GroupLayout.PREFERRED_SIZE))
                                                            .addComponent(jSeparator3)
                                                            .addGroup(GroupLayout.Alignment.LEADING,
                                                                    fileButtonPaneLayout.createParallelGroup(
                                                                            GroupLayout.Alignment.BASELINE)
                                                                            .addComponent(targetIDField)
                                                                            .addComponent(searchUserButton,
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    25,
                                                                                    GroupLayout.PREFERRED_SIZE)
                                                                            .addComponent(returnButton,
                                                                                    GroupLayout.PREFERRED_SIZE,
                                                                                    25,
                                                                                    GroupLayout.PREFERRED_SIZE)))))))
                            .addGap(15, 15, 15)));

    fileSplitPane.setBackground(new Color(255, 255, 255));
    fileSplitPane.setDividerLocation(750);
    fileSplitPane.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    fileSplitPane.setMaximumSize(new Dimension(1366, 768));
    fileSplitPane.setPreferredSize(new Dimension(701, 646));

    jSplitPane2.setDividerLocation(400);
    jSplitPane2.setOrientation(JSplitPane.VERTICAL_SPLIT);
    jSplitPane2.setContinuousLayout(true);
    jSplitPane2.setMaximumSize(new Dimension(1366, 768));

    fileInfoScroll.setBackground(new Color(255, 255, 255));
    fileInfoScroll.setFont(new Font("", 0, 12)); // NOI18N
    fileInfoScroll.getViewport().setBackground(Color.WHITE);
    fileInfoScroll.addMouseListener(formListener);

    fileInfoTable.setAutoCreateRowSorter(true);
    fileInfoTable.setFont(new Font("", 0, 12)); // NOI18N
    fileInfoTable.setModel(fileTableModel);
    fileInfoTable.getTableHeader().setFont(new Font("", 0, 12));
    fileInfoTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    fileInfoTable.setRowHeight(20);
    fileInfoTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    fileInfoTable.setShowHorizontalLines(false);
    fileInfoTable.setShowVerticalLines(false);
    fileInfoTable.addMouseListener(formListener);
    fileInfoTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {

        public void valueChanged(ListSelectionEvent evt) {
            fileSelectedChanged(evt);
        }
    });
    fileInfoScroll.setViewportView(fileInfoTable);

    jSplitPane2.setTopComponent(fileInfoScroll);

    noteDisplayScroll.setBackground(new Color(255, 255, 255));
    noteDisplayScroll.setFont(new Font("", 0, 12)); // NOI18N
    noteDisplayScroll.getViewport().setBackground(Color.WHITE);
    noteDisplayScroll.addMouseListener(formListener);

    noteTable.setAutoCreateRowSorter(true);
    noteTable.setFont(new Font("", 0, 12)); // NOI18N
    noteTable.setModel(noteTableModel);
    noteTable.getTableHeader().setFont(new Font("", 0, 12));
    noteTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
    noteTable.setRowHeight(20);
    noteTable.setShowHorizontalLines(false);
    noteTable.setShowVerticalLines(false);
    noteTable.addMouseListener(formListener);
    noteTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent evt) {
            noteSelectedChanged(evt);
        }
    });
    noteDisplayScroll.setViewportView(noteTable);

    jSplitPane2.setBottomComponent(noteDisplayScroll);

    fileSplitPane.setLeftComponent(jSplitPane2);

    jSplitPane1.setDividerLocation(500);
    jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);

    fileDisplayScroll.setFont(new Font("", 0, 12)); // NOI18N
    fileDisplayScroll.setMinimumSize(new Dimension(30, 30));

    fileContentArea.setEditable(false);
    fileContentArea.setColumns(20);
    fileContentArea.setFont(new Font("", 0, 12)); // NOI18N
    fileContentArea.setRows(5);
    fileContentArea.setToolTipText("");
    fileContentArea
            .setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.DEFAULT_JUSTIFICATION,
                    TitledBorder.DEFAULT_POSITION, new Font("", 0, 12))); // NOI18N
    fileDisplayScroll.setViewportView(fileContentArea);

    jSplitPane1.setTopComponent(fileDisplayScroll);

    noteInputScroll.setFont(new Font("", 0, 12)); // NOI18N
    noteInputScroll.setMaximumSize(new Dimension(1366, 768));
    noteInputScroll.setMinimumSize(new Dimension(30, 30));

    noteInputArea.setColumns(20);
    noteInputArea.setFont(new Font("", 0, 12)); // NOI18N
    noteInputArea.setRows(5);
    noteInputArea.setToolTipText("");
    noteInputArea
            .setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.DEFAULT_JUSTIFICATION,
                    TitledBorder.DEFAULT_POSITION, new Font("", 0, 12))); // NOI18N
    noteInputScroll.setViewportView(noteInputArea);

    jSplitPane1.setBottomComponent(noteInputScroll);

    fileSplitPane.setRightComponent(jSplitPane1);

    GroupLayout layout = new GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout
            .createSequentialGroup().addContainerGap()
            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(fileSplitPane, GroupLayout.DEFAULT_SIZE, 1346, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                            .addComponent(fileButtonPane, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, Short.MAX_VALUE)))
            .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(fileButtonPane, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(fileSplitPane,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));
}