2017-11-14 15:53:47 +00:00
|
|
|
package Classes.css.core.rule;
|
|
|
|
|
|
|
|
import Classes.css.core.Rule;
|
|
|
|
import javafx.scene.Node;
|
|
|
|
|
2017-11-15 17:12:46 +00:00
|
|
|
public class JavaFX extends Rule{
|
2017-11-14 15:53:47 +00:00
|
|
|
|
|
|
|
/* Attributes */
|
|
|
|
private String l_side;
|
|
|
|
private String r_side;
|
|
|
|
|
|
|
|
|
|
|
|
/* Constructor -> Dispatch attributes */
|
|
|
|
public JavaFX(String l_side, String r_side){
|
|
|
|
|
|
|
|
/* (1) Initialize values */
|
|
|
|
this.l_side = l_side;
|
|
|
|
this.r_side = r_side;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void apply(Node target){
|
|
|
|
|
|
|
|
/* (1) Prefix with '-fx-' */
|
2017-11-15 17:12:46 +00:00
|
|
|
String css_prop = this.toString(); // "name: val;"
|
2017-11-14 15:53:47 +00:00
|
|
|
|
|
|
|
/* (2) Apply to target */
|
|
|
|
target.setStyle(css_prop);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-15 17:12:46 +00:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "-fx-"+this.l_side+": "+this.r_side+";";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-14 15:53:47 +00:00
|
|
|
}
|