Package org.hyperonline.hyperlib.oi
Class ButtonData
- java.lang.Object
-
- org.hyperonline.hyperlib.oi.ButtonData
-
public class ButtonData extends java.lang.ObjectThis class is an intermediate data structure used inOIand in RobotInspector. It holds information parsed out of the OI map for a particular binding of a button to a command.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classButtonData.ActionAn Action describes what action on a button (pressed, released, held) should trigger a command to run.
-
Constructor Summary
Constructors Constructor Description ButtonData(int port, ButtonData.Action action, java.lang.reflect.Field field)Construct a new ButtonData object from parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ButtonData.Actionaction()Get the action which triggers a commandjava.lang.Stringdescription()Get a string description of the button/command mapping.java.lang.reflect.Fieldfield()Get the field in the OI map corresponding to this buttonjava.lang.Stringname()Get the name of the button/command mapping.intport()Get the id of the button
-
-
-
Constructor Detail
-
ButtonData
public ButtonData(int port, ButtonData.Action action, java.lang.reflect.Field field)Construct a new ButtonData object from parameters- Parameters:
port- The id number of the button, starting at 1action- The action which will trigger a commandfield- The field of the OIMap class which corresponds to the command to run
-
-
Method Detail
-
port
public int port()
Get the id of the button- Returns:
- The id of the button
-
action
public ButtonData.Action action()
Get the action which triggers a command- Returns:
- the action which triggers a command
-
name
public java.lang.String name()
Get the name of the button/command mapping. This is the name of the field in OIMap corresponding to this button.- Returns:
- The name of the button/command mapping.
-
field
public java.lang.reflect.Field field()
Get the field in the OI map corresponding to this button- Returns:
- The filed in the OI map corresponding to this button
-
description
public java.lang.String description()
Get a string description of the button/command mapping. This includes the action and the name. This is used for making the joystick diagrams.- Returns:
- A string description of the button/command mapping.
-
-