Fixed loading issue.

master
pagan 7 years ago
parent cc2db06a26
commit 43a9bd1d21

@ -2,4 +2,4 @@ OpenIDE-Module-Display-Category=Team
OpenIDE-Module-Long-Description=\ OpenIDE-Module-Long-Description=\
This plugin was designed only to compose well readable and enoght dark theme for Netbeans, But day by day it was enlarging - and now it is what it is. This plugin was designed only to compose well readable and enoght dark theme for Netbeans, But day by day it was enlarging - and now it is what it is.
OpenIDE-Module-Name=2pmTech L&F OpenIDE-Module-Name=2pmTech L&F
OpenIDE-Module-Short-Description=Editor for Netbeans Metal Look and Feel OpenIDE-Module-Short-Description=Editor for Netbeans Titan Look and Feel

@ -11,6 +11,14 @@ import static org.twopm.laf.Color.ColorClass.SF;
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public class Color implements Serializable{ public class Color implements Serializable{
int R;
int G;
int B;
int A;
String pname;
ColorClass cls;
String description;
public void printJava() { public void printJava() {
String res = "color_map.add("; String res = "color_map.add(";
@ -19,7 +27,7 @@ public class Color implements Serializable{
System.out.println(res); System.out.println(res);
} }
public String getString() { public String getString() {
String res = "new org.twopm.laf.Color(\""; String res = "new org.twopm.laf.Color(\"";
res += this.pname + "\", "; res += this.pname + "\", ";
@ -42,9 +50,7 @@ public class Color implements Serializable{
res += ")"; res += ")";
return res; return res;
} }
public enum ColorClass { public enum ColorClass {
SF (javax.swing.plaf.ColorUIResource.class), SF (javax.swing.plaf.ColorUIResource.class),
AT (java.awt.Color.class); AT (java.awt.Color.class);
@ -61,15 +67,6 @@ public class Color implements Serializable{
} }
} }
int R;
int G;
int B;
int A;
String pname;
ColorClass cls;
String description;
public Color(javax.swing.plaf.ColorUIResource color) { public Color(javax.swing.plaf.ColorUIResource color) {
this.A = color.getAlpha(); this.A = color.getAlpha();
this.B = color.getBlue(); this.B = color.getBlue();
@ -80,7 +77,7 @@ public class Color implements Serializable{
this.description = ""; this.description = "";
} }
public Color(String pname, ColorClass cls, int red, int green, int blue, int alpha, String desc) { public Color(String pname, ColorClass cls, int red, int green, int blue, int alpha, String desc) {
this.A = alpha; this.A = alpha;
this.B = blue; this.B = blue;
this.G = green; this.G = green;
@ -99,8 +96,7 @@ public class Color implements Serializable{
return "C[" + this.pname + ":" + this.cls + ":" + R + "," + G + "," + B + "," + A + ":" + description + "]"; return "C[" + this.pname + ":" + this.cls + ":" + R + "," + G + "," + B + "," + A + ":" + description + "]";
} }
public Color (String str) public Color (String str) {
{
if (str.startsWith("C")) if (str.startsWith("C"))
{ {
String real = str.substring(2, str.length() - 1); String real = str.substring(2, str.length() - 1);
@ -135,8 +131,7 @@ public class Color implements Serializable{
} }
public Object getObject () public Object getObject () {
{
java.awt.Color cc = new java.awt.Color(R, G, B, A); java.awt.Color cc = new java.awt.Color(R, G, B, A);
switch (this.cls) switch (this.cls)
{ {
@ -187,16 +182,14 @@ public class Color implements Serializable{
return pname; return pname;
} }
public void setObject ( java.awt.Color obj) public void setObject ( java.awt.Color obj) {
{
this.A = obj.getAlpha(); this.A = obj.getAlpha();
this.B = obj.getBlue(); this.B = obj.getBlue();
this.G = obj.getGreen(); this.G = obj.getGreen();
this.R = obj.getRed(); this.R = obj.getRed();
} }
public String getHEX () public String getHEX () {
{
java.awt.Color cc = new java.awt.Color(R, G, B, A); java.awt.Color cc = new java.awt.Color(R, G, B, A);
return String.format("#%06X", (0xFFFFFF & cc.getRGB())); return String.format("#%06X", (0xFFFFFF & cc.getRGB()));
} }

@ -12,7 +12,7 @@ public class ColorTheme {
// <editor-fold desc="annotations" defaultstate="collapsed"> // <editor-fold desc="annotations" defaultstate="collapsed">
private static final AttributeSetConfigured [] annotations = { private static final AttributeSetConfigured [] annotations = {
new AttributeSetConfigured ("debugger-mixed_BP", new Color (252, 157, 159, 255), null, null, true, true, false, new Color (252, 157, 159, 255), new Color (252, 157, 159, 255), null, null, null), new AttributeSetConfigured ("debugger-mixed_BP", new Color (252, 157, 159, 255), null, null, true, true, false, new Color (252, 157, 159, 255), new Color (252, 157, 159, 255), null, null, null),
new AttributeSetConfigured ("Dbx_Bpt_cmpx_hit_dis", new Color (189, 230, 170, 255), null, null, true, true, false, new Color (189, 230, 170, 255), new Color (189, 230, 170, 255), null, null, null), new AttributeSetConfigured ("Dbx_Bpt_cmpx_hit_dis", new Color (189, 230, 170, 255), null, null, true, true, false, new Color (189, 230, 170, 255), new Color (189, 230, 170, 255), null, null, null),
new AttributeSetConfigured ("OtherThreads_DBP", new Color (220, 220, 216, 255), null, null, true, true, false, new Color (220, 220, 216, 255), new Color (220, 220, 216, 255), null, null, null), new AttributeSetConfigured ("OtherThreads_DBP", new Color (220, 220, 216, 255), null, null, true, true, false, new Color (220, 220, 216, 255), new Color (220, 220, 216, 255), null, null, null),
new AttributeSetConfigured ("stopwatchProfilingPoint", new Color (180, 228, 252, 255), null, null, true, true, false, new Color (180, 228, 252, 255), new Color (180, 228, 252, 255), null, null, null), new AttributeSetConfigured ("stopwatchProfilingPoint", new Color (180, 228, 252, 255), null, null, true, true, false, new Color (180, 228, 252, 255), new Color (180, 228, 252, 255), null, null, null),
@ -228,7 +228,7 @@ private static final AttributeSetConfigured [] lang_Java = {
// <editor-fold desc="C++" defaultstate="collapsed"> // <editor-fold desc="C++" defaultstate="collapsed">
private static final AttributeSetConfigured [] lang_CPP = { private static final AttributeSetConfigured [] lang_CPP = {
new AttributeSetConfigured ("string", null, null, null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("string", null, null, null, null, null, null, null, null, null, null, null),
new AttributeSetConfigured ("pragma-omp-keyword-directive", null, null, null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("pragma-omp-keyword-directive", null, null, null, null, null, null, null, null, null, null, null),
new AttributeSetConfigured ("preprocessor", null, new Color (0, 155, 0, 255), null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("preprocessor", null, new Color (0, 155, 0, 255), null, null, null, null, null, null, null, null, null),
new AttributeSetConfigured ("cc-highlighting-function", null, null, null, null, null, null, null, null, null, null, null), new AttributeSetConfigured ("cc-highlighting-function", null, null, null, null, null, null, null, null, null, null, null),
@ -397,7 +397,6 @@ public static final org.twopm.laf.Color[] DIFF = {
}; };
//// </editor-fold> //// </editor-fold>
public static final HashMap <String, HashMap <String, AttributeSetConfigured>> color_map; public static final HashMap <String, HashMap <String, AttributeSetConfigured>> color_map;
static static
@ -414,8 +413,6 @@ static
} }
private static HashMap <String, AttributeSetConfigured> wrap (AttributeSetConfigured [] data) private static HashMap <String, AttributeSetConfigured> wrap (AttributeSetConfigured [] data)
{ {
HashMap <String, AttributeSetConfigured> data_map = new HashMap<String, AttributeSetConfigured>(); HashMap <String, AttributeSetConfigured> data_map = new HashMap<String, AttributeSetConfigured>();
@ -426,5 +423,4 @@ private static HashMap <String, AttributeSetConfigured> wrap (AttributeSetConfi
return data_map; return data_map;
} }
} }

@ -47,11 +47,6 @@ public class Installer extends ModuleInstall
} }
}); });
} }
} }
@Override @Override

@ -40,11 +40,11 @@ public class Kernel {
private static final boolean w_init = false; private static final boolean w_init = false;
public static Color[] color_scheme_loaded; public static Color[] color_scheme_loaded;
private static final String scheme_file_name = "netbeans.twopm_scheme"; private static final String scheme_file_name = "netbeans.2pm_scheme";
public static void load_kernel () public static void load_kernel ()
{ {
if (UIManager.getLookAndFeel().getName().equals("[twopm!] Titan")) //NOI18N if (UIManager.getLookAndFeel().getName().equals("[2pm.tech] Titan")) //NOI18N
{ {
String nb_etc = retrieve_netbeans_etc_dir(); String nb_etc = retrieve_netbeans_etc_dir();
String cfh_dir = retrieve_app_folder(); String cfh_dir = retrieve_app_folder();
@ -180,10 +180,7 @@ public class Kernel {
UIManager.put ("MenuBar.border", buttons_border); UIManager.put ("MenuBar.border", buttons_border);
UIManager.put ("Menu.border", mainMenuBorder); UIManager.put ("Menu.border", mainMenuBorder);
UIManager.put ("MenuItem.border", itemBorder); UIManager.put ("MenuItem.border", itemBorder);
String [] side_components ={ String [] side_components ={
"CheckBoxMenuItem.border", "CheckBoxMenuItem.border",
"ScrollPane.border", "ScrollPane.border",
@ -238,7 +235,7 @@ public class Kernel {
private static String retrieve_app_folder () private static String retrieve_app_folder ()
{ {
if (System.getProperty("os.name").startsWith("Windows")) { if (System.getProperty("os.name").startsWith("Windows")) {
return System.getenv("APPDATA") + File.separator + "twopm_scheme"; return System.getenv("APPDATA") + File.separator + "2pm_scheme";
} else { } else {
return retrieve_netbeans_etc_dir (); return retrieve_netbeans_etc_dir ();
} }
@ -379,12 +376,6 @@ public class Kernel {
Exceptions.printStackTrace(ex); Exceptions.printStackTrace(ex);
return false; return false;
} }
//}
// else
// {
// JOptionPane.showMessageDialog(null, "Unable to write '" + scheme_file + "'" );
// return false;
// }
} }
private static boolean read_scheme(String scheme_file) { private static boolean read_scheme(String scheme_file) {

@ -18,7 +18,7 @@ public class TitanLookAndFeel extends MetalLookAndFeel {
UIManager.LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels(); UIManager.LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels();
for (UIManager.LookAndFeelInfo lafi : installedLookAndFeels) for (UIManager.LookAndFeelInfo lafi : installedLookAndFeels)
{ {
String laf_name = "[twopm!] Titan"; //NOI18N String laf_name = "[2pm.tech] Titan"; //NOI18N
if (lafi.getName().equals(laf_name)) if (lafi.getName().equals(laf_name))
{ {
System.out.println("LAF Persist - no install."); System.out.println("LAF Persist - no install.");
@ -26,7 +26,7 @@ public class TitanLookAndFeel extends MetalLookAndFeel {
} }
} }
System.out.print("NO LAF - installing... "); System.out.print("NO LAF - installing... ");
UIManager.installLookAndFeel(new UIManager.LookAndFeelInfo("[twopm!] Titan" , TitanLookAndFeel.class.getName()) ); //NOI18N UIManager.installLookAndFeel(new UIManager.LookAndFeelInfo("[2pm.tech] Titan" , TitanLookAndFeel.class.getName()) ); //NOI18N
System.out.println("OK"); System.out.println("OK");
System.out.print("Applying LAf... "); System.out.print("Applying LAf... ");
@ -38,7 +38,7 @@ public class TitanLookAndFeel extends MetalLookAndFeel {
@Override @Override
public String getName() { public String getName() {
return "[twopm!] Titan"; //NOI18N return "[2pm.tech] Titan"; //NOI18N
} }
@Override @Override

@ -24,7 +24,7 @@ public class TitanTheme extends MetalTheme {
@Override @Override
public void addCustomEntriesToTable(UIDefaults table) { public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table); //To change body of generated methods, choose Tools | Templates. super.addCustomEntriesToTable(table); //To change body of generated methods, choose Tools | Templates.
table.put( "nb.imageicon.filter", new DarkIconFilter() ); //NOI18N table.put("nb.imageicon.filter", new DarkIconFilter() ); //NOI18N
} }
private final static FontUIResource DEFAULT_FONT = new FontUIResource("Dialog", Font.PLAIN, 11); //NOI18N private final static FontUIResource DEFAULT_FONT = new FontUIResource("Dialog", Font.PLAIN, 11); //NOI18N
@ -53,7 +53,7 @@ public class TitanTheme extends MetalTheme {
@Override @Override
public String getName() { public String getName() {
return "[twopm!] Titan"; //NOI18N return "[2pm.tech] Titan"; //NOI18N
} }
// FUCKERS - it's not obligatory to override this - IDIOTS!!! // FUCKERS - it's not obligatory to override this - IDIOTS!!!

Loading…
Cancel
Save