예제 #1
0
 public void setMouseActionAttributes(
     String actionName,
     int modifier,
     ActionAttributes.ActionTrigger trigger,
     ActionAttributes.MouseAction[] mouseActions,
     double minValue,
     double maxValue,
     boolean smoothingEnabled,
     double smoothingValue) {
   ActionAttributes actionAttrs = this.getActionAttributes(DEVICE_MOUSE, actionName);
   if (actionAttrs != null) {
     actionAttrs.setValues(minValue, maxValue);
     actionAttrs.setMouseActions(mouseActions);
     actionAttrs.setActionTrigger(trigger);
     actionAttrs.setEnableSmoothing(smoothingEnabled);
     actionAttrs.setSmoothingValue(smoothingValue);
   } else {
     this.addAction(
         DEVICE_MOUSE,
         modifier,
         actionName,
         new ActionAttributes(
             mouseActions, trigger, minValue, maxValue, smoothingEnabled, smoothingValue));
   }
 }
예제 #2
0
 public void setValues(Object device, Object action, double minValue, double maxValue) {
   ActionAttributes actionAttrs = getActionAttributes(device, action);
   if (actionAttrs == null) {
     String message = Logging.getMessage("nullValue.AttributesIsNull");
     Logging.logger().severe(message);
     throw new IllegalArgumentException(message);
   } else {
     actionAttrs.setValues(minValue, maxValue);
   }
 }
예제 #3
0
 protected ActionAttributes makeSlowActionAttributes(
     ActionAttributes attributes, double slowCoefficient) {
   ActionAttributes slowAttributes = new ActionAttributes(attributes);
   double[] values = attributes.getValues();
   slowAttributes.setValues(values[0] * slowCoefficient, values[1] * slowCoefficient);
   slowAttributes.setEnableSmoothing(attributes.isEnableSmoothing());
   slowAttributes.setSmoothingValue(attributes.getSmoothingValue());
   slowAttributes.setKeyCodeModifier(attributes.getKeyCodeModifier());
   slowAttributes.setKeyActions(attributes.getKeyActions());
   return slowAttributes;
 }