use of com.jgoodies.forms.layout.CellConstraints in project cogtool by cogtool.
the class ConfigForm method addFillComponents.
/**
* Adds fill components to empty cells in the first row and first column of the grid.
* This ensures that the grid spacing will be the same as shown in the designer.
* @param cols an array of column indices in the first row where fill components should be added.
* @param rows an array of row indices in the first column where fill components should be added.
*/
void addFillComponents(Container panel, int[] cols, int[] rows) {
Dimension filler = new Dimension(10, 10);
boolean filled_cell_11 = false;
CellConstraints cc = new CellConstraints();
if (cols.length > 0 && rows.length > 0) {
if (cols[0] == 1 && rows[0] == 1) {
/** add a rigid area */
panel.add(Box.createRigidArea(filler), cc.xy(1, 1));
filled_cell_11 = true;
}
}
for (int index = 0; index < cols.length; index++) {
if (cols[index] == 1 && filled_cell_11) {
continue;
}
panel.add(Box.createRigidArea(filler), cc.xy(cols[index], 1));
}
for (int index = 0; index < rows.length; index++) {
if (rows[index] == 1 && filled_cell_11) {
continue;
}
panel.add(Box.createRigidArea(filler), cc.xy(1, rows[index]));
}
}
use of com.jgoodies.forms.layout.CellConstraints in project cogtool by cogtool.
the class ConfigForm method createPanel.
public JPanel createPanel() {
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:3DLU:NONE,FILL:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
_logTextArea.setName("logTextArea");
JScrollPane jscrollpane1 = new JScrollPane();
jscrollpane1.setViewportView(_logTextArea);
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpanel1.add(jscrollpane1, cc.xy(2, 6));
_logSeparator.setName("logSeparator");
_logSeparator.setText(Messages.getString("log"));
jpanel1.add(_logSeparator, cc.xy(2, 4));
_tab.setName("tab");
jpanel1.add(_tab, cc.xywh(1, 2, 3, 1));
addFillComponents(jpanel1, new int[] { 1, 2, 3 }, new int[] { 1, 3, 4, 5, 6, 7 });
return jpanel1;
}
use of com.jgoodies.forms.layout.CellConstraints in project cogtool by cogtool.
the class EnvironmentVarsForm method createPanel.
public JPanel createPanel() {
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:9DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
_envVarsTextArea.setName("envVarsTextArea");
JScrollPane jscrollpane1 = new JScrollPane();
jscrollpane1.setViewportView(_envVarsTextArea);
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpanel1.add(jscrollpane1, cc.xy(4, 2));
_envVarsLabel.setName("envVarsLabel");
_envVarsLabel.setText(Messages.getString("setVariables"));
jpanel1.add(_envVarsLabel, new CellConstraints(2, 2, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5 }, new int[] { 1, 2, 3 });
return jpanel1;
}
use of com.jgoodies.forms.layout.CellConstraints in project cogtool by cogtool.
the class EnvironmentVarsForm method addFillComponents.
/**
* Adds fill components to empty cells in the first row and first column of the grid.
* This ensures that the grid spacing will be the same as shown in the designer.
* @param cols an array of column indices in the first row where fill components should be added.
* @param rows an array of row indices in the first column where fill components should be added.
*/
void addFillComponents(Container panel, int[] cols, int[] rows) {
Dimension filler = new Dimension(10, 10);
boolean filled_cell_11 = false;
CellConstraints cc = new CellConstraints();
if (cols.length > 0 && rows.length > 0) {
if (cols[0] == 1 && rows[0] == 1) {
/** add a rigid area */
panel.add(Box.createRigidArea(filler), cc.xy(1, 1));
filled_cell_11 = true;
}
}
for (int index = 0; index < cols.length; index++) {
if (cols[index] == 1 && filled_cell_11) {
continue;
}
panel.add(Box.createRigidArea(filler), cc.xy(cols[index], 1));
}
for (int index = 0; index < rows.length; index++) {
if (rows[index] == 1 && filled_cell_11) {
continue;
}
panel.add(Box.createRigidArea(filler), cc.xy(1, rows[index]));
}
}
use of com.jgoodies.forms.layout.CellConstraints in project cogtool by cogtool.
the class HeaderForm method addFillComponents.
/**
* Adds fill components to empty cells in the first row and first column of the grid.
* This ensures that the grid spacing will be the same as shown in the designer.
* @param cols an array of column indices in the first row where fill components should be added.
* @param rows an array of row indices in the first column where fill components should be added.
*/
void addFillComponents(Container panel, int[] cols, int[] rows) {
Dimension filler = new Dimension(10, 10);
boolean filled_cell_11 = false;
CellConstraints cc = new CellConstraints();
if (cols.length > 0 && rows.length > 0) {
if (cols[0] == 1 && rows[0] == 1) {
/** add a rigid area */
panel.add(Box.createRigidArea(filler), cc.xy(1, 1));
filled_cell_11 = true;
}
}
for (int index = 0; index < cols.length; index++) {
if (cols[index] == 1 && filled_cell_11) {
continue;
}
panel.add(Box.createRigidArea(filler), cc.xy(cols[index], 1));
}
for (int index = 0; index < rows.length; index++) {
if (rows[index] == 1 && filled_cell_11) {
continue;
}
panel.add(Box.createRigidArea(filler), cc.xy(1, rows[index]));
}
}
Aggregations