diff --git a/.gitignore b/.gitignore index d1b1ee750..0dde712a4 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,4 @@ buildNumber.properties /copybin.sh /Digital.sh /upload.sh +/copyToPluginExample.sh diff --git a/src/main/dig/74xx/traficDiode.dig b/src/main/dig/74xx/traficDiode.dig index d8e6a8997..891f1e5fe 100644 --- a/src/main/dig/74xx/traficDiode.dig +++ b/src/main/dig/74xx/traficDiode.dig @@ -36,7 +36,7 @@ LED - + LED @@ -51,7 +51,7 @@ - + LED @@ -66,22 +66,32 @@ - + DiodeBackward - - + + + rotation + + + + DiodeBackward - - + + + rotation + + + + PullUp - + Ground @@ -91,8 +101,8 @@ - - + + @@ -106,21 +116,25 @@ - - - - + + + + - + + + + + - + @@ -132,27 +146,7 @@ - - - - - - - - - - - - - - - - - - - - - + @@ -162,41 +156,53 @@ + + + + + + + + + + + + - + + + + + - + - - + + + + + + - - - - - - - - - - + + @@ -231,28 +237,12 @@ - - + + - - - - - - - - - - - - - - - - - - + + \ No newline at end of file diff --git a/src/main/java/de/neemann/digital/core/element/Key.java b/src/main/java/de/neemann/digital/core/element/Key.java index 8ddf62c45..a8e7903d4 100644 --- a/src/main/java/de/neemann/digital/core/element/Key.java +++ b/src/main/java/de/neemann/digital/core/element/Key.java @@ -16,6 +16,11 @@ public class Key { private final String langKey; private boolean groupEditAllowed = false; + // Both values are always null in digital. + // Both are only used within a custom implemented component. + private String name; + private String description; + /** * Creates a new Key * @@ -42,10 +47,13 @@ public class Key { /** * Returns the attributes display name * - * @return thr name + * @return the name of the key */ public String getName() { - return Lang.get(langKey); + if (name != null) + return name; + else + return Lang.get(langKey); } /** @@ -71,11 +79,15 @@ public class Key { * @return the keys description */ public String getDescription() { - String d = Lang.getNull(langKey + "_tt"); - if (d != null) - return d; - else - return getName(); + if (description != null) + return description; + else { + String d = Lang.getNull(langKey + "_tt"); + if (d != null) + return d; + else + return getName(); + } } /** @@ -97,11 +109,38 @@ public class Key { * * @return this for chained calls */ - Key allowGroupEdit() { + public Key allowGroupEdit() { this.groupEditAllowed = true; return this; } + /** + * Sets the name of this key. + * Is not used in Digital at all. + * This method can be used to define custom keys in custom java components. + * + * @param name the name of the key + * @return this for chained calls + */ + public Key setName(String name) { + this.name = name; + return this; + } + + /** + * Sets the description of this key. + * Is not used in Digital at all. + * This method can be used to define custom keys in custom java components. + * + * @param description the name of the key + * @return this for chained calls + */ + public Key setDescription(String description) { + this.description = description; + return this; + } + + /** * A integer attribute. * Stores additional combo box values