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] - IUIBase now extends IStrand which simplified IUIBase. Alert and SimpleAlert beads are now responsible for creating their backgrounds and borders.
Date Wed, 12 Jun 2013 18:31:03 GMT
Updated Branches:
  refs/heads/develop b501d00ed -> 216917445


IUIBase now extends IStrand which simplified IUIBase. Alert and SimpleAlert beads are now
responsible for creating their backgrounds and borders.


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

Branch: refs/heads/develop
Commit: 216917445d83024e1fdae06266b12ca7d3f3a18f
Parents: b501d00
Author: Peter Ent <pent@apache.org>
Authored: Wed Jun 12 14:30:51 2013 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Wed Jun 12 14:30:51 2013 -0400

----------------------------------------------------------------------
 .../as/src/org/apache/flex/core/IUIBase.as      |  6 +-----
 .../apache/flex/html/staticControls/Alert.as    | 14 -------------
 .../flex/html/staticControls/SimpleAlert.as     |  4 +---
 .../flex/html/staticControls/beads/AlertBead.as | 21 ++++++++++++++------
 .../staticControls/beads/SimpleAlertBead.as     | 17 +++++++++++++++-
 5 files changed, 33 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21691744/frameworks/as/src/org/apache/flex/core/IUIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/IUIBase.as b/frameworks/as/src/org/apache/flex/core/IUIBase.as
