Package jcurses.util

Examples of jcurses.util.Rectangle


  }
 
 
 
  protected Rectangle getPreferredSize() {
    return new Rectangle(_label.length()+4,1);
  }
View Full Code Here


    return new Rectangle(_label.length()+4,1);
  }
 
 
  protected void doPaint() {
    Rectangle rect = getRectangle();
    String text = "< "+_label+" >";
    CharColor colors = hasFocus()?getFocusedButtonColors():getColors();
    Toolkit.printString(text,rect, colors);
    if (!hasFocus()) {
      drawShortCutIfNeeded();
View Full Code Here

  * Returns the rectangle on the screen, that contains this widget
  *
  * @return   the rectangle on the screen, that contains this widget
  */
  protected Rectangle getRectangle() {
    Rectangle size = (Rectangle)getSize().clone();
    size.setLocation(getAbsoluteX(),getAbsoluteY());
    return size;
  }
View Full Code Here

  }
 
 
  protected Rectangle getPreferredSize() {
    if (_label.indexOf("\n") == -1) {
      return new Rectangle(_label.length(),1);
    } else {
      StringTokenizer tokenizer = new StringTokenizer(_label,"\n");
      int width=0;
      int height=0;
      while (tokenizer.hasMoreElements()) {
        String token = tokenizer.nextToken();
        height++;
        if (token.length()>width) {
          width = token.length();
        }
      }
      height = (height == 0)?1:height;
      return new Rectangle(width, height);
    }
  }
View Full Code Here

    }
  }
 
 
  protected void doPaint() {
    Rectangle rect = (Rectangle)getSize().clone();
    rect.setLocation(getAbsoluteX(), getAbsoluteY());
    Toolkit.printString(_label,rect, getColors());
  }
View Full Code Here

 
 
 
 
  protected Rectangle getChildsRectangle() {
    Rectangle rect = (Rectangle)getSize().clone();
    rect.setLocation(1, 1);
    rect.setWidth(rect.getWidth()-2);
    rect.setHeight(rect.getHeight()-2);
   
    return rect;
  }
View Full Code Here

    * the width of the panel depends only on the layout manager of the parent container
    * or on the window width, if this is a root panel.
    * @param height
    */
  public Panel(int width, int height) {
    _prefSize = new Rectangle(width, height)
  }
View Full Code Here

    return _prefSize;
  }
 
 
  protected void paintSelf() {
    Rectangle size = getSize();
    size.setLocation(getAbsoluteX(), getAbsoluteY());
    Toolkit.drawRectangle(size, getPanelColors());
  }
View Full Code Here

 
 
 
 
  protected Rectangle getPreferredSize() {
    return new Rectangle(3,1);
  }
View Full Code Here

    return new Rectangle(3,1);
  }
 
 
  protected void doPaint() {
    Rectangle rect = (Rectangle)getSize().clone();
    rect.setLocation(getAbsoluteX(), getAbsoluteY());
    String text = "["+((_checked)?"X":" ")+"]";
    CharColor colors = hasFocus()?getFocusedCheckboxColors():getColors();
    Toolkit.printString(text,rect, colors);
  }
View Full Code Here

TOP

Related Classes of jcurses.util.Rectangle

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.