http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/AwesomeUtils.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/AwesomeUtils.as b/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/AwesomeUtils.as new file mode 100644 index 0000000..ec7fb78 --- /dev/null +++ b/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/AwesomeUtils.as @@ -0,0 +1,399 @@ +/** + 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 skins.flatspark.utils +{ + public class AwesomeUtils + { + + public function AwesomeUtils() + { + + } + + public static const fa_glass:String = "\uf000"; + public static const fa_music:String = "\uf001"; + public static const fa_search:String = "\uf002"; + public static const fa_envelope_o:String = "\uf003"; + public static const fa_heart:String = "\uf004"; + public static const fa_star:String = "\uf005"; + public static const fa_star_o:String = "\uf006"; + public static const fa_user:String = "\uf007"; + public static const fa_film:String = "\uf008"; + public static const fa_th_large:String = "\uf009"; + public static const fa_th:String = "\uf00a"; + public static const fa_th_list:String = "\uf00b"; + public static const fa_check:String = "\uf00c"; + public static const fa_times:String = "\uf00d"; + public static const fa_search_plus:String = "\uf00e"; + public static const fa_search_minus:String = "\uf010"; + public static const fa_power_off:String = "\uf011"; + public static const fa_signal:String = "\uf012"; + public static const fa_cog:String = "\uf013"; + public static const fa_trash_o:String = "\uf014"; + public static const fa_home:String = "\uf015"; + public static const fa_file_o:String = "\uf016"; + public static const fa_clock_o:String = "\uf017"; + public static const fa_road:String = "\uf018"; + public static const fa_download:String = "\uf019"; + public static const fa_arrow_circle_o_down:String = "\uf01a"; + public static const fa_arrow_circle_o_up:String = "\uf01b"; + public static const fa_inbox:String = "\uf01c"; + public static const fa_play_circle_o:String = "\uf01d"; + public static const fa_repeat:String = "\uf01e"; + public static const fa_refresh:String = "\uf021"; + public static const fa_list_alt:String = "\uf022"; + public static const fa_lock:String = "\uf023"; + public static const fa_flag:String = "\uf024"; + public static const fa_headphones:String = "\uf025"; + public static const fa_volume_off:String = "\uf026"; + public static const fa_volume_down:String = "\uf027"; + public static const fa_volume_up:String = "\uf028"; + public static const fa_qrcode:String = "\uf029"; + public static const fa_barcode:String = "\uf02a"; + public static const fa_tag:String = "\uf02b"; + public static const fa_tags:String = "\uf02c"; + public static const fa_book:String = "\uf02d"; + public static const fa_bookmark:String = "\uf02e"; + public static const fa_print:String = "\uf02f"; + public static const fa_camera:String = "\uf030"; + public static const fa_font:String = "\uf031"; + public static const fa_bold:String = "\uf032"; + public static const fa_italic:String = "\uf033"; + public static const fa_text_height:String = "\uf034"; + public static const fa_text_width:String = "\uf035"; + public static const fa_align_left:String = "\uf036"; + public static const fa_align_center:String = "\uf037"; + public static const fa_align_right:String = "\uf038"; + public static const fa_align_justify:String = "\uf039"; + public static const fa_list:String = "\uf03a"; + public static const fa_outdent:String = "\uf03b"; + public static const fa_indent:String = "\uf03c"; + public static const fa_video_camera:String = "\uf03d"; + public static const fa_picture_o:String = "\uf03e"; + public static const fa_pencil:String = "\uf040"; + public static const fa_map_marker:String = "\uf041"; + public static const fa_adjust:String = "\uf042"; + public static const fa_tint:String = "\uf043"; + public static const fa_pencil_square_o:String = "\uf044"; + public static const fa_share_square_o:String = "\uf045"; + public static const fa_check_square_o:String = "\uf046"; + public static const fa_arrows:String = "\uf047"; + public static const fa_step_backward:String = "\uf048"; + public static const fa_fast_backward:String = "\uf049"; + public static const fa_backward:String = "\uf04a"; + public static const fa_play:String = "\uf04b"; + public static const fa_pause:String = "\uf04c"; + public static const fa_stop:String = "\uf04d"; + public static const fa_forward:String = "\uf04e"; + public static const fa_fast_forward:String = "\uf050"; + public static const fa_step_forward:String = "\uf051"; + public static const fa_eject:String = "\uf052"; + public static const fa_chevron_left:String = "\uf053"; + public static const fa_chevron_right:String = "\uf054"; + public static const fa_plus_circle:String = "\uf055"; + public static const fa_minus_circle:String = "\uf056"; + public static const fa_times_circle:String = "\uf057"; + public static const fa_check_circle:String = "\uf058"; + public static const fa_question_circle:String = "\uf059"; + public static const fa_info_circle:String = "\uf05a"; + public static const fa_crosshairs:String = "\uf05b"; + public static const fa_times_circle_o:String = "\uf05c"; + public static const fa_check_circle_o:String = "\uf05d"; + public static const fa_ban:String = "\uf05e"; + public static const fa_arrow_left:String = "\uf060"; + public static const fa_arrow_right:String = "\uf061"; + public static const fa_arrow_up:String = "\uf062"; + public static const fa_arrow_down:String = "\uf063"; + public static const fa_share:String = "\uf064"; + public static const fa_expand:String = "\uf065"; + public static const fa_compress:String = "\uf066"; + public static const fa_plus:String = "\uf067"; + public static const fa_minus:String = "\uf068"; + public static const fa_asterisk:String = "\uf069"; + public static const fa_exclamation_circle:String = "\uf06a"; + public static const fa_gift:String = "\uf06b"; + public static const fa_leaf:String = "\uf06c"; + public static const fa_fire:String = "\uf06d"; + public static const fa_eye:String = "\uf06e"; + public static const fa_eye_slash:String = "\uf070"; + public static const fa_exclamation_triangle:String = "\uf071"; + public static const fa_plane:String = "\uf072"; + public static const fa_calendar:String = "\uf073"; + public static const fa_random:String = "\uf074"; + public static const fa_comment:String = "\uf075"; + public static const fa_magnet:String = "\uf076"; + public static const fa_chevron_up:String = "\uf077"; + public static const fa_chevron_down:String = "\uf078"; + public static const fa_retweet:String = "\uf079"; + public static const fa_shopping_cart:String = "\uf07a"; + public static const fa_folder:String = "\uf07b"; + public static const fa_folder_open:String = "\uf07c"; + public static const fa_arrows_v:String = "\uf07d"; + public static const fa_arrows_h:String = "\uf07e"; + public static const fa_bar_chart_o:String = "\uf080"; + public static const fa_twitter_square:String = "\uf081"; + public static const fa_facebook_square:String = "\uf082"; + public static const fa_camera_retro:String = "\uf083"; + public static const fa_key:String = "\uf084"; + public static const fa_cogs:String = "\uf085"; + public static const fa_comments:String = "\uf086"; + public static const fa_thumbs_o_up:String = "\uf087"; + public static const fa_thumbs_o_down:String = "\uf088"; + public static const fa_star_half:String = "\uf089"; + public static const fa_heart_o:String = "\uf08a"; + public static const fa_sign_out:String = "\uf08b"; + public static const fa_linkedin_square:String = "\uf08c"; + public static const fa_thumb_tack:String = "\uf08d"; + public static const fa_external_link:String = "\uf08e"; + public static const fa_sign_in:String = "\uf090"; + public static const fa_trophy:String = "\uf091"; + public static const fa_github_square:String = "\uf092"; + public static const fa_upload:String = "\uf093"; + public static const fa_lemon_o:String = "\uf094"; + public static const fa_phone:String = "\uf095"; + public static const fa_square_o:String = "\uf096"; + public static const fa_bookmark_o:String = "\uf097"; + public static const fa_phone_square:String = "\uf098"; + public static const fa_twitter:String = "\uf099"; + public static const fa_facebook:String = "\uf09a"; + public static const fa_github:String = "\uf09b"; + public static const fa_unlock:String = "\uf09c"; + public static const fa_credit_card:String = "\uf09d"; + public static const fa_rss:String = "\uf09e"; + public static const fa_hdd_o:String = "\uf0a0"; + public static const fa_bullhorn:String = "\uf0a1"; + public static const fa_bell:String = "\uf0f3"; + public static const fa_certificate:String = "\uf0a3"; + public static const fa_hand_o_right:String = "\uf0a4"; + public static const fa_hand_o_left:String = "\uf0a5"; + public static const fa_hand_o_up:String = "\uf0a6"; + public static const fa_hand_o_down:String = "\uf0a7"; + public static const fa_arrow_circle_left:String = "\uf0a8"; + public static const fa_arrow_circle_right:String = "\uf0a9"; + public static const fa_arrow_circle_up:String = "\uf0aa"; + public static const fa_arrow_circle_down:String = "\uf0ab"; + public static const fa_globe:String = "\uf0ac"; + public static const fa_wrench:String = "\uf0ad"; + public static const fa_tasks:String = "\uf0ae"; + public static const fa_filter:String = "\uf0b0"; + public static const fa_briefcase:String = "\uf0b1"; + public static const fa_arrows_alt:String = "\uf0b2"; + public static const fa_users:String = "\uf0c0"; + public static const fa_link:String = "\uf0c1"; + public static const fa_cloud:String = "\uf0c2"; + public static const fa_flask:String = "\uf0c3"; + public static const fa_scissors:String = "\uf0c4"; + public static const fa_files_o:String = "\uf0c5"; + public static const fa_paperclip:String = "\uf0c6"; + public static const fa_floppy_o:String = "\uf0c7"; + public static const fa_square:String = "\uf0c8"; + public static const fa_bars:String = "\uf0c9"; + public static const fa_list_ul:String = "\uf0ca"; + public static const fa_list_ol:String = "\uf0cb"; + public static const fa_strikethrough:String = "\uf0cc"; + public static const fa_underline:String = "\uf0cd"; + public static const fa_table:String = "\uf0ce"; + public static const fa_magic:String = "\uf0d0"; + public static const fa_truck:String = "\uf0d1"; + public static const fa_pinterest:String = "\uf0d2"; + public static const fa_pinterest_square:String = "\uf0d3"; + public static const fa_google_plus_square:String = "\uf0d4"; + public static const fa_google_plus:String = "\uf0d5"; + public static const fa_money:String = "\uf0d6"; + public static const fa_caret_down:String = "\uf0d7"; + public static const fa_caret_up:String = "\uf0d8"; + public static const fa_caret_left:String = "\uf0d9"; + public static const fa_caret_right:String = "\uf0da"; + public static const fa_columns:String = "\uf0db"; + public static const fa_sort:String = "\uf0dc"; + public static const fa_sort_asc:String = "\uf0dd"; + public static const fa_sort_desc:String = "\uf0de"; + public static const fa_envelope:String = "\uf0e0"; + public static const fa_linkedin:String = "\uf0e1"; + public static const fa_undo:String = "\uf0e2"; + public static const fa_gavel:String = "\uf0e3"; + public static const fa_tachometer:String = "\uf0e4"; + public static const fa_comment_o:String = "\uf0e5"; + public static const fa_comments_o:String = "\uf0e6"; + public static const fa_bolt:String = "\uf0e7"; + public static const fa_sitemap:String = "\uf0e8"; + public static const fa_umbrella:String = "\uf0e9"; + public static const fa_clipboard:String = "\uf0ea"; + public static const fa_lightbulb_o:String = "\uf0eb"; + public static const fa_exchange:String = "\uf0ec"; + public static const fa_cloud_download:String = "\uf0ed"; + public static const fa_cloud_upload:String = "\uf0ee"; + public static const fa_user_md:String = "\uf0f0"; + public static const fa_stethoscope:String = "\uf0f1"; + public static const fa_suitcase:String = "\uf0f2"; + public static const fa_bell_o:String = "\uf0a2"; + public static const fa_coffee:String = "\uf0f4"; + public static const fa_cutlery:String = "\uf0f5"; + public static const fa_file_text_o:String = "\uf0f6"; + public static const fa_building_o:String = "\uf0f7"; + public static const fa_hospital_o:String = "\uf0f8"; + public static const fa_ambulance:String = "\uf0f9"; + public static const fa_medkit:String = "\uf0fa"; + public static const fa_fighter_jet:String = "\uf0fb"; + public static const fa_beer:String = "\uf0fc"; + public static const fa_h_square:String = "\uf0fd"; + public static const fa_plus_square:String = "\uf0fe"; + public static const fa_angle_double_left:String = "\uf100"; + public static const fa_angle_double_right:String = "\uf101"; + public static const fa_angle_double_up:String = "\uf102"; + public static const fa_angle_double_down:String = "\uf103"; + public static const fa_angle_left:String = "\uf104"; + public static const fa_angle_right:String = "\uf105"; + public static const fa_angle_up:String = "\uf106"; + public static const fa_angle_down:String = "\uf107"; + public static const fa_desktop:String = "\uf108"; + public static const fa_laptop:String = "\uf109"; + public static const fa_tablet:String = "\uf10a"; + public static const fa_mobile:String = "\uf10b"; + public static const fa_circle_o:String = "\uf10c"; + public static const fa_quote_left:String = "\uf10d"; + public static const fa_quote_right:String = "\uf10e"; + public static const fa_spinner:String = "\uf110"; + public static const fa_circle:String = "\uf111"; + public static const fa_reply:String = "\uf112"; + public static const fa_github_alt:String = "\uf113"; + public static const fa_folder_o:String = "\uf114"; + public static const fa_folder_open_o:String = "\uf115"; + public static const fa_smile_o:String = "\uf118"; + public static const fa_frown_o:String = "\uf119"; + public static const fa_meh_o:String = "\uf11a"; + public static const fa_gamepad:String = "\uf11b"; + public static const fa_keyboard_o:String = "\uf11c"; + public static const fa_flag_o:String = "\uf11d"; + public static const fa_flag_checkered:String = "\uf11e"; + public static const fa_terminal:String = "\uf120"; + public static const fa_code:String = "\uf121"; + public static const fa_reply_all:String = "\uf122"; + public static const fa_mail_reply_all:String = "\uf122"; + public static const fa_star_half_o:String = "\uf123"; + public static const fa_location_arrow:String = "\uf124"; + public static const fa_crop:String = "\uf125"; + public static const fa_code_fork:String = "\uf126"; + public static const fa_chain_broken:String = "\uf127"; + public static const fa_question:String = "\uf128"; + public static const fa_info:String = "\uf129"; + public static const fa_exclamation:String = "\uf12a"; + public static const fa_superscript:String = "\uf12b"; + public static const fa_subscript:String = "\uf12c"; + public static const fa_eraser:String = "\uf12d"; + public static const fa_puzzle_piece:String = "\uf12e"; + public static const fa_microphone:String = "\uf130"; + public static const fa_microphone_slash:String = "\uf131"; + public static const fa_shield:String = "\uf132"; + public static const fa_calendar_o:String = "\uf133"; + public static const fa_fire_extinguisher:String = "\uf134"; + public static const fa_rocket:String = "\uf135"; + public static const fa_maxcdn:String = "\uf136"; + public static const fa_chevron_circle_left:String = "\uf137"; + public static const fa_chevron_circle_right:String = "\uf138"; + public static const fa_chevron_circle_up:String = "\uf139"; + public static const fa_chevron_circle_down:String = "\uf13a"; + public static const fa_html5:String = "\uf13b"; + public static const fa_css3:String = "\uf13c"; + public static const fa_anchor:String = "\uf13d"; + public static const fa_unlock_alt:String = "\uf13e"; + public static const fa_bullseye:String = "\uf140"; + public static const fa_ellipsis_h:String = "\uf141"; + public static const fa_ellipsis_v:String = "\uf142"; + public static const fa_rss_square:String = "\uf143"; + public static const fa_play_circle:String = "\uf144"; + public static const fa_ticket:String = "\uf145"; + public static const fa_minus_square:String = "\uf146"; + public static const fa_minus_square_o:String = "\uf147"; + public static const fa_level_up:String = "\uf148"; + public static const fa_level_down:String = "\uf149"; + public static const fa_check_square:String = "\uf14a"; + public static const fa_pencil_square:String = "\uf14b"; + public static const fa_external_link_square:String = "\uf14c"; + public static const fa_share_square:String = "\uf14d"; + public static const fa_compass:String = "\uf14e"; + public static const fa_caret_square_o_down:String = "\uf150"; + public static const fa_caret_square_o_up:String = "\uf151"; + public static const fa_caret_square_o_right:String = "\uf152"; + public static const fa_eur:String = "\uf153"; + public static const fa_gbp:String = "\uf154"; + public static const fa_usd:String = "\uf155"; + public static const fa_inr:String = "\uf156"; + public static const fa_jpy:String = "\uf157"; + public static const fa_rub:String = "\uf158"; + public static const fa_krw:String = "\uf159"; + public static const fa_btc:String = "\uf15a"; + public static const fa_file:String = "\uf15b"; + public static const fa_file_text:String = "\uf15c"; + public static const fa_sort_alpha_asc:String = "\uf15d"; + public static const fa_sort_alpha_desc:String = "\uf15e"; + public static const fa_sort_amount_asc:String = "\uf160"; + public static const fa_sort_amount_desc:String = "\uf161"; + public static const fa_sort_numeric_asc:String = "\uf162"; + public static const fa_sort_numeric_desc:String = "\uf163"; + public static const fa_thumbs_up:String = "\uf164"; + public static const fa_thumbs_down:String = "\uf165"; + public static const fa_youtube_square:String = "\uf166"; + public static const fa_youtube:String = "\uf167"; + public static const fa_xing:String = "\uf168"; + public static const fa_xing_square:String = "\uf169"; + public static const fa_youtube_play:String = "\uf16a"; + public static const fa_dropbox:String = "\uf16b"; + public static const fa_stack_overflow:String = "\uf16c"; + public static const fa_instagram:String = "\uf16d"; + public static const fa_flickr:String = "\uf16e"; + public static const fa_adn:String = "\uf170"; + public static const fa_bitbucket:String = "\uf171"; + public static const fa_bitbucket_square:String = "\uf172"; + public static const fa_tumblr:String = "\uf173"; + public static const fa_tumblr_square:String = "\uf174"; + public static const fa_long_arrow_down:String = "\uf175"; + public static const fa_long_arrow_up:String = "\uf176"; + public static const fa_long_arrow_left:String = "\uf177"; + public static const fa_long_arrow_right:String = "\uf178"; + public static const fa_apple:String = "\uf179"; + public static const fa_windows:String = "\uf17a"; + public static const fa_android:String = "\uf17b"; + public static const fa_linux:String = "\uf17c"; + public static const fa_dribbble:String = "\uf17d"; + public static const fa_skype:String = "\uf17e"; + public static const fa_foursquare:String = "\uf180"; + public static const fa_trello:String = "\uf181"; + public static const fa_female:String = "\uf182"; + public static const fa_male:String = "\uf183"; + public static const fa_gittip:String = "\uf184"; + public static const fa_sun_o:String = "\uf185"; + public static const fa_moon_o:String = "\uf186"; + public static const fa_archive:String = "\uf187"; + public static const fa_bug:String = "\uf188"; + public static const fa_vk:String = "\uf189"; + public static const fa_weibo:String = "\uf18a"; + public static const fa_renren:String = "\uf18b"; + public static const fa_pagelines:String = "\uf18c"; + public static const fa_stack_exchange:String = "\uf18d"; + public static const fa_arrow_circle_o_right:String = "\uf18e"; + public static const fa_arrow_circle_o_left:String = "\uf190"; + public static const fa_caret_square_o_left:String = "\uf191"; + public static const fa_dot_circle_o:String = "\uf192"; + public static const fa_wheelchair:String = "\uf193"; + public static const fa_vimeo_square:String = "\uf194"; + public static const fa_try:String = "\uf195"; + public static const fa_plus_square_o:String = "\uf196"; + + } +} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/ColorUtils.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/ColorUtils.as b/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/ColorUtils.as new file mode 100644 index 0000000..fed416f --- /dev/null +++ b/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/ColorUtils.as @@ -0,0 +1,89 @@ +/** + 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 skins.flatspark.utils +{ + import mx.states.State; + + import skins.flatspark.enums.ButtonColorEnum; + + public class ColorUtils + { + public static const Turquoise:uint = 0x1ABC9C; + public static const GreenSea:uint = 0x16A085; + public static const Emerald:uint = 0x2ECC71; + public static const Nephritis:uint = 0x27AE60; + public static const PeterRiver:uint = 0x3498DB; + public static const BelizeHole:uint = 0x2980B9; + public static const Amethyst:uint = 0x9B59B6; + public static const Wisteria:uint = 0x8E44AD; + public static const WetAsphalt:uint = 0x34495E; + public static const MidnightBlue:uint = 0x2C3E50; + public static const SunFlower:uint = 0xF1C40F; + public static const Orange:uint = 0xF39C12; + public static const Carrot:uint = 0xE67E22; + public static const Pumpkin:uint = 0xD35400; + public static const Alizarin:uint = 0xE74C3C; + public static const Pomegranate:uint = 0xC0392B; + public static const Clouds:uint = 0xECF0F1; + public static const Silver:uint = 0xBDC3C7; + public static const Concrete:uint = 0x95A5A6; + public static const Asbestos:uint = 0x7F8C8D; + + public function ColorUtils() + { + + } + + public static function ButtonColor(brand:int, estado:State):uint + { + // All the possible colors + var cores:Array = new Array( + ButtonColorEnum.PrimaryUp, ButtonColorEnum.PrimaryHover, ButtonColorEnum.PrimaryDown, ButtonColorEnum.PrimaryDisabled, + ButtonColorEnum.SuccessUp, ButtonColorEnum.SuccessHover, ButtonColorEnum.SuccessDown, ButtonColorEnum.SuccessDisabled, + ButtonColorEnum.WarningUp, ButtonColorEnum.WarningHover, ButtonColorEnum.WarningDown, ButtonColorEnum.WarningDisabled, + ButtonColorEnum.InverseUp, ButtonColorEnum.InverseHover, ButtonColorEnum.InverseDown, ButtonColorEnum.InverseDisabled, + ButtonColorEnum.DefaultUp, ButtonColorEnum.DefaultHover, ButtonColorEnum.DefaultDown, ButtonColorEnum.DefaultDisabled, + ButtonColorEnum.InfoUp, ButtonColorEnum.InfoHover, ButtonColorEnum.InfoDown, ButtonColorEnum.InfoDisabled, + ButtonColorEnum.DangerUp, ButtonColorEnum.DangerHover, ButtonColorEnum.DangerDown, ButtonColorEnum.DangerDisabled + ); + + // Map all the allowed states + var numeroEstado:int = 1; + switch (estado.name) + { + case "up": + numeroEstado = 1; + break; + case "over": + numeroEstado = 2; + break; + case "down": + numeroEstado = 3; + break; + case "disabled": + numeroEstado = 3; + break; + } + + var posicao:int = 1; + posicao = 4 * (brand - 1) + (numeroEstado - 1); + + return cores[posicao]; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/ConfigSkin.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/ConfigSkin.as b/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/ConfigSkin.as new file mode 100644 index 0000000..a09dd29 --- /dev/null +++ b/manualtests/FlexJSTest_SVG/src/skins/flatspark/utils/ConfigSkin.as @@ -0,0 +1,44 @@ +/** + 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 skins.flatspark.utils +{ + + import flatspark.enums.ColorSwatchEnum; + import flatspark.enums.SizeEnum; + + public final class ConfigSkin + { + + /* + * Default size + */ + public static var sizeEnum:SizeEnum=new SizeEnum(); + + /* + * Default color + */ + public static var colorSwatch:ColorSwatchEnum=new ColorSwatchEnum(); + + + public function ConfigSkin() + { + + } + + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/build.xml b/manualtests/FlexJSTest_basic/build.xml new file mode 100644 index 0000000..313fe90 --- /dev/null +++ b/manualtests/FlexJSTest_basic/build.xml @@ -0,0 +1,70 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<project name="flexjstest_basic" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="FlexJSTest_basic" /> + + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <include file="${basedir}/../build_example.xml" /> + + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of FlexJSUI.swc"> + </target> + + <target name="clean"> + <delete dir="${basedir}/bin" failonerror="false" /> + <delete dir="${basedir}/bin-debug" failonerror="false" /> + <delete dir="${basedir}/bin-release" failonerror="false" /> + </target> + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/ButtonImageDown.png ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/ButtonImageDown.png b/manualtests/FlexJSTest_basic/src/ButtonImageDown.png new file mode 100644 index 0000000..0cf7f8a Binary files /dev/null and b/manualtests/FlexJSTest_basic/src/ButtonImageDown.png differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/ButtonImageOver.png ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/ButtonImageOver.png b/manualtests/FlexJSTest_basic/src/ButtonImageOver.png new file mode 100644 index 0000000..2f78d59 Binary files /dev/null and b/manualtests/FlexJSTest_basic/src/ButtonImageOver.png differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/ButtonImageUp.png ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/ButtonImageUp.png b/manualtests/FlexJSTest_basic/src/ButtonImageUp.png new file mode 100644 index 0000000..927e1c8 Binary files /dev/null and b/manualtests/FlexJSTest_basic/src/ButtonImageUp.png differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/FlexJSTest_basic.mxml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/FlexJSTest_basic.mxml b/manualtests/FlexJSTest_basic/src/FlexJSTest_basic.mxml new file mode 100644 index 0000000..4ff4297 --- /dev/null +++ b/manualtests/FlexJSTest_basic/src/FlexJSTest_basic.mxml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +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. + +--> +<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:local="*" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:models="models.*" + xmlns:controllers="controllers.*" + initialize="MyModel(model).labelText='Hello World'" + > + <js:valuesImpl> + <js:SimpleCSSValuesImpl /> + </js:valuesImpl> + <js:initialView> + <local:MyInitialView /> + </js:initialView> + <js:model> + <models:MyModel /> + </js:model> + <js:controller> + <controllers:MyController /> + </js:controller> + <js:beads> + <js:HTTPService id="service"> + <js:LazyCollection id="collection"> + <js:inputParser> + <js:JSONInputParser /> + </js:inputParser> + <js:itemConverter> + <local:StockDataJSONItemConverter /> + </js:itemConverter> + </js:LazyCollection> + </js:HTTPService> + </js:beads> +</js:Application> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/MyInitialView.mxml b/manualtests/FlexJSTest_basic/src/MyInitialView.mxml new file mode 100644 index 0000000..496741a --- /dev/null +++ b/manualtests/FlexJSTest_basic/src/MyInitialView.mxml @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +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. + +--> +<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:js="library://ns.apache.org/flexjs/basic" + > + <fx:Script> + <![CDATA[ + import org.apache.flex.events.CustomEvent; + import org.apache.flex.events.Event; + import org.apache.flex.utils.Timer; + + private var timer:org.apache.flex.utils.Timer; + + public function get symbol():String + { + return list.selectedItem as String; + } + + public function get city():String + { + return cityList.selectedItem as String; + } + + public function get inputText():String + { + return input.text; + } + + public function get comboBoxValue():String + { + return String(comboBox.selectedItem); + } + + public function startTimer():void + { + timer = new org.apache.flex.utils.Timer(1000); + timer.addEventListener('timer', timerHandler); + timer.start() + } + + public function timerHandler(event:org.apache.flex.events.Event):void + { + timerLabel.text = timer.currentCount.toString(); + } + ]]> + </fx:Script> + <fx:Style> + @namespace basic "library://ns.apache.org/flexjs/basic"; + + .skinned { + background-image: url('ButtonImageUp.png'); + border-style: none; + } + + .skinned:hover { + background-image: url('ButtonImageOver.png'); + } + + .skinned:active { + background-image: url('ButtonImageDown.png'); + } + + </fx:Style> + <js:Label id="lbl" x="100" y="25" > + <js:beads> + <js:SimpleBinding eventName="labelTextChanged" + sourceID="applicationModel" + sourcePropertyName="labelText" + destinationPropertyName="text" /> + </js:beads> + </js:Label> + <js:TextButton text="Start Timer" x="100" y="75" click="startTimer()" /> + <js:TextButton text="Stop Timer" x="100" y="100" click="timer.removeEventListener('timer', timerHandler);timer.stop()" /> + <js:Label id="timerLabel" x="100" y="125" /> + + <js:List id="cityList" x="200" y="75" width="100" height="75" change="dispatchEvent(new CustomEvent('cityListChanged'))"> + <js:beads> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="cities" + destinationPropertyName="dataProvider" /> + </js:beads> + </js:List> + + <js:TextArea x="320" y="25" width="150" height="75"> + <js:beads> + <js:SimpleBinding eventName="labelTextChanged" + sourceID="applicationModel" + sourcePropertyName="labelText" + destinationPropertyName="text" /> + </js:beads> + </js:TextArea> + <js:TextInput id="input" x="320" y="110" /> + <js:TextButton text="Transfer" x="320" y="138" click="dispatchEvent(new CustomEvent('transferClicked'))" /> + + <js:CheckBox id="checkbox" x="320" y="170" text="Check Me" /> + + <js:RadioButton groupName="group1" text="Apples" value="0" x="100" y="150" /> + <js:RadioButton groupName="group1" text="Oranges" value="1" x="100" y="170" selected="true" /> + <js:RadioButton groupName="group1" text="Grapes" value="2" x="100" y="190" /> + + <js:RadioButton groupName="group2" text="Red" value="red" x="100" y="250" selected="true" /> + <js:RadioButton groupName="group2" text="Green" value="green" x="100" y="270" /> + <js:RadioButton groupName="group2" text="Blue" value="blue" x="100" y="290" /> + + <js:DropDownList id="list" x="200" y="200" width="100" height="18" change="dispatchEvent(new CustomEvent('listChanged'))"> + <js:beads> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="strings" + destinationPropertyName="dataProvider" /> + </js:beads> + </js:DropDownList> + <js:TextButton text="OK" x="200" y="230" click="dispatchEvent(new CustomEvent('buttonClicked'))" /> + <js:TextButton text="Skinned" x="200" y="260" width="80" height="24" className="skinned" click="dispatchEvent(new CustomEvent('buttonClicked'))" /> + + <js:ComboBox id="comboBox" x="320" y="200" width="100" change="dispatchEvent(new CustomEvent('comboBoxChanged'))"> + <js:beads> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="cities" + destinationPropertyName="dataProvider" /> + </js:beads> + </js:ComboBox> + +</js:ViewBase> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/README.txt ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/README.txt b/manualtests/FlexJSTest_basic/src/README.txt new file mode 100644 index 0000000..adf23bc --- /dev/null +++ b/manualtests/FlexJSTest_basic/src/README.txt @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 FlexJSTest_basic demonstrates a number of the common components in the FlexJS +SDK (listed below). + +This Flex application may be run either as an ActionScript SWF or cross-compiled +into JavsScript/HTML using the Falcon JX compiler and run without using the +Flash Player. + +This application also uses the same financial data as the DataBindingTest, +accessed using HTTPService, although it uses the ConstantBinding bead to +display the remote data instead of data binding. + +COMPONENTS and BEADS + +- CheckBox +- ComboBox +- DropDownList +- Label +- List +- RadioButton +- TextArea +- TextButton + +NOTES + +In ActionScript, the hit area for radio and check boxes is limited to the +radio or check itself and not the label. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/StockDataJSONItemConverter.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/StockDataJSONItemConverter.as b/manualtests/FlexJSTest_basic/src/StockDataJSONItemConverter.as new file mode 100644 index 0000000..35f1b78 --- /dev/null +++ b/manualtests/FlexJSTest_basic/src/StockDataJSONItemConverter.as @@ -0,0 +1,38 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + import org.apache.flex.collections.converters.JSONItemConverter; + + public class StockDataJSONItemConverter extends JSONItemConverter + { + public function StockDataJSONItemConverter() + { + super(); + } + + override public function convertItem(data:String):Object + { + var obj:Object = super.convertItem(data); + if (obj['query']['results'] == null) + return 'No Quote Available'; + return obj['query']['results']['quote']['Ask']; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/controllers/MyController.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/controllers/MyController.as b/manualtests/FlexJSTest_basic/src/controllers/MyController.as new file mode 100644 index 0000000..636ed30 --- /dev/null +++ b/manualtests/FlexJSTest_basic/src/controllers/MyController.as @@ -0,0 +1,92 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 controllers +{ + import org.apache.flex.core.Application; + import org.apache.flex.core.IDocument; + import org.apache.flex.events.Event; + + + import models.MyModel; + + public class MyController implements IDocument + { + public function MyController(app:Application = null) + { + if (app) + { + this.app = app as FlexJSTest_basic; + app.addEventListener("viewChanged", viewChangeHandler); + } + } + + private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22"; + private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json"; + private var app:FlexJSTest_basic; + + private function viewChangeHandler(event:Event):void + { + app.initialView.addEventListener("buttonClicked", buttonClickHandler); + app.initialView.addEventListener("listChanged", listChangedHandler); + app.initialView.addEventListener("cityListChanged", cityListChangeHandler); + app.initialView.addEventListener("transferClicked", transferClickHandler); + app.initialView.addEventListener("comboBoxChanged", comboBoxChangeHandler); + } + + private function buttonClickHandler(event:Event):void + { + var sym:String = MyInitialView(app.initialView).symbol; + app.service.url = queryBegin + sym + queryEnd; + app.service.send(); + app.service.addEventListener("complete", completeHandler); + } + + private function completeHandler(event:Event):void + { + MyModel(app.model).labelText = app.collection.getItemAt(0) as String; + } + + private function listChangedHandler(event:Event):void + { + MyModel(app.model).labelText = MyInitialView(app.initialView).symbol; + } + + private function cityListChangeHandler(event:Event):void + { + MyModel(app.model).labelText = MyInitialView(app.initialView).city; + } + + private function transferClickHandler(event:Event):void + { + MyModel(app.model).labelText = MyInitialView(app.initialView).inputText; + } + + private function comboBoxChangeHandler(event:Event):void + { + MyModel(app.model).labelText = MyInitialView(app.initialView).comboBoxValue; + } + + public function setDocument(document:Object, id:String = null):void + { + this.app = document as FlexJSTest_basic; + app.addEventListener("viewChanged", viewChangeHandler); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_basic/src/models/MyModel.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_basic/src/models/MyModel.as b/manualtests/FlexJSTest_basic/src/models/MyModel.as new file mode 100644 index 0000000..1dc23e6 --- /dev/null +++ b/manualtests/FlexJSTest_basic/src/models/MyModel.as @@ -0,0 +1,59 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 models +{ + import org.apache.flex.events.Event; + import org.apache.flex.events.EventDispatcher; + + public class MyModel extends EventDispatcher + { + public function MyModel() + { + } + + private var _labelText:String; + + public function get labelText():String + { + return _labelText; + } + + public function set labelText(value:String):void + { + if (value != _labelText) + { + _labelText = value; + dispatchEvent(new Event("labelTextChanged")); + } + } + + private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"]; + public function get strings():Array + { + return _strings; + } + + private var _cities:Array = ["London", "Miami", "Paris", "Sydney", "Tokyo"]; + public function get cities():Array + { + return _cities; + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_createjs/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_createjs/build.xml b/manualtests/FlexJSTest_createjs/build.xml new file mode 100644 index 0000000..678ef0a --- /dev/null +++ b/manualtests/FlexJSTest_createjs/build.xml @@ -0,0 +1,70 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<project name="flexjstest_createjs" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="CreateJSExample" /> + + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <include file="${basedir}/../build_example.xml" /> + + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}"> + </target> + + <target name="clean"> + <delete dir="${basedir}/bin" failonerror="false" /> + <delete dir="${basedir}/bin-debug" failonerror="false" /> + <delete dir="${basedir}/bin-release" failonerror="false" /> + </target> + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_createjs/src/CreateJSExample.mxml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_createjs/src/CreateJSExample.mxml b/manualtests/FlexJSTest_createjs/src/CreateJSExample.mxml new file mode 100644 index 0000000..d5324a1 --- /dev/null +++ b/manualtests/FlexJSTest_createjs/src/CreateJSExample.mxml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8"?> +<!--- +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +--> +<createjs:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:local="*" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:createjs="library://ns.apache.org/flexjs/createjs" + xmlns:models="models.*" + xmlns:controllers="controllers.*" + initialize="MyModel(model).labelText='Hello World'" + > + + <!-- + This example shows how to use CreateJS for the web framework. While the example + shows only a label and button, you can extend the pattern to include other + controls. + + Once you have compiled the application into JavaScript using Falcon JX, you + must do two more things to make the example work: + + 1. Copy the CreateJS easeljs JavaScript library into the js-debug or js-release directory + so it available when the application is opened by the browser. + + 2. Modify the index.html file that the compile created so that includes the CreateJS + easeljs library. For example: <script src="./lib/easeljs-0.6.0.min.js"></script> + --> + + <createjs:valuesImpl> + <js:SimpleCSSValuesImpl /> + </createjs:valuesImpl> + <createjs:initialView> + <local:MyInitialView /> + </createjs:initialView> + <createjs:model> + <models:MyModel /> + </createjs:model> + <createjs:controller> + <controllers:MyController /> + </createjs:controller> + +</createjs:Application> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_createjs/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_createjs/src/MyInitialView.mxml b/manualtests/FlexJSTest_createjs/src/MyInitialView.mxml new file mode 100644 index 0000000..6baacc0 --- /dev/null +++ b/manualtests/FlexJSTest_createjs/src/MyInitialView.mxml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +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. + +--> +<createjs:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:createjs="library://ns.apache.org/flexjs/createjs" + > + <fx:Script> + <![CDATA[ + + import org.apache.flex.events.Event; + + public function simpleClick() : void + { + lbl1.text = "pushed"; + } + + public function changeLabel() : void + { + dispatchEvent( new org.apache.flex.events.Event("pushme2Clicked") ); + + check1.selected = !check1.selected; + } + ]]> + </fx:Script> + + <createjs:Label id="lbl1" x="50" y="100" text="push me changes me" /> + <createjs:TextButton x="50" y="225" text="Push Me" click="simpleClick()" /> + + <createjs:Label id="lbl2" x="350" y="100"> + <createjs:beads> + <js:SimpleBinding eventName="labelTextChanged" + sourceID="applicationModel" + sourcePropertyName="labelText" + destinationPropertyName="text" /> + </createjs:beads> + </createjs:Label> + <createjs:TextButton x="350" y="225" text="Change Label" click="changeLabel()"/> + + <createjs:CheckBox id="check1" x="10" y="10" text="Check Me" selected="true"/> + +</createjs:ViewBase> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_createjs/src/README.txt ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_createjs/src/README.txt b/manualtests/FlexJSTest_createjs/src/README.txt new file mode 100644 index 0000000..3e8e2ba --- /dev/null +++ b/manualtests/FlexJSTest_createjs/src/README.txt @@ -0,0 +1,22 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 + +This sample is currently not working. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_createjs/src/controllers/MyController.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_createjs/src/controllers/MyController.as b/manualtests/FlexJSTest_createjs/src/controllers/MyController.as new file mode 100644 index 0000000..666a249 --- /dev/null +++ b/manualtests/FlexJSTest_createjs/src/controllers/MyController.as @@ -0,0 +1,57 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 controllers +{ + import models.MyModel; + + import org.apache.flex.core.Application; + import org.apache.flex.core.IDocument; + import org.apache.flex.events.Event; + + public class MyController implements IDocument + { + public function MyController(app:Application = null) + { + if (app) + { + this.app = app as CreateJSExample; + app.addEventListener("viewChanged", viewChangeHandler); + } + } + + private var app:CreateJSExample; + + private function viewChangeHandler(event:Event):void + { + app.initialView.addEventListener("pushme2Clicked", pushme2ClickHandler); + } + + private function pushme2ClickHandler(event:Event):void + { + MyModel(app.model).labelText = "push me again"; + } + + public function setDocument(document:Object, id:String = null):void + { + this.app = document as CreateJSExample; + app.addEventListener("viewChanged", viewChangeHandler); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_createjs/src/models/MyModel.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_createjs/src/models/MyModel.as b/manualtests/FlexJSTest_createjs/src/models/MyModel.as new file mode 100644 index 0000000..f79667b --- /dev/null +++ b/manualtests/FlexJSTest_createjs/src/models/MyModel.as @@ -0,0 +1,53 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 models +{ + import org.apache.flex.events.Event; + import org.apache.flex.events.EventDispatcher; + + public class MyModel extends EventDispatcher + { + public function MyModel() + { + } + + private var _labelText:String; + + public function get labelText():String + { + return _labelText; + } + + public function set labelText(value:String):void + { + if (value != _labelText) + { + _labelText = value; + dispatchEvent(new Event("labelTextChanged")); + } + } + + private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"]; + public function get strings():Array + { + return _strings; + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/build.xml b/manualtests/FlexJSTest_jquery/build.xml new file mode 100644 index 0000000..d408541 --- /dev/null +++ b/manualtests/FlexJSTest_jquery/build.xml @@ -0,0 +1,70 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<project name="flexjstest_jquery" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="jQuerySample" /> + + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <include file="${basedir}/../build_example.xml" /> + + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}"> + </target> + + <target name="clean"> + <delete dir="${basedir}/bin" failonerror="false" /> + <delete dir="${basedir}/bin-debug" failonerror="false" /> + <delete dir="${basedir}/bin-release" failonerror="false" /> + </target> + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/src/ButtonImageDown.png ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/src/ButtonImageDown.png b/manualtests/FlexJSTest_jquery/src/ButtonImageDown.png new file mode 100644 index 0000000..0cf7f8a Binary files /dev/null and b/manualtests/FlexJSTest_jquery/src/ButtonImageDown.png differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/src/ButtonImageOver.png ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/src/ButtonImageOver.png b/manualtests/FlexJSTest_jquery/src/ButtonImageOver.png new file mode 100644 index 0000000..2f78d59 Binary files /dev/null and b/manualtests/FlexJSTest_jquery/src/ButtonImageOver.png differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/src/ButtonImageUp.png ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/src/ButtonImageUp.png b/manualtests/FlexJSTest_jquery/src/ButtonImageUp.png new file mode 100644 index 0000000..927e1c8 Binary files /dev/null and b/manualtests/FlexJSTest_jquery/src/ButtonImageUp.png differ http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/src/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/src/MyInitialView.mxml b/manualtests/FlexJSTest_jquery/src/MyInitialView.mxml new file mode 100644 index 0000000..6059cdf --- /dev/null +++ b/manualtests/FlexJSTest_jquery/src/MyInitialView.mxml @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + +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. + +--> +<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:jquery="library://ns.apache.org/flexjs/jquery" + > + <fx:Script> + <![CDATA[ + import org.apache.flex.events.CustomEvent; + import org.apache.flex.events.Event; + import org.apache.flex.html.Label; + import org.apache.flex.html.TextButton; + import org.apache.flex.utils.Timer; + + private var timer:org.apache.flex.utils.Timer; + + private var radioXpos:int = 200; + + public function get symbol():String + { + return list.selectedItem as String; + } + + public function get city():String + { + return cityList.selectedItem as String; + } + + public function get inputText():String + { + return input.text; + } + + public function get comboBoxValue():String + { + return String(comboBox.selectedItem); + } + + public function startTimer():void + { + timer = new org.apache.flex.utils.Timer(1000); + timer.addEventListener('timer', timerHandler); + timer.start() + } + + public function timerHandler(event:org.apache.flex.events.Event):void + { + timerLabel.text = timer.currentCount.toString(); + } + ]]> + </fx:Script> + <fx:Style> + @namespace basic "library://ns.apache.org/flexjs/basic"; + + .skinned { + background-image: url('ButtonImageUp.png'); + border-style: none; + } + + .skinned:hover { + background-image: url('ButtonImageOver.png'); + } + + .skinned:active { + background-image: url('ButtonImageDown.png'); + } + + </fx:Style> + <js:Label id="lbl" x="100" y="25" > + <js:beads> + <js:SimpleBinding eventName="labelTextChanged" + sourceID="applicationModel" + sourcePropertyName="labelText" + destinationPropertyName="text" /> + </js:beads> + </js:Label> + <jquery:TextButton text="Start Timer" x="100" y="75" click="startTimer()" /> + <jquery:TextButton text="Stop Timer" x="100" y="100" click="timer.removeEventListener('timer', timerHandler);timer.stop()" /> + <js:Label id="timerLabel" x="100" y="125" /> + + <js:List id="cityList" x="200" y="75" width="100" height="75" change="dispatchEvent(new CustomEvent('cityListChanged'))"> + <js:beads> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="cities" + destinationPropertyName="dataProvider" /> + </js:beads> + </js:List> + + <js:TextArea x="320" y="25" width="150" height="75"> + <js:beads> + <js:SimpleBinding eventName="labelTextChanged" + sourceID="applicationModel" + sourcePropertyName="labelText" + destinationPropertyName="text" /> + </js:beads> + </js:TextArea> + <js:TextInput id="input" x="320" y="110" /> + <jquery:TextButton text="Transfer" x="320" y="138" click="dispatchEvent(new CustomEvent('transferClicked'))" /> + + <jquery:CheckBox id="checkbox" x="320" y="170" text="Check Me" /> + + <jquery:RadioButton groupName="group1" text="Apples" value="0" x="100" y="290" /> + <jquery:RadioButton groupName="group1" text="Oranges" value="1" x="200" y="290" selected="true" /> + <jquery:RadioButton groupName="group1" text="Grapes" value="2" x="300" y="290" /> + + <jquery:RadioButton groupName="group2" text="Red" value="red" x="100" y="320" selected="true" /> + <jquery:RadioButton groupName="group2" text="Green" value="green" x="200" y="320" /> + <jquery:RadioButton groupName="group2" text="Blue" value="blue" x="300" y="320" /> + + <js:DropDownList id="list" x="200" y="200" width="100" height="18" change="dispatchEvent(new CustomEvent('listChanged'))"> + <js:beads> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="strings" + destinationPropertyName="dataProvider" /> + </js:beads> + </js:DropDownList> + <jquery:TextButton text="OK" x="200" y="230" click="dispatchEvent(new CustomEvent('buttonClicked'))" /> + <jquery:TextButton text="Skinned" x="200" y="260" width="80" height="24" className="skinned" click="dispatchEvent(new CustomEvent('buttonClicked'))" /> + + <js:ComboBox id="comboBox" x="320" y="200" width="100" change="dispatchEvent(new CustomEvent('comboBoxChanged'))"> + <js:beads> + <js:ConstantBinding + sourceID="applicationModel" + sourcePropertyName="cities" + destinationPropertyName="dataProvider" /> + </js:beads> + </js:ComboBox> + +</js:ViewBase> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/src/StockDataJSONItemConverter.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/src/StockDataJSONItemConverter.as b/manualtests/FlexJSTest_jquery/src/StockDataJSONItemConverter.as new file mode 100644 index 0000000..35f1b78 --- /dev/null +++ b/manualtests/FlexJSTest_jquery/src/StockDataJSONItemConverter.as @@ -0,0 +1,38 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + import org.apache.flex.collections.converters.JSONItemConverter; + + public class StockDataJSONItemConverter extends JSONItemConverter + { + public function StockDataJSONItemConverter() + { + super(); + } + + override public function convertItem(data:String):Object + { + var obj:Object = super.convertItem(data); + if (obj['query']['results'] == null) + return 'No Quote Available'; + return obj['query']['results']['quote']['Ask']; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/src/controllers/MyController.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/src/controllers/MyController.as b/manualtests/FlexJSTest_jquery/src/controllers/MyController.as new file mode 100644 index 0000000..3e78a2f --- /dev/null +++ b/manualtests/FlexJSTest_jquery/src/controllers/MyController.as @@ -0,0 +1,92 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 controllers +{ + import org.apache.flex.core.Application; + import org.apache.flex.core.IDocument; + import org.apache.flex.events.Event; + + + import models.MyModel; + + public class MyController implements IDocument + { + public function MyController(app:Application = null) + { + if (app) + { + this.app = app as jQuerySample; + app.addEventListener("viewChanged", viewChangeHandler); + } + } + + private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22"; + private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json"; + private var app:jQuerySample; + + private function viewChangeHandler(event:Event):void + { + app.initialView.addEventListener("buttonClicked", buttonClickHandler); + app.initialView.addEventListener("listChanged", listChangedHandler); + app.initialView.addEventListener("cityListChanged", cityListChangeHandler); + app.initialView.addEventListener("transferClicked", transferClickHandler); + app.initialView.addEventListener("comboBoxChanged", comboBoxChangeHandler); + } + + private function buttonClickHandler(event:Event):void + { + var sym:String = MyInitialView(app.initialView).symbol; + app.service.url = queryBegin + sym + queryEnd; + app.service.send(); + app.service.addEventListener("complete", completeHandler); + } + + private function completeHandler(event:Event):void + { + MyModel(app.model).labelText = app.collection.getItemAt(0) as String; + } + + private function listChangedHandler(event:Event):void + { + MyModel(app.model).labelText = MyInitialView(app.initialView).symbol; + } + + private function cityListChangeHandler(event:Event):void + { + MyModel(app.model).labelText = MyInitialView(app.initialView).city; + } + + private function transferClickHandler(event:Event):void + { + MyModel(app.model).labelText = MyInitialView(app.initialView).inputText; + } + + private function comboBoxChangeHandler(event:Event):void + { + MyModel(app.model).labelText = MyInitialView(app.initialView).comboBoxValue; + } + + public function setDocument(document:Object, id:String = null):void + { + this.app = document as jQuerySample; + app.addEventListener("viewChanged", viewChangeHandler); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/src/jQuerySample.mxml ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/src/jQuerySample.mxml b/manualtests/FlexJSTest_jquery/src/jQuerySample.mxml new file mode 100644 index 0000000..e5e18fc --- /dev/null +++ b/manualtests/FlexJSTest_jquery/src/jQuerySample.mxml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="utf-8"?> +<!--- +// +// 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. +// +//////////////////////////////////////////////////////////////////////////////// +--> +<jquery:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:local="*" + xmlns:js="library://ns.apache.org/flexjs/basic" + xmlns:jquery="library://ns.apache.org/flexjs/jquery" + xmlns:models="models.*" + xmlns:controllers="controllers.*" + initialize="MyModel(model).labelText='Hello World'" + > + + <!-- + To make this sample work, please add the following lines to the index.html + + <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" /> + <script src="http://code.jquery.com/jquery-1.9.1.js"></script> + <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script> + --> + + + <jquery:valuesImpl> + <js:SimpleCSSValuesImpl /> + </jquery:valuesImpl> + <jquery:initialView> + <local:MyInitialView /> + </jquery:initialView> + <jquery:model> + <models:MyModel /> + </jquery:model> + <jquery:controller> + <controllers:MyController /> + </jquery:controller> + <jquery:beads> + <js:HTTPService id="service"> + <js:LazyCollection id="collection"> + <js:inputParser> + <js:JSONInputParser /> + </js:inputParser> + <js:itemConverter> + <local:StockDataJSONItemConverter /> + </js:itemConverter> + </js:LazyCollection> + </js:HTTPService> + </jquery:beads> + +</jquery:Application> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FlexJSTest_jquery/src/models/MyModel.as ---------------------------------------------------------------------- diff --git a/manualtests/FlexJSTest_jquery/src/models/MyModel.as b/manualtests/FlexJSTest_jquery/src/models/MyModel.as new file mode 100644 index 0000000..1dc23e6 --- /dev/null +++ b/manualtests/FlexJSTest_jquery/src/models/MyModel.as @@ -0,0 +1,59 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 models +{ + import org.apache.flex.events.Event; + import org.apache.flex.events.EventDispatcher; + + public class MyModel extends EventDispatcher + { + public function MyModel() + { + } + + private var _labelText:String; + + public function get labelText():String + { + return _labelText; + } + + public function set labelText(value:String):void + { + if (value != _labelText) + { + _labelText = value; + dispatchEvent(new Event("labelTextChanged")); + } + } + + private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"]; + public function get strings():Array + { + return _strings; + } + + private var _cities:Array = ["London", "Miami", "Paris", "Sydney", "Tokyo"]; + public function get cities():Array + { + return _cities; + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0485c8b6/manualtests/FormExample/build.xml ---------------------------------------------------------------------- diff --git a/manualtests/FormExample/build.xml b/manualtests/FormExample/build.xml new file mode 100644 index 0000000..9e18f17 --- /dev/null +++ b/manualtests/FormExample/build.xml @@ -0,0 +1,77 @@ +<?xml version="1.0"?> +<!-- + + 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. + +--> + + +<project name="formexample" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../.."/> + <property name="example" value="FormExample" /> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> + <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${env.FALCON_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar" + type="file" + property="FALCON_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/> + + <available file="${env.FALCONJX_HOME}/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${env.FALCONJX_HOME}"/> + + <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar" + type="file" + property="FALCONJX_HOME" + value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/> + + <available file="${env.GOOG_HOME}/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${env.GOOG_HOME}"/> + + <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js" + type="file" + property="GOOG_HOME" + value="${FLEXJS_HOME}/js/lib/google/closure-library"/> + + <include file="${basedir}/../build_example.xml" /> + + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}"> + </target> + <!-- Uncomment to reproduce cross-compilation error in compilejs step + <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}"> + </target> + --> + + <target name="clean"> + <delete dir="${basedir}/bin" failonerror="false" /> + <delete dir="${basedir}/bin-debug" failonerror="false" /> + <delete dir="${basedir}/bin-release" failonerror="false" /> + </target> + + + +</project>
