Package charva.awt

Examples of charva.awt.Dimension


    /**
     * Overrides the corresponding method in Container.
     */
    public Dimension minimumSize() {
        Dimension minsize = super.minimumSize();
        if (_menubar == null) return minsize;

        Dimension menubarSize = _menubar.minimumSize();
        if (menubarSize.width + _insets.left + _insets.right > minsize.width)
                minsize.width = menubarSize.width + _insets.left
                        + _insets.right;

        if (menubarSize.height > minsize.height)
View Full Code Here


  Insets insets = super.getInsets();
  return 1 + insets.top + insets.bottom;
    }

    public Dimension getSize() {
  return new Dimension(this.getWidth(), this.getHeight());
    }
View Full Code Here

      }
      add(southpan, BorderLayout.SOUTH);

      setSize(Toolkit.getDefaultToolkit().getScreenSize());
      pack();
      Dimension msgsize = messagepanel.getSize();
      setSize(msgsize.width+8, msgsize.height+9);
      pack();

      /* 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));
View Full Code Here

     * Sets the location of the dialog to be centered over the specified
     * component. This must be called AFTER the size of the dialog has been
     * set, and the size and location of the specified component has been set.
     */
    public void setLocationRelativeTo(Component component_) {
        Dimension size = super.getSize(); // our own size
        Rectangle bounds = component_.getBounds(); // bounds of component
        int x = ((bounds.getLeft() + bounds.getRight()) / 2) - (size.width / 2);
        int y = ((bounds.getTop() + bounds.getBottom()) / 2)
                - (size.height / 2);
        super.setLocation(x, y);
View Full Code Here

    /**
     * Return the size of the text field. Overrides the method in the
     * Component superclass.
     */
    public Dimension getSize() {
  return new Dimension(this.getWidth(), this.getHeight());
    }
View Full Code Here

  int width = 0;
  int height = 0;
  Enumeration<Component> e = _tabComponents.elements();
  while (e.hasMoreElements()) {
      Component c = e.nextElement();
      Dimension size = c.minimumSize();
      if (size.width > width)
    width = size.width;
      if (size.height > height)
    height = size.height;
  }

  /* Now scan through the titles of the tabs, and determine the width
   * that all of them will fit into.
   */
  int tabwidth = 0;
  Enumeration<TabButton> e2 = _tabs.elements();
  while (e2.hasMoreElements()) {
      tabwidth += e2.nextElement().getWidth();
  }
  tabwidth += 2;
  if (tabwidth > width)
      width = tabwidth;

  /* Take into account the border and the height of the tabs.
   */
  _minimumSize = new Dimension(width + _insets.left + _insets.right,
      height + _insets.top + _insets.bottom);

  _isValid = true;
  return _minimumSize;
    }
View Full Code Here

  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;
View Full Code Here

    /**
     * This may be wrong, but it'll do for now.
     */
    public Dimension getSize() {
  return new Dimension(this.getWidth(), this.getHeight());
    }
View Full Code Here

     * Return the size of the button. The button is always one line
     * high, and two columns wider than the label, plus the size
     * of the border (if any).
     */
    public Dimension getSize() {
  return new Dimension(this.getWidth(), this.getHeight());
    }
View Full Code Here

    }

    /** Get the screen size of the progress bar.
     */
    public Dimension getSize() {
  return new Dimension(this.getWidth(), this.getHeight());
    }
View Full Code Here

TOP

Related Classes of charva.awt.Dimension

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.