mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-16 08:25:09 -04:00
Added setters for the name and the description of a Key intended to be
used in custom components.
This commit is contained in:
parent
7f987f2d8f
commit
25ed0665c9
1
.gitignore
vendored
1
.gitignore
vendored
@ -72,3 +72,4 @@ buildNumber.properties
|
||||
/copybin.sh
|
||||
/Digital.sh
|
||||
/upload.sh
|
||||
/copyToPluginExample.sh
|
||||
|
@ -36,7 +36,7 @@
|
||||
<visualElement>
|
||||
<elementName>LED</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="580" y="180"/>
|
||||
<pos x="540" y="180"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>LED</elementName>
|
||||
@ -51,7 +51,7 @@
|
||||
</awt-color>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="580" y="220"/>
|
||||
<pos x="540" y="220"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>LED</elementName>
|
||||
@ -66,22 +66,32 @@
|
||||
</awt-color>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="580" y="260"/>
|
||||
<pos x="540" y="260"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>DiodeBackward</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="500" y="340"/>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="3"/>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="420" y="260"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>DiodeBackward</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="540" y="340"/>
|
||||
<elementAttributes>
|
||||
<entry>
|
||||
<string>rotation</string>
|
||||
<rotation rotation="3"/>
|
||||
</entry>
|
||||
</elementAttributes>
|
||||
<pos x="420" y="380"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>PullUp</elementName>
|
||||
<elementAttributes/>
|
||||
<pos x="500" y="280"/>
|
||||
<pos x="480" y="200"/>
|
||||
</visualElement>
|
||||
<visualElement>
|
||||
<elementName>Ground</elementName>
|
||||
@ -91,8 +101,8 @@
|
||||
</visualElements>
|
||||
<wires>
|
||||
<wire>
|
||||
<p1 x="480" y="180"/>
|
||||
<p2 x="580" y="180"/>
|
||||
<p1 x="500" y="180"/>
|
||||
<p2 x="540" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="180"/>
|
||||
@ -106,21 +116,25 @@
|
||||
<p1 x="240" y="180"/>
|
||||
<p2 x="280" y="180"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="260"/>
|
||||
<p2 x="580" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="260" y="260"/>
|
||||
<p2 x="280" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="260"/>
|
||||
<p2 x="480" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="260"/>
|
||||
<p2 x="460" y="260"/>
|
||||
<p2 x="420" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="260"/>
|
||||
<p2 x="540" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="340"/>
|
||||
<p2 x="440" y="340"/>
|
||||
<p2 x="460" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="260" y="340"/>
|
||||
@ -132,27 +146,7 @@
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="420"/>
|
||||
<p2 x="480" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="360"/>
|
||||
<p2 x="500" y="360"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="220"/>
|
||||
<p2 x="440" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="260" y="220"/>
|
||||
<p2 x="280" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="220"/>
|
||||
<p2 x="580" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="300"/>
|
||||
<p2 x="540" y="300"/>
|
||||
<p2 x="500" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="260" y="300"/>
|
||||
@ -162,41 +156,53 @@
|
||||
<p1 x="400" y="300"/>
|
||||
<p2 x="420" y="300"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="220"/>
|
||||
<p2 x="460" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="260" y="220"/>
|
||||
<p2 x="280" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="220"/>
|
||||
<p2 x="540" y="220"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="380"/>
|
||||
<p2 x="540" y="380"/>
|
||||
<p2 x="420" y="380"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="240" y="380"/>
|
||||
<p2 x="280" y="380"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="380"/>
|
||||
<p2 x="480" y="380"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="260" y="460"/>
|
||||
<p2 x="280" y="460"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="400" y="460"/>
|
||||
<p2 x="440" y="460"/>
|
||||
<p2 x="460" y="460"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="180"/>
|
||||
<p2 x="480" y="420"/>
|
||||
<p1 x="480" y="200"/>
|
||||
<p2 x="480" y="260"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="480" y="260"/>
|
||||
<p2 x="480" y="380"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="240" y="180"/>
|
||||
<p2 x="240" y="380"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="340"/>
|
||||
<p2 x="500" y="360"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="280"/>
|
||||
<p2 x="500" y="300"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="500" y="300"/>
|
||||
<p2 x="500" y="320"/>
|
||||
<p1 x="500" y="180"/>
|
||||
<p2 x="500" y="420"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="260" y="160"/>
|
||||
@ -231,28 +237,12 @@
|
||||
<p2 x="420" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="220"/>
|
||||
<p2 x="440" y="340"/>
|
||||
<p1 x="460" y="220"/>
|
||||
<p2 x="460" y="340"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="440" y="340"/>
|
||||
<p2 x="440" y="460"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="260"/>
|
||||
<p2 x="540" y="300"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="340"/>
|
||||
<p2 x="540" y="380"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="540" y="300"/>
|
||||
<p2 x="540" y="320"/>
|
||||
</wire>
|
||||
<wire>
|
||||
<p1 x="460" y="260"/>
|
||||
<p2 x="460" y="360"/>
|
||||
<p1 x="460" y="340"/>
|
||||
<p2 x="460" y="460"/>
|
||||
</wire>
|
||||
</wires>
|
||||
</circuit>
|
@ -16,6 +16,11 @@ public class Key<VALUE> {
|
||||
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,9 +47,12 @@ public class Key<VALUE> {
|
||||
/**
|
||||
* Returns the attributes display name
|
||||
*
|
||||
* @return thr name
|
||||
* @return the name of the key
|
||||
*/
|
||||
public String getName() {
|
||||
if (name != null)
|
||||
return name;
|
||||
else
|
||||
return Lang.get(langKey);
|
||||
}
|
||||
|
||||
@ -71,12 +79,16 @@ public class Key<VALUE> {
|
||||
* @return the keys description
|
||||
*/
|
||||
public String getDescription() {
|
||||
if (description != null)
|
||||
return description;
|
||||
else {
|
||||
String d = Lang.getNull(langKey + "_tt");
|
||||
if (d != null)
|
||||
return d;
|
||||
else
|
||||
return getName();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the language key
|
||||
@ -97,11 +109,38 @@ public class Key<VALUE> {
|
||||
*
|
||||
* @return this for chained calls
|
||||
*/
|
||||
Key<VALUE> allowGroupEdit() {
|
||||
public Key<VALUE> 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<VALUE> 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<VALUE> setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A integer attribute.
|
||||
* Stores additional combo box values
|
||||
|
Loading…
x
Reference in New Issue
Block a user