You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2015/05/27 11:17:23 UTC

svn commit: r1681939 - in /directory/studio/trunk/plugins: aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/sourceeditor/ common.ui/src/main/java/org/apache/directory/studio/common/ui/ ldapbrowser.common/src/main/java/org/apache/di...

Author: elecharny
Date: Wed May 27 09:17:22 2015
New Revision: 1681939

URL: http://svn.apache.org/r1681939
Log:
o Normalized the RGB values (0, 31, 63..., 255)
o Created some new RGB constants
o Used the RGB constants

Modified:
    directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/sourceeditor/ACITextAttributeProvider.java
    directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIConstants.java
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java
    directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java
    directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/sourceeditor/OpenLdapAclTextAttributeProvider.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/SchemaTextAttributeProvider.java

Modified: directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/sourceeditor/ACITextAttributeProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/sourceeditor/ACITextAttributeProvider.java?rev=1681939&r1=1681938&r2=1681939&view=diff
==============================================================================
--- directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/sourceeditor/ACITextAttributeProvider.java (original)
+++ directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/sourceeditor/ACITextAttributeProvider.java Wed May 27 09:17:22 2015
@@ -24,7 +24,6 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.studio.common.ui.CommonUIConstants;
-import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.jface.text.TextAttribute;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Color;
@@ -62,7 +61,7 @@ public class ACITextAttributeProvider
     {
         attributes.put( DEFAULT_ATTRIBUTE, new TextAttribute( CommonUIConstants.BLACK_COLOR ) );
 
-        attributes.put( KEYWORD_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 128, 0, 96 ) ),
+        attributes.put( KEYWORD_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.M_PURPLE ),
             null, SWT.BOLD ) );
 
         attributes.put( STRING_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.BLUE ) ) );
@@ -79,10 +78,9 @@ public class ACITextAttributeProvider
 
         attributes.put( AUTHENTICATIONLEVEL_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.M_GREEN ), null, SWT.BOLD ) );
 
-        attributes.put( ITEMORUSERFIRST_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 128, 0,
-            128 ) ), null, SWT.BOLD ) );
+        attributes.put( ITEMORUSERFIRST_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.M_PURPLE ), null, SWT.BOLD ) );
 
-        attributes.put( USER_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 0, 128, 255 ) ),
+        attributes.put( USER_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 0, 127, 255 ) ),
             null, SWT.BOLD ) );
 
     }

