/**
* @return the {@link IDeviceView} for given object.
*/
public static IDeviceView getDeviceView(IUIObjectInfo object) {
DeviceInfo device = getDevice(object);
Orientation orientation = getOrientation(object);
if (device == null) {
return null;
}
// prepare view parts
final Image image;
final org.eclipse.wb.draw2d.geometry.Rectangle displayBounds;
if (orientation == Orientation.PORTRAIT) {
image = device.getImage();
displayBounds = device.getDisplayBounds();
} else {
image = getRotatedImage(device.getImage());
//displayBounds = device.getDisplayBounds().getTransposed();
Rectangle ib = image.getBounds();
org.eclipse.wb.draw2d.geometry.Rectangle db = device.getDisplayBounds();
int y = ib.height - db.right();
int x = db.y;
displayBounds = new org.eclipse.wb.draw2d.geometry.Rectangle(x, y, db.height, db.width);
}
// return view