Ok Alex,

I reverted it, I thought Timer was incomplete. I think I can pass for now
without a complete event. If I need it I'll plan an extension like your
sugesstion

Thanks!

Carlos


El jue., 29 nov. 2018 a las 20:20, Alex Harui (<[email protected]>)
escribió:

> In the Core, we want to keep PAYG in mind.  So for any feature you want to
> add, the question is what is the cost of adding it and how many people
> really need it?  We have several patterns in Royale, such as
> SimpleCSSValuesImpl and AllCSSValuesImpl (and someday, potentially some
> versions in the middle), or we have Basic and Express, or we Strands with
> more and more complex Beads.
>
> I think the Timer as it existed was designed to keep calling you back on
> an interval, so I don't think there is/should-be a concept of "complete".
> So maybe you want add a TimerWithDuration class, or maybe you are trying
> more for SetTimeout kind of functionality.  The Effects subsystem does have
> a concept of "complete" like "tweenEnd" and "effectEnd" (or it should if it
> doesn't), so if you are using Timer for animation, you might want to
> leverage Effects instead.
>
>  HTH,
> -Alex
>
> On 11/29/18, 10:41 AM, "Carlos Rovira" <[email protected]> wrote:
>
>     Ok Alex,
>     so better remove TimerEvent
>     I saw we didn't have timerComplete.
>     Is ok to dispatch there?
>
>     thanks
>
>     El jue., 29 nov. 2018 a las 18:16, Alex Harui
> (<[email protected]>)
>     escribió:
>
>     > Hi,
>     >
>     > We are using a different pattern for events.  There should not be a
> Timer
>     > event in the core.  Royale tries to use as few events as possible so
>     > classes reuse these event classes and store the event names in the
> class,
>     > not the event class.
>     >
>     > Thanks,
>     > -Alex
>     >
>     > On 11/29/18, 6:01 AM, "[email protected]" <
> [email protected]>
>     > wrote:
>     >
>     >     This is an automated email from the ASF dual-hosted git
> repository.
>     >
>     >     carlosrovira pushed a commit to branch develop
>     >     in repository
>     >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cacb2a9858b5c4481f1c608d6562a4830%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636791136930328031&amp;sdata=6UKkCKfKEECo1Z4nZeSv4dq3Z7uHVz8zqgbfv2wNtCk%3D&amp;reserved=0
>     >
>     >
>     >     The following commit(s) were added to refs/heads/develop by this
> push:
>     >          new 2ec43a4  add TimerEvent and timerComplete event
>     >     2ec43a4 is described below
>     >
>     >     commit 2ec43a4503588dd1b49019c1d75ba8ee3613982d
>     >     Author: Carlos Rovira <[email protected]>
>     >     AuthorDate: Thu Nov 29 15:01:30 2018 +0100
>     >
>     >         add TimerEvent and timerComplete event
>     >     ---
>     >      .../projects/Core/src/main/royale/CoreClasses.as   |  1 +
>     >      .../royale/org/apache/royale/events/TimerEvent.as  | 68
>     > ++++++++++++++++++++++
>     >      .../main/royale/org/apache/royale/utils/Timer.as   |  1 +
>     >      3 files changed, 70 insertions(+)
>     >
>     >     diff --git
> a/frameworks/projects/Core/src/main/royale/CoreClasses.as
>     > b/frameworks/projects/Core/src/main/royale/CoreClasses.as
>     >     index e28bbda..ac4158b 100644
>     >     --- a/frameworks/projects/Core/src/main/royale/CoreClasses.as
>     >     +++ b/frameworks/projects/Core/src/main/royale/CoreClasses.as
>     >     @@ -155,6 +155,7 @@ import
> org.apache.royale.events.ItemRemovedEvent;
>     > ItemRemovedEvent;
>     >         import org.apache.royale.core.StyleChangeNotifier;
>     > StyleChangeNotifier;
>     >         import org.apache.royale.events.CustomEvent; CustomEvent;
>     >          import org.apache.royale.events.Event; Event;
>     >     +    import org.apache.royale.events.TimerEvent; TimerEvent;
>     >         import org.apache.royale.events.CloseEvent; CloseEvent;
>     >         import org.apache.royale.events.CollectionEvent;
> CollectionEvent;
>     >          import org.apache.royale.events.ProgressEvent;
> ProgressEvent;
>     >     diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/TimerEvent.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/TimerEvent.as
>     >     new file mode 100644
>     >     index 0000000..c20b491
>     >     --- /dev/null
>     >     +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/TimerEvent.as
>     >     @@ -0,0 +1,68 @@
>     >
>     >
> +////////////////////////////////////////////////////////////////////////////////
>     >     +//
>     >     +//  Licensed to the Apache Software Foundation (ASF) under one
> or more
>     >     +//  contributor license agreements.  See the NOTICE file
> distributed
>     > with
>     >     +//  this work for additional information regarding copyright
>     > ownership.
>     >     +//  The ASF licenses this file to You under the Apache License,
>     > Version 2.0
>     >     +//  (the "License"); you may not use this file except in
> compliance
>     > with
>     >     +//  the License.  You may obtain a copy of the License at
>     >     +//
>     >     +//
>     >
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.apache.org%2Flicenses%2FLICENSE-2.0&amp;data=02%7C01%7Caharui%40adobe.com%7Cacb2a9858b5c4481f1c608d6562a4830%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636791136930328031&amp;sdata=MpRIQBfiSQ70BFNithhR1Dw9ZDCenDf1Wd1CkLmqHp0%3D&amp;reserved=0
>     >     +//
>     >     +//  Unless required by applicable law or agreed to in writing,
>     > software
>     >     +//  distributed under the License is distributed on an "AS IS"
> BASIS,
>     >     +//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
> express or
>     > implied.
>     >     +//  See the License for the specific language governing
> permissions
>     > and
>     >     +//  limitations under the License.
>     >     +//
>     >
>     >
> +////////////////////////////////////////////////////////////////////////////////
>     >     +package org.apache.royale.events
>     >     +{
>     >     +    public class TimerEvent extends Event
>     >     +    {
>     >     +        /**
>     >     +         *  Defines the value of the type property of a timer
> event
>     > object.
>     >     +         *
>     >     +         *  @langversion 3.0
>     >     +         *  @playerversion Flash 10.2
>     >     +         *  @playerversion AIR 2.6
>     >     +         *  @productversion Royale 0.0
>     >     +         */
>     >     +        public static const TIMER:String = "timer";
>     >     +
>     >     +        /**
>     >     +         *  Defines the value of the type property of a
> timerComplete
>     > event object.
>     >     +         *
>     >     +         *  @langversion 3.0
>     >     +         *  @playerversion Flash 10.2
>     >     +         *  @playerversion AIR 2.6
>     >     +         *  @productversion Royale 0.0
>     >     +         */
>     >     +        public static const TIMER_COMPLETE:String =
> "timerComplete";
>     >     +
>     >     +        /**
>     >     +            * Creates an Event object with specific information
>     > relevant to timer events.
>     >     +         *
>     >     +         * Constructor.
>     >     +            *
>     >     +            * @param type The name of the event.
>     >     +            * @param bubbles Whether the event bubbles.
>     >     +            * @param cancelable Whether the event can be
> canceled.
>     >     +            *
>     >     +            * @langversion 3.0
>     >     +            * @playerversion Flash 10.2
>     >     +            * @playerversion AIR 2.6
>     >     +            * @productversion Royale 0.0
>     >     +            */
>     >     +           public function TimerEvent(type:String,
> bubbles:Boolean =
>     > false, cancelable:Boolean = false)
>     >     +           {
>     >     +                   super(type, bubbles, cancelable);
>     >     +           }
>     >     +
>     >     +        COMPILE::JS
>     >     +        public function toString():String
>     >     +        {
>     >     +            return "[TimerEvent type=" + type + " bubbles=" +
> bubbles
>     > + " cancelable=" + cancelable + "]";
>     >     +        }
>     >     +    }
>     >     +}
>     >     \ No newline at end of file
>     >     diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/Timer.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/Timer.as
>     >     index ddbee84..ab4e1fe 100644
>     >     ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/Timer.as
>     >     +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/Timer.as
>     >     @@ -185,6 +185,7 @@ public class Timer extends EventDispatcher
>     >              _currentCount++;
>     >              if (repeatCount > 0 && currentCount >= repeatCount) {
>     >                  stop();
>     >     +            dispatchEvent(new Event('timerComplete'));
>     >              }
>     >
>     >              dispatchEvent(new Event('timer'));
>     >
>     >
>     >
>     >
>
>     --
>     Carlos Rovira
>
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7Cacb2a9858b5c4481f1c608d6562a4830%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636791136930328031&amp;sdata=6XKXJzWkwyw62ANGh%2FlbA9wh5akfbeO2Qw%2BWYGeTGcc%3D&amp;reserved=0
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Reply via email to