flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Added SpinnerRangeModel to allow controls that share this model to have defaults different than the RangeModel. NumericStepper passes on its instance of the model to the Spinner it uses.
Date Mon, 22 Jul 2013 18:07:49 GMT
Updated Branches:
  refs/heads/develop dea317257 -> c2132c26d


Added SpinnerRangeModel to allow controls that share this model to have defaults different
than the RangeModel. NumericStepper passes on its instance of the model to the Spinner it
uses.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c2132c26
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c2132c26
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c2132c26

Branch: refs/heads/develop
Commit: c2132c26da7a011594df943fd513e1b621d509d4
Parents: dea3172
Author: Peter Ent <pent@apache.org>
Authored: Mon Jul 22 14:07:36 2013 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Mon Jul 22 14:07:36 2013 -0400

----------------------------------------------------------------------
 frameworks/as/defaults.css                      |  6 ++--
 frameworks/as/src/FlexJSUIClasses.as            |  3 +-
 .../flex/html/staticControls/NumericStepper.as  |  6 ----
 .../apache/flex/html/staticControls/Spinner.as  |  6 ----
 .../staticControls/beads/NumericStepperView.as  |  2 +-
 .../beads/controllers/SliderMouseController.as  |  3 +-
 .../beads/controllers/SpinnerMouseController.as |  3 +-
 .../beads/models/SpinnerRangeModel.as           | 34 ++++++++++++++++++++
 8 files changed, 43 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2132c26/frameworks/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/defaults.css b/frameworks/as/defaults.css
