public void widgetSelected (SelectionEvent event) { if (event.detail != SWT.DRAG) { ((GridData)paletteCanvas.getLayoutData()).heightHint = SWT.DEFAULT; Rectangle paletteCanvasBounds = paletteCanvas.getBounds(); int minY = paletteCanvasBounds.y + 20; Rectangle dataLabelBounds = dataLabel.getBounds(); int maxY = statusLabel.getBounds().y - dataLabelBounds.height - 20; if (event.y > minY && event.y < maxY) { Rectangle oldSash = sash.getBounds(); sash.setBounds(event.x, event.y, event.width, event.height); int diff = event.y - oldSash.y; Rectangle bounds = imageCanvas.getBounds(); imageCanvas.setBounds(bounds.x, bounds.y, bounds.width, bounds.height + diff); bounds = paletteCanvasBounds; paletteCanvas.setBounds(bounds.x, bounds.y, bounds.width, bounds.height + diff); bounds = dataLabelBounds; dataLabel.setBounds(bounds.x, bounds.y + diff, bounds.width, bounds.height); bounds = dataText.getBounds(); dataText.setBounds(bounds.x, bounds.y + diff, bounds.width, bounds.height - diff);  } }
public void widgetSelected(SelectionEvent event) { scrollPalette((ScrollBar)event.widget);
			public void widgetSelected (SelectionEvent event) {				if (event.detail != SWT.DRAG) {					((GridData)paletteCanvas.getLayoutData()).heightHint = SWT.DEFAULT;					Rectangle paletteCanvasBounds = paletteCanvas.getBounds();					int minY = paletteCanvasBounds.y + 20;					Rectangle dataLabelBounds = dataLabel.getBounds();					int maxY = statusLabel.getBounds().y - dataLabelBounds.height - 20;					if (event.y > minY && event.y < maxY) {						Rectangle oldSash = sash.getBounds();						sash.setBounds(event.x, event.y, event.width, event.height);						int diff = event.y - oldSash.y;						Rectangle bounds = imageCanvas.getBounds();						imageCanvas.setBounds(bounds.x, bounds.y, bounds.width, bounds.height + diff);						bounds = paletteCanvasBounds;						paletteCanvas.setBounds(bounds.x, bounds.y, bounds.width, bounds.height + diff);						bounds = dataLabelBounds;						dataLabel.setBounds(bounds.x, bounds.y + diff, bounds.width, bounds.height);						bounds = dataText.getBounds();						dataText.setBounds(bounds.x, bounds.y + diff, bounds.width, bounds.height - diff);						//shell.layout(true);					}				}			}