com.kuka.roboticsAPI.uiModel.userKeys
Interface IUserKey


public interface IUserKey

Interface for a user key.

A user key can be created by adding it to a IUserKeyBar . It can be set up with different looks and custom behaviors.
The display area for a user key is set up in a 3x3 grid. All 9 spaces can be filled with UserKeyLEDElements or UserKeyTextElements.
By setting up a IUserKeyListener, the programmer can listen for different UserKeyEvents and define custom reactions for them.


Method Summary
 void addKeyListener(IUserKeyListener listener)
          Adds the specified key listener to the user key.
 String getCriticalText()
          Gets the confirmation text of a critical user key.
 UserKeyElement getElement(com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment position)
          Gets the user key element at the specified position.
 int getSlot()
          Gets the index of the user key slot on the user key bar.
 boolean isCritical()
          Indicates whether a user key is critical or not.
 boolean isDoubleKey()
          Indicates whether a user key is a double user key.
 boolean isEnabled()
          Indicates whether a user key is enabled or not.
 UserKeyElement removeElement(com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment position)
          Removes the user key element at the specified position.
 void removeKeyListener(IUserKeyListener listener)
          Removes the specified listener from the user key.
 void setCriticalText(String warningText)
          Sets the confirmation text for and thereby defines this user key as critical.
 void setElement(UserKeyElement... element)
          Sets a user key element to the user key.
 void setEnabled(boolean isEnabled)
          Sets a user key to enabled or disabled.
 void setLED(com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment position, com.kuka.roboticsAPI.uiModel.userKeys.UserKeyLED led, com.kuka.roboticsAPI.uiModel.userKeys.UserKeyLEDSize size)
          Sets a LED with the given size on the user key at the specified position.
 void setText(com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment position, String text)
          Sets the text on the user key at the specified position.
 

Method Detail

setCriticalText

void setCriticalText(String warningText)
Sets the confirmation text for and thereby defines this user key as critical.

A critical user key displays the specified text as a warning when it is clicked (KeyDown). The user has to acknowledge this warning by clicking the user key again, before the function of the user key is executed. There is a timeout of 4 seconds before the warning can be acknowledged. Note that a critical user key only allows a custom reaction when the button is clicked (KeyDown). Button release events (KeyUp) are ignored.

Parameters:
warningText - the text that is displayed when the user key is clicked. Setting this parameter to null or empty string makes the key non critical.

getCriticalText

String getCriticalText()
Gets the confirmation text of a critical user key.

Returns:
the text that is displayed when the user key is clicked.

isCritical

boolean isCritical()
Indicates whether a user key is critical or not.

A critical user key needs a confirmation by the user to be executed.

Returns:
true if the user key is critical, false otherwise.
See Also:
setCriticalText(String)

getSlot

int getSlot()
Gets the index of the user key slot on the user key bar.

The index is zero-based.

Returns:
the slot on the user key bar.

isDoubleKey

boolean isDoubleKey()
Indicates whether a user key is a double user key.

A double user key takes two slots on the user key bar.

Returns:
true if the user key is a double user key, false otherwise.

addKeyListener

void addKeyListener(IUserKeyListener listener)
Adds the specified key listener to the user key.

The listener can define behavior in case of a user key click event.

Parameters:
listener - the listener for this user key.

removeKeyListener

void removeKeyListener(IUserKeyListener listener)
Removes the specified listener from the user key.

Parameters:
listener - the listener that should be removed.

setEnabled

void setEnabled(boolean isEnabled)
Sets a user key to enabled or disabled.

Disabled user keys are still part of the user key bar, but cannot be clicked. By default, the user keys are set as enabled.

Parameters:
isEnabled - Boolean flag indicating whether the user key is enabled or not.

isEnabled

boolean isEnabled()
Indicates whether a user key is enabled or not.

Disabled user keys are still part of the user key bar, but cannot be clicked. By default, the user keys are set as enabled.

Returns:
true if the user key is enabled, false otherwise.

setText

void setText(com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment position,
             String text)
Sets the text on the user key at the specified position.

Parameters:
position - the position for the given text. Can not be null.
text - the text that should be displayed on the user key. Can not be null or empty.

setLED

void setLED(com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment position,
            com.kuka.roboticsAPI.uiModel.userKeys.UserKeyLED led,
            com.kuka.roboticsAPI.uiModel.userKeys.UserKeyLEDSize size)
Sets a LED with the given size on the user key at the specified position.

Parameters:
position - the position for the LED. Can not be null.
led - the color of the LED. Can not be null.
size - the size of the LED. If set to null - size UserKeyLEDSize.Normal will be used.

setElement

void setElement(UserKeyElement... element)
Sets a user key element to the user key.

It contains information on the position and content of the user key element.

Parameters:
element - the element that should be displayed on the user key. Can not be null.

getElement

UserKeyElement getElement(com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment position)
Gets the user key element at the specified position.

Parameters:
position - the position from which to get the user key element.
Returns:
the user key element.

removeElement

UserKeyElement removeElement(com.kuka.roboticsAPI.uiModel.userKeys.UserKeyAlignment position)
Removes the user key element at the specified position.

Parameters:
position - the position from which to remove the user key element.
Returns:
the removed user key element.


Copyright © 2019. All rights reserved.