@Override
	public void actionPerformed(ActionEvent action) {
		if(currentOp != -1) { // if a button is already pressed
			if(action.getSource() == buttons[currentOp]) { // if the presssed button is pressed again
				buttons[currentOp].setSelected(false);
				currentOp = NONE_SELECTED;
				return;
			}
		}

		if(action.getSource() == buttons[ADD_NODE])
			setCurrentOperation(ADD_NODE);
		else if(action.getSource() == buttons[RM_NODE])
			setCurrentOperation(RM_NODE);

		else if(action.getSource() == buttons[RM_NODE])
			setCurrentOperation(RM_NODE);

		else if(action.getSource() == buttons[ADD_EDGE])
			setCurrentOperation(ADD_EDGE);

		else if(action.getSource() == buttons[RM_EDGE])
			setCurrentOperation(RM_EDGE);
	}