Search in sources :

Example 1 with OCButton

use of doc_gui.OCButton 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;
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) GridBagConstraints(java.awt.GridBagConstraints) OCButton(doc_gui.OCButton) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel)

Aggregations

OCButton (doc_gui.OCButton)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 ImageIcon (javax.swing.ImageIcon)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1