Wuerfel wuerfelt
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
package bandit.Schnittstelle;
|
||||
|
||||
import bandit.Model.WuerfelData;
|
||||
import bandit.Model.Zahlengenerator;
|
||||
import bandit.View.ZahlenView;
|
||||
import java.util.concurrent.Flow;
|
||||
@@ -15,7 +16,7 @@ import java.util.concurrent.Flow.Subscription;
|
||||
*
|
||||
* @author le
|
||||
*/
|
||||
public class WertAdapter implements Subscriber<Integer>
|
||||
public class WertAdapter implements Subscriber<WuerfelData>
|
||||
{
|
||||
private ZahlenView view;
|
||||
private Zahlengenerator model;
|
||||
@@ -35,10 +36,23 @@ public class WertAdapter implements Subscriber<Integer>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(Integer item)
|
||||
public void onNext(WuerfelData item)
|
||||
{
|
||||
String strWert = String.valueOf(item);
|
||||
view.getLblZahl1().setText(strWert);
|
||||
String strWert = String.valueOf(item.getValue());
|
||||
switch(item.getId()){
|
||||
case 1:
|
||||
view.getLblZahl1().setText(strWert);
|
||||
break;
|
||||
case 2:
|
||||
view.getLblZahl2().setText(strWert);
|
||||
break;
|
||||
case 3:
|
||||
view.getLblZahl3().setText(strWert);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.subscription.request(1);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user