mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
fixed point visibility on curved trace
added option to hide color bands on the resistor
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
<map>
|
<map>
|
||||||
<entry>
|
<entry>
|
||||||
<string>metric</string>
|
<string>lastPath</string>
|
||||||
<boolean>true</boolean>
|
<string>C:\Documents and Settings\Branislav Stojkovic\Desktop</string>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<string>zoom</string>
|
<string>zoom</string>
|
||||||
<double>1.0</double>
|
<double>1.0</double>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<string>lastPath</string>
|
<string>metric</string>
|
||||||
<string>C:\Documents and Settings\Branislav Stojkovic\Desktop</string>
|
<boolean>true</boolean>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<string>default.org.diylc.components.misc.Label:Color</string>
|
<string>default.org.diylc.components.misc.Label:Color</string>
|
||||||
|
|||||||
Binary file not shown.
+4
-1
@@ -2,10 +2,13 @@ package org.diylc.common;
|
|||||||
|
|
||||||
public enum ResistorColorCode {
|
public enum ResistorColorCode {
|
||||||
|
|
||||||
_4_BAND, _5_BAND;
|
NONE, _4_BAND, _5_BAND;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
if (name().startsWith("_")) {
|
||||||
return name().substring(1).replace("_", " ").toLowerCase();
|
return name().substring(1).replace("_", " ").toLowerCase();
|
||||||
}
|
}
|
||||||
|
return name().substring(0, 1).toUpperCase() + name().substring(1).toLowerCase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,5 +82,30 @@
|
|||||||
<url>http://code.google.com/p/diy-layout-creator/downloads/list
|
<url>http://code.google.com/p/diy-layout-creator/downloads/list
|
||||||
</url>
|
</url>
|
||||||
</com.diyfever.gui.update.Version>
|
</com.diyfever.gui.update.Version>
|
||||||
|
<com.diyfever.gui.update.Version>
|
||||||
|
<versionNumber>
|
||||||
|
<major>3</major>
|
||||||
|
<minor>0</minor>
|
||||||
|
<build>5</build>
|
||||||
|
</versionNumber>
|
||||||
|
<releaseDate>2011-01-27 21:00:00.000 CET</releaseDate>
|
||||||
|
<name></name>
|
||||||
|
<changes>
|
||||||
|
<com.diyfever.gui.update.Change>
|
||||||
|
<changeType>BUG_FIX</changeType>
|
||||||
|
<description>Curved trace does not show control points</description>
|
||||||
|
</com.diyfever.gui.update.Change>
|
||||||
|
<com.diyfever.gui.update.Change>
|
||||||
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
<description>Resistor can show color bands</description>
|
||||||
|
</com.diyfever.gui.update.Change>
|
||||||
|
<com.diyfever.gui.update.Change>
|
||||||
|
<changeType>NEW_FEATURE</changeType>
|
||||||
|
<description></description>
|
||||||
|
</com.diyfever.gui.update.Change>
|
||||||
|
</changes>
|
||||||
|
<url>http://code.google.com/p/diy-layout-creator/downloads/list
|
||||||
|
</url>
|
||||||
|
</com.diyfever.gui.update.Version>
|
||||||
</a>
|
</a>
|
||||||
</java.util.Arrays_-ArrayList>
|
</java.util.Arrays_-ArrayList>
|
||||||
Binary file not shown.
-5
@@ -38,11 +38,6 @@ public class CurvedTrace extends AbstractCurvedComponent<Void> {
|
|||||||
g2d.draw(curve);
|
g2d.draw(curve);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public VisibilityPolicy getControlPointVisibilityPolicy(int index) {
|
|
||||||
return VisibilityPolicy.NEVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
@EditableProperty(name = "Width")
|
@EditableProperty(name = "Width")
|
||||||
public Size getSize() {
|
public Size getSize() {
|
||||||
return size;
|
return size;
|
||||||
|
|||||||
+3
@@ -91,6 +91,9 @@ public class Resistor extends AbstractLeadedComponent<Resistance> {
|
|||||||
@Override
|
@Override
|
||||||
protected void decorateComponentBody(Graphics2D g2d) {
|
protected void decorateComponentBody(Graphics2D g2d) {
|
||||||
// int width = getWidth().convertToPixels();
|
// int width = getWidth().convertToPixels();
|
||||||
|
if (colorCode == ResistorColorCode.NONE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
int height = getClosestOdd(getHeight().convertToPixels());
|
int height = getClosestOdd(getHeight().convertToPixels());
|
||||||
Color[] bands = value.getColorCode(colorCode);
|
Color[] bands = value.getColorCode(colorCode);
|
||||||
int x = 4;
|
int x = 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user