public void setBounds(int x, int y, int w, int h) { Rectangle oldBounds = getBounds(); _bigPort.setBounds(x, y, w, h); _cover.setBounds(x, y, w, h); Dimension nameDim = _name.getMinimumSize(); _name.setBounds( x + (w - nameDim.width) / 2, y + (h - nameDim.height) / 2, nameDim.width, nameDim.height); _x = x; _y = y; _w = w; _h = h; firePropChange("bounds", oldBounds, getBounds()); updateEdges(); }
/** 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(); getBigPort().setBounds(x, y, w, h); inCircle.setBounds(x + 5, y + 5, w - 10, h - 10); calcBounds(); // _x = x; _y = y; _w = w; _h = h; updateEdges(); firePropChange("bounds", oldBounds, getBounds()); }