org.eclipse.swt.widgets.Shell.redraw()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中org.eclipse.swt.widgets.Shell.redraw()方法的一些代码示例,展示了Shell.redraw()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.redraw()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:redraw

Shell.redraw介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

@Override
 public void run() {
  try {
   splash.redraw();
   LogChannel.UI.logBasic( "Redraw!" );
  } catch ( Throwable e ) {
   // ignore.
  }
 }
};

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt

public void removeAdornment(Adornment a) {
  adornments.remove(a);
  if (adornments.isEmpty()) {
    overlayShell.setVisible(false);
  } else {
    overlayShell.redraw();
  }
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

public void addAdornment(Adornment a) {
  adornments.add(a);
  updateRegion();
  overlayShell.redraw();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt

public void addAdornment(Adornment a) {
  adornments.add(a);
  updateRegion();
  overlayShell.redraw();
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

public void removeAdornment(Adornment a) {
  adornments.remove(a);
  if (adornments.size() == 0)
    overlayShell.setVisible(false);
  else
    overlayShell.redraw();
}

代码示例来源:origin: tvrenamer/tvrenamer

/**
 * Toggle whether the or not the listed {@link Control}s are enabled, based off the of
 * the given state value.
 *
 * @param state the boolean to set the other controls to
 * @param controls the list of controls to update
 */
private void toggleEnableControls(boolean state, Control... controls) {
  for (Control control : controls) {
    control.setEnabled(state);
  }
  preferencesShell.redraw();
}

代码示例来源:origin: org.eclipse/org.eclipse.help.ui

public void controlMoved(ControlEvent e) {
    if (HelpUIPlugin.DEBUG_INFOPOP) {
      System.out
          .println("ContextHelpDialog: shell control adapter called."); //$NON-NLS-1$
    }
    Rectangle clientArea = shell.getClientArea();
    shell.redraw(clientArea.x, clientArea.y, clientArea.width,
        clientArea.height, true);
    shell.update();
  }
});

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

boolean runSettings () {
  if (!runSettings) return false;
  runSettings = false;
  initColors ();
  sendEvent (SWT.Settings, null);
  Shell [] shells = getShells ();
  for (int i=0; i<shells.length; i++) {
    Shell shell = shells [i];
    if (!shell.isDisposed ()) {
      shell.redraw (true);
      shell.layout (true, true);
    }
  }
  return true;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

boolean runSettings () {
  if (!runSettings) return false;
  runSettings = false;
  saveResources ();
  initializeSystemColors ();
  sendEvent (SWT.Settings, null);
  Shell [] shells = getShells ();
  for (int i=0; i<shells.length; i++) {
    Shell shell = shells [i];
    if (!shell.isDisposed ()) {
      shell.fixStyle ();
      shell.redraw (true);
      shell.layout (true, true);
    }
  }
  return true;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

boolean runSettings () {
  if (!runSettings) return false;
  runSettings = false;
  saveResources ();
  initializeSystemColors ();
  sendEvent (SWT.Settings, null);
  Shell [] shells = getShells ();
  for (int i=0; i<shells.length; i++) {
    Shell shell = shells [i];
    if (!shell.isDisposed ()) {
      shell.fixStyle ();
      shell.redraw (true);
      shell.layout (true, true);
    }
  }
  return true;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

boolean runSettings () {
  if (!runSettings) return false;
  runSettings = false;
  saveResources ();
  initializeSystemColors ();
  sendEvent (SWT.Settings, null);
  Shell [] shells = getShells ();
  for (int i=0; i<shells.length; i++) {
    Shell shell = shells [i];
    if (!shell.isDisposed ()) {
      shell.fixStyle ();
      shell.redraw (true);
      shell.layout (true, true);
    }
  }
  return true;
}

代码示例来源:origin: stackoverflow.com

private static void bringupDialog(WindowState state) {
  final Shell workbenchShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();

  //bring up the application to front
  workbenchShell.setVisible( true );
  workbenchShell.setMinimized( false );
  workbenchShell.redraw();

  //focus on dialog
  workbenchShell.setActive();
  workbenchShell.forceActive();
  workbenchShell.setFocus();
  workbenchShell.forceFocus();
  workbenchShell.moveAbove( null );
  workbenchShell.redraw();

  Shell shell = instance.getShell(); // desired window shell
  shell.setActive();
  shell.forceActive();
  shell.setFocus();
  shell.forceFocus();
  shell.moveAbove( null );

  shell.redraw();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui

void setText(String t, Rectangle decorationRectangle, Control targetControl) {
 if(t == null) {
  t = EMPTY;
 }
 if(!t.equals(text)) {
  Point oldSize = getExtent();
  text = t;
  hoverShell.redraw();
  Point newSize = getExtent();
  if(!oldSize.equals(newSize)) {
   // set a flag that indicates the direction of arrow
   arrowOnLeft = decorationRectangle.x <= targetControl.getLocation().x;
   setNewShape();
  }
 }
 Point extent = getExtent();
 int y = -extent.y - hah + 1;
 int x = arrowOnLeft ? -hao + haw / 2 : -extent.x + hao + haw / 2;
 hoverShell.setLocation(control.getParent().toDisplay(decorationRectangle.x + x, decorationRectangle.y + y));
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

void setText(String t, Control hoverNear, Control targetControl) {
  if (t == null) {
    t = EMPTY;
  }
  if (!t.equals(text)) {
    Point oldSize = getExtent();
    text = t;
    hoverShell.redraw();
    Point newSize = getExtent();
    if (!oldSize.equals(newSize)) {
      // set a flag that indicates the direction of arrow
      arrowOnLeft = hoverNear.getLocation().x <= targetControl
          .getLocation().x;
      setNewShape();
    }
  }
  if (hoverNear != null) {
    Point extent = getExtent();
    int y = -extent.y - hah + 1;
    int x = arrowOnLeft ? -hao + haw / 2 : -extent.x + hao + haw
        / 2;
    hoverShell.setLocation(hoverNear.toDisplay(x, y));
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

void setText(String t, Control hoverNear, Control targetControl) {
  if (t == null) {
    t = EMPTY;
  }
  if (!t.equals(text)) {
    Point oldSize = getExtent();
    text = t;
    hoverShell.redraw();
    Point newSize = getExtent();
    if (!oldSize.equals(newSize)) {
      // set a flag that indicates the direction of arrow
      arrowOnLeft = hoverNear.getLocation().x <= targetControl
          .getLocation().x;
      setNewShape();
    }
  }
  if (hoverNear != null) {
    Point extent = getExtent();
    int y = -extent.y - hah + 1;
    int x = arrowOnLeft ? -hao + haw / 2 : -extent.x + hao + haw
        / 2;
    hoverShell.setLocation(hoverNear.toDisplay(x, y));
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

@Override
  public void widgetSelected(SelectionEvent e) {
    FilterTypeUtil.setValue(filter, FilterTypeUtil.ID, idCombo
        .getItem(idCombo.getSelectionIndex()));
    if (filter.hasStringArguments())
      filter.setArguments(""); //$NON-NLS-1$
    setupPatternLine();
    currentCustomFilterArgumentUI.selectionChanged();
    getShell().layout(true);
    Point size = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
    Point shellSize = getShell().getSize();
    size.x = Math.max(size.x, shellSize.x);
    size.y = Math.max(size.y, shellSize.y);
    getShell().setSize(size);
    getShell().redraw();
  }
});

代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt

private void defineRegion() {
  Region rgn = new Region();
  for (Rectangle r : rects) {
    rgn.add(r);
    rgn.subtract(r.x + 2, r.y + 2, r.width - 4, r.height - 4);
  }
  if (feedbackShell.getRegion() != null && !feedbackShell.getRegion().isDisposed())
    feedbackShell.getRegion().dispose();
  feedbackShell.setRegion(rgn);
  feedbackShell.redraw();
  display.update();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

void setText(String t, Rectangle decorationRectangle,
    Control targetControl) {
  if (t == null) {
    t = EMPTY;
  }
  if (!t.equals(text)) {
    Point oldSize = getExtent();
    text = t;
    hoverShell.redraw();
    Point newSize = getExtent();
    if (!oldSize.equals(newSize)) {
      // set a flag that indicates the direction of arrow
      arrowOnLeft = decorationRectangle.x <= targetControl
          .getLocation().x;
      setNewShape();
    }
  }
  Point extent = getExtent();
  int y = -extent.y - hah + 1;
  int x = arrowOnLeft ? -hao + haw / 2 : -extent.x + hao + haw / 2;
  Point hoverSize = hoverShell.getSize();
  Rectangle hoverBounds = control.getDisplay().map(control.getParent(), null, decorationRectangle.x + x, decorationRectangle.y + y, hoverSize.x, hoverSize.y);
  hoverShell.setLocation(hoverBounds.x, hoverBounds.y);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui

/**
 * Something has changed, requiring redraw. Redraw the decoration and update the hover text if appropriate.
 */
protected void update() {
 if(control == null || control.isDisposed()) {
  return;
 }
 Rectangle rect = getDecorationRectangle(control.getShell());
 // Redraw this rectangle in all children
 control.getShell().redraw(rect.x, rect.y, rect.width, rect.height, true);
 control.getShell().update();
 if(hover != null && getDescriptionText() != null) {
  hover.setText(getDescriptionText(), getDecorationRectangle(control.getParent()), control);
 }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt

private void defineRegion() {
  Region rgn = new Region();
  for (Rectangle r : rects) {
    rgn.add(r);
    rgn.subtract(r.x + 2, r.y + 2, r.width - 4, r.height - 4);
  }
  // Workaround: Some window managers draw a drop shadow even if the shell
  // is set to NO_TRIM. By making the shell contain a component in the
  // bottom-right of its parent shell, SWT won't resize it and any extra
  // shadows will end up being drawn on top of the shadows for the parent
  // shell rather than in the middle of the workbench window.
  Composite parent = feedbackShell.getParent();
  if (parent instanceof Shell) {
    Shell parentShell = (Shell) parent;
    Rectangle bounds = parentShell.getBounds();
    rgn.add(bounds.width - 1, bounds.height - 1, 1, 1);
  }
  if (feedbackShell.getRegion() != null && !feedbackShell.getRegion().isDisposed()) {
    feedbackShell.getRegion().dispose();
  }
  feedbackShell.setRegion(rgn);
  feedbackShell.redraw();
  display.update();
}

相关文章

微信公众号

最新文章

更多

Shell类方法