mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Since 3.49, some capacitor variants have disappeared. The fix brings
them back
This commit is contained in:
@@ -44,6 +44,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
|
||||||
@@ -116,7 +117,10 @@ public class Presenter implements IPlugInPort {
|
|||||||
try {
|
try {
|
||||||
BufferedInputStream in = new BufferedInputStream(new FileInputStream("variants.xml"));
|
BufferedInputStream in = new BufferedInputStream(new FileInputStream("variants.xml"));
|
||||||
XStream xStream = new XStream(new DomDriver());
|
XStream xStream = new XStream(new DomDriver());
|
||||||
defaultVariantMap = (Map<String, List<Template>>) xStream.fromXML(in);
|
@SuppressWarnings("unchecked")
|
||||||
|
Map<String, List<Template>> map = (Map<String, List<Template>>) xStream.fromXML(in);
|
||||||
|
defaultVariantMap = new TreeMap<String, List<Template>>(String.CASE_INSENSITIVE_ORDER);
|
||||||
|
defaultVariantMap.putAll(map);
|
||||||
in.close();
|
in.close();
|
||||||
LOG.info(String.format("Loaded default variants for %d components", defaultVariantMap == null ? 0 : defaultVariantMap.size()));
|
LOG.info(String.format("Loaded default variants for %d components", defaultVariantMap == null ? 0 : defaultVariantMap.size()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -2250,8 +2254,13 @@ public class Presenter implements IPlugInPort {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public List<Template> getVariantsFor(String categoryName, String componentTypeName) {
|
public List<Template> getVariantsFor(String categoryName, String componentTypeName) {
|
||||||
|
Map<String, List<Template>> lookupMap = new TreeMap<String, List<Template>>(String.CASE_INSENSITIVE_ORDER);
|
||||||
|
|
||||||
Map<String, List<Template>> variantMap =
|
Map<String, List<Template>> variantMap =
|
||||||
(Map<String, List<Template>>) ConfigurationManager.getInstance().readObject(TEMPLATES_KEY, null);
|
(Map<String, List<Template>>) ConfigurationManager.getInstance().readObject(TEMPLATES_KEY, null);
|
||||||
|
if (variantMap != null)
|
||||||
|
lookupMap.putAll(variantMap);
|
||||||
|
|
||||||
List<Template> variants = new ArrayList<Template>();
|
List<Template> variants = new ArrayList<Template>();
|
||||||
if (variantMap != null) {
|
if (variantMap != null) {
|
||||||
List<Template> userVariants = variantMap.get(categoryName + "." + componentTypeName);
|
List<Template> userVariants = variantMap.get(categoryName + "." + componentTypeName);
|
||||||
|
|||||||
@@ -2306,6 +2306,10 @@
|
|||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>Since 3.49, straight traces are rendered 1px thinner than curved traces of the same thickness</description>
|
<description>Since 3.49, straight traces are rendered 1px thinner than curved traces of the same thickness</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>BUG_FIX</changeType>
|
||||||
|
<description>Since 3.49, some capacitor variants have disappeared. The fix brings them back</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
</changes>
|
</changes>
|
||||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||||
</org.diylc.appframework.update.Version>
|
</org.diylc.appframework.update.Version>
|
||||||
|
|||||||
Reference in New Issue
Block a user