index 91c4a5e..055d06d 100644
--- a/frameworks/as/defaults.css
+++ b/frameworks/as/defaults.css
@@ -133,7 +133,7 @@ List
 
 NumericStepper
 {
-    IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.RangeModel");
+    IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.SpinnerRangeModel");
     IBeadView: ClassReference("org.apache.flex.html.staticControls.beads.NumericStepperView");
     
     padding: 0px;
@@ -188,7 +188,7 @@ SimpleAlert
 
 Slider
 {
-    IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.RangeModel");
+    IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.SpinnerRangeModel");
     iBeadView:  ClassReference("org.apache.flex.html.staticControls.beads.SliderView");
     iBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.SliderMouseController");
     iThumbView: ClassReference("org.apache.flex.html.staticControls.beads.SliderThumbView");
@@ -197,7 +197,7 @@ Slider
 
 Spinner
 {
-    IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.RangeModel");
+    IBeadModel: ClassReference("org.apache.flex.html.staticControls.beads.models.SpinnerRangeModel");
     IBeadView:  ClassReference("org.apache.flex.html.staticControls.beads.SpinnerView");
     IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.SpinnerMouseController");
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2132c26/frameworks/as/src/FlexJSUIClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/FlexJSUIClasses.as b/frameworks/as/src/FlexJSUIClasses.as
index ed77401..6bd6029 100644
--- a/frameworks/as/src/FlexJSUIClasses.as
+++ b/frameworks/as/src/FlexJSUIClasses.as
@@ -55,7 +55,8 @@ internal class FlexJSUIClasses
     import org.apache.flex.html.staticControls.beads.models.AlertModel; AlertModel;
     import org.apache.flex.html.staticControls.beads.models.ArraySelectionModel; ArraySelectionModel;
     import org.apache.flex.html.staticControls.beads.models.ComboBoxModel; ComboBoxModel;
-    import org.apache.flex.html.staticControls.beads.models.PanelModel; PanelModel;
+	import org.apache.flex.html.staticControls.beads.models.PanelModel; PanelModel;
+	import org.apache.flex.html.staticControls.beads.models.SpinnerRangeModel; SpinnerRangeModel;
 	import org.apache.flex.html.staticControls.beads.models.TextModel; TextModel;
     import org.apache.flex.html.staticControls.beads.models.TitleBarModel; TitleBarModel;
 	import org.apache.flex.html.staticControls.beads.models.ToggleButtonModel; ToggleButtonModel;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2132c26/frameworks/as/src/org/apache/flex/html/staticControls/NumericStepper.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/NumericStepper.as b/frameworks/as/src/org/apache/flex/html/staticControls/NumericStepper.as
index f2c2b1c..c587ff3 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/NumericStepper.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/NumericStepper.as
@@ -26,12 +26,6 @@ package org.apache.flex.html.staticControls
 		public function NumericStepper()
 		{
 			super();
-			
-			IRangeModel(model).value = 0;
-			IRangeModel(model).minimum = 0;
-			IRangeModel(model).maximum = 100;
-			IRangeModel(model).stepSize = 1;
-			IRangeModel(model).snapInterval = 1;
 		}
 		
 		public function get value():Number

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2132c26/frameworks/as/src/org/apache/flex/html/staticControls/Spinner.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/Spinner.as b/frameworks/as/src/org/apache/flex/html/staticControls/Spinner.as
index d11a390..d0eb443 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/Spinner.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/Spinner.as
@@ -30,12 +30,6 @@ package org.apache.flex.html.staticControls
 			super();
 			
 			className = "Spinner";
-			
-			IRangeModel(model).value = 0;
-			IRangeModel(model).minimum = 0;
-			IRangeModel(model).maximum = 100;
-			IRangeModel(model).stepSize = 1;
-			IRangeModel(model).snapInterval = 1;
 		}
 		
 		public function get value():Number

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2132c26/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
index bbc964b..43e877f 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/NumericStepperView.as
@@ -54,7 +54,7 @@ package org.apache.flex.html.staticControls.beads
 			
 			// add a spinner
 			spinner = new Spinner();
-			spinner.addBead( value.getBeadByType(IBeadModel) );
+			spinner.addBead( UIBase(value).model );
 			spinner.addToParent(value);
 			spinner.width = 17;
 			

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2132c26/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SliderMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SliderMouseController.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SliderMouseController.as
index 2364f21..1b3faf0 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SliderMouseController.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SliderMouseController.as
@@ -33,7 +33,6 @@ package org.apache.flex.html.staticControls.beads.controllers
 	{
 		public function SliderMouseController()
 		{
-			trace("SliderMouseController");
 		}
 		
 		private var rangeModel:IRangeModel;
@@ -43,7 +42,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 		{
 			_strand = value;
 			
-			rangeModel = value.getBeadByType(IBeadModel) as IRangeModel;
+			rangeModel = UIBase(value).model as IRangeModel;
 			
 			var sliderView:ISliderView = value.getBeadByType(ISliderView) as ISliderView;
 			sliderView.thumb.addEventListener(MouseEvent.MOUSE_DOWN, thumbDownHandler);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2132c26/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
index 606e2f8..76f1735 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/controllers/SpinnerMouseController.as
@@ -24,6 +24,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 	import org.apache.flex.core.IBeadModel;
 	import org.apache.flex.core.IRangeModel;
 	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.UIBase;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.html.staticControls.beads.ISpinnerView;
@@ -41,7 +42,7 @@ package org.apache.flex.html.staticControls.beads.controllers
 		{
 			_strand = value;
 			
-			rangeModel = value.getBeadByType(IBeadModel) as IRangeModel;
+			rangeModel = UIBase(value).model as IRangeModel;
 			
 			var spinnerBead:ISpinnerView = value.getBeadByType(ISpinnerView) as ISpinnerView;
 			spinnerBead.decrement.addEventListener(MouseEvent.CLICK, decrementClickHandler);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c2132c26/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SpinnerRangeModel.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SpinnerRangeModel.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SpinnerRangeModel.as
new file mode 100644
index 0000000..507c568
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/models/SpinnerRangeModel.as
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.flex.html.staticControls.beads.models
+{
+	public class SpinnerRangeModel extends RangeModel
+	{
+		public function SpinnerRangeModel()
+		{
+			super();
+			
+			minimum = 0;
+			maximum = 100;
+			value = 0;
+			stepSize = 1;
+			snapInterval = 1;
+		}
+	}
+}
\ No newline at end of file


Mime
View raw message