[hg] main-silver: #234445 - [dark] Modified tasks color is not r...

  • From: Ondrej Vrabec < >
  • To: ,
  • Subject: [hg] main-silver: #234445 - [dark] Modified tasks color is not r...
  • Date: Fri, 16 Aug 2013 08:56:44 -0700

changeset 33a04ab670bc in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/33a04ab670bc
description:
        #234445 - [dark] Modified tasks color is not readable

diffstat:

 bugtracking/manifest.mf                                                      
           |   2 +-
 
bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties 
          |  12 +-
 
bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
 |  21 +++--
 bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java   
           |   8 +-
 bugtracking/src/org/netbeans/modules/bugtracking/util/UIUtils.java           
           |  36 ++++++++++
 o.n.swing.plaf/src/org/netbeans/swing/plaf/metal/DarkMetalTheme.java         
           |   3 +
 o.n.swing.plaf/src/org/netbeans/swing/plaf/nimbus/DarkNimbusTheme.java       
           |   3 +
 7 files changed, 67 insertions(+), 18 deletions(-)

diffs (219 lines):

diff --git a/bugtracking/manifest.mf b/bugtracking/manifest.mf
--- a/bugtracking/manifest.mf
+++ b/bugtracking/manifest.mf
@@ -2,5 +2,5 @@
 AutoUpdate-Show-In-Client: false
 OpenIDE-Module: org.netbeans.modules.bugtracking
 OpenIDE-Module-Localizing-Bundle: 
org/netbeans/modules/bugtracking/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.62
+OpenIDE-Module-Specification-Version: 1.63
 
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/Bundle.properties
@@ -49,17 +49,17 @@
 LBL_ColumnDialogTitle=Change Visible Columns
 LBL_ColumnDialogDesc=Choose the Columns to Display in the List
 
-issueObsoleteFormat = <font color="#999999"><s>{0}</s></font>
-issueNewFormat = <font color="#00b400">{0}</font>
-issueModifiedFormat = <font color="#0000FF">{0}</font>
+issueObsoleteFormat = <font color="{0}"><s>{1}</s></font>
+issueNewFormat = <font color="{0}">{1}</font>
+issueModifiedFormat = <font color="{0}">{1}</font>
 
 LBL_IssueStatusNew=New
 LBL_IssueStatusModified=Modified
 LBL_IssueStatusObsolete=Archived
 
-MSG_IssueStatusNew= - this task is new
-MSG_IssueStatusModified= - this task is modified -
-MSG_IssueStatusObsolete= - this task doesn't belong to the query anymore
+MSG_IssueStatusNew=\ - this task is new
+MSG_IssueStatusModified=\ - this task is modified -
+MSG_IssueStatusObsolete=\ - this task doesn't belong to the query anymore
 
 CTL_Issue_Summary_Title=Summary
 CTL_Issue_Summary_Desc=Task Summary
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/issuetable/QueryTableCellRenderer.java
@@ -67,6 +67,7 @@
 import org.netbeans.modules.bugtracking.api.Query;
 import org.netbeans.modules.bugtracking.spi.IssueStatusProvider;
 import org.netbeans.modules.bugtracking.util.TextUtils;
+import org.netbeans.modules.bugtracking.util.UIUtils;
 import org.openide.util.ImageUtilities;
 import org.openide.util.NbBundle;
 
@@ -84,9 +85,9 @@
     private static final int VISIBLE_START_CHARS = 0;
     private static final Icon seenValueIcon = new 
ImageIcon(ImageUtilities.loadImage("org/netbeans/modules/bugtracking/ui/resources/seen-value.png"));
 // NOI18N
 
-    private static final MessageFormat issueNewFormat       = 
getFormat("issueNewFormat");      // NOI18N
-    private static final MessageFormat issueObsoleteFormat  = 
getFormat("issueObsoleteFormat"); // NOI18N
-    private static final MessageFormat issueModifiedFormat  = 
getFormat("issueModifiedFormat"); // NOI18N
+    private static final MessageFormat issueNewFormat       = 
getFormat("issueNewFormat", UIUtils.getTaskNewColor()); //NOI18N
+    private static final MessageFormat issueObsoleteFormat  = 
getFormat("issueObsoleteFormat", UIUtils.getTaskObsoleteColor()); //NOI18N
+    private static final MessageFormat issueModifiedFormat  = 
getFormat("issueModifiedFormat", UIUtils.getTaskModifiedColor()); //NOI18N
 
     private static final String labelNew = 
NbBundle.getMessage(QueryTableCellRenderer.class, "LBL_IssueStatusNew");      
       // NOI18N
     private static final String labelModified = 
NbBundle.getMessage(QueryTableCellRenderer.class, "LBL_IssueStatusModified"); 
  // NOI18N
