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=\
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-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")
public class Color implements Serializable{
int R;
int G;
int B;
int A;
String pname;
ColorClass cls;
String description;
public void printJava() {
String res = "color_map.add(";
@ -43,8 +51,6 @@ public class Color implements Serializable{
return res;
}
public enum ColorClass {
SF (javax.swing.plaf.ColorUIResource.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) {
this.A = color.getAlpha();
this.B = color.getBlue();
@ -99,8 +96,7 @@ public class Color implements Serializable{
return "C[" + this.pname + ":" + this.cls + ":" + R + "," + G + "," + B + "," + A + ":" + description + "]";
}
public Color (String str)
{
public Color (String str) {
if (str.startsWith("C"))
{
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);
switch (this.cls)
{
@ -187,16 +182,14 @@ public class Color implements Serializable{
return pname;
}
public void setObject ( java.awt.Color obj)
{
public void setObject ( java.awt.Color obj) {
this.A = obj.getAlpha();
this.B = obj.getBlue();
this.G = obj.getGreen();
this.R = obj.getRed();
}
public String getHEX ()
{
public String getHEX () {
java.awt.Color cc = new java.awt.Color(R, G, B, A);
return String.format("#%06X", (0xFFFFFF & cc.getRGB()));
}

@ -397,7 +397,6 @@ public static final org.twopm.laf.Color[] DIFF = {
};
//// </editor-fold>
public static final HashMap <String, HashMap <String, AttributeSetConfigured>> color_map;
static
@ -414,8 +413,6 @@ static
}
private static HashMap <String, AttributeSetConfigured> wrap (AttributeSetConfigured [] data)
{
HashMap <String, AttributeSetConfigured> data_map = new HashMap<String, AttributeSetConfigured>();
@ -426,5 +423,4 @@ private static HashMap <String, AttributeSetConfigured> wrap (AttributeSetConfi
return data_map;
}
}

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

@ -40,11 +40,11 @@ public class Kernel {
private static final boolean w_init = false;
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 ()
{
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 cfh_dir = retrieve_app_folder();
@ -181,9 +181,6 @@ public class Kernel {
UIManager.put ("Menu.border", mainMenuBorder);
UIManager.put ("MenuItem.border", itemBorder);
String [] side_components ={
"CheckBoxMenuItem.border",
"ScrollPane.border",
@ -238,7 +235,7 @@ public class Kernel {
private static String retrieve_app_folder ()
{
if (System.getProperty("os.name").startsWith("Windows")) {
return System.getenv("APPDATA") + File.separator + "twopm_scheme";
return System.getenv("APPDATA") + File.separator + "2pm_scheme";
} else {
return retrieve_netbeans_etc_dir ();
}
@ -379,12 +376,6 @@ public class Kernel {
Exceptions.printStackTrace(ex);
return false;
}
//}
// else
// {
// JOptionPane.showMessageDialog(null, "Unable to write '" + scheme_file + "'" );
// return false;
// }
}
private static boolean read_scheme(String scheme_file) {

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

@ -53,7 +53,7 @@ public class TitanTheme extends MetalTheme {
@Override
public String getName() {
return "[twopm!] Titan"; //NOI18N
return "[2pm.tech] Titan"; //NOI18N
}
// FUCKERS - it's not obligatory to override this - IDIOTS!!!

Loading…
Cancel
Save