r2948 - in trunk/lima-swing/src/main: java/org/chorem/lima/ui/home resources/i18n
Author: jpepin Date: 2010-06-25 16:59:10 +0200 (Fri, 25 Jun 2010) New Revision: 2948 Url: http://chorem.org/repositories/revision/lima/2948 Log: Modification accueil, utilisation de JEditorPane au lieu de vbox et jlabel. Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewHandler.java trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2010-06-24 17:18:43 UTC (rev 2947) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeView.jaxx 2010-06-25 14:59:10 UTC (rev 2948) @@ -11,6 +11,11 @@ } ]]> </script> + <row weightx="1" weighty="1" anchor="west"> + <cell> + <JLabel font='{new Font("Arial", 0, 16)}' text="LIMA"/> + </cell> + </row> <row weightx="1" weighty="1"> <cell> <JPanel id="limaHomeChartAccount" @@ -18,12 +23,7 @@ minimumSize='{getFixedSize()}' preferredSize='{getFixedSize()}' layout='{new BoxLayout(limaHomeChartAccount,BoxLayout.X_AXIS)}'> - <VBox id="homeBoxAccount" - margin='0' - horizontalAlignment='center' - verticalAlignment='middle'> - <JLabel id="textHomeAccount"/> - </VBox> + <JEditorPane id="textHomeAccount" /> </JPanel> </cell> </row> @@ -34,12 +34,7 @@ minimumSize='{getFixedSize()}' preferredSize='{getFixedSize()}' layout='{new BoxLayout(limaHomeEntryBook,BoxLayout.X_AXIS)}'> - <VBox id="homeBoxEntryBook" - margin='0' - horizontalAlignment='center' - verticalAlignment='middle'> - <JLabel id="textHomeEntryBook"/> - </VBox> + <JEditorPane id="textHomeEntryBook"/> </JPanel> </cell> </row> @@ -50,12 +45,7 @@ minimumSize='{getFixedSize()}' preferredSize='{getFixedSize()}' layout='{new BoxLayout(limaHomeFiscalYear,BoxLayout.X_AXIS)}'> - <VBox id="homeBoxFiscalYear" - margin='0' - horizontalAlignment='center' - verticalAlignment='middle'> - <JLabel id="textHomeFiscalYear"/> - </VBox> + <JEditorPane id="textHomeFiscalYear"/> </JPanel> </cell> </row> @@ -66,16 +56,11 @@ minimumSize='{getFixedSize()}' preferredSize='{getFixedSize()}' layout='{new BoxLayout(limaHomeDaily,BoxLayout.X_AXIS)}'> - <VBox id="homeBoxDaily" - margin='0' - horizontalAlignment='center' - verticalAlignment='middle'> - <JLabel id="textHomeDaily"/> - </VBox> + <JEditorPane id="textHomeDaily"/> </JPanel> </cell> </row> - <row insets="40" weightx="1" weighty="1" anchor="west"> + <row weightx="1" weighty="1" anchor="west"> <cell> <JLabel icon='{new ImageIcon(getClass().getResource("/images/logo-codelutin.png"))}'/> </cell> Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewHandler.java 2010-06-24 17:18:43 UTC (rev 2947) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/home/HomeViewHandler.java 2010-06-25 14:59:10 UTC (rev 2948) @@ -2,6 +2,7 @@ import static org.nuiton.i18n.I18n._; import java.awt.Color; +import java.awt.Component; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -49,78 +50,106 @@ redBackground = new Color(255, 102, 102); } + public void goToAccountChart(){ + + } public void refresh(){ try { + //ACCOUNT List<Account> accounts = accountService.getAllAccounts(); + view.getTextHomeAccount().setUI(new javax.swing.plaf.basic.BasicEditorPaneUI()); + view.getTextHomeAccount().setOpaque(true); + view.getTextHomeAccount().setContentType("text/html"); + view.getTextHomeAccount().setEditable(false); if (accounts.size()>0){ - view.homeBoxAccount.setBackground(greenBackground); String accountsString = _("limahome.chartaccounts1") + " " + accounts.size() + " " + _("limahome.chartaccounts2"); - view.textHomeAccount.setText(accountsString); + view.getTextHomeAccount().setBackground(greenBackground); + view.getTextHomeAccount().setText("<p style=vertical-align:'bottom', horizontal-align:'center'><a href='lima://accountcharts'>"+accountsString+"</a></p>"); } else { - view.homeBoxAccount.setBackground(redBackground); - String accountsString = "<html>"+_("limahome.fiscalperiodnoopen") + - "<br/>"+_("limahome.createchartaccounts")+"</html>"; - view.textHomeAccount.setText(accountsString); + view.getTextHomeAccount().setBackground(redBackground); + String accountsString = "<p style=vertical-align:'bottom', horizontal-align:'center'>"+_("limahome.fiscalperiodnoopen") + + "<br/><a href='lima://accountcharts'>"+_("limahome.createchartaccounts")+"</a>"; + view.getTextHomeAccount().setText(accountsString+"</p>"); } + //ENTRYBOOK List<EntryBook> entryBooks = entryBookService.getAllEntryBooks(); + view.getTextHomeEntryBook().setUI(new javax.swing.plaf.basic.BasicEditorPaneUI()); + view.getTextHomeEntryBook().setOpaque(true); + view.getTextHomeEntryBook().setContentType("text/html"); + view.getTextHomeEntryBook().setEditable(false); if (entryBooks.size()>0){ - view.homeBoxEntryBook.setBackground(greenBackground); - String entryBooksString = "<html>"+_("limahome.entrybooks1") + + view.getTextHomeEntryBook().setBackground(greenBackground); + String entryBooksString = "<p style=vertical-align:'bottom', horizontal-align:'center'><a href='lima://entrybookcharts'>"+_("limahome.entrybooks1") + " " + entryBooks.size() + " " + _("limahome.entrybooks2") + - "<br/><ul>"; + "</a><br/><ul>"; for (EntryBook entryBook : entryBooks) { entryBooksString += "<li>"+entryBook.getCode() + " - "+entryBook.getLabel()+"</li>"; } - view.textHomeEntryBook.setText(entryBooksString+"</ul></html>"); + view.getTextHomeEntryBook().setText(entryBooksString+"</ul>"+"</p>"); } else { - view.homeBoxEntryBook.setBackground(redBackground); - view.textHomeEntryBook.setText(_("limahome.fiscalperiodnoopen")); + view.getTextHomeEntryBook().setBackground(redBackground); + view.getTextHomeEntryBook().setText("<p style=vertical-align:'bottom', horizontal-align:'center'><a href='lima://entrybookcharts'>"+_("limahome.entrybooknoopen")+"</a></p>"); } + //FISCAL PERIOD List<FiscalPeriod> fiscalPeriods = fiscalPeriodService.getAllFiscalPeriods(); List<FiscalPeriod> unblockedFiscalPeriods = fiscalPeriodService.getAllUnblockedFiscalPeriods(); + + view.getTextHomeFiscalYear().setUI(new javax.swing.plaf.basic.BasicEditorPaneUI()); + view.getTextHomeFiscalYear().setOpaque(true); + view.getTextHomeFiscalYear().setContentType("text/html"); + view.getTextHomeFiscalYear().setEditable(false); + view.getTextHomeDaily().setUI(new javax.swing.plaf.basic.BasicEditorPaneUI()); + view.getTextHomeDaily().setOpaque(true); + view.getTextHomeDaily().setContentType("text/html"); + view.getTextHomeDaily().setEditable(false); + if (unblockedFiscalPeriods.size()>0){ - view.homeBoxFiscalYear.setBackground(greenBackground); - String fiscalString = "<html>"+unblockedFiscalPeriods.size() + + view.getTextHomeFiscalYear().setBackground(greenBackground); + String fiscalString = "<p style=vertical-align:'bottom', horizontal-align:'center'><a href='lima://fiscalcharts'>" + + unblockedFiscalPeriods.size() + " " + _("limahome.fiscalperiodopened")+"<br/>" + (fiscalPeriods.size()-unblockedFiscalPeriods.size()) + - " " + _("limahome.fiscalperiodclosed")+"</html>"; - view.textHomeFiscalYear.setText(fiscalString); + " " + _("limahome.fiscalperiodclosed"); + view.getTextHomeFiscalYear().setText(fiscalString+"</a></p>"); + //FINACIAL TRANSACTION List<FinancialTransaction> financialTransactions = financialTransactionService. getAllFinancialTransactionsUnbalanced(fiscalPeriods.get(0)); if (financialTransactions.size()>0){ - view.homeBoxDaily.setBackground(redBackground); - String transactionsString = financialTransactions.size() + - _("limahome.transactionunbalanced"); - view.textHomeAccount.setText(transactionsString); + view.getTextHomeDaily().setBackground(redBackground); + String transactionsString = "<p style=vertical-align:'bottom', horizontal-align:'center'><a href='lima://financialtransactionunbalanced'>" + + financialTransactions.size() + + _("limahome.transactionunbalanced")+"</a></p>"; + view.getTextHomeDaily().setText(transactionsString); } else { - view.homeBoxDaily.setBackground(greenBackground); - String transactionsString =_("limahome.transactionbalanced"); - view.textHomeDaily.setText(transactionsString); + view.getTextHomeDaily().setBackground(greenBackground); + String transactionsString = "<p style=vertical-align:'bottom', horizontal-align:'center'><a href='lima://financialtransactionbalanced'>" + + _("limahome.transactionbalanced"); + view.getTextHomeDaily().setText(transactionsString+"</a></p>"); } } else { - view.homeBoxFiscalYear.setBackground(redBackground); - view.homeBoxDaily.setBackground(redBackground); - String fiscalString = "<html>"+_("limahome.fiscalperiodnoopen"); + view.getTextHomeFiscalYear().setBackground(redBackground); + view.getTextHomeDaily().setBackground(redBackground); + String fiscalString = "<p style=vertical-align:'bottom', horizontal-align:'center'><a href='lima://fiscalcharts'>" + _("limahome.fiscalperiodnoopen"); if (fiscalPeriods.size()>0){ fiscalString += fiscalPeriods.size() + _("limahome.fiscalperiodclosed"); } - view.textHomeFiscalYear.setText(fiscalString+"</html>"); + view.getTextHomeFiscalYear().setText(fiscalString+"</a></p>"); } } catch (LimaException eee) { Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-06-24 17:18:43 UTC (rev 2947) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-en_GB.properties 2010-06-25 14:59:10 UTC (rev 2948) @@ -2,7 +2,9 @@ DEBUG\ delete\ all= Do\ you\ really\ want\ to\ delete\ entry\ book\ %s\ ?= Global\ lima\ exception= +LIMA= Loading\ accounting...= +hello\ world= lima.about.message= lima.account=Account lima.account.label=Label @@ -167,10 +169,13 @@ lima.transaction.period=Period lima.voucher=Voucher lima.warning.nimbus.landf=Could not find Numbus Look&Feel +limahome.chartaccounts1= +limahome.chartaccounts2= limahome.createchartaccounts= limahome.createchartaccounts1= limahome.createchartaccounts2= limahome.entrybooks1= +limahome.entrybooks2= limahome.fiscalperiodclosed= limahome.fiscalperiodnoopen= limahome.fiscalperiodopened= Modified: trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties =================================================================== --- trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-06-24 17:18:43 UTC (rev 2947) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing-fr_FR.properties 2010-06-25 14:59:10 UTC (rev 2948) @@ -2,7 +2,9 @@ DEBUG\ delete\ all= Do\ you\ really\ want\ to\ delete\ entry\ book\ %s\ ?= Global\ lima\ exception= +LIMA= Loading\ accounting...= +hello\ world= lima.about.message=\u00C0 propos de Lima lima.account=Compte lima.account.label=
participants (1)
-
jpepin@users.chorem.org