Author: sletellier Date: 2012-07-09 12:23:21 +0200 (Mon, 09 Jul 2012) New Revision: 3506 Url: http://chorem.org/repositories/revision/lima/3506 Log: Start decouping ui using models Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringEditModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringSelectionModel.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LettringAndUnlettringSelectionModel.java Modified: trunk/lima-callao/src/main/xmi/accounting.zargo trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java Modified: trunk/lima-callao/src/main/xmi/accounting.zargo =================================================================== (Binary files differ) Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringEditModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringEditModel.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringEditModel.java 2012-07-09 10:23:21 UTC (rev 3506) @@ -0,0 +1,55 @@ +package org.chorem.lima.ui.lettering; + +import java.math.BigDecimal; + +/** + * @author sletellier <letellier@codelutin.com> + */ +public class LetteringEditModel { + + protected boolean lettred; + protected boolean unLettred; + protected BigDecimal debit; + protected BigDecimal credit; + protected BigDecimal solde; + + public boolean isLettred() { + return lettred; + } + + public void setLettred(boolean lettred) { + this.lettred = lettred; + } + + public boolean isUnLettred() { + return unLettred; + } + + public void setUnLettred(boolean unLettred) { + this.unLettred = unLettred; + } + + public BigDecimal getDebit() { + return debit; + } + + public void setDebit(BigDecimal debit) { + this.debit = debit; + } + + public BigDecimal getCredit() { + return credit; + } + + public void setCredit(BigDecimal credit) { + this.credit = credit; + } + + public BigDecimal getSolde() { + return solde; + } + + public void setSolde(BigDecimal solde) { + this.solde = solde; + } +} Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringSelectionModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringSelectionModel.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringSelectionModel.java 2012-07-09 10:23:21 UTC (rev 3506) @@ -0,0 +1,9 @@ +package org.chorem.lima.ui.lettering; + +import javax.swing.DefaultListSelectionModel; + +/** + * @author sletellier <letellier@codelutin.com> + */ +public class LetteringSelectionModel extends DefaultListSelectionModel { +} Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx 2012-07-09 09:28:37 UTC (rev 3505) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringView.jaxx 2012-07-09 10:23:21 UTC (rev 3506) @@ -35,7 +35,15 @@ <LetteringViewHandler id="handler" constructorParams="this"/> <LetteringTableModel id="tableModel"/> - <LetteringModelUI id='modelUi' constructorParams='tableModel'/> + <!--LetteringModelUI id='modelUi' constructorParams='tableModel'/--> + + <LetteringEditModel id='letteringEditModel'/> + <LetteringFilter id='filterModel'/> + + <LetteringSelectionModel id='letteringSelectionModel'/> + <DefaultListSelectionModel id='defaultListSelectionModel'/> + <LettringAndUnlettringSelectionModel id='lettringAndUnlettringSelectionModel' + constructorParams='letteringSelectionModel, defaultListSelectionModel'/> <!-- <Boolean id="selectedRow" javaBean="false"/> --> @@ -102,7 +110,7 @@ <cell> <JRadioButton id="lettredEntryCheckBox" buttonGroup="letteredCheckGroup" onActionPerformed="handler.updateAllEntries(pickerDebut.getDate(), pickerFin.getDate(), (Account)accountComboBox.getSelectedItem(), letteredCheckGroup.isSelected(noLettredEntryCheckBox.getModel()))"/> - </cell> + </cell> <cell> <JLabel text="lima.ui.lettering.checkLettredEntry"/> </cell> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-09 09:28:37 UTC (rev 3505) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringViewHandler.java 2012-07-09 10:23:21 UTC (rev 3506) @@ -25,6 +25,13 @@ package org.chorem.lima.ui.lettering; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import javax.swing.JComboBox; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; import org.apache.commons.lang3.time.DateUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -39,12 +46,6 @@ import org.chorem.lima.entity.FiscalPeriod; import org.chorem.lima.service.LimaServiceFactory; -import javax.swing.*; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; - /** * Handler associated with financial transaction view. * @@ -54,7 +55,7 @@ * Last update : $Date$ * By : $Author$ */ -public class LetteringViewHandler implements ServiceListener{ +public class LetteringViewHandler implements ServiceListener, ListSelectionListener { private static final Log log = LogFactory.getLog(LetteringViewHandler.class); @@ -84,6 +85,10 @@ */ public void init() { loadComboAndRows(); + + letteringSelectionModel; + defaultListSelectionModel; + lettringAndUnlettringSelectionModel.addD } public void loadComboAndRows(){ @@ -237,4 +242,10 @@ @Override public void notifyMethod(String serviceName, String methodeName) { } + + @Override + public void valueChanged(ListSelectionEvent e) { + LetteringEditModel editModel = view.getLetteringEditModel(); + editModel. + } } Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LettringAndUnlettringSelectionModel.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LettringAndUnlettringSelectionModel.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LettringAndUnlettringSelectionModel.java 2012-07-09 10:23:21 UTC (rev 3506) @@ -0,0 +1,17 @@ +package org.chorem.lima.ui.lettering; + +import javax.swing.DefaultListSelectionModel; + +/** + * @author sletellier <letellier@codelutin.com> + */ +public class LettringAndUnlettringSelectionModel { + + protected LetteringSelectionModel letteringSelectionModel; + protected DefaultListSelectionModel defaultListSelectionModel; + + public LettringAndUnlettringSelectionModel(LetteringSelectionModel letteringSelectionModel, DefaultListSelectionModel defaultListSelectionModel) { + this.letteringSelectionModel = letteringSelectionModel; + this.defaultListSelectionModel = defaultListSelectionModel; + } +}