File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
main/java/org/fxapps/llmfx/tools/graphics
test/java/org/fxapps/llmfx/tools/graphics Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,12 @@ You can draw using the following commands separated by line break (\n):
6464 text x y "string"
6565 """ )
6666 public void draw (String dsl ) {
67- clearRenderNode ();
67+ applyDSL (dsl );
68+ setEditorContent (dsl );
69+ }
70+
71+ void applyDSL (String dsl ) {
72+ clearRenderNode ();
6873 String [] lines = dsl .split ("\\ R" );
6974 for (String line : lines ) {
7075 var tokens = line .trim ().split ("\\ s+" );
@@ -117,7 +122,6 @@ public void draw(String dsl) {
117122
118123 }
119124 }
120- setEditorContent (dsl );
121125 }
122126
123127 private double [][] extractPoints (double [] params ) {
Original file line number Diff line number Diff line change @@ -17,12 +17,13 @@ class JFXDrawerToolTest {
1717 @ BeforeEach
1818 public void setup () {
1919 tool = new JFXDrawerTool ();
20- tool .gc = mock ();
20+ tool .gc = mock ();
21+
2122 }
2223
2324 @ Test
2425 public void testDSL () {
25- tool .draw ("""
26+ tool .applyDSL ("""
2627 background 0 10 20
2728 color 255 200 10
2829 rect 1 2 3 4
You can’t perform that action at this time.
0 commit comments