@@ -98,9 +99,9 @@
 
     private static Color evenLineColor                      = null;
     private static Color unevenLineColor                    = null;
-    private static final Color newHighlightColor            = new 
Color(0x00b400);
-    private static final Color modifiedHighlightColor       = new 
Color(0x0000ff);
-    private static final Color obsoleteHighlightColor       = new 
Color(0x999999);
+    private static final Color newHighlightColor            = 
UIUtils.getTaskNewColor();
+    private static final Color modifiedHighlightColor       = 
UIUtils.getTaskModifiedColor();
+    private static final Color obsoleteHighlightColor       = 
UIUtils.getTaskObsoleteColor();
 
     static {
         evenLineColor = UIManager.getColor( 
"nb.bugtracking.table.background" ); //NOI18N
@@ -117,8 +118,9 @@
         this.issueTable = issueTable;
     }
 
-    private static MessageFormat getFormat(String key) {
-        String format = NbBundle.getMessage(IssueTable.class, key);
+    private static MessageFormat getFormat (String key, Color c) {
+        String format = NbBundle.getMessage(IssueTable.class, key,
+                new Object[] { UIUtils.getColorString(c), "{0}" }); //NOI18N
         return new MessageFormat(format);
     }
 
@@ -316,6 +318,7 @@
                 // archived issues
                 style.format     = isSelected ? style.format           : 
issueObsoleteFormat;
                 style.background = isSelected ? obsoleteHighlightColor : 
style.background;
+                style.foreground = isSelected ? table.getBackground() : 
style.foreground;
             } else {
                 status = issue.getStatus();
                 if(status != IssueStatusProvider.Status.SEEN) {
@@ -323,10 +326,12 @@
                         case NEW :
                             style.format     = isSelected ? style.format     
 : issueNewFormat;
                             style.background = isSelected ? 
newHighlightColor : style.background;
+                            style.foreground = isSelected ? 
table.getBackground() : style.foreground;
                             break;
                         case MODIFIED :
                             style.format     = isSelected ? style.format     
      : issueModifiedFormat;
                             style.background = isSelected ? 
modifiedHighlightColor : style.background;
+                            style.foreground = isSelected ? 
table.getBackground() : style.foreground;
                             break;
                     }
                 }
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java
@@ -53,7 +53,6 @@
 import java.util.Map.Entry;
 import javax.swing.JButton;
 import javax.swing.JComponent;
-import javax.swing.SwingUtilities;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import org.netbeans.modules.bugtracking.IssueImpl;
@@ -67,6 +66,7 @@
 import org.netbeans.modules.bugtracking.tasks.dashboard.RepositoryNode;
 import org.netbeans.modules.bugtracking.tasks.dashboard.TaskNode;
 import org.netbeans.modules.bugtracking.ui.issue.IssueAction;
+import org.netbeans.modules.bugtracking.util.UIUtils;
 import org.openide.DialogDisplayer;
 import org.openide.NotifyDescriptor;
 import org.openide.actions.FindAction;
@@ -83,6 +83,8 @@
     private final static int VISIBLE_START_CHARS = 5;
     private final static String BOLD_START_SUBSTITUTE = "$$$BOLD_START$$$"; 
//NOI18
     private final static String BOLD_END_SUBSTITUTE = "$$$BOLD_END$$$"; 
