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