Your pet company

Eclipse Gef Tutorial File

(root) – manages children:

private PropertyChangeSupport listeners = new PropertyChangeSupport(this); private int x, y, width, height;

:

@Override protected PaletteRoot getPaletteRoot() // return palette with creation tools (optional) return null; // for minimal

// Getters & Setters with property change firing public int getX() return x; public void setX(int x) int old = this.x; this.x = x; listeners.firePropertyChange(LOCATION_PROP, old, x); eclipse gef tutorial

editor/ShapeEditor.java :

public class ShapeEditPart extends AbstractGraphicalEditPart private int x

public class DiagramEditPart extends AbstractGraphicalEditPart @Override protected IFigure createFigure() Layer lay = new FreeformLayer(); lay.setLayoutManager(new FreeformLayout()); return lay; @Override protected void createEditPolicies() installEditPolicy(EditPolicy.LAYOUT_ROLE, new FreeformLayoutEditPolicy());

public abstract void accept(ShapeVisitor visitor); this.x = x

Shopping cart close