mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
release 4.4.0
This commit is contained in:
@@ -2931,7 +2931,7 @@
|
|||||||
<minor>4</minor>
|
<minor>4</minor>
|
||||||
<build>0</build>
|
<build>0</build>
|
||||||
</versionNumber>
|
</versionNumber>
|
||||||
<releaseDate>2020-04-09 00:00:00.000 CET</releaseDate>
|
<releaseDate>2020-04-16 00:00:00.000 CET</releaseDate>
|
||||||
<name></name>
|
<name></name>
|
||||||
<changes>
|
<changes>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
|
|||||||
@@ -37,6 +37,6 @@ public class ClassProcessorTest {
|
|||||||
public void testExtractProperties() {
|
public void testExtractProperties() {
|
||||||
List<PropertyWrapper> properties = ComponentProcessor.getInstance().extractProperties(MockDIYComponent.class);
|
List<PropertyWrapper> properties = ComponentProcessor.getInstance().extractProperties(MockDIYComponent.class);
|
||||||
assertNotNull(properties);
|
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;
|
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.
|
* spacing.
|
||||||
*
|
*
|
||||||
* @author bancika
|
* @author bancika
|
||||||
@@ -48,7 +48,7 @@ public abstract class AbstractRadialComponent<T> extends AbstractLeadedComponent
|
|||||||
return (int) getPinSpacing().convertToPixels();
|
return (int) getPinSpacing().convertToPixels();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EditableProperty(name = "Pin spacing")
|
@EditableProperty(name = "Pin Spacing")
|
||||||
public Size getPinSpacing() {
|
public Size getPinSpacing() {
|
||||||
if (pinSpacing == null) {
|
if (pinSpacing == null) {
|
||||||
pinSpacing = PIN_SPACING;
|
pinSpacing = PIN_SPACING;
|
||||||
@@ -59,5 +59,4 @@ public abstract class AbstractRadialComponent<T> extends AbstractLeadedComponent
|
|||||||
public void setPinSpacing(Size pinSpacing) {
|
public void setPinSpacing(Size pinSpacing) {
|
||||||
this.pinSpacing = pinSpacing;
|
this.pinSpacing = pinSpacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ package org.diylc.components.passive;
|
|||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Rectangle;
|
||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.awt.geom.RoundRectangle2D;
|
import java.awt.geom.RoundRectangle2D;
|
||||||
|
|
||||||
@@ -30,6 +31,9 @@ import org.diylc.common.SimpleComponentTransformer;
|
|||||||
import org.diylc.core.CreationMethod;
|
import org.diylc.core.CreationMethod;
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
import org.diylc.core.annotations.ComponentDescriptor;
|
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",
|
@ComponentDescriptor(name = "Film Capacitor (Radial)", author = "Branislav Stojkovic", category = "Passive",
|
||||||
creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "C",
|
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 BODY_COLOR = Color.decode("#FF8000");
|
||||||
public static Color BORDER_COLOR = BODY_COLOR.darker();
|
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() {
|
public RadialFilmCapacitor() {
|
||||||
super();
|
super();
|
||||||
this.bodyColor = BODY_COLOR;
|
this.bodyColor = BODY_COLOR;
|
||||||
@@ -64,4 +72,21 @@ public class RadialFilmCapacitor extends AbstractFilmCapacitor {
|
|||||||
return new RoundRectangle2D.Double(0f, 0f, getLength().convertToPixels(), getClosestOdd(getWidth()
|
return new RoundRectangle2D.Double(0f, 0f, getLength().convertToPixels(), getClosestOdd(getWidth()
|
||||||
.convertToPixels()), radius, radius);
|
.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