public ImageCaptureView(org.alice.ide.capture.ImageCaptureComposite composite) { super(composite); java.awt.Toolkit toolkit = this.getAwtComponent().getToolkit(); StringBuilder sb = new StringBuilder(); sb.append("(screen dpi: "); sb.append(toolkit.getScreenResolution()); sb.append(")"); org.lgna.croquet.views.Label screenDpiLabel = new org.lgna.croquet.views.Label(sb.toString()); this.addComponent(composite.getOperationsHeader().createLabel(), "wrap"); this.addComponent( org.lgna.croquet.views.Separator.createInstanceSeparatingTopFromBottom(), "span 2, grow, shrink, wrap"); this.addComponent(composite.getCaptureEntireWindowOperation().createButton(), "skip, wrap"); this.addComponent( composite.getCaptureEntireContentPaneOperation().createButton(), "skip, wrap"); this.addComponent(composite.getCaptureRectangleOperation().createButton(), "skip, wrap"); this.addComponent(composite.getPropertiesHeader().createLabel(), "top 32, wrap"); this.addComponent( org.lgna.croquet.views.Separator.createInstanceSeparatingTopFromBottom(), "span 2, grow, shrink, wrap"); this.addComponent(composite.getDpiState().getSidekickLabel().createLabel(), "align right"); this.addComponent(composite.getDpiState().createSpinner(), "split 2"); this.addComponent(screenDpiLabel, "wrap"); this.addComponent(composite.getIsAlphaChannelState().createCheckBox(), "skip, wrap"); }
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); } }