/** * Adds auto-direction adjustment to a given object: * - Creates an AutoDirectionHandler. * - Initializes it with the given DirectionEstimator. * - Adds it as an event handler for the relevant events on the given object. * - Returns the AutoDirectionHandler, so its setAutoDir() method can be * called when the object's text changes by means other than the handled * events. * * @param target Object whose direction should be automatically adjusted on * relevant events. * @param directionEstimator A DirectionEstimator object used for direction * estimation (use null to disable direction estimation). * @return AutoDirectionHandler An instance of AutoDirectionHandler for the * given object. */ public static AutoDirectionHandler addTo(Target target, DirectionEstimator directionEstimator) { return new AutoDirectionHandler(target, directionEstimator); }
/** * Adds auto-direction adjustment to a given object: * - Creates an AutoDirectionHandler. * - Initializes it with the given DirectionEstimator. * - Adds it as an event handler for the relevant events on the given object. * - Returns the AutoDirectionHandler, so its setAutoDir() method can be * called when the object's text changes by means other than the handled * events. * * @param target Object whose direction should be automatically adjusted on * relevant events. * @param directionEstimator A DirectionEstimator object used for direction * estimation (use null to disable direction estimation). * @return AutoDirectionHandler An instance of AutoDirectionHandler for the * given object. */ public static AutoDirectionHandler addTo(Target target, DirectionEstimator directionEstimator) { return new AutoDirectionHandler(target, directionEstimator); }
/** * Adds auto-direction adjustment to a given object: * - Creates an AutoDirectionHandler. * - Initializes it with the given DirectionEstimator. * - Adds it as an event handler for the relevant events on the given object. * - Returns the AutoDirectionHandler, so its setAutoDir() method can be * called when the object's text changes by means other than the handled * events. * * @param target Object whose direction should be automatically adjusted on * relevant events. * @param directionEstimator A DirectionEstimator object used for direction * estimation (use null to disable direction estimation). * @return AutoDirectionHandler An instance of AutoDirectionHandler for the * given object. */ public static AutoDirectionHandler addTo(Target target, DirectionEstimator directionEstimator) { return new AutoDirectionHandler(target, directionEstimator); }