117118119120121122123124125126127
public TitleFigure() { super(); setLayoutManager(new TitleLayout()); setOpaque(true); setBackgroundColor(CommonUIPlugin.getDefault().getColorRegistry().get(IDetailsColors.COLOR_LIGHT_BACKGROUND)); add(new ImageFigure(getLabelProvider().getImage(getModel()))); textLabel = new Label(getLabelProvider().getText(getModel())); textLabel.setLabelAlignment(PositionConstants.LEFT); add(textLabel); removeButton = new NoBorderButton(CommonUIPlugin.getDefault().getImageRegistry().get(ICommonUIConstants.ICON_TRAY_CATEGORY_REMOVE_BUTTON)) {
122123124125126127128129130
} } }); trayComposite.addListener(TrayComposite.EVENT_COLLAPSED_STATE_CHANGED, new Listener() { public void handleEvent(Event event) { setContents(new ImageFigure(getButtonImage())); } }); }
20212223242526
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)); }
28293031323334
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;