diff --git a/src/org/idp/laf/AttributeSetConfigured.java b/src/org/idp/laf/AttributeSetConfigured.java index 58eeb0a..8ce4de3 100644 --- a/src/org/idp/laf/AttributeSetConfigured.java +++ b/src/org/idp/laf/AttributeSetConfigured.java @@ -1,7 +1,7 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/* Copyright (C) Edward M. Kagan - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited + * Proprietary and confidential + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; @@ -9,8 +9,7 @@ import java.awt.Color; import java.util.List; /** - * - * @author Clochard Pagan + * @author Edward M. Kagan */ public class AttributeSetConfigured { diff --git a/src/org/idp/laf/Color.java b/src/org/idp/laf/Color.java index a420874..0008a22 100644 --- a/src/org/idp/laf/Color.java +++ b/src/org/idp/laf/Color.java @@ -1,7 +1,7 @@ /* Copyright (C) Edward M. Kagan - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential - * Written by Edward M. Kagan , 2015 + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; @@ -11,7 +11,7 @@ import static org.idp.laf.Color.ColorClass.AT; import static org.idp.laf.Color.ColorClass.SF; /** - * @author Edward M. Kagan + * @author Edward M. Kagan */ @SuppressWarnings("rawtypes") public class Color implements Serializable{ diff --git a/src/org/idp/laf/ColorTheme.java b/src/org/idp/laf/ColorTheme.java index 94b30fb..58dd14d 100644 --- a/src/org/idp/laf/ColorTheme.java +++ b/src/org/idp/laf/ColorTheme.java @@ -1,7 +1,7 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/* Copyright (C) Edward M. Kagan - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited + * Proprietary and confidential + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; @@ -9,8 +9,7 @@ import java.awt.Color; import java.util.HashMap; /** - * - * @author Clochard Pagan + * @author Edward M. Kagan */ public class ColorTheme { @@ -204,7 +203,7 @@ private static final AttributeSetConfigured [] lang_Java = { new AttributeSetConfigured ("string-escape-invalid", null, null, null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("keyword", null, new Color (234, 82, 128, 255), null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("mod-local-variable", null, null, null, null, null, null, null, null, null, null, null), - new AttributeSetConfigured ("identifier", null, new Color (0, 255, 255, 255), null, null, null, null, null, null, null, null, null), + new AttributeSetConfigured ("identifier", null, null, null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("mod-field", null, new Color (255, 255, 255, 255), null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("javadoc-tag", null, new Color (255, 0, 102, 255), null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("mod-method", null, new Color (141, 141, 222, 255), null, null, null, null, null, null, null, null, null), diff --git a/src/org/idp/laf/Defaults.java b/src/org/idp/laf/Defaults.java index e01d195..c741601 100644 --- a/src/org/idp/laf/Defaults.java +++ b/src/org/idp/laf/Defaults.java @@ -1,7 +1,7 @@ /* Copyright (C) Edward M. Kagan - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential - * Written by Edward M. Kagan , 2015 + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; @@ -9,7 +9,7 @@ import java.util.ArrayList; import static org.idp.laf.Kernel.color_scheme_loaded; /** - * @author Edward M. Kagan + * @author Edward M. Kagan * @author Helen A. Kukhar */ public class Defaults { diff --git a/src/org/idp/laf/Installer.java b/src/org/idp/laf/Installer.java index bf23974..5cf113c 100644 --- a/src/org/idp/laf/Installer.java +++ b/src/org/idp/laf/Installer.java @@ -1,20 +1,18 @@ /* Copyright (C) Edward M. Kagan - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential - * Written by Edward M. Kagan , 2015 + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; import java.util.prefs.Preferences; import javax.swing.SwingUtilities; -import javax.swing.UIManager; import org.openide.modules.ModuleInstall; -import org.openide.util.NbBundle; import org.openide.util.NbPreferences; import org.openide.windows.WindowManager; /** - * @author Edward M. Kagan + * @author Edward M. Kagan */ public class Installer extends ModuleInstall { @@ -31,35 +29,33 @@ public class Installer extends ModuleInstall } }); - -// System.out.println(">>>>>>>>>>>>>>> L&F = " + UIManager.getLookAndFeel().getName()); -// -//// if (UIManager.getLookAndFeel().getName().equals(NbBundle.getMessage(TitanLookAndFeel.class, "LBL_TITAN"))) -//// { -// -// //} - -// -// - final Preferences prefs = NbPreferences.root().node( "laf" ); //NOI18N - if( !prefs.getBoolean("idp.titan_editor.installed", false) ) //NOI18N - { + + Preferences prefs = NbPreferences.root().node( "laf" ); //NOI18N + if( !prefs.getBoolean("idp.titan.installed", false) ) //NOI18N + { + prefs.putBoolean("idp.titan.installed", true ); //NOI18N + WindowManager.getDefault().invokeWhenUIReady( new Runnable() + { + @Override + public void run() { + TitanEditor.load_editor(true); + } + }); + } + else + { WindowManager.getDefault().invokeWhenUIReady( new Runnable() { @Override public void run() { - TitanEditor.load_editor(); - prefs.putBoolean("idp.titan_editor.installed", true ); //NOI18N + TitanEditor.load_editor(false); } }); - } - - - - + + } @@ -69,7 +65,7 @@ public class Installer extends ModuleInstall if (TitanLookAndFeel.self_install()) { System.out.print("Setting up anti-aliasing hints to conf file..."); - if (Kernel.setup_font_antialiaing_hints()) + if (!Kernel.setup_font_antialiaing_hints()) { System.err.println("FAIL"); return; diff --git a/src/org/idp/laf/Kernel.java b/src/org/idp/laf/Kernel.java index d3eb908..f682ab5 100644 --- a/src/org/idp/laf/Kernel.java +++ b/src/org/idp/laf/Kernel.java @@ -1,7 +1,7 @@ /* Copyright (C) Edward M. Kagan - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential - * Written by Edward M. Kagan , 2015 + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; @@ -14,7 +14,6 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; -import java.lang.reflect.Method; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.FileSystems; @@ -36,20 +35,16 @@ import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.StyleSheet; import org.idp.laf.tools.Scheme2Java; import org.openide.util.Exceptions; -import org.openide.util.Lookup; -import org.openide.util.NbBundle; import org.openide.windows.WindowManager; /** - * @author Edward M. Kagan + * @author Edward M. Kagan */ @SuppressWarnings("rawtypes") public class Kernel { private static final boolean w_init = false; - public static Color[] color_scheme_loaded; - private static final String scheme_file_name = "netbeans.idp_scheme"; public static void load_kernel () @@ -76,13 +71,6 @@ public class Kernel { } } -// private static boolean prepare_titan_laf () -// { -// // UIManager.put("nb.forceui", true); -// // UIManager.put("netbeans.plaf.disable.ui.customizations", false); -// return ; -// } - public static boolean setup_font_antialiaing_hints () { try @@ -138,23 +126,15 @@ public class Kernel { private static void apply_border_managment_hints () { - -// UIManager.put("ComboBoxUI", "javax.swing.plaf.basic.BasicComboBoxUI"); -// UIManager.put("SliderUI", "javax.swing.plaf.basic.BasicSliderUI"); -// UIManager.put("TreeUI", "javax.swing.plaf.basic.BasicTreeUI"); - javax.swing.border.EmptyBorder invisable_border = new EmptyBorder(0,0,0,0); UIManager.put ("EditorPane.border", invisable_border); // Editor FUCKING LINE! - UIManager.put ("ComboBox.border", invisable_border); // Editor FUCKING LINE! - + UIManager.put ("ComboBox.border", invisable_border); // Editor FUCKING LINE! javax.swing.border.EmptyBorder spinner_border = new EmptyBorder(1,1,1,1); UIManager.put("Spinner.border", spinner_border); UIManager.put("Spinner.arrowButtonBorder", spinner_border); - - UIManager.put ("TabbedContainer.editor.outerBorder", new LineBorder(new java.awt.Color(24, 24, 24, 255), 1)); // Editor border @@ -255,9 +235,6 @@ public class Kernel { UIManager.put(o, status_border); } // - -// UIManager.put("nb.forceui", true); -// UIManager.put("netbeans.plaf.disable.ui.customizations", false); } diff --git a/src/org/idp/laf/Keys.java b/src/org/idp/laf/Keys.java index 5feeb21..d7fdb55 100644 --- a/src/org/idp/laf/Keys.java +++ b/src/org/idp/laf/Keys.java @@ -1,12 +1,12 @@ /* Copyright (C) Edward M. Kagan - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential - * Written by Edward M. Kagan , 2015 + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; /** - * @author Edward M. Kagan + * @author Edward M. Kagan */ public class Keys { diff --git a/src/org/idp/laf/TitanEditor.java b/src/org/idp/laf/TitanEditor.java index 2999137..46bb526 100644 --- a/src/org/idp/laf/TitanEditor.java +++ b/src/org/idp/laf/TitanEditor.java @@ -1,20 +1,16 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. +/* Copyright (C) Edward M. Kagan - All Rights Reserved + * Unauthorized copying of this file, via any medium is strictly prohibited + * Proprietary and confidential + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.AbstractMap; -import java.util.ArrayList; import java.util.Collection; -import java.util.Enumeration; import java.util.HashMap; import java.util.LinkedList; -import java.util.Map; import java.util.Set; import java.util.prefs.BackingStoreException; import java.util.prefs.Preferences; @@ -24,43 +20,37 @@ import javax.swing.text.SimpleAttributeSet; import javax.swing.text.StyleConstants; import org.openide.util.Exceptions; import org.openide.util.Lookup; -import org.openide.util.NbBundle; import org.openide.util.NbPreferences; /** - * * @author Edward M. Kagan */ @SuppressWarnings ({"rawtypes","unchecked"}) public class TitanEditor { - private static final String COLOR_MODEL_CLASS_NAME = "org.netbeans.modules.options.colors.ColorModel"; //NOI18N + private static final String COLOR_MODEL_CLASS_NAME = "org.netbeans.modules.options.colors.ColorModel"; //NOI18N private static final String EDITOR_SETTINGS_CLASS_NAME = "org.netbeans.api.editor.settings.EditorStyleConstants"; //NOI18N private static final String ANNOTATION_TYPE_CLASS_NAME = "org.netbeans.editor.AnnotationType"; //NOI18N - private static final String PROVIDER_CLASS_NAME = "org.netbeans.modules.versioning.util.OptionsPanelColorProvider"; //NOI18N -// private static final String PROVIDER_GIT_CLASS_NAME = "org.netbeans.modules.git.options.AnnotationColorProvider"; //NOI18N -// private static final String PROVIDER_SVN_CLASS_NAME = "org.netbeans.modules.subversion.options.AnnotationColorProvider"; //NOI18N -// private static final String PROVIDER_HG_CLASS_NAME = "org.netbeans.modules.mercurial.options.AnnotationColorProvider"; //NOI18N - private static final String PROVIDER_GIT_CLASS_NAME = "org.netbeans.modules.git.GitModuleConfig"; //NOI18N - private static final String PROVIDER_SVN_CLASS_NAME = "org.netbeans.modules.subversion.SvnModuleConfig"; //NOI18N - private static final String PROVIDER_HG_CLASS_NAME = "org.netbeans.modules.mercurial.HgModuleConfig"; //NOI18N + private static final String PROVIDER_CLASS_NAME = "org.netbeans.modules.versioning.util.OptionsPanelColorProvider"; //NOI18N + private static final String PROVIDER_GIT_CLASS_NAME = "org.netbeans.modules.git.GitModuleConfig"; //NOI18N + private static final String PROVIDER_SVN_CLASS_NAME = "org.netbeans.modules.subversion.SvnModuleConfig"; //NOI18N + private static final String PROVIDER_HG_CLASS_NAME = "org.netbeans.modules.mercurial.HgModuleConfig"; //NOI18N private static final String PROVIDER_DIFF_CLASS_NAME = "org.netbeans.modules.diff.DiffModuleConfig"; //NOI18N - private static final boolean no_load = false; + private static final boolean no_load = false; + private static final String DEFAULT_THEME_NAME = "NetBeans 5.5"; //NOI18N + + private static ClassLoader working_classLoader = null; private static Class COLOR_MODEL; private static Class EDITOR_SETTINGS; private static Class ANNOTATION_TYPE; - private static Class GIT_CONFIG; - - private static Field DisplayName; private static Field WaveUnderlineColor; private static Method getName; - private static Method getProfiles; private static Method getCurrentProfile; private static Method setCurrentProfile; @@ -87,35 +77,22 @@ public class TitanEditor { private static Method getLanguages; - private static Object const_DisplayName; private static Object const_WaveUnderlineColor; private static Object colorModel; - - private static final String DEFAULT_THEME_NAME = "NetBeans 5.5"; //NOI18N - //private static final String TITAN_THEME_NAME = NbBundle.getMessage(TitanLookAndFeel.class, "LBL_TITAN"); - + private static Class provider_GIT = null; private static Class provider_SVN = null; private static Class provider_HG = null; private static Class provider_CLASS = null; private static Class provider_DIFF = null; - - //private static Method provider_getInstance; -// private static Method provider_getColors; -// private static Method provider_colorsChanged; - private static Method provider_getDefault; private static Method provider_getPreferences; - private static ClassLoader working_classLoader = null; private static void extractDiffModule () throws IllegalAccessException { - - if (provider_DIFF != null) - { - + { HashMap linkMap = new HashMap(); java.awt.Color nb_diff_added_color = (java.awt.Color) UIManager.get ("nb.diff.added.color"); @@ -175,17 +152,13 @@ public class TitanEditor { res += "\n"; } } - - } catch (InvocationTargetException ex) { - Exceptions.printStackTrace(ex); } + catch (InvocationTargetException ex) {} res += "};\n"; res += "// \n"; System.out.println(res); } - - } private static void applyColorForDiffModule () throws IllegalAccessException, IllegalArgumentException, InvocationTargetException @@ -212,10 +185,8 @@ public class TitanEditor { getName = ANNOTATION_TYPE.getDeclaredMethod("getName", new Class[0]); - DisplayName = EDITOR_SETTINGS.getField("DisplayName"); //NOI18N WaveUnderlineColor = EDITOR_SETTINGS.getField("WaveUnderlineColor"); //NOI18N - getProfiles = COLOR_MODEL.getDeclaredMethod( "getProfiles", new Class[0] ); //NOI18N getCurrentProfile = COLOR_MODEL.getDeclaredMethod( "getCurrentProfile", new Class[0] ); //NOI18N setCurrentProfile = COLOR_MODEL.getDeclaredMethod( "setCurrentProfile", String.class ); //NOI18N @@ -241,7 +212,6 @@ public class TitanEditor { getLanguages = COLOR_MODEL.getDeclaredMethod( "getLanguages", new Class[0] ); //NOI18N - const_DisplayName = DisplayName.get(EDITOR_SETTINGS); const_WaveUnderlineColor = WaveUnderlineColor.get(EDITOR_SETTINGS); colorModel = COLOR_MODEL.newInstance(); @@ -256,22 +226,23 @@ public class TitanEditor { if (provider_CLASS != null) { - - try { + try + { provider_HG = working_classLoader.loadClass(PROVIDER_HG_CLASS_NAME); - } catch (ClassNotFoundException ex) {} + } + catch (ClassNotFoundException ex) {} - try { + try + { provider_SVN = working_classLoader.loadClass(PROVIDER_SVN_CLASS_NAME); - } catch (ClassNotFoundException ex) {} + } + catch (ClassNotFoundException ex) {} - try { + try + { provider_GIT = working_classLoader.loadClass(PROVIDER_GIT_CLASS_NAME); - } catch (ClassNotFoundException ex) {} - -// provider_getColors = provider_CLASS.getDeclaredMethod( "getColors", new Class[0] ); //NOI18N -// provider_colorsChanged = provider_CLASS.getDeclaredMethod( "colorsChanged", Map.class ); //NOI18N - + } + catch (ClassNotFoundException ex) {} } return true; @@ -294,115 +265,55 @@ public class TitanEditor { return false; } -// private static String setup_theme () throws IllegalAccessException, IllegalArgumentException, InvocationTargetException -// { -// // String current_profile -//// -//// Set profile_set = (Set) getProfiles.invoke( colorModel, new Object[0] ); -//// //boolean contain_target_theme = false; -////// for (String str : profile_set) -////// { -////// System.out.println("> " + str); -//////// if (str.equals(TITAN_THEME_NAME)) contain_target_theme = true; -//// } -//// -//// if (!contain_target_theme) -//// { -// // Ugly dublication routine, sorry NB developers... -// -// // } -// -// // setCurrentProfile.invoke(colorModel, TITAN_THEME_NAME); -// //} -// return current_profile; -// } - -// public static void remove_editor () throws IllegalAccessException, IllegalArgumentException, InvocationTargetException -// { -// Set profile_set = (Set) getProfiles.invoke( colorModel, new Object[0] ); -// boolean contain_target_theme = false; -// for (String str : profile_set) -// { -// if (str.equals(TITAN_THEME_NAME)) contain_target_theme = true; -// } -// -// if (contain_target_theme) -// { -// setCurrentProfile.invoke(colorModel, TITAN_THEME_NAME); -// -// -// setCurrentProfile.invoke(colorModel, DEFAULT_THEME_NAME); -// } -// -// -// -// -// } - - private static void extractColorsForModule (String name, Class provider) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { String res = "// " + "\npublic static final org.idp.laf.Color[] " + name + " = {\n"; + if (provider != null) { Preferences forModule = NbPreferences.forModule(provider); - try { + try + { for (String key : forModule.keys()) { - java.awt.Color cc = new java.awt.Color(Integer.parseInt(forModule.get(key, null))); - res += " " + (new Color(key, Color.ColorClass.AT, + java.awt.Color cc = new java.awt.Color(Integer.parseInt(forModule.get(key, null))); + res += " " + (new Color(key, Color.ColorClass.AT, cc.getRed(), cc.getGreen(), cc.getBlue(), cc.getAlpha(), "")).getString() + ",\n"; } - } catch (BackingStoreException ex) { - Exceptions.printStackTrace(ex); - } - + } + catch (BackingStoreException ex) {} } res += "};\n"; res += "// \n"; - System.out.println(res); } private static void applyColorForModule (Class provider, org.idp.laf.Color[] colors_theme) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - if (provider != null) { Preferences forModule = NbPreferences.forModule(provider); - try { - for (String key : forModule.keys()) - { - for (org.idp.laf.Color cc : colors_theme) - { - if (cc.getName().equals(key)) - { - java.awt.Color toSet = (java.awt.Color) cc.getObject(); - forModule.put(key, String.valueOf(toSet.getRGB())); - break; - } - } - - } - } catch (BackingStoreException ex) { - Exceptions.printStackTrace(ex); - } + for (org.idp.laf.Color cc : colors_theme) + { + java.awt.Color toSet = (java.awt.Color) cc.getObject(); + forModule.put(cc.getPname(), String.valueOf(toSet.getRGB())); + } } } - public static void load_editor () + public static void load_editor (boolean first_run) { if (!pre_load()) return; try { - // String swith_back = (String) getCurrentProfile.invoke( colorModel, new Object[0] ); + String swith_back = (String) getCurrentProfile.invoke( colorModel, new Object[0] ); if (no_load) { @@ -432,54 +343,49 @@ public class TitanEditor { extractColorsForModule ("SVN", provider_SVN); extractColorsForModule ("HG", provider_HG); - extractDiffModule(); - } else { - - - - setCurrentProfile.invoke(colorModel, DEFAULT_THEME_NAME); - Collection annotations = (Collection) getAnnotations.invoke(colorModel, DEFAULT_THEME_NAME); - Collection annotations_upd = apply_set ("annotations", annotations, true); - setAnnotations.invoke(colorModel, DEFAULT_THEME_NAME, annotations_upd); + setCurrentProfile.invoke(colorModel, DEFAULT_THEME_NAME); + Collection annotations = (Collection) getAnnotations.invoke(colorModel, DEFAULT_THEME_NAME); + Collection annotations_upd = apply_set ("annotations", annotations, true); + setAnnotations.invoke(colorModel, DEFAULT_THEME_NAME, annotations_upd); - Collection highlightings = (Collection) getHighlightings.invoke(colorModel, DEFAULT_THEME_NAME); - Collection highlightings_upd = apply_set ("highlightings", highlightings, false); - setHighlightings.invoke(colorModel, DEFAULT_THEME_NAME, highlightings_upd); + Collection highlightings = (Collection) getHighlightings.invoke(colorModel, DEFAULT_THEME_NAME); + Collection highlightings_upd = apply_set ("highlightings", highlightings, false); + setHighlightings.invoke(colorModel, DEFAULT_THEME_NAME, highlightings_upd); - Object languages = getLanguages.invoke( colorModel, new Object[0] ); - Set languages_set = (Set) languages; + Object languages = getLanguages.invoke( colorModel, new Object[0] ); + Set languages_set = (Set) languages; - for (String str : languages_set) + for (String str : languages_set) + { + if (str.equals("All Languages") || + str.equals("Java") || + str.equals("C++") || + str.equals("C")) { - if (str.equals("All Languages") || - str.equals("Java") || - str.equals("C++") || - str.equals("C")) - { - Collection category = (Collection) getCategories.invoke(colorModel, DEFAULT_THEME_NAME, str); - Collection category_upd = apply_set (str, category, false); - setCategories.invoke(colorModel, DEFAULT_THEME_NAME, str, category_upd); - - } - } + Collection category = (Collection) getCategories.invoke(colorModel, DEFAULT_THEME_NAME, str); + Collection category_upd = apply_set (str, category, false); + setCategories.invoke(colorModel, DEFAULT_THEME_NAME, str, category_upd); + + } + } + if (!first_run) + { + setCurrentProfile.invoke(colorModel, swith_back); + } + else + { applyColorForModule (provider_GIT, ColorTheme.GIT); applyColorForModule (provider_SVN, ColorTheme.SVN); - applyColorForModule (provider_HG, ColorTheme.HG); + applyColorForModule (provider_HG, ColorTheme.HG); applyColorForDiffModule (); - -// if (!first_run) -// { -// setCurrentProfile.invoke(colorModel, swith_back); -// } - } - - + } + } } catch (IllegalAccessException ex) { Exceptions.printStackTrace(ex); } catch (IllegalArgumentException ex) { @@ -537,8 +443,7 @@ public class TitanEditor { } private static SimpleAttributeSet apply_colors (AttributeSetConfigured asc, AttributeSet at, boolean annotation) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException - { - + { SimpleAttributeSet sas = new SimpleAttributeSet(at); if (sas.isDefined(StyleConstants.Background)) sas.removeAttribute(StyleConstants.Background); @@ -560,19 +465,14 @@ public class TitanEditor { if (asc.underColor != null) sas.addAttribute(const_WaveUnderlineColor, asc.underColor); } - Object annotationType = at.getAttribute("annotationType"); if (annotationType != null) { - Boolean v_isUseHighlightColor = null; - Boolean v_isInheritForegroundColor = null; - Boolean v_isUseWaveUnderlineColor = null; - if (annotation) { - v_isUseHighlightColor = (Boolean) isUseHighlightColor.invoke(annotationType, new Object[0]); - v_isInheritForegroundColor = (Boolean) isInheritForegroundColor.invoke(annotationType, new Object[0]); - v_isUseWaveUnderlineColor = (Boolean) isUseWaveUnderlineColor.invoke(annotationType, new Object[0]); + Boolean v_isUseHighlightColor = (Boolean) isUseHighlightColor.invoke(annotationType, new Object[0]); + Boolean v_isInheritForegroundColor = (Boolean) isInheritForegroundColor.invoke(annotationType, new Object[0]); + Boolean v_isUseWaveUnderlineColor = (Boolean) isUseWaveUnderlineColor.invoke(annotationType, new Object[0]); if (v_isUseHighlightColor) { @@ -585,9 +485,7 @@ public class TitanEditor { } if (v_isUseWaveUnderlineColor) - { - - + { setWaveUnderlineColor.invoke(annotationType, asc.a_getWaveUnderlineColor); } } @@ -598,14 +496,11 @@ public class TitanEditor { private static void process_set(String set_name, Collection data, boolean annotation) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { - - System.out.println("\n// "); LinkedList conf_annotations = new LinkedList(); for (AttributeSet at : data) { - //String description; String name = "BAD ASS"; Boolean v_isUseHighlightColor = null; @@ -615,12 +510,9 @@ public class TitanEditor { java.awt.Color a_getForegroundColor = null; java.awt.Color a_getWaveUnderlineColor = null; - if (annotation) { Object annotationType = at.getAttribute("annotationType"); - //System.out.println(">>> " + description + " | " + annotationType); - //String name = "BAD ASS"; if (annotationType != null) { name = (String) getName.invoke(annotationType, new Object[0]); @@ -640,24 +532,13 @@ public class TitanEditor { { name = (String) at.getAttribute(javax.swing.text.StyleConstants.NameAttribute); } -// else if (type == 2) -// { -// name = (String) at.getAttribute(javax.swing.text.StyleConstants.NameAttribute); -// } - //System.out.println(type + " : " + name ); - - + java.awt.Color bgColor = (java.awt.Color) at.getAttribute(StyleConstants.Background); java.awt.Color fgColor = (java.awt.Color) at.getAttribute(StyleConstants.Foreground); java.awt.Color underColor = (java.awt.Color) at.getAttribute(const_WaveUnderlineColor); - - - - Boolean bold = (Boolean) at.getAttribute(javax.swing.text.StyleConstants.FontConstants.Bold); Boolean italic = (Boolean) at.getAttribute(javax.swing.text.StyleConstants.FontConstants.Italic); - conf_annotations.add(new AttributeSetConfigured(name, bgColor, @@ -671,7 +552,6 @@ public class TitanEditor { a_getWaveUnderlineColor, bold, italic)); - } AttributeSetConfigured.compileSet(set_name, conf_annotations); diff --git a/src/org/idp/laf/TitanLookAndFeel.java b/src/org/idp/laf/TitanLookAndFeel.java index f7c3fbc..cc60b17 100644 --- a/src/org/idp/laf/TitanLookAndFeel.java +++ b/src/org/idp/laf/TitanLookAndFeel.java @@ -1,7 +1,7 @@ /* Copyright (C) Edward M. Kagan - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential - * Written by Edward M. Kagan , 2015 + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; @@ -11,11 +11,10 @@ import javax.swing.UIManager; import javax.swing.plaf.metal.MetalLookAndFeel; import static javax.swing.plaf.metal.MetalLookAndFeel.getCurrentTheme; import static javax.swing.plaf.metal.MetalLookAndFeel.setCurrentTheme; -import org.openide.util.NbBundle; import org.openide.util.NbPreferences; /** - * @author Edward M. Kagan + * @author Edward M. Kagan */ public class TitanLookAndFeel extends MetalLookAndFeel { @@ -42,44 +41,7 @@ public class TitanLookAndFeel extends MetalLookAndFeel { return true; } -// public static void self_remove () -// { -// UIManager.LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels(); -// -// for (UIManager.LookAndFeelInfo lafi : installedLookAndFeels) -// { -// System.out.println(">>>> " + lafi.getName()); -// String laf_name = NbBundle.getMessage(TitanLookAndFeel.class, "LBL_TITAN"); -// if (lafi.getName().equals(laf_name)) -// { -// System.out.print("LAF Persist - removing..."); -// int i = 0; -// UIManager.LookAndFeelInfo[] toSet = new UIManager.LookAndFeelInfo[installedLookAndFeels.length - 1]; -// for (UIManager.LookAndFeelInfo copy : installedLookAndFeels) -// { -// if (!copy.getName().equals(laf_name)) -// { -// toSet[i] = copy; -// i++; -// } -// } -// UIManager.setInstalledLookAndFeels(toSet); -// System.out.println("OK"); -// System.out.print("Setting Metal theme by default..."); -// try { -// UIManager.setLookAndFeel(MetalLookAndFeel.class.getName()); -// System.out.print("OK"); -// } catch (Exception ex) { -// System.out.print("FAIL"); -// } -// return; -// } -// } -// -// System.out.println("NO LAF - nothing to remove."); -// } - - @Override + @Override public String getName() { return "[idP!] Titan"; //NOI18N } diff --git a/src/org/idp/laf/TitanTheme.java b/src/org/idp/laf/TitanTheme.java index 296eec2..b5d1296 100644 --- a/src/org/idp/laf/TitanTheme.java +++ b/src/org/idp/laf/TitanTheme.java @@ -1,7 +1,7 @@ /* Copyright (C) Edward M. Kagan - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential - * Written by Edward M. Kagan , 2015 + * Written by Edward M. Kagan , 2015 */ package org.idp.laf; @@ -10,10 +10,9 @@ import javax.swing.UIDefaults; import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.FontUIResource; import javax.swing.plaf.metal.MetalTheme; -import org.openide.util.NbBundle; /** - * @author Edward M. Kagan + * @author Edward M. Kagan */ public class TitanTheme extends MetalTheme { diff --git a/src/org/idp/laf/tools/Scheme2Java.java b/src/org/idp/laf/tools/Scheme2Java.java index 7273752..6ce6f8f 100644 --- a/src/org/idp/laf/tools/Scheme2Java.java +++ b/src/org/idp/laf/tools/Scheme2Java.java @@ -1,14 +1,14 @@ /* Copyright (C) Edward M. Kagan - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential - * Written by Edward M. Kagan , 2015 + * Written by Edward M. Kagan , 2015 */ package org.idp.laf.tools; import org.idp.laf.Color; /** - * @author Edward M. Kagan + * @author Edward M. Kagan */ public class Scheme2Java {