コード例 #1
0
  @Override
  public void updateMinimumSize() {
    final Dimension min;
    if (getTarget().isMinimumSizeSet()) {
      min = getTarget().getMinimumSize();
      min.width = Math.max(min.width, MINIMUM_WIDTH);
      min.height = Math.max(min.height, MINIMUM_HEIGHT);
    } else {
      min = new Dimension(MINIMUM_WIDTH, MINIMUM_HEIGHT);
    }

    final int maxW, maxH;
    if (graphicsConfig instanceof TextureSizeConstraining) {
      maxW = ((TextureSizeConstraining) graphicsConfig).getMaxTextureWidth();
      maxH = ((TextureSizeConstraining) graphicsConfig).getMaxTextureHeight();
    } else {
      maxW = maxH = Integer.MAX_VALUE;
    }

    final Dimension max;
    if (getTarget().isMaximumSizeSet()) {
      max = getTarget().getMaximumSize();
      max.width = Math.min(max.width, maxW);
      max.height = Math.min(max.height, maxH);
    } else {
      max = new Dimension(maxW, maxH);
    }

    platformWindow.setSizeConstraints(min.width, min.height, max.width, max.height);
  }
コード例 #2
0
ファイル: LWWindowPeer.java プロジェクト: JetBrains/jdk8u_jdk
  @Override
  public void updateMinimumSize() {
    final Dimension min;
    if (getTarget().isMinimumSizeSet()) {
      min = getTarget().getMinimumSize();
      min.width = Math.max(min.width, MINIMUM_WIDTH);
      min.height = Math.max(min.height, MINIMUM_HEIGHT);
    } else {
      min = new Dimension(MINIMUM_WIDTH, MINIMUM_HEIGHT);
    }

    final Dimension max;
    if (getTarget().isMaximumSizeSet()) {
      max = getTarget().getMaximumSize();
      max.width = Math.min(max.width, getLWGC().getMaxTextureWidth());
      max.height = Math.min(max.height, getLWGC().getMaxTextureHeight());
    } else {
      max = new Dimension(getLWGC().getMaxTextureWidth(), getLWGC().getMaxTextureHeight());
    }

    platformWindow.setSizeConstraints(min.width, min.height, max.width, max.height);
  }
コード例 #3
0
  public void XRCompositeTraps(int dst, int srcX, int srcY, TrapezoidList trapList) {
    int renderReferenceX = 0;
    int renderReferenceY = 0;

    if (trapList.getP1YLeft(0) < trapList.getP2YLeft(0)) {
      renderReferenceX = trapList.getP1XLeft(0);
      renderReferenceY = trapList.getP1YLeft(0);
    } else {
      renderReferenceX = trapList.getP2XLeft(0);
      renderReferenceY = trapList.getP2YLeft(0);
    }

    renderReferenceX = (int) Math.floor(XRUtils.XFixedToDouble(renderReferenceX));
    renderReferenceY = (int) Math.floor(XRUtils.XFixedToDouble(renderReferenceY));

    con.renderCompositeTrapezoids(
        compRule,
        src.picture,
        XRUtils.PictStandardA8,
        dst,
        renderReferenceX,
        renderReferenceY,
        trapList);
  }