コード例 #1
0
 private void registerScreenCaptureKeyStrokes(org.lgna.croquet.views.AbstractWindow<?> window) {
   org.alice.ide.capture.ImageCaptureComposite imageCaptureComposite =
       org.alice.ide.capture.ImageCaptureComposite.getInstance();
   window
       .getContentPane()
       .registerKeyboardAction(
           imageCaptureComposite
               .getCaptureEntireContentPaneOperation()
               .getImp()
               .getSwingModel()
               .getAction(),
           CAPTURE_ENTIRE_CONTENT_PANE_KEY_STROKE,
           org.lgna.croquet.views.SwingComponentView.Condition.WHEN_IN_FOCUSED_WINDOW);
   window
       .getContentPane()
       .registerKeyboardAction(
           imageCaptureComposite
               .getCaptureEntireWindowOperation()
               .getImp()
               .getSwingModel()
               .getAction(),
           CAPTURE_ENTIRE_WINDOW_KEY_STROKE,
           org.lgna.croquet.views.SwingComponentView.Condition.WHEN_IN_FOCUSED_WINDOW);
   if (window == this.getFrame()) {
     // pass
   } else {
     window
         .getContentPane()
         .registerKeyboardAction(
             imageCaptureComposite
                 .getCaptureRectangleOperation()
                 .getImp()
                 .getSwingModel()
                 .getAction(),
             CAPTURE_RECTANGLE_KEY_STROKE,
             org.lgna.croquet.views.SwingComponentView.Condition.WHEN_IN_FOCUSED_WINDOW);
   }
 }
コード例 #2
0
 private void unregisterScreenCaptureKeyStrokes(org.lgna.croquet.views.AbstractWindow<?> window) {
   window.getContentPane().unregisterKeyboardAction(CAPTURE_ENTIRE_WINDOW_KEY_STROKE);
   window.getContentPane().unregisterKeyboardAction(CAPTURE_ENTIRE_CONTENT_PANE_KEY_STROKE);
   window.getContentPane().unregisterKeyboardAction(CAPTURE_RECTANGLE_KEY_STROKE);
 }