EditableOMGraphic addedEditable = ((EditableOMGraphicList) currentEditable).add(omg, this);
((EditableOMGraphicList) currentEditable).add(omg, this);
    public boolean select(OMGraphic omg, DrawingToolRequestor req, MouseEvent e) {        if (DEBUG) {            Debug.output("OMDrawingTool.select()");        }        OMGraphic ret = null;        boolean currentlyEditing = (getCurrentEditable() != null);        if (currentlyEditing) {            boolean repaintCanvas = true;            if (!(currentEditable instanceof EditableOMGraphicList)) {                if (DEBUG) {                    Debug.output("OMDrawingTool.select:  already working on OMGraphic, creating an EditableOMGraphicList for selection mode");                }                EditableOMGraphicList eomgl = new EditableOMGraphicList(new OMGraphicList());                eomgl.setProjection(getProjection());                DrawingToolRequestorList rl = new DrawingToolRequestorList();                // Add what's current to the requestor list                rl.add(currentEditable.getGraphic(), requestor);                // then add the current editable to the eomgl                eomgl.add(currentEditable);                currentEditable.removeEOMGListener(this);                // tell selectionlisteners to disregard the current                // thing.                setCurrentEditable(null);                // reset the requestor to the requestor list                requestor = rl;                // now reactivate with the eomgl                setCurrentEditable(eomgl);                if (DEBUG) {                    EditableOMGraphic ce = getCurrentEditable();                    Debug.output("OMDrawingTool: current editable is: "                            + (ce == null ? "null" : ce.getClass().getName()));                }                // Activate the list to make sure the listeners are                // set up                // so the map gets repainted with the new EOMG in                // selected mode                activate(false);                // Don't need to repaint if we call activate()                repaintCanvas = false;            } else {                // We already have an EditableOMGraphicList, just add                // the new stuff to it.                if (DEBUG) {                    Debug.output("OMDrawingTool.select:  already working on EditableOMGraphicList");                }            }            // OK, even if we've just created the new EOMGL and added            // a previous OMG to it, we still need to deal with the            // OMG that has just been added into the method.            EditableOMGraphic addedEditable = ((EditableOMGraphicList) currentEditable).add(omg,                    this);            if (requestor instanceof DrawingToolRequestorList) {                ((DrawingToolRequestorList) requestor).add(omg, req);            } else {                Debug.error("OHHHH, THE HORRORS!");                Thread.dumpStack();            }            // OK, make the EditableOMGraphic list react to the new            // mouse event, which will also set the state machine,            // which will flow to the new EditableOMGraphic.            ((EditableOMGraphicList) currentEditable).handleInitialMouseEvent(e);            // Make sure the list is returned.            ret = currentEditable.getGraphic();            // Only need to call canvas.repaint() if activate isn't            // called, and this is where that will happen. This makes            // the grab points show up on the new OMGraphic.            if (repaintCanvas && canvas != null) {                canvas.repaint();            }        } else {            if (DEBUG) {                Debug.output("OMDrawingTool.select:  activating for: "                        + omg.getClass().getName());            }            // Since this is the first OMG in the tool at this point,            // it's standard editing behavior....            ret = edit(omg, req, e);        }        return ret != null;    }