36 lines
596 B
Java
36 lines
596 B
Java
package Classes.css.core.rule;
|
|
|
|
import Classes.css.core.Rule;
|
|
import javafx.scene.Node;
|
|
|
|
public class JavaFX implements Rule{
|
|
|
|
/* 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-' */
|
|
String css_prop = "-fx-"+this.l_side+": "+this.r_side+";"; // "name: val;"
|
|
|
|
/* (2) Apply to target */
|
|
target.setStyle(css_prop);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|