28293031323334
public abstract class Shape extends Figure { public Shape() { GridLayout layout = new GridLayout(1, false); super.setLayoutManager(layout); add(new ImageFigure(getShapeImage()), new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 1, 1)); }
213214215216217218219220221222223224
{ Point realLocation = this.getConfigurationManager().getDiagramEditor().calculateRealMouseLocation(mouseLocation); List<ImagePart> imageParts = getContainedImageParts(); for (ImagePart imagePart : imageParts) { ImageFigure imageFigure = (ImageFigure)getPartFigure(imagePart); if (imageFigure != null && imageFigure.getBounds().contains(realLocation)) { return imagePart; } } return null;