Merge branch 'master' into caching

Conflicts:
	diylc/diylc-swing/library/main.jar
This commit is contained in:
bancika
2020-04-06 22:26:32 +02:00
8 changed files with 41 additions and 18 deletions
@@ -163,7 +163,8 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
}
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : getStandingBodyColor());
g2d.fill(body);
g2d.setComposite(oldComposite);
g2d.setComposite(oldComposite);
Color finalBorderColor;
if (outlineMode) {
Theme theme =
@@ -179,7 +180,12 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
g2d.setColor(finalBorderColor);
drawingObserver.stopTracking();
g2d.draw(body);
drawingObserver.startTracking();
if (!outlineMode) {
drawLead(g2d, componentState, drawingObserver, false);
}
@@ -258,6 +264,8 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
}
}
drawingObserver.stopTracking();
Composite newComposite = null;
if (!decorateAboveBorder())
decorateComponentBody(g2d, outlineMode);
@@ -326,6 +334,8 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
offset = -offset;
}
drawingObserver.startTracking();
if (getMoveLabel()) {
g2d.setTransform(oldTransform);
g2d.translate(getPoints()[2].x, getPoints()[2].y);
@@ -90,6 +90,8 @@ public class HookupWire extends AbstractCurvedComponent<Void> implements IContin
drawingObserver.startTracking();
}
drawingObserver.stopTracking();
if (componentState == ComponentState.NORMAL) {
g2d.setColor(color.darker());
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1f));
@@ -104,23 +104,24 @@ public class TwistedWire extends AbstractCurvedComponent<Void> implements IConti
}
g2d.setColor(curveColor1);
drawingObserver.startTracking();
g2d.fill(firstLeadArea);
drawingObserver.stopTracking();
if (stripe1 && componentState == ComponentState.NORMAL) {
drawingObserver.stopTracking();
g2d.setColor(stripeColor);
g2d.fill(firstLeadStripeArea);
drawingObserver.startTracking();
g2d.fill(firstLeadStripeArea);
}
g2d.setColor(curveColor2);
drawingObserver.startTracking();
g2d.fill(secondLeadArea);
drawingObserver.stopTracking();
if (stripe2 && componentState == ComponentState.NORMAL) {
drawingObserver.stopTracking();
if (stripe2 && componentState == ComponentState.NORMAL) {
g2d.setColor(stripeColor2);
g2d.fill(secondLeadStripeArea);
drawingObserver.startTracking();
g2d.fill(secondLeadStripeArea);
}
if (componentState == ComponentState.NORMAL) {
@@ -217,7 +217,9 @@ public class CliffJack1_4 extends AbstractMultiPartComponent<String> {
finalBorderColor = theme.getOutlineColor();
} else {
finalBorderColor = BORDER_COLOR;
}
}
drawingObserver.stopTracking();
g2d.setColor(finalBorderColor);
for (int i = 0; i < body.length - 1; i++) {
@@ -183,7 +183,12 @@ public class FuseHolderPanel extends AbstractMultiPartComponent<String> {
if (a != null) {
g2d.fill(a);
break;
}
}
// Do not track these changes because the whole switch has been tracked
// so far.
drawingObserver.stopTracking();
g2d.setComposite(oldComposite);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
Color finalBorderColor;
@@ -197,9 +202,6 @@ public class FuseHolderPanel extends AbstractMultiPartComponent<String> {
if (a != null)
g2d.draw(a);
}
// Do not track these changes because the whole switch has been tracked
// so far.
drawingObserver.stopTracking();
// Draw lugs.
int lugWidth = getClosestOdd((int) LUG_WIDTH.convertToPixels());
@@ -204,7 +204,12 @@ public class IECSocket extends AbstractMultiPartComponent<String> {
if (a != null) {
g2d.fill(a);
break;
}
}
// Do not track these changes because the whole switch has been tracked
// so far.
drawingObserver.stopTracking();
g2d.setComposite(oldComposite);
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
Color finalBorderColor;
@@ -218,9 +223,6 @@ public class IECSocket extends AbstractMultiPartComponent<String> {
if (a != null)
g2d.draw(a);
}
// Do not track these changes because the whole switch has been tracked
// so far.
drawingObserver.stopTracking();
// Draw lugs.
int lugWidth = getClosestOdd((int) LUG_WIDTH.convertToPixels());
@@ -142,13 +142,17 @@ public class OpenJack1_4 extends AbstractMultiPartComponent<String> {
finalBorderColor = theme.getOutlineColor();
} else {
finalBorderColor = BASE_COLOR.darker();
}
}
drawingObserver.stopTracking();
g2d.setColor(finalBorderColor);
g2d.draw(body[1]);
g2d.draw(body[2]);
if (body[3] != null)
g2d.draw(body[3]);
g2d.draw(body[3]);
drawingObserver.startTracking();
// draw labels
if (showLabels) {
Binary file not shown.