Example usage for javax.swing JRadioButton equals

List of usage examples for javax.swing JRadioButton equals

Introduction

In this page you can find the example usage for javax.swing JRadioButton equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:TArea.java

public void actionPerformed(ActionEvent e) {
    JRadioButton temp = (JRadioButton) e.getSource();

    if (temp.equals(addButton)) {
        canvas.area1 = new Area(canvas.gp);
        canvas.area1.add(canvas.area2);//w  w w. j av  a 2  s .co m
        canvas.drawFlag = false;
        canvas.fillFlag = true;
        canvas.repaint();
    } else if (temp.equals(subtractButton)) {
        canvas.area1 = new Area(canvas.gp);
        canvas.area1.subtract(canvas.area2);
        canvas.drawFlag = false;
        canvas.fillFlag = true;
        canvas.repaint();
    } else if (temp.equals(intersectButton)) {
        canvas.area1 = new Area(canvas.gp);
        canvas.area1.intersect(canvas.area2);
        canvas.drawFlag = false;
        canvas.fillFlag = true;
        canvas.repaint();
    } else if (temp.equals(exclusiveORButton)) {
        canvas.area1 = new Area(canvas.gp);
        canvas.area1.exclusiveOr(canvas.area2);
        canvas.drawFlag = false;
        canvas.fillFlag = true;
        canvas.repaint();
    } else if (temp.equals(resetButton)) {
        if (canvas.drawFlag == false) {
            canvas.area1 = new Area(canvas.gp);
            canvas.drawFlag = true;
            canvas.fillFlag = false;
            canvas.repaint();
        }
    }
}