OMRect rect = (OMRect) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRect", fga, layer, false); if (rect != null) { rect.setAppObject(internalKey);
EditableOMPoly eomp = new EditableOMPoly(fga); eomp.setEnclosed(true); eomp.setShowGUI(false);  dt.setBehaviorMask(OMDrawingTool.QUICK_CHANGE_BEHAVIOR_MASK); OMPoly poly = (OMPoly) getDrawingTool().edit(eomp, layer);  if (poly != null) { poly.setIsPolygon(true); poly.setAppObject(internalKey);
            public void actionPerformed(ActionEvent event) {                DrawingTool dt = getDrawingTool();                if (dt != null) {                    GraphicAttributes fga = getFilterGA();                    fga.setFillPaint(new OMColor(0x0c0a0a0a));                    OMRect rect = (OMRect) getDrawingTool().create("com.bbn.openmap.omGraphics.OMRect",                            fga,                            layer,                            false);                    if (rect != null) {                        rect.setAppObject(internalKey);                    } else {                        Debug.error("DemoLayer: Drawing tool can't create OMRect");                    }                } else {                    Debug.output("DemoLayer can't find a drawing tool");                }            }