[Java-link-svn] SF.net SVN: java-link: [1]
Status: Pre-Alpha
Brought to you by:
welterde0
From: <wel...@us...> - 2006-03-09 19:33:22
|
Revision: 1 Author: welterde0 Date: 2006-03-09 11:30:15 -0800 (Thu, 09 Mar 2006) ViewCVS: http://svn.sourceforge.net/java-link/?rev=1&view=rev Log Message: ----------- inital import Added Paths: ----------- branches/ tags/ trunk/ trunk/CHANGELOG trunk/Client/ trunk/Client/build.xml trunk/Client/manifest.mf trunk/Client/nbproject/ trunk/Client/nbproject/build-impl.xml trunk/Client/nbproject/genfiles.properties trunk/Client/nbproject/private/ trunk/Client/nbproject/private/private.properties trunk/Client/nbproject/private/profiler/ trunk/Client/nbproject/private/profiler/presets.xml trunk/Client/nbproject/profiler-build-impl.xml trunk/Client/nbproject/project.properties trunk/Client/nbproject/project.xml trunk/Client/src/ trunk/Client/src/org/ trunk/Client/src/org/jlink/ trunk/Client/src/org/jlink/ClientCore.java trunk/Client/src/org/jlink/ClientFrontend.java trunk/Client/src/org/jlink/ClientMain.java trunk/Client/src/org/jlink/ClientNetwork.java trunk/Client/src/org/jlink/ClientSound.java trunk/Client/src/org/jlink/Options.java trunk/Client/src/org/jlink/ServerController.java trunk/Client/src/org/jlink/client/ trunk/Client/src/org/jlink/client/core/ trunk/Client/src/org/jlink/client/core/Connection.java trunk/Client/src/org/jlink/client/frontend/ trunk/Client/src/org/jlink/client/frontend/MainFrame.java trunk/Client/src/org/jlink/client/frontend/menu/ trunk/Client/src/org/jlink/client/frontend/menu/MainMenu.form trunk/Client/src/org/jlink/client/frontend/menu/MainMenu.java trunk/Client/src/org/jlink/client/frontend/theme/ trunk/Client/src/org/jlink/client/frontend/theme/Theme.java trunk/Client/src/org/jlink/client/frontend/theme/ThemeManager.java trunk/Client/src/org/jlink/client/gui/ trunk/Client/src/org/jlink/client/gui/Colors.java trunk/Client/src/org/jlink/client/gui/MenuBean.java trunk/Client/src/org/jlink/client/model/ trunk/Client/src/org/jlink/client/model/Proxy.java trunk/Client/src/org/jlink/client/net/ trunk/Client/src/org/jlink/client/sound/ trunk/Client/test/ trunk/LICENSE trunk/MODDING trunk/MODDING.DE trunk/PROJECTS trunk/README trunk/README.de trunk/ROADMAP trunk/Server/ trunk/Server/build.xml trunk/Server/manifest.mf trunk/Server/nbproject/ trunk/Server/nbproject/build-impl.xml trunk/Server/nbproject/genfiles.properties trunk/Server/nbproject/management-build-impl.xml trunk/Server/nbproject/private/ trunk/Server/nbproject/private/private.properties trunk/Server/nbproject/private/profiler/ trunk/Server/nbproject/private/profiler/custom-0.xml trunk/Server/nbproject/private/profiler/custom-1.xml trunk/Server/nbproject/private/profiler/custom-2.xml trunk/Server/nbproject/private/profiler/presets.xml trunk/Server/nbproject/profiler-build-impl.xml trunk/Server/nbproject/project.properties trunk/Server/nbproject/project.xml trunk/Server/src/ trunk/Server/src/org/ trunk/Server/src/org/jlink/ trunk/Server/src/org/jlink/CoreController.java trunk/Server/src/org/jlink/DatabaseController.java trunk/Server/src/org/jlink/LoginController.java trunk/Server/src/org/jlink/Options.java trunk/Server/src/org/jlink/ServerCore.java trunk/Server/src/org/jlink/ServerDatabase.java trunk/Server/src/org/jlink/ServerMain.java trunk/Server/src/org/jlink/ServerNetwork.java trunk/Server/src/org/jlink/server/ trunk/Server/src/org/jlink/server/db/ trunk/Server/src/org/jlink/server/db/Database.java trunk/Server/src/org/jlink/server/db/DatabaseCreationReader.java trunk/Server/src/org/jlink/server/db/DatabaseNullWriter.java trunk/Server/src/org/jlink/server/db/DatabaseReader.java trunk/Server/src/org/jlink/server/db/DatabaseWriter.java trunk/Server/src/org/jlink/server/jmx/ trunk/Server/src/org/jlink/server/jmx/JMXAgent.java trunk/Server/src/org/jlink/server/jmx/run.access trunk/Server/src/org/jlink/server/jmx/run.password trunk/Server/src/org/jlink/server/jmx/run.properties trunk/Server/src/org/jlink/server/net/ trunk/Server/src/org/jlink/server/net/NetworkBackend.java trunk/Server/test/ trunk/Share/ trunk/Share/build.xml trunk/Share/nbproject/ trunk/Share/nbproject/build-impl.xml trunk/Share/nbproject/genfiles.properties trunk/Share/nbproject/private/ trunk/Share/nbproject/private/private.properties trunk/Share/nbproject/project.properties trunk/Share/nbproject/project.xml trunk/Share/src/ trunk/Share/src/org/ trunk/Share/src/org/jlink/ trunk/Share/src/org/jlink/Core.java trunk/Share/src/org/jlink/Module.java trunk/Share/src/org/jlink/locale/ trunk/Share/src/org/jlink/model/ trunk/Share/src/org/jlink/model/AbstractModelComponent.java trunk/Share/src/org/jlink/model/Avatar.java trunk/Share/src/org/jlink/model/Character.java trunk/Share/src/org/jlink/model/Company.java trunk/Share/src/org/jlink/model/Hardware.java trunk/Share/src/org/jlink/model/ID.java trunk/Share/src/org/jlink/model/IP.java trunk/Share/src/org/jlink/model/Machine.java trunk/Share/src/org/jlink/model/ModelComponent.java trunk/Share/src/org/jlink/model/ModelProxy.java trunk/Share/src/org/jlink/model/NonPlayerCharacter.java trunk/Share/src/org/jlink/model/PlayerCharacter.java trunk/Share/src/org/jlink/model/Route.java trunk/Share/src/org/jlink/model/hw/ trunk/Share/src/org/jlink/model/hw/HardDisk.java trunk/Share/src/org/jlink/model/hw/HardwareComponent.java trunk/Share/src/org/jlink/model/hw/Motherboard.java trunk/Share/src/org/jlink/model/hw/Processor.java trunk/Share/src/org/jlink/model/machine/ trunk/Share/src/org/jlink/model/machine/Gateway.java trunk/Share/src/org/jlink/model/machine/MachineOwner.java trunk/Share/src/org/jlink/model/machine/Partition.java trunk/Share/src/org/jlink/nav/ trunk/Share/src/org/jlink/nav/NavEntry.java trunk/Share/src/org/jlink/nav/NavTree.java trunk/Share/src/org/jlink/nav/auth/ trunk/Share/src/org/jlink/nav/auth/PasswordAuthEntry.java trunk/Share/src/org/jlink/net/ trunk/Share/src/org/jlink/net/ConnectionHandler.java trunk/Share/src/org/jlink/net/ConnectionListener.java trunk/Share/src/org/jlink/net/Message.java trunk/Share/src/org/jlink/net/msgs/ trunk/Share/src/org/jlink/net/msgs/ConnectionAccepted.java trunk/Share/src/org/jlink/net/msgs/ConnectionDenied.java trunk/Share/src/org/jlink/net/msgs/ConnectionEnding.java trunk/Share/src/org/jlink/net/msgs/ConnectionStarting.java trunk/Share/src/org/jlink/net/msgs/Login.java trunk/Share/src/org/jlink/net/msgs/LoginAcceptedMessage.java trunk/Share/src/org/jlink/net/msgs/LoginDeniedMessage.java trunk/Share/src/org/jlink/net/msgs/LoginMessage.java trunk/Share/src/org/jlink/resources/ trunk/Share/src/org/jlink/resources/FontLoader.java trunk/Share/src/org/jlink/resources/fonts/ trunk/Share/src/org/jlink/resources/fonts/battle3.ttf trunk/Share/test/ trunk/Share/test/org/ trunk/Share/test/org/jlink/ trunk/Share/test/org/jlink/resources/ trunk/Share/test/org/jlink/resources/FontLoaderTest.java trunk/TODO trunk/lib/ trunk/lib/commons-pool.jar trunk/lib/log4j/ trunk/lib/log4j/log4j-db.jar trunk/lib/log4j/log4j-jms.jar trunk/lib/log4j/log4j-optional.jar trunk/lib/log4j/log4j-oro.jar trunk/lib/log4j/log4j-smtp.jar trunk/lib/log4j/log4j-xml.jar trunk/lib/log4j/log4j.jar trunk/lib/log4j/oro.jar trunk/lib/other/ trunk/lib/other/swing-layout.jar trunk/templates/ trunk/templates/Client/ trunk/templates/Server/ trunk/templates/Share/ trunk/templates/Share/net/ trunk/templates/Share/net/msgs/ trunk/templates/Share/net/msgs/Message.java trunk/themes/ trunk/themes/default/ trunk/themes/default/menues/ trunk/themes/default/menues/main/ trunk/themes/default/menues/main/account-register.png trunk/themes/default/menues/main/system-change_server.png trunk/themes/default/menues/main/system-exit.png trunk/themes/default/theme.xml Added: trunk/CHANGELOG =================================================================== Added: trunk/Client/build.xml =================================================================== --- trunk/Client/build.xml (rev 0) +++ trunk/Client/build.xml 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,70 @@ +<?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="Client" default="default" basedir="."> + <description>Builds, tests, and runs the project Client.</description> + <import file="nbproject/build-impl.xml"/> + + <import file="nbproject/profiler-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="Client-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> Added: trunk/Client/manifest.mf =================================================================== --- trunk/Client/manifest.mf (rev 0) +++ trunk/Client/manifest.mf 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + Added: trunk/Client/nbproject/build-impl.xml =================================================================== --- trunk/Client/nbproject/build-impl.xml (rev 0) +++ trunk/Client/nbproject/build-impl.xml 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,545 @@ +<?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 name="Client-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1"> + <target name="default" depends="test,jar,javadoc" description="Build and test whole project."/> + <!-- + ====================== + INITIALIZATION SECTION + ====================== + --> + <target name="-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-init-private" depends="-pre-init"> + <property file="nbproject/private/private.properties"/> + </target> + <target name="-init-user" depends="-pre-init,-init-private"> + <property file="${user.properties.file}"/> + <!-- The two properties below are usually overridden --> + <!-- by the active platform. Just a fallback. --> + <property name="default.javac.source" value="1.4"/> + <property name="default.javac.target" value="1.4"/> + </target> + <target name="-init-project" depends="-pre-init,-init-private,-init-user"> + <property file="nbproject/project.properties"/> + </target> + <target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property"> + <available file="${manifest.file}" property="manifest.available"/> + <condition property="manifest.available+main.class"> + <and> + <isset property="manifest.available"/> + <isset property="main.class"/> + <not> + <equals arg1="${main.class}" arg2="" trim="true"/> + </not> + </and> + </condition> + <condition property="manifest.available+main.class+mkdist.available"> + <and> + <istrue value="${manifest.available+main.class}"/> + <isset property="libs.CopyLibs.classpath"/> + </and> + </condition> + <condition property="have.tests"> + <or> + <available file="${test.src.dir}"/> + </or> + </condition> + <condition property="have.sources"> + <or> + <available file="${src.dir}"/> + </or> + </condition> + <condition property="netbeans.home+have.tests"> + <and> + <isset property="netbeans.home"/> + <isset property="have.tests"/> + </and> + </condition> + <condition property="no.javadoc.preview"> + <isfalse value="${javadoc.preview}"/> + </condition> + <property name="run.jvmargs" value=""/> + <property name="javac.compilerargs" value=""/> + <property name="work.dir" value="${basedir}"/> + <condition property="no.deps"> + <and> + <istrue value="${no.dependencies}"/> + </and> + </condition> + <property name="javac.debug" value="true"/> + <property name="javadoc.preview" value="true"/> + </target> + <target name="-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init"> + <fail unless="src.dir">Must set src.dir</fail> + <fail unless="test.src.dir">Must set test.src.dir</fail> + <fail unless="build.dir">Must set build.dir</fail> + <fail unless="dist.dir">Must set dist.dir</fail> + <fail unless="build.classes.dir">Must set build.classes.dir</fail> + <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail> + <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail> + <fail unless="build.test.results.dir">Must set build.test.results.dir</fail> + <fail unless="build.classes.excludes">Must set build.classes.excludes</fail> + <fail unless="dist.jar">Must set dist.jar</fail> + </target> + <target name="-init-macrodef-property"> + <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${@{value}}"/> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-javac"> + <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute name="srcdir" default="${src.dir}"/> + <attribute name="destdir" default="${build.classes.dir}"/> + <attribute name="classpath" default="${javac.classpath}"/> + <attribute name="debug" default="${javac.debug}"/> + <element name="customize" optional="true"/> + <sequential> + <javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false"> + <classpath> + <path path="@{classpath}"/> + </classpath> + <compilerarg line="${javac.compilerargs}"/> + <customize/> + </javac> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-junit"> + <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute name="includes" default="**/*Test.java"/> + <sequential> + <junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed"> + <batchtest todir="${build.test.results.dir}"> + <fileset dir="${test.src.dir}" includes="@{includes}"/> + </batchtest> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper type="glob" from="test-sys-prop.*" to="*"/> + </syspropertyset> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + <jvmarg line="${run.jvmargs}"/> + </junit> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-nbjpda"> + <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="name" default="${main.class}"/> + <attribute name="classpath" default="${debug.classpath}"/> + <attribute name="stopclassname" default=""/> + <sequential> + <nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}"> + <classpath> + <path path="@{classpath}"/> + </classpath> + </nbjpdastart> + </sequential> + </macrodef> + <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="dir" default="${build.classes.dir}"/> + <sequential> + <nbjpdareload> + <fileset includes="${fix.includes}*.class" dir="@{dir}"/> + </nbjpdareload> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-debug"> + <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3"> + <attribute name="classname" default="${main.class}"/> + <attribute name="classpath" default="${debug.classpath}"/> + <element name="customize" optional="true"/> + <sequential> + <java fork="true" classname="@{classname}" dir="${work.dir}"> + <jvmarg value="-Xdebug"/> + <jvmarg value="-Xnoagent"/> + <jvmarg value="-Djava.compiler=none"/> + <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="@{classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper type="glob" from="run-sys-prop.*" to="*"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-macrodef-java"> + <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1"> + <attribute name="classname" default="${main.class}"/> + <element name="customize" optional="true"/> + <sequential> + <java fork="true" classname="@{classname}" dir="${work.dir}"> + <jvmarg line="${run.jvmargs}"/> + <classpath> + <path path="${run.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper type="glob" from="run-sys-prop.*" to="*"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-init-presetdef-jar"> + <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1"> + <jar jarfile="${dist.jar}" compress="${jar.compress}"> + <j2seproject1:fileset dir="${build.classes.dir}"/> + </jar> + </presetdef> + </target> + <target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/> + <!-- + =================== + COMPILATION SECTION + =================== + --> + <target name="deps-jar" depends="init" unless="no.deps"> + <ant target="jar" inheritall="false" antfile="${project.Share}/build.xml"/> + </target> + <target name="-pre-pre-compile" depends="init,deps-jar"> + <mkdir dir="${build.classes.dir}"/> + </target> + <target name="-pre-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile" if="have.sources"> + <j2seproject3:javac/> + <copy todir="${build.classes.dir}"> + <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/> + </copy> + </target> + <target name="-post-compile"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/> + <target name="-pre-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:javac> + <customize> + <patternset includes="${javac.includes}"/> + </customize> + </j2seproject3:javac> + </target> + <target name="-post-compile-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/> + <!-- + ==================== + JAR BUILDING SECTION + ==================== + --> + <target name="-pre-pre-jar" depends="init"> + <dirname property="dist.jar.dir" file="${dist.jar}"/> + <mkdir dir="${dist.jar.dir}"/> + </target> + <target name="-pre-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available"> + <j2seproject1:jar/> + </target> + <target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class"> + <j2seproject1:jar manifest="${manifest.file}"/> + </target> + <target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" unless="manifest.available+main.class+mkdist.available"> + <j2seproject1:jar manifest="${manifest.file}"> + <j2seproject1:manifest> + <j2seproject1:attribute name="Main-Class" value="${main.class}"/> + </j2seproject1:manifest> + </j2seproject1:jar> + <echo>To run this application from the command line without Ant, try:</echo> + <property name="build.classes.dir.resolved" location="${build.classes.dir}"/> + <property name="dist.jar.resolved" location="${dist.jar}"/> + <pathconvert property="run.classpath.with.dist.jar"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/> + </pathconvert> + <echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo> + </target> + <target name="-do-jar-with-libraries" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available"> + <property name="build.classes.dir.resolved" location="${build.classes.dir}"/> + <pathconvert property="run.classpath.without.build.classes.dir"> + <path path="${run.classpath}"/> + <map from="${build.classes.dir.resolved}" to=""/> + </pathconvert> + <pathconvert property="jar.classpath" pathsep=" "> + <path path="${run.classpath.without.build.classes.dir}"/> + <chainedmapper> + <flattenmapper/> + <globmapper from="*" to="lib/*"/> + </chainedmapper> + </pathconvert> + <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" name="copylibs" classpath="${libs.CopyLibs.classpath}"/> + <copylibs manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}" jarfile="${dist.jar}" compress="${jar.compress}"> + <fileset dir="${build.classes.dir}"/> + <manifest> + <attribute name="Main-Class" value="${main.class}"/> + <attribute name="Class-Path" value="${jar.classpath}"/> + </manifest> + </copylibs> + <echo>To run this application from the command line without Ant, try:</echo> + <property name="dist.jar.resolved" location="${dist.jar}"/> + <echo>java -jar "${dist.jar.resolved}"</echo> + </target> + <target name="-post-jar"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/> + <!-- + ================= + EXECUTION SECTION + ================= + --> + <target name="run" depends="init,compile" description="Run a main class."> + <j2seproject1:java> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject1:java> + </target> + <target name="run-single" depends="init,compile-single"> + <fail unless="run.class">Must select one file in the IDE or set run.class</fail> + <j2seproject1:java classname="${run.class}"/> + </target> + <!-- + ================= + DEBUGGING SECTION + ================= + --> + <target name="-debug-start-debugger" if="netbeans.home" depends="init"> + <j2seproject1:nbjpdastart name="${debug.class}"/> + </target> + <target name="-debug-start-debuggee" depends="init,compile"> + <j2seproject3:debug> + <customize> + <arg line="${application.args}"/> + </customize> + </j2seproject3:debug> + </target> + <target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/> + <target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init"> + <j2seproject1:nbjpdastart stopclassname="${main.class}"/> + </target> + <target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/> + <target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single"> + <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail> + <j2seproject3:debug classname="${debug.class}"/> + </target> + <target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/> + <target name="-pre-debug-fix" depends="init"> + <fail unless="fix.includes">Must set fix.includes</fail> + <property name="javac.includes" value="${fix.includes}.java"/> + </target> + <target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single"> + <j2seproject1:nbjpdareload/> + </target> + <target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/> + <!-- + =============== + JAVADOC SECTION + =============== + --> + <target name="-javadoc-build" depends="init"> + <mkdir dir="${dist.javadoc.dir}"/> + <javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" additionalparam="${javadoc.additionalparam}" failonerror="true" useexternalfile="true"> + <classpath> + <path path="${javac.classpath}"/> + </classpath> + <sourcepath> + <pathelement location="${src.dir}"/> + </sourcepath> + <packageset dir="${src.dir}" includes="*/**"/> + <fileset dir="${src.dir}" includes="*.java"/> + </javadoc> + </target> + <target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build"> + <nbbrowse file="${dist.javadoc.dir}/index.html"/> + </target> + <target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/> + <!-- + ========================= + JUNIT COMPILATION SECTION + ========================= + --> + <target name="-pre-pre-compile-test" if="have.tests" depends="init,compile"> + <mkdir dir="${build.test.classes.dir}"/> + </target> + <target name="-pre-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test"> + <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}"/> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="**/*.java"/> + </copy> + </target> + <target name="-post-compile-test"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/> + <target name="-pre-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single"> + <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail> + <j2seproject3:javac srcdir="${test.src.dir}" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}"> + <customize> + <patternset includes="${javac.includes}"/> + </customize> + </j2seproject3:javac> + <copy todir="${build.test.classes.dir}"> + <fileset dir="${test.src.dir}" excludes="**/*.java"/> + </copy> + </target> + <target name="-post-compile-test-single"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/> + <!-- + ======================= + JUNIT EXECUTION SECTION + ======================= + --> + <target name="-pre-test-run" if="have.tests" depends="init"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run"> + <j2seproject3:junit/> + </target> + <target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run"> + <fail if="tests.failed">Some tests failed; see details above.</fail> + </target> + <target name="test-report" if="have.tests" depends="init"/> + <target name="-test-browse" if="netbeans.home+have.tests" depends="init"/> + <target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/> + <target name="-pre-test-run-single" if="have.tests" depends="init"> + <mkdir dir="${build.test.results.dir}"/> + </target> + <target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single"> + <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail> + <j2seproject3:junit includes="${test.includes}"/> + </target> + <target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single"> + <fail if="tests.failed">Some tests failed; see details above.</fail> + </target> + <target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/> + <!-- + ======================= + JUNIT DEBUGGING SECTION + ======================= + --> + <target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test"> + <fail unless="test.class">Must select one file in the IDE or set test.class</fail> + <j2seproject3:debug classname="junit.textui.TestRunner" classpath="${debug.test.classpath}"> + <customize> + <arg line="${test.class}"/> + </customize> + </j2seproject3:debug> + </target> + <target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test"> + <j2seproject1:nbjpdastart name="${test.class}" classpath="${debug.test.classpath}"/> + </target> + <target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/> + <target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single"> + <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/> + </target> + <target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/> + <!-- + ========================= + APPLET EXECUTION SECTION + ========================= + --> + <target name="run-applet" depends="init,compile-single"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject1:java classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject1:java> + </target> + <!-- + ========================= + APPLET DEBUGGING SECTION + ========================= + --> + <target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single"> + <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail> + <j2seproject3:debug classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </j2seproject3:debug> + </target> + <target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/> + <!-- + =============== + CLEANUP SECTION + =============== + --> + <target name="deps-clean" depends="init" unless="no.deps"> + <ant target="clean" inheritall="false" antfile="${project.Share}/build.xml"/> + </target> + <target name="-do-clean" depends="init"> + <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 name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/> +</project> Added: trunk/Client/nbproject/genfiles.properties =================================================================== --- trunk/Client/nbproject/genfiles.properties (rev 0) +++ trunk/Client/nbproject/genfiles.properties 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,8 @@ +# 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=c2a3099f +nbproject/build-impl.xml.script.CRC32=a0263979 +nbproject/build-impl.xml.stylesheet.CRC32=99b91518 +nbproject/profiler-build-impl.xml.data.CRC32=c2a3099f +nbproject/profiler-build-impl.xml.script.CRC32=abda56ed +nbproject/profiler-build-impl.xml.stylesheet.CRC32=a5b6598e Added: trunk/Client/nbproject/private/private.properties =================================================================== --- trunk/Client/nbproject/private/private.properties (rev 0) +++ trunk/Client/nbproject/private/private.properties 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,7 @@ +application.args=../ +file.reference.log4j.jar=../lib/log4j/log4j.jar +file.reference.swing-layout.jar=/home/tassilo/Documents/dev/jlink/svn/trunk/lib/other/swing-layout.jar +javac.debug=true +javadoc.preview=true +project.Share=../Share +user.properties.file=/home/tassilo/.netbeans/5.0/build.properties Added: trunk/Client/nbproject/private/profiler/presets.xml =================================================================== --- trunk/Client/nbproject/private/profiler/presets.xml (rev 0) +++ trunk/Client/nbproject/private/profiler/presets.xml 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment></comment> +<entry key="presets.cpufragment.profiler.settings.fragment.selection"></entry> +<entry key="presets.cpupart.profiler.settings.instrumentation.root.methods.size">0</entry> +</properties> Added: trunk/Client/nbproject/profiler-build-impl.xml =================================================================== --- trunk/Client/nbproject/profiler-build-impl.xml (rev 0) +++ trunk/Client/nbproject/profiler-build-impl.xml 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,131 @@ +<?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 + - profiling + - applet profiling + +--> +<project name="-profiler-impl" default="profile" basedir=".."> + <target name="default" depends="profile" description="Build and profile the project."/> + <!-- + ====================== + INITIALIZATION SECTION + ====================== + --> + <target name="profile-init" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check"/> + <target name="-profile-pre-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-profile-post-init"> + <!-- Empty placeholder for easier customization. --> + <!-- You can override this target in the ../build.xml file. --> + </target> + <target name="-profile-init-macrodef-profile"> + <macrodef name="resolve"> + <attribute name="name"/> + <attribute name="value"/> + <sequential> + <property name="@{name}" value="${env.@{value}}"/> + </sequential> + </macrodef> + <macrodef name="profile"> + <attribute name="classname" default="${main.class}"/> + <element name="customize" optional="true"/> + <sequential> + <property environment="env"/> + <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/> + <java fork="true" classname="@{classname}" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}"> + <jvmarg value="${profiler.info.jvmargs.agent}"/> + <jvmarg line="${profiler.info.jvmargs}"/> + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> + <arg line="${application.args}"/> + <classpath> + <path path="${run.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="run-sys-prop."/> + <mapper type="glob" from="run-sys-prop.*" to="*"/> + </syspropertyset> + <customize/> + </java> + </sequential> + </macrodef> + </target> + <target name="-profile-init-check" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile"> + <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail> + <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail> + </target> + <!-- + ================= + PROFILING SECTION + ================= + --> + <target name="profile" if="netbeans.home" depends="profile-init,compile" description="Profile a project in the IDE."> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile/> + </target> + <target name="profile-single" if="netbeans.home" depends="profile-init,compile-single" description="Profile a selected class in the IDE."> + <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile classname="${profile.class}"/> + </target> + <!-- + ========================= + APPLET PROFILING SECTION + ========================= + --> + <target name="profile-applet" if="netbeans.home" depends="profile-init,compile-single"> + <nbprofiledirect> + <classpath> + <path path="${run.classpath}"/> + </classpath> + </nbprofiledirect> + <profile classname="sun.applet.AppletViewer"> + <customize> + <arg value="${applet.url}"/> + </customize> + </profile> + </target> + <!-- + ========================= + TESTS PROFILING SECTION + ========================= + --> + <target name="profile-test-single" if="netbeans.home" depends="profile-init,compile-test-single"> + <nbprofiledirect> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + </nbprofiledirect> + <junit showoutput="true" fork="true" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}" failureproperty="tests.failed" errorproperty="tests.failed"> + <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/> + <jvmarg value="${profiler.info.jvmargs.agent}"/> + <jvmarg line="${profiler.info.jvmargs}"/> + <test name="${profile.class}"/> + <classpath> + <path path="${run.test.classpath}"/> + </classpath> + <syspropertyset> + <propertyref prefix="test-sys-prop."/> + <mapper type="glob" from="test-sys-prop.*" to="*"/> + </syspropertyset> + <formatter type="brief" usefile="false"/> + <formatter type="xml"/> + </junit> + </target> +</project> Added: trunk/Client/nbproject/project.properties =================================================================== --- trunk/Client/nbproject/project.properties (rev 0) +++ trunk/Client/nbproject/project.properties 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,62 @@ +application.args= +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# 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 +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/Client.jar +dist.javadoc.dir=${dist.dir}/javadoc +file.reference.swing-layout.jar=../lib/other/swing-layout.jar +jar.compress=true +javac.classpath=\ + ${reference.Share.jar}:\ + ${file.reference.log4j.jar}:\ + ${file.reference.swing-layout.jar}:\ + ${libs.swing-layout.classpath} +# Space-separated list of extra javac options +javac.compilerargs=-Xlint:unchecked +javac.deprecation=true +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath} +javadoc.additionalparam= +javadoc.author=true +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=org.jlink.ClientMain +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +reference.Share.jar=${project.Share}/dist/Share.jar +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= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src +test.src.dir=test Added: trunk/Client/nbproject/project.xml =================================================================== --- trunk/Client/nbproject/project.xml (rev 0) +++ trunk/Client/nbproject/project.xml 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://www.netbeans.org/ns/project/1"> + <type>org.netbeans.modules.java.j2seproject</type> + <configuration> + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> + <name>Client</name> + <minimum-ant-version>1.6.5</minimum-ant-version> + <source-roots> + <root id="src.dir"/> + </source-roots> + <test-roots> + <root id="test.src.dir"/> + </test-roots> + </data> + <references xmlns="http://www.netbeans.org/ns/ant-project-references/1"> + <reference> + <foreign-project>Share</foreign-project> + <artifact-type>jar</artifact-type> + <script>build.xml</script> + <target>jar</target> + <clean-target>clean</clean-target> + <id>jar</id> + </reference> + </references> + </configuration> +</project> Added: trunk/Client/src/org/jlink/ClientCore.java =================================================================== --- trunk/Client/src/org/jlink/ClientCore.java (rev 0) +++ trunk/Client/src/org/jlink/ClientCore.java 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,231 @@ +/* + * ClientCore.java + * + * Created on 27. Februar 2006, 10:38 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink; + +//import +//import::own +//import::sys +//import::sys::util +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.ArrayBlockingQueue; +//import::sys::log4j +import org.apache.log4j.Logger; + +/** + * + * @author tassilo + */ +public class ClientCore extends Core { + static { + Core.setImpl(new ClientCore()); + } + ClientCore() { + } + + protected Core createCore() { + ClientCore ret = null; + ret = new ClientCore(); + ret.log = Logger.getLogger("jlink.coreD"); + ret.log.debug("Core created"); + //Core::init() + ret.pool_run_now = new ThreadPoolExecutor(6, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new ArrayBlockingQueue(20, true)); + + + //mods::init() + ret.log.debug("creating other modules"); + ret.mod_sound = ClientSound.create(ret); + ret.mod_frontend = ClientFrontend.create(ret); + ret.mod_network = ClientNetwork.create(ret); + + + return ret; + } + protected void runCorePre() { + log.debug("ClientCore::runCorePre() called"); + //start other modules + log.debug("calling other modules"); + this.pool_run_now.submit(new Callable() { + public Object call() throws Exception { + log.info("Sound::run()"); + mod_sound.run(); + return null; + } + }); + this.pool_run_now.submit(new Callable() { + public Object call() throws Exception { + log.info("Network::run()"); + mod_network.run(); + return null; + } + }); + this.pool_run_now.submit(new Callable() { + public Object call() throws Exception { + log.info("Frontend::run()"); + mod_frontend.run(); + return null; + } + }); + } + protected void runCore() throws Exception { + log.trace("ClientCore::run() called"); + Thread.sleep(100); + if(do_connect) { + this.doConnect(); + } + } + protected void runCoreSuf() { + log.debug("ClientCore::runCoreSuf() called"); + + log.debug("destroying other modules"); + this.mod_sound.destroy(); + this.mod_network.destroy(); + + //Core::destroy() + log.debug("self destroy"); + + log.debug("destroy done"); + } + + //Operations + protected void doConnect() throws Exception { + log.debug("Core::do(connect)"); + synchronized(this.serverLock) { + this.do_connect = false; + log.debug("delegating to mod_network"); + this.mod_network.connect(this.serverHost, this.serverPort); + } + } + + + + //Server::(Host|Port) + public String getServerHost() { + return this.serverHost; + } + public void setServerHost(String nhost) { + if(nhost == null) + throw new NullPointerException(); + synchronized(this.serverLock) { + this.serverHost = nhost; + } + } + public int getServerPort() { + return this.serverPort; + } + public void setServerPort(int nport) { + if(nport <= 0) + throw new IllegalStateException("cannot be <= 0"); + synchronized(this.serverLock) { + this.serverPort = nport; + } + } + public void connect() { + log.debug("Core::connect() called"); + if(this.serverConnected) + return;//TODO: throw IllegalStateExc + synchronized(this.serverLock) { + this.do_connect = true; + } + } + public void disconnect() { + if(!this.serverConnected) + return;//TODO: throw IllegalStateExc + synchronized(this.serverLock) { + this.do_disconnect = true; + } + } + + + + //User-Services + public boolean LoggedIn() { + return this.loginActive; + } + public String getLoginName() { + return this.loginName; + } + public String getLoginPassword() { + return this.loginPass; + } + public void setLoginName(String user) { + if(user == null) + throw new NullPointerException(); + this.loginName = user; + } + public void setLoginPassword(String pass) { + if(pass == null) + throw new NullPointerException(); + this.loginPass = pass; + } + public void login() { + this.do_login = true; + } + + + ///////////////////////// + ///////////////////////// + ////private Variables//// + ///////////////////////// + ///////////////////////// + //Composite// + ///////////// + private ClientFrontend mod_frontend = null; + private ClientNetwork mod_network = null; + private ClientSound mod_sound = null; + public ClientFrontend getFrontend() { + return this.mod_frontend; + } + public ClientNetwork getNetwork() { + return this.mod_network; + } + public ClientSound getSound() { + return this.mod_sound; + } + ////////////////// + //external Usage// + ////////////////// + private String serverHost = "localhost"; + private int serverPort = 3470; //port 3470 is the Standard port + private String serverLock = ""; + private boolean serverConnected = false; + + private String loginName = null; + private String loginPass = null; + private boolean loginActive = false; + //////////////////////////////////// + //internal Usage, and for Services// + //////////////////////////////////// + private ExecutorService pool_run_now = null; + private Logger log = null; + //////////////////////////// + //internal operate() flags// + //////////////////////////// + private boolean do_login = false; + private boolean do_connect = false; + private boolean do_disconnect = false; +} Added: trunk/Client/src/org/jlink/ClientFrontend.java =================================================================== --- trunk/Client/src/org/jlink/ClientFrontend.java (rev 0) +++ trunk/Client/src/org/jlink/ClientFrontend.java 2006-03-09 19:30:15 UTC (rev 1) @@ -0,0 +1,258 @@ +/* + * ClientFrontend.java + * + * Created on 27. Februar 2006, 11:48 + * + * JLink: An Introversion Uplink Clone with multiplayer support. + * Copyright (C) 2006 Tassilo Schweyer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +package org.jlink; + +//import +//import::own +import org.jlink.Options; +//import::own::frontend +import org.jlink.client.frontend.MainFrame; +import org.jlink.client.frontend.theme.ThemeManager; +import org.jlink.client.frontend.theme.Theme; +//import::own::gui +import org.jlink.client.gui.MenuBean; +//import::sys +//import::sys::io +import java.io.File; +//import::sys::awt +import java.awt.Toolkit; +import java.awt.Dimension; +import java.awt.Image; +import java.awt.MediaTracker; +import java.awt.event.ActionListener; +... [truncated message content] |