mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
Better rendering of guitar pickups when dragging and in outline mode
This commit is contained in:
@@ -106,17 +106,18 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
|
||||||
if (alpha < MAX_ALPHA) {
|
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
|
||||||
}
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
|
||||||
if (getType() != HumbuckerType.Filtertron)
|
|
||||||
g2d.fill(body[0]);
|
|
||||||
if (body[1] != null)
|
|
||||||
g2d.fill(body[1]);
|
|
||||||
|
|
||||||
|
Composite oldComposite = g2d.getComposite();
|
||||||
|
if (alpha < MAX_ALPHA) {
|
||||||
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
|
}
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
||||||
|
if (getType() != HumbuckerType.Filtertron)
|
||||||
|
g2d.fill(body[0]);
|
||||||
|
if (body[1] != null)
|
||||||
|
g2d.fill(body[1]);
|
||||||
|
|
||||||
|
if (!outlineMode) {
|
||||||
if (body[4] != null) {
|
if (body[4] != null) {
|
||||||
g2d.setColor(getBobinColor1());
|
g2d.setColor(getBobinColor1());
|
||||||
g2d.fill(body[4]);
|
g2d.fill(body[4]);
|
||||||
@@ -125,17 +126,19 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(getBobinColor2());
|
g2d.setColor(getBobinColor2());
|
||||||
g2d.fill(body[5]);
|
g2d.fill(body[5]);
|
||||||
}
|
}
|
||||||
if (getType() == HumbuckerType.Filtertron) {
|
}
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
|
||||||
g2d.fill(body[0]);
|
if (getType() == HumbuckerType.Filtertron) {
|
||||||
}
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
||||||
|
g2d.fill(body[0]);
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
|
||||||
g2d.fill(body[2]);
|
|
||||||
|
|
||||||
g2d.setComposite(oldComposite);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
||||||
|
g2d.fill(body[2]);
|
||||||
|
|
||||||
|
g2d.setComposite(oldComposite);
|
||||||
|
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
Theme theme =
|
Theme theme =
|
||||||
@@ -154,14 +157,15 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
if (body[1] != null)
|
if (body[1] != null)
|
||||||
g2d.draw(body[1]);
|
g2d.draw(body[1]);
|
||||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
|
||||||
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[3]);
|
g2d.fill(body[3]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
g2d.draw(body[3]);
|
g2d.draw(body[3]);
|
||||||
if (body[6] != null)
|
if (body[6] != null)
|
||||||
g2d.draw(body[6]);
|
g2d.draw(body[6]);
|
||||||
|
|
||||||
if (getType() != HumbuckerType.Filtertron) {
|
if (getType() != HumbuckerType.Filtertron) {
|
||||||
if (body[4] != null) {
|
if (body[4] != null) {
|
||||||
g2d.setColor(getBobinColor1().darker());
|
g2d.setColor(getBobinColor1().darker());
|
||||||
@@ -171,8 +175,9 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(getBobinColor2().darker());
|
g2d.setColor(getBobinColor2().darker());
|
||||||
g2d.draw(body[5]);
|
g2d.draw(body[5]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getType() == HumbuckerType.Filtertron) {
|
if (getType() == HumbuckerType.Filtertron) {
|
||||||
g2d.setColor(finalBorderColor);
|
g2d.setColor(finalBorderColor);
|
||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
|
|||||||
@@ -91,19 +91,18 @@ public class JazzBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
|
||||||
if (alpha < MAX_ALPHA) {
|
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
|
||||||
}
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
|
||||||
g2d.fill(body[0]);
|
|
||||||
g2d.fill(body[1]);
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
|
||||||
g2d.fill(body[2]);
|
|
||||||
g2d.setComposite(oldComposite);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Composite oldComposite = g2d.getComposite();
|
||||||
|
if (alpha < MAX_ALPHA) {
|
||||||
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
|
}
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
||||||
|
g2d.fill(body[0]);
|
||||||
|
g2d.fill(body[1]);
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
||||||
|
g2d.fill(body[2]);
|
||||||
|
g2d.setComposite(oldComposite);
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
Theme theme =
|
Theme theme =
|
||||||
@@ -120,11 +119,12 @@ public class JazzBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(finalBorderColor);
|
g2d.setColor(finalBorderColor);
|
||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
g2d.draw(body[1]);
|
g2d.draw(body[1]);
|
||||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
|
||||||
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[3]);
|
g2d.fill(body[3]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
g2d.draw(body[3]);
|
g2d.draw(body[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Color finalLabelColor;
|
Color finalLabelColor;
|
||||||
|
|||||||
@@ -98,19 +98,18 @@ public class P90Pickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
Composite oldComposite = g2d.getComposite();
|
||||||
if (alpha < MAX_ALPHA) {
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
}
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
|
||||||
g2d.fill(body[0]);
|
|
||||||
if (body[1] != null)
|
|
||||||
g2d.fill(body[1]);
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
|
||||||
g2d.fill(body[2]);
|
|
||||||
g2d.setComposite(oldComposite);
|
|
||||||
}
|
}
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
||||||
|
g2d.fill(body[0]);
|
||||||
|
if (body[1] != null)
|
||||||
|
g2d.fill(body[1]);
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
||||||
|
g2d.fill(body[2]);
|
||||||
|
g2d.setComposite(oldComposite);
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
@@ -128,12 +127,13 @@ public class P90Pickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.setColor(finalBorderColor);
|
g2d.setColor(finalBorderColor);
|
||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
if (body[1] != null)
|
if (body[1] != null)
|
||||||
g2d.draw(body[1]);
|
g2d.draw(body[1]);
|
||||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
|
||||||
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[3]);
|
g2d.fill(body[3]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
g2d.draw(body[3]);
|
g2d.draw(body[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Color finalLabelColor;
|
Color finalLabelColor;
|
||||||
|
|||||||
@@ -89,18 +89,17 @@ public class PBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
Composite oldComposite = g2d.getComposite();
|
||||||
if (alpha < MAX_ALPHA) {
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
}
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
|
||||||
g2d.fill(body[0]);
|
|
||||||
g2d.fill(body[1]);
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
|
||||||
g2d.fill(body[2]);
|
|
||||||
g2d.setComposite(oldComposite);
|
|
||||||
}
|
}
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
||||||
|
g2d.fill(body[0]);
|
||||||
|
g2d.fill(body[1]);
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
||||||
|
g2d.fill(body[2]);
|
||||||
|
g2d.setComposite(oldComposite);
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
@@ -117,12 +116,13 @@ public class PBassPickup extends AbstractTransparentComponent<String> {
|
|||||||
|
|
||||||
g2d.setColor(finalBorderColor);
|
g2d.setColor(finalBorderColor);
|
||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
g2d.draw(body[1]);
|
g2d.draw(body[1]);
|
||||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
|
||||||
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[3]);
|
g2d.fill(body[3]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
g2d.draw(body[3]);
|
g2d.draw(body[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Color finalLabelColor;
|
Color finalLabelColor;
|
||||||
|
|||||||
@@ -107,27 +107,26 @@ public class SingleCoilPickup extends AbstractTransparentComponent<String> {
|
|||||||
Shape[] body = getBody();
|
Shape[] body = getBody();
|
||||||
|
|
||||||
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1));
|
||||||
if (componentState != ComponentState.DRAGGING) {
|
|
||||||
Composite oldComposite = g2d.getComposite();
|
|
||||||
if (alpha < MAX_ALPHA) {
|
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
|
||||||
}
|
|
||||||
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : getBaseColor());
|
Composite oldComposite = g2d.getComposite();
|
||||||
g2d.fill(body[4]);
|
if (alpha < MAX_ALPHA) {
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : getColor());
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f * alpha / MAX_ALPHA));
|
||||||
if (body[0] == null)
|
|
||||||
g2d.fill(body[3]);
|
|
||||||
else
|
|
||||||
g2d.fill(body[0]);
|
|
||||||
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
|
||||||
g2d.fill(body[1]);
|
|
||||||
|
|
||||||
// g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
|
||||||
// g2d.fill(body[3]);
|
|
||||||
g2d.setComposite(oldComposite);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : getBaseColor());
|
||||||
|
g2d.fill(body[4]);
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : getColor());
|
||||||
|
if (body[0] == null)
|
||||||
|
g2d.fill(body[3]);
|
||||||
|
else
|
||||||
|
g2d.fill(body[0]);
|
||||||
|
g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : POINT_COLOR);
|
||||||
|
g2d.fill(body[1]);
|
||||||
|
|
||||||
|
// g2d.setColor(outlineMode ? Constants.TRANSPARENT_COLOR : color);
|
||||||
|
// g2d.fill(body[3]);
|
||||||
|
g2d.setComposite(oldComposite);
|
||||||
|
|
||||||
Color finalBorderColor;
|
Color finalBorderColor;
|
||||||
if (outlineMode) {
|
if (outlineMode) {
|
||||||
Theme theme =
|
Theme theme =
|
||||||
@@ -161,7 +160,7 @@ public class SingleCoilPickup extends AbstractTransparentComponent<String> {
|
|||||||
g2d.draw(body[0]);
|
g2d.draw(body[0]);
|
||||||
g2d.draw(body[3]);
|
g2d.draw(body[3]);
|
||||||
|
|
||||||
if (componentState != ComponentState.DRAGGING && !outlineMode) {
|
if (!outlineMode) {
|
||||||
g2d.setColor(getPoleColor());
|
g2d.setColor(getPoleColor());
|
||||||
g2d.fill(body[2]);
|
g2d.fill(body[2]);
|
||||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||||
|
|||||||
Binary file not shown.
@@ -2413,7 +2413,11 @@
|
|||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Better rendering of IC and transistor pins when zoomed in</description>
|
<description>Better rendering of IC and transistor pins when zoomed in</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Better rendering of guitar pickups when dragging and in outline mode</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>Drag&Drop from the tree sometimes picks up a wrong component type</description>
|
<description>Drag&Drop from the tree sometimes picks up a wrong component type</description>
|
||||||
|
|||||||
Reference in New Issue
Block a user