Package charva.awt

Examples of charva.awt.Point


    public void draw(Toolkit toolkit) {

        /*
         * Get the absolute origin of this component.
         */
        Point origin = getLocationOnScreen();
        Insets borderInsets;
        if (getViewportBorder() != null) {
            borderInsets = getViewportBorder().getBorderInsets(this);
        } else
            borderInsets = new Insets(0, 0, 0, 0);

        int colorpair = getCursesColor();
        Dimension size = minimumSize();

        if (_border != null) {

            _border.paintBorder(this, 0, origin.x, origin.y, size.width,
                    size.height, toolkit);
        }

        // Don't draw scrollbars if the child component is a TableHeader.
        if (_child instanceof TableHeader) return;

        /*
         * If the child component is larger than the viewport, draw scrollbars.
         */

        // The size of the component displayed within the viewport.
        Dimension childSize = getViewport().getViewSize();

        // The size of the viewport
        Dimension extentSize = getViewport().getExtentSize();
        Point viewPosition = getViewport().getViewPosition();

        // If the child is a JTable, we have to adjust the
        // parameters a bit because the viewport includes the header.
        /*
         * if (_child instanceof JTable) { viewport_height--; child_height--;
View Full Code Here


        _border = viewportBorder_;
        Insets insets = _border.getBorderInsets(this);

        if (_headerViewport != null) {
            // This must be a JTable.
            _headerViewport.setLocation(new Point(insets.left, insets.top));
            _childViewport.setLocation(new Point(insets.left, insets.top + 1));
        } else
            _childViewport.setLocation(new Point(insets.left, insets.top));
    }
View Full Code Here

  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)));

  // Then (if necessary) scroll it UP so that the specified index
  // is not below the bottom of the viewport.
  evtqueue.postEvent(
          new ScrollEvent(this, ScrollEvent.UP,
    new Point(0, index_)));
    }
View Full Code Here

   */
  super.requestFocus();

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

   */
  super.draw(toolkit);

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

  int colorpair = getCursesColor();
  int attribute;

  StringBuffer blanks = new StringBuffer();
View Full Code Here

    if (_currentRow >= _listModel.getSize() -1)
        return;

    evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.UP,
      new Point(0, ++_currentRow)));
    break;

      case KeyEvent.VK_PAGE_DOWN:
    _currentRow += _visibleRows;
    if (_currentRow >= _listModel.getSize())
        _currentRow = _listModel.getSize() -1;

    evtqueue.postEvent(
        new ScrollEvent(this, ScrollEvent.UP,
      new Point(0, _currentRow)));
    break;

      case KeyEvent.VK_END:
    _currentRow = _listModel.getSize() - 1;
    evtqueue.postEvent(new ScrollEvent(
            this, ScrollEvent.UP, new Point(0, _currentRow)));
    break;

      case KeyEvent.VK_UP:
    /* If we are already at the top of the list, ignore
     * this keystroke.
     */
    if (_currentRow < 1)
        return;

    evtqueue.postEvent(new ScrollEvent(
            this, ScrollEvent.DOWN, new Point(0, --_currentRow)));
    break;

      case KeyEvent.VK_PAGE_UP:
    _currentRow -= _visibleRows;
    if (_currentRow < 0)
        _currentRow = 0;

    evtqueue.postEvent(new ScrollEvent(this, ScrollEvent.DOWN,
      new Point(0, _currentRow)));
    break;

      case KeyEvent.VK_ENTER:
    _doSelect();
    break;
View Full Code Here

    e_.getModifiers() == MouseEvent.MOUSE_CLICKED &&
    this.isFocusTraversable()) {

      if (e_.getClickCount() == 1) {
    int y = e_.getY();
    Point origin = getLocationOnScreen();
    Container parent = getParent();
    if (parent instanceof JViewport) {
        _currentRow = y - origin.y;
        repaint();
    }
View Full Code Here

    public void requestFocus() { }

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

  int columns = _model.getColumnCount();
  int colorpair = getCursesColor();

  /* Start by blanking out the table area and drawing the box
   * around the table.
   */
  toolkit.blankBox(origin, getSize(), colorpair);
  toolkit.drawBox(origin, getSize(), colorpair);

  /* Now fill in the table headings
   */
  int x = 1;
  int attr = Toolkit.A_BOLD;
  for (int i=0; i<columns; i++) {
      toolkit.setCursor(origin.addOffset(x, 0));
      toolkit.addChar(' ', attr, colorpair);
      toolkit.addString(_model.getColumnName(i), attr, colorpair);
      toolkit.addChar(' ', attr, colorpair);
      x += getColumnWidth(i) + 1;
  }

  /* Now draw the vertical lines that divide the columns.
   */
  x = getColumnWidth(0) + 1;
  for (int i=0; i<columns-1; i++) {
      toolkit.setCursor(origin.addOffset(x, 0));
      toolkit.addChar(Toolkit.ACS_TTEE, 0, colorpair);      // top tee
      x += getColumnWidth(i+1) + 1;
  }
    }
View Full Code Here

     * Draws the border of the panel (if there is one), plus
     * all the contained components.
     * @param toolkit
     */
    public void draw(Toolkit toolkit) {
  Point origin = getLocationOnScreen();

  /* Blank out the area of this component, but only if this
   * component's color-pair is different than that of the
   * parent container.
   */
 
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.right);

  int colorpair = getCursesColor();
  toolkit.setCursor(origin);
  String selectedItem = (String) _model.getSelectedItem();
  StringBuffer buf = new StringBuffer();
  for (int i=0; i<_columns + 1; i++)
      buf.append(' ');
  if (selectedItem != null) {
      buf.replace(1, selectedItem.length()+1, selectedItem);
  }

  int attribute =
      super.isEnabled() ?  Toolkit.A_REVERSE : Toolkit.A_NORMAL;

  toolkit.addString(buf.toString(), attribute, colorpair);
  toolkit.setCursor(origin.addOffset(_columns + 1, 0));
  toolkit.addChar(Toolkit.ACS_DIAMOND, attribute, 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.