/* * (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; }
private Dimension getInsSize(IReferencedFigure child) { return child.getSize(); }
/* * (non-Javadoc) * * @see * org.xmind.ui.tools.DummyCreateTool#updateDummyPosition(org.eclipse.draw2d * .IFigure, org.eclipse.draw2d.geometry.Point) */ protected void updateDummyPosition(IFigure dummy, Point pos) { this.position = pos; ((IReferencedFigure) dummy).setReference(pos); }