Beispiel #1
0
  @Override
  public void doLayout(final Size maximumSize) {
    LOG.debug("doLayout() " + maximumSize + "  " + getSize());
    final View toolbar = getSubviews()[0];
    maximumSize.contract(getPadding());
    final Size toolbarSize = toolbar.getRequiredSize(maximumSize);
    LOG.debug("   toolbar " + toolbarSize);
    Bounds bounds = new Bounds(toolbarSize);
    toolbar.setBounds(bounds);

    final View grid = getSubviews()[1];
    final Size gridSize = getRequiredSize(Size.createMax());
    gridSize.contract(getPadding());
    gridSize.contractHeight(toolbarSize.getHeight());
    bounds = new Bounds(new Location(0, toolbarSize.getHeight()), gridSize);
    grid.setBounds(bounds);
    LOG.debug("   grid " + toolbarSize);
  }
  public void initSize() {
    internalDisplaySize = createSize(renderingArea.getSize());
    insets = renderingArea.getInsets();
    LOG.debug("  insets " + insets);
    internalDisplaySize.contract(insets.left + insets.right, insets.top + insets.bottom);
    LOG.debug("  internal " + internalDisplaySize);

    final Size rootViewSize = new Size(internalDisplaySize);
    final Text text = Toolkit.getText(ColorsAndFonts.TEXT_STATUS);
    statusBarHeight = text.getLineHeight() + text.getDescent();
    rootViewSize.contractHeight(statusBarHeight);
    statusBarArea =
        new Bounds(
            insets.left,
            insets.top + rootViewSize.getHeight(),
            rootViewSize.getWidth(),
            statusBarHeight);
    rootView.setSize(rootViewSize);
  }