You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/01/11 06:49:22 UTC

[royale-asjs] 01/10: swap out for an interface

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 319ed73356a0cbdbaa0da7745fc2eba8aec81b6b
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Jan 4 14:43:07 2019 -0800

    swap out for an interface
---
 .../royale/org/apache/royale/core/GroupBase.as     |  4 +--
 .../projects/Core/src/main/royale/CoreClasses.as   |  1 +
 .../main/royale/org/apache/royale/core/IState.as   | 36 ++++++++++++++++++++++
 .../main/royale/org/apache/royale/states/State.as  |  4 ++-
 4 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/GroupBase.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/GroupBase.as
index ae77414..0156152 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/GroupBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/GroupBase.as
@@ -22,12 +22,12 @@ package org.apache.royale.core
 	import org.apache.royale.core.ILayoutParent;
 	import org.apache.royale.core.ILayoutHost;
 	import org.apache.royale.core.ILayoutView;
+    import org.apache.royale.core.IState;
 	import org.apache.royale.core.UIBase;
 	import org.apache.royale.core.ValuesManager;
 	import org.apache.royale.events.Event;
 	import org.apache.royale.events.ValueChangeEvent;
     import org.apache.royale.events.ValueEvent;
-	import org.apache.royale.states.State;
 	import org.apache.royale.utils.loadBeadFromValuesManager;
 
     COMPILE::JS
@@ -225,7 +225,7 @@ package org.apache.royale.core
          */
         public function hasState(state:String):Boolean
         {
-            for each (var s:State in _states)
+            for each (var s:IState in _states)
             {
                 if (s.name == state)
                     return true;
diff --git a/frameworks/projects/Core/src/main/royale/CoreClasses.as b/frameworks/projects/Core/src/main/royale/CoreClasses.as
index e28bbda..7110fa4 100644
--- a/frameworks/projects/Core/src/main/royale/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/royale/CoreClasses.as
@@ -119,6 +119,7 @@ import org.apache.royale.events.ItemRemovedEvent; ItemRemovedEvent;
     import org.apache.royale.core.IParentIUIBase; IParentIUIBase;
     import org.apache.royale.core.IPopUp; IPopUp;
     import org.apache.royale.core.IRangeModel; IRangeModel;
+    import org.apache.royale.core.IState; IState;
     import org.apache.royale.core.ISWFApplication; ISWFApplication;
 	import org.apache.royale.core.ITransformModel; ITransformModel;
 	import org.apache.royale.core.ITransformHost; ITransformHost;
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IState.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IState.as
new file mode 100644
index 0000000..675eb29
--- /dev/null
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IState.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+//
+//      http://www.apache.org/licenses/LICENSE-2.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.core
+{
+
+    /**
+     *  The IState interface is a basic interface for States that are 
+     *  handled by various IStatesImpls.  IStatesImpls watche for the currentState property to
+     *  change and executes changes accordingly.
+     * 
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Royale 0.0
+     */
+	public interface IState
+	{
+        function get name():String;
+	}
+}
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/states/State.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/states/State.as
index 30719d9..74a858c 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/states/State.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/states/State.as
@@ -20,6 +20,8 @@
 // shim the mx classes for states
 package org.apache.royale.states
 {
+    import org.apache.royale.core.IState;
+    
     /**
      *  The State class is one of the classes in the
      *  view states subsystem.  It is used to declare a 
@@ -30,7 +32,7 @@ package org.apache.royale.states
      *  @playerversion AIR 2.6
      *  @productversion Royale 0.0
      */
-	public class State
+	public class State implements IState
 	{
         /**
          *  Constructor.