Ejemplo n.º 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));
   }
 }
Ejemplo n.º 2
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;
 }