This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 134281
Collapse All | Expand All

(-)a/cnd.completion/nbproject/project.xml (+8 lines)
Lines 173-178 Link Here
173
                    </run-dependency>
173
                    </run-dependency>
174
                </dependency>
174
                </dependency>
175
                <dependency>
175
                <dependency>
176
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
177
                    <build-prerequisite/>
178
                    <compile-dependency/>
179
                    <run-dependency>
180
                        <specification-version>1.27</specification-version>
181
                    </run-dependency>
182
                </dependency>
183
                <dependency>
176
                    <code-name-base>org.openide.awt</code-name-base>
184
                    <code-name-base>org.openide.awt</code-name-base>
177
                    <build-prerequisite/>
185
                    <build-prerequisite/>
178
                    <compile-dependency/>
186
                    <compile-dependency/>
(-)a/cnd.completion/src/org/netbeans/modules/cnd/completion/cplusplus/ext/CsmResultItem.java (-6 / +5 lines)
Lines 103-109 Link Here
103
import org.netbeans.spi.editor.completion.CompletionItem;
103
import org.netbeans.spi.editor.completion.CompletionItem;
104
import org.netbeans.spi.editor.completion.CompletionTask;
104
import org.netbeans.spi.editor.completion.CompletionTask;
105
import org.openide.util.Lookup;
105
import org.openide.util.Lookup;
106
106
import org.netbeans.swing.plaf.LFCustoms;
107
/**
107
/**
108
 *
108
 *
109
 * @author  Vladimir Voskresensky
109
 * @author  Vladimir Voskresensky
Lines 122-129 Link Here
122
    protected int selectionEndOffset = -1;
122
    protected int selectionEndOffset = -1;
123
    protected int substituteOffset = -1;
123
    protected int substituteOffset = -1;
124
    CsmObject associatedObject;
124
    CsmObject associatedObject;
125
    private static final Color KEYWORD_COLOR = Color.gray;
125
    private static final Color KEYWORD_COLOR = Color.lightGray;
126
    private static final Color TYPE_COLOR = Color.black;
127
    private int priority;
126
    private int priority;
128
    private SubstitutionHint hint;
127
    private SubstitutionHint hint;
129
128
Lines 147-153 Link Here
147
    }
146
    }
148
    
147
    
149
    protected static Color getTypeColor(CsmType type) {
148
    protected static Color getTypeColor(CsmType type) {
150
        return type.isBuiltInBased(false) ? KEYWORD_COLOR : TYPE_COLOR;
149
        return type.isBuiltInBased(false) ? LFCustoms.shiftColor(KEYWORD_COLOR) : LFCustoms.getTextFgColor();
151
    }
150
    }
152
151
153
    public void setSubstituteOffset(int substituteOffset) {
152
    public void setSubstituteOffset(int substituteOffset) {
Lines 981-991 Link Here
981
                if (type == null) {
980
                if (type == null) {
982
                    // only var args parameters could have null types
981
                    // only var args parameters could have null types
983
                    assert (((CsmParameter) prm).isVarArgs()) : " non var arg " + prm + " of class " + prm.getClass().getName();
982
                    assert (((CsmParameter) prm).isVarArgs()) : " non var arg " + prm + " of class " + prm.getClass().getName();
984
                    params.add(new ParamStr("", "", ((CsmParameter) prm).getName().toString(), prm.getText().toString(), true, KEYWORD_COLOR)); //NOI18N
983
                    params.add(new ParamStr("", "", ((CsmParameter) prm).getName().toString(), prm.getText().toString(), true, LFCustoms.shiftColor(KEYWORD_COLOR))); //NOI18N
985
                    varArgIndex = i;
984
                    varArgIndex = i;
986
                } else {
985
                } else {
987
                    String typeName = getTypeName(type, instantiateTypes);
986
                    String typeName = getTypeName(type, instantiateTypes);
988
                    params.add(new ParamStr(typeName, typeName, ((CsmParameter) prm).getName().toString(), prm.getText().toString(), false, TYPE_COLOR /*getTypeColor(type.getClassifier())*/));
987
                    params.add(new ParamStr(typeName, typeName, ((CsmParameter) prm).getName().toString(), prm.getText().toString(), false, LFCustoms.getTextFgColor() /*getTypeColor(type.getClassifier())*/));
989
                }
988
                }
990
                i++;
989
                i++;
991
            }
990
            }
(-)a/cnd.modelutil/nbproject/project.xml (+8 lines)
Lines 86-91 Link Here
86
                    </run-dependency>
86
                    </run-dependency>
87
                </dependency>
87
                </dependency>
88
                <dependency>
88
                <dependency>
89
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
90
                    <build-prerequisite/>
91
                    <compile-dependency/>
92
                    <run-dependency>
93
                        <specification-version>1.27</specification-version>
94
                    </run-dependency>
95
                </dependency>
96
                <dependency>
89
                    <code-name-base>org.openide.awt</code-name-base>
97
                    <code-name-base>org.openide.awt</code-name-base>
90
                    <build-prerequisite/>
98
                    <build-prerequisite/>
91
                    <compile-dependency/>
99
                    <compile-dependency/>
