* Added 1/8" jack

* Release 4.20

* Merge traces and wires into "Wiring" layer

* Add shabang to run.sh

* Added gray theme

* Prevent the donation label from wrapping into several lines

* Use Backspace key to delete selection in Mac OS

* Upgrade xstream to fix java 16 compatibility

* Add exec to run.sh
This commit is contained in:
Bane Stojkovic
2022-02-16 23:41:47 +01:00
committed by GitHub
parent feaa48fed5
commit d245a6305f
48 changed files with 303 additions and 355 deletions
+1 -1
View File
@@ -8,7 +8,7 @@
<classpathentry kind="lib" path="lib/jettison-1.0.1.jar"/>
<classpathentry kind="lib" path="lib/java-http-proxy.jar"/>
<classpathentry kind="lib" path="lib/AppleJavaExtensions.jar"/>
<classpathentry kind="lib" path="lib/xstream-1.4.3.jar"/>
<classpathentry kind="lib" path="lib/xstream-1.4.19.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -50,7 +50,7 @@ public interface IDIYComponent<T> extends Serializable, Cloneable {
public static final int CHASSIS = 1;
public static final int BOARD = 2;
public static final int TRACE = 3;
public static final int WIRING = 3;
public static final int COMPONENT = 4;
public static final int TEXT = 5;
@@ -98,6 +98,7 @@ import org.diylc.utils.Constants;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.security.AnyTypePermission;
/**
* The main presenter class, contains core app logic and drawing routines.
@@ -143,6 +144,7 @@ public class Presenter implements IPlugInPort {
if (resource != null) {
BufferedInputStream in = new BufferedInputStream(resource.openStream());
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
@SuppressWarnings("unchecked")
List<Version> allVersions = (List<Version>) xStream.fromXML(in);
CURRENT_VERSION = allVersions.get(allVersions.size() - 1).getVersionNumber();
@@ -2593,6 +2595,7 @@ public class Presenter implements IPlugInPort {
try {
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream("variants.xml"));
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
xStream.toXML(defaultVariantMap, out);
out.close();
// no more user variants
@@ -2615,6 +2618,7 @@ public class Presenter implements IPlugInPort {
if (resource != null) {
BufferedInputStream in = new BufferedInputStream(resource.openStream());
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
Map<String, List<Template>> defaults = (Map<String, List<Template>>) xStream.fromXML(in);
in.close();
@@ -2654,6 +2658,7 @@ public class Presenter implements IPlugInPort {
if (resource != null) {
BufferedInputStream in = new BufferedInputStream(resource.openStream());
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
Map<String, List<IDIYComponent<?>>> defaults = (Map<String, List<IDIYComponent<?>>>) xStream.fromXML(in);
in.close();
@@ -2937,6 +2942,7 @@ public class Presenter implements IPlugInPort {
try {
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream("blocks.xml"));
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
xStream.toXML(defaultBlockMap, out);
out.close();
// no more user variants
@@ -3015,6 +3021,7 @@ public class Presenter implements IPlugInPort {
LOG.debug(String.format("importVariants(%s)", fileName));
BufferedInputStream in = new BufferedInputStream(new FileInputStream(fileName));
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
VariantPackage pkg;
@@ -3064,6 +3071,7 @@ public class Presenter implements IPlugInPort {
LOG.debug(String.format("importBlocks(%s)", fileName));
BufferedInputStream in = new BufferedInputStream(new FileInputStream(fileName));
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
BuildingBlockPackage pkg;
@@ -3605,5 +3605,37 @@
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version>
<org.diylc.appframework.update.Version>
<versionNumber>
<major>4</major>
<minor>21</minor>
<build>0</build>
</versionNumber>
<releaseDate>2022-02-16 00:00:00.000 CET</releaseDate>
<name></name>
<changes>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>Fixed compatibility issues with Java version 16 and above</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Added 'Gray' theme</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Add shabang to run.sh for *nix systems</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Prevent the donation label from wrapping into several lines</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Use Backspace key to delete selection in Mac OS</description>
</org.diylc.appframework.update.Change>
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version>
</a>
</java.util.Arrays_-ArrayList>
@@ -58,6 +58,7 @@ import org.xml.sax.SAXException;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.mapper.MapperWrapper;
import com.thoughtworks.xstream.security.AnyTypePermission;
public class ProjectFileManager {
@@ -97,7 +98,8 @@ public class ProjectFileManager {
}
};
configure(xStream);
this.xStreamOld = new XStream(new DomDriver());
this.xStreamOld = new XStream(new DomDriver());
this.xStreamOld.addPermission(AnyTypePermission.ANY);
xStreamOld.autodetectAnnotations(true);
this.messageDispatcher = messageDispatcher;
}
@@ -126,6 +128,7 @@ public class ProjectFileManager {
xStream.addImmutableType(org.diylc.core.measures.Power.class);
xStream.addImmutableType(org.diylc.core.measures.Inductance.class);
xStream.addImmutableType(org.diylc.core.measures.Size.class);
xStream.addPermission(AnyTypePermission.ANY);
}
public void startNewFile() {
@@ -12,6 +12,7 @@ import org.diylc.presenter.Presenter;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.security.AnyTypePermission;
public class VersionReader {
public static void main(String[] args) {
@@ -20,6 +21,7 @@ public class VersionReader {
if (resource != null) {
BufferedInputStream in = new BufferedInputStream(resource.openStream());
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
@SuppressWarnings("unchecked")
List<Version> allVersions = (List<Version>) xStream.fromXML(in);
Version latest = allVersions.get(allVersions.size() - 1);
+1 -1
View File
@@ -7,8 +7,8 @@
<classpathentry kind="lib" path="lib/jep-2.4.1.jar"/>
<classpathentry kind="lib" path="lib/poi-3.5-FINAL-20090928.jar"/>
<classpathentry kind="lib" path="lib/svgSalamander-1.1.2.4.jar"/>
<classpathentry kind="lib" path="lib/xstream-1.4.19.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/diylc-core"/>
<classpathentry kind="lib" path="lib/xstream-1.4.3.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -38,7 +38,7 @@ import org.diylc.core.measures.SizeUnit;
@ComponentDescriptor(name = "Copper Trace", author = "Branislav Stojkovic", category = "Connectivity",
creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "Trace",
description = "Straight copper trace", zOrder = IDIYComponent.TRACE, bomPolicy = BomPolicy.NEVER_SHOW,
description = "Straight copper trace", zOrder = IDIYComponent.WIRING, bomPolicy = BomPolicy.NEVER_SHOW,
autoEdit = false, keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "PCB",
transformer = SimpleComponentTransformer.class)
public class CopperTrace extends AbstractLeadedComponent<Void> {
@@ -38,7 +38,7 @@ import org.diylc.core.measures.SizeUnit;
@ComponentDescriptor(name = "Curved Trace", author = "Branislav Stojkovic", category = "Connectivity",
instanceNamePrefix = "Trace", description = "Curved copper trace with two control points",
zOrder = IDIYComponent.TRACE, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
zOrder = IDIYComponent.WIRING, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "PCB", transformer = SimpleComponentTransformer.class,
enableCache = true)
public class CurvedTrace extends AbstractCurvedComponent<Void> {
@@ -46,7 +46,7 @@ import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Eyelet", category = "Connectivity", author = "Branislav Stojkovic",
description = "Eyelet or turret terminal", instanceNamePrefix = "Eyelet",
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
zOrder = IDIYComponent.WIRING + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class,
enableCache = true)
public class Eyelet extends AbstractComponent<String> {
@@ -42,7 +42,7 @@ import org.diylc.core.measures.Size;
import org.diylc.core.measures.SizeUnit;
@ComponentDescriptor(name = "Ground Fill", author = "Branislav Stojkovic", category = "Connectivity",
instanceNamePrefix = "GF", description = "Polygonal ground fill area", zOrder = IDIYComponent.TRACE,
instanceNamePrefix = "GF", description = "Polygonal ground fill area", zOrder = IDIYComponent.WIRING,
bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false, transformer = SimpleComponentTransformer.class)
public class GroundFill extends AbstractComponent<Void> {
@@ -39,7 +39,7 @@ import org.diylc.core.annotations.EditableProperty;
import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Hookup Wire", author = "Branislav Stojkovic", category = "Connectivity",
instanceNamePrefix = "W", description = "Flexible wire with two control points", zOrder = IDIYComponent.COMPONENT,
instanceNamePrefix = "W", description = "Flexible wire with two control points", zOrder = IDIYComponent.WIRING,
flexibleZOrder = true, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
transformer = SimpleComponentTransformer.class, enableCache = true)
public class HookupWire extends AbstractCurvedComponent<Void> implements IContinuity {
@@ -41,7 +41,7 @@ import org.diylc.core.measures.Size;
@ComponentDescriptor(name = "Jumper", author = "Branislav Stojkovic", category = "Connectivity",
creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "J", description = "",
zOrder = IDIYComponent.COMPONENT, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
zOrder = IDIYComponent.WIRING, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
transformer = SimpleComponentTransformer.class)
public class Jumper extends AbstractLeadedComponent<Void> implements IContinuity {
@@ -43,7 +43,7 @@ import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Solder Pad", category = "Connectivity", author = "Branislav Stojkovic",
description = "Copper solder pad, round or square", instanceNamePrefix = "Pad",
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
zOrder = IDIYComponent.WIRING + 0.1, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
keywordPolicy = KeywordPolicy.SHOW_TAG, keywordTag = "PCB", transformer = SimpleComponentTransformer.class, enableCache = true)
public class SolderPad extends AbstractComponent<Void> {
@@ -44,7 +44,7 @@ import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Turret Lug", category = "Connectivity", author = "Branislav Stojkovic",
description = "Turret terminal lug", instanceNamePrefix = "Turret",
zOrder = IDIYComponent.TRACE + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
zOrder = IDIYComponent.WIRING + 0.1, bomPolicy = BomPolicy.SHOW_ONLY_TYPE_NAME, autoEdit = false,
keywordPolicy = KeywordPolicy.SHOW_TYPE_NAME, transformer = SimpleComponentTransformer.class,
enableCache = true)
public class Turret extends AbstractComponent<String> {
@@ -46,7 +46,7 @@ import org.diylc.core.annotations.EditableProperty;
import org.diylc.utils.Constants;
@ComponentDescriptor(name = "Twisted Leads", author = "Branislav Stojkovic", category = "Connectivity",
instanceNamePrefix = "W", description = "A pair of flexible leads twisted tighly together", zOrder = IDIYComponent.COMPONENT,
instanceNamePrefix = "W", description = "A pair of flexible leads twisted tighly together", zOrder = IDIYComponent.WIRING,
flexibleZOrder = true, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
transformer = SimpleComponentTransformer.class, enableCache = true)
public class TwistedWire extends AbstractCurvedComponent<Void> implements IContinuity {
@@ -45,7 +45,7 @@ import org.diylc.core.annotations.ComponentDescriptor;
import org.diylc.core.annotations.EditableProperty;
@ComponentDescriptor(name = "PCB Text", author = "Branislav Stojkovic", category = "Misc",
description = "Mirrored text for PCB artwork", instanceNamePrefix = "L", zOrder = IDIYComponent.TRACE,
description = "Mirrored text for PCB artwork", instanceNamePrefix = "L", zOrder = IDIYComponent.WIRING,
flexibleZOrder = false, bomPolicy = BomPolicy.NEVER_SHOW, transformer = TextTransformer.class)
public class PCBText extends AbstractComponent<Void> {
+2 -2
View File
@@ -17,10 +17,10 @@
<classpathentry kind="lib" path="lib/gestures-wrapper-0.2.jar"/>
<classpathentry kind="lib" path="lib/jar-loader.jar"/>
<classpathentry kind="lib" path="lib/svgSalamander-1.1.2.4.jar"/>
<classpathentry kind="lib" path="library/main.jar"/>
<classpathentry kind="lib" path="lib/xstream-1.4.19.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/diylc-core"/>
<classpathentry kind="lib" path="lib/xstream-1.4.3.jar"/>
<classpathentry kind="lib" path="lib/java-http-proxy.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="library/main.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+3 -1
View File
@@ -9,8 +9,10 @@
</listAttribute>
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;sourceLookupDirector&gt;&#13;&#10;&lt;sourceContainers duplicates=&quot;false&quot;&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;Library&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;DIYLC&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;diylc-core&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;javaProject name=&amp;quot;diylc-library&amp;quot;/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.jdt.launching.sourceContainer.javaProject&quot;/&gt;&#13;&#10;&lt;container memento=&quot;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot; standalone=&amp;quot;no&amp;quot;?&amp;gt;&amp;#13;&amp;#10;&amp;lt;default/&amp;gt;&amp;#13;&amp;#10;&quot; typeId=&quot;org.eclipse.debug.core.containerType.default&quot;/&gt;&#13;&#10;&lt;/sourceContainers&gt;&#13;&#10;&lt;/sourceLookupDirector&gt;&#13;&#10;"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-16.0.1"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="diylc-swing"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m -Xmx2048m -javaagent:lib/jar-loader.jar -Dorg.diylc.storeDict=true -Dorg.diylc.enableTests=true -Dorg.diylc.scriptRun=true -Ddorg.diylc.debugContinuityAreas=true -Ddorg.diylc.debugComponentAreas=true -Ddorg.diylc.WriteStaticVariants=true -Dorg.diylc.WriteStaticBlocks=true"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m -Xmx2048m -javaagent:lib/jar-loader.jar -Dorg.diylc.storeDict=true -Dorg.diylc.enableTests=true -Dorg.diylc.scriptRun=true -Ddorg.diylc.debugContinuityAreas=true -Ddorg.diylc.debugComponentAreas=true -Ddorg.diylc.WriteStaticVariants=true -Dorg.diylc.WriteStaticBlocks=true &#13;&#10;--add-opens java.base/java.util=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.lang=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.text=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt=ALL-UNNAMED"/>
</launchConfiguration>
+6 -1
View File
@@ -10,7 +10,7 @@
<property name="jar.dir" value="${build.dir}/jar" />
<property name="report.dir" value="${build.dir}/junitreport" />
<property name="main.class" value="org.diylc.DIYLCStarter" />
<property name="diylc.version" value="4.20.0" />
<property name="diylc.version" value="4.21.0" />
<property name="osx.jre8.path" value="jre\osx\jdk8u275-b01-jre\Contents\Home\" />
@@ -116,6 +116,11 @@
<option value="-Dcom.apple.smallTabs=true"/>
<option value="-Xdock:name=DIY Layout Creator"/>
<option value="-Xdock:icon=Contents/Resources/diylc.icns"/>
<option value="--add-opens java.base/java.util=ALL-UNNAMED"/>
<option value="--add-opens java.base/java.lang=ALL-UNNAMED"/>
<option value="--add-opens java.base/java.text=ALL-UNNAMED"/>
<option value="--add-opens java.desktop/java.awt=ALL-UNNAMED"/>
</bundleapp>
<zip destfile="${build.dir}/diylc-${diylc.version}-osx.zip">
<zipfileset filemode="755" dir="${build.dir}/DIYLC.app" prefix="DIYLC.app" />
-147
View File
@@ -1,147 +0,0 @@
<project name="diylc-swing" basedir="." default="universal" xmlns:fx="javafx:com.sun.javafx.tools.ant">
<property name="src.dir" value="src" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="build.dir" value="${basedir}/build" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="report.dir" value="${build.dir}/junitreport" />
<property name="main.class" value="org.diylc.DIYLCStarter" />
<property name="diylc.version" value="4.1.0" />
<property name="classes.dir" value="${build.dir}/temp/${ant.project.name}/classes" />
<property name="test.classes.dir" value="${build.dir}/temp/${ant.project.name}/test.classes" />
<target name="clean">
<delete dir="${build.dir}" />
</target>
<!--change src dir-->
<target name="compile">
<ant antfile="../diylc-library/build.xml" target="jar" inheritAll="false" />
<mkdir dir="${classes.dir}" />
<echo>Compile with JDK ${java.runtime.version}</echo>
<javac compiler="modern" encoding="8859_1" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="class.path" includeantruntime="false">
<compilerarg value="-proc:none" />
</javac>
</target>
<target name="resource.copy">
<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="lib.copy">
<copy todir="${jar.dir}/lib" overwrite="true">
<fileset dir="${basedir}/lib">
<exclude name="**/*dll" />
</fileset>
</copy>
<copy todir="${jar.dir}/library" overwrite="true">
<fileset dir="${basedir}/library">
<exclude name="**/*dll" />
</fileset>
</copy>
<copy todir="${jar.dir}" overwrite="true">
<fileset dir="${basedir}/lib/" includes="**/*.dll" />
</copy>
</target>
<path id="class.path">
<fileset dir="${basedir}">
<include name="lib/**/*.jar" />
<include name="library/**/*.jar" />
</fileset>
</path>
<manifestclasspath jarfile="${ant.project.name}.jar" property="manifest.class.path">
<classpath refid="class.path" />
</manifestclasspath>
<target name="jar" depends="clean, lib.copy, resource.copy, compile">
<jar destfile="${jar.dir}/diylc.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${main.class}" />
<attribute name="Class-Path" value="${manifest.class.path}" />
<attribute name="SplashScreen-Image" value="splash.png" />
</manifest>
<zipfileset dir="." includes="config.properties" />
</jar>
</target>
<target name="universal" depends="clean, lib.copy, resource.copy, compile">
<zip destfile="${build.dir}/diylc-${diylc.version}.zip">
<zipfileset dir="${jar.dir}" includes="diylc.jar" />
<zipfileset dir="${jar.dir}/lib" prefix="lib" />
<zipfileset dir="${jar.dir}/library/" prefix="library" />
<zipfileset dir="templates" prefix="templates" />
<zipfileset dir="themes" prefix="themes" />
<zipfileset dir="fonts" prefix="fonts" />
<zipfileset dir="." includes="splash.png" />
<zipfileset dir="." includes="run.sh" />
<zipfileset dir="." includes="diylc.l4j.ini" />
<zipfileset dir="." includes="diylc.exe" />
<zipfileset dir="icons" includes="*.png" prefix="icons" />
</zip>
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath=".:${JAVA_HOME}/lib/ant-javafx.jar"/>
<fx:application id="diylc" name="DIY Layout Creator" mainClass="${main.class}"/>
<fx:resources id="diylcRes">
<fx:fileset dir="${jar.dir}" includes="diylc.jar"/>
<fx:fileset dir="${jar.dir}/lib" includes="*.jar"/>
<fx:fileset dir="${jar.dir}/library" includes="*.jar"/>
<fx:fileset dir="templates" includes="*.xml" />
<fx:fileset dir="themes" includes="*.xml" />
<fx:fileset dir="fonts" includes="*.xml" />
<fx:fileset dir="." includes="splash.png" />
<fx:fileset dir="icons" includes="*.png" />
</fx:resources>
<fx:jar destfile="${jar.dir}/diylc.jar">
<!-- Details about application -->
<fx:application refid="diylc"/>
<!-- <fx:resources refid="diylcRes"/> -->
<fileset dir="${classes.dir}"/>
<!-- Customize jar manifest (optional) -->
<manifest>
<attribute name="Implementation-Vendor" value="bancika"/>
<attribute name="Implementation-Version" value="4.1.0"/>
</manifest>
</fx:jar>
<fx:deploy width="640" height="480"
outdir="${build.dir}" embedJNLP="false"
outfile="diylc" nativeBundles="all">
<fx:application refId="diylc"/>
<fx:resources refid="diylcRes"/>
<fx:info title="DIY Layout Creator"
vendor="bancika"/>
</fx:deploy>
</target>
<target name="full" depends="universal" />
<target name="javadoc">
<javadoc access="public" author="true" classpathref="class.path" destdir="doc" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" source="1.6" splitindex="true" use="true" version="true">
<fileset dir="${src.dir}">
<exclude name="**\.svn\**" />
<include name="**/*.java" />
</fileset>
</javadoc>
</target>
</project>
+2
View File
@@ -50,6 +50,7 @@ G-D-S JFET
G-D-S MOSFET
G-S-D JFET
G-S-D MOSFET
Gray
Import Netlist
Italiano
Lin
@@ -82,6 +83,7 @@ SPST
Srpski
Tick Width
Ticks
Wiring
Xnor
Xor
cm
+1 -1
View File
@@ -16,7 +16,7 @@
<libelement value="jar://$MODULE_DIR$/lib/orsonpdf-1.8.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/gestures-wrapper-0.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/jar-loader.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/xstream-1.4.3.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/xstream-1.4.19.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/java-http-proxy.jar!/" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
+1 -1
View File
@@ -1 +1 @@
-Xms512m -Xmx1024m -Dorg.diylc.scriptRun=true -Dfile.encoding=UTF-8
-Xms512m -Xmx1024m -Dorg.diylc.scriptRun=true -Dfile.encoding=UTF-8 --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED
+1 -1
View File
@@ -46,4 +46,4 @@ echo SNAP_USER_DATA
echo $SNAP_USER_DATA
echo =============================================
java -Xms512m -Xmx2048m -Dorg.diylc.scriptRun=true -Duser.dir=$SNAP_USER_DATA -Dfile.encoding=UTF-8 -cp $SNAP/diylc.jar:lib org.diylc.DIYLCStarter
java -Xms512m -Xmx2048m -Dorg.diylc.scriptRun=true -Duser.dir=$SNAP_USER_DATA -Dfile.encoding=UTF-8 -cp $SNAP/diylc.jar:lib --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED org.diylc.DIYLCStarter
@@ -37,6 +37,18 @@
<update_contact>nbenitezl_AT_gmail.com</update_contact>
<content_rating type="oars-1.1"/>
<releases>
<release version="4.21.0" date="2022-02-16">
<description>
<ul>
<li>[Bug Fix] Fixed compatibility issues with Java version 16 and above</li>
<li>[New Feature] Added 'Gray' theme</li>
<li>[Improvement] Add shabang to run.sh for *nix systems</li>
<li>[Improvement] Prevent the donation label from wrapping into several lines</li>
<li>[Improvement] Use Backspace key to delete selection in Mac OS</li>
</ul>
</description>
<url>https://github.com/bancika/diy-layout-creator/releases/tag/v4.21.0</url>
</release>
<release version="4.20.0" date="2021-09-12">
<description>
<ul>
+4
View File
@@ -31,5 +31,9 @@
<opt>-Dorg.diylc.scriptRun=true</opt>
<opt>-Dfile.encoding=UTF-8</opt>
<opt>-javaagent:lib/jar-loader.jar</opt>
<opt>--add-opens java.base/java.util=ALL-UNNAMED</opt>
<opt>--add-opens java.base/java.lang=ALL-UNNAMED</opt>
<opt>--add-opens java.base/java.text=ALL-UNNAMED</opt>
<opt>--add-opens java.desktop/java.awt=ALL-UNNAMED</opt>
</jre>
</launch4jConfig>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -1
View File
@@ -1 +1,2 @@
java -Xms512m -Xmx2048m -javaagent:lib/jar-loader.jar -Dorg.diylc.scriptRun=true -Dfile.encoding=UTF-8 -cp diylc.jar:lib org.diylc.DIYLCStarter
#!/bin/bash
exec java -Xms512m -Xmx2048m -javaagent:lib/jar-loader.jar -Dorg.diylc.scriptRun=true -Dfile.encoding=UTF-8 -cp diylc.jar:lib --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED org.diylc.DIYLCStarter "$@"
+165 -181
View File
@@ -18,13 +18,8 @@
package org.diylc;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.Properties;
@@ -63,201 +58,190 @@ import ca.cgjennings.jvm.JarLoader;
*/
public class DIYLCStarter {
private static final Logger LOG = Logger.getLogger(DIYLCStarter.class);
private static final Logger LOG = Logger.getLogger(DIYLCStarter.class);
private static final String SCRIPT_RUN = "org.diylc.scriptRun";
private static final String SCRIPT_RUN = "org.diylc.scriptRun";
/**
* @param args
* @throws InvalidActivityException
*/
public static void main(String[] args) {
try {
runDIYLC(args);
} catch (Throwable t) {
LOG.error("Major error while starting DIYLC", t);
System.out.println("Major error while starting DIYLC");
t.printStackTrace(System.out);
}
}
public static void runDIYLC(String[] args) {
// Initialize splash screen
DIYLCSplash splash = null;
Exception splashException = null;
/**
* @param args
* @throws InvalidActivityException
*/
public static void main(String[] args) {
try {
runDIYLC(args);
} catch (Throwable t) {
LOG.error("Major error while starting DIYLC", t);
System.out.println("Major error while starting DIYLC");
t.printStackTrace(System.out);
}
}
try {
splash = new DIYLCSplash();
} catch (Exception e) {
System.out.println("Splash screen could not be initialized: " + e.getMessage());
splashException = e;
}
public static void runDIYLC(String[] args) {
// Initialize splash screen
DIYLCSplash splash = null;
Exception splashException = null;
URL url = DIYLCStarter.class.getResource("log4j.properties");
Properties properties = new Properties();
try {
properties.load(url.openStream());
PropertyConfigurator.configure(properties);
} catch (Exception e) {
LOG.error("Could not initialize log4j configuration", e);
}
initializeConfiguration();
try {
splash = new DIYLCSplash();
} catch (Exception e) {
System.out.println("Splash screen could not be initialized: " + e.getMessage());
splashException = e;
}
// disable HIGHLIGHT_CONTINUITY_AREA config, keep it transient
ConfigurationManager.getInstance().writeValue(IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, false);
LOG.info("JarLoader strategy: " + JarLoader.getStrategy());
URL url = DIYLCStarter.class.getResource("log4j.properties");
Properties properties = new Properties();
try {
properties.load(url.openStream());
PropertyConfigurator.configure(properties);
} catch (Exception e) {
LOG.error("Could not initialize log4j configuration", e);
}
LOG.info("Loading languages...");
initializeConfiguration();
LangUtil.configure();
// disable HIGHLIGHT_CONTINUITY_AREA config, keep it transient
ConfigurationManager.getInstance().writeValue(IPlugInPort.HIGHLIGHT_CONTINUITY_AREA, false);
LOG.debug("Java version: " + System.getProperty("java.runtime.version") + " by "
+ System.getProperty("java.vm.vendor"));
LOG.debug("Java home: " + System.getProperty("java.home"));
LOG.debug("OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
LOG.info("JarLoader strategy: " + JarLoader.getStrategy());
LOG.info("Starting DIYLC with working directory " + System.getProperty("user.dir"));
LOG.info("Configuration dump start.");
// log configuration
Field[] fields = IPlugInPort.class.getFields();
for (Field f : fields) {
if (f.getType() != String.class || !f.getName().toUpperCase().equals(f.getName()))
continue;
try {
String key = (String) f.get(null);
Object configValue = ConfigurationManager.getInstance().readObject(key, null);
if (configValue != null && (configValue.getClass() == Boolean.class || configValue.getClass() == String.class)) {
LOG.info(key + " = " + configValue);
}
} catch (Exception e) {
LOG.info("Error logging for field: " + f.getName());
}
}
LOG.info("Configuration dump end.");
LOG.info("Loading languages...");
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
LOG.error("Could not set Look&Feel", e);
}
LangUtil.configure();
Thread fontThread = new Thread(new Runnable() {
LOG.debug("Java version: " + System.getProperty("java.runtime.version") + " by "
+ System.getProperty("java.vm.vendor"));
LOG.debug("Java home: " + System.getProperty("java.home"));
LOG.debug("OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version"));
@Override
public void run() {
try {
FontOptimizer.run(ConfigurationManager.getInstance());
} catch (Exception e) {
LOG.error("Could not ", e);
}
}
});
fontThread.setPriority(Thread.MIN_PRIORITY);
fontThread.start();
LOG.info("Starting DIYLC with working directory " + System.getProperty("user.dir"));
String val = System.getProperty(SCRIPT_RUN);
if (!"true".equals(val)) {
LOG.info("Detected no scriptRun setting!");
int response = JOptionPane.showConfirmDialog(splash,
"It is not recommended to run DIYLC by clicking on the diylc.jar file.\n"
+ "Please use diylc.exe on Windows or run.sh on OSX/Linux to ensure the best\n"
+ "performance and reliability. Do you want to continue?",
"DIYLC", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if (response != JOptionPane.YES_OPTION) {
System.exit(0);
}
}
LOG.info("Creating the main frame...");
LOG.info("Configuration dump start.");
// log configuration
Field[] fields = IPlugInPort.class.getFields();
for (Field f : fields) {
if (f.getType() != String.class || !f.getName().toUpperCase().equals(f.getName()))
continue;
try {
String key = (String) f.get(null);
Object configValue = ConfigurationManager.getInstance().readObject(key, null);
if (configValue != null
&& (configValue.getClass() == Boolean.class || configValue.getClass() == String.class)) {
LOG.info(key + " = " + configValue);
}
} catch (Exception e) {
LOG.info("Error logging for field: " + f.getName());
}
}
LOG.info("Configuration dump end.");
MainFrame mainFrame = new MainFrame();
Presenter presenter = mainFrame.getPresenter();
LOG.info("Main frame created.");
// mainFrame.setLocationRelativeTo(null);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
LOG.error("Could not set Look&Feel", e);
}
if (splash == null) {
LOG.warn("Splash screen could not be initialized", splashException);
} else {
LOG.info("Hiding splash screen...");
splash.setVisible(false);
splash.dispose();
LOG.info("Done hiding splash screen.");
}
Thread fontThread = new Thread(new Runnable() {
mainFrame.setVisible(true);
@Override
public void run() {
try {
FontOptimizer.run(ConfigurationManager.getInstance());
} catch (Exception e) {
LOG.error("Could not ", e);
}
}
});
fontThread.setPriority(Thread.MIN_PRIORITY);
fontThread.start();
// assign open file handler for Mac
if (Utils.isMac()) {
LOG.info("Setting up open file handler for Mac...");
SwingUtilities.invokeLater(() -> {
Application.getApplication().setOpenFileHandler((AppEvent.OpenFilesEvent ofe) -> {
List<File> files = ofe.getFiles();
if (files != null && files.size() > 0) {
String filePath = files.get(0).getAbsolutePath();
if (presenter.allowFileAction()) {
presenter.loadProjectFromFile(filePath);
}
}
LOG.info("Finished setting up open file handler for Mac.");
});
});
}
String val = System.getProperty(SCRIPT_RUN);
if (!"true".equals(val)) {
LOG.info("Detected no scriptRun setting!");
int response = JOptionPane.showConfirmDialog(splash,
"It is not recommended to run DIYLC by clicking on the diylc.jar file.\n"
+ "Please use diylc.exe on Windows or run.sh on OSX/Linux to ensure the best\n"
+ "performance and reliability. Do you want to continue?",
"DIYLC", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
if (response != JOptionPane.YES_OPTION) {
System.exit(0);
}
}
if (args.length > 0) {
presenter.loadProjectFromFile(args[0]);
} else {
boolean showTemplates =
ConfigurationManager.getInstance().readBoolean(TemplateDialog.SHOW_TEMPLATES_KEY, false);
if (showTemplates) {
TemplateDialog templateDialog = new TemplateDialog(mainFrame, mainFrame.getPresenter());
if (!templateDialog.getFiles().isEmpty()) {
templateDialog.setVisible(true);
}
}
}
LOG.info("Creating the main frame...");
properties = new Properties();
try {
LOG.info("Injecting default properties.");
URL resource = Presenter.class.getResource("config.properties");
if (resource != null) {
properties.load(resource.openStream());
PropertyInjector.injectProperties(properties);
}
} catch (Exception e) {
LOG.error("Could not read config.properties file", e);
}
MainFrame mainFrame = new MainFrame();
Presenter presenter = mainFrame.getPresenter();
if (ConfigurationManager.getInstance().isFileWithErrors())
mainFrame.showMessage("<html>"
+ "There was an error reading the configuration file and it was replaced by a default configuration.<br>"
+ "The backup file is created and placed in user directory under '.diylc' sub-directory with '~' at the end.<br>"
+ "This can happen when running two versions of DIYLC on the same machine at the same time.<br>"
+ "Replace the main 'config.xml' file with the backup when running the latest version of DIYLC."
+ "</html>", "Warning", IView.WARNING_MESSAGE);
}
LOG.info("Main frame created.");
// mainFrame.setLocationRelativeTo(null);
private static void initializeConfiguration() {
// migrate config file from old folder path to the new one
Path oldPath = Paths.get(Utils.getUserDataDirectory(".diylc") + "config.xml");
Path newPath = Paths.get(Utils.getUserDataDirectory("diylc") + "config.xml");
try {
if (oldPath.toFile().exists() && !newPath.toFile().exists()) {
LOG.info("Copying config file to the new directory");
Files.copy(oldPath, newPath, StandardCopyOption.REPLACE_EXISTING);
}
} catch (IOException e) {
LOG.error("Failed to copy config file to the new directory", e);
}
// initialize
ConfigurationManager configurationManager = ConfigurationManager.getInstance();
XStream xStream = configurationManager.getSerializer();
ProjectFileManager.configure(xStream);
configurationManager.initialize("diylc");
}
if (splash == null) {
LOG.warn("Splash screen could not be initialized", splashException);
} else {
LOG.info("Hiding splash screen...");
splash.setVisible(false);
splash.dispose();
LOG.info("Done hiding splash screen.");
}
mainFrame.setVisible(true);
// assign open file handler for Mac
if (Utils.isMac()) {
LOG.info("Setting up open file handler for Mac...");
SwingUtilities.invokeLater(() -> {
Application.getApplication().setOpenFileHandler((AppEvent.OpenFilesEvent ofe) -> {
List<File> files = ofe.getFiles();
if (files != null && files.size() > 0) {
String filePath = files.get(0).getAbsolutePath();
if (presenter.allowFileAction()) {
presenter.loadProjectFromFile(filePath);
}
}
LOG.info("Finished setting up open file handler for Mac.");
});
});
}
if (args.length > 0) {
presenter.loadProjectFromFile(args[0]);
} else {
boolean showTemplates = ConfigurationManager.getInstance().readBoolean(TemplateDialog.SHOW_TEMPLATES_KEY,
false);
if (showTemplates) {
TemplateDialog templateDialog = new TemplateDialog(mainFrame, mainFrame.getPresenter());
if (!templateDialog.getFiles().isEmpty()) {
templateDialog.setVisible(true);
}
}
}
properties = new Properties();
try {
LOG.info("Injecting default properties.");
URL resource = Presenter.class.getResource("config.properties");
if (resource != null) {
properties.load(resource.openStream());
PropertyInjector.injectProperties(properties);
}
} catch (Exception e) {
LOG.error("Could not read config.properties file", e);
}
if (ConfigurationManager.getInstance().isFileWithErrors())
mainFrame.showMessage("<html>"
+ "There was an error reading the configuration file and it was replaced by a default configuration.<br>"
+ "The backup file is created and placed in user directory under '.diylc' sub-directory with '~' at the end.<br>"
+ "This can happen when running two versions of DIYLC on the same machine at the same time.<br>"
+ "Replace the main 'config.xml' file with the backup when running the latest version of DIYLC."
+ "</html>", "Warning", IView.WARNING_MESSAGE);
}
private static void initializeConfiguration() {
// initialize
ConfigurationManager configurationManager = ConfigurationManager.getInstance();
XStream xStream = configurationManager.getSerializer();
ProjectFileManager.configure(xStream);
configurationManager.initialize(".diylc");
}
}
@@ -46,6 +46,7 @@ import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import javax.swing.filechooser.FileFilter;
import org.diylc.appframework.miscutils.Utils;
import org.apache.log4j.Logger;
import org.diylc.appframework.miscutils.ConfigurationManager;
@@ -1512,7 +1513,11 @@ public class ActionFactory {
super();
this.plugInPort = plugInPort;
putValue(AbstractAction.NAME, "Delete Selection");
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
if (Utils.isMac()) {
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
} else {
putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0));
}
putValue(AbstractAction.SMALL_ICON, IconLoader.Delete.getIcon());
}
@@ -26,9 +26,12 @@ import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.font.TextAttribute;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
@@ -67,8 +70,8 @@ public class ActionBarPlugin implements IPlugIn {
private ConfigToolbar configToolbar;
private JLabel donateLabel;
private static final String DONATE_HTML = "<html><u>" + LangUtil.translate("Enjoying DIYLC? Click here to buy me a coffee :)") + "</u></html>";
private static final String DONATE_HTML_SHORT = "<html><u>" + LangUtil.translate("Donate") + "</u></html>";
private static final String DONATE_HTML = LangUtil.translate("Enjoying DIYLC? Click here to buy me a coffee :)");
private static final String DONATE_HTML_SHORT = LangUtil.translate("Donate");
public ActionBarPlugin(ISwingUI swingUI) {
this.swingUI = swingUI;
@@ -114,6 +117,9 @@ public class ActionBarPlugin implements IPlugIn {
public JLabel getDonateLabel() {
if (donateLabel == null) {
donateLabel = new JLabel(DONATE_HTML);
// Map<TextAttribute, Integer> fontAttributes = new HashMap<TextAttribute, Integer>();
// fontAttributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
// donateLabel.setFont(donateLabel.getFont().deriveFont(fontAttributes));
donateLabel.setForeground(Color.blue);
donateLabel.setIcon(IconLoader.Donate.getIcon());
donateLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
@@ -125,7 +131,7 @@ public class ActionBarPlugin implements IPlugIn {
rootPane.addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
if (rootPane.getWidth() < 920) {
if (rootPane.getWidth() < 940) {
if (!DONATE_HTML_SHORT.equals(donateLabel.getText()))
donateLabel.setText(DONATE_HTML_SHORT);
} else {
@@ -43,6 +43,7 @@ import org.diylc.utils.ResourceLoader;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import com.thoughtworks.xstream.security.AnyTypePermission;
/**
* Controls configuration menu.
@@ -168,6 +169,7 @@ public class ConfigPlugin implements IPlugIn {
File[] themeFiles = ResourceLoader.getFiles("themes");
if (themeFiles != null && themeFiles.length > 0) {
XStream xStream = new XStream(new DomDriver());
xStream.addPermission(AnyTypePermission.ANY);
swingUI.injectSubmenu(THEME_MENU, IconLoader.Pens.getIcon(), CONFIG_MENU);
for (File file : themeFiles) {
if (file.getName().toLowerCase().endsWith(".xml")) {
@@ -123,7 +123,7 @@ public class LayersMenuPlugin implements IPlugIn {
}
static enum Layer {
CHASSIS("Chassis", IDIYComponent.CHASSIS), BOARD("Board", IDIYComponent.BOARD), TRACE("Trace", IDIYComponent.TRACE), COMPONENT(
CHASSIS("Chassis", IDIYComponent.CHASSIS), BOARD("Board", IDIYComponent.BOARD), WIRING("Wiring", IDIYComponent.WIRING), COMPONENT(
"Component", IDIYComponent.COMPONENT), TEXT("Text", IDIYComponent.TEXT);
String title;
+27
View File
@@ -0,0 +1,27 @@
<org.diylc.core.Theme>
<name>Gray</name>
<bgColor>
<red>170</red>
<green>170</green>
<blue>170</blue>
<alpha>255</alpha>
</bgColor>
<gridColor>
<red>150</red>
<green>150</green>
<blue>150</blue>
<alpha>255</alpha>
</gridColor>
<dotColor>
<red>100</red>
<green>100</green>
<blue>100</blue>
<alpha>255</alpha>
</dotColor>
<outlineColor>
<red>0</red>
<green>0</green>
<blue>0</blue>
<alpha>255</alpha>
</outlineColor>
</org.diylc.core.Theme>