[gtranslatoorfx~subversion:2] Revisão inicial de GTranslatoorFX
- From: bulinha@kenai.com
- To: commits@gtranslatoorfx.kenai.com
- Subject: [gtranslatoorfx~subversion:2] Revisão inicial de GTranslatoorFX
- Date: Tue, 1 Sep 2009 03:28:22 +0000
Project: gtranslatoorfx
Repository: subversion
Revision: 2
Author: bulinha
Date: 2009-09-01 03:28:19 UTC
Link:
Log Message:
------------
Revisão inicial de GTranslatoorFX
Revisions:
----------
2
Modified Paths:
---------------
GTranslatoorFX
Added Paths:
------------
GTranslatoorFX/nbproject/configs/mobile.properties
GTranslatoorFX/build.xml
GTranslatoorFX/nbproject/project.properties
GTranslatoorFX/nbproject/configs/browser.properties
GTranslatoorFX/lib/JFXtras-0.5.jar
GTranslatoorFX/lib/jnlp.jar
GTranslatoorFX/nbproject/configs
GTranslatoorFX/manifest.mf
GTranslatoorFX/lib/WidgetFX-API.jar
GTranslatoorFX/src/gtranslatoorfx/Main.fx
GTranslatoorFX/nbproject
GTranslatoorFX/src
GTranslatoorFX/nbproject/configs/webstart.properties
GTranslatoorFX/nbproject/genfiles.properties
GTranslatoorFX/nbproject/build-impl.xml
GTranslatoorFX/nbproject/project.xml
GTranslatoorFX/lib
GTranslatoorFX/src/gtranslatoorfx
Diffs:
------
Index: GTranslatoorFX/lib/WidgetFX-API.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: GTranslatoorFX/lib/WidgetFX-API.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: GTranslatoorFX/lib/JFXtras-0.5.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: GTranslatoorFX/lib/JFXtras-0.5.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: GTranslatoorFX/lib/jnlp.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: GTranslatoorFX/lib/jnlp.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: GTranslatoorFX/nbproject/project.properties
===================================================================
--- GTranslatoorFX/nbproject/project.properties (revision 0)
+++ GTranslatoorFX/nbproject/project.properties (revision 2)
@@ -0,0 +1,58 @@
+applet.draggable=true
+applet.height=200
+applet.width=200
+application.title=GoogleTranslatorFX
+application.vendor=bulinha
+build.classes.excludes=**/*.java,**/*.form,**/*.fx
+build.classpath=\
+ ${javac.classpath}:\
+ ${src.dir}:\
+ ${build.classes.dir}:
+# This directory is removed when the project is cleaned:
+build.dir=build
+build.generated.dir=${build.dir}/generated
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+debug.classpath=\
+ ${run.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/GTranslatoorFX.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+excludes=
+file.reference.JFXtras-0.5.jar=lib/JFXtras-0.5.jar
+file.reference.jnlp.jar=lib/jnlp.jar
+file.reference.WidgetFX-API.jar=lib/WidgetFX-API.jar
+includes=**
+jar.compress=true
+javac.classpath=\
+ ${file.reference.JFXtras-0.5.jar}:\
+ ${file.reference.jnlp.jar}:\
+ ${file.reference.WidgetFX-API.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.source=1.5
+javac.target=1.5
+javadoc.additionalparam=
+javadoc.author=true
+javadoc.encoding=
+javadoc.private=true
+javadoc.version=false
+javafx.profile=desktop
+jnlp.codebase.type=local
+jnlp.offline-allowed=true
+jnlp.packEnabled=false
+jnlp.signed=false
+main.class=gtranslatoorfx.Main
+pack200.jar.compress=true
+platform.active=default_fx_platform
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value
instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+run.jvmargs=
+source.encoding=UTF-8
+src.dir=src
Index: GTranslatoorFX/nbproject/project.xml
===================================================================
--- GTranslatoorFX/nbproject/project.xml (revision 0)
+++ GTranslatoorFX/nbproject/project.xml (revision 2)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.javafx.project</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/javafx-project/3">
+ <name>GTranslatoorFX</name>
+ <minimum-ant-version>1.6.5</minimum-ant-version>
+ <source-roots>
+ <root id="src.dir"/>
+ </source-roots>
+ </data>
+ </configuration>
+</project>
Index: GTranslatoorFX/nbproject/genfiles.properties
===================================================================
--- GTranslatoorFX/nbproject/genfiles.properties (revision 0)
+++ GTranslatoorFX/nbproject/genfiles.properties (revision 2)
@@ -0,0 +1,8 @@
+build.xml.data.CRC32=ebecfccd
+build.xml.script.CRC32=de5597f8
+build.xml.stylesheet.CRC32=bdec6f99@1.8.1
+# This file is used by a NetBeans-based IDE to track changes in generated
files such as build-impl.xml.
+# Do not edit this file. You may delete it but then the IDE will never
regenerate such files for you.
+nbproject/build-impl.xml.data.CRC32=ebecfccd
+nbproject/build-impl.xml.script.CRC32=64656a06
+nbproject/build-impl.xml.stylesheet.CRC32=e7782709@1.8.1
Index: GTranslatoorFX/nbproject/configs/mobile.properties
===================================================================
--- GTranslatoorFX/nbproject/configs/mobile.properties (revision 0)
+++ GTranslatoorFX/nbproject/configs/mobile.properties (revision 2)
@@ -0,0 +1,3 @@
+$label=Mobile
+execution.target=midp
+javafx.profile=mobile
Index: GTranslatoorFX/nbproject/configs/webstart.properties
===================================================================
--- GTranslatoorFX/nbproject/configs/webstart.properties (revision 0)
+++ GTranslatoorFX/nbproject/configs/webstart.properties (revision 2)
@@ -0,0 +1,3 @@
+$label=Web Start
+execution.target=jnlp
+javafx.profile=desktop
Index: GTranslatoorFX/nbproject/configs/browser.properties
===================================================================
--- GTranslatoorFX/nbproject/configs/browser.properties (revision 0)
+++ GTranslatoorFX/nbproject/configs/browser.properties (revision 2)
@@ -0,0 +1,3 @@
+$label=Browser
+execution.target=applet
+javafx.profile=desktop
Index: GTranslatoorFX/nbproject/build-impl.xml
===================================================================
--- GTranslatoorFX/nbproject/build-impl.xml (revision 0)
+++ GTranslatoorFX/nbproject/build-impl.xml (revision 2)
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+*** GENERATED FROM project.xml - DO NOT EDIT ***
+*** EDIT ../build.xml INSTEAD ***
+
+For the purpose of easier reading the script
+is divided into following sections:
+
+ - initialization
+ - compilation
+ - jar
+ - execution
+ - debugging
+ - javadoc
+ - junit compilation
+ - junit execution
+ - junit debugging
+ - applet
+ - cleanup
+
+ -->
+<project xmlns:javafxproject1="http://www.netbeans.org/ns/javafx-project/1"
xmlns:javafxproject2="http://www.netbeans.org/ns/javafx-project/2"
xmlns:javafxproject3="http://www.netbeans.org/ns/javafx-project/3"
basedir=".." default="default" name="GTranslatoorFX-impl">
+ <target depends="jar" description="Build whole project." name="default"/>
+ <!--
+ ======================
+ INITIALIZATION SECTION
+ ======================
+ -->
+ <target name="-pre-init">
+ <!-- Empty placeholder for easier customization.-->
+ <!-- You can override this target in the ../build.xml file.-->
+ </target>
+ <target depends="-pre-init" name="-init-private">
+ <macrodef name="property"
uri="http://www.netbeans.org/ns/javafx-project/1">
+ <attribute name="name"/>
+ <attribute name="value"/>
+ <sequential>
+ <property name="@{name}" value="${@{value}}"/>
+ </sequential>
+ </macrodef>
+ <property file="nbproject/private/config.properties"/>
+ <property file="nbproject/private/configs/${config}.properties"/>
+ <property file="nbproject/private/private.properties"/>
+ </target>
+ <target depends="-pre-init,-init-private" name="-init-user">
+ <property file="${user.properties.file}"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user"
name="-init-project">
+ <property file="nbproject/configs/${config}.properties"/>
+ <property file="nbproject/project.properties"/>
+ </target>
+ <target depends="-pre-init,-init-private,-init-user,-init-project"
name="-do-init">
+ <javafxproject1:property name="platform.fxhome"
value="platforms.${platform.active}.fxhome"/>
+ <javafxproject1:property name="platform.javadoc.tmp"
value="platforms.${platform.active}.javadoc"/>
+ <condition property="platform.javadoc"
value="${platform.home}/bin/javadoc">
+ <equals arg1="${platform.javadoc.tmp}"
arg2="$${platforms.${platform.active}.javadoc}"/>
+ </condition>
+ <property name="platform.javadoc" value="${platform.javadoc.tmp}"/>
+ <condition property="no.javadoc.preview">
+ <and>
+ <isset property="javadoc.preview"/>
+ <isfalse value="${javadoc.preview}"/>
+ </and>
+ </condition>
+ <property name="work.dir" value="${basedir}"/>
+ <condition property="no.deps">
+ <istrue value="${no.dependencies}"/>
+ </condition>
+ <condition else="" property="codebase.arg" value="-appCodebase
${codebase.url}">
+ <isset property="codebase.url"/>
+ </condition>
+ <property
file="${user.properties.file}/../config/preferences/org/apache/tools/ant/module.properties"
prefix="ant.module"/>
+ <condition else="" property="verbose.arg" value="-v">
+ <or>
+ <equals arg1="${ant.module.verbosity}" arg2="3"/>
+ <equals arg1="${ant.module.verbosity}" arg2="4"/>
+ </or>
+ </condition>
+ <condition else="" property="draggable.arg" value="-draggable">
+ <istrue value="${applet.draggable}"/>
+ </condition>
+ <condition else="" property="pack200.arg" value="-pack200">
+ <istrue value="${jnlp.packEnabled}"/>
+ </condition>
+ <condition else="" property="sign.arg" value="-sign">
+ <istrue value="${jnlp.signed}"/>
+ </condition>
+ <property name="javadoc.preview" value="true"/>
+ <property name="source.encoding" value="${file.encoding}"/>
+ <condition else="" property="binary.extension" value=".exe">
+ <os family="windows"/>
+ </condition>
+ <property name="javafx.profile" value="desktop"/>
+ <condition property="midp.execution.trigger">
+ <equals arg1="${javafx.profile}" arg2="mobile"/>
+ </condition>
+ <condition property="jnlp.execution.trigger">
+ <and>
+ <equals arg1="${javafx.profile}" arg2="desktop"/>
+ <equals arg1="${execution.target}" arg2="jnlp"/>
+ </and>
+ </condition>
+ <condition property="applet.execution.trigger">
+ <and>
+ <equals arg1="${javafx.profile}" arg2="desktop"/>
+ <equals arg1="${execution.target}" arg2="applet"/>
+ <isset property="netbeans.home"/>
+ </and>
+ </condition>
+ <condition property="standard.execution.trigger">
+ <not>
+ <or>
+ <isset property="jnlp.execution.trigger"/>
+ <isset property="applet.execution.trigger"/>
+ <isset property="midp.execution.trigger"/>
+ </or>
+ </not>
+ </condition>
+ <property name="run.jvmargs" value=""/>
+ <available
file="${platform.fxhome}/emulator/bin/emulator${binary.extension}"
property="emulator.available"/>
+ </target>
+ <target name="-post-init">
+ <!-- Empty placeholder for easier customization.-->
+ <!-- You can override this target in the ../build.xml file.-->
+ </target>
+ <target
depends="-pre-init,-init-private,-init-user,-init-project,-do-init"
name="-init-check">
+ <fail unless="build.dir">Must set build.dir</fail>
+ <fail unless="dist.dir">Must set dist.dir</fail>
+ <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
+ </target>
+ <target
depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check"
name="init"/>
+ <!--
+ ===================
+ COMPILATION SECTION
+ ===================
+ -->
+ <target depends="init" name="deps-jar" unless="no.deps"/>
+ <target name="-pre-compile">
+ <!-- Empty placeholder for easier customization.-->
+ <!-- You can override this target in the ../build.xml file.-->
+ </target>
+ <target depends="init,deps-jar,-pre-compile" name="-do-compile">
+ <exec
executable="${platform.fxhome}/bin/javafxpackager${binary.extension}"
failonerror="true">
+ <arg value="-src"/>
+ <arg value="${src.dir}"/>
+ <arg value="-workdir"/>
+ <arg file="${build.dir}"/>
+ <arg value="-d"/>
+ <arg file="${dist.dir}"/>
+ <arg value="-appname"/>
+ <arg value="${application.title}"/>
+ <arg value="-appvendor"/>
+ <arg value="${application.vendor}"/>
+ <arg value="-appwidth"/>
+ <arg value="${applet.width}"/>
+ <arg value="-appheight"/>
+ <arg value="${applet.height}"/>
+ <arg value="-appclass"/>
+ <arg value="${main.class}"/>
+ <arg line="${codebase.arg}"/>
+ <arg value="-encoding"/>
+ <arg value="${source.encoding}"/>
+ <arg value="-p"/>
+ <arg value="${javafx.profile}"/>
+ <arg value="${verbose.arg}"/>
+ <arg value="${draggable.arg}"/>
+ <arg value="${pack200.arg}"/>
+ <arg value="${sign.arg}"/>
+ <arg value="-cp"/>
+ <arg path="${javac.classpath}"/>
+ </exec>
+ </target>
+ <target name="-post-compile">
+ <!-- Empty placeholder for easier customization.-->
+ <!-- You can override this target in the ../build.xml file.-->
+ </target>
+ <target depends="init,deps-jar,-pre-compile,-do-compile,-post-compile"
description="Compile project." name="compile"/>
+ <!--
+ ====================
+ JAR BUILDING SECTION
+ ====================
+ -->
+ <target depends="init,compile" description="Build." name="jar"/>
+ <!--
+ =================
+ EXECUTION SECTION
+ =================
+ -->
+ <target depends="init,compile,jar" description="Run a main class."
if="standard.execution.trigger" name="standard-run">
+ <property name="application.args" value=""/>
+ <java classname="${main.class}"
classpath="${dist.dir}/${application.title}.jar" failonerror="true"
fork="true" jvm="${platform.fxhome}/bin/javafx${binary.extension}"
jvmargs="${run.jvmargs}">
+ <arg line="${application.args}"/>
+ </java>
+ </target>
+ <target depends="jar" description="Start MIDP execution"
if="midp.execution.trigger" name="midp-run">
+ <fail message="Current platform does not include mobile device
emulator necessary for the execution." unless="emulator.available"/>
+ <property location="${dist.dir}/${application.title}.jad"
name="jad.file"/>
+ <property name="mobile.device" value="DefaultFxPhone1"/>
+ <condition else="-Xdescriptor:" property="emulator.exec.arg"
value="-Xjam:install=">
+ <istrue value="${jad.install}"/>
+ </condition>
+ <exec
executable="${platform.fxhome}/emulator/bin/emulator${binary.extension}"
failonerror="true">
+ <arg value="${run.jvmargs}"/>
+ <arg value="${emulator.exec.arg}${jad.file}"/>
+ <arg value="-Xdevice:${mobile.device}"/>
+ </exec>
+ </target>
+ <target depends="init,jar" if="applet.execution.trigger"
name="browser-run">
+ <makeurl file="${dist.dir}/${application.title}.html"
property="applet.local.url"/>
+ <condition else="${applet.local.url}" property="applet.url"
value="${codebase.url}/${application.title}.html">
+ <isset property="codebase.url"/>
+ </condition>
+ <nbbrowse url="${applet.url}"/>
+ </target>
+ <target depends="jar" description="Start javaws execution"
if="jnlp.execution.trigger" name="jws-run">
+ <condition else="${java.home}" property="javaws.home" value="/usr">
+ <os family="mac"/>
+ </condition>
+ <exec executable="${javaws.home}/bin/javaws" failonerror="true">
+ <env key="JAVAWS_VM_ARGS" value="${run.jvmargs}"/>
+ <arg file="${dist.dir}/${application.title}.jnlp"/>
+ </exec>
+ </target>
+ <target
depends="init,compile,jar,standard-run,browser-run,jws-run,midp-run"
description="Run an application." name="run"/>
+ <!--
+ =================
+ DEBUGGING SECTION
+ =================
+ -->
+ <target depends="init" if="netbeans.home" name="-debug-start-debugger">
+ <nbjavafxstart addressproperty="javafx.address"
name="${application.title}" transport="dt_socket">
+ <classpath>
+ <path path="${javac.classpath}"/>
+ </classpath>
+ <sourcepath>
+ <path path="${src.dir}"/>
+ </sourcepath>
+ </nbjavafxstart>
+ </target>
+ <target depends="init" if="netbeans.home"
name="-debug-start-debugger-stepinto">
+ <nbjavafxstart addressproperty="javafx.address"
name="${application.title}" stopclassname="${main.class}"
transport="dt_socket">
+ <classpath>
+ <path path="${javac.classpath}"/>
+ </classpath>
+ <sourcepath>
+ <path path="${src.dir}"/>
+ </sourcepath>
+ </nbjavafxstart>
+ </target>
+ <target depends="init,compile" if="standard.execution.trigger"
name="-debug-start-debuggee">
+ <property name="application.args" value=""/>
+ <java classname="${main.class}"
classpath="${dist.dir}/${application.title}.jar" fork="true"
jvm="${platform.fxhome}/bin/javafx${binary.extension}">
+ <jvmarg
value="-Xrunjdwp:transport=dt_socket,address=${javafx.address}"/>
+ <jvmarg line="${run.jvmargs}"/>
+ <syspropertyset>
+ <propertyref prefix="run-sys-prop."/>
+ <mapper from="run-sys-prop.*" to="*" type="glob"/>
+ </syspropertyset>
+ <arg line="${application.args}"/>
+ </java>
+ </target>
+ <target if="midp.execution.trigger" name="-debug-midp-debuggee">
+ <fail message="Current platform does not include mobile device
emulator necessary for the debugging." unless="emulator.available"/>
+ <property location="${dist.dir}/${application.title}.jad"
name="jad.file"/>
+ <condition else="-Xdescriptor:" property="emulator.exec.arg"
value="-Xjam:install=">
+ <istrue value="${jad.install}"/>
+ </condition>
+ <exec
executable="${platform.fxhome}/emulator/bin/emulator${binary.extension}">
+ <arg value="${run.jvmargs}"/>
+ <arg value="${emulator.exec.arg}${jad.file}"/>
+ <arg value="-Xdebug"/>
+ <arg
value="-Xrunjdwp:transport=dt_socket,address=${javafx.address},server=n"/>
+ </exec>
+ </target>
+ <target if="jnlp.execution.trigger" name="-debug-javaws-debuggee">
+ <condition else="${java.home}" property="javaws.home" value="/usr">
+ <os family="mac"/>
+ </condition>
+ <exec executable="${javaws.home}/bin/javaws">
+ <env key="JAVAWS_VM_ARGS" value="-Xdebug -Xnoagent
-Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=${javafx.address}
${run.jvmargs}"/>
+ <arg file="${dist.dir}/${application.title}.jnlp"/>
+ </exec>
+ </target>
+ <target
depends="init,compile,-debug-start-debugger,-debug-start-debuggee,-debug-javaws-debuggee,-debug-midp-debuggee"
description="Debug project in IDE." if="netbeans.home" name="debug"/>
+ <target
depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee,-debug-javaws-debuggee,-debug-midp-debuggee"
if="netbeans.home" name="debug-stepinto"/>
+ <!--
+ ===============
+ JAVADOC SECTION
+ ===============
+ -->
+ <target depends="init" name="-javadoc-build">
+ <mkdir dir="${dist.javadoc.dir}"/>
+ <javadoc author="${javadoc.author}" classpath="${javac.classpath}"
destdir="${dist.javadoc.dir}"
executable="${platform.fxhome}/bin/javafxdoc${binary.extension}"
failonerror="true" private="${javadoc.private}" useexternalfile="true"
version="${javadoc.version}">
+ <fileset dir="${src.dir}" includes="**/*.fx"/>
+ </javadoc>
+ <condition property="javadoc.available">
+ <and>
+ <isset property="netbeans.home"/>
+ <available file="${dist.javadoc.dir}/index.html"/>
+ </and>
+ </condition>
+ </target>
+ <target depends="init,-javadoc-build" if="javadoc.available"
name="-javadoc-browse" unless="no.javadoc.preview">
+ <nbbrowse file="${dist.javadoc.dir}/index.html"/>
+ </target>
+ <target depends="init,-javadoc-build,-javadoc-browse" description="Build
Javadoc." name="javadoc"/>
+ <!--
+ ===============
+ CLEANUP SECTION
+ ===============
+ -->
+ <target depends="init" name="deps-clean" unless="no.deps"/>
+ <target depends="init" name="-do-clean">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.dir}"/>
+ </target>
+ <target name="-post-clean">
+ <!-- Empty placeholder for easier customization.-->
+ <!-- You can override this target in the ../build.xml file.-->
+ </target>
+ <target depends="init,deps-clean,-do-clean,-post-clean"
description="Clean build products." name="clean"/>
+</project>
Property changes on: GTranslatoorFX/nbproject
___________________________________________________________________
Added: svn:ignore
+ private
Index: GTranslatoorFX/manifest.mf
===================================================================
--- GTranslatoorFX/manifest.mf (revision 0)
+++ GTranslatoorFX/manifest.mf (revision 2)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+X-COMMENT: Main-Class will be added automatically by build
+
Index: GTranslatoorFX/src/gtranslatoorfx/Main.fx
===================================================================
--- GTranslatoorFX/src/gtranslatoorfx/Main.fx (revision 0)
+++ GTranslatoorFX/src/gtranslatoorfx/Main.fx (revision 2)
@@ -0,0 +1,221 @@
+package gtranslatoorfx;
+
+import javafx.scene.text.Text;
+import javafx.scene.text.Font;
+import javafx.io.http.HttpRequest;
+import javafx.data.pull.Event;
+import javafx.data.pull.PullParser;
+import javafx.scene.paint.LinearGradient;
+import javafx.scene.paint.Stop;
+import javafx.scene.paint.Color;
+import org.widgetfx.Widget;
+import javafx.io.http.URLConverter;
+import javafx.scene.control.TextBox;
+import javafx.scene.Group;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.control.ScrollBar;
+import javafx.scene.text.TextAlignment;
+import javafx.scene.text.TextOrigin;
+import javafx.scene.transform.Scale;
+
+import org.widgetfx.config.Configuration;
+
+import javafx.scene.Scene;
+
+import javafx.scene.layout.VBox;
+
+import javafx.scene.layout.HBox;
+import javafx.scene.control.ListView;
+import org.widgetfx.config.StringProperty;
+
+import javafx.util.Sequences;
+
+var address = "http://ajax.googleapis.com/ajax/services/language/translate";
+var textToTranslate:String;
+var result:String;
+var languages =
["pt","af","sq","de","ar","be","bg","ca","zh-CN","ko","hr","da","sk","sl","es","et","fi","fr","gl","cy","el","iw","hi","nl","hu","id","en","ga","is","it","ja","lv","lt","mk","ms","mt","no","fa","pl","pt","ro","ru","sr","sw","sv","tl","th","cs","tr","uk","vi","yi"];
+var lf:String;
+var lt:String;
+var languageFrom = bind languagesFrom.selectedItem on replace {
+ lf = languageFrom.toString();
+ };
+var languageTo= bind languagesTo.selectedItem on replace {
+ lt = languageTo.toString();
+ };
+def parser = PullParser {
+ documentType: PullParser.JSON;
+ onEvent: function(event: Event) {
+ if(event.type == PullParser.END_VALUE) {
+ if(event.name == "translatedText"){
+ result = event.text;
+ }
+ }
+ }
+}
+
+function translate(){
+ var u = URLConverter {} ;
+ var request = HttpRequest {
+ location:
u.encodeURL("{address}?v=1.0&q={textToTranslate}&langpair={ if(lf=="auto") ""
else lf}|{lt}");
+ method:HttpRequest.GET
+ onInput: function(stream: java.io.InputStream) {
+ parser.input = stream;
+ parser.parse();
+ textBox.disable=false;
+ }
+ onError:function(i) {
+ result = "error!"
+ }
+ onException:function(e) {
+ result = "error!"
+ }
+ }
+ textBox.disable=true;
+ request.start();
+
+}
+var languagesFrom = ListView { items: ["auto",languages] };
+var languagesTo= ListView {items: [languages]};
+var config=Configuration {
+ properties: [
+ StringProperty { name:"from", value: bind lf with inverse}
+ StringProperty { name:"to", value: bind lt with inverse}
+ ]
+ onLoad: function(){
+ if (lf==null) lf = "auto";
+ if (lt==null) lt="en";
+ languagesFrom.select(Sequences.indexOf(languagesFrom.items, lf));
+ languagesTo.select(Sequences.indexOf(languagesTo.items, lt));
+
+ }
+
+ scene: Scene {
+ content: HBox {
+ content: [
+ VBox{
+ content: [ Text{content:"From"},
+ languagesFrom
+ ]
+ },
+ VBox{
+ content: [ Text{content:"To"},
+ languagesTo
+ ]
+ }
+
+ ]
+ }
+ }
+}
+
+
+var widget:Widget;
+var textBox:TextBox;
+var textResult:Text;
+
+def defaultWidth=100;
+def defaultHeight=180;
+var posTextResult:Number=0;
+var group:Group;
+var sx:Float=1;
+var sy:Float=1;
+var sc:ScrollBar;
+
+
+group = Group{
+ content: [
+ Rectangle {
+ width: defaultWidth
+ height: defaultHeight
+ arcHeight:10
+ arcWidth:10
+ stroke:Color.BLACK
+ strokeWidth:1
+ fill:LinearGradient {
+ startX : 0.0
+ startY : 0.0
+ endX : 0.0
+ endY : 1.0
+ stops: [
+ Stop {
+ color : Color.BLACK
+ offset: 0.0
+ },
+ Stop {
+ color : Color.LIGHTGREY
+ offset: 0.1
+ },
+ Stop {
+ color : Color.LIGHTGREY
+ offset: 0.9
+ },
+ Stop {
+ color : Color.BLACK
+ offset: 1.0
+ },
+ ]
+ }
+ },
+
+ textBox=TextBox {
+ layoutX:10
+ layoutY:20
+ width: defaultWidth -20
+ text: bind textToTranslate with inverse
+ action: function(){
+ translate();
+ }
+
+ },
+ Group {
+ layoutX:10
+ layoutY:50
+ content:[
+ textResult = Text {
+ layoutY : bind 10 - sc.value
+ font : Font {
+ size : 12
+ }
+ textAlignment: TextAlignment.JUSTIFY
+ textOrigin: TextOrigin.TOP
+ wrappingWidth: defaultWidth - 40
+ content: bind result
+
+ },
+ ]
+ clip: Rectangle {
+ width: defaultWidth-30
+ height:100
+
+ }
+
+ },
+ sc = ScrollBar {
+ visible: bind textResult.boundsInParent.height >100
+ layoutY: 50
+ vertical:true
+ layoutX: defaultWidth-20
+ min : 0
+ max : bind textResult.boundsInParent.height
+ height:100
+ }
+
+ ]
+
+ transforms: [ Scale { x : bind sx, y : bind sy } ]
+
+
+}
+
+
+widget = Widget {
+ width:defaultWidth
+ height:defaultHeight
+ aspectRatio: defaultWidth / defaultHeight
+ configuration: config
+ content: group
+ onResize: function(x,y) {
+ sx= x/defaultWidth ;
+ sy= y/defaultHeight;
+ }
+}
\ No newline at end of file
Index: GTranslatoorFX/build.xml
===================================================================
--- GTranslatoorFX/build.xml (revision 0)
+++ GTranslatoorFX/build.xml (revision 2)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- You may freely edit this file. See commented blocks below for -->
+<!-- some examples of how to customize the build. -->
+<!-- (If you delete it and reopen the project it will be recreated.) -->
+<project name="GTranslatoorFX" default="default" basedir=".">
+ <description>Builds, tests, and runs the project
GTranslatoorFX.</description>
+ <import file="nbproject/build-impl.xml"/>
+ <!--
+
+ There exist several targets which are by default empty and which can be
+ used for execution of your tasks. These targets are usually executed
+ before and after some main targets. They are:
+
+ -pre-init: called before initialization of project
properties
+ -post-init: called after initialization of project
properties
+ -pre-compile: called before javac compilation
+ -post-compile: called after javac compilation
+ -pre-compile-single: called before javac compilation of single
file
+ -post-compile-single: called after javac compilation of single
file
+ -pre-compile-test: called before javac compilation of JUnit
tests
+ -post-compile-test: called after javac compilation of JUnit
tests
+ -pre-compile-test-single: called before javac compilation of single
JUnit test
+ -post-compile-test-single: called after javac compilation of single
JUunit test
+ -pre-jar: called before JAR building
+ -post-jar: called after JAR building
+ -post-clean: called after cleaning build products
+
+ (Targets beginning with '-' are not intended to be called on their own.)
+
+ Example of inserting an obfuscator after compilation could look like
this:
+
+ <target name="-post-compile">
+ <obfuscate>
+ <fileset dir="${build.classes.dir}"/>
+ </obfuscate>
+ </target>
+
+ For list of available properties check the imported
+ nbproject/build-impl.xml file.
+
+
+ Another way to customize the build is by overriding existing main
targets.
+ The targets of interest are:
+
+ -init-macrodef-javac: defines macro for javac compilation
+ -init-macrodef-junit: defines macro for junit execution
+ -init-macrodef-debug: defines macro for class debugging
+ -init-macrodef-java: defines macro for class execution
+ -do-jar-with-manifest: JAR building (if you are using a manifest)
+ -do-jar-without-manifest: JAR building (if you are not using a
manifest)
+ run: execution of project
+ -javadoc-build: Javadoc generation
+ test-report: JUnit report generation
+
+ An example of overriding the target for project execution could look
like this:
+
+ <target name="run" depends="GTranslatoorFX-impl.jar">
+ <exec dir="bin" executable="launcher.exe">
+ <arg file="${dist.jar}"/>
+ </exec>
+ </target>
+
+ Notice that the overridden target depends on the jar target and not only
on
+ the compile target as the regular run target does. Again, for a list of
available
+ properties which you can use, check the target you are overriding in the
+ nbproject/build-impl.xml file.
+
+ -->
+</project>
Property changes on: GTranslatoorFX
___________________________________________________________________
Added: svn:ignore
+ build
dist
|
[gtranslatoorfx~subversion:2] Revisão inicial de GTranslatoorFX |
bulinha | 09/01/2009 |





