OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
94 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
182 ilm 4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
94 ilm 5
 *
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
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.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
132 ilm 14
 package org.openconcerto.ui.light;
94 ilm 15
 
132 ilm 16
import java.awt.Color;
17
 
94 ilm 18
public class InformationLine extends LightUILine {
156 ilm 19
    private LightUILabel keyElement;
20
    private LightUILabel valueElement;
132 ilm 21
 
156 ilm 22
    public InformationLine() {
23
        // Serialization
24
    }
25
 
132 ilm 26
    public InformationLine(final String key, final String value) {
27
        super();
94 ilm 28
        this.setGridAlignment(ALIGN_GRID);
132 ilm 29
        this.keyElement = new LightUILabel("label.key" + key.replace(" ", ".").toLowerCase(), key, true);
30
        this.keyElement.setHorizontalAlignement(LightUIElement.HALIGN_RIGHT);
31
        this.addChild(this.keyElement);
94 ilm 32
 
132 ilm 33
        this.valueElement = new LightUILabel("label.value." + key.replace(" ", ".").toLowerCase(), value);
34
        this.valueElement.setHorizontalAlignement(LightUIElement.HALIGN_LEFT);
35
        this.valueElement.setWeightX(1);
36
        this.addChild(this.valueElement);
37
 
38
        setElementPadding(5);
94 ilm 39
    }
132 ilm 40
 
41
    public void setItalicOnValue(boolean b) {
42
        this.valueElement.setFontItalic(b);
43
    }
44
 
45
    public void setLabelColor(Color c) {
46
        this.keyElement.setForeColor(c);
47
    }
48
 
49
    public void setValueColor(Color c) {
50
        this.valueElement.setForeColor(c);
51
    }
94 ilm 52
}