(-)a/cnd.modelutil/src/org/netbeans/modules/cnd/modelutil/CsmDisplayUtilities.java (-1 / +2 lines)
Lines 89-94 Link Here
89
import org.openide.text.CloneableEditorSupport;
89
import org.openide.text.CloneableEditorSupport;
90
import org.openide.util.Lookup;
90
import org.openide.util.Lookup;
91
import org.openide.util.NbBundle;
91
import org.openide.util.NbBundle;
92
import org.netbeans.swing.plaf.LFCustoms;
92
93
93
/**
94
/**
94
 *
95
 *
Lines 405-411 Link Here
405
            buf.insert(0, "<s>"); // NOI18N
406
            buf.insert(0, "<s>"); // NOI18N
406
            buf.append("</s>"); // NOI18N
407
            buf.append("</s>"); // NOI18N
407
        }
408
        }
408
        buf.insert(0, "<font color=" + getHTMLColor(StyleConstants.getForeground(set)) + ">"); //NOI18N
409
        buf.insert(0, "<font color=" + getHTMLColor(LFCustoms.getForeground(set)) + ">"); //NOI18N
409
        buf.append("</font>"); //NOI18N
410
        buf.append("</font>"); //NOI18N
410
        return buf.toString();
411
        return buf.toString();
411
    }
412
    }
(-)a/cnd.modelutil/src/org/netbeans/modules/cnd/modelutil/CsmPaintComponent.java (-31 / +31 lines)
Lines 63-69 Link Here
63
import javax.swing.BorderFactory;
63
import javax.swing.BorderFactory;
64
import javax.swing.Icon;
64
import javax.swing.Icon;
65
import javax.swing.JPanel;
65
import javax.swing.JPanel;
66
66
import org.netbeans.swing.plaf.LFCustoms;
67
67
68
/**
68
/**
69
 *
69
 *
Lines 101-109 Link Here
101
        "", " ", "[]", "(", ")", ", ", "String", THROWS // NOI18N
101
        "", " ", "[]", "(", ")", ", ", "String", THROWS // NOI18N
102
    };
102
    };
103
    
103
    
104
    private static final Color KEYWORD_COLOR = Color.darkGray;
104
    private final static Color KEYWORD_COLOR = Color.gray;
105
    private static final Color TYPE_COLOR = Color.black;
105
    private final static Color POSTFIX_COLOR = Color.lightGray;
106
    private static final Color POSTFIX_COLOR = Color.gray;
107
    
106
    
108
    private Icon icon;
107
    private Icon icon;
109
    
108
    
Lines 128-148 Link Here
128
    @Override
127
    @Override
129
    public void paintComponent(Graphics g) {
128
    public void paintComponent(Graphics g) {
130
        // clear background
129
        // clear background
130
        Color postfixColor = LFCustoms.shiftColor(POSTFIX_COLOR);
131
        g.setColor(getBackground());
131
        g.setColor(getBackground());
132
        java.awt.Rectangle r = g.getClipBounds();
132
        java.awt.Rectangle r = g.getClipBounds();
133
        g.fillRect(r.x, r.y, r.width, r.height);
133
        g.fillRect(r.x, r.y, r.width, r.height);
134
        draw(g);
134
        draw(g);
135
        
135
        
136
        if(!postfixes.isEmpty()) {
136
        if(!postfixes.isEmpty()) {
137
            drawString(g, " (", POSTFIX_COLOR); // NOI18N
137
            drawString(g, " (", postfixColor); // NOI18N
138
            Iterator iter = postfixes.iterator();
138
            Iterator iter = postfixes.iterator();
139
            while(iter.hasNext()) {
139
            while(iter.hasNext()) {
140
                ((PostfixString) iter.next()).Draw(g);
140
                ((PostfixString) iter.next()).Draw(g);
141
                if(iter.hasNext()) {
141
                if(iter.hasNext()) {
142
                    drawString(g, ",  ", POSTFIX_COLOR); // NOI18N
142
                    drawString(g, ",  ", postfixColor); // NOI18N
143
                }
143
                }
144
            } 
144
            } 
145
            drawString(g, ")", POSTFIX_COLOR); // NOI18N
145
            drawString(g, ")", postfixColor); // NOI18N
146
        }        
146
        }        
147
    }
147
    }
148
    
148
    
Lines 372-378 Link Here
372
        }
372
        }
373
        
373
        
374
        public PostfixString(String text, int fontStyle) {
374
        public PostfixString(String text, int fontStyle) {
375
            this(text, CsmPaintComponent.POSTFIX_COLOR, fontStyle);            
375
            this(text, LFCustoms.shiftColor(CsmPaintComponent.POSTFIX_COLOR), fontStyle);
376
        }
376
        }
377
        
377
        
378
        void Draw(Graphics g) {            
378
        void Draw(Graphics g) {            
Lines 397-403 Link Here
397
397
398
        private String pkgName;
398
        private String pkgName;
399
        private boolean displayFullNamespacePath;
399
        private boolean displayFullNamespacePath;
400
        private Color NAMESPACE_COLOR = Color.green.darker().darker().darker();
400
        private Color NAMESPACE_COLOR = LFCustoms.shiftColor(new Color(64,255,64));
401
        
401
        
402
        public NamespacePaintComponent(){
402
        public NamespacePaintComponent(){
403
            super();
403
            super();
Lines 436-442 Link Here
436
    public static class NamespaceAliasPaintComponent extends CsmPaintComponent{
436
    public static class NamespaceAliasPaintComponent extends CsmPaintComponent{
437
437
438
        private String aliasName;
438
        private String aliasName;
439
        private Color NAMESPACE_COLOR = Color.green.darker().darker().darker();
439
        private Color NAMESPACE_COLOR = LFCustoms.shiftColor(new Color(64,255,64));
440
        
440
        
441
        public NamespaceAliasPaintComponent(){
441
        public NamespaceAliasPaintComponent(){
442
            super();
442
            super();
Lines 467-473 Link Here
467
    public static class EnumPaintComponent extends CsmPaintComponent {
467
    public static class EnumPaintComponent extends CsmPaintComponent {
468
        
468
        
469
        String formatEnumName;
469
        String formatEnumName;
470
        private Color ENUM_COLOR = Color.red.darker().darker().darker().darker();
470
        private Color ENUM_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
471
        private boolean displayFQN;
471
        private boolean displayFQN;
472
        
472
        
473
        public void EnumPaintComponent(String formatEnumName){
473
        public void EnumPaintComponent(String formatEnumName){
Lines 504-510 Link Here
504
    public static class EnumeratorPaintComponent extends CsmPaintComponent {
504
    public static class EnumeratorPaintComponent extends CsmPaintComponent {
505
        
505
        
506
        String formatEnumeratorName;
506
        String formatEnumeratorName;
507
        private Color ENUMERATOR_COLOR = Color.blue.darker().darker().darker().darker();
507
        private Color ENUMERATOR_COLOR = LFCustoms.shiftColor(new Color(64,64,255));
508
        private boolean displayFQN;
508
        private boolean displayFQN;
509
        
509
        
510
        public void EnumeratorPaintComponent(String formatEnumeratorName){
510
        public void EnumeratorPaintComponent(String formatEnumeratorName){
Lines 542-548 Link Here
542
    public static class ClassPaintComponent extends CsmPaintComponent{
542
    public static class ClassPaintComponent extends CsmPaintComponent{
543
        
543
        
544
        String formatClassName;
544
        String formatClassName;
545
        private Color CLASS_COLOR = Color.red.darker().darker().darker();
545
        private Color CLASS_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
546
        private boolean displayFQN;
546
        private boolean displayFQN;
547
        
547
        
548
        public void setFormatClassName(String formatClassName){
548
        public void setFormatClassName(String formatClassName){
Lines 576-582 Link Here
576
    public static class TypedefPaintComponent extends CsmPaintComponent{
576
    public static class TypedefPaintComponent extends CsmPaintComponent{
577
        
577
        
578
        String formatTypedefName;
578
        String formatTypedefName;
579
        private final Color TYPEDEF_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.TYPEDEF); //Color.blue.darker().darker().darker();
579
        private final Color TYPEDEF_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.TYPEDEF); //new Color(64,64,255).darker().darker().darker();
580
        //private boolean displayFQN;
580
        //private boolean displayFQN;
581
        
581
        
582
        public void setFormatTypedefName(String formatTypedefName){
582
        public void setFormatTypedefName(String formatTypedefName){
Lines 609-615 Link Here
609
609
610
    public static class StructPaintComponent extends ClassPaintComponent{
610
    public static class StructPaintComponent extends ClassPaintComponent{
611
        
611
        
612
        private Color STRUCT_COLOR = Color.red.darker().darker();
612
        private Color STRUCT_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
613
        
613
        
614
        @Override
614
        @Override
615
        protected Color getColor(){
615
        protected Color getColor(){
Lines 623-629 Link Here
623
    
623
    
624
    public static class UnionPaintComponent extends ClassPaintComponent{
624
    public static class UnionPaintComponent extends ClassPaintComponent{
625
        
625
        
626
        private Color UNION_COLOR = Color.red.darker();
626
        private Color UNION_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
627
        
627
        
628
        @Override
628
        @Override
629
        protected Color getColor(){
629
        protected Color getColor(){
Lines 636-642 Link Here
636
    }
636
    }
637
    
637
    
638
    public static class FieldPaintComponent extends CsmPaintComponent{
638
    public static class FieldPaintComponent extends CsmPaintComponent{
639
        private Color FIELD_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.CLASS_FIELD);//Color.blue.darker();
639
        private Color FIELD_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.CLASS_FIELD);//new Color(64,64,255).darker();
640
        protected String typeName;
640
        protected String typeName;
641
        protected Color typeColor;
641
        protected Color typeColor;
642
        protected String fldName;
642
        protected String fldName;
Lines 720-726 Link Here
720
    }
720
    }
721
    
721
    
722
    public static class LocalVariablePaintComponent extends FieldPaintComponent {
722
    public static class LocalVariablePaintComponent extends FieldPaintComponent {
723
        private Color VARIABLE_COLOR = Color.red.darker().darker().darker();
723
        private Color VARIABLE_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
724
        
724
        
725
        public LocalVariablePaintComponent(){
725
        public LocalVariablePaintComponent(){
726
            super();
726
            super();
Lines 739-745 Link Here
739
    }
739
    }
740
    
740
    
741
    public static class FileLocalVariablePaintComponent extends FieldPaintComponent {
741
    public static class FileLocalVariablePaintComponent extends FieldPaintComponent {
742
        private Color VARIABLE_COLOR = Color.blue.darker().darker().darker();
742
        private Color VARIABLE_COLOR = LFCustoms.shiftColor(new Color(64,64,255));
743
        
743
        
744
        public FileLocalVariablePaintComponent(){
744
        public FileLocalVariablePaintComponent(){
745
            super();
745
            super();
Lines 752-758 Link Here
752
    }
752
    }
753
    
753
    
754
    public static class GlobalVariablePaintComponent extends FieldPaintComponent {
754
    public static class GlobalVariablePaintComponent extends FieldPaintComponent {
755
        private Color VARIABLE_COLOR = Color.blue.darker().darker().darker();
755
        private Color VARIABLE_COLOR = LFCustoms.shiftColor(new Color(64,64,255));
756
        
756
        
757
        public GlobalVariablePaintComponent(){
757
        public GlobalVariablePaintComponent(){
758
            super();
758
            super();
Lines 765-772 Link Here
765
    }
765
    }
766
    
766
    
767
    public static class MacroPaintComponent extends CsmPaintComponent{
767
    public static class MacroPaintComponent extends CsmPaintComponent{
768
        private Color MACRO_NAME_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.DEFINED_MACRO);//Color.green.darker().darker();
768
        private Color MACRO_NAME_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.DEFINED_MACRO);//new Color(64,255,64).darker().darker();
769
        private Color MACRO_PARAMETER_NAME_COLOR = new Color(163, 102, 10);//Color.magenta.darker();
769
        private Color MACRO_PARAMETER_NAME_COLOR = LFCustoms.shiftColor(new Color(227, 166, 74));//Color.magenta.darker();
770
        private List params = null;
770
        private List params = null;
771
        private String name;
771
        private String name;
772
772
Lines 848-854 Link Here
848
    }
848
    }
849
    
849
    
850
    public static class TemplateParameterPaintComponent extends CsmPaintComponent{
850
    public static class TemplateParameterPaintComponent extends CsmPaintComponent{
851
        private Color PARAMETER_NAME_COLOR = Color.BLACK.darker().darker();
851
        private Color PARAMETER_NAME_COLOR = LFCustoms.getTextFgColor();
852
        private List params = null;
852
        private List params = null;
853
        private String name;
853
        private String name;
854
854
Lines 897-903 Link Here
897
    }
897
    }
898
898
899
    public static class LabelPaintComponent extends  CsmPaintComponent {
899
    public static class LabelPaintComponent extends  CsmPaintComponent {
900
        private Color LABEL_NAME_COLOR = Color.BLACK.darker().darker();
900
        private Color LABEL_NAME_COLOR = LFCustoms.getTextFgColor();
901
        private List params = null;
901
        private List params = null;
902
        private String name;
902
        private String name;
903
903
Lines 947-954 Link Here
947
    
947
    
948
    public static class ConstructorPaintComponent extends CsmPaintComponent{
948
    public static class ConstructorPaintComponent extends CsmPaintComponent{
949
        
949
        
950
        private Color CONSTRUCTOR_COLOR = Color.orange.darker().darker();
950
        private Color CONSTRUCTOR_COLOR = LFCustoms.shiftColor(Color.orange);
951
        private Color PARAMETER_NAME_COLOR = new Color(163, 102, 10);//Color.magenta.darker();
951
        private Color PARAMETER_NAME_COLOR = LFCustoms.shiftColor(new Color(227, 166, 74));//Color.magenta.darker();
952
        private List params = new ArrayList();
952
        private List params = new ArrayList();
953
        private List excs = new ArrayList();
953
        private List excs = new ArrayList();
954
        private String name;
954
        private String name;
Lines 1028-1034 Link Here
1028
        
1028
        
1029
        protected void drawExceptions(Graphics g, List exc, boolean strike) {
1029
        protected void drawExceptions(Graphics g, List exc, boolean strike) {
1030
            if (exc.size() > 0) {
1030
            if (exc.size() > 0) {
1031
                drawString(g, THROWS, KEYWORD_COLOR, null, strike);
1031
                drawString(g, THROWS, LFCustoms.shiftColor(KEYWORD_COLOR), null, strike);
1032
                for (Iterator it = exc.iterator(); it.hasNext();) {
1032
                for (Iterator it = exc.iterator(); it.hasNext();) {
1033
                    ExceptionStr ex = (ExceptionStr) it.next();
1033
                    ExceptionStr ex = (ExceptionStr) it.next();
1034
                    drawString(g, ex.getName(), ex.getTypeColor(), null, strike);
1034
                    drawString(g, ex.getName(), ex.getTypeColor(), null, strike);
Lines 1105-1111 Link Here
1105
    public static class MethodPaintComponent extends ConstructorPaintComponent {
1105
    public static class MethodPaintComponent extends ConstructorPaintComponent {
1106
        
1106
        
1107
        //private Color PARAMETER_NAME_COLOR = Color.magenta.darker();
1107
        //private Color PARAMETER_NAME_COLOR = Color.magenta.darker();
1108
        private Color METHOD_COLOR = Color.black;//red.darker().darker();
1108
        private Color METHOD_COLOR = LFCustoms.getTextFgColor();
1109
        private String typeName;
1109
        private String typeName;
1110
        private Color typeColor;
1110
        private Color typeColor;
1111
        private boolean drawTypeAsPrefix = false;
1111
        private boolean drawTypeAsPrefix = false;
Lines 1190-1196 Link Here
1190
    }
1190
    }
1191
1191
1192
    public static class FileLocalFunctionPaintComponent extends MethodPaintComponent {
1192
    public static class FileLocalFunctionPaintComponent extends MethodPaintComponent {
1193
        private Color FUN_COLOR = Color.black;//red.darker().darker();
1193
        private Color FUN_COLOR = LFCustoms.getTextFgColor();
1194
        
1194
        
1195
        public FileLocalFunctionPaintComponent(){
1195
        public FileLocalFunctionPaintComponent(){
1196
            super();
1196
            super();
Lines 1203-1209 Link Here
1203
    }
1203
    }
1204
    
1204
    
1205
    public static class GlobalFunctionPaintComponent extends MethodPaintComponent {
1205
    public static class GlobalFunctionPaintComponent extends MethodPaintComponent {
1206
        private Color FUN_COLOR = Color.black;//.red.darker().darker();
1206
        private Color FUN_COLOR = LFCustoms.getTextFgColor();
1207
        
1207
        
1208
        public GlobalFunctionPaintComponent(){
1208
        public GlobalFunctionPaintComponent(){
1209
            super();
1209
            super();
Lines 1277-1283 Link Here
1277
        @Override
1277
        @Override
1278
        protected void draw(Graphics g){
1278
        protected void draw(Graphics g){
1279
            drawIcon(g, null);
1279
            drawIcon(g, null);
1280
            drawString(g, str, TYPE_COLOR);
1280
            drawString(g, str, LFCustoms.getTextFgColor());
1281
        }
1281
        }
1282
1282
1283
        @Override
1283
        @Override
(-)a/core.output2/nbproject/project.xml (+8 lines)
Lines 50-55 Link Here
50
            <code-name-base>org.netbeans.core.output2</code-name-base>
50
            <code-name-base>org.netbeans.core.output2</code-name-base>
51
            <module-dependencies>
51
            <module-dependencies>
52
                <dependency>
52
                <dependency>
53
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
54
                    <build-prerequisite/>
55
                    <compile-dependency/>
56
                    <run-dependency>
57
                        <specification-version>1.27</specification-version>
58
                    </run-dependency>
59
                </dependency>
60
                <dependency>
53
                    <code-name-base>org.openide.actions</code-name-base>
61
                    <code-name-base>org.openide.actions</code-name-base>
54
                    <build-prerequisite/>
62
                    <build-prerequisite/>
55
                    <compile-dependency/>
63
                    <compile-dependency/>
(-)a/core.output2/src/org/netbeans/core/output2/AbstractLines.java (-7 / +10 lines)
Lines 67-73 Link Here
67
import org.openide.util.Mutex;
67
import org.openide.util.Mutex;
68
import org.openide.windows.IOColors;
68
import org.openide.windows.IOColors;
69
import org.openide.windows.OutputListener;
69
import org.openide.windows.OutputListener;
70
70
import org.netbeans.swing.plaf.LFCustoms;
71
/**
71
/**
72
 * Abstract Lines implementation with handling for getLine wrap calculations, etc.
72
 * Abstract Lines implementation with handling for getLine wrap calculations, etc.
73
 */
