private Location center(final View workspace, final View view) { final Size rootSize = workspace.getSize(); final Location location = new Location(rootSize.getWidth() / 2, rootSize.getHeight() / 2); final Size dialogSize = view.getRequiredSize(new Size(rootSize)); location.subtract(dialogSize.getWidth() / 2, dialogSize.getHeight() / 2); return location; }
public ViewAreaType viewAreaType(final Location location) { if (onOverlay(location)) { location.subtract(overlayView.getLocation()); return overlayView.viewAreaType(location); } else { return rootView.viewAreaType(location); } }
public View pickupView(final Location location) { if (onOverlay(location)) { location.subtract(overlayView.getLocation()); return overlayView.pickupView(location); } else { return rootView.pickupView(location); } }
public void mouseMoved(final Location location) { if (onOverlay(location)) { location.subtract(overlayView.getLocation()); overlayView.mouseMoved(location); } else { rootView.mouseMoved(location); } }
public View identifyView(final Location location, final boolean includeOverlay) { if (includeOverlay && onOverlay(location)) { location.subtract(overlayView.getLocation()); return overlayView.identify(location); } else { return rootView.identify(location); } }
public View dragFrom(final Location location) { if (onOverlay(location)) { location.subtract(overlayView.getLocation()); return overlayView.dragFrom(location); } else { return rootView.dragFrom(location); } }
@Override public void showInOverlay(final Content content, final Location location) { View view; view = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.OPEN)); view = new LineBorder( 2, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2), new BackgroundBorder(Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3), view)); final Size size = view.getRequiredSize(Size.createMax()); location.subtract(size.getWidth() / 2, size.getHeight() / 2); view.setLocation(location); setOverlayView(view); }