Examples of Display


Examples of org.eclipse.swt.widgets.Display

          }
        });
    } catch (Exception e) {
      e.printStackTrace();
    }
    Display d = Display.getDefault();
    while (true) {
      if (!d.readAndDispatch()) {
        d.sleep();
      }
    }
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

        // TODO: support composite, image, etc
        if (oToolTip == null || !(oToolTip instanceof String))
          return;
        String sToolTip = (String) oToolTip;

        Display d = table.getDisplay();
        if (d == null)
          return;

        // We don't get mouse down notifications on trim or borders..
        toolTipShell = new Shell(table.getShell(), SWT.ON_TOP);
        FillLayout f = new FillLayout();
        try {
          f.marginWidth = 3;
          f.marginHeight = 1;
        } catch (NoSuchFieldError e) {
          /* Ignore for Pre 3.0 SWT.. */
        }
        toolTipShell.setLayout(f);
        toolTipShell.setBackground(d.getSystemColor(SWT.COLOR_INFO_BACKGROUND));

        toolTipLabel = new Label(toolTipShell, SWT.WRAP);
        toolTipLabel.setForeground(d.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
        toolTipLabel.setBackground(d.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
        //toolTipShell.setData("TableCellSWT", item);
        toolTipLabel.setText(sToolTip.replaceAll("&", "&&"));
        // compute size on label instead of shell because label
        // calculates wrap, while shell doesn't
        Point size = toolTipLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

        }
      }
    }.start();
     
    try{
      final Display display = SWTThread.getInstance().getDisplay();
 
      while( !( task_complete || display.isDisposed())){
       
        if (!display.readAndDispatch()) display.sleep();
      }
    }finally{
     
        // bit of boiler plate in case something fails in the dispatch loop
     
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

    final String path,
    final String fileNames[] )
  {
    CoreWaiterSWT.waitForCoreRunning(new AzureusCoreRunningListener() {
      public void azureusCoreRunning(final AzureusCore core) {
        final Display display = SWTThread.getInstance().getDisplay();
        if (display == null || display.isDisposed() || core == null)
          return;
       
        new AEThread("TorrentOpener") {
          public void runSupport() {
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    container.setLayout(layout);
    GridData txtStyle = new GridData(GridData.FILL_HORIZONTAL | SWT.LEFT);
    Display display = getWizard().getContainer().getShell().getDisplay();

    new Label(container, SWT.NONE).setText("Module name: ");
    _moduleName = new Text(container, SWT.BORDER);
    _moduleName.addModifyListener(this);
    _moduleName.setLayoutData(txtStyle);

    new Label(container, SWT.None).setText("Target location: ");
    _txtTargetLocation = new Text(container, SWT.READ_ONLY);
    _txtTargetLocation.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    GridData innerLayout = new GridData(GridData.FILL_HORIZONTAL);
    _txtTargetLocation.setLayoutData(innerLayout);
   
    if(_selectedContainer!=null){
      _txtTargetLocation.setText(_selectedContainer.getFullPath().toString());
    }

    new Label(container, SWT.NONE).setText("Script type: ");
    _typeLable = new Text(container, SWT.READ_ONLY);

    _typeLable.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));

    _tmlscriptOptionsGrp = new Group(container, SWT.None);
    _tmlscriptOptionsGrp.setText("tmlscript options:");
    GridLayout groupLayout = new GridLayout();
    groupLayout.numColumns = 1;
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

    _moduleName.setLayoutData(innerGrpData);
    _moduleName.addModifyListener(this);

    new Label(container, SWT.None).setText("Target location: ");
    _txtTargetLocation = new Text(container, SWT.READ_ONLY);
    Display display = getWizard().getContainer().getShell().getDisplay();
    _txtTargetLocation.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    _txtTargetLocation.setLayoutData(innerGrpData);

    if(_selectedContainer!=null){
      _txtTargetLocation.setText(_selectedContainer.getFullPath().toString());
    }
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.verticalSpacing = 9;
    container.setLayout(layout);
    Display display = getWizard().getContainer().getShell().getDisplay();
    new Label(container, SWT.NULL).setText("Portlet name:");

    _txtPortletName = new Text(container, SWT.BORDER);
    GridData txtStyle = new GridData(GridData.FILL_HORIZONTAL | SWT.LEFT);

    _txtPortletName.setLayoutData(txtStyle);
    _txtPortletName.addModifyListener(this);
    String defaultPortletName = ((NewWGAPortlet) getWizard()).getDefaultPortletName();
    if (defaultPortletName != null) {
      _txtPortletName.setText(defaultPortletName);
    }

    new Label(container, SWT.None).setText("Target location: ");
    _txtTargetLocation = new Text(container, SWT.READ_ONLY);
    _txtTargetLocation.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    GridData innerLayout = new GridData(GridData.FILL_HORIZONTAL);
    _txtTargetLocation.setLayoutData(innerLayout);

    if(_selectedContainer!=null){
      _txtTargetLocation.setText(_selectedContainer.getFullPath().toString());
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

      {
        public void
        chatCreated(
          final BuddyPluginAZ2.chatInstance    chat )
        {
          final Display display = ui_instance.getDisplay();
         
          if ( !display.isDisposed()){
           
            display.asyncExec(
              new Runnable()
              {
                public void
                run()
                {
                  if ( !display.isDisposed()){
                 
                    new BuddyPluginViewChat( plugin, display, chat );
                  }
                }
              });
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

  private static final int DISTANCE   = 50;
  private static final int MAX_ITERATIONS = 10000;
  private static final int NB_CONTACTS = 5;
 
  public VivaldiVisualTest() {
    final Display display = new Display();
    Shell shell = new Shell(display);
    final VivaldiPanel panel = new VivaldiPanel(shell);
    shell.setLayout(new FillLayout());
    shell.setSize(800,800);
    shell.setText("Vivaldi Simulator");
    shell.open();
   
    Thread runner = new Thread("Viviladi Simulator") {
      public void run() {
        VivaldiPosition positions[][] = new VivaldiPosition[ELEMENTS_X][ELEMENTS_Y];
        final List lPos = new ArrayList(ELEMENTS_X*ELEMENTS_Y);       
        HeightCoordinatesImpl realCoordinates[][] = new HeightCoordinatesImpl[ELEMENTS_X][ELEMENTS_Y];
        //Init all
        for(int i = 0 ; i < ELEMENTS_X ; i++) {
          for(int j = 0 ; j < ELEMENTS_Y ; j++) {
            realCoordinates[i][j] = new HeightCoordinatesImpl(i*DISTANCE-ELEMENTS_X * DISTANCE/2,j*DISTANCE-ELEMENTS_Y*DISTANCE/2,MAX_HEIGHT);
            if(i >= ELEMENTS_X / 2 && 1 == 0) {
              positions[i][j] = new VivaldiPositionImpl(realCoordinates[i][j]);
              positions[i][j].setErrorEstimate(0.01f);
            } else {
              positions[i][j] = new VivaldiPositionImpl(new HeightCoordinatesImpl(1000+DISTANCE*i,1000+DISTANCE*j,20));
            }
           
            lPos.add(positions[i][j]);
          }
        }
       
        //Main loop
        for(int iter = 0 ; iter < MAX_ITERATIONS ; iter++) {
          if(iter%100 == 0) System.out.println(iter);
          if(display.isDisposed()) return;
          display.syncExec( new Runnable() {
            public void run() {
              panel.refresh(lPos);
            }
          });
          try {
            //Thread.sleep(100);
          } catch (Exception e) {
            // TODO: handle exception
          }
         
          //For each node :
          for(int i = 0 ; i < ELEMENTS_X ; i++) {
            for(int j = 0 ; j < ELEMENTS_Y ; j++) {
              VivaldiPosition position = positions[i][j];
              //Pick N random nodes
              for(int k = 0 ; k < NB_CONTACTS ; k++) {
                int i1 = (int) (Math.random() * ELEMENTS_X);
                int j1 = (int) (Math.random() * ELEMENTS_Y);
                if(i1 == i && j1 ==j) continue;
                VivaldiPosition position1 = positions[i1][j1];
                float rtt = realCoordinates[i1][j1].distance(realCoordinates[i][j]);
                //rtt *= (Math.random() - 0.5)/20 + 1; 
                position.update(rtt,position1.getCoordinates(),position1.getErrorEstimate());
              }
             
            }
          }
         
        }
      }
    };
    runner.setDaemon(true);
    runner.start();
   
    while (!shell.isDisposed ()) {
      if (!display.readAndDispatch ()) display.sleep ();
    }
    display.dispose ();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

    // initialise the SWT locale util
    long startTime = SystemTime.getCurrentTime();

    new LocaleUtilSWT(core);
   
    final Display display = SWTThread.getInstance().getDisplay();

    new UIMagnetHandler(core);
   
    if (!STARTUP_UIFIRST) {
      // Ensure colors initialized
      Colors.getInstance();

      UIConfigDefaultsSWT.initialize();
      UIConfigDefaultsSWTv3.initialize(core);
    } else {
      COConfigurationManager.setBooleanDefault("Show Splash", false);
    }

    if (COConfigurationManager.getBooleanParameter("Show Splash")) {
      display.asyncExec(new AERunnable() {
        public void runSupport() {
          new SplashWindow(display, Initializer.this);
        }
      });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.