73
 */
Lines 313-319 Link Here
313
        longestLineLen = 0;
313
        longestLineLen = 0;
314
        listener = null;
314
        listener = null;
315
        dirty = false;
315
        dirty = false;
316
        curDefColors = DEF_COLORS.clone();
316
        curDefColors = getDefColors().clone();
317
    }
317
    }
318
318
319
    private boolean dirty;
319
    private boolean dirty;
Lines 827-838 Link Here
827
    }
827
    }
828
828
829
    /** initial default colors */
829
    /** initial default colors */
830
    static final Color[] DEF_COLORS;
830
    private static Color[] DEF_COLORS = null;
831
831
832
    /** current default colors */
832
    /** current default colors */
833
    Color[] curDefColors;
833
    Color[] curDefColors;
834
834
835
    static {
835
    static Color[] getDefColors() {
836
        if (DEF_COLORS != null) {
837
            return DEF_COLORS;
838
        }
836
        Color out = UIManager.getColor("nb.output.foreground"); //NOI18N
839
        Color out = UIManager.getColor("nb.output.foreground"); //NOI18N
837
        if (out == null) {
840
        if (out == null) {
838
            out = UIManager.getColor("textText");
841
            out = UIManager.getColor("textText");
Lines 843-854 Link Here
843
846
844
        Color err = UIManager.getColor("nb.output.err.foreground"); //NOI18N
847
        Color err = UIManager.getColor("nb.output.err.foreground"); //NOI18N
845
        if (err == null) {
848
        if (err == null) {
846
            err = new Color(164, 0, 0);
849
            err = LFCustoms.shiftColor(Color.red);
847
        }
850
        }
848
851
849
        Color hyperlink = UIManager.getColor("nb.output.link.foreground"); //NOI18N
852
        Color hyperlink = UIManager.getColor("nb.output.link.foreground"); //NOI18N
850
        if (hyperlink == null) {
853
        if (hyperlink == null) {
851
            hyperlink = Color.BLUE.darker();
854
            hyperlink = LFCustoms.shiftColor(Color.blue);
852
        }
855
        }
853
856
854
        Color hyperlinkImp = UIManager.getColor("nb.output.link.foreground.important"); //NOI18N
857
        Color hyperlinkImp = UIManager.getColor("nb.output.link.foreground.important"); //NOI18N
Lines 856-862 Link Here
856
            hyperlinkImp = hyperlink;
859
            hyperlinkImp = hyperlink;
857
        }
860
        }
858
861
859
        DEF_COLORS = new Color[]{out, err, hyperlink, hyperlinkImp};
862
        return DEF_COLORS = new Color[]{out, err, hyperlink, hyperlinkImp};
860
    }
863
    }