index 934cde0..c4f7123 100644
--- a/frameworks/as/src/org/apache/flex/core/IUIBase.as
+++ b/frameworks/as/src/org/apache/flex/core/IUIBase.as
@@ -18,7 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.core
 {
-	public interface IUIBase
+	public interface IUIBase extends IStrand
 	{
 		function get model():IBeadModel;
 		
@@ -30,10 +30,6 @@ package org.apache.flex.core
 		
 		function addToParent(p:Object):void;
 		
-		function getBeadByType(classOrInterface:Class):IBead;
-		function addBead(bead:IBead):void;
-		function removeBead(value:IBead):IBead;
-		
 		function get measurementBead():IMeasurementBead;
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21691744/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as b/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
index 80b1c6b..b74c444 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/Alert.as
@@ -25,12 +25,7 @@ package org.apache.flex.html.staticControls
 	import org.apache.flex.core.UIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
-	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.html.staticControls.beads.IAlertBead;
-	import org.apache.flex.html.staticControls.beads.SingleLineBorderBead;
-	import org.apache.flex.html.staticControls.beads.SolidBackgroundBead;
-	import org.apache.flex.html.staticControls.beads.models.SingleLineBorderModel;
-	import org.apache.flex.html.staticControls.supportClasses.Border;
 	
 	public class Alert extends UIBase implements IInitSkin, IPopUp
 	{
@@ -100,15 +95,6 @@ package org.apache.flex.html.staticControls
 		
 		public function initSkin():void
 		{
-			var bdr:Border = new Border();
-			bdr.addToParent(this);
-			bdr.model = new SingleLineBorderModel();
-			bdr.addBead(new SingleLineBorderBead());
-			
-			var bb:SolidBackgroundBead = new SolidBackgroundBead();
-			bb.backgroundColor = 0xff0000;
-			addBead(bb);
-			
 			if( getBeadByType(IAlertBead) == null ) {
 				addBead(new (ValuesManager.valuesImpl.getValue(this, "iAlertBead")) as IBead);
 			}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21691744/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as b/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
index d4d7b7d..536e7b7 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/SimpleAlert.as
@@ -17,9 +17,7 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.html.staticControls
-{
-	import flash.display.DisplayObjectContainer;
-	
+{	
 	import org.apache.flex.core.IAlertModel;
 	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IInitSkin;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21691744/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as b/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as
index ac05a9a..b200c03 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/AlertBead.as
@@ -18,16 +18,10 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.html.staticControls.beads
 {
-	import flash.display.DisplayObject;
-	import flash.display.DisplayObjectContainer;
-	
 	import org.apache.flex.core.IAlertModel;
-	import org.apache.flex.core.IInitModel;
-	import org.apache.flex.core.IInitSkin;
 	import org.apache.flex.core.IMeasurementBead;
 	import org.apache.flex.core.IStrand;
 	import org.apache.flex.core.UIBase;
-	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.createjs.staticControls.Label;
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
@@ -35,6 +29,8 @@ package org.apache.flex.html.staticControls.beads
 	import org.apache.flex.html.staticControls.ControlBar;
 	import org.apache.flex.html.staticControls.TextButton;
 	import org.apache.flex.html.staticControls.TitleBar;
+	import org.apache.flex.html.staticControls.beads.models.SingleLineBorderModel;
+	import org.apache.flex.html.staticControls.supportClasses.Border;
 	
 	public class AlertBead implements IAlertBead
 	{
@@ -49,12 +45,17 @@ package org.apache.flex.html.staticControls.beads
 		private var _cancelButton:TextButton;
 		private var _yesButton:TextButton;
 		private var _noButton:TextButton;
+		private var _border:Border;
 		
 		private var _strand:IStrand;
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
 			
+			var bb:SolidBackgroundBead = new SolidBackgroundBead();
+			bb.backgroundColor = 0xffffff;
+			_strand.addBead(bb);
+			
 			var flags:uint = IAlertModel(UIBase(_strand).model).flags;
 			if( flags & Alert.OK ) {
 				_okButton = new TextButton();
@@ -107,6 +108,11 @@ package org.apache.flex.html.staticControls.beads
 			_controlBar.addToParent(_strand);
 			_label.addToParent(_strand);
 			
+			_border = new Border();
+			_border.addToParent(_strand);
+			_border.model = new SingleLineBorderModel();
+			_border.addBead(new SingleLineBorderBead());
+			
 			sizeHandler(null);
 		}
 		
@@ -132,6 +138,9 @@ package org.apache.flex.html.staticControls.beads
 			
 			UIBase(_strand).width = maxWidth;
 			UIBase(_strand).height = _controlBar.y + _controlBar.height;
+			
+			_border.width = UIBase(_strand).width;
+			_border.height = UIBase(_strand).height;
 		}
 		
 		private function handleOK(event:Event):void

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/21691744/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
index 10f5606..d10d7aa 100644
--- a/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
+++ b/frameworks/as/src/org/apache/flex/html/staticControls/beads/SimpleAlertBead.as
@@ -35,6 +35,8 @@ package org.apache.flex.html.staticControls.beads
 	import org.apache.flex.events.ValueChangeEvent;
 	import org.apache.flex.html.staticControls.Label;
 	import org.apache.flex.html.staticControls.TextButton;
+	import org.apache.flex.html.staticControls.beads.models.SingleLineBorderModel;
+	import org.apache.flex.html.staticControls.supportClasses.Border;
 	
 	public class SimpleAlertBead implements ISimpleAlertBead
 	{
@@ -44,12 +46,17 @@ package org.apache.flex.html.staticControls.beads
 		
 		private var messageLabel:Label;
 		private var okButton:TextButton;
+		private var border:Border;
 		
 		private var _strand:IStrand;
 		public function set strand(value:IStrand):void
 		{
 			_strand = value;
 			
+			var bb:SolidBackgroundBead = new SolidBackgroundBead();
+			bb.backgroundColor = 0xffffff;
+			_strand.addBead(bb);
+			
 			var model:IAlertModel = _strand.getBeadByType(IAlertModel) as IAlertModel;
 			model.addEventListener("messageChange",handleMessageChange);
 			model.addEventListener("htmlMessageChange",handleMessageChange);
@@ -63,11 +70,16 @@ package org.apache.flex.html.staticControls.beads
 			
 			okButton = new TextButton();
 			okButton.initModel();
-			okButton.text = "OK";
+			okButton.text = model.okLabel;
 			okButton.initSkin();
 			okButton.addToParent(_strand);
 			okButton.addEventListener("click",handleOK);
 			
+			border = new Border();
+			border.addToParent(_strand);
+			border.model = new SingleLineBorderModel();
+			border.addBead(new SingleLineBorderBead());
+			
 			handleMessageChange(null);
 		}
 		
@@ -88,6 +100,9 @@ package org.apache.flex.html.staticControls.beads
 			
 			UIBase(_strand).width = maxWidth;
 			UIBase(_strand).height = messageLabel.height + okButton.height + 20;
+			
+			border.width = UIBase(_strand).width;
+			border.height = UIBase(_strand).height;
 		}
 		
 		private function handleOK(event:Event):void


Mime
View raw message