mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22: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();
|
||||
|
||||
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) {
|
||||
g2d.setColor(getBobinColor1());
|
||||
g2d.fill(body[4]);
|
||||
@@ -125,17 +126,19 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
||||
g2d.setColor(getBobinColor2());
|
||||
g2d.fill(body[5]);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
||||
Color finalBorderColor;
|
||||
if (outlineMode) {
|
||||
Theme theme =
|
||||
@@ -154,14 +157,15 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
||||
g2d.draw(body[0]);
|
||||
if (body[1] != null)
|
||||
g2d.draw(body[1]);
|
||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
||||
|
||||
if (!outlineMode) {
|
||||
g2d.setColor(getPoleColor());
|
||||
g2d.fill(body[3]);
|
||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||
g2d.draw(body[3]);
|
||||
if (body[6] != null)
|
||||
g2d.draw(body[6]);
|
||||
|
||||
|
||||
if (getType() != HumbuckerType.Filtertron) {
|
||||
if (body[4] != null) {
|
||||
g2d.setColor(getBobinColor1().darker());
|
||||
@@ -171,8 +175,9 @@ public class HumbuckerPickup extends AbstractTransparentComponent<String> {
|
||||
g2d.setColor(getBobinColor2().darker());
|
||||
g2d.draw(body[5]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (getType() == HumbuckerType.Filtertron) {
|
||||
g2d.setColor(finalBorderColor);
|
||||
g2d.draw(body[0]);
|
||||
|
||||
@@ -91,19 +91,18 @@ public class JazzBassPickup extends AbstractTransparentComponent<String> {
|
||||
Shape[] body = getBody();
|
||||
|
||||
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;
|
||||
if (outlineMode) {
|
||||
Theme theme =
|
||||
@@ -120,11 +119,12 @@ public class JazzBassPickup extends AbstractTransparentComponent<String> {
|
||||
g2d.setColor(finalBorderColor);
|
||||
g2d.draw(body[0]);
|
||||
g2d.draw(body[1]);
|
||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
||||
|
||||
if (!outlineMode) {
|
||||
g2d.setColor(getPoleColor());
|
||||
g2d.fill(body[3]);
|
||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||
g2d.draw(body[3]);
|
||||
g2d.draw(body[3]);
|
||||
}
|
||||
|
||||
Color finalLabelColor;
|
||||
|
||||
@@ -98,19 +98,18 @@ public class P90Pickup extends AbstractTransparentComponent<String> {
|
||||
Shape[] body = getBody();
|
||||
|
||||
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]);
|
||||
if (body[1] != null)
|
||||
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]);
|
||||
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;
|
||||
if (outlineMode) {
|
||||
@@ -128,12 +127,13 @@ public class P90Pickup extends AbstractTransparentComponent<String> {
|
||||
g2d.setColor(finalBorderColor);
|
||||
g2d.draw(body[0]);
|
||||
if (body[1] != null)
|
||||
g2d.draw(body[1]);
|
||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
||||
g2d.draw(body[1]);
|
||||
|
||||
if (!outlineMode) {
|
||||
g2d.setColor(getPoleColor());
|
||||
g2d.fill(body[3]);
|
||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||
g2d.draw(body[3]);
|
||||
g2d.draw(body[3]);
|
||||
}
|
||||
|
||||
Color finalLabelColor;
|
||||
|
||||
@@ -89,18 +89,17 @@ public class PBassPickup extends AbstractTransparentComponent<String> {
|
||||
Shape[] body = getBody();
|
||||
|
||||
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;
|
||||
if (outlineMode) {
|
||||
@@ -117,12 +116,13 @@ public class PBassPickup extends AbstractTransparentComponent<String> {
|
||||
|
||||
g2d.setColor(finalBorderColor);
|
||||
g2d.draw(body[0]);
|
||||
g2d.draw(body[1]);
|
||||
if (!outlineMode && componentState != ComponentState.DRAGGING) {
|
||||
g2d.draw(body[1]);
|
||||
|
||||
if (!outlineMode) {
|
||||
g2d.setColor(getPoleColor());
|
||||
g2d.fill(body[3]);
|
||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||
g2d.draw(body[3]);
|
||||
g2d.draw(body[3]);
|
||||
}
|
||||
|
||||
Color finalLabelColor;
|
||||
|
||||
@@ -107,27 +107,26 @@ public class SingleCoilPickup extends AbstractTransparentComponent<String> {
|
||||
Shape[] body = getBody();
|
||||
|
||||
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());
|
||||
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);
|
||||
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());
|
||||
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;
|
||||
if (outlineMode) {
|
||||
Theme theme =
|
||||
@@ -161,7 +160,7 @@ public class SingleCoilPickup extends AbstractTransparentComponent<String> {
|
||||
g2d.draw(body[0]);
|
||||
g2d.draw(body[3]);
|
||||
|
||||
if (componentState != ComponentState.DRAGGING && !outlineMode) {
|
||||
if (!outlineMode) {
|
||||
g2d.setColor(getPoleColor());
|
||||
g2d.fill(body[2]);
|
||||
g2d.setColor(darkerOrLighter(getPoleColor()));
|
||||
|
||||
Reference in New Issue
Block a user