...
Commands that are shipped by default also show up the default user input mask that may not suit well into the host applications surface. The CFxARESInstance allows to disable the predefined controls using the method switchStandardUserInputSetUIConfiguration(). Once this is done it is necessary to create a custom input that cooperates with commands. Whenever a command requires an user action the custom input should request for corresponding values. This can be accomplished with the CFxUserInputDelegate. The CFxUserInputDelegate informs the host application when an user interaction starts interactionStarted() or ends interactionEnded(). The DWG Expert controls a class UserInput.java that takes over the job of the delegate and the user interface. The class must be instantiated and registered as main CFxUserInputDelegate. Depending on the started interaction type the custom user input has to accept the command value or exit the command procedure. The DWG Expert relies on point input and demonstrates the use of acceptWithCoordinates() and cancel().
UIConfiguration
The default value is 7. Get the current value with GetUIConfiguration() from CFxARESInstance.
Flag | Value | Description |
---|---|---|
| 0 | This flag overrides and disables the default user input |
| 1 | The standard user input for commands, all features enabled |
| 2 | This flag can be removed to hide the help button |
| 4 | This flag can be removed to hide the Pan/Orbit button |
The method interactionStarted( final String prompt, String[] keywords, int inputType ) basically provides the following kind of data:
Type | Description |
---|---|
prompt | The current command prompt that can be displayed |
keywords | The current command keywords that can be displayed or executed with CFxARESInstance.instance().userInput().acceptWithStringResult() |
inputType | The type of the current command prompt. The active type should be addressed accordingly in the custom user interface. Some types like GetPoint or GetDistance do not require user input fields when the host application only wants to allow picking a point or specifying a distance on the graphics area. Types likes GetKeyword or GetString can not be processed on the graphics area and require corresponding and suitable input fields. |
The command prompt input types are:
...