use of org.eclipse.swt.graphics.Rectangle in project translationstudio8 by heartsome.
the class PaddingDecorator method paintCell.
public void paintCell(LayerCell cell, GC gc, Rectangle bounds, IConfigRegistry configRegistry) {
Rectangle interiorBounds = new Rectangle(bounds.x + leftPadding, bounds.y + topPadding, bounds.width - leftPadding - rightPadding, bounds.height - topPadding - bottomPadding);
super.paintCell(cell, gc, interiorBounds, configRegistry);
}
use of org.eclipse.swt.graphics.Rectangle in project translationstudio8 by heartsome.
the class CompositeLayer method getChildClientArea.
private Rectangle getChildClientArea(final int layoutX, final int layoutY) {
final ChildLayerInfo childLayerInfo = getChildLayerInfoByLayout(layoutX, layoutY);
final Rectangle compositeClientArea = getClientAreaProvider().getClientArea();
final Rectangle childClientArea = new Rectangle(compositeClientArea.x + childLayerInfo.getWidthOffset(), compositeClientArea.y + childLayerInfo.getHeightOffset(), childLayerInfo.getLayer().getPreferredWidth(), childLayerInfo.getLayer().getPreferredHeight());
final Rectangle intersection = compositeClientArea.intersection(childClientArea);
return intersection;
}
use of org.eclipse.swt.graphics.Rectangle in project translationstudio8 by heartsome.
the class CompositeLayer method setChildLayer.
// Child layer stuff
public void setChildLayer(String regionName, ILayer childLayer, final int layoutX, final int layoutY) {
if (childLayer == null) {
throw new IllegalArgumentException("Cannot set null child layer");
}
childLayerToRegionNameMap.put(childLayer, regionName);
childLayer.addLayerListener(this);
childLayerToLayoutCoordinateMap.put(childLayer, new LayoutCoordinate(layoutX, layoutY));
childLayerLayout[layoutX][layoutY] = childLayer;
childLayer.setClientAreaProvider(new IClientAreaProvider() {
public Rectangle getClientArea() {
return getChildClientArea(layoutX, layoutY);
}
});
}
use of org.eclipse.swt.graphics.Rectangle in project translationstudio8 by heartsome.
the class CompositeLayer method getBoundsByPosition.
@Override
public Rectangle getBoundsByPosition(int compositeColumnPosition, int compositeRowPosition) {
ChildLayerInfo childLayerInfo = getChildLayerInfoByPosition(compositeColumnPosition, compositeRowPosition);
if (childLayerInfo == null) {
return null;
}
ILayer childLayer = childLayerInfo.getLayer();
int childColumnPosition = compositeColumnPosition - childLayerInfo.getColumnPositionOffset();
int childRowPosition = compositeRowPosition - childLayerInfo.getRowPositionOffset();
final Rectangle bounds = childLayer.getBoundsByPosition(childColumnPosition, childRowPosition);
if (bounds != null) {
bounds.x += childLayerInfo.widthOffset;
bounds.y += childLayerInfo.heightOffset;
}
return bounds;
}
use of org.eclipse.swt.graphics.Rectangle in project translationstudio8 by heartsome.
the class ColorPicker method getColorImage.
private Image getColorImage(Color color) {
Display display = Display.getCurrent();
image = new Image(display, new Rectangle(10, 10, 70, 20));
GC gc = new GC(image);
gc.setBackground(color);
gc.fillRectangle(image.getBounds());
gc.dispose();
return image;
}
Aggregations