public void setBounds(int x, int y, int w, int h) {
    if (_name == null) return;

    Rectangle oldBounds = getBounds();
    _bigPort.setBounds(x, y, w, h);
    _cover.setBounds(x, y, w, h);

    Dimension stereoDim = _stereo.getMinimumSize();
    Dimension nameDim = _name.getMinimumSize();

    if (h < 50) {
      _upperRect.setBounds(x - 10, y + h / 6, 20, 10);
      _lowerRect.setBounds(x - 10, y + 3 * h / 6, 20, 10);
    } else {
      _upperRect.setBounds(x - 10, y + 13, 20, 10);
      _lowerRect.setBounds(x - 10, y + 39, 20, 10);
    }

    _stereo.setBounds(x + 1, y + 1, w - 2, stereoDim.height);
    _name.setBounds(x + 1, y + stereoDim.height - OVERLAP + 1, w - 2, nameDim.height);
    _x = x;
    _y = y;
    _w = w;
    _h = h;
    firePropChange("bounds", oldBounds, getBounds());
    updateEdges();
  }
  /* Override setBounds to keep shapes looking right */
  public void setBounds(int x, int y, int w, int h) {
    Rectangle oldBounds = getBounds();
    if (w > h) h = 9;
    else w = 9;
    _bigPort.setBounds(x, y, w, h);
    _head.setBounds(x, y, w, h);

    calcBounds(); // _x = x; _y = y; _w = w; _h = h;
    updateEdges();
    firePropChange("bounds", oldBounds, getBounds());
  }
  /** Override setBounds to keep shapes looking right. {@inheritDoc} */
  @Override
  protected void setStandardBounds(int x, int y, int w, int h) {
    if (getNameFig() == null) {
      return;
    }
    Rectangle oldBounds = getBounds();
    Dimension nameDim = getNameFig().getMinimumSize();

    getNameFig().setBounds(x + MARGIN, y + SPACE_TOP, w - 2 * MARGIN, nameDim.height);
    divider.setShape(x, y + DIVIDER_Y + nameDim.height, x + w - 1, y + DIVIDER_Y + nameDim.height);

    getInternal()
        .setBounds(
            x + MARGIN,
            y + SPACE_TOP + nameDim.height + SPACE_MIDDLE,
            w - 2 * MARGIN,
            h - SPACE_TOP - nameDim.height - SPACE_MIDDLE - SPACE_BOTTOM);

    getBigPort().setBounds(x, y, w, h);
    cover.setBounds(x, y, w, h);

    calcBounds(); // _x = x; _y = y; _w = w; _h = h;
    updateEdges();
    firePropChange("bounds", oldBounds, getBounds());
  }
Example #4
0
  /*
   * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
   */
  @Override
  protected void setStandardBounds(int x, int y, int w, int h) {
    Rectangle oldBounds = getBounds();
    if (w > h) {
      h = HEIGHT;
    } else {
      w = HEIGHT;
    }
    getBigPort().setBounds(x, y, w, h);
    head.setBounds(x, y, w, h);

    calcBounds();
    updateEdges();
    firePropChange("bounds", oldBounds, getBounds());
  }