From: <de...@us...> - 2012-08-17 16:25:41
|
Revision: 7558 http://fudaa.svn.sourceforge.net/fudaa/?rev=7558&view=rev Author: deniger Date: 2012-08-17 16:25:34 +0000 (Fri, 17 Aug 2012) Log Message: ----------- Modified Paths: -------------- trunk/soft/fudaa-crue/crue-server/src/main/resources/org/fudaa/dodico/crue/common/businessMessages.properties trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionDonFrtCellRenderer.java trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionLoiUiController.java trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestProfilSectionUIController.java Modified: trunk/soft/fudaa-crue/crue-server/src/main/resources/org/fudaa/dodico/crue/common/businessMessages.properties =================================================================== --- trunk/soft/fudaa-crue/crue-server/src/main/resources/org/fudaa/dodico/crue/common/businessMessages.properties 2012-08-17 16:00:55 UTC (rev 7557) +++ trunk/soft/fudaa-crue/crue-server/src/main/resources/org/fudaa/dodico/crue/common/businessMessages.properties 2012-08-17 16:25:34 UTC (rev 7558) @@ -355,7 +355,7 @@ validation.ord.NotNormal = L''ordonn\u00e9e du point {0} n''est pas normale. validation.ord.NotValid = L''ordonn\u00e9e du point {0} n''est pas valide. profil.editionValidation.order.error=L''ordre de LitNomme n''est pas valide. Attendu: {1} -profil.editionValidation.end.error=L''\u00e9tiquette de fin du LitNomme {0} n''est pas d\u00e9fini. +profil.editionValidation.end.error=L''\u00e9tiquette de fin du LitNomme {0} n''est pas d\u00e9finie. validation.pdtVar.OneElemIsRequired={0}: au moins un \u00e9l\u00e9ment doit \u00eatre d\u00e9fini Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionDonFrtCellRenderer.java =================================================================== --- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionDonFrtCellRenderer.java 2012-08-17 16:00:55 UTC (rev 7557) +++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionDonFrtCellRenderer.java 2012-08-17 16:25:34 UTC (rev 7558) @@ -24,10 +24,14 @@ ProfilSectionLoiTableModel tableModel = (ProfilSectionLoiTableModel) _table.getModel(); ProfilSectionLine line = tableModel.getLine(_row); if (line.containsLimiteLitNomme()) { - init = Color.LIGHT_GRAY; +// init = Color.LIGHT_GRAY; } else if (line.containsLimiteLit()) { - init = limitLitColor; +// init = limitLitColor; } + else{ + setText(null); + setToolTipText(null); + } setBackground(init); } Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionLoiUiController.java =================================================================== --- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionLoiUiController.java 2012-08-17 16:00:55 UTC (rev 7557) +++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/section/ProfilSectionLoiUiController.java 2012-08-17 16:25:34 UTC (rev 7558) @@ -23,6 +23,7 @@ import org.fudaa.dodico.crue.validation.ValidateAndRebuildProfilSection; import org.fudaa.fudaa.crue.common.log.LogIconTranslationProvider; import org.fudaa.fudaa.crue.common.log.LogsDisplayer; +import org.fudaa.fudaa.crue.loi.LoiMessages; import org.fudaa.fudaa.crue.loi.common.AbstractLoiCourbeModel; import org.fudaa.fudaa.crue.loi.common.AbstractLoiUiController; import org.fudaa.fudaa.crue.loi.common.DefaultLoiTableModel; @@ -31,36 +32,36 @@ * * @author Frederic Deniger */ -public class ProfilSectionLoiUiController extends AbstractLoiUiController implements TableModelListener{ +public class ProfilSectionLoiUiController extends AbstractLoiUiController implements TableModelListener { - JLabel labelValidating=new JLabel(); - + JLabel labelValidating = new JLabel(" test"); + public ProfilSectionLoiUiController() { tableGraphePanel.getTable().getModel().addTableModelListener(this); } - + public JLabel getLabelValidating() { return labelValidating; } @Override public void tableChanged(TableModelEvent e) { - if(e.getColumn()==ProfilSectionLoiTableModel.COLUMN_FRT){ + if (e.getColumn() == ProfilSectionLoiTableModel.COLUMN_FRT) { return; } - CtuluLog log=validateLit(); - if(log.isEmpty()){ + CtuluLog log = validateLit(); + if (log.isEmpty()) { labelValidating.setIcon(null); labelValidating.setText(null); labelValidating.setToolTipText(null); - } - else{ + } else { labelValidating.setIcon(LogIconTranslationProvider.getIcon(CtuluLogLevel.ERROR)); + labelValidating.setText(org.openide.util.NbBundle.getMessage(LoiMessages.class, "ProfilSection.Lit.Error")); + String toHtml = LogsDisplayer.toHtml(log); + labelValidating.setToolTipText(toHtml); } } - - @Override public ProfiLSectionCourbeModel getLoiModel() { return (ProfiLSectionCourbeModel) super.getLoiModel(); @@ -69,11 +70,11 @@ Map<LitNomme, ProfilSectionEtiquette> etiquettesByLitNomme; ProfilSectionEtiquette etiquettesLimiteLit; CrueConfigMetier ccm; - + public CtuluLog validateLit() { return new ProfilSectionLitValidation().valid(getLoiModel().getProfilSectionLoiLine(), ccm.getLitNomme()); } - + public void setProfilSection(DonPrtGeoProfilSection profil, CrueConfigMetier ccm) { this.ccm = ccm; if (profil == null) { @@ -107,7 +108,7 @@ final ProfilSectionEtiquette litNommeEtiquette = etiquettesByLitNomme.get(litNommeIndexed.getLitNomme()); model.getLoiLine(start).addEtiquette(litNommeEtiquette); model.getLoiLine(last).addEtiquette(litNommeEtiquette); - + int litNumerotesSize = litNommeIndexed.getLitNumerotesSize(); for (int i = 0; i < litNumerotesSize; i++) { LitNumeroteIndex litNumeroteIndex = litNommeIndexed.getLitNumeroteIndex(i); @@ -118,17 +119,17 @@ model.getLoiLine(litNumeroteIndex.getIdxStart()).addEtiquette(etiquettesLimiteLit); } } - + } - - + + } - + @Override protected DefaultLoiTableModel createTableModel() { return new ProfilSectionLoiTableModel(tableGraphePanel); } - + @Override protected AbstractLoiCourbeModel createCourbeModel(Loi loi, ConfigLoi configLoi) { return ProfiLSectionCourbeModel.create(loi, configLoi); Modified: trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties =================================================================== --- trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties 2012-08-17 16:00:55 UTC (rev 7557) +++ trunk/soft/fudaa-crue/ui-loi/src/main/resources/org/fudaa/fudaa/crue/loi/Bundle.properties 2012-08-17 16:25:34 UTC (rev 7558) @@ -28,3 +28,4 @@ EditionCancel=Fermer ProfilSection.DonFrt.LimiteLit=-------- ProfilSection.DonFrt.LimiteLitNomme========= +ProfilSection.Lit.Error=Erreurs d\u00e9tect\u00e9es dans les LitNomme Modified: trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestProfilSectionUIController.java =================================================================== --- trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestProfilSectionUIController.java 2012-08-17 16:00:55 UTC (rev 7557) +++ trunk/soft/fudaa-crue/ui-loi/src/test/java/org/fudaa/fudaa/crue/loi/TestProfilSectionUIController.java 2012-08-17 16:25:34 UTC (rev 7558) @@ -53,18 +53,10 @@ JPanel pn = new JPanel(new BorderLayout(10, 10)); pn.add(uiController.getPanel()); pn.add(uiController.getToolbar(), BorderLayout.NORTH); - pn.add(uiController.getTableGraphePanel(), BorderLayout.EAST); - JButton btValid = new JButton("Valide"); - btValid.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - CtuluLog validateLit = uiController.validateLit(); - if (validateLit.isNotEmpty()) { - LogsDisplayer.displayError(validateLit, "Test"); - } - } - }); - pn.add(btValid,BorderLayout.WEST); + JPanel pnTable = new JPanel(new BorderLayout()); + pnTable.add(uiController.getTableGraphePanel()); + pnTable.add(uiController.getLabelValidating(), BorderLayout.SOUTH); + pn.add(pnTable, BorderLayout.EAST); uiController.setEditable(true); display(pn); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |