From commits-return-2593-archive-asf-public=cust-asf.ponee.io@royale.apache.org Wed Mar 7 18:29:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0F599180771 for ; Wed, 7 Mar 2018 18:29:02 +0100 (CET) Received: (qmail 16408 invoked by uid 500); 7 Mar 2018 17:29:02 -0000 Mailing-List: contact commits-help@royale.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@royale.apache.org Delivered-To: mailing list commits@royale.apache.org Received: (qmail 16399 invoked by uid 99); 7 Mar 2018 17:29:02 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2018 17:29:02 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 4F6C8827CD; Wed, 7 Mar 2018 17:29:01 +0000 (UTC) Date: Wed, 07 Mar 2018 17:29:02 +0000 To: "commits@royale.apache.org" Subject: [royale-asjs] 01/04: refactor all work on vivid branch to jewel for all files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: carlosrovira@apache.org In-Reply-To: <152044374121.11911.17762673597540499696@gitbox.apache.org> References: <152044374121.11911.17762673597540499696@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: royale-asjs X-Git-Refname: refs/heads/jewel-ui X-Git-Reftype: branch X-Git-Rev: 2eef5a7d2afd971371194a2775c86cdd772b00fb X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180307172901.4F6C8827CD@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. carlosrovira pushed a commit to branch jewel-ui in repository https://gitbox.apache.org/repos/asf/royale-asjs.git commit 2eef5a7d2afd971371194a2775c86cdd772b00fb Author: Carlos Rovira AuthorDate: Tue Mar 6 11:51:41 2018 +0100 refactor all work on vivid branch to jewel for all files --- examples/royale/JewelExample/.vscode/launch.json | 21 ++ examples/royale/JewelExample/.vscode/settings.json | 3 + examples/royale/JewelExample/.vscode/tasks.json | 8 + examples/royale/JewelExample/README.txt | 26 ++ examples/royale/JewelExample/asconfig.json | 31 +++ examples/royale/JewelExample/build.xml | 68 +++++ examples/royale/JewelExample/pom.xml | 96 +++++++ .../src/main/config/compile-app-config.xml | 28 ++ .../src/main/resources/jewel-example-styles.css | 25 ++ .../royale/JewelExample/src/main/royale/App.mxml | 40 +++ .../src/main/royale/ButtonPlayGround.mxml | 60 +++++ .../src/main/royale/TextInputPlayGround.mxml | 30 +++ examples/royale/pom.xml | 1 + frameworks/projects/Jewel/.vscode/launch.json | 21 ++ frameworks/projects/Jewel/.vscode/settings.json | 3 + frameworks/projects/Jewel/.vscode/tasks.json | 8 + frameworks/projects/Jewel/asconfig.json | 34 +++ frameworks/projects/Jewel/build.xml | 130 ++++++++++ .../royale => frameworks/projects/Jewel}/pom.xml | 133 ++++------ .../Jewel/src/main/config/compile-swf-config.xml | 105 ++++++++ .../projects/Jewel/src/main/resources/defaults.css | 74 ++++++ .../Jewel/src/main/resources/jewel-as-manifest.xml | 25 ++ .../Jewel/src/main/resources/jewel-manifest.xml | 30 +++ .../projects/Jewel/src/main/royale/JewelClasses.as | 42 +++ .../royale/org/apache/royale/jewel/Application.as | 70 +++++ .../royale/org/apache/royale/jewel/RadioButton.as | 107 ++++++++ .../main/royale/org/apache/royale/jewel/Slider.as | 72 ++++++ .../royale/org/apache/royale/jewel/TextButton.as | 63 +++++ .../royale/org/apache/royale/jewel/TextField.as | 115 +++++++++ .../apache/royale/jewel/beads/RadioButtonView.as | 286 +++++++++++++++++++++ .../apache/royale/jewel/beads/SliderThumbView.as | 121 +++++++++ .../apache/royale/jewel/beads/SliderTrackView.as | 121 +++++++++ .../org/apache/royale/jewel/beads/SliderView.as | 172 +++++++++++++ .../royale/jewel/supportClasses/ITextField.as | 68 +++++ .../royale/jewel/supportClasses/RadioButtonIcon.as | 117 +++++++++ .../royale/jewel/supportClasses/TextFieldBase.as | 154 +++++++++++ frameworks/projects/pom.xml | 1 + frameworks/themes/JewelTheme/.vscode/launch.json | 21 ++ frameworks/themes/JewelTheme/.vscode/settings.json | 3 + frameworks/themes/JewelTheme/.vscode/tasks.json | 8 + frameworks/themes/JewelTheme/asconfig.json | 34 +++ frameworks/themes/JewelTheme/build.xml | 133 ++++++++++ frameworks/themes/JewelTheme/pom.xml | 70 +++++ .../JewelTheme/src/main/resources/TextButton.css | 82 ++++++ .../JewelTheme/src/main/resources/TextField.css | 75 ++++++ .../src/main/resources/assets/JewelButton2.svg | 44 ++++ .../JewelTheme/src/main/resources/defaults.css | 33 +++ .../src/main/royale/JewelThemeClasses.as | 33 +++ frameworks/themes/pom.xml | 1 + 49 files changed, 2958 insertions(+), 88 deletions(-) diff --git a/examples/royale/JewelExample/.vscode/launch.json b/examples/royale/JewelExample/.vscode/launch.json new file mode 100644 index 0000000..5dfb672 --- /dev/null +++ b/examples/royale/JewelExample/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Chrome against debug.html, with sourcemaps", + "type": "chrome", + "request": "launch", + "file": "${workspaceRoot}/target/javascript/bin/js-debug/index.html", + "sourceMaps": true, + "preLaunchTask": "mvn" + }, + { + "name": "Launch Firefox against debug.html, with sourcemaps", + "type": "firefox", + "request": "launch", + "file": "${workspaceRoot}/target/javascript/bin/js-debug/index.html", + "sourceMaps": true, + "preLaunchTask": "mvn" + } + ] +} diff --git a/examples/royale/JewelExample/.vscode/settings.json b/examples/royale/JewelExample/.vscode/settings.json new file mode 100644 index 0000000..1f5a970 --- /dev/null +++ b/examples/royale/JewelExample/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "nextgenas.sdk.framework": "/Users/carlosrovira/Dev/Royale/Sdks/apache-royale-0.9.2-SNAPSHOT" +} \ No newline at end of file diff --git a/examples/royale/JewelExample/.vscode/tasks.json b/examples/royale/JewelExample/.vscode/tasks.json new file mode 100644 index 0000000..5d6198d --- /dev/null +++ b/examples/royale/JewelExample/.vscode/tasks.json @@ -0,0 +1,8 @@ +{ + // for the documentation about the tasks.json format + "version": "0.1.0", + "command": "mvn", + "args": ["clean", "install", "-DskipTests"], + "isShellCommand": true, + "showOutput": "always" +} \ No newline at end of file diff --git a/examples/royale/JewelExample/README.txt b/examples/royale/JewelExample/README.txt new file mode 100644 index 0000000..7b84b3a --- /dev/null +++ b/examples/royale/JewelExample/README.txt @@ -0,0 +1,26 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// + +DESCRIPTION + +The JewelExample is demo app to customize styles on Royale components + +Right now this is a starter project with only a button to start developing styles + + diff --git a/examples/royale/JewelExample/asconfig.json b/examples/royale/JewelExample/asconfig.json new file mode 100644 index 0000000..4b6259e --- /dev/null +++ b/examples/royale/JewelExample/asconfig.json @@ -0,0 +1,31 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +{ + "config": "royale", + "compilerOptions": { + "debug": false, + "targets": ["JSRoyale","SWF"], + "source-map": true + }, + "additionalOptions": "-remove-circulars -js-output-optimization=skipAsCoercions", + "files": + [ + "src/main/royale/App.mxml" + ] +} diff --git a/examples/royale/JewelExample/build.xml b/examples/royale/JewelExample/build.xml new file mode 100644 index 0000000..b0cb3d3 --- /dev/null +++ b/examples/royale/JewelExample/build.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/royale/JewelExample/pom.xml b/examples/royale/JewelExample/pom.xml new file mode 100644 index 0000000..56331a8 --- /dev/null +++ b/examples/royale/JewelExample/pom.xml @@ -0,0 +1,96 @@ + + + + 4.0.0 + + + org.apache.royale.examples + examples-royale + 0.9.2-SNAPSHOT + + + JewelExample + 0.9.2-SNAPSHOT + swf + + Apache Royale: Examples: Royale: JewelExample + + + src/main/royale + + + org.apache.royale.compiler + royale-maven-plugin + true + + App.mxml + JSRoyale,SWF + + + + + + + + + com.adobe.flash.framework + playerglobal + ${flash.version} + swc + provided + + + org.apache.royale.framework + Jewel + 0.9.2-SNAPSHOT + swc + swf + + + org.apache.royale.framework + Jewel + 0.9.2-SNAPSHOT + swc + js + + + org.apache.royale.framework + Basic + 0.9.2-SNAPSHOT + swc + js + + + org.apache.royale.framework + HTML + 0.9.2-SNAPSHOT + swc + swf + + + org.apache.royale.framework + JewelTheme + 0.9.2-SNAPSHOT + swc + theme + + + + diff --git a/examples/royale/JewelExample/src/main/config/compile-app-config.xml b/examples/royale/JewelExample/src/main/config/compile-app-config.xml new file mode 100644 index 0000000..df6ea5b --- /dev/null +++ b/examples/royale/JewelExample/src/main/config/compile-app-config.xml @@ -0,0 +1,28 @@ + + + + skipAsCoercions + + + + ../../../../../../frameworks/libs/JewelTheme.swc + + + diff --git a/examples/royale/JewelExample/src/main/resources/jewel-example-styles.css b/examples/royale/JewelExample/src/main/resources/jewel-example-styles.css new file mode 100644 index 0000000..48829b3 --- /dev/null +++ b/examples/royale/JewelExample/src/main/resources/jewel-example-styles.css @@ -0,0 +1,25 @@ +/* +//////////////////////////////////////////////////////////////////////////////// +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +*/ + +@namespace "http://www.w3.org/1999/xhtml"; + + + diff --git a/examples/royale/JewelExample/src/main/royale/App.mxml b/examples/royale/JewelExample/src/main/royale/App.mxml new file mode 100644 index 0000000..8f1e7e5 --- /dev/null +++ b/examples/royale/JewelExample/src/main/royale/App.mxml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + diff --git a/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml b/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml new file mode 100644 index 0000000..e7d8fe6 --- /dev/null +++ b/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml b/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml new file mode 100644 index 0000000..aa8c81a --- /dev/null +++ b/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml @@ -0,0 +1,30 @@ + + + + + + + + + + + diff --git a/examples/royale/pom.xml b/examples/royale/pom.xml index d06e5b8..373a925 100644 --- a/examples/royale/pom.xml +++ b/examples/royale/pom.xml @@ -71,6 +71,7 @@ DataBindingExampleWithFlexLayout DragAndDropExample AlertExample + JewelExample diff --git a/frameworks/projects/Jewel/.vscode/launch.json b/frameworks/projects/Jewel/.vscode/launch.json new file mode 100644 index 0000000..5dfb672 --- /dev/null +++ b/frameworks/projects/Jewel/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Chrome against debug.html, with sourcemaps", + "type": "chrome", + "request": "launch", + "file": "${workspaceRoot}/target/javascript/bin/js-debug/index.html", + "sourceMaps": true, + "preLaunchTask": "mvn" + }, + { + "name": "Launch Firefox against debug.html, with sourcemaps", + "type": "firefox", + "request": "launch", + "file": "${workspaceRoot}/target/javascript/bin/js-debug/index.html", + "sourceMaps": true, + "preLaunchTask": "mvn" + } + ] +} diff --git a/frameworks/projects/Jewel/.vscode/settings.json b/frameworks/projects/Jewel/.vscode/settings.json new file mode 100644 index 0000000..1f5a970 --- /dev/null +++ b/frameworks/projects/Jewel/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "nextgenas.sdk.framework": "/Users/carlosrovira/Dev/Royale/Sdks/apache-royale-0.9.2-SNAPSHOT" +} \ No newline at end of file diff --git a/frameworks/projects/Jewel/.vscode/tasks.json b/frameworks/projects/Jewel/.vscode/tasks.json new file mode 100644 index 0000000..5d6198d --- /dev/null +++ b/frameworks/projects/Jewel/.vscode/tasks.json @@ -0,0 +1,8 @@ +{ + // for the documentation about the tasks.json format + "version": "0.1.0", + "command": "mvn", + "args": ["clean", "install", "-DskipTests"], + "isShellCommand": true, + "showOutput": "always" +} \ No newline at end of file diff --git a/frameworks/projects/Jewel/asconfig.json b/frameworks/projects/Jewel/asconfig.json new file mode 100644 index 0000000..f4421c7 --- /dev/null +++ b/frameworks/projects/Jewel/asconfig.json @@ -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. + */ + { + "config": "royale", + "type": "lib", + "compilerOptions": { + "debug": true, + "targets": [ + "JSRoyale", + "SWF" + ], + "include-classes": [ + "JewelClasses" + ], + "include-sources": [ + "src/main/royale" + ], + "output": "target/Jewel.swc" + } +} diff --git a/frameworks/projects/Jewel/build.xml b/frameworks/projects/Jewel/build.xml new file mode 100644 index 0000000..5ad2877 --- /dev/null +++ b/frameworks/projects/Jewel/build.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/royale/pom.xml b/frameworks/projects/Jewel/pom.xml similarity index 54% copy from examples/royale/pom.xml copy to frameworks/projects/Jewel/pom.xml index d06e5b8..74e9f8d 100644 --- a/examples/royale/pom.xml +++ b/frameworks/projects/Jewel/pom.xml @@ -17,90 +17,55 @@ limitations under the License. --> - + 4.0.0 - org.apache.royale.examples - examples + org.apache.royale.framework + projects 0.9.2-SNAPSHOT - examples-royale + Jewel 0.9.2-SNAPSHOT - pom + swc - Apache Royale: Examples: Royale - - - AccordionExample - ASDoc - ChartExample - CordovaCameraExample - CreateJSExample - DataBindingExample - DataBindingExample_as - DataBindingExample_Flat - DataGridExample - DateControlsExample - DesktopMap - Flex2Royale - RoyaleStore - RoyaleStore_jquery - RoyaleTeamPage_MDL - RoyaleWebsite - RoyaleWebsiteStatsViewer - HelloWorld - HTMLElements - ListExample - MapSearch - MDLDynamicTabsExample - MDLDynamicTableExample - ModuleExample - MobileMap - MobileStocks - MobileTrader - RemoteObjectAMFTest - StorageExample - StyleExample - TeamPage - TodoListSampleApp - TreeExample - TableExample - DebuggingExample - DataBindingExampleWithFlexLayout - DragAndDropExample - AlertExample - + Apache Royale: Framework: Libs: Jewel + src/main/royale - org.apache.maven.plugins - maven-surefire-plugin - 2.19.1 - - - tests-default - integration-test - - test - - - - - org.apache.royale.examples:examples-tests - - - ${project.artifactId} - ${project.version} - ${project.packaging} - ${project.build.plugins.plugin.configuration.targets} - ${project.build.directory} - - - - + org.apache.royale.compiler + royale-maven-plugin + ${royale.compiler.version} + true + + + + library://ns.apache.org/royale/jewel + ${project.basedir}/src/main/resources/jewel-manifest.xml + + + as + library://ns.apache.org/royale/jewel + ${project.basedir}/src/main/resources/jewel-as-manifest.xml + + + + JewelClasses + + + + defaults.css + ../src/main/resources/defaults.css + + + true + + true + + @@ -122,28 +87,28 @@ org.apache.royale.framework - Language + Binding 0.9.2-SNAPSHOT swc swf org.apache.royale.framework - Language + Binding 0.9.2-SNAPSHOT swc js org.apache.royale.framework - HTML + Graphics 0.9.2-SNAPSHOT swc swf org.apache.royale.framework - HTML + Graphics 0.9.2-SNAPSHOT swc js @@ -164,40 +129,32 @@ org.apache.royale.framework - Binding + Basic 0.9.2-SNAPSHOT swc swf org.apache.royale.framework - Binding + Basic 0.9.2-SNAPSHOT swc js org.apache.royale.framework - Graphics + HTML 0.9.2-SNAPSHOT swc swf org.apache.royale.framework - Graphics + HTML 0.9.2-SNAPSHOT swc js - - - - org.apache.royale.examples - examples-tests - 0.9.2-SNAPSHOT - test - diff --git a/frameworks/projects/Jewel/src/main/config/compile-swf-config.xml b/frameworks/projects/Jewel/src/main/config/compile-swf-config.xml new file mode 100644 index 0000000..4c2f19e --- /dev/null +++ b/frameworks/projects/Jewel/src/main/config/compile-swf-config.xml @@ -0,0 +1,105 @@ + + + + + false + + + + JSRoyale + + true + + + ${env.AIR_HOME}/frameworks/libs/air/airglobal.swc + ../../../../../libs/Binding.swc + ../../../../../libs/Core.swc + ../../../../../libs/Graphics.swc + ../../../../../libs/Basic.swc + ../../../../../libs/Collections.swc + ../../../../../libs/HTML.swc + + + true + + true + + org.apache.royale.events.ValueChangeEvent + org.apache.royale.events.ValueChangeEvent + valueChange + + + COMPILE::SWF + true + + + COMPILE::JS + false + + + + Bindable + Managed + ChangeEvent + NonCommittingChangeEvent + Transient + + + + + + + + + library://ns.apache.org/royale/jewel + ../resources/jewel-manifest.xml + + + library://ns.apache.org/royale/jewel + ../resources/jewel-as-manifest.xml + + + + + ../royale + + + false + + + + defaults.css + ../resources/defaults.css + + + true + + + JewelClasses + + + + library://ns.apache.org/royale/jewel + + + ${playerglobal.version} + + + diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css new file mode 100644 index 0000000..db367df --- /dev/null +++ b/frameworks/projects/Jewel/src/main/resources/defaults.css @@ -0,0 +1,74 @@ +/* + * + * 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. + * + */ + +@namespace "library://ns.apache.org/royale/jewel"; + +/* +* Jewel TextField +*/ +TextField { + IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel"); + /*IBeadView: ClassReference("org.apache.royale.html.beads.TextInputWithBorderView"); + IBeadController: ClassReference("org.apache.royale.html.beads.controllers.EditableTextKeyboardController");*/ +} +.vTextField--input {} +.vTextField--label {} + +/* +* Jewel TextButton +*/ +TextButton { +} +TextButton:hover {} +TextButton:active {} + +/* +* Jewel Slider +*/ +Slider { + IBeadModel: ClassReference("org.apache.royale.html.beads.models.RangeModel"); + IBeadView: ClassReference("org.apache.royale.jewel.beads.SliderView"); + IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.HorizontalSliderLayout"); + IBeadController: ClassReference("org.apache.royale.html.beads.controllers.HSliderMouseController"); + position: relative; +} +.SliderTrack { + position: absolute; +} +.SliderThumb { + position: absolute; + border-radius: 15px; +} + +@media -royale-swf +{ + Slider + { + iThumbView: ClassReference("org.apache.royale.jewel.beads.SliderThumbView"); + iTrackView: ClassReference("org.apache.royale.jewel.beads.SliderTrackView"); + } + + RadioButton + { + IBeadModel: ClassReference("org.apache.royale.html.beads.models.ValueToggleButtonModel"); + IBeadView: ClassReference("org.apache.royale.jewel.beads.RadioButtonView"); + /*font-size: 11px; + font-family: Arial;*/ + } +} diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-as-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-as-manifest.xml new file mode 100644 index 0000000..e38496a --- /dev/null +++ b/frameworks/projects/Jewel/src/main/resources/jewel-as-manifest.xml @@ -0,0 +1,25 @@ + + + + + + + + diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml new file mode 100644 index 0000000..804e1de --- /dev/null +++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as new file mode 100644 index 0000000..cc74f2e --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as @@ -0,0 +1,42 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * @private + * This class is used to link additional classes into jewel.swc + * beyond those that are found by dependecy analysis starting + * from the classes specified in manifest.xml. + */ + internal class JewelClasses + { + import org.apache.royale.jewel.beads.SliderView; SliderView; + + COMPILE::SWF + { + import org.apache.royale.jewel.beads.SliderThumbView; SliderThumbView; + import org.apache.royale.jewel.beads.SliderTrackView; SliderTrackView; + + import org.apache.royale.jewel.beads.RadioButtonView; RadioButtonView; + } + + } + +} \ No newline at end of file diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Application.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Application.as new file mode 100644 index 0000000..0b447f6 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Application.as @@ -0,0 +1,70 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel +{ + import org.apache.royale.core.Application; + import org.apache.royale.core.SimpleCSSValuesImpl; + + /** + * Jewel Application holds specific Jewel need in a Royale Application. + * + * This class extends the standard Application and sets up the + * SimpleCSSValuesImpl (implementation) for convenience. + * + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public class Application extends org.apache.royale.core.Application + { + /** + * constructor. + * + * + * + * + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function Application() + { + super(); + + this.valuesImpl = new SimpleCSSValuesImpl(); + + // this a is temp solution until we get a better way to get a reference to Application + //topLevelApplication = this; + } + + /** + * static reference to this application used mainly for dialog (Dialog class) + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + //public static var topLevelApplication:Object; + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as new file mode 100644 index 0000000..05a5b3d --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/RadioButton.as @@ -0,0 +1,107 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel +{ + import org.apache.royale.html.RadioButton; + + COMPILE::SWF + { + import flash.display.DisplayObject; + } + + COMPILE::JS + { + import org.apache.royale.core.WrappedHTMLElement; + import org.apache.royale.jewel.supportClasses.RadioButtonIcon; + import org.apache.royale.html.util.addElementToWrapper; + } + + /** + * The RadioButton class is a component that displays a selectable Button. RadioButtons + * are typically used in groups, identified by the groupName property. RadioButton use + * the following beads: + * + * org.apache.royale.core.IBeadModel: the data model, which includes the groupName. + * org.apache.royale.core.IBeadView: the bead that constructs the visual parts of the RadioButton.. + * + * @toplevel + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + COMPILE::SWF + public class RadioButton extends org.apache.royale.html.RadioButton + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function RadioButton(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null, hitTestState:DisplayObject=null) + { + super(upState, overState, downState, hitTestState); + } + } + + COMPILE::JS + public class RadioButton extends org.apache.royale.html.RadioButton + { + /** + * @private + * + * @royalesuppresspublicvarwarning + */ + public static var radioCounter:int = 0; + + private var labelFor:HTMLLabelElement; + private var textNode:Text; + private var icon:RadioButtonIcon; + + /** + * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement + * @royaleignorecoercion HTMLInputElement + * @royaleignorecoercion HTMLLabelElement + * @royaleignorecoercion Text + */ + override protected function createElement():WrappedHTMLElement + { + + + icon = new RadioButtonIcon() + icon.id = '_radio_' + org.apache.royale.jewel.RadioButton.radioCounter++; + + textNode = document.createTextNode('') as Text; + + labelFor = addElementToWrapper(this,'label') as HTMLLabelElement; + labelFor.appendChild(icon.element); + labelFor.appendChild(textNode); + + (textNode as WrappedHTMLElement).royale_wrapper = this; + (icon.element as WrappedHTMLElement).royale_wrapper = this; + + typeNames = 'RadioButton'; + + return element; + } + } +} \ No newline at end of file diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Slider.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Slider.as new file mode 100644 index 0000000..9d4f6d9 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/Slider.as @@ -0,0 +1,72 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel +{ + import org.apache.royale.html.Slider; + + COMPILE::JS + { + import org.apache.royale.core.WrappedHTMLElement; + } + + [Event(name="valueChange", type="org.apache.royale.events.Event")] + + /** + * The Slider class is a component that displays a range of values using a + * track and a thumb control. The Slider uses the following bead types: + * + * org.apache.royale.core.IBeadModel: the data model, typically an IRangeModel, that holds the Slider values. + * org.apache.royale.core.IBeadView: the bead that constructs the visual parts of the Slider. + * org.apache.royale.core.IBeadController: the bead that handles input. + * org.apache.royale.core.IThumbValue: the bead responsible for the display of the thumb control. + * org.apache.royale.core.ITrackView: the bead responsible for the display of the track. + * + * @toplevel + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public class Slider extends org.apache.royale.html.Slider + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function Slider() + { + super(); + } + + + + /** + * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement + */ + COMPILE::JS + override protected function createElement():WrappedHTMLElement + { + return super.createElement(); + } + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TextButton.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TextButton.as new file mode 100644 index 0000000..63beab2 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TextButton.as @@ -0,0 +1,63 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel +{ + import org.apache.royale.html.TextButton; + + COMPILE::JS + { + import org.apache.royale.core.WrappedHTMLElement; + import org.apache.royale.html.util.addElementToWrapper; + } + + /** + * The Button class provides a Jewel Design Library UI-like appearance for + * a Button. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public class TextButton extends org.apache.royale.html.TextButton + { + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function TextButton() + { + super(); + } + + /** + * @private + * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement + */ + COMPILE::JS + override protected function createElement():WrappedHTMLElement + { + return super.createElement(); + } + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TextField.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TextField.as new file mode 100644 index 0000000..145ab37 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/TextField.as @@ -0,0 +1,115 @@ +// +// 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.jewel +{ + import org.apache.royale.jewel.supportClasses.TextFieldBase; + + COMPILE::JS + { + import goog.events; + import org.apache.royale.core.WrappedHTMLElement; + import org.apache.royale.html.util.addElementToWrapper; + } + + /** + * The TextField class implements the basic control for + * single-line text input. + * + * @toplevel + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public class TextField extends TextFieldBase + { + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function TextField() + { + super(); + } + + COMPILE::JS + private var _positioner:WrappedHTMLElement; + + COMPILE::JS + /** + * The HTMLElement used to position the component. + */ + override public function get positioner():WrappedHTMLElement + { + return _positioner; + } + + COMPILE::JS + /** + * @private + */ + override public function set positioner(value:WrappedHTMLElement):void + { + _positioner = value; + } + + /** + * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement + * @royaleignorecoercion HTMLDivElement + * @royaleignorecoercion HTMLInputElement + * @royaleignorecoercion HTMLLabelElement + * @royaleignorecoercion Text + */ + COMPILE::JS + override protected function createElement():WrappedHTMLElement + { + typeNames = "TextField"; + + var div:HTMLDivElement = document.createElement('div') as HTMLDivElement; + div.className = typeNames; + + input = addElementToWrapper(this,'input') as HTMLInputElement; + input.setAttribute('type', 'text'); + input.className = "vTextField--input"; + + //attach input handler to dispatch royale change event when user write in textinput + //goog.events.listen(element, 'change', killChangeHandler); + goog.events.listen(input, 'input', textChangeHandler); + + label = document.createElement('label') as HTMLLabelElement; + label.className = "vTextField--label"; + + textNode = document.createTextNode('') as Text; + label.appendChild(textNode); + + div.appendChild(input); + div.appendChild(label); + + positioner = div as WrappedHTMLElement; + (label as WrappedHTMLElement).royale_wrapper = this; + _positioner.royale_wrapper = this; + + return element; + } + + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as new file mode 100644 index 0000000..984b7b5 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/RadioButtonView.as @@ -0,0 +1,286 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel.beads +{ + import flash.display.Shape; + import flash.display.SimpleButton; + import flash.display.Sprite; + import flash.text.TextFieldAutoSize; + import flash.text.TextFieldType; + + import org.apache.royale.core.BeadViewBase; + import org.apache.royale.core.CSSTextField; + import org.apache.royale.core.IBeadView; + import org.apache.royale.core.IStrand; + import org.apache.royale.core.IValueToggleButtonModel; + import org.apache.royale.events.Event; + + /** + * The RadioButtonView class creates the visual elements of the org.apache.royale.html.RadioButton + * component. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public class RadioButtonView extends BeadViewBase implements IBeadView + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function RadioButtonView() + { + sprites = [ upSprite = new Sprite(), + downSprite = new Sprite(), + overSprite = new Sprite(), + upAndSelectedSprite = new Sprite(), + downAndSelectedSprite = new Sprite(), + overAndSelectedSprite = new Sprite() ]; + + for each( var s:Sprite in sprites ) + { + var tf:CSSTextField = new CSSTextField(); + tf.type = TextFieldType.DYNAMIC; + tf.autoSize = TextFieldAutoSize.LEFT; + tf.name = "textField"; + var icon:Shape = new Shape(); + icon.name = "icon"; + s.addChild(icon); + s.addChild(tf); + } + } + + private var upSprite:Sprite; + private var downSprite:Sprite; + private var overSprite:Sprite; + private var upAndSelectedSprite:Sprite; + private var downAndSelectedSprite:Sprite; + private var overAndSelectedSprite:Sprite; + + private var sprites:Array; + + private var _toggleButtonModel:IValueToggleButtonModel; + + /** + * The model used for the RadioButton. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function get toggleButtonModel() : IValueToggleButtonModel + { + return _toggleButtonModel; + } + + /** + * @copy org.apache.royale.core.IBead#strand + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + override public function set strand(value:IStrand):void + { + super.strand = value; + _toggleButtonModel = value.getBeadByType(IValueToggleButtonModel) as IValueToggleButtonModel; + _toggleButtonModel.addEventListener("textChange", textChangeHandler); + _toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler); + _toggleButtonModel.addEventListener("selectedValueChange", selectedValueChangeHandler); + if (_toggleButtonModel.text != null) + text = _toggleButtonModel.text; + if (_toggleButtonModel.html != null) + html = _toggleButtonModel.html; + for each( var s:Sprite in sprites ) + { + var tf:CSSTextField = s.getChildByName("textField") as CSSTextField; + tf.styleParent = value; + } + + layoutControl(); + + var hitArea:Shape = new Shape(); + hitArea.graphics.beginFill(0x000000); + hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height); + hitArea.graphics.endFill(); + + SimpleButton(value).upState = upSprite; + SimpleButton(value).downState = downSprite; + SimpleButton(value).overState = overSprite; + SimpleButton(value).hitTestState = hitArea; + + if (toggleButtonModel.text !== null) + text = toggleButtonModel.text; + if (toggleButtonModel.html !== null) + html = toggleButtonModel.html; + + if (toggleButtonModel.selected && toggleButtonModel.value == value) { + selected = true; + } + } + + /** + * The string label for the org.apache.royale.html.RadioButton. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function get text():String + { + var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField; + return tf.text; + } + public function set text(value:String):void + { + for each( var s:Sprite in sprites ) + { + var tf:CSSTextField = s.getChildByName('textField') as CSSTextField; + tf.text = value; + } + + layoutControl(); + } + + /** + * The HTML string for the org.apache.royale.html.RadioButton. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function get html():String + { + var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField; + return tf.htmlText; + } + public function set html(value:String):void + { + for each(var s:Sprite in sprites) + { + var tf:CSSTextField = s.getChildByName('textField') as CSSTextField; + tf.htmlText = value; + } + + layoutControl(); + } + + /** + * @private + */ + private function textChangeHandler(event:Event):void + { + text = toggleButtonModel.text; + } + + /** + * @private + */ + private function htmlChangeHandler(event:Event):void + { + html = toggleButtonModel.html; + } + + private var _selected:Boolean; + + /** + * The selection state of the RadioButton + */ + public function get selected():Boolean + { + return _selected; + } + public function set selected(value:Boolean):void + { + _selected = value; + + if( value ) { + SimpleButton(_strand).upState = upAndSelectedSprite; + SimpleButton(_strand).downState = downAndSelectedSprite; + SimpleButton(_strand).overState = overAndSelectedSprite; + + } else { + SimpleButton(_strand).upState = upSprite; + SimpleButton(_strand).downState = downSprite; + SimpleButton(_strand).overState = overSprite; + } + + layoutControl(); + } + + /** + * @private + */ + private function selectedValueChangeHandler(event:Event):void + { + selected = _toggleButtonModel.value == _toggleButtonModel.selectedValue; + } + + /** + * @private + */ + protected function layoutControl() : void + { + for each(var s:Sprite in sprites) + { + var icon:Shape = s.getChildByName("icon") as Shape; + var tf:CSSTextField = s.getChildByName("textField") as CSSTextField; + + drawRadioButton(icon); + + var mh:Number = Math.max(icon.height,tf.height); + + icon.x = 0; + icon.y = (mh - icon.height)/2; + + tf.x = icon.x + icon.width + 1; + tf.y = (mh - tf.height)/2; + } + + } + + /** + * @private + */ + protected function drawRadioButton(icon:Shape) : void + { + icon.graphics.clear(); + icon.graphics.beginFill(0xf8f8f8); + icon.graphics.lineStyle(1,0x808080); + icon.graphics.drawEllipse(0,0,10,10); + icon.graphics.endFill(); + + if( selected ) { + icon.graphics.beginFill(0); + icon.graphics.drawEllipse(3,3,4,4); + icon.graphics.endFill(); + } + } + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderThumbView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderThumbView.as new file mode 100644 index 0000000..4df51c8 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderThumbView.as @@ -0,0 +1,121 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel.beads +{ + import flash.display.Graphics; + import flash.display.Shape; + import flash.display.SimpleButton; + + import org.apache.royale.core.BeadViewBase; + import org.apache.royale.core.IBeadView; + import org.apache.royale.core.IStrand; + import org.apache.royale.html.Button; + import org.apache.royale.events.Event; + import org.apache.royale.events.IEventDispatcher; + import org.apache.royale.core.IChild; + + /** + * The SliderThumbView class creates the draggable input element for the + * org.apache.royale.html.Slider component. + * + * @viewbead + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public class SliderThumbView extends BeadViewBase implements IBeadView + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function SliderThumbView() + { + hitArea = new Shape(); + upView = new Shape(); + downView = new Shape(); + overView = new Shape(); + } + + /** + * @private + */ + private function drawView(g:Graphics, bgColor:uint):void + { + var host:Button = Button(_strand); + var button:SimpleButton = IChild(_strand).$displayObject as SimpleButton; + g.clear(); + g.lineStyle(1,0x000000); + g.beginFill(bgColor,1.0); + g.drawCircle(host.width/2, host.height/2, 10); + g.endFill(); + } + + private var hitArea:Shape; + + /** + * @copy org.apache.royale.core.IBead#strand + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + * @royaleignoreimport org.apache.royale.core.WrappedHTMLElement + * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement + */ + override public function set strand(value:IStrand):void + { + super.strand = value; + + drawView(hitArea.graphics, 0xDD0000); + drawView(upView.graphics, 0xFFFFFF); + drawView(downView.graphics, 0x999999); + drawView(overView.graphics, 0xDDDDDD); + + var button:SimpleButton = IChild(value).$displayObject as SimpleButton; + button.upState = upView; + button.downState = downView; + button.overState = overView; + button.hitTestState = hitArea; + + IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler); + IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler); + } + + private var upView:Shape; + private var downView:Shape; + private var overView:Shape; + + /** + * @private + */ + private function sizeChangeHandler( event:Event ) : void + { + drawView(hitArea.graphics, 0xDD0000); + drawView(upView.graphics, 0xFFFFFF); + drawView(downView.graphics, 0x999999); + drawView(overView.graphics, 0xDDDDDD); + } + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderTrackView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderTrackView.as new file mode 100644 index 0000000..a5e0410 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderTrackView.as @@ -0,0 +1,121 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel.beads +{ + import flash.display.Graphics; + import flash.display.Shape; + import flash.display.SimpleButton; + + import org.apache.royale.core.BeadViewBase; + import org.apache.royale.core.IBeadView; + import org.apache.royale.core.IStrand; + import org.apache.royale.core.UIBase; + import org.apache.royale.html.Button; + import org.apache.royale.events.Event; + import org.apache.royale.events.IEventDispatcher; + import org.apache.royale.core.IChild; + + /** + * The SliderTrackView class creates the track area for the org.apache.royale.html.Slider + * component. + * + * @viewbead + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public class SliderTrackView extends BeadViewBase implements IBeadView + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function SliderTrackView() + { + hitArea = new Shape(); + upView = new Shape(); + downView = new Shape(); + overView = new Shape(); + } + + /** + * @private + */ + private function drawView(g:Graphics, bgColor:uint):void + { + var host:Button = Button(_strand); + var button:SimpleButton = IChild(_strand).$displayObject as SimpleButton; + g.clear(); + g.lineStyle(1,0x000000); + g.beginFill(bgColor); + g.drawRect(0, 0, host.width, host.height); + g.endFill(); + } + + private var hitArea:Shape; + + /** + * @copy org.apache.royale.core.IBead#strand + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement + */ + override public function set strand(value:IStrand):void + { + super.strand = value; + + drawView(hitArea.graphics, 0xDD0000); + drawView(upView.graphics, 0xCCCCCC); + drawView(downView.graphics, 0x808080); + drawView(overView.graphics, 0xEEEEEE); + + var button:SimpleButton = IChild(value).$displayObject as SimpleButton; + button.upState = upView; + button.downState = downView; + button.overState = overView; + button.hitTestState = hitArea; + + IEventDispatcher(value).addEventListener("widthChanged",sizeChangeHandler); + IEventDispatcher(value).addEventListener("heightChanged",sizeChangeHandler); + } + + private var upView:Shape; + private var downView:Shape; + private var overView:Shape; + + /** + * @private + */ + private function sizeChangeHandler( event:Event ) : void + { + drawView(hitArea.graphics, 0xDD0000); + drawView(upView.graphics, 0xCCCCCC); + drawView(downView.graphics, 0x808080); + drawView(overView.graphics, 0xEEEEEE); + } + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderView.as new file mode 100644 index 0000000..c62a3fc --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/SliderView.as @@ -0,0 +1,172 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel.beads +{ + COMPILE::SWF { + import flash.display.DisplayObject; + import flash.display.Sprite; + } + + import org.apache.royale.html.beads.ISliderView; + import org.apache.royale.core.BeadViewBase; + import org.apache.royale.core.IBead; + import org.apache.royale.core.IBeadLayout; + import org.apache.royale.core.IBeadModel; + import org.apache.royale.core.IBeadView; + import org.apache.royale.core.IRangeModel; + import org.apache.royale.core.IStrand; + import org.apache.royale.core.IUIBase; + import org.apache.royale.core.UIBase; + import org.apache.royale.core.ValuesManager; + import org.apache.royale.events.Event; + import org.apache.royale.events.IEventDispatcher; + import org.apache.royale.html.Button; + import org.apache.royale.html.TextButton; + + /** + * The SliderView class creates the visual elements of the org.apache.royale.html.Slider + * component. The Slider has a track and a thumb control which are also created with view beads. + * + * @viewbead + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public class SliderView extends BeadViewBase implements ISliderView, IBeadView + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function SliderView() + { + } + + private var rangeModel:IRangeModel; + + /** + * @copy org.apache.royale.core.IBead#strand + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + override public function set strand(value:IStrand):void + { + super.strand = value; + + var layout:IBeadLayout = _strand.getBeadByType(IBeadLayout) as IBeadLayout; + if (layout == null) { + var klass:Class = ValuesManager.valuesImpl.getValue(_strand, "iBeadLayout"); + _strand.addBead(new klass() as IBead); + } + + COMPILE::SWF { + var s:UIBase = UIBase(_strand); + + _track = new Button(); + _track.addBead(new (ValuesManager.valuesImpl.getValue(_strand, "iTrackView")) as IBead); + _track.className = "SliderTrack"; + s.addElement(_track); + + _thumb = new TextButton(); + _thumb.text = '\u29BF'; + _thumb.addBead(new (ValuesManager.valuesImpl.getValue(_strand, "iThumbView")) as IBead); + _thumb.className = "SliderThumb"; + s.addElement(_thumb); + + } + COMPILE::JS { + _track = new Button(); + _track.className = "SliderTrack"; + host.addElement(_track); + + _thumb = new TextButton(); + _thumb.className = "SliderThumb"; + _thumb.text = '\u29BF'; + host.addElement(_thumb); + } + + rangeModel = _strand.getBeadByType(IBeadModel) as IRangeModel; + + var rm:IEventDispatcher = rangeModel as IEventDispatcher; + + // listen for changes to the model and adjust the UI accordingly. + rm.addEventListener("valueChange",modelChangeHandler); + rm.addEventListener("minimumChange",modelChangeHandler); + rm.addEventListener("maximumChange",modelChangeHandler); + rm.addEventListener("stepSizeChange",modelChangeHandler); + rm.addEventListener("snapIntervalChange",modelChangeHandler); + + (_strand as IEventDispatcher).dispatchEvent(new Event("layoutNeeded")); + } + + private var _track:Button; + private var _thumb:TextButton; + + + /** + * The track component. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function get track():IUIBase + { + return _track; + } + + /** + * The thumb component. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public function get thumb():IUIBase + { + return _thumb; + } + + /** + * @royaleignorecoercion org.apache.royale.core.UIBase + */ + private function get host():UIBase + { + return _strand as UIBase; + } + + /** + * @private + */ + private function modelChangeHandler( event:Event ) : void + { + (_strand as IEventDispatcher).dispatchEvent(new Event("layoutNeeded")); + } + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/ITextField.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/ITextField.as new file mode 100644 index 0000000..e1ed050 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/ITextField.as @@ -0,0 +1,68 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel.supportClasses +{ + /** + * ITextField is the interface that all text jewel classes. + * It's used mainly in org.apache.royale.jewel.supportClasses.TextFieldBase + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 9.2 + */ + public interface ITextField + { + COMPILE::JS + { + /** + * the textNode + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + function get textNode():Text; + function set textNode(value:Text):void; + + /** + * the input + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + function get input():HTMLInputElement; + function set input(value:HTMLInputElement):void; + + /** + * the label + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + function get label():HTMLLabelElement; + function set label(value:HTMLLabelElement):void; + } + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/RadioButtonIcon.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/RadioButtonIcon.as new file mode 100644 index 0000000..4d71794 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/RadioButtonIcon.as @@ -0,0 +1,117 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.jewel.supportClasses +{ + COMPILE::JS { + import org.apache.royale.core.WrappedHTMLElement; + } + + /** + * The RadioButton class is a component that displays a selectable Button. RadioButtons + * are typically used in groups, identified by the groupName property. RadioButton use + * the following beads: + * + * org.apache.royale.core.IBeadModel: the data model, which includes the groupName. + * org.apache.royale.core.IBeadView: the bead that constructs the visual parts of the RadioButton.. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.0 + */ + public class RadioButtonIcon + { + public function RadioButtonIcon() + { + COMPILE::JS { + createElement(); + } + + className = 'RadioButtonIcon'; + } + + /** + * @private + * + * @royalesuppresspublicvarwarning + */ + COMPILE::JS + public var element:WrappedHTMLElement; + + COMPILE::JS + public function get positioner():WrappedHTMLElement + { + return element; + } + + private var _className:String; + + /** + * @private + */ + public function get className():String + { + return _className; + } + public function set className(value:String):void + { + _className = value; + + COMPILE::JS { + element.className = value; + } + } + + private var _id:String; + + /** + * @private + */ + public function get id():String + { + return _id; + } + public function set id(value:String):void + { + _id = value; + + COMPILE::JS { + element.id = value; + } + } + + /** + * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement + * @royaleignorecoercion HTMLInputElement + * @royaleignorecoercion Text + */ + COMPILE::JS + protected function createElement():WrappedHTMLElement + { + //This class does not subclass anything, so these properties must be set explicitly + var input:HTMLInputElement = document.createElement('input') as HTMLInputElement; + input.type = 'radio'; + + element = input as WrappedHTMLElement; + element.royale_wrapper = this; + + return element; + } + } +} diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/TextFieldBase.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/TextFieldBase.as new file mode 100644 index 0000000..5cb5924 --- /dev/null +++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/TextFieldBase.as @@ -0,0 +1,154 @@ +// +// 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.jewel.supportClasses +{ + import org.apache.royale.events.Event; + import org.apache.royale.html.TextInput; + + import org.apache.royale.jewel.supportClasses.ITextField; + + COMPILE::JS + { + import goog.events; + import org.apache.royale.core.WrappedHTMLElement; + } + + /** + * The TextFieldBase class is the base class for TextField and TextArea Jewel controls + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public class TextFieldBase extends TextInput implements ITextField + { + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function TextFieldBase() + { + super(); + } + + COMPILE::JS + { + private var _textNode:Text; + /** + * @copy org.apache.royale.jewel.supportClasses.ITextField#textNode + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function get textNode():Text + { + return _textNode; + } + + public function set textNode(value:Text):void + { + _textNode = value; + } + + private var _input:HTMLInputElement; + /** + * @copy org.apache.royale.jewel.supportClasses.ITextField#input + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function get input():HTMLInputElement + { + return _input; + } + + public function set input(value:HTMLInputElement):void + { + _input = value; + } + + private var _label:HTMLLabelElement; + /** + * @copy org.apache.royale.jewel.supportClasses.ITextField#label + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function get label():HTMLLabelElement + { + return _label; + } + + public function set label(value:HTMLLabelElement):void + { + _label = value; + } + } + + COMPILE::JS + /** + * override UIBase to affect positioner instead of element + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + override protected function setClassName(value:String):void + { + positioner.className = value; + } + + private var _isInvalid:Boolean = false; + /** + * A boolean flag to activate "is-invalid" effect selector. + * Defines the textfield as invalid on initial load. + * Optional + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion Royale 0.9.2 + */ + public function get isInvalid():Boolean + { + return _isInvalid; + } + public function set isInvalid(value:Boolean):void + { + _isInvalid = value; + + COMPILE::JS + { + positioner.classList.toggle("is-invalid", _isInvalid); + typeNames = positioner.className; + } + } + } +} diff --git a/frameworks/projects/pom.xml b/frameworks/projects/pom.xml index c1d5cc1..456351d 100644 --- a/frameworks/projects/pom.xml +++ b/frameworks/projects/pom.xml @@ -60,6 +60,7 @@ Text TLF RoyaleSite + Jewel diff --git a/frameworks/themes/JewelTheme/.vscode/launch.json b/frameworks/themes/JewelTheme/.vscode/launch.json new file mode 100644 index 0000000..5dfb672 --- /dev/null +++ b/frameworks/themes/JewelTheme/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Chrome against debug.html, with sourcemaps", + "type": "chrome", + "request": "launch", + "file": "${workspaceRoot}/target/javascript/bin/js-debug/index.html", + "sourceMaps": true, + "preLaunchTask": "mvn" + }, + { + "name": "Launch Firefox against debug.html, with sourcemaps", + "type": "firefox", + "request": "launch", + "file": "${workspaceRoot}/target/javascript/bin/js-debug/index.html", + "sourceMaps": true, + "preLaunchTask": "mvn" + } + ] +} diff --git a/frameworks/themes/JewelTheme/.vscode/settings.json b/frameworks/themes/JewelTheme/.vscode/settings.json new file mode 100644 index 0000000..1f5a970 --- /dev/null +++ b/frameworks/themes/JewelTheme/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "nextgenas.sdk.framework": "/Users/carlosrovira/Dev/Royale/Sdks/apache-royale-0.9.2-SNAPSHOT" +} \ No newline at end of file diff --git a/frameworks/themes/JewelTheme/.vscode/tasks.json b/frameworks/themes/JewelTheme/.vscode/tasks.json new file mode 100644 index 0000000..5d6198d --- /dev/null +++ b/frameworks/themes/JewelTheme/.vscode/tasks.json @@ -0,0 +1,8 @@ +{ + // for the documentation about the tasks.json format + "version": "0.1.0", + "command": "mvn", + "args": ["clean", "install", "-DskipTests"], + "isShellCommand": true, + "showOutput": "always" +} \ No newline at end of file diff --git a/frameworks/themes/JewelTheme/asconfig.json b/frameworks/themes/JewelTheme/asconfig.json new file mode 100644 index 0000000..2a1ae6c --- /dev/null +++ b/frameworks/themes/JewelTheme/asconfig.json @@ -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. + */ + { + "config": "royale", + "type": "lib", + "compilerOptions": { + "debug": true, + "targets": [ + "JSRoyale", + "SWF" + ], + "include-classes": [ + "JewelThemeClasses" + ], + "include-sources": [ + "src/main/royale" + ], + "output": "target/JewelThemeClasses.swc" + } +} diff --git a/frameworks/themes/JewelTheme/build.xml b/frameworks/themes/JewelTheme/build.xml new file mode 100644 index 0000000..6174e3e --- /dev/null +++ b/frameworks/themes/JewelTheme/build.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frameworks/themes/JewelTheme/pom.xml b/frameworks/themes/JewelTheme/pom.xml new file mode 100644 index 0000000..ea75e2d --- /dev/null +++ b/frameworks/themes/JewelTheme/pom.xml @@ -0,0 +1,70 @@ + + + + 4.0.0 + + + org.apache.royale.framework + themes + 0.9.2-SNAPSHOT + + + JewelTheme + 0.9.2-SNAPSHOT + swc + + Apache Royale: Framework: Themes: JewelTheme + + + src/main/royale + + + org.apache.royale.compiler + royale-maven-plugin + ${royale.compiler.version} + true + + + JewelThemeClasses + + + + assets/* + ../src/main/resources/assets/* + + + defaults.css + ../src/main/resources/defaults.css + + + TextButton.css + ../src/main/resources/TextButton.css + + + TextField.css + ../src/main/resources/TextField.css + + + + + + + + diff --git a/frameworks/themes/JewelTheme/src/main/resources/TextButton.css b/frameworks/themes/JewelTheme/src/main/resources/TextButton.css new file mode 100644 index 0000000..cbbfb51 --- /dev/null +++ b/frameworks/themes/JewelTheme/src/main/resources/TextButton.css @@ -0,0 +1,82 @@ +/* + * + * 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. + * + */ + +@namespace "library://ns.apache.org/royale/jewel"; +/*@namespace svg "library://ns.apache.org/royale/svg";*/ + +/* +* Jewel TextButton +*/ + +TextButton, TextButton:hover { + + cursor:pointer; + + border-image-source: url(assets/JewelButton2.svg) ; + border-image-slice: 4; + border-image-width: 4; + + background-image: linear-gradient(#3BB0FF, #1E36FA); + background-size: cover; + background-repeat: no-repeat; + background-clip: padding-box; + + /* TextField: */ + font-family: 'Lato-Bold', sans-serif; + font-size: 14px; + font-weight:bold; + color: #fff; + text-shadow: 0 1px 0 #555; + + padding: 10px 32px; + /*line-height:16px; + */ + + /*border-image: url(assets/JewelButton2.svg) 30 fill stretch; + */ + /*background: url(assets/4slicewithpattern.svg); + background-size: cover; + width: fit-content; + height: fit-content; + */ + + + /* Background: */ + /*background: linear-gradient(#FF893B, #FA461E); + border: 1px solid #A93116; + border-radius: 3px; + box-shadow: #E6B89B 0 1px 0 inset, #E6431D 0 -1px 0 inset, #aaa 0 1px 0 inset; + */ + +} + +TextButton:hover { + /*background: linear-gradient(#FD9958, #F76943); + border: 1px solid #BC573C; + line-height:16px; + padding: 8px 16px;*/ +} + +TextButton:active { + /*box-shadow: #E6431D 0 1px 0 inset; + text-shadow: 0 -1px 0 #5F3A29;*/ +} +TextButton:focus { + outline:0; +} \ No newline at end of file diff --git a/frameworks/themes/JewelTheme/src/main/resources/TextField.css b/frameworks/themes/JewelTheme/src/main/resources/TextField.css new file mode 100644 index 0000000..d7a1b85 --- /dev/null +++ b/frameworks/themes/JewelTheme/src/main/resources/TextField.css @@ -0,0 +1,75 @@ +/* + * + * 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. + * + */ + +@namespace "library://ns.apache.org/royale/jewel"; +/*@namespace svg "library://ns.apache.org/royale/svg";*/ + +/* +* Jewel TextField +*/ +TextField { + position: relative; + display: inline-block; + box-sizing: border-box; + width: 300px; + max-width: 100%; + margin: 0; +} + +.vTextField--input { + font-size: 16px; + font-family: 'Lato', sans-serif; + + border: none; + border-bottom: 2px solid; + border-bottom-color: #ff0000; + display: block; + margin: 0; + padding: 4 0; + width: 100px; + background: transparent; + text-align: left; + color: inherit; + outline: none; +} + +.vTextField--label { + bottom: 0; + color: #ff0000; + font-size: 13px; + left: 0; + right: 0; + pointer-events: none; + position: absolute; + display: block; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-align: left; +} + +/* + padding: 5px; + border: solid 1px #666666; + border-radius: 6px; + color: #333333; +:hover + padding: 5px; + background-color: #DFDFDF; +*/ \ No newline at end of file diff --git a/frameworks/themes/JewelTheme/src/main/resources/assets/JewelButton2.svg b/frameworks/themes/JewelTheme/src/main/resources/assets/JewelButton2.svg new file mode 100644 index 0000000..ad0c128 --- /dev/null +++ b/frameworks/themes/JewelTheme/src/main/resources/assets/JewelButton2.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frameworks/themes/JewelTheme/src/main/resources/defaults.css b/frameworks/themes/JewelTheme/src/main/resources/defaults.css new file mode 100644 index 0000000..3d376ac --- /dev/null +++ b/frameworks/themes/JewelTheme/src/main/resources/defaults.css @@ -0,0 +1,33 @@ +/* + * + * 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. + * + */ + + @namespace "http://www.w3.org/1999/xhtml"; + + .royale *, . royale *:before, . royale *:after { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + } + + .page-content + { + padding: 10px; + margin: 10px; + } + \ No newline at end of file diff --git a/frameworks/themes/JewelTheme/src/main/royale/JewelThemeClasses.as b/frameworks/themes/JewelTheme/src/main/royale/JewelThemeClasses.as new file mode 100644 index 0000000..394b871 --- /dev/null +++ b/frameworks/themes/JewelTheme/src/main/royale/JewelThemeClasses.as @@ -0,0 +1,33 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * @private + * This class is used to link additional classes into jeweltheme.swc + * beyond those that are found by dependecy analysis starting + * from the classes specified in manifest.xml. + */ + internal class JewelThemeClasses + { + + } + +} \ No newline at end of file diff --git a/frameworks/themes/pom.xml b/frameworks/themes/pom.xml index 33ba1d3..bc9ab6c 100644 --- a/frameworks/themes/pom.xml +++ b/frameworks/themes/pom.xml @@ -34,6 +34,7 @@ Basic + JewelTheme -- To stop receiving notification emails like this one, please contact carlosrovira@apache.org.