Added ability control if the board underside display should render as transparent or not

This commit is contained in:
Bane Stojkovic
2025-03-30 13:18:08 +02:00
parent a5f6299de7
commit baaeefdbab
4 changed files with 27 additions and 7 deletions
@@ -8,9 +8,11 @@ public interface IBoard {
Rectangle2D getBoardRectangle();
BoardUndersideDisplay getBoardUndersideDisplay();
BoardUndersideDisplay getUndersideDisplay();
Size getUndersideOffset();
Boolean getUndersideTransparency();
boolean shouldExportToGerber();
}
@@ -191,7 +191,7 @@ public class DrawingManager {
Map<IBoard, List<IDIYComponent<?>>> boardMap = project.getComponents().stream()
.filter(IBoard.class::isInstance)
.map(IBoard.class::cast)
.filter(b -> b.getBoardUndersideDisplay() != BoardUndersideDisplay.NONE)
.filter(b -> b.getUndersideDisplay() != BoardUndersideDisplay.NONE)
.collect(Collectors.toMap(x -> x, x -> new ArrayList<IDIYComponent<?>>()));
Map<IDIYComponent<?>, Set<IBoard>> componentBoardMap = new HashMap<IDIYComponent<?>, Set<IBoard>>();
@@ -524,7 +524,7 @@ public class DrawingManager {
IDIYComponent<?> clonedComponent = component.clone();
int direction = 0;
Point2D pivotPoint = new Point2D.Double();
switch (board.getBoardUndersideDisplay()) {
switch (board.getUndersideDisplay()) {
case ABOVE:
direction = IComponentTransformer.VERTICAL;
pivotPoint.setLocation(boardRectangle.getMinX(), boardRectangle.getMinY() - offset / 2);
@@ -543,7 +543,7 @@ public class DrawingManager {
break;
}
componentType.getTransformer().mirror(clonedComponent, pivotPoint, direction);
if (AbstractTransparentComponent.class.isInstance(clonedComponent)) {
if (board.getUndersideTransparency() && AbstractTransparentComponent.class.isInstance(clonedComponent)) {
AbstractTransparentComponent<?> transparentComponent = (AbstractTransparentComponent<?>) clonedComponent;
transparentComponent.setAlpha(MIRROR_ALPHA);
}
@@ -337,6 +337,10 @@
<changeType>NEW_FEATURE</changeType>
<description>Added a 'Save' button to all analysis screens which saves results of a circuit analysis to an HTML file</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Added ability control if the board underside display should render as transparent or not</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Moved 'Analyze' functions from 'File' menu to their own menu for faster access</description>