Package charva.awt

Examples of charva.awt.Point


   */
  super.requestFocus();

  /* Get the absolute origin of this component
   */
  Point origin = getLocationOnScreen();
  Insets insets = super.getInsets();
  Toolkit.getDefaultToolkit().setCursor(
    origin.addOffset(insets.left, insets.top));
    }
View Full Code Here


      _popup = this.new Popup(this, _model);
      _popup.setMaximumRowCount(_maxRows);

      /* Get the absolute origin of this component.
       */
      Point origin = getLocationOnScreen();
      _popup.setLocation(origin);
      _popup.show();
    }
View Full Code Here

      /* Center the dialog over its parent component.
       */
      Dimension ourSize = getSize();
      if (_ownerComponent != null) {
    Point ownerOrigin = _ownerComponent.getLocationOnScreen();
    Dimension ownerSize = _ownerComponent.getSize();
    Point ownerCenter = ownerOrigin.addOffset(
        ownerSize.width/2, ownerSize.height/2);
    setLocation(ownerCenter.addOffset(
        -ourSize.width/2, -ourSize.height/2));
      }
      else {
    /* The parent component was not specified. Center this
     * dialog box in the middle of the screen.
     */
    Dimension screensize =
        Toolkit.getDefaultToolkit().getScreenSize();
    Point screenCenter = new Point(screensize.width/2,
        screensize.height/2);
    setLocation(screenCenter.addOffset(
        -ourSize.width/2, -ourSize.height/2));
      }

      // Add a KeyListener in case one or more accelerators were set.
      addKeyListener(this);
View Full Code Here

      // The selected file is a directory.
      setCurrentDirectory(file);
      displayCurrentDirectory();
      repaint();

      _scrollPane.getViewport().setViewPosition(new Point(0,0));
      _scrollPane.repaint();

      /* If the newly selected directory is a root directory,
       * don't allow the Parent button to be pressed.
       */
 
View Full Code Here

    }

    public void draw(Toolkit toolkit) {
  /* Get the absolute origin of this component.
   */
  Point origin = getLocationOnScreen();
  Point relative = new Point(0, 0);

  int colorpair = getCursesColor();

  /* Draw the enclosing frame
   */
  Dimension size = getSize();
  toolkit.blankBox(origin, size, colorpair);
  toolkit.drawBox(origin.addOffset(0,1),
      new Dimension(size.width, size.height-1),
      colorpair);

  /* Draw each of the tabs
   */
  int hoffset = 1;
  Enumeration<TabButton> e = _tabs.elements();
  for (int i=0; e.hasMoreElements(); i++) {
      TabButton tb = (TabButton) e.nextElement();

      tb.setLocation(relative.addOffset(hoffset, 0));
      tb.draw(toolkit);
      hoffset += tb.getWidth();
  }

  /* Now draw the selected component.
View Full Code Here

  }

  public void requestFocus()
  {
      super.requestFocus();
      Point origin = getLocationOnScreen();
      Insets insets = super.getInsets();
      Toolkit.getDefaultToolkit().
    setCursor(origin.addOffset(2 + insets.left, 0 + insets.top));
  }
View Full Code Here

      Toolkit.getDefaultToolkit().
    setCursor(origin.addOffset(2 + insets.left, 0 + insets.top));
  }
  public void draw(Toolkit toolkit)
  {
      Point origin = getLocationOnScreen();
      Insets insets = super.getInsets();
      origin.translate(insets.left, insets.top);

      toolkit.setCursor(origin);

      int  colorpair = getCursesColor();
      toolkit.addChar(Toolkit.ACS_ULCORNER, 0, colorpair);
      toolkit.addChar(' ', 0, colorpair);
      toolkit.addString(getLabelString(), isEnabled() ? Toolkit.A_BOLD : 0,
         colorpair);
      toolkit.addChar(' ', 0, colorpair);
      toolkit.addChar(Toolkit.ACS_URCORNER, 0, colorpair);
      if (isEnabled()) {
    if (getMnemonic() > 0) {
        int mnemonicPos = getText().indexOf((char) getMnemonic());
        if (mnemonicPos != -1) {
      toolkit.setCursor(origin.addOffset(2 + mnemonicPos, 0));
      toolkit.addChar(getMnemonic(), Toolkit.A_UNDERLINE |
             Toolkit.A_REVERSE, colorpair);
        }
    }
      }
      toolkit.setCursor(origin.addOffset(0, 1));
      if (isSelected()) {
    toolkit.addChar(Toolkit.ACS_LRCORNER, 0, colorpair);
    for (int j = 0; j < getText().length() + 2; j++) {
        toolkit.addChar(' ', 0, colorpair);
    }
    toolkit.addChar(Toolkit.ACS_LLCORNER, 0, colorpair);
      } else {
    toolkit.addChar(Toolkit.ACS_BTEE, 0, colorpair);
    toolkit.setCursor(origin.addOffset(getText().length() + 3, 1));
    toolkit.addChar(Toolkit.ACS_BTEE, 0, colorpair);
    if (isEnabled()) {
        toolkit.setCursor(origin.addOffset(1, 1));
        toolkit.addString(_keylabel, Toolkit.A_BOLD, colorpair);
    }
      }
  }
View Full Code Here

  // Draw the border if it exists
  super.draw(toolkit);

  /* Get the absolute origin of this component.
   */
  Point origin = getLocationOnScreen();
  Insets insets = super.getInsets();
  origin.translate(insets.left, insets.top);

  toolkit.setCursor(origin);

  // we'll sort out justification and video-attributes etc later.
  StringBuffer buf = new StringBuffer(_labeltext);
View Full Code Here

    /**
     * Draws the border of the component (if there is one).
     * @param toolkit
     */
    public void draw(Toolkit toolkit) {
  Point origin = getLocationOnScreen();

//  int colorpair = getCursesColor();

  /* Blank out the area of this component, but only if this
   * component's color-pair is different than that of the
View Full Code Here

  // Draw the border if it exists
  super.draw(toolkit);

  /* Get the absolute origin of this component.
   */
  Point origin = getLocationOnScreen();
  Insets insets = super.getInsets();
  origin.translate(insets.left, insets.top);

  toolkit.setCursor(origin);

  int  colorpair = getCursesColor();
  if (super.isEnabled()) {
      toolkit.addString(" ", Toolkit.A_REVERSE, colorpair);
      toolkit.addString(super.getLabelString(), Toolkit.A_REVERSE,
    colorpair);
      toolkit.addString(" ", Toolkit.A_REVERSE, colorpair);

      if (super.getMnemonic() > 0) {
    int mnemonicPos = super.getLabelString().indexOf((char) super.getMnemonic());
    if (mnemonicPos != -1) {
        toolkit.setCursor(origin.addOffset(1 + mnemonicPos, 0));
        toolkit.addChar(super.getMnemonic(),
          Toolkit.A_UNDERLINE | Toolkit.A_REVERSE, colorpair);
    }
      }
  }
View Full Code Here

TOP

Related Classes of charva.awt.Point

Copyright © 2018 www.massapicom. 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.