skip to content

Eclipse Gef Tutorial -

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

@Override protected IFigure createFigure() Shape model = (Shape) getModel(); if (model instanceof RectangleShape) return new RectangleFigure(); else if (model instanceof EllipseShape) return new EllipseFigure(); // create similar return null; eclipse gef tutorial

// 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); // create similar return null

(root) – manages children:

@Override protected List<Shape> getModelChildren() return ((Diagram) getModel()).getShapes(); this.x = x

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

– Base class for all shapes:

Copyright © 2024 | SENDWO - WhatsApp Marketing Software