sMetricsComposite.layout( true, true );
sMetricsComposite.layout( true, true );
@Override public void controlResized( ControlEvent event ) { layout(); // layout( false ); } };
@Override public void handleEvent(Event e) { if (e.type != SWT.Resize) return; layout(false); } };
@Override public void controlResized( ControlEvent event ) { handleScrollbars(); scrolledComposite.layout( true, true ); } } );
@Override public void layout(boolean changed) { if (ignoreLayouts) { return; } ignoreLayouts = true; ignoreResizes = true; super.layout(changed); ignoreResizes = false; }
@Override public void handleEvent(Event e) { if (e.type != SWT.Resize) return; layout(false); } };
@Override public void layout(boolean changed) { if (ignoreLayouts) { return; } ignoreLayouts = true; ignoreResizes = true; super.layout(changed); ignoreResizes = false; }
@Override public void handleEvent(Event e) { if (e.type != SWT.Resize) return; layout(false); } };
public void handleEvent(Event e) { if (e.type != SWT.Resize) return; layout(false); } };
@Override public void handleEvent(Event e) { if (e.type != SWT.Resize) return; layout(false); } };
/** * Specify the minimum width and height at which the ScrolledComposite will begin scrolling the * content with the horizontal scroll bar. This value is only relevant if * setExpandHorizontal(true) and setExpandVertical(true) have been set. * * @param width the minimum width or 0 for default width * @param height the minimum height or 0 for default height * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setMinSize(int width, int height) { checkWidget(); if (width == minWidth && height == minHeight) return; minWidth = Math.max(0, width); minHeight = Math.max(0, height); layout(false); } /**
/** * Configure the ScrolledComposite to resize the content object to be as tall as the * ScrolledComposite when the height of the ScrolledComposite is greater than the * minimum height specified in setMinHeight. If the ScrolledComposite is less than the * minimum height, the content will not be resized and instead the vertical scroll bar will be * used to view the entire height. * If expand is false, this behaviour is turned off. By default, this behaviour is turned off. * * @param expand true to expand the content control to fill available vertical space * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setExpandVertical(boolean expand) { checkWidget(); if (expand == expandVertical) return; expandVertical = expand; layout(false); } /**
/** * Specify the minimum width and height at which the ScrolledComposite will begin scrolling the * content with the horizontal scroll bar. This value is only relevant if * setExpandHorizontal(true) and setExpandVertical(true) have been set. * * @param width the minimum width or 0 for default width * @param height the minimum height or 0 for default height * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setMinSize(int width, int height) { checkWidget(); if (width == minWidth && height == minHeight) return; minWidth = Math.max(0, width); minHeight = Math.max(0, height); layout(false); } /**
public void setCanvasSize(int canvasWidth, int canvasHeight) { if(canvasWidth > width || this.canvasWidth <= 0) { this.canvasWidth = canvasWidth; } if(canvasHeight > height || this.canvasHeight <= 0) { this.canvasHeight = canvasHeight; } if(canvasHeight > 0 && canvasWidth > 0){ imageCanvas.setSize(this.canvasWidth, this.canvasHeight); scrollComposite.setMinSize(this.canvasWidth, this.canvasHeight); scrollComposite.layout(); } }
public void propertyChange(PropertyChangeEvent event) { for (Iterator iterator = fBannerLabels.iterator(); iterator.hasNext();) { Label label = (Label) iterator.next(); label.setFont(JFaceResources.getBannerFont()); } for (Iterator iterator = fHeaderLabels.iterator(); iterator.hasNext();) { Label label = (Label) iterator.next(); label.setFont(JFaceResources.getHeaderFont()); } Control control= fScrolledComposite.getContent(); fScrolledComposite.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT)); fScrolledComposite.setContent(control); fScrolledComposite.layout(true); fScrolledComposite.redraw(); }
/** * When any <code>ProgressReporterPanel</code> in this window is expanded or collapsed * re-layout the controls and window appropriately */ @Override public void isCollapsed(boolean value) { if (null != shell && !shell.isDisposed()) { scrollable.setRedraw(false); Rectangle r = scrollable.getClientArea(); scrollable.setMinSize(scrollChild.computeSize(r.width, SWT.DEFAULT)); /* * Resizing to fit the panel if there is only one */ if (pReporters.length == 1) { Point p = shell.computeSize(defaultShellWidth, SWT.DEFAULT); if (shell.getSize().y != p.y) { p.x = shell.getSize().x; shell.setSize(p); } } scrollable.layout(); scrollable.setRedraw(true); } }
protected void handlePropertyChange(PropertyChangeEvent event) { if (fHeader != null) fHeader.setFont(JFaceResources.getHeaderFont()); if (fBanner != null) fBanner.setFont(JFaceResources.getBannerFont()); Control control= fScrolledComposite.getContent(); fScrolledComposite.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT)); fScrolledComposite.setContent(control); fScrolledComposite.layout(true); fScrolledComposite.redraw(); }
/** * Handles the property change. * * @param event the property change event object describing which property changed and how */ protected void handlePropertyChange(PropertyChangeEvent event) { if (fHeader != null) fHeader.setFont(JFaceResources.getHeaderFont()); if (fBanner != null) fBanner.setFont(JFaceResources.getBannerFont()); Control control= fScrolledComposite.getContent(); fScrolledComposite.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT)); fScrolledComposite.setContent(control); fScrolledComposite.layout(true); fScrolledComposite.redraw(); }
/** * Handles the property change. * * @param event the property change event object describing which property changed and how */ protected void handlePropertyChange(PropertyChangeEvent event) { if (fHeader != null) fHeader.setFont(JFaceResources.getHeaderFont()); if (fBanner != null) fBanner.setFont(JFaceResources.getBannerFont()); Control control= fScrolledComposite.getContent(); fScrolledComposite.setMinSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT)); fScrolledComposite.setContent(control); fScrolledComposite.layout(true); fScrolledComposite.redraw(); }