OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 182
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 78... Line 78...
78
 
78
 
79
            @Override
79
            @Override
80
            public void paintCell(Graphics g, Object object, int index, boolean isSelected, int posY) {
80
            public void paintCell(Graphics g, Object object, int index, boolean isSelected, int posY) {
81
                if (object instanceof Article) {
81
                if (object instanceof Article) {
82
                    Article article = (Article) object;
82
                    Article article = (Article) object;
83
                    ArticleSelector.paintArticle(f1, g, article, isSelected, posY, this.getWidth(), this.getCellHeight(), 36, 10);
83
                    ArticleSelector.paintArticle(f1, g, article, isSelected, posY, this.getWidth(), this.getCellHeight(), 36, 10, true);
84
                    if (Categorie.getFavoriteProducts().contains(article)) {
84
                    if (Categorie.getFavoriteProducts().contains(article)) {
85
                        g.setColor(Color.ORANGE);
85
                        g.setColor(Color.ORANGE);
86
                        g.fillRect(0, posY, 6, this.getCellHeight());
86
                        g.fillRect(0, posY, 6, this.getCellHeight());
87
                    }
87
                    }
88
                } else if (object instanceof Categorie) {
88
                } else if (object instanceof Categorie) {
Line 97... Line 97...
97
                if ((event.getModifiers() & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) {
97
                if ((event.getModifiers() & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) {
98
                    final Object obj = getSelectedValue();
98
                    final Object obj = getSelectedValue();
99
                    if (obj instanceof Article) {
99
                    if (obj instanceof Article) {
100
                        Article product = (Article) obj;
100
                        Article product = (Article) obj;
101
                        Categorie.toggleFavoriteState(product);
101
                        Categorie.toggleFavoriteState(product);
102
                        controler.saveFavoriteProductsIds(Categorie.getFavoriteProducts());
102
                        controler.getCaisseFrame().mainPanel.saveFavoriteProductsIds(Categorie.getFavoriteProducts());
103
                        model.setFilter(ArticleSearchPanel.this.textField.getText());
103
                        model.setFilter(ArticleSearchPanel.this.textField.getText());
104
                        ArticleSearchPanel.this.list.scrollToOffset(0);
104
                        ArticleSearchPanel.this.list.scrollToOffset(0);
105
                    }
105
                    }
106
                } else {
106
                } else {
107
                    super.mouseReleased(event);
107
                    super.mouseReleased(event);