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();
  }
 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);
 }
예제 #3
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());
  }
예제 #4
0
 public int getLineWidth() {
   return _head.getLineWidth();
 }
예제 #5
0
 public void setLineWidth(int w) {
   _head.setLineWidth(w);
 }
예제 #6
0
 public Color getFillColor() {
   return _head.getFillColor();
 }
예제 #7
0
 public void setFillColor(Color col) {
   _head.setFillColor(col);
 }
예제 #8
0
 public Color getLineColor() {
   return _head.getLineColor();
 }
예제 #9
0
 public void setLineColor(Color col) {
   _head.setLineColor(col);
 }