Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3E988200AE3 for ; Wed, 4 May 2016 20:13:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3D886160A03; Wed, 4 May 2016 18:13:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 62CA51609FF for ; Wed, 4 May 2016 20:13:49 +0200 (CEST) Received: (qmail 39679 invoked by uid 500); 4 May 2016 18:13:48 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 39562 invoked by uid 99); 4 May 2016 18:13:48 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2016 18:13:48 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 34B8DDFDEC; Wed, 4 May 2016 18:13:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Date: Wed, 04 May 2016 18:14:06 -0000 Message-Id: <071aaf53132b4b528c0c2dd43cf56144@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [20/50] [abbrv] git commit: [flex-asjs] [refs/heads/spark] - Updated CreateJS project. archived-at: Wed, 04 May 2016 18:13:50 -0000 http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f399ec5/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as new file mode 100644 index 0000000..8d06985 --- /dev/null +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as @@ -0,0 +1,76 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.createjs.graphics +{ + COMPILE::AS3 + { + import org.apache.flex.core.graphics.GraphicShape + } + + COMPILE::JS + { + import createjs.Shape; + import createjs.Stage; + + import org.apache.flex.createjs.core.CreateJSBase; + import org.apache.flex.core.WrappedHTMLElement; + } + + import org.apache.flex.core.graphics.IFill; + import org.apache.flex.core.graphics.IStroke; + + /** + * This is the base class for CreateJS graphic shape components such as + * Circle and Rect. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion FlexJS 0.0 + */ + + COMPILE::AS3 + public class GraphicShape extends org.apache.flex.core.graphics.GraphicShape + { + // nothing special for SWF version. + } + + COMPILE::JS + public class GraphicShape extends CreateJSBase + { + /** + * Creates a CreateJS Shape as the element. + * + * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement + * @flexjsignorecoercion createjs.Shape + */ + override protected function createElement():WrappedHTMLElement + { + var base:createjs.Shape = new createjs.Shape(null); + + element = base as WrappedHTMLElement; + element.flexjs_wrapper = this; + + positioner = element; + + return element; + } + + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f399ec5/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as new file mode 100644 index 0000000..eaf0a56 --- /dev/null +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as @@ -0,0 +1,93 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.createjs.graphics +{ + COMPILE::AS3 + { + import org.apache.flex.core.graphics.Rect + } + + COMPILE::JS + { + import createjs.Shape; + import createjs.Stage; + import createjs.Graphics; + + import org.apache.flex.createjs.core.UIBase; + import org.apache.flex.core.WrappedHTMLElement; + } + + import org.apache.flex.core.graphics.IFill; + import org.apache.flex.core.graphics.SolidColor; + import org.apache.flex.core.graphics.SolidColorStroke; + + /** + * Creates a rectangle. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion FlexJS 0.0 + */ + + COMPILE::AS3 + public class Rect extends org.apache.flex.core.graphics.Rect + { + // nothing special for SWF version. + } + + COMPILE::JS + public class Rect extends GraphicShape + { + /** + * @private + * @flexjsignorecoercion createjs.Shape + */ + override protected function redrawShape():void + { + if (isNaN(width) || isNaN(height)) return; + + var fillColor:String = null; + var fillAlpha:Number = 1.0; + if (fill != null) { + fillAlpha = (fill as SolidColor).alpha; + fillColor = convertColorToString((fill as SolidColor).color, fillAlpha); + } + var strokeColor:String = null; + var strokeWeight:Number = 0; + var strokeAlpha:Number = 1.0; + if (stroke != null) { + strokeWeight = (stroke as SolidColorStroke).weight; + strokeAlpha = (stroke as SolidColorStroke).alpha; + strokeColor = convertColorToString((stroke as SolidColorStroke).color, strokeAlpha); + } + + var rect:createjs.Shape = element as createjs.Shape; + rect.graphics.setStrokeStyle(strokeWeight); + rect.graphics.beginStroke(strokeColor); + rect.graphics.beginFill(fillColor); + rect.graphics.rect(0, 0, width, height); + + var stage:createjs.Stage = rect.getStage(); + if (stage) + stage.update(); + } + + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f399ec5/frameworks/projects/CreateJS/src/main/resources/compile-asjs-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/resources/compile-asjs-config.xml b/frameworks/projects/CreateJS/src/main/resources/compile-asjs-config.xml index cd48012..3e82454 100644 --- a/frameworks/projects/CreateJS/src/main/resources/compile-asjs-config.xml +++ b/frameworks/projects/CreateJS/src/main/resources/compile-asjs-config.xml @@ -58,6 +58,7 @@ ../../../../../externs/Core.swc ../../../../../externs/HTML.swc + ../../../../../externs/Graphics.swc false http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f399ec5/frameworks/projects/CreateJS/src/main/resources/compile-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/resources/compile-config.xml b/frameworks/projects/CreateJS/src/main/resources/compile-config.xml index 46f455d..1ce2f99 100644 --- a/frameworks/projects/CreateJS/src/main/resources/compile-config.xml +++ b/frameworks/projects/CreateJS/src/main/resources/compile-config.xml @@ -25,6 +25,7 @@ ${env.AIR_HOME}/frameworks/libs/air/airglobal.swc ../../../../../libs/Core.swc ../../../../../libs/HTML.swc + ../../../../../libs/Graphics.swc http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f399ec5/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml b/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml index 1c5a5ed..5716695 100644 --- a/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml +++ b/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml @@ -22,10 +22,12 @@ - - - + + + + + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f399ec5/frameworks/projects/CreateJS/src/main/resources/defaults.css ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/resources/defaults.css b/frameworks/projects/CreateJS/src/main/resources/defaults.css index 55fa336..db5cfa7 100644 --- a/frameworks/projects/CreateJS/src/main/resources/defaults.css +++ b/frameworks/projects/CreateJS/src/main/resources/defaults.css @@ -19,15 +19,34 @@ @namespace createjs "library://ns.apache.org/flexjs/createjs"; +createjs|TextButton +{ + IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel"); +} + +createjs|Label +{ + IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel"); +} + +createjs|CheckBox +{ + IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel"); +} + @media -flex-flash { createjs|TextButton { - IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel"); IBeadView: ClassReference("org.apache.flex.html.beads.TextButtonView"); } +createjs|Label +{ + IBeadView: ClassReference("org.apache.flex.html.beads.TextFieldView"); +} + createjs|CheckBox { IBeadView: ClassReference("org.apache.flex.html.beads.CheckBoxView");