public void addButton(final PlugInContext context) { if (!circleButtonAdded) { final ToolboxDialog toolbox = ((EditingPlugIn) context.getWorkbenchContext().getBlackboard().get(EditingPlugIn.KEY)) .getToolbox(context.getWorkbenchContext()); QuasimodeTool quasimodeTool = new QuasimodeTool(DrawConstrainedCircleTool.create(toolbox.getContext())); quasimodeTool.add(new QuasimodeTool.ModifierKeySpec(true, false, false), null); quasimodeTool.add(new QuasimodeTool.ModifierKeySpec(true, true, false), null); toolbox.add(quasimodeTool, null); toolbox.finishAddingComponents(); toolbox.validate(); circleButtonAdded = true; } }
public boolean execute(PlugInContext context) throws Exception { try { CursorTool circleTool = DrawConstrainedCircleTool.create((LayerNamePanelProxy) context.getActiveInternalFrame()); context.getLayerViewPanel().setCurrentCursorTool(circleTool); return true; } catch (Exception e) { context.getWorkbenchFrame().warnUser(errorSeeOutputWindow); context.getWorkbenchFrame().getOutputFrame().createNewDocument(); context .getWorkbenchFrame() .getOutputFrame() .addText("DrawConstrainedCircleTool Exception:" + e.toString()); return false; } }