Examples of Toolkit

Most applications should not call any of the methods in this class directly. The methods defined by Toolkit are the "glue" that joins the platform-independent classes in the ae.java.awt package with their counterparts in ae.java.awt.peer. Some methods defined by Toolkit query the native operating system directly. @author Sami Shaio @author Arthur van Hoff @author Fred Ecks @since JDK1.0

  • charva.awt.Toolkit
    @author vali @author Levente S\u00e1ntha
  • java.awt.Toolkit
    sun.com/docs/books/tutorial/uiswing/misc/focus.html#transferTiming">Timing Focus Transfers, a section in The Swing Tutorial.

  • Making a top-level container visible.
    Calling setVisible(true) on a Window, Frame or Dialog may occur asynchronously.

  • Setting the size or location of a top-level container.
    Calls to setSize, setBounds or setLocation on a Window, Frame or Dialog are forwarded to the underlying window management system and may be ignored or modified. See {@link java.awt.Window} formore information.

    Most applications should not call any of the methods in this class directly. The methods defined by Toolkit are the "glue" that joins the platform-independent classes in the java.awt package with their counterparts in java.awt.peer. Some methods defined by Toolkit query the native operating system directly. @version 1.203, 12/19/03 @author Sami Shaio @author Arthur van Hoff @author Fred Ecks @since JDK1.0

  • org.sonar.sslr.toolkit.Toolkit

  • Examples of ae.java.awt.Toolkit

        private Preferences userRoot;

        ExecutableInputMethodManager() {

            // set up host adapter locator
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            try {
                if (toolkit instanceof InputMethodSupport) {
                    InputMethodDescriptor hostAdapterDescriptor =
                        ((InputMethodSupport)toolkit)
                        .getInputMethodAdapterDescriptor();
    View Full Code Here

    Examples of charva.awt.Toolkit

          p = parentpopup.getLocation();

          int verticalOffset = parentpopup.getComponentIndex(this);
          _popup.setInvoker(parentpopup);
          int parentwidth = parentpopup.getSize().width;
          Toolkit term = Toolkit.getDefaultToolkit();
          if (p.x + parentwidth + _popup.getWidth() <
            term.getScreenColumns()) {

        _popup.setLocation(
              p.addOffset(parentwidth - 1, verticalOffset));
          }
          else {
    View Full Code Here

    Examples of charva.awt.Toolkit

            /*
             * Ensure the cursor is within the viewport (if the component contained
             * within the viewport is offset a long way to the left, the cursor
             * position can get scrambled).
             */
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            Point cursor = toolkit.getCursor();
            Point viewportOrigin = _childViewport.getLocationOnScreen();
            if (cursor.x < viewportOrigin.x || cursor.y < viewportOrigin.y) {
                if (cursor.x < viewportOrigin.x) cursor.x = viewportOrigin.x;
                if (cursor.y < viewportOrigin.y) cursor.y = viewportOrigin.y;
                toolkit.setCursor(cursor);
            }
        }
    View Full Code Here

    Examples of charva.awt.Toolkit

      /* Check if any of the KeyListeners consumed the KeyEvent.
       */
      if (ke_.isConsumed())
          return;

      Toolkit term = Toolkit.getDefaultToolkit();
      int key = ke_.getKeyCode();
      switch (key) {
          case '\t':
        getParent().nextFocus();
        return;

          case KeyEvent.VK_BACK_TAB:
        getParent().previousFocus();
        return;

          /* Set the button's state to SELECTED on ENTER.
           */
          case KeyEvent.VK_ENTER:
        // Check if the button is disabled or ALREADY selected.
        if ( (!super.isEnabled()) || super.isSelected()) {
            return
        }
        super.setSelected(true);

        // post an ItemEvent.
        EventQueue queue = term.getSystemEventQueue();
        queue.postEvent(new ItemEvent(this, this, ItemEvent.SELECTED));
        break;
      }

      draw(Toolkit.getDefaultToolkit());
    View Full Code Here

    Examples of charva.awt.Toolkit

      // It seems reasonable to assume that the "current row" should
      // be set to the index that is being made visible.
      _currentRow = index_;

      Toolkit term = Toolkit.getDefaultToolkit();
      EventQueue evtqueue = term.getSystemEventQueue();

      // First scroll the list DOWN so that index 0 is visible.
      evtqueue.postEvent(
              new ScrollEvent(this, ScrollEvent.DOWN,
        new Point(0, 0)));
    View Full Code Here

    Examples of charva.awt.Toolkit

      /* Check if any of the KeyListeners consumed the KeyEvent.
       */
      if (ke_.isConsumed())
          return;

      Toolkit term = Toolkit.getDefaultToolkit();
      EventQueue evtqueue = term.getSystemEventQueue();
      int key = ke_.getKeyCode();
      switch (key) {
          case '\t':
        getParent().nextFocus();
        return;
    View Full Code Here

    Examples of charva.awt.Toolkit

      if ( ! _visible)
          return// the popup has already been dismissed.

      int key = e.getKeyCode();
      Toolkit term = Toolkit.getDefaultToolkit();

      if (key == KeyEvent.VK_UP) {
          super.previousFocus();
      }

      else if (key == KeyEvent.VK_DOWN) {
          super.nextFocus();
      }

      else if (key == KeyEvent.VK_LEFT) {
          /* Pressing the LEFT cursor key has the effect of cancelling
           * the selected menu and invoking the next menu on the left.
           */
          _leftWasPressed = true;
          hide();
      }

      else if (key == KeyEvent.VK_RIGHT) {
          /* Pressing the RIGHT cursor key has the effect of cancelling
           * the selected menu and invoking the next menu on the right.
           */
          _rightWasPressed = true;
          hide();
      }

      else if (key == KeyEvent.VK_ENTER) {
          /* Pressing ENTER sends an ActionEvent. The source of the
           * event is the menu item, not the menu; this means that the
           * client program has to add an ActionListener to each menu
           * item. This is inconvenient, but it's the way that the Java
           * Swing menus do it.
           */
          JMenuItem item = (JMenuItem) super.getCurrentFocus();
          _activate(item);
          e.consume();
      }

      else if (key == KeyEvent.VK_BACK_SPACE || key == 0x1b) {
          // Backspace or ESC was pressed
          _wasCancelled = true;
          hide();
      }

      else {
          /* Check if one of the mnemonic keys was pressed.
           * Note that the user can press a lowercase or an uppercase
           * key.
           */
          char keyLower = Character.toLowerCase((char) key);
          for (int i=0; i < super._components.size(); i++) {
        JMenuItem item = getMenuItem(i);
        if (item != null) {
            if (item.getMnemonic() == -1)
          continue;   // this item doesn't have a mnemonic

            char mnemonicLower =
          Character.toLowerCase((char) item.getMnemonic());
            if (keyLower == mnemonicLower) {
          _activate(item);
          return;
            }
        }
          }
          term.beep();
      }
        }      // end of processKeyEvent()
    View Full Code Here

    Examples of java.awt.Toolkit

                try {
                    Map map = null;
                    // we should be able to look up the "recommended" AA settings (that correspond to the user's
                    // desktop preferences and machine capabilities
                    // see: http://java.sun.com/javase/6/docs/api/java/awt/doc-files/DesktopProperties.html
                    Toolkit tk = Toolkit.getDefaultToolkit();
                    map = (Map)(tk.getDesktopProperty("awt.font.desktophints"));
                    antiAliasRenderingHint = map.get(RenderingHints.KEY_TEXT_ANTIALIASING);
                } catch (Exception e) {
                    // conceivably could get an exception in a webstart environment? not sure
                }
            }
    View Full Code Here

    Examples of java.awt.Toolkit

            if (useCursor) {
                /*
                 * For who like make his CustomCursor
                 */
                try {
                    Toolkit tk = Toolkit.getDefaultToolkit();
                    ImageIcon pointer = new ImageIcon(getClass().getResource("pan.gif"));
                    Dimension bestSize = tk.getBestCursorSize(pointer.getIconWidth(), pointer.getIconHeight());
                    Image pointerImage = ImageScaler.getOptimalScalingImage(pointer.getImage(),(int) bestSize.getWidth(),
                                                                              (int) bestSize.getHeight());
                    Cursor cursor = tk.createCustomCursor(pointerImage, new Point(0, 0), "PP");
                    setModeCursor(cursor);
                    return;
                } catch (Exception e) {
                    // Problem finding image probably, just move on.
                }
    View Full Code Here

    Examples of java.awt.Toolkit

            int width = 256;

            BufferedImage bigImage = new BufferedImage(width * 6, height * 6, BufferedImage.TYPE_INT_RGB);
            GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
            Graphics g = ge.createGraphics(bigImage);
            Toolkit tk = Toolkit.getDefaultToolkit();

            for (int x = 0; x < 6; x++) {
                for (int y = 0; y < 6; y++) {
                    int[] pixels = decompressSubframe(x, y, colortable);

                    java.awt.Image bitmap = tk.createImage(new MemoryImageSource(width, height, pixels, 0, width));

                    g.drawImage(bitmap, x * 256, y * 256, null);
                }
            }

    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.