Package org.eclipse.gef

Examples of org.eclipse.gef.GraphicalEditPart


  Command result = null;
  List selection = getSelectedObjects();
  if (selection != null && selection.size() == 1) {
    Object obj = selection.get(0);
    if (obj instanceof GraphicalEditPart) {
      GraphicalEditPart gep = (GraphicalEditPart)obj;
      Object template = getClipboardContents();
      if (template != null) {
        CreationFactory factory = getFactory(template);
        if (factory != null) {
          CreateRequest request = new CreateRequest();
          request.setFactory(factory);
          request.setLocation(getPasteLocation(gep));
          result = gep.getCommand(request);
        }
      }
    }
  }
  return result;
View Full Code Here


 
  EditPart after = getInsertionReference(request);
  int index = getHost().getChildren().indexOf(after);
 
  Iterator i = request.getEditParts().iterator();
  GraphicalEditPart currPart = null;
 
  while (i.hasNext()) {
    currPart = (GraphicalEditPart)i.next();
    clone.addPart((LogicSubpart)currPart.getModel(), index++);
  }
 
  return clone;
}
View Full Code Here

protected Command getAddCommand(Request generic) {
  ChangeBoundsRequest request = (ChangeBoundsRequest)generic;
  List editParts = request.getEditParts();
  CompoundCommand command = new CompoundCommand();
  command.setDebugLabel("Add in ConstrainedLayoutEditPolicy");//$NON-NLS-1$
  GraphicalEditPart childPart;
  Rectangle r;
  Object constraint;

  for (int i = 0; i < editParts.size(); i++) {
    childPart = (GraphicalEditPart)editParts.get(i);
    r = childPart.getFigure().getBounds().getCopy();
    //convert r to absolute from childpart figure
    childPart.getFigure().translateToAbsolute(r);
    r = request.getTransformedRectangle(r);
    //convert this figure to relative
    getLayoutContainer().translateToRelative(r);
    getLayoutContainer().translateFromParent(r);
    r.translate(getLayoutOrigin().getNegated());
View Full Code Here

  CloneCommand clone = new CloneCommand();
 
  clone.setParent((LogicDiagram)getHost().getModel());
 
  Iterator i = request.getEditParts().iterator();
  GraphicalEditPart currPart = null;
 
  while (i.hasNext()) {
    currPart = (GraphicalEditPart)i.next();
    clone.addPart((LogicSubpart)currPart.getModel(),
        (Rectangle)getConstraintForClone(currPart, request));
  }
 
  // Attach to horizontal guide, if one is given
  Integer guidePos = (Integer)request.getExtendedData()
View Full Code Here

TOP

Related Classes of org.eclipse.gef.GraphicalEditPart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.