Tutorial: Eclipse Gef

Tutorial: Eclipse Gef

– similar. 4. Create the Figure (Draw2D) Visual representation.

// 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

@Override protected void refreshVisuals() Shape model = (Shape) getModel(); Rectangle bounds = new Rectangle(model.getX(), model.getY(), model.getWidth(), model.getHeight()); ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), bounds); – similar

@Override public void setBounds(Rectangle rect) super.setBounds(rect); // any custom layout logic this.x = x