예제 #1
0
 /*
  * (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;
 }
예제 #2
0
 private Dimension getInsSize(IReferencedFigure child) {
   return child.getSize();
 }
예제 #3
0
 /*
  * (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);
 }