Package geom

Examples of geom.Offset


  protected void calcMinimumSize() {
    FontMetrics fontMetrics = getFontMetrics(font);
    int width = fontMetrics.stringWidth(text);
    ascent = fontMetrics.getAscent();
    decent = fontMetrics.getDescent();
    innerRectangle = new Offset(width, decent+ascent);
  }
View Full Code Here


    updateMap(fontMetrics, currentLineSoFar, lengthOfPreviousLines);
    lines.add(currentLineSoFar);
    int decent = fontMetrics.getDescent();
    double textHeight = lines.size() * (ascent + decent);
    if (hasMultipleLines) {
      innerRectangle = new Offset(actualSize.width, textHeight);
    }
    double largestHeight = Math.max(actualSize.height, textHeight);
    Offset largestSize = new Offset(actualSize.width, largestHeight);
    super.setupOuterRectangle(largestSize);
 
View Full Code Here

  }

  @Override
  protected void calcMinimumSize() {
    content.setupInnerRectangle(Box.DEFAULT_BOX_FONT_SIZE); // TODO: Use the correct font size. given the recursive depth.
    Offset contentInner = content.getInnerRectangle();
    innerRectangle = new Offset(contentInner.width+5, contentInner.height+5);
  }
View Full Code Here

  }

  @Override
  public void setupOuterRectangle(Offset actualSize) {
    content.setupOuterRectangle(content.getInnerRectangle());
    innerRectangle = new Offset(content.getInnerRectangle().width+5, content.getInnerRectangle().height+5);
    super.setupOuterRectangle(new Offset(actualSize.width, actualSize.height));
  }
View Full Code Here

 
  @Override
  protected void calcMinimumSize() {
    switch (shape) {
      case HORIZONTAL_LINE:
        innerRectangle = new Offset(0.0, THICKNESS);
        break;

      case VERTICAL_LINE:
        innerRectangle = new Offset(THICKNESS, 0.0);
        break;

      case NOTHING:
        innerRectangle = new Offset(0.0, 0.0);
        break;

      case RADICAL:
        // TODO: While using a minimum size to ensure a
        // kind of aspect ratio, this should be
        // replaced with a context aware alternative.
        innerRectangle = new Offset(GUESS_SIZE, GUESS_SIZE);
        break;

      case OPEN_SQUARE:
        innerRectangle = new Offset(3*THICKNESS, 0.0);
        break;

      case CLOSE_SQUARE:
        innerRectangle = new Offset(3*THICKNESS, 0.0);
        break;

      case OPEN_ROUND:
        innerRectangle = new Offset(3*THICKNESS, 0.0);
        break;

      case CLOSE_ROUND:
        innerRectangle = new Offset(3*THICKNESS, 0.0);
        break;

      case CONTOUR:
        innerRectangle = new Offset(GUESS_SIZE, GUESS_SIZE);
        break;

      case INTEGRAL:
        innerRectangle = new Offset(GUESS_SIZE, GUESS_SIZE);
        break;

      case OPEN_PARENTHESIS:
        innerRectangle = new Offset(PARENTHESIS_MIN);
        break;

      case CLOSE_PARENTHESIS:
        innerRectangle = new Offset(PARENTHESIS_MIN);
        break;

      case BRA:
        innerRectangle = new Offset(GUESS_SIZE, GUESS_SIZE);
        break;

      case KET:
        innerRectangle = new Offset(GUESS_SIZE, GUESS_SIZE);
        break;

      default:
        throw new RuntimeException("unfinished");
    }
View Full Code Here

  @Override
  public void setupOuterRectangle(Offset actualSize) {
    switch (shape) {
      case HORIZONTAL_LINE:
        innerRectangle = new Offset(actualSize.width, THICKNESS);
        break;
 
      case VERTICAL_LINE:
        innerRectangle = new Offset(THICKNESS, actualSize.height);
        break;
 
      case NOTHING:
        innerRectangle = new Offset(0.0, 0.0);
        break;

      case CONTOUR:
        innerRectangle = new Offset(actualSize);
        break;
 
      case INTEGRAL:
        innerRectangle = new Offset(actualSize);
        if (actualSize.height < INTEGRAL_RATIO*actualSize.width) { // Does this matter?
          innerRectangle.width = innerRectangle.height/INTEGRAL_RATIO;
        }
        break;

      case RADICAL:
        // TODO: While using a minimum size to ensure a
        // kind of aspect ratio, this should be
        // replaced with a context aware alternative.
        innerRectangle = new Offset(actualSize);
        break;

      case OPEN_SQUARE:
        innerRectangle = new Offset(2*THICKNESS, actualSize.height);
        break;

      case CLOSE_SQUARE:
        innerRectangle = new Offset(2*THICKNESS, actualSize.height);
        break;

      case OPEN_ROUND:
        innerRectangle = new Offset(0, actualSize.height);
        break;

      case CLOSE_ROUND:
        innerRectangle = new Offset(0, actualSize.height)//? 0?
        break;

      case OPEN_PARENTHESIS:
        innerRectangle = new Offset(PARENTHESIS_MIN.width, actualSize.height);
        break;

      case CLOSE_PARENTHESIS:
        innerRectangle = new Offset(PARENTHESIS_MIN.height, actualSize.height);
        break;

      case BRA:
        innerRectangle = new Offset(actualSize);
        break;

      case KET:
        innerRectangle = new Offset(actualSize);
        break;

      default:
        throw new RuntimeException("unfinished");
    }    
View Full Code Here

  protected void calcMinimumSize() {
    FontMetrics fontMetrics = getFontMetrics(font);
    int width = fontMetrics.stringWidth(text);
    int decent = fontMetrics.getDescent();
    ascent = fontMetrics.getAscent();
    innerRectangle = new Offset(width, decent+ascent);
  }
View Full Code Here

  }

  @Override
  protected void calcMinimumSize() {
    reference.calcMinimumSize();
    Offset inner = reference.getInnerRectangle();
    double width = scaleX * inner.width + shiftX;
    double height = scaleY * inner.height + shiftY;
    this.innerRectangle = new Offset(width, height);
  }
View Full Code Here

  }
 
  @Override
  public void setupOuterRectangle(Offset actualSize) {
    calcMinimumSize(); //? In case the inner rectangle of the reference object has since changed shape.
    this.outerRectangle = new Offset(innerRectangle.width, innerRectangle.height);
    super.setupOuterRectangle(actualSize);
  }
View Full Code Here

      g2D.setColor(new Color(255, 128, 255));
      // Note: top, left, width, height
      g2D.drawRect(4, 4, this.getWidth()-8, this.getHeight()-8);
    }
    display.paint(g2D, getColourScheme(), getFontSize(), getPanelRectangle());
    Offset drawRectangle = getDrawRectangle();
    panelDecoration.paint(g2D, drawRectangle, getColourScheme());
    if (DEBUG) {
      mouseEventHandler.getMouseLoop().paint(g2D);
      repaint();
      //- return;
View Full Code Here

TOP

Related Classes of geom.Offset

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.