Ejemplo n.º 1
0
  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();
  }
Ejemplo n.º 2
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;
 }