Ignore:
Timestamp:
2011-06-24T23:13:02+02:00 (13 years ago)
Author:
stoecker
Message:

fix #4140 - make colors in conflict dialog configurable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRenderer.java

    r4072 r4162  
    1717import org.openstreetmap.josm.data.osm.RelationMember;
    1818import org.openstreetmap.josm.gui.DefaultNameFormatter;
     19import org.openstreetmap.josm.gui.conflict.ConflictColors;
    1920import org.openstreetmap.josm.gui.conflict.pair.ListMergeModel;
    2021import org.openstreetmap.josm.tools.ImageProvider;
     
    2526 */
    2627public  class RelationMemberTableCellRenderer extends JLabel implements TableCellRenderer {
    27     public final static Color BGCOLOR_SELECTED = new Color(143,170,255);
    28     public final static Color BGCOLOR_EMPTY_ROW = new Color(234,234,234);
    29 
    30     public final static Color BGCOLOR_NOT_IN_OPPOSITE = new Color(255,197,197);
    31     public final static Color BGCOLOR_IN_OPPOSITE = new Color(255,234,213);
    32     public final static Color BGCOLOR_SAME_POSITION_IN_OPPOSITE = new Color(217,255,217);
    33 
    34     public final static Color BGCOLOR_PARTICIPAING_IN_COMPARISON = Color.BLACK;
    35     public final static Color FGCOLOR_PARTICIPAING_IN_COMPARISON = Color.WHITE;
    36 
    37     public final static Color BGCOLOR_FROZEN = new Color(234,234,234);
    38 
    3928    private  Border rowNumberBorder = null;
    4029
     
    8473     */
    8574    protected void reset() {
    86         setBackground(Color.WHITE);
    87         setForeground(Color.BLACK);
     75        setBackground(ConflictColors.BGCOLOR.get());
     76        setForeground(ConflictColors.FGCOLOR.get());
    8877        setBorder(null);
    8978        setIcon(null);
     
    9281
    9382    protected void renderBackground(ListMergeModel<Node>.EntriesTableModel model, RelationMember member, int row, int col, boolean isSelected) {
    94         Color bgc = Color.WHITE;
     83        Color bgc = ConflictColors.BGCOLOR.get();
    9584        if (col == 0) {
    9685            if (model.getListMergeModel().isFrozen()) {
    97                 bgc = BGCOLOR_FROZEN;
     86                bgc = ConflictColors.BGCOLOR_FROZEN.get();
    9887            } else if (model.isParticipatingInCurrentComparePair()) {
    99                 bgc = BGCOLOR_PARTICIPAING_IN_COMPARISON;
     88                bgc = ConflictColors.BGCOLOR_PARTICIPAING_IN_COMPARISON.get();
    10089            } else if (isSelected) {
    101                 bgc = BGCOLOR_SELECTED;
     90                bgc = ConflictColors.BGCOLOR_SELECTED.get();
    10291            }
    10392        } else {
    10493            if (model.getListMergeModel().isFrozen()) {
    105                 bgc = BGCOLOR_FROZEN;
     94                bgc = ConflictColors.BGCOLOR_FROZEN.get();
    10695            } else if (member == null) {
    107                 bgc = BGCOLOR_EMPTY_ROW;
     96                bgc = ConflictColors.BGCOLOR_EMPTY_ROW.get();
    10897            } else if (isSelected) {
    109                 bgc = BGCOLOR_SELECTED;
     98                bgc = ConflictColors.BGCOLOR_SELECTED.get();
    11099            } else {
    111100                if (model.isParticipatingInCurrentComparePair()) {
    112101                    if (model.isSamePositionInOppositeList(row)) {
    113                         bgc = BGCOLOR_SAME_POSITION_IN_OPPOSITE;
     102                        bgc = ConflictColors.BGCOLOR_SAME_POSITION_IN_OPPOSITE.get();
    114103                    } else if (model.isIncludedInOppositeList(row)) {
    115                         bgc = BGCOLOR_IN_OPPOSITE;
     104                        bgc = ConflictColors.BGCOLOR_IN_OPPOSITE.get();
    116105                    } else {
    117                         bgc = BGCOLOR_NOT_IN_OPPOSITE;
     106                        bgc = ConflictColors.BGCOLOR_NOT_IN_OPPOSITE.get();
    118107                    }
    119108                }
     
    124113
    125114    protected void renderForeground(ListMergeModel<Node>.EntriesTableModel model, RelationMember member, int row, int col, boolean isSelected) {
    126         Color fgc = Color.BLACK;
     115        Color fgc = ConflictColors.FGCOLOR.get();
    127116        if (col == 0 && model.isParticipatingInCurrentComparePair() && ! model.getListMergeModel().isFrozen()) {
    128             fgc = Color.WHITE;
     117            fgc = ConflictColors.FGCOLOR_PARTICIPAING_IN_COMPARISON.get();
    129118        }
    130119        setForeground(fgc);
     
    155144    protected void renderEmptyRow() {
    156145        setIcon(null);
    157         setBackground(BGCOLOR_EMPTY_ROW);
     146        setBackground(ConflictColors.BGCOLOR_EMPTY_ROW.get());
    158147        setText("");
    159148    }
Note: See TracChangeset for help on using the changeset viewer.