You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.5 KiB
Java
63 lines
1.5 KiB
Java
/*
|
|
* 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.
|
|
*/
|
|
package org.idp.laf.settings;
|
|
|
|
import java.io.Serializable;
|
|
import static org.idp.laf.settings.Font.FontClass.FA;
|
|
import static org.idp.laf.settings.Font.FontClass.FS;
|
|
|
|
/**
|
|
*
|
|
* @author Edward M. Kagan <root@paganware.com>
|
|
*/
|
|
public class Gradient implements Serializable{
|
|
|
|
String pname;
|
|
float I;
|
|
float J;
|
|
Color A;
|
|
Color B;
|
|
Color C;
|
|
|
|
public Gradient(String pname, float I, float J, Color A, Color B, Color C) {
|
|
this.pname = pname;
|
|
this.I = I;
|
|
this.J = J;
|
|
this.A = A;
|
|
this.B = B;
|
|
this.C = C;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "G[" + this.pname + ";" + I + ";" + J + ";" + A.toString() + ";" + B.toString() + ";" + C.toString() + "]";
|
|
}
|
|
|
|
public Gradient (String str)
|
|
{
|
|
if (str.startsWith("G"))
|
|
{
|
|
String real = str.substring(2, str.length() - 1);
|
|
String [] vals = real.split(";");
|
|
|
|
this.pname = vals[0];
|
|
System.out.println(">>" + vals[1]);
|
|
this.I = Float.parseFloat(vals[1]);
|
|
this.J = Float.parseFloat(vals[2]);
|
|
this.A = new Color(vals[3]);
|
|
this.B = new Color(vals[4]);
|
|
this.C = new Color(vals[5]);
|
|
}
|
|
else
|
|
{
|
|
System.err.println("FUCK OFF - poor format");
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|