private Component getTable() { if (tableView == null) { JTable table = new JTable(getTableModel(), getTableColumnModel()); JScrollPane scrollPane = new JScrollPane(table); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); tableView = scrollPane; } return tableView; }
public AccountPanel() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } usermodel.addUser(new User("karl", "Karl Marx", ("rabid#communist").toCharArray())); usermodel.addUser(new User("vlad", "Vladimir Lenin", ("looney").toCharArray())); table = new JTable(usermodel); table.setPreferredScrollableViewportSize(new Dimension(28, 8)); JScrollPane scrollpane = new JScrollPane(table); jPanelUsers.add(scrollpane); }
public JComponent createContestantList() { JPanel contListPanel = new JPanel(); MyTableModel contTable = new MyTableModel(); JTable table = new JTable(contTable); table.setPreferredScrollableViewportSize(new Dimension(WIDTH, HEIGHT)); table.setFillsViewportHeight(true); table.setAutoCreateRowSorter(true); table.setRowHeight(77); table.setFont(new Font("Viner Hand ITC", Font.PLAIN, 18)); table.setForeground(Color.BLUE); table.setSelectionForeground(Color.RED); table.setSelectionBackground( new Color(0, 0, 0, 64)); // When a cell is selected, this entire row is highlighted. // Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(table); contListPanel.add(scrollPane); return contListPanel; }
public storiconoleggio() { storico = new JFrame("Storico cliente:"); storico.setDefaultCloseOperation(DISPOSE_ON_CLOSE); storico.setVisible(true); operazioni = new JPanel(); operazioni.setLayout(new BoxLayout(operazioni, BoxLayout.Y_AXIS)); sotto = new JPanel(); gruppo = Box.createVerticalBox(); indietro = new JButton("Indietro"); ascoltatore = new listenernolcli(); Object righe[][] = { {"# Noleggio", "ID Bagnino", "# Ombrellone", "Data Noleggio", "Num. Lettini", "ID Cliente"} }; Object colonne[] = {"", "", "", "", "", ""}; JTable tabella = new JTable(righe, colonne); try { String url = "jdbc:mysql://127.0.0.1:3306/lido"; String userid = "root"; String paswordd = "root"; con = DriverManager.getConnection(url, userid, paswordd); requete = con.createStatement(); rs = requete.executeQuery( "SELECT * FROM lido.bagnino_noleggia_ombrellone WHERE cliente_idcliente =" + login.getNomeUtente()); ResultSetMetaData md = rs.getMetaData(); int columnCount = md.getColumnCount(); Vector columns = new Vector(columnCount); for (int i = 1; i <= columnCount; i++) columns.add(md.getColumnName(i)); Vector data = new Vector(); Vector row; while (rs.next()) { row = new Vector(columnCount); for (int i = 1; i <= columnCount; i++) { row.add(rs.getString(i)); } data.add(row); } table = new JTable(data, columns); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); table.setFillsViewportHeight(true); table.setVisible(true); table.validate(); } catch (SQLException sqle) { System.out.println(sqle); sqle.printStackTrace(); } indietro.addActionListener(ascoltatore); operazioni.add(tabella); operazioni.add(table); sotto.add(indietro); gruppo.add(operazioni); gruppo.add(sotto); storico.add(gruppo); storico.pack(); }
// {{{ InstallPanel constructor InstallPanel(PluginManager window, boolean updates) { super(new BorderLayout(12, 12)); this.window = window; this.updates = updates; setBorder(new EmptyBorder(12, 12, 12, 12)); final JSplitPane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT); split.setResizeWeight(0.75); /* Setup the table */ table = new JTable(pluginModel = new PluginTableModel()); table.setShowGrid(false); table.setIntercellSpacing(new Dimension(0, 0)); table.setRowHeight(table.getRowHeight() + 2); table.setPreferredScrollableViewportSize(new Dimension(500, 200)); table.setDefaultRenderer( Object.class, new TextRenderer((DefaultTableCellRenderer) table.getDefaultRenderer(Object.class))); table.addFocusListener(new TableFocusHandler()); InputMap tableInputMap = table.getInputMap(JComponent.WHEN_FOCUSED); ActionMap tableActionMap = table.getActionMap(); tableInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "tabOutForward"); tableActionMap.put("tabOutForward", new KeyboardAction(KeyboardCommand.TAB_OUT_FORWARD)); tableInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK), "tabOutBack"); tableActionMap.put("tabOutBack", new KeyboardAction(KeyboardCommand.TAB_OUT_BACK)); tableInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "editPlugin"); tableActionMap.put("editPlugin", new KeyboardAction(KeyboardCommand.EDIT_PLUGIN)); tableInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "closePluginManager"); tableActionMap.put( "closePluginManager", new KeyboardAction(KeyboardCommand.CLOSE_PLUGIN_MANAGER)); TableColumn col1 = table.getColumnModel().getColumn(0); TableColumn col2 = table.getColumnModel().getColumn(1); TableColumn col3 = table.getColumnModel().getColumn(2); TableColumn col4 = table.getColumnModel().getColumn(3); TableColumn col5 = table.getColumnModel().getColumn(4); col1.setPreferredWidth(30); col1.setMinWidth(30); col1.setMaxWidth(30); col1.setResizable(false); col2.setPreferredWidth(180); col3.setPreferredWidth(130); col4.setPreferredWidth(70); col5.setPreferredWidth(70); JTableHeader header = table.getTableHeader(); header.setReorderingAllowed(false); header.addMouseListener(new HeaderMouseHandler()); header.setDefaultRenderer( new HeaderRenderer((DefaultTableCellRenderer) header.getDefaultRenderer())); scrollpane = new JScrollPane(table); scrollpane.getViewport().setBackground(table.getBackground()); split.setTopComponent(scrollpane); /* Create description */ JScrollPane infoPane = new JScrollPane(infoBox = new PluginInfoBox()); infoPane.setPreferredSize(new Dimension(500, 100)); split.setBottomComponent(infoPane); EventQueue.invokeLater( new Runnable() { @Override public void run() { split.setDividerLocation(0.75); } }); final JTextField searchField = new JTextField(); searchField.addKeyListener( new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_DOWN || e.getKeyCode() == KeyEvent.VK_UP) { table.dispatchEvent(e); table.requestFocus(); } } }); searchField .getDocument() .addDocumentListener( new DocumentListener() { void update() { pluginModel.setFilterString(searchField.getText()); } @Override public void changedUpdate(DocumentEvent e) { update(); } @Override public void insertUpdate(DocumentEvent e) { update(); } @Override public void removeUpdate(DocumentEvent e) { update(); } }); table.addKeyListener( new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { int i = table.getSelectedRow(), n = table.getModel().getRowCount(); if (e.getKeyCode() == KeyEvent.VK_DOWN && i == (n - 1) || e.getKeyCode() == KeyEvent.VK_UP && i == 0) { searchField.requestFocus(); searchField.selectAll(); } } }); Box filterBox = Box.createHorizontalBox(); filterBox.add(new JLabel("Filter : ")); filterBox.add(searchField); add(BorderLayout.NORTH, filterBox); add(BorderLayout.CENTER, split); /* Create buttons */ Box buttons = new Box(BoxLayout.X_AXIS); buttons.add(new InstallButton()); buttons.add(Box.createHorizontalStrut(12)); buttons.add(new SelectallButton()); buttons.add(chooseButton = new ChoosePluginSet()); buttons.add(new ClearPluginSet()); buttons.add(Box.createGlue()); buttons.add(new SizeLabel()); add(BorderLayout.SOUTH, buttons); String path = jEdit.getProperty(PluginManager.PROPERTY_PLUGINSET, ""); if (!path.isEmpty()) { loadPluginSet(path); } } // }}}
/** Fills the panel with SWARM specific fields. */ public void fillPanel() { // Zone initialization ControllerSWARM z = (ControllerSWARM) controller; Vector<Zone> cz = z.zones; for (int i = 0; i < cz.size(); i++) zones.add(cz.get(i).clone()); // Parameter initialization density_sample_size = z.P.SWARM_DENSITY_SAMPLE_SIZE; epsilon = z.P.epsilon; forecast_lead_time = z.P.SWARM_FORECAST_LEAD_TIME; input_var_lane = z.P.input_var_lane; meas_var_lane = z.P.meas_var_lane; phi = z.P.swarm_phi; psi = z.P.swarm_psi; sat_den_multiplier = z.P.SWARM_SAT_DEN_NUMBER; sat_smoother = z.P.sat_smoother; slope_sample_size = z.P.SWARM_SLOPE_SAMPLE_SIZE; // Components JPanel comp = new JPanel(new FlowLayout()); comp.setBorder(BorderFactory.createTitledBorder("Components")); cbsw1.setSelected(z.P.SWARM1); comp.add(cbsw1); comp.add(new JLabel(" ")); cbsw2a.setSelected(z.P.SWARM2A); comp.add(cbsw2a); comp.add(new JLabel(" ")); cbsw2b.setSelected(z.P.SWARM2B); comp.add(cbsw2b); comp.add(new JLabel(" ")); cbdynbott.setEnabled(false); comp.add(cbdynbott); add(comp); // Zones JPanel zone = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); zone.setBorder(BorderFactory.createTitledBorder("Zones")); zonetab.setPreferredScrollableViewportSize(new Dimension(400, 30)); setUpBottleneckColumn(); setUpFromOnrampColumn(); setUpToOnrampColumn(); c.fill = GridBagConstraints.HORIZONTAL; c.ipady = 45; c.weightx = 0.5; c.gridwidth = 3; c.gridx = 0; c.gridy = 0; zone.add(new JScrollPane(zonetab), c); c.ipady = 0; c.gridy = 1; c.gridwidth = 1; c.gridx = 0; zone.add(buttonAdd, c); c.gridx = 1; zone.add(buttonDelete, c); // configure buttons buttonAdd.setEnabled(true); buttonAdd.setActionCommand(cmdAdd); buttonAdd.addActionListener(this); buttonDelete.setEnabled(true); buttonDelete.setActionCommand(cmdDelete); buttonDelete.addActionListener(this); add(zone); // Parameters JPanel param = new JPanel(new GridLayout(1, 0)); param.setBorder(BorderFactory.createTitledBorder("Parameters")); final JTable paramtab = new JTable(paramTM); paramtab.setPreferredScrollableViewportSize(new Dimension(500, 160)); param.add(new JScrollPane(paramtab)); add(param); return; }
/** Constructor (create and layout page) */ public SOAPMonitorPage(String host_name) { host = host_name; // Set up default filter (show all messages) filter = new SOAPMonitorFilter(); // Use borders to help improve appearance etched_border = new EtchedBorder(); // Build top portion of split (list panel) model = new SOAPMonitorTableModel(); table = new JTable(model); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setRowSelectionInterval(0, 0); table.setPreferredScrollableViewportSize(new Dimension(600, 96)); table.getSelectionModel().addListSelectionListener(this); scroll = new JScrollPane(table); remove_button = new JButton("Remove"); remove_button.addActionListener(this); remove_button.setEnabled(false); remove_all_button = new JButton("Remove All"); remove_all_button.addActionListener(this); filter_button = new JButton("Filter ..."); filter_button.addActionListener(this); list_buttons = new JPanel(); list_buttons.setLayout(new FlowLayout()); list_buttons.add(remove_button); list_buttons.add(remove_all_button); list_buttons.add(filter_button); list_panel = new JPanel(); list_panel.setLayout(new BorderLayout()); list_panel.add(scroll, BorderLayout.CENTER); list_panel.add(list_buttons, BorderLayout.SOUTH); list_panel.setBorder(empty_border); // Build bottom portion of split (message details) details_time = new JLabel("Time: ", SwingConstants.RIGHT); details_target = new JLabel("Target Service: ", SwingConstants.RIGHT); details_status = new JLabel("Status: ", SwingConstants.RIGHT); details_time_value = new JLabel(); details_target_value = new JLabel(); details_status_value = new JLabel(); Dimension preferred_size = details_time.getPreferredSize(); preferred_size.width = 1; details_time.setPreferredSize(preferred_size); details_target.setPreferredSize(preferred_size); details_status.setPreferredSize(preferred_size); details_time_value.setPreferredSize(preferred_size); details_target_value.setPreferredSize(preferred_size); details_status_value.setPreferredSize(preferred_size); details_header = new JPanel(); details_header_layout = new GridBagLayout(); details_header.setLayout(details_header_layout); details_header_constraints = new GridBagConstraints(); details_header_constraints.fill = GridBagConstraints.BOTH; details_header_constraints.weightx = 0.5; details_header_layout.setConstraints(details_time, details_header_constraints); details_header.add(details_time); details_header_layout.setConstraints(details_time_value, details_header_constraints); details_header.add(details_time_value); details_header_layout.setConstraints(details_target, details_header_constraints); details_header.add(details_target); details_header_constraints.weightx = 1.0; details_header_layout.setConstraints(details_target_value, details_header_constraints); details_header.add(details_target_value); details_header_constraints.weightx = .5; details_header_layout.setConstraints(details_status, details_header_constraints); details_header.add(details_status); details_header_layout.setConstraints(details_status_value, details_header_constraints); details_header.add(details_status_value); details_header.setBorder(etched_border); request_label = new JLabel("SOAP Request", SwingConstants.CENTER); request_text = new SOAPMonitorTextArea(); request_text.setEditable(false); request_scroll = new JScrollPane(request_text); request_panel = new JPanel(); request_panel.setLayout(new BorderLayout()); request_panel.add(request_label, BorderLayout.NORTH); request_panel.add(request_scroll, BorderLayout.CENTER); response_label = new JLabel("SOAP Response", SwingConstants.CENTER); response_text = new SOAPMonitorTextArea(); response_text.setEditable(false); response_scroll = new JScrollPane(response_text); response_panel = new JPanel(); response_panel.setLayout(new BorderLayout()); response_panel.add(response_label, BorderLayout.NORTH); response_panel.add(response_scroll, BorderLayout.CENTER); details_soap = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); details_soap.setTopComponent(request_panel); details_soap.setRightComponent(response_panel); details_soap.setResizeWeight(.5); details_panel = new JPanel(); layout_button = new JButton("Switch Layout"); layout_button.addActionListener(this); reflow_xml = new JCheckBox("Reflow XML text"); reflow_xml.addActionListener(this); details_buttons = new JPanel(); details_buttons.setLayout(new FlowLayout()); details_buttons.add(reflow_xml); details_buttons.add(layout_button); details_panel.setLayout(new BorderLayout()); details_panel.add(details_header, BorderLayout.NORTH); details_panel.add(details_soap, BorderLayout.CENTER); details_panel.add(details_buttons, BorderLayout.SOUTH); details_panel.setBorder(empty_border); // Add the two parts to the age split pane split = new JSplitPane(JSplitPane.VERTICAL_SPLIT); split.setTopComponent(list_panel); split.setRightComponent(details_panel); // Build status area start_button = new JButton("Start"); start_button.addActionListener(this); stop_button = new JButton("Stop"); stop_button.addActionListener(this); status_buttons = new JPanel(); status_buttons.setLayout(new FlowLayout()); status_buttons.add(start_button); status_buttons.add(stop_button); status_text = new JLabel(); status_text.setBorder(new BevelBorder(BevelBorder.LOWERED)); status_text_panel = new JPanel(); status_text_panel.setLayout(new BorderLayout()); status_text_panel.add(status_text, BorderLayout.CENTER); status_text_panel.setBorder(empty_border); status_area = new JPanel(); status_area.setLayout(new BorderLayout()); status_area.add(status_buttons, BorderLayout.WEST); status_area.add(status_text_panel, BorderLayout.CENTER); status_area.setBorder(etched_border); // Add the split and status area to page setLayout(new BorderLayout()); add(split, BorderLayout.CENTER); add(status_area, BorderLayout.SOUTH); }
/** Fills the panel with simple signal specific fields. */ protected void fillPanel() { if (controller != null) { Vector<CycleDataRow> cd = ((ControllerSimpleSignal) controller).getCycleTable(); for (int i = 0; i < cd.size(); i++) { CycleDataRow cdr = ((ControllerSimpleSignal) controller) .new CycleDataRow(cd.get(i).getTime(), cd.get(i).getGreen(), cd.get(i).getRed()); cycledata.add(cdr); } } // offset JPanel pO = new JPanel(new BorderLayout()); pO.setBorder(BorderFactory.createTitledBorder("Offset (sec.)")); offset = new JSpinner( new SpinnerNumberModel( ((ControllerSimpleSignal) controller).getOffset() * conversion, 0.0, 99999.99, 10)); offset.setEditor(new JSpinner.NumberEditor(offset, "####0.##")); pO.add(offset); add(pO); // table JPanel tabpanel = new JPanel(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); tabpanel.setBorder(BorderFactory.createTitledBorder("Cycle Schedule")); cycletable = new JTable(cycletablemodel); cycletable.setPreferredScrollableViewportSize(new Dimension(200, 50)); cycletable.addMouseListener( new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { int row = cycletable.rowAtPoint(new Point(e.getX(), e.getY())); if ((row > cycledata.size() - 1) || (row < 0)) return; try { WindowEdit winEdit = new WindowEdit(null, cycledata.get(row)); winEdit.setVisible(true); cycletablemodel.deleterow(row); cycletablemodel.addrow(winEdit.getMyRow()); } catch (Exception excp) { } } } }); c.fill = GridBagConstraints.HORIZONTAL; c.ipady = 100; c.weightx = 0.5; c.gridwidth = 3; c.gridx = 0; c.gridy = 0; tabpanel.add(new JScrollPane(cycletable), c); c.ipady = 0; c.gridy = 1; c.gridwidth = 1; c.gridx = 0; tabpanel.add(buttonAdd, c); c.gridx = 1; tabpanel.add(buttonDelete, c); add(tabpanel); // configure buttons buttonAdd.setEnabled(true); buttonAdd.addActionListener(new ButtonAddListener()); buttonDelete.setEnabled(true); buttonDelete.addActionListener(new ButtonDeleteListener()); return; }
/** * Customization of external program paths. * * @param prefs a <code>JabRefPreferences</code> value */ public TableColumnsTab(JabRefPreferences prefs, JabRefFrame frame) { _prefs = prefs; this.frame = frame; setLayout(new BorderLayout()); TableModel tm = new AbstractTableModel() { public int getRowCount() { return rowCount; } public int getColumnCount() { return 2; } public Object getValueAt(int row, int column) { if (row == 0) return (column == 0 ? GUIGlobals.NUMBER_COL : "" + ncWidth); row--; if (row >= tableRows.size()) return ""; Object rowContent = tableRows.elementAt(row); if (rowContent == null) return ""; TableRow tr = (TableRow) rowContent; switch (column) { case 0: return tr.name; case 1: return ((tr.length > 0) ? Integer.toString(tr.length) : ""); } return null; // Unreachable. } public String getColumnName(int col) { return (col == 0 ? Globals.lang("Field name") : Globals.lang("Column width")); } public Class<?> getColumnClass(int column) { if (column == 0) return String.class; else return Integer.class; } public boolean isCellEditable(int row, int col) { return !((row == 0) && (col == 0)); } 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.elementAt(row - 1); if (col == 0) { rowContent.name = value.toString(); if (((String) getValueAt(row, 1)).equals("")) setValueAt("" + GUIGlobals.DEFAULT_FIELD_LENGTH, row, 1); } else { if (value == null) rowContent.length = -1; else rowContent.length = 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", // , 4dlu, fill:60dlu, 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, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); colSetup.setPreferredScrollableViewportSize(new Dimension(250, 200)); sp.setMinimumSize(new Dimension(250, 300)); tabPanel.add(sp, BorderLayout.CENTER); JToolBar tlb = new JToolBar(SwingConstants.VERTICAL); tlb.setFloatable(false); // tlb.setRollover(true); // tlb.setLayout(gbl); AddRowAction ara = new AddRowAction(); DeleteRowAction dra = new DeleteRowAction(); MoveRowUpAction moveUp = new MoveRowUpAction(); MoveRowDownAction moveDown = new MoveRowDownAction(); tlb.setBorder(null); tlb.add(ara); tlb.add(dra); tlb.addSeparator(); tlb.add(moveUp); tlb.add(moveDown); // tlb.addSeparator(); // tlb.add(new UpdateWidthsAction()); tabPanel.add(tlb, BorderLayout.EAST); showOneLetterHeadingForIconColumns = new JCheckBox(Globals.lang("Show one letter heading for icon columns")); fileColumn = new JCheckBox(Globals.lang("Show file column")); pdfColumn = new JCheckBox(Globals.lang("Show PDF/PS column")); urlColumn = new JCheckBox(Globals.lang("Show URL/DOI column")); preferUrl = new JRadioButton(Globals.lang("Show URL first")); preferDoi = new JRadioButton(Globals.lang("Show DOI first")); preferUrlDoiGroup = new ButtonGroup(); preferUrlDoiGroup.add(preferUrl); preferUrlDoiGroup.add(preferDoi); urlColumn.addChangeListener( new ChangeListener() { @Override public void stateChanged(ChangeEvent arg0) { preferUrl.setEnabled(urlColumn.isSelected()); preferDoi.setEnabled(urlColumn.isSelected()); } }); arxivColumn = new JCheckBox(Globals.lang("Show ArXiv column")); /** * begin: special table columns and special fields ** */ HelpAction help = new HelpAction(frame.helpDiag, GUIGlobals.specialFieldsHelp); hlb = new JButton(GUIGlobals.getImage("helpSmall")); hlb.setToolTipText(Globals.lang("Help on special fields")); hlb.addActionListener(help); specialFieldsEnabled = new JCheckBox(Globals.lang("Enable special fields")); // .concat(". ").concat(Globals.lang("You must restart JabRef for this to come into // effect."))); specialFieldsEnabled.addChangeListener( new ChangeListener() { public void stateChanged(ChangeEvent event) { boolean isEnabled = specialFieldsEnabled.isSelected(); rankingColumn.setEnabled(isEnabled); compactRankingColumn.setEnabled(isEnabled ? rankingColumn.isSelected() : false); qualityColumn.setEnabled(isEnabled); priorityColumn.setEnabled(isEnabled); relevanceColumn.setEnabled(isEnabled); syncKeywords.setEnabled(isEnabled); writeSpecialFields.setEnabled(isEnabled); } }); rankingColumn = new JCheckBox(Globals.lang("Show rank")); rankingColumn.addChangeListener( new ChangeListener() { public void stateChanged(ChangeEvent event) { compactRankingColumn.setEnabled(rankingColumn.isSelected()); } }); compactRankingColumn = new JCheckBox(Globals.lang("Compact rank")); qualityColumn = new JCheckBox(Globals.lang("Show quality")); priorityColumn = new JCheckBox(Globals.lang("Show priority")); relevanceColumn = new JCheckBox(Globals.lang("Show relevance")); // "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(Globals.lang("Synchronize with keywords")); writeSpecialFields = new JRadioButton( Globals.lang("Write values of special fields as separate fields to BibTeX")); ButtonGroup group = new ButtonGroup(); group.add(syncKeywords); group.add(writeSpecialFields); builder.appendSeparator(Globals.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")); CellConstraints cc = new CellConstraints(); specialTableColumnsBuilder.add(specialFieldsEnabled, cc.xyw(1, 1, 3)); specialTableColumnsBuilder.add(rankingColumn, cc.xyw(2, 2, 2)); specialTableColumnsBuilder.add(compactRankingColumn, cc.xy(3, 3)); specialTableColumnsBuilder.add(relevanceColumn, cc.xyw(2, 4, 2)); specialTableColumnsBuilder.add(qualityColumn, cc.xyw(2, 5, 2)); specialTableColumnsBuilder.add(priorityColumn, cc.xyw(2, 6, 2)); specialTableColumnsBuilder.add(syncKeywords, cc.xyw(2, 7, 2)); specialTableColumnsBuilder.add(writeSpecialFields, cc.xyw(2, 8, 2)); specialTableColumnsBuilder.add(showOneLetterHeadingForIconColumns, cc.xyw(1, 9, 5)); specialTableColumnsBuilder.add(hlb, cc.xyw(1, 10, 2)); specialTableColumnsBuilder.add(fileColumn, cc.xyw(5, 1, 2)); specialTableColumnsBuilder.add(pdfColumn, cc.xyw(5, 2, 2)); specialTableColumnsBuilder.add(urlColumn, cc.xyw(5, 3, 2)); specialTableColumnsBuilder.add(preferUrl, cc.xy(6, 4)); specialTableColumnsBuilder.add(preferDoi, cc.xy(6, 5)); specialTableColumnsBuilder.add(arxivColumn, cc.xyw(5, 6, 2)); builder.append(specialTableColumnsBuilder.getPanel()); builder.nextLine(); /** * end: special table columns and special fields ** */ builder.appendSeparator(Globals.lang("Entry table columns")); builder.nextLine(); builder.append(pan); builder.append(tabPanel); builder.nextLine(); // lab = new JLabel("<HTML>("+Globals.lang("this button will update the column width // settings<BR>" // +"to match the current widths in your table")+")</HTML>"); // lab = new JLabel("<HTML>("+Globals.lang("this_button_will_update") +")</HTML>") ; 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.append(lab); builder.nextLine(); pan = builder.getPanel(); pan.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); add(pan, BorderLayout.CENTER); }