//NOI18
+    private static final String newColor = 
UIUtils.getColorString(UIUtils.getTaskNewColor());
+    private static final String modifiedColor = 
UIUtils.getColorString(UIUtils.getTaskModifiedColor());
 
     public static String getCategoryDisplayText(CategoryNode categoryNode) {
         String categoryName = categoryNode.getCategory().getName();
@@ -181,9 +183,9 @@
 
     private static String getTaskAnotatedText(String text, 
IssueStatusProvider.Status status, boolean hasFocus, boolean isHTML) {
         if (status == IssueStatusProvider.Status.NEW && !hasFocus) {
-            text = "<html><font color=\"green\">" + text + "</font></html>"; 
//NOI18N
+            text = "<html><font color=\"" + newColor + "\">" + text + 
"</font></html>"; //NOI18N
         } else if (status == IssueStatusProvider.Status.MODIFIED && 
!hasFocus) {
-            text = "<html><font color=\"blue\">" + text + "</font></html>"; 
//NOI18N
+            text = "<html><font color=\"" + modifiedColor + "\">" + text + 
"</font></html>"; //NOI18N
         } else if (isHTML) {
             text = "<html>" + text + "</html>"; //NOI18N
         }
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/util/UIUtils.java 
b/bugtracking/src/org/netbeans/modules/bugtracking/util/UIUtils.java
--- a/bugtracking/src/org/netbeans/modules/bugtracking/util/UIUtils.java
+++ b/bugtracking/src/org/netbeans/modules/bugtracking/util/UIUtils.java
@@ -152,6 +152,42 @@
         return "Nimbus".equals( UIManager.getLookAndFeel().getID() ); 
//NOI18N
     }
 
+    public static String getColorString (Color c) {
+        return "#" + getHex(c.getRed()) + getHex(c.getGreen()) + 
getHex(c.getBlue()); //NOI18N
+    }
+
+    public static Color getTaskNewColor () {
+        Color c = UIManager.getColor("nb.bugtracking.new.color"); //NOI18N
+        if (c == null) {
+            c = new Color(0, 180, 0);
+        }
+        return c;
+    }
+
+    public static Color getTaskModifiedColor () {
+        Color c = UIManager.getColor("nb.bugtracking.modified.color"); 
//NOI18N
+        if (c == null) {
+            c = new Color(0, 0, 255);
+        }
+        return c;
+    }
+
+    public static Color getTaskObsoleteColor () {
+        Color c = UIManager.getColor("nb.bugtracking.obsolete.color"); 
//NOI18N
+        if (c == null) {
+            c = new Color(153, 153, 153);
+        }
+        return c;
+    }
+
+    private static String getHex (int i) {
+        String hex = Integer.toHexString(i & 0x000000FF);
+        if (hex.length() == 1) {
+            hex = "0" + hex; //NOI18N
+        }
+        return hex;
+    }
+
     private static void keepFocusedComponentVisible(Component component, 
FocusListener l) {
         component.removeFocusListener(l); // Making sure that it is not 
added twice
         component.addFocusListener(l);
diff --git 
a/o.n.swing.plaf/src/org/netbeans/swing/plaf/metal/DarkMetalTheme.java 
b/o.n.swing.plaf/src/org/netbeans/swing/plaf/metal/DarkMetalTheme.java
--- a/o.n.swing.plaf/src/org/netbeans/swing/plaf/metal/DarkMetalTheme.java
+++ b/o.n.swing.plaf/src/org/netbeans/swing/plaf/metal/DarkMetalTheme.java
@@ -111,6 +111,9 @@
         UIManager.put( "nb.bugtracking.label.highlight", new Color(71, 71, 
75) ); //NOI18N
         UIManager.put( "nb.bugtracking.table.background", new Color(18, 30, 
49) ); //NOI18N
         UIManager.put( "nb.bugtracking.table.background.alternate", new 
Color(13, 22, 36) ); //NOI18N
+        UIManager.put( "nb.bugtracking.new.color", new Color(0, 224, 0) ); 
//NOI18N
+        UIManager.put( "nb.bugtracking.modified.color", new Color(81, 182, 
255) ); //NOI18N
+        UIManager.put( "nb.bugtracking.obsolete.color", new Color(130, 130, 
130) ); //NOI18N
 
         UIManager.put( "nb.html.link.foreground", new Color(164,164,255) ); 
//NOI18N
         UIManager.put( "nb.html.link.foreground.hover", new Color(255,216,0) 
); //NOI18N
diff --git 
a/o.n.swing.plaf/src/org/netbeans/swing/plaf/nimbus/DarkNimbusTheme.java 
b/o.n.swing.plaf/src/org/netbeans/swing/plaf/nimbus/DarkNimbusTheme.java
--- a/o.n.swing.plaf/src/org/netbeans/swing/plaf/nimbus/DarkNimbusTheme.java
+++ b/o.n.swing.plaf/src/org/netbeans/swing/plaf/nimbus/DarkNimbusTheme.java
@@ -107,6 +107,9 @@
         UIManager.put( "nb.bugtracking.label.highlight", new Color(160, 160, 
160) ); //NOI18N
         UIManager.put( "nb.bugtracking.table.background", new Color(18, 30, 
49) ); //NOI18N
         UIManager.put( "nb.bugtracking.table.background.alternate", new 
Color(13, 22, 36) ); //NOI18N
+        UIManager.put( "nb.bugtracking.new.color", new Color(0, 224, 0)); 
//NOI18N
+        UIManager.put( "nb.bugtracking.modified.color", new Color(81, 182, 
255)); //NOI18N
+        UIManager.put( "nb.bugtracking.obsolete.color", new Color(153, 153, 
153)); //NOI18N
 
         UIManager.put( "nb.html.link.foreground", new Color(164,164,255) ); 
//NOI18N
         UIManager.put( "nb.html.link.foreground.hover", new Color(255,216,0) 
); //NOI18N

[hg] main-silver: #234445 - [dark] Modified tasks color is not r...

Ondrej Vrabec 08/16/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 66 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close