Ejemplo n.º 1
0
  public void resize(int offsetWidth, int offsetHeight, boolean update) {
    int w = offsetWidth;
    int h = offsetHeight;

    int width = optionsPanel.isVisible() ? w - optionsPanel.getOffsetWidth() - PLOTPANEL_MARGIN : w;
    int height =
        (frequencyTable.isVisible() ? h - spFrequencyTable.getOffsetHeight() : h)
            - lbDisplayType.getOffsetHeight()
            - PLOTPANEL_MARGIN;

    if (daModel.isRegressionMode()) {
      height -= 2 * lblTitleX.getOffsetHeight();
      height -= lblTitleY.getOffsetHeight();
    }

    if (width < PLOTPANEL_MIN_WIDTH) {
      width = PLOTPANEL_MIN_WIDTH;
    }

    if (height < PLOTPANEL_MIN_HEIGHT) {
      height = PLOTPANEL_MIN_HEIGHT;
    }

    if (oldWidth == width && oldHeight == height) {
      return;
    }

    oldWidth = width;
    oldHeight = height;

    plotPanel.setPreferredSize(new GDimensionW(width, height));
    if (optionsPanel.isVisible()) {
      optionsPanel.resize(height);
    }
    plotPanel.updateSize();
    plotPanel.repaintView();
    plotPanel.getEuclidianController().calculateEnvironment();
    if (update) {
      getModel().updatePlot(false);
    }

    if (app.has(Feature.JLM_IN_WEB)) {
      imagePanel.setPixelSize(width, height);

    } else {
      imageContainer.setPixelSize(width, height);
    }
  }
 /*
  * (non-Javadoc)
  * @see ch.unifr.pai.twice.mousecontrol.client.TouchPadWidget#updateScreenDimensions()
  */
 @Override
 protected void updateScreenDimensions() {
   spacer.setWidth((scroller.getOffsetWidth() + screenWidth) + "px");
   spacer.setHeight((scroller.getOffsetHeight() + screenHeight) + "px");
 }