Modified: directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIConstants.java?rev=1681939&r1=1681938&r2=1681939&view=diff
==============================================================================
--- directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIConstants.java (original)
+++ directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/CommonUIConstants.java Wed May 27 09:17:22 2015
@@ -49,15 +49,15 @@ public final class CommonUIConstants
 
     /** 
      * The various colors in use. Each color have gradients, from black to white (ie from 0 to 255). We 
-     * use colors by increments of 32 :
+     * use colors by increments of 31 :
      * <ul>
      * <li>0 : Black or no color</li>
-     * <li>32 : Black Dark color (BD_[color]) for instance BD_GREEN</li>
-     * <li>64 : Dark color (D_[color]) for instance D_GREEN</li>
-     * <li>96 : Mid Dark Color(MD_[color]) for instance MD_GREEN</li>
-     * <li>128 : Mid color (M_[color]), for instance M_GREEN</li>
-     * <li>160 : Mid Light color (ML_[color]), for instance ML_GREEN</li>
-     * <li>192 : Light color (L_[color]), for instance L_GREEN</li>
+     * <li>31 : Black Dark color (BD_[color]) for instance BD_GREEN</li>
+     * <li>63 : Dark color (D_[color]) for instance D_GREEN</li>
+     * <li>95 : Mid Dark Color(MD_[color]) for instance MD_GREEN</li>
+     * <li>127 : Mid color (M_[color]), for instance M_GREEN</li>
+     * <li>159 : Mid Light color (ML_[color]), for instance ML_GREEN</li>
+     * <li>191 : Light color (L_[color]), for instance L_GREEN</li>
      * <li>224 : White Light color (WL_[color]), for instance WL_GREEN</li>
      * <li>255 : Full color ([color]), for instance GREEN</li>
      * </ul>
@@ -69,28 +69,32 @@ public final class CommonUIConstants
     public static Color WHITE_COLOR;
     
     // 7 shade of greys... From dark to light, with combinaisons
-    public static final RGB BD_GREY = new RGB( 32, 32, 32 );    // Black Dark grey
-    public static final RGB D_GREY = new RGB( 64, 64, 64 );     // Dark grey
-    public static final RGB MD_GREY = new RGB( 96, 96, 96 );    // Medium Dark grey
-    public static final RGB M_GREY = new RGB( 128, 128, 128 );  // Grey
-    public static final RGB ML_GREY = new RGB( 160, 160, 160 ); // Medium Light grey
-    public static final RGB L_GREY = new RGB( 192, 192, 192 );  // Light grey
+    public static final RGB BD_GREY = new RGB( 31, 31, 31 );    // Black Dark grey
+    public static final RGB D_GREY = new RGB( 63, 63, 63 );     // Dark grey
+    public static final RGB MD_GREY = new RGB( 95, 95, 95 );    // Medium Dark grey
+    public static final RGB M_GREY = new RGB( 127, 127, 127 );  // Grey
+    public static final RGB ML_GREY = new RGB( 159, 159, 159 ); // Medium Light grey
+    public static final RGB L_GREY = new RGB( 191, 191, 191 );  // Light grey
     public static final RGB WL_GREY = new RGB( 224, 224, 224 ); // White Light grey
     
     // Red
-    public static final RGB M_RED = new RGB( 128, 0, 0 );       // Medium red
-    public static final RGB ML_RED = new RGB( 160, 0, 0 );      // Medium light red
+    public static final RGB M_RED = new RGB( 127, 0, 0 );       // Medium red
+    public static final RGB ML_RED = new RGB( 159, 0, 0 );      // Medium light red
     public static final RGB RED = new RGB( 255, 0, 0 );         // Full red
     
     // Green
-    public static final RGB M_GREEN = new RGB( 0, 128, 0 );     // Medium green
-    public static final RGB ML_GREEN = new RGB( 0, 160, 0 );    // Medium Light green
+    public static final RGB M_GREEN = new RGB( 0, 127, 0 );     // Medium green
+    public static final RGB ML_GREEN = new RGB( 0, 159, 0 );    // Medium Light green
     
     // Blue
-    public static final RGB M_BLUE = new RGB( 0, 0, 128 );      // Medium blue
-    public static final RGB L_BLUE = new RGB( 0, 0, 192 );      // Light blue 
+    public static final RGB M_BLUE = new RGB( 0, 0, 127 );      // Medium blue
+    public static final RGB L_BLUE = new RGB( 0, 0, 191 );      // Light blue 
     public static final RGB BLUE = new RGB( 0, 0, 255 );        // Full blue
     
+    // Purple
+    public static final RGB M_PURPLE = new RGB( 127, 0, 127 );  // Middle purple
+    public static final RGB PURPLE = new RGB( 255, 0, 255 );    // Deep purple
+    
     // Some specific colors
     public static final String IMG_INFORMATION = "resources/icons/information.gif"; //$NON-NLS-1$
 }

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java?rev=1681939&r1=1681938&r2=1681939&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java (original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/filtereditor/FilterDamagerRepairer.java Wed May 27 09:17:22 2015
@@ -54,7 +54,7 @@ public class FilterDamagerRepairer imple
         .getDefault().getColor( CommonUIConstants.M_GREEN ), null, SWT.BOLD );
 
     private static final TextAttribute ATTRIBUTE_TEXT_ATTRIBUTE = new TextAttribute( BrowserCommonActivator
-        .getDefault().getColor( new RGB( 128, 0, 96 ) ) );
+        .getDefault().getColor( CommonUIConstants.M_PURPLE ) );
 
     private static final TextAttribute FILTER_TYPE_TEXT_ATTRIBUTE = new TextAttribute( BrowserCommonActivator
         .getDefault().getColor( CommonUIConstants.RED ), null, SWT.BOLD );

Modified: directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java?rev=1681939&r1=1681938&r2=1681939&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java (original)
+++ directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java Wed May 27 09:17:22 2015
@@ -59,7 +59,7 @@ public class LdifEditorPreferencesInitia
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_OPTIONS_CONTINUEONERROR, true );
 
         PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_COMMENT
-            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 64, 128, 96 ) );// green
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 63, 127, 95 ) );// green
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_COMMENT
             + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.NORMAL );
         PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_KEYWORD
@@ -71,7 +71,7 @@ public class LdifEditorPreferencesInitia
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_DN
             + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
         PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_ATTRIBUTE
-            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 128, 0, 96 ) );// violet
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, CommonUIConstants.M_PURPLE );// violet
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_ATTRIBUTE
             + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
         PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_VALUETYPE
@@ -83,19 +83,19 @@ public class LdifEditorPreferencesInitia
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_VALUE
             + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.NORMAL );
         PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEADD
-            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 128, 160, 96 ) );// green
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 127, 159, 95 ) );// green
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEADD
             + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
         PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODIFY
-            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 224, 160, 96 ) );// yellow
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 223, 159, 95 ) );// yellow
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODIFY
             + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
         PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEDELETE
-            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 255, 64, 96 ) );// red
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 255, 63, 95 ) );// red
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEDELETE
             + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
         PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODDN
-            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 128, 160, 192 ) );// bright
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 127, 159, 191 ) );// bright
         // blue
         store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODDN
             + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );

Modified: directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/sourceeditor/OpenLdapAclTextAttributeProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/sourceeditor/OpenLdapAclTextAttributeProvider.java?rev=1681939&r1=1681938&r2=1681939&view=diff
==============================================================================
--- directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/sourceeditor/OpenLdapAclTextAttributeProvider.java (original)
+++ directory/studio/trunk/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/sourceeditor/OpenLdapAclTextAttributeProvider.java Wed May 27 09:17:22 2015
@@ -52,10 +52,10 @@ public class OpenLdapAclTextAttributePro
     {
         attributes.put( DEFAULT_ATTRIBUTE, new TextAttribute( CommonUIConstants.BLACK_COLOR ) );
 
-        attributes.put( KEYWORD_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 127, 0, 85 ) ),
+        attributes.put( KEYWORD_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.M_PURPLE ),
             null, SWT.BOLD ) );
 
-        attributes.put( STRING_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 0, 0, 255 ) ) ) );
+        attributes.put( STRING_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.BLUE ) ) );
     }
 
 

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/SchemaTextAttributeProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/SchemaTextAttributeProvider.java?rev=1681939&r1=1681938&r2=1681939&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/SchemaTextAttributeProvider.java (original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/widget/SchemaTextAttributeProvider.java Wed May 27 09:17:22 2015
@@ -56,16 +56,16 @@ public class SchemaTextAttributeProvider
     {
         attributes.put( DEFAULT_ATTRIBUTE, new TextAttribute( CommonUIConstants.BLACK_COLOR ) );
 
-        attributes.put( KEYWORD_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 128, 0, 96 ) ),
+        attributes.put( KEYWORD_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.M_PURPLE ),
             null, SWT.BOLD ) );
 
         attributes.put( STRING_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.BLUE ) ) );
 
-        attributes.put( ATTRIBUTETYPE_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 96, 64,
-            160 ) ), null, SWT.BOLD ) );
+        attributes.put( ATTRIBUTETYPE_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), new RGB( 95, 63,
+            159 ) ), null, SWT.BOLD ) );
 
         attributes.put( OBJECTCLASS_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(),
-            new RGB( 64, 128, 64 ) ), null, SWT.BOLD ) );
+            new RGB( 63, 127, 63 ) ), null, SWT.BOLD ) );
 
         attributes.put( OID_ATTRIBUTE, new TextAttribute( new Color( Display.getCurrent(), CommonUIConstants.RED ) ) );
     }