public void enableEditor(final boolean b) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				if (toolBar != null) {
					if (!b) {
						try {
							((AbstractButton) toolBar.getClientProperty("Select button")).doClick();
						} catch (Exception e) {
							System.err.println("No selection button was found.");
						}
					}
					for (int i = 0, n = toolBar.getComponentCount(); i < n; i++) {
						toolBar.getComponent(i).setEnabled(b);
					}
				}
			}
		});
		if (!b) {
			clearSelection();
			actionID = SELE_ID;
			resetUndoManager();
			repaint();
			EventQueue.invokeLater(new Runnable() {
				public void run() {
					setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
				}
			});
		}
		doNotFireUndoEvent = !b;
	}