r3555 - in trunk: . lima-swing/src/main/java/org/chorem/lima lima-swing/src/main/java/org/chorem/lima/ui lima-swing/src/main/java/org/chorem/lima/ui/celleditor lima-swing/src/main/java/org/chorem/lima/ui/financialperiod lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch lima
Author: mallon Date: 2012-07-31 15:37:49 +0200 (Tue, 31 Jul 2012) New Revision: 3555 Url: http://chorem.org/repositories/revision/lima/3555 Log: refs #712 Ajout de deux entrees dans le panneau de configuration de l application : une liste deroulante permettant de modifier le comportement de la selection du contenu a l edition, et un editeur de couleur afin de selectionner la couleur du focus de selection d une cellule. (Rajout d'un ?\195?\169diteur dans jaxx 'ColorEditor', et d'un convertisseur de couleur dans nuiton-utils 'ColorConverter'.) - Reste le visuel de selection de la couleur a rendre plus comprehensible. Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTable.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 trunk/pom.xml Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaConfig.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -40,6 +40,7 @@ import org.nuiton.util.VersionUtil; import org.nuiton.util.converter.ConverterUtil; +import java.awt.Color; import java.beans.PropertyChangeListener; import java.io.File; import java.io.IOException; @@ -72,6 +73,14 @@ protected Version version; /** + * Get the configuration file + * @return name of the config. file + * */ + /*public String getConfigFile() { + return configFile; + }*/ + + /** * Get copyright text (include version). * * @return copyright text @@ -123,6 +132,7 @@ instance = new LimaConfig(); instance.loadConfiguration(configFile); } + return instance; } @@ -355,6 +365,22 @@ return getOption(Option.LIMA_HOST_ADDRESS.key); } + public void setColorSelectionFocus(String color) { + setOption(Option.COLOR_SELECTION_FOCUS.key, color); + } + + public Color getColorSelectionFocus() { + return getOptionAsColor((Option.COLOR_SELECTION_FOCUS.key)); + } + + public void setComportmentEditingCell(String comportmentEditingCell) { + setOption(Option.COMPORTMENT_EDITING_CELL.key, comportmentEditingCell); + } + + public String getComportmentEditingCell() { + return getOption((Option.COMPORTMENT_EDITING_CELL.key)); + } + /** Used in ???? */ public static final String[] DEFAULT_JAXX_PCS = {"fullScreen", "locale", "decimalSeparator", "scale", "thousandSeparator", "currency"}; @@ -386,6 +412,7 @@ */ public enum Option implements OptionDef { + CONFIG_FILE(CONFIG_FILE_NAME, n_("lima.config.configFileName.description"), "lima-config.properties", String.class, true, true), DATA_DIR("lima.data.dir", n_("lima.config.data.dir.description"), "${user.home}/.lima", File.class, false, false), RESOURCES_DIRECTORY("lima.resources.dir", n_("lima.config.resources.dir.description"), "${lima.data.dir}/resources-${application.version}", String.class, false, false), @@ -400,8 +427,12 @@ SUPPORT_EMAIL("lima.misc.supportemail", n_("lima.misc.supportemail.description"), "support@codelutin.com", String.class, false, false), OPENEJB_REMOTEMODE("lima.openejb.remotemode", n_("lima.openejb.remotemode.description"), "false", String.class, false, false), LIMA_HOST_ADDRESS("lima.host.address", n_("lima.config.host.adress"), "localhost", String.class, false, false), - LIMA_STATE_FILE("lima.state.file", n_("lima.config.state.file"), "${lima.data.dir}/limaState.xml", String.class, false, false); + LIMA_STATE_FILE("lima.state.file", n_("lima.config.state.file"), "${lima.data.dir}/limaState.xml", String.class, false, false), + COLOR_SELECTION_FOCUS("colorselectionfocus", _("lima.config.colorselectionfocus"), "#000000", Color.class, false, false), + COMPORTMENT_EDITING_CELL("comportmenteditingcell", n_("lima.config.comportmenteditingcell"), "ALL", comportmentEditingCellEnum.class, false, false); + public enum comportmentEditingCellEnum {ALL, NOTHING}; + public final String key; public final String description; Modified: trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/LimaMain.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -137,6 +137,7 @@ LimaConfig config = context.getConfig(); config.parse(args); context.initI18n(config); + context.initEditingComportement(config); return context; } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/MainViewHandler.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -197,6 +197,8 @@ helper.addOption(LimaConfig.Option.SCALE); helper.addOption(LimaConfig.Option.THOUSAND_SEPARATOR); helper.addOption(LimaConfig.Option.CURRENCY); + helper.addOption(LimaConfig.Option.COMPORTMENT_EDITING_CELL); + helper.addOption(LimaConfig.Option.COLOR_SELECTION_FOCUS); helper.buildUI(context, _("lima.config.category.directories")); helper.displayUI(ui, false); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/BigDecimalTableCellEditor.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -24,9 +24,12 @@ */ import jaxx.runtime.swing.editor.cell.NumberCellEditor; +import org.chorem.lima.LimaConfig; import javax.swing.JTable; +import javax.swing.JTextField; import java.awt.Component; +import java.awt.event.FocusEvent; import java.math.BigDecimal; /** @@ -35,15 +38,25 @@ public class BigDecimalTableCellEditor extends NumberCellEditor<BigDecimal>{ protected int row; + protected String comportmentEditingCell; - /** - * constructor - */ public BigDecimalTableCellEditor() { super(BigDecimal.class, false); } @Override + public void focusGained(FocusEvent e) { + comportmentEditingCell = LimaConfig.getInstance().getComportmentEditingCell(); + JTextField numberEditorTextField = super.getNumberEditor().getTextField(); + if (comportmentEditingCell.equals("ALL")) { + numberEditorTextField.selectAll(); + } else { + int textFieldSize = numberEditorTextField.getText().length(); + numberEditorTextField.select(textFieldSize, textFieldSize); + } + } + + @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { this.row = row; return super.getTableCellEditorComponent(table, value, isSelected, row, column); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/celleditor/DateTableCellEditor.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -26,10 +26,12 @@ package org.chorem.lima.ui.celleditor; import org.apache.commons.lang3.time.DateUtils; +import org.chorem.lima.LimaConfig; import org.chorem.lima.LimaContext; import org.jdesktop.swingx.JXDatePicker; import javax.swing.AbstractCellEditor; +import javax.swing.JFormattedTextField; import javax.swing.JTable; import javax.swing.SwingUtilities; import javax.swing.event.AncestorEvent; @@ -46,11 +48,11 @@ public class DateTableCellEditor extends AbstractCellEditor implements TableCellEditor, FocusListener, AncestorListener { + private static final long serialVersionUID = 1L; + private final JXDatePicker datePicker; + protected String comportmentEditingCell; - private static final long serialVersionUID = 1L; -// private static DateTableCellEditor editor; - //used to tell if the user has pressed a key private Date date; @@ -59,6 +61,7 @@ datePicker = new JXDatePicker(LimaContext.getContext().getConfig().getLocale()); datePicker.getEditor().addFocusListener(this); datePicker.getEditor().addAncestorListener(this); + comportmentEditingCell = LimaConfig.getInstance().getComportmentEditingCell(); } @Override @@ -101,15 +104,30 @@ return !(evt instanceof MouseEvent) || ((MouseEvent) evt).getClickCount() == 2; } - /** Listeners */ + @Override public void focusGained(FocusEvent e) { SwingUtilities.invokeLater(new Runnable() { public void run() { - datePicker.getEditor().selectAll(); + JFormattedTextField dateFormattedTextField = datePicker.getEditor(); + if (comportmentEditingCell.equals("ALL")) { + dateFormattedTextField.selectAll(); + } else { + int textFieldSize = dateFormattedTextField.getText().length(); + dateFormattedTextField.select(textFieldSize, textFieldSize); + } } }); } + /** Listeners */ + /*public void focusGained(FocusEvent e) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + datePicker.getEditor().selectAll(); + } + }); + }*/ + public void focusLost(FocusEvent e) { } Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialperiod/FinancialPeriodTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -32,6 +32,7 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import org.chorem.lima.LimaConfig; import org.chorem.lima.entity.ClosedPeriodicEntryBook; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.ColorHighlighter; @@ -40,6 +41,10 @@ import org.jdesktop.swingx.decorator.Highlighter; import org.jdesktop.swingx.decorator.HighlighterFactory; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; + /** * Financial period table adding color hidhlighter and key management. * @@ -55,6 +60,7 @@ private static final long serialVersionUID = -1960326844433064178L; protected FinancialPeriodViewHandler handler; + protected Color colorSelectionFocus; protected FinancialPeriodTableModel model; @@ -65,6 +71,9 @@ */ public FinancialPeriodTable(FinancialPeriodViewHandler handler) { this.handler = handler; + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); model = handler.view.getFinancialPeriodTableModel(); addKeyListener(this); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementchart/FinancialStatementChartTreeTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -26,8 +26,13 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaConfig; import org.jdesktop.swingx.JXTreeTable; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; +import java.awt.Color; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.MouseEvent; @@ -39,15 +44,16 @@ /** serialVersionUID. */ private static final long serialVersionUID = 3221024449873737253L; - /** log. */ - private static final Log log = LogFactory - .getLog(FinancialStatementChartTreeTable.class); - protected FinancialStatementChartViewHandler handler; + protected Color colorSelectionFocus; public FinancialStatementChartTreeTable(FinancialStatementChartViewHandler handler) { this.handler = handler; + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); + addKeyListener(this); addMouseListener(this); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialstatementreport/FinancialStatementReportTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -25,6 +25,7 @@ package org.chorem.lima.ui.financialstatementreport; +import org.chorem.lima.LimaConfig; import org.chorem.lima.beans.FinancialStatementAmounts; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.ColorHighlighter; @@ -32,6 +33,9 @@ import org.jdesktop.swingx.decorator.HighlightPredicate; import org.jdesktop.swingx.decorator.Highlighter; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; import java.awt.Color; import java.awt.Component; import java.awt.event.KeyEvent; @@ -45,6 +49,7 @@ private static final long serialVersionUID = 154211277688304679L; protected FinancialStatementReportTableModel model; + protected Color colorSelectionFocus; private Highlighter colorTransaction; @@ -54,6 +59,10 @@ public FinancialStatementReportTable(FinancialStatementReportTableModel model) { super(model); + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); + addKeyListener(this); addMouseListener(this); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -26,6 +26,7 @@ package org.chorem.lima.ui.financialtransaction; import org.apache.commons.collections.CollectionUtils; +import org.chorem.lima.LimaConfig; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.Entry; import org.chorem.lima.entity.FinancialTransaction; @@ -70,6 +71,7 @@ private static final long serialVersionUID = 3133690382049594727L; protected FinancialTransactionViewHandler handler; + protected Color colorSelectionFocus; private int x_tab; @@ -78,8 +80,9 @@ public FinancialTransactionTable(FinancialTransactionViewHandler handler) { this.handler = handler; - //Change border of cell focus for a better visibility - UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(new Color(0, 0, 0), 2))); + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); addKeyListener(new MyKeyAdapter()); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionsearch/FinancialTransactionSearchTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -27,6 +27,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaConfig; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.ui.celleditor.AccountTableCellEditor; @@ -41,6 +42,9 @@ import org.jdesktop.swingx.decorator.HighlightPredicate; import org.jdesktop.swingx.decorator.Highlighter; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; import java.awt.Color; import java.awt.Component; import java.awt.event.KeyEvent; @@ -63,11 +67,8 @@ /** serialVersionUID. */ private static final long serialVersionUID = 3133690382049594727L; - /** log. */ - private static final Log log = LogFactory - .getLog(FinancialTransactionSearchTable.class); - protected FinancialTransactionSearchViewHandler handler; + protected Color colorSelectionFocus; private Highlighter colorTransaction; @@ -77,6 +78,10 @@ this.handler = handler; + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); + addKeyListener(this); addMouseListener(this); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransactionunbalanced/FinancialTransactionUnbalancedTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -25,6 +25,7 @@ package org.chorem.lima.ui.financialtransactionunbalanced; +import org.chorem.lima.LimaConfig; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.ui.celleditor.AccountTableCellEditor; @@ -39,6 +40,9 @@ import org.jdesktop.swingx.decorator.HighlightPredicate; import org.jdesktop.swingx.decorator.Highlighter; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; import java.awt.Color; import java.awt.Component; import java.awt.event.KeyEvent; @@ -61,6 +65,7 @@ private static final long serialVersionUID = 3133690382049594727L; protected FinancialTransactionUnbalancedViewHandler handler; + protected Color colorSelectionFocus; private Highlighter colorTransaction; @@ -69,6 +74,9 @@ public FinancialTransactionUnbalancedTable(FinancialTransactionUnbalancedViewHandler handler) { this.handler = handler; + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); addKeyListener(this); addMouseListener(this); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/fiscalperiod/FiscalPeriodTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -25,6 +25,7 @@ package org.chorem.lima.ui.fiscalperiod; +import org.chorem.lima.LimaConfig; import org.chorem.lima.entity.FiscalPeriod; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.ColorHighlighter; @@ -32,6 +33,9 @@ import org.jdesktop.swingx.decorator.HighlightPredicate; import org.jdesktop.swingx.decorator.Highlighter; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; import java.awt.Color; import java.awt.Component; import java.awt.event.KeyEvent; @@ -60,10 +64,14 @@ private static final long serialVersionUID = -8462838870024505659L; protected FiscalPeriodTableModel model; + protected Color colorSelectionFocus; public FiscalPeriodTable(FiscalPeriodTableModel model) { super(model); this.model = model; + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); addKeyListener(this); addMouseListener(this); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/ledger/LedgerTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -25,6 +25,7 @@ package org.chorem.lima.ui.ledger; +import org.chorem.lima.LimaConfig; import org.chorem.lima.ui.celleditor.BigDecimalTableCellRenderer; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.ColorHighlighter; @@ -32,6 +33,9 @@ import org.jdesktop.swingx.decorator.HighlightPredicate; import org.jdesktop.swingx.decorator.Highlighter; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; import java.awt.Color; import java.awt.Component; import java.awt.event.KeyEvent; @@ -53,10 +57,16 @@ private Highlighter colorReportsDatas; + protected Color colorSelectionFocus; + /** */ public LedgerTable() { + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); + addKeyListener(this); addMouseListener(this); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/lettering/LetteringTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -25,6 +25,7 @@ package org.chorem.lima.ui.lettering; +import org.chorem.lima.LimaConfig; import org.chorem.lima.entity.Account; import org.chorem.lima.entity.EntryBook; import org.chorem.lima.ui.celleditor.AccountTableCellEditor; @@ -39,6 +40,10 @@ import javax.swing.JComponent; import javax.swing.JTextField; import javax.swing.KeyStroke; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; +import java.awt.Color; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.math.BigDecimal; @@ -56,10 +61,15 @@ private static final long serialVersionUID = 3133690382049594727L; protected LetteringViewHandler handler; + protected Color colorSelectionFocus; public LetteringTable(LetteringTableModel letteringTableModel) { super(letteringTableModel); + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); + //To block reaction of the dual key 'ctrl+a' (Selection of all lines) InputMap im = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); im.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK), "none"); Modified: trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTable.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTable.java 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/vatchart/VatChartTreeTable.java 2012-07-31 13:37:49 UTC (rev 3555) @@ -26,6 +26,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.chorem.lima.LimaConfig; import org.chorem.lima.entity.VatStatement; import org.jdesktop.swingx.JXTreeTable; import org.jdesktop.swingx.decorator.ColorHighlighter; @@ -34,6 +35,9 @@ import org.jdesktop.swingx.decorator.Highlighter; import org.jdesktop.swingx.treetable.TreeTableModel; +import javax.swing.UIManager; +import javax.swing.border.LineBorder; +import javax.swing.plaf.BorderUIResource; import javax.swing.tree.TreePath; import java.awt.Color; import java.awt.Component; @@ -48,17 +52,18 @@ /** serialVersionUID. */ private static final long serialVersionUID = 3960840343197845825L; - /** log. */ - private static final Log log = LogFactory - .getLog(VatChartTreeTable.class); - protected VatChartViewHandler handler; + protected Color colorSelectionFocus; private Highlighter colorLine; public VatChartTreeTable(VatChartViewHandler handler) { this.handler = handler; + //Change border of cell focus + colorSelectionFocus = LimaConfig.getInstance().getColorSelectionFocus(); + UIManager.put("Table.focusCellHighlightBorder", new BorderUIResource(new LineBorder(colorSelectionFocus, 2))); + addKeyListener(this); addMouseListener(this); 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 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing_en_GB.properties 2012-07-31 13:37:49 UTC (rev 3555) @@ -70,6 +70,8 @@ lima.config.category.directories.description=Directories used by LIMA lima.config.category.other=Other lima.config.category.other.description=Other configuration properties +lima.config.colorselectionfocus=Cadring color of the selection of a cell +lima.config.comportmenteditingcell=Comportment selection of the containing on the edition of a cell lima.config.configFileName.description= lima.config.currency.description= lima.config.data.dir.description= 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 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/lima-swing/src/main/resources/i18n/lima-swing_fr_FR.properties 2012-07-31 13:37:49 UTC (rev 3555) @@ -70,6 +70,8 @@ lima.config.category.directories.description=Répertoires utilisés par Lima lima.config.category.other=Autre lima.config.category.other.description=Autre propriétés de configuration +lima.config.colorselectionfocus=Couleur de l'encadrement de sélection d'une cellule +lima.config.comportmenteditingcell=Comportement de la sélection du contenu lors de l'édition d'une cellule ('ALL' \: sélection de tout le contenu; 'NOTHING' \: aucune sélection) lima.config.configFileName.description= lima.config.currency.description= lima.config.data.dir.description= Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2012-07-30 10:17:08 UTC (rev 3554) +++ trunk/pom.xml 2012-07-31 13:37:49 UTC (rev 3555) @@ -342,10 +342,10 @@ <projectId>lima</projectId> <!-- customized libs version --> - <nuitonUtilsVersion>2.5.1</nuitonUtilsVersion> + <nuitonUtilsVersion>2.5.2-SNAPSHOT</nuitonUtilsVersion> <eugenePluginVersion>2.4.2</eugenePluginVersion> <topiaVersion>2.6.11</topiaVersion> - <jaxxVersion>2.5.1</jaxxVersion> + <jaxxVersion>2.5.3-SNAPSHOT</jaxxVersion> <nuitonI18nVersion>2.4.1</nuitonI18nVersion> <openEjbVersion>4.0.0</openEjbVersion> <slf4jVersion>1.6.6</slf4jVersion>
participants (1)
-
mallon@users.chorem.org