Examples of Display


Examples of mdes.slick.sui.Display

   
   
    m_instance = this;
    gc.getGraphics().setWorldClip(-32, -32, 832, 832);
    gc.setShowFPS(false);
    m_display = new Display(gc);
   


    /*
     * Setup variables
View Full Code Here

Examples of org.apache.pivot.wtk.Display

        // Mouse handler to enable users to quickly close the sheet
        final ContainerMouseListener displayMouseHandler = new ContainerMouseListener.Adapter() {
            @Override
            public boolean mouseDown(Container container, Mouse.Button button, int x, int y) {
                Display display = (Display) container;
                Component component = display.getComponentAt(x, y);

                // Close the sheet by clicking away from it.
                // This allows resizing etc to work without requiring
                // a close button or similar on the sheet.
                boolean consumed = (component != sheet);
                if (consumed) {
                    sheet.close();
                }
                return consumed;
            }
        };

        // Add/remove the mouse handler based on the Sheet's state
        sheet.getWindowStateListeners().add(new WindowStateListener.Adapter() {
            @Override
            public void windowOpened(Window window) {
                window.getDisplay().getContainerMouseListeners().add(displayMouseHandler);
            }

            @Override
            public void windowClosed(Window window, Display display, Window owner) {
                display.getContainerMouseListeners().remove(displayMouseHandler);
            }
        });
    }
View Full Code Here

Examples of org.calculator.io.Display

    // Calculator main method
 
    public static void main(String[] args) {
        Keypad keypad = new Keypad();
        Processor processor = new Processor();
        Display _display = new Display(processor, keypad);
    _display.display();
   
    }
View Full Code Here

Examples of org.easetech.easytest.annotation.Display

        return null;
    }

    public static String getTestName(final TestClass testClass, final FrameworkMethod method) {
        String testName = method.getName();
        Display methodDisplay = method.getMethod().getAnnotation(Display.class);
        Display classDisplay = testClass.getJavaClass().getAnnotation(Display.class);
        Display policyDisplay = null;
        TestPolicy testPolicy = testClass.getJavaClass().getAnnotation(TestPolicy.class);
        if (testPolicy != null) {
            Class<?> policyClass = testPolicy.value();
            policyDisplay = policyClass.getAnnotation(Display.class);
        }
        Display displayAnnotation = methodDisplay != null ? methodDisplay : classDisplay != null ? classDisplay
            : policyDisplay;

        if (displayAnnotation != null) {
            StringBuilder fieldsToConcatenate = new StringBuilder("");
            String[] fields = displayAnnotation.fields();
            EasyFrameworkMethod fMethod = (EasyFrameworkMethod) method;
            Map<String, Object> testData = fMethod.getTestData();
            if (testData != null) {
                for (int i = 0; i < fields.length; i++) {
                    Object data = testData.get(fields[i]);
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

  /**
   * {@inheritDoc}
   */
  public void run() {
    Display display= Display.getCurrent();
    if (display == null)
      return;
    Control focus= display.getFocusControl();
    if (focus == null || focus.isDisposed())
      return;
   
    MenuManager menu= new MenuManager();
    fillMenu(menu);
    final Menu widget= menu.createContextMenu(focus.getShell());
    Point location= computeMenuLocation(focus, widget);
    if (location == null)
      return;
    widget.setLocation(location);
    widget.setVisible(true);
    while (!widget.isDisposed() && widget.isVisible()) {
      if (!display.readAndDispatch())
        display.sleep();
    }
    if (!widget.isDisposed()) {
      widget.dispose();
    }
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

      int /*long*/arg0, int /*long*/arg1)
      throws Throwable {
    if (DEBUG) {
      System.err.println("actionProc 4 " + id + "/" + sel);
    }
    Display display = Display.getCurrent();
    if (display == null)
      return 0;

    if (!alreadyHaveOpenDoc && sel == sel_application_openFile_) {
      Constructor<?> conNSString = nsstringCls.getConstructor(new Class[] {
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

   *            The action to run when the About menu is invoked.
   * @param preferencesAction
   *            The action to run when the Preferences menu is invoked.
   */
  public void hookApplicationMenu() {
    Display display = Display.getCurrent();
    try {
      // Initialize the menuItems.
      initialize();
    } catch (Exception e) {
      throw new IllegalStateException(e);
    }

    // Schedule disposal of callback object
    display.disposeExec(new Runnable() {
      public void run() {
        invoke(callBack3, "dispose");
        callBack3 = null;
        invoke(callBack4, "dispose");
        callBack4 = null;
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

 
  public
  TextViewerWindow(
     String sTitleID, String sMessageID, String sText, boolean modal )
  {
    final Display display = SWTThread.getInstance().getDisplay();
   
    if ( modal ){
   
      shell = org.gudy.azureus2.ui.swt.components.shell.ShellFactory.createShell(display, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE );
     
    }else{
     
      shell = ShellFactory.createMainShell(SWT.DIALOG_TRIM | SWT.RESIZE );
    }
   
    if (sTitleID != null) shell.setText(MessageText.keyExists(sTitleID)?MessageText.getString(sTitleID):sTitleID);
   
    Utils.setShellIcon(shell);
   
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    shell.setLayout(layout);

    Label label = new Label(shell, SWT.NONE);
    if (sMessageID != null) label.setText(MessageText.keyExists(sMessageID)?MessageText.getString(sMessageID):sMessageID);
    GridData gridData = new GridDataGridData.FILL_HORIZONTAL );
    gridData.widthHint = 200;
    gridData.horizontalSpan = 2;
    label.setLayoutData(gridData);

    txtInfo = new Text(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
    gridData = new GridDataGridData.FILL_BOTH );
    gridData.widthHint = 500;
    gridData.heightHint = 400;
    gridData.horizontalSpan = 2;
    txtInfo.setLayoutData(gridData);
    txtInfo.setText(sText);

    label = new Label(shell, SWT.NONE);
    gridData = new GridData( GridData.FILL_HORIZONTAL );
    label.setLayoutData(gridData);
   
    Button ok = new Button(shell, SWT.PUSH);
    ok.setText(MessageText.getString("Button.ok"));
    gridData = new GridData();
    gridData.widthHint = 70;
    ok.setLayoutData(gridData);
    shell.setDefaultButton(ok);
    ok.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        try {
          shell.dispose();
        }
        catch (Exception e) {
          Debug.printStackTrace( e );
        }
      }
    });

  shell.addListener(SWT.Traverse, new Listener() { 
    public void handleEvent(Event e) {
      if ( e.character == SWT.ESC){
        shell.dispose();
      }
    }
  });
 
  shell.addDisposeListener(
    new DisposeListener()
    {
      public void
      widgetDisposed(
        DisposeEvent arg0)
      {
        for ( TextViewerWindowListener l: listeners ){
         
          l.closed();
        }
      }
    });
 
    shell.pack();
  Utils.centreWindow( shell );
    shell.open();
   
    if ( modal ){
      while (!shell.isDisposed())
        if (!display.readAndDispatch()) display.sleep();
    }
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

   * @param alert
   *
   * @since 3.0.0.9
   */
  protected static void showAlert(LogAlert alert) {
    final Display display = SWTThread.getInstance().getDisplay();

    if (alert.err != null) {
      alert.details = Debug.getStackTrace(alert.err);
    }

    /*
    final String message2;
    if (alert.text != null
        && COConfigurationManager.getBooleanParameter("Show Timestamp For Alerts")) {
      message2 = "["
          + DisplayFormatters.formatDateShort(SystemTime.getCurrentTime())
          + "] " + alert.text;
    } else {
      message2 = (alert.text == null) ? "" : alert.text;
    }
    */

    for (Iterator<AlertListener> iter = listeners.iterator(); iter.hasNext();) {
      AlertListener l = (AlertListener) iter.next();
      if (!l.allowPopup(alert.relatedTo, alert.entryType)) {
        return;
      }
    }
   
 
    if (stopping || display.isDisposed()) {

      try {
        alert_queue_mon.enter();

        List close_alerts = COConfigurationManager.getListParameter(
            "Alerts.raised.at.close", new ArrayList());

        Map alert_map = new HashMap();

        alert_map.put("type", new Long(alert.entryType));
        alert_map.put("message", alert.text);
        alert_map.put("timeout", new Long( alert.getGivenTimeoutSecs()));
       
        if (alert.details != null) {
          alert_map.put("details", alert.details);
        }

        close_alerts.add(alert_map);

        COConfigurationManager.setParameter("Alerts.raised.at.close",
            close_alerts);

        return;
      } finally {
        alert_queue_mon.exit();
      }
    }

    if (display.isDisposed()) {
      return;
    }

   
    String key = (alert.err == null) ? alert.text : alert.text + ":"
View Full Code Here

Examples of org.eclipse.swt.widgets.Display

  public SplashWindow(Display display) {
    this(display, null);
  }

  public static void main(String args[]) {
    Display display = new Display();

    final SplashWindow splash = new SplashWindow(display);

    Thread t = new Thread() {
      public void run() {
        try {
          int percent = 0;
          while (percent <= 100) {
            splash.reportPercent(percent++);
            splash.reportCurrentTask(percent
                + "% Loading dbnvsudn vjksfdh fgshdu fbhsduh bvsfd fbsd fbvsdb fsuid opnum supnum boopergood haha text doot subliminal.".substring(
                    0, (int) (1 + Math.random() * 110)));
            Thread.sleep(100);
          }
        } catch (Exception e) {
          // TODO: handle exception
        }
        splash.closeSplash();
      }
    };
    t.start();

    while (!splash.splash.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();
  }
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.