/** Constructor */ Controller(DataModel model, KassaView view) { this.data = model; this.view = view; // ... Add listeners to the view. view.addPkSlaListener(new PkSlaListener()); view.addPkDelListener(new PkDelListener()); view.addPkEANbListener(new PkEANbListener()); view.addPkClearListener(new PkClearListener()); view.addP0KasListener(new P0KasListener()); }
private void updArtLista(Artikel a, int i) { if (artLista.get(a.getArtnr()) != null) { if (artLista.get(a.getArtnr()) + i == 0) { artLista.remove(a.getArtnr()); } else { artLista.put(a.getArtnr(), artLista.get(a.getArtnr()) + i); } } else { artLista.put(a.getArtnr(), i); } view.updPkLabel(artLista); }