JavaFX/Classes/css/core/rule/JavaFX.java

42 lines
663 B
Java
Raw Permalink Normal View History

2017-11-14 15:53:47 +00:00
package Classes.css.core.rule;
import Classes.css.core.Rule;
import javafx.scene.Node;
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-' */
String css_prop = this.toString(); // "name: val;"
2017-11-14 15:53:47 +00:00
/* (2) Apply to target */
target.setStyle(css_prop);
}
@Override
public String toString() {
return "-fx-"+this.l_side+": "+this.r_side+";";
}
2017-11-14 15:53:47 +00:00
}