use of java.awt.GridBagConstraints in project OpenNotebook by jaltekruse.
the class ObjectPropertiesFrame method createExpressionModifier.
private JPanel createExpressionModifier() {
JPanel newPanel = new JPanel();
newPanel.setLayout(new GridBagLayout());
ImageIcon pic;
new OCButton(ExpressionObject.SUB_IN_VALUE, 4, 1, 0, 0, newPanel) {
public void associatedAction() {
buttonAction(ExpressionObject.SUB_IN_VALUE);
}
};
new OCButton(ExpressionObject.MODIFY_EXPRESSION, 4, 1, 0, 1, newPanel) {
public void associatedAction() {
buttonAction(ExpressionObject.MODIFY_EXPRESSION);
}
};
new OCButton(ExpressionObject.MANUALLY_TYPE_STEP, 4, 1, 0, 2, newPanel) {
public void associatedAction() {
buttonAction(ExpressionObject.MANUALLY_TYPE_STEP);
}
};
new OCButton(ExpressionObject.UNDO_STEP, 4, 1, 0, 3, newPanel) {
public void associatedAction() {
buttonAction(ExpressionObject.UNDO_STEP);
}
};
GridBagConstraints con = new GridBagConstraints();
con.fill = GridBagConstraints.HORIZONTAL;
con.gridx = 0;
con.gridy = 4;
con.gridwidth = 4;
con.weightx = 1;
con.weighty = .02;
newPanel.add(new JLabel("Apply to both sides"), con);
createButton(ExpressionObject.ADD_TO_BOTH_SIDES, 1, 1, 0, 5, newPanel);
createButton(ExpressionObject.SUBTRACT_FROM_BOTH_SIDES, 1, 1, 1, 5, newPanel);
createButton(ExpressionObject.MULTIPLY_BOTH_SIDES, 1, 1, 2, 5, newPanel);
createButton(ExpressionObject.DIVIDE_BOTH_SIDES, 1, 1, 3, 5, newPanel);
new OCButton(ExpressionObject.OTHER_OPERATIONS, 4, 1, 0, 6, newPanel) {
public void associatedAction() {
buttonAction(ExpressionObject.OTHER_OPERATIONS);
}
};
return newPanel;
}
use of java.awt.GridBagConstraints in project OpenNotebook by jaltekruse.
the class ObjectPropertiesFrame method generatePanel.
public JPanel generatePanel(Document doc, DocViewerPanel docPanel) {
JPanel panel = new JPanel();
if (doc != null) {
panel.setLayout(new GridBagLayout());
GridBagConstraints con = new GridBagConstraints();
con.fill = GridBagConstraints.BOTH;
con.weightx = 1;
con.weighty = 1;
con.insets = new Insets(2, 0, 2, 0);
con.gridx = 0;
con.gridy = 0;
for (MathObjectAttribute mAtt : doc.getAttributes()) {
if (docPanel.isInStudentMode() && mAtt.isStudentEditable() || !docPanel.isInStudentMode()) {
// only show editing dialog if in teacher mode (not student)
//or if the attribute has been left student editable
panel.add(getAdjuster(mAtt, notebookPanel, panel), con);
con.gridy++;
}
}
}
return panel;
}
use of java.awt.GridBagConstraints in project groovy by apache.
the class TableLayout method addCell.
/**
* Adds a new cell to the current grid
* @param cell the td component
*/
public void addCell(TableLayoutCell cell) {
GridBagConstraints constraints = cell.getConstraints();
constraints.insets = new Insets(cellpadding, cellpadding, cellpadding, cellpadding);
add(cell.getComponent(), constraints);
}
use of java.awt.GridBagConstraints in project jreversepro by akkumar.
the class CustomListPanel method addComponents.
/**
* Adds the components.
**/
private void addComponents() {
// GridBagLayout grid = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
c.gridwidth = GridBagConstraints.REMAINDER;
add(mLblList, c);
c.gridwidth = 1;
add(mLblGoto, c);
add(mTxtIndex, c);
c.gridwidth = GridBagConstraints.REMAINDER;
add(mBtnGoto, c);
c.gridwidth = 1;
add(mTxtSearch, c);
add(mChooseType, c);
c.gridwidth = GridBagConstraints.REMAINDER;
add(mBtnFind, c);
}
use of java.awt.GridBagConstraints in project qi4j-sdk by Qi4j.
the class EntityViewer method $$$setupUI$$$.
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
*/
private void $$$setupUI$$$() {
mainPane = new JPanel();
mainPane.setLayout(new BorderLayout(0, 0));
splitPane = new JSplitPane();
mainPane.add(splitPane, BorderLayout.CENTER);
propertiesAreaPane = new JPanel();
propertiesAreaPane.setLayout(new BorderLayout(0, 0));
splitPane.setRightComponent(propertiesAreaPane);
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridBagLayout());
propertiesAreaPane.add(panel1, BorderLayout.NORTH);
entitiesCombo = new JComboBox();
GridBagConstraints gbc;
gbc = new GridBagConstraints();
gbc.gridx = 2;
gbc.gridy = 0;
gbc.gridwidth = 3;
gbc.weightx = 0.3;
gbc.anchor = GridBagConstraints.WEST;
gbc.fill = GridBagConstraints.HORIZONTAL;
panel1.add(entitiesCombo, gbc);
final JLabel label1 = new JLabel();
label1.setText("Entity");
gbc = new GridBagConstraints();
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.WEST;
panel1.add(label1, gbc);
final JPanel spacer1 = new JPanel();
gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
panel1.add(spacer1, gbc);
}
Aggregations