Closed leuschel closed 1 year ago
Here is the file
MACHINE button_def
// An example that uses VisB DEFINITIONS instead of a JSON and SVG file
DEFINITIONS
VISB_JSON_FILE == "";
VISB_SVG_BOX == rec(height:200, width:240);
VISB_SVG_CONTENTS == '''
<circle cx=180 cy=100 r=20 fill="blue"></circle>
<defs>
<marker id="arrowhead" markerWidth="10" markerHeight="7"
refX="0" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" />
</marker>
<marker id="startarrow" markerWidth="10" markerHeight="7"
refX="10" refY="3.5" orient="auto">
<polygon points="10 0, 10 7, 0 3.5" fill="green" />
</marker>
<marker id="endarrow" markerWidth="10" markerHeight="7"
refX="0" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="green" />
</marker>
<marker id="circlmarker" markerWidth="12" markerHeight="12" refX="6" refY="6"
markerUnits="userSpaceOnUse">
<circle cx="6" cy="6" r="2"
fill="gray" stroke="context-stroke" stroke-width="2"/>
</marker>
</defs>
''';
VISB_SVG_OBJECTS == rec(`id`:"button", svg_class:"circle",
cx:"100",cy:"100", r:"80", stroke:"black", `stroke-width`:"3");
VISB_SVG_UPDATES == rec(`id`:"button",
fill: IF button=TRUE THEN "green" ELSE "red" END);
VISB_SVG_HOVERS == rec(`id`:"button",
stroke:"gray", `stroke-width`:"5");
VISB_SVG_OBJECTS_ARROW == rec( svg_class:"line",
`id`: "arrow",
y1:0,
x1:0,
y2:0,
x2:0,
stroke:"gray",
`stroke-width`:1.0,
`marker-end`: "url(#arrowhead)");
VISB_SVG_UPDATES2 == rec(`id`:"arrow2", visible:"TRUE",
x1:100,y1:100, y2:180.0, x2:100.0);
VISB_SVG_EVENT_toggle_button ==
"change the status of the button from " ^ TO_STRING(button) ^ " to " ^ TO_STRING(bool(button=FALSE));
VARIABLES button
INVARIANT button:BOOL
INITIALISATION button := FALSE
OPERATIONS
toggle_button /* desc change status of button */ = BEGIN
button:= bool(button=FALSE)
END
END
Hitting the Reload Button works and the visualisation appear.s
This problem occurs when the two paths that are being compared here: https://github.com/hhu-stups/prob2_ui/blob/11680fdfc8754906e9c08b5d91b45a1ea143d370/src/main/java/de/prob2/ui/visb/VisBView.java#L537 are not both absolute or relative.
Fixed
For the file "button_def" I did not see a VisB visualisation and was trying to click on the Settings / Crank Wheel button in the VisB view and got this exception: