コード例 #1
0
  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();
  }
コード例 #2
0
ファイル: FigActor.java プロジェクト: TheProjecter/plea-spl
  /** 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);
  }
コード例 #3
0
 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);
 }
コード例 #4
0
  /* 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());
  }
コード例 #5
0
  /** 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());
  }
コード例 #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());
  }
コード例 #7
0
 public void setLineColor(Color col) {
   _head.setLineColor(col);
 }
コード例 #8
0
 /*
  * @see org.tigris.gef.presentation.Fig#getLineWidth()
  */
 @Override
 public int getLineWidth() {
   return cover.getLineWidth();
 }
コード例 #9
0
 /*
  * @see org.tigris.gef.presentation.Fig#setLineWidth(int)
  */
 @Override
 public void setLineWidth(int w) {
   cover.setLineWidth(w);
   divider.setLineWidth(w);
 }
コード例 #10
0
 @Override
 public boolean isFilled() {
   return cover.isFilled();
 }
コード例 #11
0
 /*
  * @see org.tigris.gef.presentation.Fig#setLineWidth(int)
  */
 @Override
 public void setLineWidth(int w) {
   head.setLineWidth(w);
 }
コード例 #12
0
 public int getLineWidth() {
   return _head.getLineWidth();
 }
コード例 #13
0
 public Color getFillColor() {
   return _head.getFillColor();
 }
コード例 #14
0
 /*
  * @see org.tigris.gef.presentation.Fig#getLineColor()
  */
 @Override
 public Color getLineColor() {
   return cover.getLineColor();
 }
コード例 #15
0
 /*
  * @see org.tigris.gef.presentation.Fig#setLineColor(java.awt.Color)
  */
 @Override
 public void setLineColor(Color col) {
   cover.setLineColor(col);
   divider.setLineColor(col);
 }
コード例 #16
0
 /*
  * @see org.tigris.gef.presentation.Fig#getLineColor()
  */
 @Override
 public Color getLineColor() {
   return head.getLineColor();
 }
コード例 #17
0
 /*
  * @see org.tigris.gef.presentation.Fig#setFillColor(java.awt.Color)
  */
 @Override
 public void setFillColor(Color col) {
   head.setFillColor(col);
 }
コード例 #18
0
 /*
  * @see org.tigris.gef.presentation.Fig#getLineWidth()
  */
 @Override
 public int getLineWidth() {
   return head.getLineWidth();
 }
コード例 #19
0
 public Color getLineColor() {
   return _head.getLineColor();
 }
コード例 #20
0
 /*
  * @see org.tigris.gef.presentation.Fig#setLineColor(java.awt.Color)
  */
 @Override
 public void setLineColor(Color col) {
   head.setLineColor(col);
 }
コード例 #21
0
 public void setFillColor(Color col) {
   _head.setFillColor(col);
 }
コード例 #22
0
 /*
  * @see org.tigris.gef.presentation.Fig#getFillColor()
  */
 @Override
 public Color getFillColor() {
   return cover.getFillColor();
 }
コード例 #23
0
 public void setLineWidth(int w) {
   _head.setLineWidth(w);
 }
コード例 #24
0
 /*
  * @see org.tigris.gef.presentation.Fig#setFilled(boolean)
  */
 @Override
 public void setFilled(boolean f) {
   cover.setFilled(f);
   getBigPort().setFilled(f);
 }
コード例 #25
0
 /*
  * @see org.tigris.gef.presentation.Fig#setFillColor(java.awt.Color)
  */
 @Override
 public void setFillColor(Color col) {
   cover.setFillColor(col);
 }
コード例 #26
0
 /*
  * @see org.tigris.gef.presentation.Fig#getFillColor()
  */
 @Override
 public Color getFillColor() {
   return head.getFillColor();
 }