This is an automated email from the ASF dual-hosted git repository.
pent pushed a commit to branch feature/DividedBox
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/feature/DividedBox by this
push:
new 6357c69 Changed from using className to typeName. Changed the
graphics of the DividedBoxGripper to be more traditional. Added
direction-specific DividedBoxView beads to be more PAYG.
6357c69 is described below
commit 6357c69cd3da70ee70f7f78df64789ca93a8e81e
Author: Peter Ent <[email protected]>
AuthorDate: Wed Feb 14 13:59:17 2018 -0500
Changed from using className to typeName. Changed the graphics of the
DividedBoxGripper to be more traditional. Added direction-specific
DividedBoxView beads to be more PAYG.
---
.../projects/Basic/src/main/resources/defaults.css | 4 +--
.../projects/Basic/src/main/royale/BasicClasses.as | 3 +-
.../royale/org/apache/royale/html/DividedBox.as | 2 +-
.../royale/org/apache/royale/html/HDividedBox.as | 2 +-
.../royale/org/apache/royale/html/VDividedBox.as | 2 +-
.../org/apache/royale/html/beads/DividedBoxView.as | 23 ++++++++++-----
.../{VDividedBox.as => beads/HDividedBoxView.as} | 22 +++++++++-----
.../{VDividedBox.as => beads/VDividedBoxView.as} | 22 +++++++++-----
.../html/supportClasses/DividedBoxDivider.as | 19 ++++++++----
.../html/supportClasses/HDividedBoxDivider.as | 2 +-
.../html/supportClasses/HDividedBoxGripper.as | 24 +++++++--------
...HDividedBoxDivider.as => IDividedBoxDivider.as} | 34 ++++++++++------------
.../html/supportClasses/VDividedBoxDivider.as | 2 +-
.../html/supportClasses/VDividedBoxGripper.as | 25 ++++++++--------
14 files changed, 107 insertions(+), 79 deletions(-)
diff --git a/frameworks/projects/Basic/src/main/resources/defaults.css
b/frameworks/projects/Basic/src/main/resources/defaults.css
index d32950a..1bec7dc 100644
--- a/frameworks/projects/Basic/src/main/resources/defaults.css
+++ b/frameworks/projects/Basic/src/main/resources/defaults.css
@@ -310,13 +310,13 @@ DateField {
/** DividedBox */
HDividedBox {
- IBeadView:
ClassReference("org.apache.royale.html.beads.DividedBoxView");
+ IBeadView:
ClassReference("org.apache.royale.html.beads.HDividedBoxView");
IBeadModel:
ClassReference("org.apache.royale.html.beads.models.DividedBoxModel");
IBeadLayout:
ClassReference("org.apache.royale.html.beads.layouts.HDividedBoxLayout");
}
VDividedBox {
- IBeadView:
ClassReference("org.apache.royale.html.beads.DividedBoxView");
+ IBeadView:
ClassReference("org.apache.royale.html.beads.VDividedBoxView");
IBeadModel:
ClassReference("org.apache.royale.html.beads.models.DividedBoxModel");
IBeadLayout:
ClassReference("org.apache.royale.html.beads.layouts.VDividedBoxLayout");
}
diff --git a/frameworks/projects/Basic/src/main/royale/BasicClasses.as
b/frameworks/projects/Basic/src/main/royale/BasicClasses.as
index 437ae86..ef44fb7 100644
--- a/frameworks/projects/Basic/src/main/royale/BasicClasses.as
+++ b/frameworks/projects/Basic/src/main/royale/BasicClasses.as
@@ -41,7 +41,8 @@ internal class BasicClasses
import org.apache.royale.html.beads.AlertView; AlertView;
import org.apache.royale.html.beads.controllers.AlertController;
AlertController;
- import org.apache.royale.html.beads.DividedBoxView; DividedBoxView;
+ import org.apache.royale.html.beads.HDividedBoxView; HDividedBoxView;
+ import org.apache.royale.html.beads.VDividedBoxView; VDividedBoxView;
import org.apache.royale.html.beads.models.DividedBoxModel;
DividedBoxModel;
import org.apache.royale.html.beads.layouts.HDividedBoxLayout;
HDividedBoxLayout;
import org.apache.royale.html.beads.layouts.VDividedBoxLayout;
VDividedBoxLayout;
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/DividedBox.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/DividedBox.as
index b2c435c..c92c09d 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/DividedBox.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/DividedBox.as
@@ -62,7 +62,7 @@ package org.apache.royale.html
public function DividedBox()
{
super();
- className = "DividedBox";
+ typeNames = "DividedBox";
}
// DividedBoxLayout takes care of sizing and positioning the
children and the
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/HDividedBox.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/HDividedBox.as
index 5fa45cd..f0a68f1 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/HDividedBox.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/HDividedBox.as
@@ -40,7 +40,7 @@ package org.apache.royale.html
public function HDividedBox()
{
super();
- className = "HDividedBox";
+ typeNames = "HDividedBox";
direction = "horizontal";
}
}
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
index 8d81858..1f0c16f 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
@@ -40,7 +40,7 @@ package org.apache.royale.html
public function VDividedBox()
{
super();
- className = "VDividedBox";
+ typeNames = "VDividedBox";
direction = "vertical";
}
}
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DividedBoxView.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DividedBoxView.as
index a56f522..9ad0dfb 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DividedBoxView.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DividedBoxView.as
@@ -27,8 +27,7 @@ package org.apache.royale.html.beads
import org.apache.royale.html.DividedBox;
import org.apache.royale.html.beads.models.DividedBoxModel;
import org.apache.royale.html.supportClasses.DividedBoxDivider;
- import org.apache.royale.html.supportClasses.HDividedBoxDivider;
- import org.apache.royale.html.supportClasses.VDividedBoxDivider;
+ import org.apache.royale.html.supportClasses.IDividedBoxDivider;
import org.apache.royale.utils.loadBeadFromValuesManager;
/**
@@ -77,6 +76,19 @@ package org.apache.royale.html.beads
}
/**
+ * A sub-class should create an instance of a DividedBoxDivider
and return it.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ */
+ protected function createSeparator():IDividedBoxDivider
+ {
+ return null;
+ }
+
+ /**
* Handles the "childrenAdded" event and generates the
separators between them
* based on the direction of the box.
*
@@ -94,12 +106,7 @@ package org.apache.royale.html.beads
var adjustments:Array = [];
if (n > 1) {
for(var i:int=0; i < (n-1); i++) {
- var sep:DividedBoxDivider;
- if (((_strand as UIBase).model as
DividedBoxModel).direction == "horizontal") {
- sep = new HDividedBoxDivider();
- } else {
- sep = new VDividedBoxDivider();
- }
+ var sep:IDividedBoxDivider =
createSeparator();
(host as UIBase).addElement(sep);
seps.push(sep);
adjustments.push(0);
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/HDividedBoxView.as
similarity index 74%
copy from
frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
copy to
frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/HDividedBoxView.as
index 8d81858..59f4624 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/HDividedBoxView.as
@@ -16,18 +16,20 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.royale.html
+package org.apache.royale.html.beads
{
+ import org.apache.royale.html.supportClasses.HDividedBoxDivider;
+ import org.apache.royale.html.supportClasses.IDividedBoxDivider;
+
/**
- * This sub-class of DividedBox organizes its children into rows
separated by
- * movable dividers.
+ * Creates a horizontal DividedBoxDivider.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
- public class VDividedBox extends DividedBox
+ public class HDividedBoxView extends DividedBoxView
{
/**
* Constructor.
@@ -37,11 +39,17 @@ package org.apache.royale.html
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
- public function VDividedBox()
+ public function HDividedBoxView()
{
super();
- className = "VDividedBox";
- direction = "vertical";
+ }
+
+ /**
+ * @private
+ */
+ override protected function createSeparator():IDividedBoxDivider
+ {
+ return new HDividedBoxDivider();
}
}
}
\ No newline at end of file
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/VDividedBoxView.as
similarity index 74%
copy from
frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
copy to
frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/VDividedBoxView.as
index 8d81858..80b28fe 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/VDividedBox.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/VDividedBoxView.as
@@ -16,18 +16,20 @@
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////////
-package org.apache.royale.html
+package org.apache.royale.html.beads
{
+ import org.apache.royale.html.supportClasses.IDividedBoxDivider;
+ import org.apache.royale.html.supportClasses.VDividedBoxDivider;
+
/**
- * This sub-class of DividedBox organizes its children into rows
separated by
- * movable dividers.
+ * Creates a vertical DividerBoxDivider.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
- public class VDividedBox extends DividedBox
+ public class VDividedBoxView extends DividedBoxView
{
/**
* Constructor.
@@ -37,11 +39,17 @@ package org.apache.royale.html
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
- public function VDividedBox()
+ public function VDividedBoxView()
{
super();
- className = "VDividedBox";
- direction = "vertical";
+ }
+
+ /**
+ * @private
+ */
+ override protected function createSeparator():IDividedBoxDivider
+ {
+ return new VDividedBoxDivider();
}
}
}
\ No newline at end of file
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DividedBoxDivider.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DividedBoxDivider.as
index 0a77da9..339509b 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DividedBoxDivider.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/DividedBoxDivider.as
@@ -19,11 +19,10 @@
package org.apache.royale.html.supportClasses
{
import org.apache.royale.core.UIBase;
- import org.apache.royale.html.beads.SingleLineBorderBead;
- import org.apache.royale.html.beads.models.DividedBoxModel;
COMPILE::SWF {
import org.apache.royale.html.beads.SolidBackgroundBead;
+ import org.apache.royale.html.beads.SingleLineBorderBead;
import org.apache.royale.utils.loadBeadFromValuesManager;
}
@@ -37,7 +36,7 @@ package org.apache.royale.html.supportClasses
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
- public class DividedBoxDivider extends UIBase
+ public class DividedBoxDivider extends UIBase implements
IDividedBoxDivider
{
/**
* Constructor.
@@ -50,13 +49,15 @@ package org.apache.royale.html.supportClasses
public function DividedBoxDivider()
{
super();
- className = "DividedBoxDivider";
+ typeNames = "DividedBoxDivider";
COMPILE::SWF {
loadBeadFromValuesManager(SolidBackgroundBead,
"iBackgroundBead", this);
loadBeadFromValuesManager(SingleLineBorderBead,
"iBorderBead", this);
}
}
+
+ private var _pairIndex:int = 0;
/**
* The index of this divider instance, indicating which pair of
children it
@@ -67,6 +68,14 @@ package org.apache.royale.html.supportClasses
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
- public var pairIndex:int = 0;
+ public function get pairIndex():int
+ {
+ return _pairIndex;
+ }
+
+ public function set pairIndex(value:int):void
+ {
+ _pairIndex = value;
+ }
}
}
\ No newline at end of file
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxDivider.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxDivider.as
index 8ec0a43..084a576 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxDivider.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxDivider.as
@@ -43,7 +43,7 @@ package org.apache.royale.html.supportClasses
public function HDividedBoxDivider()
{
super();
- className = "HDividedBoxDivider";
+ typeNames = "HDividedBoxDivider";
}
/**
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxGripper.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxGripper.as
index f2883f3..200c512 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxGripper.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxGripper.as
@@ -24,7 +24,8 @@ package org.apache.royale.html.supportClasses
import org.apache.royale.events.Event;
import org.apache.royale.events.IEventDispatcher;
import org.apache.royale.graphics.SolidColor;
- import org.apache.royale.svg.Rect;
+ import org.apache.royale.graphics.SolidColorStroke;
+ import org.apache.royale.svg.Path;
/**
* The HDividedBoxGripper is a bead added to the HDividedBoxDivider to
@@ -50,7 +51,7 @@ package org.apache.royale.html.supportClasses
}
private var _strand:IStrand;
- private var rect:Rect;
+ private var path:Path;
/**
* @copy org.apache.royale.core.IStrand#strand
@@ -68,9 +69,10 @@ package org.apache.royale.html.supportClasses
(_strand as
IEventDispatcher).addEventListener("widthChanged", handleResize);
(_strand as
IEventDispatcher).addEventListener("heightChanged", handleResize);
- rect = new Rect();
- rect.fill = new SolidColor(0x555555);
- (_strand as UIBase).addElement(rect);
+ path = new Path();
+ path.stroke = new SolidColorStroke(0x555555,1);
+ path.data = "M 1 0 L 1 30 M 4 0 L 4 30 M 7 0 L 7 30";
+ (_strand as UIBase).addElement(path);
}
/**
@@ -81,13 +83,11 @@ package org.apache.royale.html.supportClasses
var useWidth:Number = (_strand as UIBase).width;
var useHeight:Number = (_strand as UIBase).height;
- // for horizontal gripper, it is taller than it is wide
- rect.width = useWidth - 2;
- rect.height = rect.width * 4;
-
- rect.x = 1;
- rect.y = (useHeight - rect.height)/2;
- rect.draw();
+ path.width = 8;
+ path.height = 30;
+ path.x = (useWidth - path.width)/2;
+ path.y = (useHeight - path.height)/2;
+ path.draw();
}
}
}
\ No newline at end of file
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxDivider.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/IDividedBoxDivider.as
similarity index 70%
copy from
frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxDivider.as
copy to
frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/IDividedBoxDivider.as
index 8ec0a43..0ac0eb3 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/HDividedBoxDivider.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/IDividedBoxDivider.as
@@ -18,42 +18,38 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.royale.html.supportClasses
{
- import org.apache.royale.core.IBead;
- import org.apache.royale.utils.loadBeadFromValuesManager;
+ import org.apache.royale.core.IChild;
/**
- * This sub-class of DividerBoxDivider sets up a vertical divider
between
- * the columns of an HDividedBox.
+ * All DividerBoxDividers must implement this interface.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
- public class HDividedBoxDivider extends DividedBoxDivider
+ public interface IDividedBoxDivider extends IChild
{
/**
- * Constructor.
+ * The model being used with the DividedBox.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
- public function HDividedBoxDivider()
- {
- super();
- className = "HDividedBoxDivider";
- }
-
+ function get model():Object;
+ function set model(value:Object):void;
+
/**
- * @private
+ * The index of the pairs this divider is managing.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
*/
- override public function addedToParent():void
- {
- super.addedToParent();
-
- loadBeadFromValuesManager(IDividedBoxGripper,
"iGripperBead", this);
- }
+ function get pairIndex():int;
+ function set pairIndex(value:int):void;
}
}
\ No newline at end of file
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/VDividedBoxDivider.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/VDividedBoxDivider.as
index e4cd5d4..ea1cf6c 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/VDividedBoxDivider.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/VDividedBoxDivider.as
@@ -43,7 +43,7 @@ package org.apache.royale.html.supportClasses
public function VDividedBoxDivider()
{
super();
- className = "VDividedBoxDivider";
+ typeNames = "VDividedBoxDivider";
}
/**
diff --git
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/VDividedBoxGripper.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/VDividedBoxGripper.as
index 765817d..f1c46fa 100644
---
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/VDividedBoxGripper.as
+++
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/supportClasses/VDividedBoxGripper.as
@@ -23,8 +23,8 @@ package org.apache.royale.html.supportClasses
import org.apache.royale.core.UIBase;
import org.apache.royale.events.Event;
import org.apache.royale.events.IEventDispatcher;
- import org.apache.royale.graphics.SolidColor;
- import org.apache.royale.svg.Rect;
+ import org.apache.royale.graphics.SolidColorStroke;
+ import org.apache.royale.svg.Path;
/**
* The VDividedBoxGripper bead adds a visual cue to the
VDividedBoxDivider to
@@ -50,7 +50,7 @@ package org.apache.royale.html.supportClasses
}
private var _strand:IStrand;
- private var rect:Rect;
+ private var path:Path;
/**
* @copy org.apache.royale.core.IStrand#strand
@@ -68,9 +68,10 @@ package org.apache.royale.html.supportClasses
(_strand as
IEventDispatcher).addEventListener("widthChanged", handleResize);
(_strand as
IEventDispatcher).addEventListener("heightChanged", handleResize);
- rect = new Rect();
- rect.fill = new SolidColor(0x555555);
- (_strand as UIBase).addElement(rect);
+ path = new Path();
+ path.stroke = new SolidColorStroke(0x555555,1);
+ path.data = "M 0 1 L 30 1 M 0 4 L 30 4 M 0 7 L 30 7";
+ (_strand as UIBase).addElement(path);
}
/**
@@ -81,13 +82,11 @@ package org.apache.royale.html.supportClasses
var useWidth:Number = (_strand as UIBase).width;
var useHeight:Number = (_strand as UIBase).height;
- // for vertical gripper, it is wider than it is tall
- rect.height = useHeight - 2;
- rect.width = rect.height * 4;
-
- rect.y = 1;
- rect.x = (useWidth - rect.height)/2;
- rect.draw();
+ path.width = 30;
+ path.height = 8;
+ path.x = (useWidth - path.width)/2;
+ path.y = (useHeight - path.height)/2;
+ path.draw();
}
}
}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
[email protected].