use of cbit.vcell.mapping.gui.NetworkConstraintsTableModel in project vcell by virtualcell.
the class NetworkConstraintsPanel method initialize.
private void initialize() {
seedSpeciesLabel = new JLabel();
reactionRulesLabel = new JLabel();
generatedSpeciesLabel = new JLabel();
generatedReactionsLabel = new JLabel();
observablesMapLabel = new JLabel("Observables Map");
somethingInsufficientLabel = new JLabel();
networkConstraintsTable = new EditorScrollTable();
networkConstraintsTableModel = new NetworkConstraintsTableModel(networkConstraintsTable);
networkConstraintsTable.setModel(networkConstraintsTableModel);
getViewGeneratedSpeciesButton().addActionListener(eventHandler);
getViewGeneratedReactionsButton().addActionListener(eventHandler);
getViewObservablesMapButton().addActionListener(eventHandler);
getRefreshMathButton().addActionListener(eventHandler);
getCreateModelButton().addActionListener(eventHandler);
// ------------------------------------------- The 2 group boxes --------------------------
JPanel leftPanel = new JPanel();
Border loweredEtchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
Border loweredBevelBorder = BorderFactory.createLoweredBevelBorder();
TitledBorder titleTop = BorderFactory.createTitledBorder(loweredEtchedBorder, " Network Constraints ");
titleTop.setTitleJustification(TitledBorder.LEFT);
titleTop.setTitlePosition(TitledBorder.TOP);
TitledBorder titleBottom = BorderFactory.createTitledBorder(loweredEtchedBorder, " Generated Network ");
titleBottom.setTitleJustification(TitledBorder.LEFT);
titleBottom.setTitlePosition(TitledBorder.TOP);
setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1;
gbc.weighty = 1;
gbc.fill = GridBagConstraints.BOTH;
gbc.insets = new Insets(5, 3, 2, 1);
add(leftPanel, gbc);
// ------------------------------------------- Populating the left group box ---------------
JPanel top = new JPanel();
JPanel bottom = new JPanel();
top.setBorder(titleTop);
bottom.setBorder(titleBottom);
leftPanel.setLayout(new GridBagLayout());
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = 1.0;
gbc.weighty = 1.0;
gbc.fill = GridBagConstraints.BOTH;
// top, left, bottom, right
gbc.insets = new Insets(5, 2, 2, 3);
leftPanel.add(top, gbc);
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 1;
gbc.weightx = 0;
gbc.weighty = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(5, 2, 2, 3);
leftPanel.add(bottom, gbc);
// we may want to use a scroll pane whose viewing area is the JTable to provide similar look with NetGen Console
JScrollPane p = new JScrollPane(networkConstraintsTable);
p.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
// --- bottom
top.setLayout(new GridBagLayout());
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.weightx = gbc.weighty = 1.0;
gbc.fill = GridBagConstraints.BOTH;
gbc.anchor = GridBagConstraints.NORTHWEST;
gbc.insets = new Insets(5, 4, 4, 10);
top.add(p, gbc);
// ------------------------------------------- Populating the right group box ------------
// --- top
bottom.setLayout(new GridBagLayout());
int gridy = 0;
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(6, 4, 4, 10);
bottom.add(generatedSpeciesLabel, gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = gridy;
// gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(6, 4, 4, 10);
bottom.add(getViewGeneratedSpeciesButton(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 2;
gbc.gridy = gridy;
// gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(6, 4, 4, 10);
bottom.add(getRefreshMathButton(), gbc);
gridy++;
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(4, 4, 4, 10);
bottom.add(generatedReactionsLabel, gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(4, 4, 4, 10);
bottom.add(getViewGeneratedReactionsButton(), gbc);
gbc = new GridBagConstraints();
gbc.gridx = 2;
gbc.gridy = gridy;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(4, 4, 4, 10);
bottom.add(getCreateModelButton(), gbc);
gridy++;
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.weightx = 1.0;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(4, 4, 4, 10);
bottom.add(observablesMapLabel, gbc);
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = gridy;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(4, 4, 4, 10);
bottom.add(getViewObservablesMapButton(), gbc);
gridy++;
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = gridy;
gbc.weightx = 1.0;
gbc.gridwidth = 4;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(4, 4, 4, 10);
bottom.add(somethingInsufficientLabel, gbc);
networkConstraintsTable.setDefaultRenderer(String.class, new DefaultScrollTableCellRenderer());
}
Aggregations