mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
abstract leaded component changes
This commit is contained in:
+3
@@ -46,6 +46,7 @@ class G2DWrapper extends Graphics2D {
|
||||
private Color originalColor;
|
||||
private Composite originalComposite;
|
||||
private AffineTransform originalTx;
|
||||
private Font originalFont;
|
||||
private AffineTransform currentTx;
|
||||
private Area currentArea;
|
||||
|
||||
@@ -69,6 +70,7 @@ class G2DWrapper extends Graphics2D {
|
||||
originalColor = canvasGraphics.getColor();
|
||||
originalTx = canvasGraphics.getTransform();
|
||||
originalComposite = canvasGraphics.getComposite();
|
||||
originalFont = canvasGraphics.getFont();
|
||||
currentTx = new AffineTransform();
|
||||
}
|
||||
|
||||
@@ -83,6 +85,7 @@ class G2DWrapper extends Graphics2D {
|
||||
canvasGraphics.setColor(originalColor);
|
||||
canvasGraphics.setTransform(originalTx);
|
||||
canvasGraphics.setComposite(originalComposite);
|
||||
canvasGraphics.setFont(originalFont);
|
||||
return currentArea;
|
||||
}
|
||||
|
||||
|
||||
+8
-7
@@ -63,10 +63,11 @@ public class Presenter implements IPlugInPort {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(Presenter.class);
|
||||
|
||||
private static final VersionNumber CURRENT_VERSION = new VersionNumber(0, 0, 0);
|
||||
private static final String DEFAULTS_KEY = "defaults";
|
||||
private static final int CONTROL_POINT_SENSITIVITY = 4;
|
||||
private static final int ICON_SIZE = 32;
|
||||
public static final VersionNumber CURRENT_VERSION = new VersionNumber(0, 0, 0);
|
||||
public static final String DEFAULTS_KEY = "defaults";
|
||||
public static final int CONTROL_POINT_SENSITIVITY = 4;
|
||||
public static final int ICON_SIZE = 32;
|
||||
public static boolean ENABLE_ANTIALIASING = true;
|
||||
|
||||
private double zoomLevel = 1;
|
||||
private Map<IDIYComponent, Area> componentAreaMap;
|
||||
@@ -255,7 +256,7 @@ public class Presenter implements IPlugInPort {
|
||||
}
|
||||
G2DWrapper g2dWrapper = new G2DWrapper(g2d);
|
||||
|
||||
if (drawOptions.contains(DrawOption.ANTIALIASING)) {
|
||||
if (drawOptions.contains(DrawOption.ANTIALIASING) && ENABLE_ANTIALIASING) {
|
||||
g2d
|
||||
.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
@@ -264,7 +265,7 @@ public class Presenter implements IPlugInPort {
|
||||
AffineTransform initialTx = g2d.getTransform();
|
||||
Dimension d = getCanvasDimensions(drawOptions.contains(DrawOption.ZOOM));
|
||||
|
||||
g2dWrapper.setColor(Color.white);
|
||||
g2dWrapper.setColor(Constants.CANVAS_COLOR);
|
||||
g2dWrapper.fillRect(0, 0, d.width, d.height);
|
||||
|
||||
if (drawOptions.contains(DrawOption.GRID)) {
|
||||
@@ -706,7 +707,7 @@ public class Presenter implements IPlugInPort {
|
||||
// Instantiate the component.
|
||||
IDIYComponent component = componentClass.newInstance();
|
||||
|
||||
// Find the next available name for the component.
|
||||
// Find the next available componentName for the component.
|
||||
int i = 0;
|
||||
boolean exists = true;
|
||||
while (exists) {
|
||||
|
||||
Reference in New Issue
Block a user