コード例 #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
 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);
 }