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();
  }
Esempio n. 2
0
  /** Main Constructor for the creation of a new Actor. */
  public FigActor() {
    // Put this rectangle behind the rest, so it goes first
    FigRect bigPort = new ActorPortFigRect(10, 10, 15, 60, this);
    bigPort.setVisible(false);
    FigCircle head = new FigCircle(10, 10, 15, 15, Color.black, Color.white);
    FigLine body = new FigLine(20, 25, 20, 40, Color.black);
    FigLine arms = new FigLine(10, 30, 30, 30, Color.black);
    FigLine leftLeg = new FigLine(20, 40, 15, 55, Color.black);
    FigLine rightLeg = new FigLine(20, 40, 25, 55, Color.black);
    getNameFig().setBounds(5, 55, 35, 20);

    getNameFig().setTextFilled(false);
    getNameFig().setFilled(false);
    getNameFig().setLineWidth(0);
    // initialize any other Figs here
    getStereotypeFig().setBounds(getBigPort().getCenter().x, getBigPort().getCenter().y, 0, 0);

    // add Figs to the FigNode in back-to-front order
    addFig(bigPort);
    addFig(getNameFig());
    addFig(head);
    addFig(body);
    addFig(arms);
    addFig(leftLeg);
    addFig(rightLeg);
    addFig(getStereotypeFig());
    setBigPort(bigPort);
  }
 public void setLineColor(Color c) {
   //     super.setLineColor(c);
   _cover.setLineColor(c);
   _stereo.setFilled(false);
   _stereo.setLineWidth(0);
   _name.setFilled(false);
   _name.setLineWidth(0);
   _upperRect.setLineColor(c);
   _lowerRect.setLineColor(c);
 }
  /* 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());
  }
Esempio n. 6
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());
  }
 public void setLineColor(Color col) {
   _head.setLineColor(col);
 }
 /*
  * @see org.tigris.gef.presentation.Fig#getLineWidth()
  */
 @Override
 public int getLineWidth() {
   return cover.getLineWidth();
 }
 /*
  * @see org.tigris.gef.presentation.Fig#setLineWidth(int)
  */
 @Override
 public void setLineWidth(int w) {
   cover.setLineWidth(w);
   divider.setLineWidth(w);
 }
 @Override
 public boolean isFilled() {
   return cover.isFilled();
 }
Esempio n. 11
0
 /*
  * @see org.tigris.gef.presentation.Fig#setLineWidth(int)
  */
 @Override
 public void setLineWidth(int w) {
   head.setLineWidth(w);
 }
 public int getLineWidth() {
   return _head.getLineWidth();
 }
 public Color getFillColor() {
   return _head.getFillColor();
 }
 /*
  * @see org.tigris.gef.presentation.Fig#getLineColor()
  */
 @Override
 public Color getLineColor() {
   return cover.getLineColor();
 }
 /*
  * @see org.tigris.gef.presentation.Fig#setLineColor(java.awt.Color)
  */
 @Override
 public void setLineColor(Color col) {
   cover.setLineColor(col);
   divider.setLineColor(col);
 }
Esempio n. 16
0
 /*
  * @see org.tigris.gef.presentation.Fig#getLineColor()
  */
 @Override
 public Color getLineColor() {
   return head.getLineColor();
 }
Esempio n. 17
0
 /*
  * @see org.tigris.gef.presentation.Fig#setFillColor(java.awt.Color)
  */
 @Override
 public void setFillColor(Color col) {
   head.setFillColor(col);
 }
Esempio n. 18
0
 /*
  * @see org.tigris.gef.presentation.Fig#getLineWidth()
  */
 @Override
 public int getLineWidth() {
   return head.getLineWidth();
 }
 public Color getLineColor() {
   return _head.getLineColor();
 }
Esempio n. 20
0
 /*
  * @see org.tigris.gef.presentation.Fig#setLineColor(java.awt.Color)
  */
 @Override
 public void setLineColor(Color col) {
   head.setLineColor(col);
 }
 public void setFillColor(Color col) {
   _head.setFillColor(col);
 }
 /*
  * @see org.tigris.gef.presentation.Fig#getFillColor()
  */
 @Override
 public Color getFillColor() {
   return cover.getFillColor();
 }
 public void setLineWidth(int w) {
   _head.setLineWidth(w);
 }
 /*
  * @see org.tigris.gef.presentation.Fig#setFilled(boolean)
  */
 @Override
 public void setFilled(boolean f) {
   cover.setFilled(f);
   getBigPort().setFilled(f);
 }
 /*
  * @see org.tigris.gef.presentation.Fig#setFillColor(java.awt.Color)
  */
 @Override
 public void setFillColor(Color col) {
   cover.setFillColor(col);
 }
Esempio n. 26
0
 /*
  * @see org.tigris.gef.presentation.Fig#getFillColor()
  */
 @Override
 public Color getFillColor() {
   return head.getFillColor();
 }