예제 #1
0
 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;
 }
예제 #2
0
 public ViewAreaType viewAreaType(final Location location) {
   if (onOverlay(location)) {
     location.subtract(overlayView.getLocation());
     return overlayView.viewAreaType(location);
   } else {
     return rootView.viewAreaType(location);
   }
 }
예제 #3
0
 public View pickupView(final Location location) {
   if (onOverlay(location)) {
     location.subtract(overlayView.getLocation());
     return overlayView.pickupView(location);
   } else {
     return rootView.pickupView(location);
   }
 }
예제 #4
0
 public void mouseMoved(final Location location) {
   if (onOverlay(location)) {
     location.subtract(overlayView.getLocation());
     overlayView.mouseMoved(location);
   } else {
     rootView.mouseMoved(location);
   }
 }
예제 #5
0
 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);
   }
 }
예제 #6
0
 public View dragFrom(final Location location) {
   if (onOverlay(location)) {
     location.subtract(overlayView.getLocation());
     return overlayView.dragFrom(location);
   } else {
     return rootView.dragFrom(location);
   }
 }
예제 #7
0
 @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);
 }