|
|
|
|
@ -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()));
|
|
|
|
|
}
|
|
|
|
|
|