Skip to content

Alphabet Annotations

HansvdLaan edited this page Apr 26, 2018 · 18 revisions

These are the annotations which can be used to set details about the alphabet of the experiment. Below all annotations are quickly explained together with a few small examples. More details about these annotations can be found in their respective JavaDoc.

Currently, all primitives and strings are allowed as parameters. Furthermore, we have a specific set of JavaFX parameters. Examples of parameters are: int:5, string:some_string, char:v and javaFX:mouse_press.

@FunctionSymbol

The FunctionSymbol annotation is used to create a new input symbol for this function.

@FunctionSymbol(symbolID = "FooFunction", predicates = {"PredicateA"}) public void foo() { // some code }

@FieldMethodSymbol

The FieldMethodSymbol annotation is used to create input symbols for methods which could be executed on this field. For example, if you have got a field 'Button b' in your class, you can annotate it with this annotation and create an input symbol for methods executable on this field such as setVisible(boolean).

@FieldMethodSymbol(fieldID = "Game", fieldMethods = {"giveTokens(int)"}, 
parameters = "int:10", outputIDs = "output")
public Game game;

@WidgetSymbol

The WidgetSymbol annotation is used to create input symbols for events which could be handled by this widget. Currently all widgets extending javafx.scene.Node and implementing the event handler interface are supported. The supported events are: "mouse_drag_detect", "mouse_click", "mouse_drag", "mouse_enter", "mouse_exit", "mouse_move", "mouse_press" and "mouse_release"

@WidgetSymbol(widgetID = "button", events = {"mouse_press","mouse_release"}, 
outputIDs = {"output","output"})
public Button rhythmButton;
Clone this wiki locally