master
mail 1 year ago
parent b3744505ec
commit 3c48b0044c

@ -2,6 +2,8 @@
<managedpackage name="de.examples.nanoleaf"/> <managedpackage name="de.examples.nanoleaf"/>
<managedpackage name="de.examples.matrixboard"/>
</dispatcherinfo> </dispatcherinfo>

@ -0,0 +1,99 @@
package de.examples.matrixboard;
import java.io.Serializable;
import org.eclnt.ccaddons.pbc.CCDashboardItem;
import org.eclnt.ccaddons.pbc.CCMatrixDashboard;
import org.eclnt.ccaddons.pbc.CCMatrixDashboard.ItemInfo;
import org.eclnt.editor.annotations.CCGenClass;
import org.eclnt.jsfserver.pagebean.PageBean;
@CCGenClass (expressionBase="#{d.MatrixBoardBean}")
public class MatrixBoardBean
extends PageBean
implements Serializable
{
// ------------------------------------------------------------------------
// inner classes
// ------------------------------------------------------------------------
/* Listener to the user of the page bean. */
public interface IListener extends Serializable
{
}
// ------------------------------------------------------------------------
// members
// ------------------------------------------------------------------------
private IListener m_listener;
// ------------------------------------------------------------------------
// constructors & initialization
// ------------------------------------------------------------------------
public MatrixBoardBean() {
initDashboard();
}
public String getPageName() { return "/examples/matrixboard/matrixboard.xml"; }
public String getRootExpressionUsedInPage() { return "#{d.MatrixBoardBean}"; }
// ------------------------------------------------------------------------
// public usage
// ------------------------------------------------------------------------
/* Initialization of the bean. Add any parameter that is required within your scenario. */
public void prepare(IListener listener)
{
m_listener = listener;
}
// ------------------------------------------------------------------------
// private usage
// ------------------------------------------------------------------------
class MyMatrixDashboardListener implements CCMatrixDashboard.IListener
{
@Override
public void reactOnMovedOrResized(ItemInfo itemInfo)
{
System.out.println("ID: " + itemInfo.getItemSize());
System.out.println("X: " + itemInfo.getItemX());
System.err.println("Y: " + itemInfo.getItemY());
}
@Override
public void reactOnMenuItemAction(ItemInfo itemInfo, String command)
{
}
}
CCMatrixDashboard m_dashboard = new CCMatrixDashboard();
public CCMatrixDashboard getDashboard() { return m_dashboard; }
String[] COLORS = new String[] {"#2c84ee","#d44a26","#2d8bef","#2d8bef","#2c84ee"};
String[] TEXTS = new String[] {"Mails","Inbound","Outbound","Orders","Info"};
String[] ICONS = new String[] {"f010","f011","f012","f013","f014"};
private void initDashboard()
{
m_dashboard = new CCMatrixDashboard();
for (int i = 0; i < 5; i++)
{
CCDashboardItem dbi = new CCDashboardItem(true);
dbi.setId("" + i);
dbi.setText(TEXTS[i]);
dbi.setBackground(COLORS[i]);
dbi.setImage("/awesomefont("+ICONS[i]+",#FFFFFF,20)");
dbi.setForeground("#FFFFFF");
m_dashboard.addItem(dbi);
}
m_dashboard.prepare(new MyMatrixDashboardListener(), true, "mypersistid");
}
}

@ -1,7 +1,11 @@
<dispatcherinfo> <dispatcherinfo>
<managedpackage name="de.games.nanoleaf.lightsswitch"/> <managedpackage name="de.games.nanoleaf.lightsswitch"/>
<managedpackage name="de.games.nanoleaf.panelconfig"/>
<managedpackage name="de.games.nanoleaf.tictactoe"/> <managedpackage name="de.games.nanoleaf.tictactoe"/>
</dispatcherinfo> </dispatcherinfo>

@ -1,54 +1,68 @@
package managedbeans; package de.games.nanoleaf.panelconfig;
import java.io.Serializable;
import org.eclnt.editor.annotations.CCGenClass;
import org.eclnt.jsfserver.pagebean.PageBean;
import org.eclnt.jsfserver.base.faces.event.ActionEvent;
@CCGenClass (expressionBase="#{d.PanelConfigBean}")
public class PanelConfigBean extends PageBean implements Serializable {
int m_matrixY = 3;
public int getMatrixY() { return m_matrixY; }
public void setMatrixY(int value) { this.m_matrixY = value; }
import java.io.Serializable; int m_matrixX = 3;
import org.eclnt.editor.annotations.CCGenClass; public int getMatrixX() { return m_matrixX; }
import org.eclnt.jsfserver.pagebean.PageBean; public void setMatrixX(int value) { this.m_matrixX = value; }
import org.eclnt.jsfserver.base.faces.event.ActionEvent; int m_anzahlPanels = 9;
public int getAnzahlPanels() { return m_anzahlPanels; }
@CCGenClass (expressionBase="#{d.MatrixBoardBean}") public void setAnzahlPanels(int value) { this.m_anzahlPanels = value; }
public class MatrixBoardBean int m_anzahlPanelsMax = 0;
extends PageBean public int getAnzahlPanelsMax() { return m_anzahlPanelsMax; }
implements Serializable public void setAnzahlPanelsMax(int value) { this.m_anzahlPanelsMax = value; }
{
// ------------------------------------------------------------------------
// inner classes // ------------------------------------------------------------------------
// ------------------------------------------------------------------------ // inner classes
// ------------------------------------------------------------------------
/* Listener to the user of the page bean. */
public interface IListener extends Serializable /* Listener to the user of the page bean. */
{ public interface IListener extends Serializable
} {
}
// ------------------------------------------------------------------------
// members // ------------------------------------------------------------------------
// ------------------------------------------------------------------------ // members
// ------------------------------------------------------------------------
private IListener m_listener;
private IListener m_listener;
// ------------------------------------------------------------------------
// constructors & initialization // ------------------------------------------------------------------------
// ------------------------------------------------------------------------ // constructors & initialization
// ------------------------------------------------------------------------
public MatrixBoardBean()
{ public PanelConfigBean() {
}
}
public String getPageName() { return "/examples/matrixboard/matrixboard.xml"; }
public String getRootExpressionUsedInPage() { return "#{d.MatrixBoardBean}"; } public String getPageName() { return "/games/nanoleaf/panelconfig/panelconfig.xml"; }
public String getRootExpressionUsedInPage() { return "#{d.PanelConfigBean}"; }
// ------------------------------------------------------------------------
// public usage // ------------------------------------------------------------------------
// ------------------------------------------------------------------------ // public usage
// ------------------------------------------------------------------------
/* Initialization of the bean. Add any parameter that is required within your scenario. */
public void prepare(IListener listener) /* Initialization of the bean. Add any parameter that is required within your scenario. */
{ public void prepare(IListener listener)
m_listener = listener; {
} m_listener = listener;
}
// ------------------------------------------------------------------------
// private usage // ------------------------------------------------------------------------
// ------------------------------------------------------------------------ // private usage
} // ------------------------------------------------------------------------
}

@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<t:layoutdefinition xmlns:t="http://www.CaptainCasa.com/controllibrary/t" > <t:layoutdefinition xmlns:t="http://www.CaptainCasa.com/controllibrary/t" >
<t:beanprocessing id="g_1" beanbinding="#{d.MatrixBoardBean}" /> <t:beanprocessing id="g_1" beanbinding="#{d.MatrixBoardBean}" />
<t:rowtitlebar id="g_2" /> <t:rowtitlebar id="g_2" />
<t:rowheader id="g_3" /> <t:rowheader id="g_3" />
<t:rowbodypane id="g_4" /> <t:rowbodypane id="g_4" >
<t:row id="g_6" >
<t:pagebeancomponent id="g_7" pagebeanbinding="#{d.MatrixBoardBean.dashboard}" pagebeanclass="org.eclnt.ccaddons.pbc.CCMatrixDashboard" shownullcontent="true" />
</t:row>
</t:rowbodypane>
</t:layoutdefinition> </t:layoutdefinition>

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<t:layoutdefinition xmlns:t="http://www.CaptainCasa.com/controllibrary/t" >
<t:beanprocessing id="g_1" beanbinding="#{d.PanelConfigBean}" />
<t:rowbodypane id="g_4" >
<t:row id="g_7" >
<t:coldistance id="g_2" />
<t:label id="g_3" font="size:16" text="Koordinaten Panel Matirx:" />
<t:coldistance id="g_6" />
<t:label id="g_10" />
<t:coldistance id="g_8" />
</t:row>
<t:rowdistance id="g_13" />
<t:row id="g_9" >
<t:coldistance id="g_14" />
<t:label id="g_11" text="Anzahl Panels:" width="100" />
<t:field id="g_12" align="center" text="#{d.PanelConfigBean.anzahlPanels}" width="100" />
</t:row>
<t:rowdistance id="g_24" />
<t:row id="g_25" >
<t:coldistance id="g_15" />
<t:label id="g_16" text="Matrix X:" width="100" />
<t:field id="g_17" align="center" text="#{d.PanelConfigBean.matrixX}" width="100" />
</t:row>
<t:rowdistance id="g_18" />
<t:row id="g_19" >
<t:coldistance id="g_20" />
<t:label id="g_21" text="Matrix Y:" width="100" />
<t:field id="g_22" text="#{d.PanelConfigBean.matrixY}" width="100" />
</t:row>
</t:rowbodypane>
</t:layoutdefinition>
Loading…
Cancel
Save