Package org.eclipse.gef.editparts

Examples of org.eclipse.gef.editparts.AbstractGraphicalEditPart


*/
public class RecordPartFactory implements EditPartFactory {

  @Override
  public EditPart createEditPart(EditPart context, Object model) {
    AbstractGraphicalEditPart part = null;

    if (model instanceof SVGRootRecord) {
      part = new SVGRootPart();
    } else if (model instanceof SVGRectRecord) {
      part = new SVGRectPart();
    } else if (model instanceof SVGPolylineRecord) {
      part = new SVGPolylinePart();
    } else if (model instanceof SVGEllipseRecord) {
      part = new SVGEllipsePart();
    }

    if (part != null)
      part.setModel(model);

    return part;
  }
View Full Code Here


*
*/
public class EditPartFactoryImpl implements EditPartFactory {

  public EditPart createEditPart(EditPart context, Object model) {
    AbstractGraphicalEditPart child = null;

    if (model instanceof Graph) {
      child = new GraphEditPart();
    } else if (model instanceof Vertex) {
      child = new VertexEditPart();
    } else if (model instanceof Edge) {
      child = new EdgeEditPart();
    } else if (model instanceof IStatus) {
      child = new StatusEditPart();
    }

    if (child != null) {
      child.setModel(model);
    }

    return child;
  }
View Full Code Here

import com.dmissoh.biologic.models.Sequence;

public class GraphEditPartFactory implements EditPartFactory {

  public EditPart createEditPart(EditPart context, Object model) {
    AbstractGraphicalEditPart part = null;
    if(model instanceof Sequence){
      part = new GraphPart();
    }else if(model instanceof Event){
      part = new EventPart();
    }
    part.setModel(model);
    return part;
  }
View Full Code Here

  private void identifySourceFigure(Request req) {
    if (req instanceof CreateConnectionRequest) {
      CreateConnectionRequest r = (CreateConnectionRequest) req;
      if (r.getSourceEditPart() instanceof AbstractGraphicalEditPart) {
        AbstractGraphicalEditPart ep = (AbstractGraphicalEditPart) r.getSourceEditPart();
        rec = ep.getFigure().getBounds();
      }
    } else {
      rec = null;
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.gef.editparts.AbstractGraphicalEditPart

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.