private void pack() { if (branchDummy == null) return; if (request != null) { Object param = request.getParameter(MindMapUI.PARAM_PROPERTY_PREFIX + Core.StructureClass); if (param instanceof String) { branchDummy.getTopic().setStructureClass((String) param); } } branchDummy.pack(); }
/* * (non-Javadoc) * * @see * org.xmind.ui.tools.DummyCreateTool#destroyDummy(org.eclipse.draw2d.IFigure * ) */ protected void destroyDummy(IFigure dummy) { if (branchDummy != null) { branchDummy.dispose(); branchDummy = null; } super.destroyDummy(dummy); }
/* * (non-Javadoc) * * @see org.xmind.ui.tools.DummyCreateTool#doCreateDummy() */ protected IFigure doCreateDummy() { if (branchDummy == null) { branchDummy = new BranchDummy(getTargetViewer(), true); branchDummy.getTopic().setTitleText(MindMapMessages.TitleText_FloatingTopic); pack(); } IFigure figure = branchDummy.getBranch().getFigure(); if (getCursorPosition() != null) { if (figure instanceof IReferencedFigure) { ((IReferencedFigure) figure).setReference(getCursorPosition()); } else { Dimension size = figure.getSize(); figure.setLocation(getCursorPosition().getTranslated(-size.width / 2, -size.height / 2)); } } return figure; }