Nano/Server
VogelT 10 months ago
parent 2f02138e39
commit 0715ccb3e9

@ -22,16 +22,44 @@ import de.examples.components.DragDropPaneBean.PaneRepeat;
import de.nanoleaf.server.ColorEnum;
import de.nanoleaf.server.NanoleafDeviceServer;
import de.tvo.tools.StringUtil;
import de.tvo.workplace.DefaultPageBean;
import io.github.rowak.nanoleafapi.Panel;
import io.github.rowak.nanoleafapi.ShapeType;
@CCGenClass (expressionBase="#{d.PanelConfigBean}")
public class PanelConfigBean extends PageBean implements Serializable {
public class PanelConfigBean extends DefaultPageBean implements Serializable {
public void onSave(org.eclnt.jsfserver.base.faces.event.ActionEvent event) {
}
public void onLoad(org.eclnt.jsfserver.base.faces.event.ActionEvent event) {
}
public void onReset(org.eclnt.jsfserver.base.faces.event.ActionEvent event) {
clearAll();
}
public void onLayoutFile(org.eclnt.jsfserver.base.faces.event.ActionEvent event) {
}
private void clearAll() {
}
ValidValuesBinding m_layoutFileVV = new ValidValuesBinding();
public ValidValuesBinding getLayoutFileVV() { return m_layoutFileVV; }
String m_layoutFile;
public String getLayoutFile() { return m_layoutFile; }
public void setLayoutFile(String value) { this.m_layoutFile = value; }
public void onCheckZurodnung(org.eclnt.jsfserver.base.faces.event.ActionEvent event) {
if (getColor() == null || getColor().equals("#000000") || getColor().equals(getDefaultPanelColor())) {
OKPopup.createInstance("Start Zuordnung Farbe", "Bitte wählen Sie eine Farbe für die Zuordnung der Panels.");
OKPopup.createInstance("Start Zuordnung Farbe", "Bitte w<EFBFBD>hlen Sie eine Farbe f<>r die Zuordnung der Panels.");
m_startZuordnung = false;
return;
} else {
@ -40,6 +68,10 @@ public class PanelConfigBean extends PageBean implements Serializable {
}
}
public String getLiteral(String key) {
return getLiteral("Nanoleaf", key);
}
private void selectNextPanel() {
if (getPanelInfoListSource().size() > 0) {
getPanelInfoListSource().get(0).setColor(getColor());
@ -323,7 +355,7 @@ public class PanelConfigBean extends PageBean implements Serializable {
anzahlPanelMatrix = matrixX * matrixY;
if (getAnzahlPanels() > anzahlPanelMatrix) {
OKPopup.createInstance("Matrix", "Bitte vergrößern Sie die Matrix.");
OKPopup.createInstance("Matrix", "Bitte vergr<EFBFBD><EFBFBD>ern Sie die Matrix.");
return;
}
@ -512,7 +544,9 @@ public class PanelConfigBean extends PageBean implements Serializable {
}
public class PanelInfo {
public class PanelInfo {
String i_reference;
public String getReference() { return i_reference; }
public void setReference(String value) { this.i_reference = value; }

@ -0,0 +1,50 @@
package de.tvo.workplace;
import org.eclnt.jsfserver.pagebean.PageBean;
import org.eclnt.jsfserver.resources.ResourceManager;
public class DefaultPageBean extends PageBean {
public DefaultPageBean() {
// TODO Auto-generated constructor stub
}
public String getLiteral(String module, String key) {
String ausgabe = "";
try {
if (key == null)
return "";
ausgabe = ResourceManager.getRuntimeInstance().readProperty("literals" + module, key.toLowerCase());
// ausgabe = readProperty("literals" + module, name.toLowerCase());
// System.out.println("module: " + module + " key: " + key + " ausgabe: " +
// ausgabe);
// System.out.println("Language: " +
// FacesContext.getCurrentInstance().getViewRoot().getLocale());
} catch (Exception e) {
ausgabe = key;
}
if (ausgabe.equals("literalstable is not defined"))
ausgabe = key;
if (ausgabe.startsWith("{literals"))
ausgabe = key;
return ausgabe;
}
@Override
public String getPageName() {
// TODO Auto-generated method stub
return null;
}
@Override
public String getRootExpressionUsedInPage() {
// TODO Auto-generated method stub
return null;
}
}

@ -1,4 +1,3 @@
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
#Created by org.eclnt.editor.resourceeditor.ResourceEditor
#Fri Aug 18 14:40:38 CEST 2017
load=Laden
reset=Zu\u00FCcksetzen
save=Speichern

@ -5,8 +5,9 @@
<t:row id="g_5" />
<t:rowbodypane id="g_4" >
<t:row id="g_13" >
<t:splitpane id="g_14" dividerlocation="400" dividersize="2" height="160" orientation="horizontal" width="100%" withwritebackdividerlocation="true" >
<t:splitpane id="g_14" dividerlocation="400" dividersize="2" height="200" orientation="horizontal" width="100%" withwritebackdividerlocation="true" >
<t:splitpanesplit id="g_15" >
<t:rowdistance id="g_202" />
<t:row id="g_7" >
<t:coldistance id="g_2" />
<t:label id="g_3" font="size:16" text="Koordinaten Panel Matirx:" />
@ -20,7 +21,7 @@
<t:label id="g_11" text="Anzahl Panels:" width="100" />
<t:field id="g_12" actionListener="#{d.PanelConfigBean.onPanelsCreate}" align="center" flush="true" text="#{d.PanelConfigBean.anzahlPanels}" width="100" />
<t:coldistance id="g_30" width="15" />
<t:button id="g_31" actionListener="#{d.PanelConfigBean.onPanelsCreate}" text="Panels Auslesen" width="140" />
<t:button id="g_31" actionListener="#{d.PanelConfigBean.onPanelsCreate}" text="Panels Auslesen" width="180" />
</t:row>
<t:rowdistance id="g_24" />
<t:row id="g_25" >
@ -34,7 +35,7 @@
<t:label id="g_21" text="Matrix Y:" width="100" />
<t:field id="g_22" align="center" flush="true" text="#{d.PanelConfigBean.matrixY}" width="100" />
<t:coldistance id="g_33" width="15" />
<t:button id="g_34" actionListener="#{d.PanelConfigBean.onCheckAndCreate}" text="Check And Create" width="140" />
<t:button id="g_34" actionListener="#{d.PanelConfigBean.onCheckAndCreate}" text="Check And Create" width="180" />
</t:row>
<t:rowdistance id="g_27" height="15" />
<t:row id="g_99" >
@ -45,6 +46,15 @@
<t:toggle id="g_174" actionListener="#{d.PanelConfigBean.onCheckZurodnung}" flush="true" imagefalse="/eclntjsfserver.images.iconssvg.toggleoff.#ff0000.36x24.ccsvg" imagenull="/eclntjsfserver.images.iconssvg.toggleoff.#c0c0c0.36x24.ccsvg" imagetrue="/eclntjsfserver.images.iconssvg.toggleon.#00ff00.36x24.ccsvg" selected="#{d.PanelConfigBean.startZuordnung}" text="Start Zuordnung" />
<t:label id="g_109" width="60" />
</t:row>
<t:rowdistance id="g_178" height="20" />
<t:row id="g_180" >
<t:coldistance id="g_182" />
<t:combobox id="g_184" actionListener="#{d.PanelConfigBean.onLayoutFile}" flush="true" validvaluesbinding="#{d.PanelConfigBean.layoutFileVV}" value="#{d.PanelConfigBean.layoutFile}" width="200" />
<t:coldistance id="g_186" />
<t:button id="g_188" actionListener="#{d.PanelConfigBean.onLoad}" text="#{rr.literalsNanoleaf[&#39;load&#39;]}" width="90" />
<t:coldistance id="g_190" />
<t:button id="g_192" text="#{rr.literalsNanoleaf[&#39;save&#39;]}" width="90" />
</t:row>
</t:splitpanesplit>
<t:splitpanesplit id="g_16" >
<t:rowdistance id="g_47" />
@ -75,7 +85,7 @@
<t:coldistance id="g_39" />
<t:label id="g_41" text="Nanoleaf Token" width="200" />
</t:row>
<t:rowdistance id="g_64" />
<t:rowdistance id="g_64" height="15" />
<t:row id="g_65" >
<t:coldistance id="g_66" />
<t:field id="g_67" enabled="false" text="#{d.PanelConfigBean.nanoleafToken}" width="250" />
@ -88,9 +98,15 @@
<t:coldistance id="g_85" />
<t:button id="g_86" actionListener="#{d.PanelConfigBean.onPanelsOff}" background="#ff0000" text="OFF" width="60" />
</t:row>
<t:rowdistance id="g_194" height="25" />
<t:row id="g_196" >
<t:coldistance id="g_198" />
<t:button id="g_200" actionListener="#{d.PanelConfigBean.onReset}" text="#{rr.literalsNanoleaf[&#39;reset&#39;]}" width="100" />
</t:row>
</t:splitpanesplit>
</t:splitpane>
</t:row>
<t:rowdistance id="g_176" />
<t:rowline id="g_58" />
<t:rowdistance id="g_68" height="15" />
<t:row id="g_69" >

Loading…
Cancel
Save