861
864
862
    public void setDefColor(IOColors.OutputType type, Color color) {
865
    public void setDefColor(IOColors.OutputType type, Color color) {
(-)a/core.output2/src/org/netbeans/core/output2/NbIO.java (-2 / +2 lines)
Lines 430-436 Link Here
430
    }
430
    }
431
431
432
    Color getColor(IOColors.OutputType type) {
432
    Color getColor(IOColors.OutputType type) {
433
        return ioColors != null ? ioColors.getColor(type) : AbstractLines.DEF_COLORS[type.ordinal()];
433
        return ioColors != null ? ioColors.getColor(type) : AbstractLines.getDefColors()[type.ordinal()];
434
    }
434
    }
435
435
436
    private class IOTabImpl extends IOTab {
436
    private class IOTabImpl extends IOTab {
Lines 521-527 Link Here
521
521
522
        @Override
522
        @Override
523
        protected Color getColor(OutputType type) {
523
        protected Color getColor(OutputType type) {
524
            return clrs[type.ordinal()] != null ? clrs[type.ordinal()] : AbstractLines.DEF_COLORS[type.ordinal()];
524
            return clrs[type.ordinal()] != null ? clrs[type.ordinal()] : AbstractLines.getDefColors()[type.ordinal()];
525
        }
525
        }
526
526
527
        @Override
527
        @Override
(-)a/java.editor/nbproject/project.xml (+8 lines)
Lines 337-342 Link Here
337
                    </run-dependency>
337
                    </run-dependency>
338
                </dependency>
338
                </dependency>
339
                <dependency>
339
                <dependency>
340
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
341
                    <build-prerequisite/>
342
                    <compile-dependency/>
343
                    <run-dependency>
344
                        <specification-version>1.27</specification-version>
345
                    </run-dependency>
346
                </dependency>
347
                <dependency>
340
                    <code-name-base>org.openide.awt</code-name-base>
348
                    <code-name-base>org.openide.awt</code-name-base>
341
                    <build-prerequisite/>
349
                    <build-prerequisite/>
342
                    <compile-dependency/>
350
                    <compile-dependency/>
(-)a/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java (-8 / +5 lines)
Lines 97-102 Link Here
97
import org.openide.util.ImageUtilities;
97
import org.openide.util.ImageUtilities;
98
import org.openide.util.NbBundle;
98
import org.openide.util.NbBundle;
99
import org.openide.xml.XMLUtil;
99
import org.openide.xml.XMLUtil;
100
import org.netbeans.swing.plaf.LFCustoms;
100
101
101
/**
102
/**
102
 *
103
 *
Lines 1070-1076 Link Here
1070
    
1071
    
1071
    static class TypeParameterItem extends JavaCompletionItem {
1072
    static class TypeParameterItem extends JavaCompletionItem {
1072
        
1073
        
1073
        private static final String TYPE_PARAMETER_COLOR = "<font color=#000000>"; //NOI18N
1074
1074
1075
        private String simpleName;
1075
        private String simpleName;
1076
        private String leftText;
1076
        private String leftText;
Lines 1094-1100 Link Here
1094
        
1094
        
1095
        protected String getLeftHtmlText() {
1095
        protected String getLeftHtmlText() {
1096
            if (leftText == null)
1096
            if (leftText == null)
1097
                leftText = TYPE_PARAMETER_COLOR + simpleName + COLOR_END;
1097
                leftText = LFCustoms.getTextFgColorHTML() + simpleName + COLOR_END;
1098
            return leftText;
1098
            return leftText;
1099
        }
1099
        }
1100
        
1100
        
Lines 1406-1412 Link Here
1406
        private static final String METHOD_ST_PROTECTED = "org/netbeans/modules/editor/resources/completion/method_static_protected_16.png"; //NOI18N
1406
        private static final String METHOD_ST_PROTECTED = "org/netbeans/modules/editor/resources/completion/method_static_protected_16.png"; //NOI18N
1407
        private static final String METHOD_ST_PRIVATE = "org/netbeans/modules/editor/resources/completion/method_static_private_16.png"; //NOI18N
1407
        private static final String METHOD_ST_PRIVATE = "org/netbeans/modules/editor/resources/completion/method_static_private_16.png"; //NOI18N
1408
        private static final String METHOD_ST_PACKAGE = "org/netbeans/modules/editor/resources/completion/method_static_package_private_16.png"; //NOI18N
1408
        private static final String METHOD_ST_PACKAGE = "org/netbeans/modules/editor/resources/completion/method_static_package_private_16.png"; //NOI18N
1409
        private static final String METHOD_COLOR = "<font color=#000000>"; //NOI18N
1410
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1409
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1411
        private static ImageIcon icon[][] = new ImageIcon[2][4];
1410
        private static ImageIcon icon[][] = new ImageIcon[2][4];
1412
1411
Lines 1487-1493 Link Here
1487
        protected String getLeftHtmlText() {
1486
        protected String getLeftHtmlText() {
1488
            if (leftText == null) {
1487
            if (leftText == null) {
1489
                StringBuilder lText = new StringBuilder();
1488
                StringBuilder lText = new StringBuilder();
1490
                lText.append(METHOD_COLOR);
1489
                lText.append(LFCustoms.getTextFgColorHTML());
1491
                if (!isInherited)
1490
                if (!isInherited)
1492
                    lText.append(BOLD);
1491
                    lText.append(BOLD);
1493
                if (isDeprecated || isBlackListed())
1492
                if (isDeprecated || isBlackListed())
Lines 1916-1922 Link Here
1916
        private static final String METHOD_PUBLIC = "org/netbeans/modules/editor/resources/completion/method_16.png"; //NOI18N
1915
        private static final String METHOD_PUBLIC = "org/netbeans/modules/editor/resources/completion/method_16.png"; //NOI18N
1917
        private static final String GETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/getter_badge.png"; //NOI18N
1916
        private static final String GETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/getter_badge.png"; //NOI18N
1918
        private static final String SETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/setter_badge.png"; //NOI18N
1917
        private static final String SETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/setter_badge.png"; //NOI18N
1919
        private static final String METHOD_COLOR = "<font color=#000000>"; //NOI18N
1920
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1918
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1921
        
1919
        
1922
        private static ImageIcon superIcon;
1920
        private static ImageIcon superIcon;
Lines 1967-1973 Link Here
1967
        protected String getLeftHtmlText() {
1965
        protected String getLeftHtmlText() {
1968
            if (leftText == null) {
1966
            if (leftText == null) {
1969
                StringBuilder lText = new StringBuilder();
1967
                StringBuilder lText = new StringBuilder();
1970
                lText.append(METHOD_COLOR);
1968
                lText.append(LFCustoms.getTextFgColorHTML());
1971
                lText.append(BOLD);
1969
                lText.append(BOLD);
1972
                lText.append(name);
1970
                lText.append(name);
1973
                lText.append(BOLD_END);
1971
                lText.append(BOLD_END);
Lines 2541-2547 Link Here
2541
    static class ParametersItem extends JavaCompletionItem {
2539
    static class ParametersItem extends JavaCompletionItem {
2542
        
2540
        
2543
        private static final String PARAMETERS_COLOR = "<font color=#808080>"; //NOI18N
2541
        private static final String PARAMETERS_COLOR = "<font color=#808080>"; //NOI18N
2544
        private static final String ACTIVE_PARAMETER_COLOR = "<font color=#000000>"; //NOI18N
2545
2542
2546
        protected ElementHandle<ExecutableElement> elementHandle;
2543
        protected ElementHandle<ExecutableElement> elementHandle;
2547
        private boolean isDeprecated;
2544
        private boolean isDeprecated;
Lines 2612-2618 Link Here
2612
                for (int i = 0; i < params.size(); i++) {
2609
                for (int i = 0; i < params.size(); i++) {
2613
                    ParamDesc paramDesc = params.get(i);
2610
                    ParamDesc paramDesc = params.get(i);
2614
                    if (i == activeParamsIndex)
2611
                    if (i == activeParamsIndex)
2615
                        lText.append(COLOR_END).append(ACTIVE_PARAMETER_COLOR).append(BOLD);
2612
                        lText.append(COLOR_END).append(LFCustoms.getTextFgColorHTML()).append(BOLD);
2616
                    lText.append(escape(paramDesc.typeName));
2613
                    lText.append(escape(paramDesc.typeName));
2617
                    lText.append(' ');
2614
                    lText.append(' ');
2618
                    lText.append(paramDesc.name);
2615
                    lText.append(paramDesc.name);
(-)a/o.n.swing.plaf/apichanges.xml (+25 lines)
Lines 49-54 Link Here
49
    <apidef name="plaf">Look And Feel Customization</apidef>
49
    <apidef name="plaf">Look And Feel Customization</apidef>
50
</apidefs>
50
</apidefs>
51
<changes>
51
<changes>
52
    <change id="lfcustoms-color-functions">
53
        <api name="plaf"/>
54
        <summary>New functions for getting foreground text color and color shifting</summary>
55
        <version major="1" minor="27"/>
56
        <date day="14" month="6" year="2012"/>
57
        <author login="wbrana"/>
58
        <compatibility
59
            addition="yes"
60
            binary="compatible" deletion="no" deprecation="no"
61
            modification="no" semantic="compatible" source="compatible"
62
        />
63
        <description>
64
            <p>
65
                new functions:<br/>
66
                <code>
67
                    static String getHexString(int color)<br/>
68
                    static String getTextFgColorHTML()<br/>
69
                    static Color getTextFgColor()<br/>
70
                    static Color shiftColor(Color color)<br/>
71
                    static Color getForeground(AttributeSet a)<br/>
72
                </code>
73
            </p>
74
        </description>
75
        <class package="org.netbeans.swing.plaf" name="LFCustoms"/>
76
    </change>
52
    <change id="branding.of.lfcustoms">
77
    <change id="branding.of.lfcustoms">
53
        <api name="plaf"/>
78
        <api name="plaf"/>
54
        <summary>It is now possible to customize application-specific UIManager keys and values.</summary>
79
        <summary>It is now possible to customize application-specific UIManager keys and values.</summary>
(-)a/o.n.swing.plaf/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/plaf/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/plaf/Bundle.properties
3
OpenIDE-Module: org.netbeans.swing.plaf
3
OpenIDE-Module: org.netbeans.swing.plaf
4
OpenIDE-Module-Specification-Version: 1.26
4
OpenIDE-Module-Specification-Version: 1.27
5
AutoUpdate-Show-In-Client: false
5
AutoUpdate-Show-In-Client: false
6
6
(-)a/o.n.swing.plaf/src/org/netbeans/swing/plaf/LFCustoms.java (+115 lines)
Lines 44-49 Link Here
44
44
45
package org.netbeans.swing.plaf;
45
package org.netbeans.swing.plaf;
46
46
47
import java.awt.Color;
48
import java.util.logging.Logger;
49
import javax.swing.UIManager;
50
import javax.swing.plaf.ColorUIResource;
51
import javax.swing.text.AttributeSet;
52
47
/** Look and feel customizations interface.
53
/** Look and feel customizations interface.
48
 * For various look and feels, there is a need to customize colors,
54
 * For various look and feels, there is a need to customize colors,
49
 * borders etc. to provide 'native-like' UI.
55
 * borders etc. to provide 'native-like' UI.
Lines 78-83 Link Here
78
    private Object[] guaranteedKeysAndValues = null;
84
    private Object[] guaranteedKeysAndValues = null;
79
    protected static final String WORKPLACE_FILL = "nb_workplace_fill"; //NOI18N
85
    protected static final String WORKPLACE_FILL = "nb_workplace_fill"; //NOI18N
80
86
87
    /** convert color
88
     * @since 1.27
89
     *  @return hexadecimal value */
90
    public static String getHexString(int color) {
91
            String result = Integer.toHexString(color).toUpperCase();
92
            if (result.length() == 1) {
93
                    return '0'+result;
94
            }
95
            return result;
96
    }
97
98
    /** cached window text  foreground color as html code */
99
    private static String textFgColorHTML = "";
100
101
    /** @return  window text foreground color as html code
102
     * @since 1.27
103
     */
104
    public static String getTextFgColorHTML() {
105
        synchronized(LFCustoms.class) {
106
            if (textFgColorHTML.isEmpty()) {
107
                    Object o = UIManager.getLookAndFeel().getDefaults().get("windowText");
108
                    if (o instanceof ColorUIResource) {
109
                            ColorUIResource resource = (ColorUIResource)o;
110
                            textFgColorHTML = "<font color=#" + getHexString(resource.getRed()) + getHexString(resource.getGreen()) + getHexString(resource.getBlue())+">";
111
                    } else {
112
                            textFgColorHTML = "<font color=#000000>";
113
                            Logger.getLogger(LFCustoms.class.getName()).warning("BUG: getTextFgColorHTML: color isn't available");
114
                    }
115
            }
116
            return textFgColorHTML;
117
        }
118
    }
119
120
    /** cached window text foreground color */
121
    private static Color textFgColor = null;
122
123
    /** @return window text foreground color
124
     * @since 1.27
125
     */
126
    public static Color getTextFgColor() {
127
        synchronized(LFCustoms.class) {
128
            if (textFgColor == null) {
129
                Object o = UIManager.getLookAndFeel().getDefaults().get("windowText");
130
                if (o instanceof ColorUIResource) {
131
                    textFgColor = (Color) o;
132
                } else {
133
                    textFgColor = Color.BLACK;
134
                    Logger.getLogger(LFCustoms.class.getName()).warning("BUG: getTextFgColor: color isn't available");
135
                }
136
            }
137
            return textFgColor;
138
        }
139
    }
140
141
    /** shift color value */
142
    private static final int shiftValue = 64;
143
144
    /** convert color component
145
     * @return brighter  color component
146
     * @since 1.27
147
     */
148
    private static int brighter (int color) {
149
            int result = color + shiftValue;
150
            if (result > 255) {
151
                    return 255;
152
            } else {
153
                    return result;
154
            }
155
    }
156
157
    /** convert color component
158
     *  @return  darker  color component
159
     * @since 1.27
160
     */
161
    private static int darker(int color) {
162
            int result = color - shiftValue;
163
            if (result < 0) {
164
                    return 0;
165
            } else {
166
                    return result;
167
            }
168
    }
169
170
    /** convert color to brighter one if window foreground text color is bright color
171
     * or convert color to darker one if window foreground text color is dark color
172
     * @return converted color
173
     * @since 1.27
174
     */
175
    public static Color shiftColor(Color color) {
176
        Color textFgColor = getTextFgColor();
177
        if ((textFgColor.getRed() > 127) || (textFgColor.getGreen() > 127) || (textFgColor.getBlue() > 127)) {
178
            return new Color(brighter(color.getRed()), brighter(color.getGreen()), brighter(color.getBlue()));
179
        }
180
        return new Color(darker(color.getRed()), darker(color.getGreen()), darker(color.getBlue()));
181
    }
182
183
    /** get foreground text color from AttributeSet
184
     *  or get window foreground text color if AttributeSet doesn't define foreground text color
185
     * @return  foreground text color
186
     * @since 1.27
187
     */
188
    public static Color getForeground(AttributeSet a) {
189
        Color fg = (Color) a.getAttribute(javax.swing.text.StyleConstants.Foreground);
190
        if (fg == null) {
191
            fg = getTextFgColor();
192
        }
193
        return fg;
194
    }
195
81
    //TODO: A nice idea would be to replace these classes with XML files - minor rewrite of NbTheme to do it
196
    //TODO: A nice idea would be to replace these classes with XML files - minor rewrite of NbTheme to do it
82
197
83
    /** Fetch and cache keys and values */
198
    /** Fetch and cache keys and values */
(-)a/refactoring.java/nbproject/project.xml (+8 lines)
Lines 214-219 Link Here
214
                    </run-dependency>
214
                    </run-dependency>
215
                </dependency>
215
                </dependency>
216
                <dependency>
216
                <dependency>
217
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
218
                    <build-prerequisite/>
219
                    <compile-dependency/>
220
                    <run-dependency>
221
                        <specification-version>1.27</specification-version>
222
                    </run-dependency>
223
                </dependency>
224
                <dependency>
217
                    <code-name-base>org.openide.actions</code-name-base>
225
                    <code-name-base>org.openide.actions</code-name-base>
218
                    <build-prerequisite/>
226
                    <build-prerequisite/>
219
                    <compile-dependency/>
227
                    <compile-dependency/>
(-)a/refactoring.java/src/org/netbeans/modules/refactoring/java/ui/UIUtilities.java (-1 / +2 lines)
Lines 66-71 Link Here
66
import org.netbeans.api.lexer.TokenHierarchy;
66
import org.netbeans.api.lexer.TokenHierarchy;
67
import org.netbeans.api.lexer.TokenSequence;
67
import org.netbeans.api.lexer.TokenSequence;
68
import org.netbeans.modules.refactoring.java.api.MemberInfo;
68
import org.netbeans.modules.refactoring.java.api.MemberInfo;
69
import org.netbeans.swing.plaf.LFCustoms;
69
import org.openide.util.Lookup;
70
import org.openide.util.Lookup;
70
import org.openide.xml.XMLUtil;
71
import org.openide.xml.XMLUtil;
71
72
Lines 279-285 Link Here
279
            buf.insert(0, "<s>"); // NOI18N
280
            buf.insert(0, "<s>"); // NOI18N
280
            buf.append("</s>"); // NOI18N
281
            buf.append("</s>"); // NOI18N
281
        }
282
        }
282
        buf.insert(0, "<font color=" + getHTMLColor(StyleConstants.getForeground(set)) + ">"); //NOI18N
283
        buf.insert(0, "<font color=" + getHTMLColor(LFCustoms.getForeground(set)) + ">"); //NOI18N
283
        buf.append("</font>"); //NOI18N
284
        buf.append("</font>"); //NOI18N
284
        return buf.toString();
285
        return buf.toString();
285
    }
286
    }

Return to bug 134281