mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
release 4.4.0
This commit is contained in:
@@ -2931,7 +2931,7 @@
|
||||
<minor>4</minor>
|
||||
<build>0</build>
|
||||
</versionNumber>
|
||||
<releaseDate>2020-04-09 00:00:00.000 CET</releaseDate>
|
||||
<releaseDate>2020-04-16 00:00:00.000 CET</releaseDate>
|
||||
<name></name>
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
|
||||
@@ -37,6 +37,6 @@ public class ClassProcessorTest {
|
||||
public void testExtractProperties() {
|
||||
List<PropertyWrapper> properties = ComponentProcessor.getInstance().extractProperties(MockDIYComponent.class);
|
||||
assertNotNull(properties);
|
||||
assertEquals(4, properties.size());
|
||||
assertEquals(5, properties.size());
|
||||
};
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -28,7 +28,7 @@ import org.diylc.core.measures.Size;
|
||||
import org.diylc.core.measures.SizeUnit;
|
||||
|
||||
/**
|
||||
* Base class for radial components. The same as {@link AbstractRadialComponent} but with added pin
|
||||
* Base class for radial components. The same as {@link AbstractLeadedComponent} but with added pin
|
||||
* spacing.
|
||||
*
|
||||
* @author bancika
|
||||
@@ -48,7 +48,7 @@ public abstract class AbstractRadialComponent<T> extends AbstractLeadedComponent
|
||||
return (int) getPinSpacing().convertToPixels();
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Pin spacing")
|
||||
@EditableProperty(name = "Pin Spacing")
|
||||
public Size getPinSpacing() {
|
||||
if (pinSpacing == null) {
|
||||
pinSpacing = PIN_SPACING;
|
||||
@@ -59,5 +59,4 @@ public abstract class AbstractRadialComponent<T> extends AbstractLeadedComponent
|
||||
public void setPinSpacing(Size pinSpacing) {
|
||||
this.pinSpacing = pinSpacing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ package org.diylc.components.passive;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.Shape;
|
||||
import java.awt.geom.RoundRectangle2D;
|
||||
|
||||
@@ -30,6 +31,9 @@ import org.diylc.common.SimpleComponentTransformer;
|
||||
import org.diylc.core.CreationMethod;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
import org.diylc.core.annotations.ComponentDescriptor;
|
||||
import org.diylc.core.annotations.EditableProperty;
|
||||
import org.diylc.core.measures.Size;
|
||||
import org.diylc.core.measures.SizeUnit;
|
||||
|
||||
@ComponentDescriptor(name = "Film Capacitor (Radial)", author = "Branislav Stojkovic", category = "Passive",
|
||||
creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "C",
|
||||
@@ -42,6 +46,10 @@ public class RadialFilmCapacitor extends AbstractFilmCapacitor {
|
||||
public static Color BODY_COLOR = Color.decode("#FF8000");
|
||||
public static Color BORDER_COLOR = BODY_COLOR.darker();
|
||||
|
||||
public static Size PIN_SPACING = new Size(0.1d, SizeUnit.in);
|
||||
|
||||
private Size pinSpacing = PIN_SPACING;
|
||||
|
||||
public RadialFilmCapacitor() {
|
||||
super();
|
||||
this.bodyColor = BODY_COLOR;
|
||||
@@ -64,4 +72,21 @@ public class RadialFilmCapacitor extends AbstractFilmCapacitor {
|
||||
return new RoundRectangle2D.Double(0f, 0f, getLength().convertToPixels(), getClosestOdd(getWidth()
|
||||
.convertToPixels()), radius, radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int calculatePinSpacing(Rectangle shapeRect) {
|
||||
return (int) getPinSpacing().convertToPixels();
|
||||
}
|
||||
|
||||
@EditableProperty(name = "Pin Spacing")
|
||||
public Size getPinSpacing() {
|
||||
if (pinSpacing == null) {
|
||||
pinSpacing = PIN_SPACING;
|
||||
}
|
||||
return pinSpacing;
|
||||
}
|
||||
|
||||
public void setPinSpacing(Size pinSpacing) {
|
||||
this.pinSpacing = pinSpacing;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user