Revision 47426 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretype/FeatureAttributeTreeCellRenderer.java

View differences:

FeatureAttributeTreeCellRenderer.java
3 3
import java.awt.Component;
4 4
import java.awt.FlowLayout;
5 5
import javax.swing.Icon;
6
import javax.swing.ImageIcon;
6 7
import javax.swing.JLabel;
7 8
import javax.swing.JPanel;
8 9
import javax.swing.JTree;
......
10 11
import javax.swing.tree.DefaultTreeCellRenderer;
11 12
import javax.swing.tree.TreeCellRenderer;
12 13
import org.apache.commons.lang3.StringUtils;
14
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
13 15
import org.gvsig.fmap.dal.swing.impl.featuretype.FeatureAttributeTreeModel.Node;
14 16
import org.gvsig.tools.swing.api.CompoundIcon;
15 17
import org.gvsig.tools.swing.api.ToolsSwingLocator;
......
31 33
//    private final JLabel icon;
32 34
//    private final DefaultTreeCellRenderer label;
33 35
    private final IconTheme iconTheme;
36
    private final ImageIcon iconColumnQueryCalculated;
37
    private final ImageIcon iconColumnTableCalculated;
34 38
    
35 39
    public FeatureAttributeTreeCellRenderer() {
36 40
        this.iconTheme = ToolsSwingLocator.getIconThemeManager().getCurrent();
37 41
        this.iconTable = iconTheme.get("featurestore-table");
38 42
        this.iconColumn = iconTheme.get("featurestore-column");
43
        this.iconColumnTableCalculated = iconTheme.get("featurestore-calculated-column");
44
        this.iconColumnQueryCalculated = iconTheme.get("featurestore-query-calculated-column");
39 45
        this.iconForeingKey = iconTheme.get("featurestore-foreing-key");
40 46
        
41 47
//        this.panel = new JPanel();
......
56 62
            return theLabel;
57 63
        }
58 64
        Node node = (Node) value;
59
        Icon iconElement = node.isRoot()? this.iconTable: leaf? this.iconColumn: this.iconForeingKey;
65
        FeatureAttributeDescriptor attrdesc = node.getValue();
66
        Icon iconElement;
67
        if( node.isRoot() ) {
68
           iconElement = this.iconTable;
69
        } else if( attrdesc == null ) {
70
           iconElement = leaf? this.iconColumn: this.iconForeingKey;
71
        } else if( attrdesc.isForeingKey() ) {
72
           iconElement = this.iconForeingKey;            
73
        } else if( attrdesc.isComputed() ) {
74
            iconElement = (attrdesc.getStore()==null)? this.iconColumnQueryCalculated: this.iconColumnTableCalculated;
75
        } else {
76
           iconElement = iconColumn;
77
        }
78
//        Icon iconElement = node.isRoot()? this.iconTable: leaf? this.iconColumn: this.iconForeingKey;
60 79
        Icon iconDataType = null;
61 80
        try {
62 81
            if( !node.isRoot() ) {

Also available in: Unified diff