Changeset 20197 in osm for applications/editors/josm


Ignore:
Timestamp:
2010-02-28T07:51:34+01:00 (14 years ago)
Author:
guggis
Message:

'Fixed rendering of background color for selected cells'

Location:
applications/editors/josm/plugins/tageditor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/tageditor/build.xml

    r20079 r20197  
    2828
    2929
    30         <property name="commit.message" value="Tageditor: fixed josm bug 2416" />
     30        <property name="commit.message" value="Fixed rendering of background color for selected cells" />
    3131        <property name="plugin.main.version" value="3015" />
    3232
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellRenderer.java

    r20058 r20197  
    120120         * @param model the tag editor model
    121121         */
    122         protected void renderBackgroundColor(TagModel tagModel, TagEditorModel model) {
    123                 setBackground(UIManager.getColor("Table.background"));
     122        protected void renderColor(TagModel tagModel, TagEditorModel model, boolean isSelected) {
     123                if (isSelected){
     124                        setBackground(UIManager.getColor("Table.selectionBackground"));
     125                        setForeground(UIManager.getColor("Table.selectionForeground"));
     126                } else {
     127                        setBackground(UIManager.getColor("Table.background"));
     128                        setForeground(UIManager.getColor("Table.foreground"));
     129                }               
    124130                if (belongsToSelectedPreset(tagModel, model)) {
    125131                        setBackground(BG_COLOR_HIGHLIGHTED);
     
    143149               
    144150                resetRenderer();
    145                
    146                 // set background color
    147                 //
    148                 if (isSelected){
    149                         setBackground(UIManager.getColor("Table.selectionBackground"));
    150                         setForeground(UIManager.getColor("Table.selectionForeground"));
    151                 } else {
    152                         setBackground(UIManager.getColor("Table.background"));
    153                         setForeground(UIManager.getColor("Table.foreground"));
    154                 }
    155 
    156151                TagModel tagModel  = (TagModel)value;
    157152                switch(vColIndex) {
     
    159154                        case 1: renderTagValue(tagModel); break;
    160155                }
    161                 renderBackgroundColor(tagModel, (TagEditorModel)table.getModel());
     156                renderColor(tagModel, (TagEditorModel)table.getModel(),isSelected);
    162157                if (hasFocus && isSelected) {
    163158                        if (table.getSelectedColumnCount() == 1 && table.getSelectedRowCount() == 1) {
Note: See TracChangeset for help on using the changeset viewer.