OSDN Git Service

結果を画面表示するようにした.
authoryuki <yuki@bdf3b611-c98c-6041-8292-703d9c9adbe7>
Sun, 6 Jan 2008 17:29:29 +0000 (17:29 +0000)
committeryuki <yuki@bdf3b611-c98c-6041-8292-703d9c9adbe7>
Sun, 6 Jan 2008 17:29:29 +0000 (17:29 +0000)
Java Web Startの設定.

git-svn-id: http://192.168.11.7/svn/repository/NicoBrowser@20 bdf3b611-c98c-6041-8292-703d9c9adbe7

master.jnlp [new file with mode: 0644]
nbproject/build-impl.xml
nbproject/configs/JWS_generated.properties [new file with mode: 0644]
nbproject/genfiles.properties
nbproject/jnlp-impl.xml [new file with mode: 0644]
nbproject/project.properties
nbproject/project.xml
src/nicobrowser/MainWindow.form
src/nicobrowser/MainWindow.java
src/nicobrowser/NicoHttpClient.java
src/nicobrowser/NicoTableModel.java [new file with mode: 0644]

diff --git a/master.jnlp b/master.jnlp
new file mode 100644 (file)
index 0000000..4bd96d2
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jnlp spec="1.0+" codebase="${jnlp.codebase}" href="launch.jnlp">
+    <information>
+        <title>${APPLICATION.TITLE}</title>
+        <vendor>${APPLICATION.VENDOR}</vendor>
+        <description>${APPLICATION.DESC}</description>
+        <description kind="short">${APPLICATION.DESC.SHORT}</description>
+        <homepage href="${APPLICATION.HOMEPAGE}"/>
+<!--${JNLP.ICONS}-->
+<!--${JNLP.OFFLINE.ALLOWED}-->
+    </information>
+<!--${JNLP.SECURITY}-->
+    <resources>
+<!--${JNLP.RESOURCES.RUNTIME}-->
+<!--${JNLP.RESOURCES.MAIN.JAR}-->
+<!--${JNLP.RESOURCES.JARS}-->
+    </resources>
+    <application-desc main-class="${jnlp.main.class}">
+<!--${JNLP.APPLICATION.ARGS}-->
+    </application-desc>
+</jnlp>
index 32a7031..029ef38 100644 (file)
@@ -20,6 +20,7 @@ is divided into following sections:
 \r
         -->\r
 <project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="NicoBrowser-impl">\r
+    <import file="jnlp-impl.xml"/>\r
     <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>\r
     <!-- \r
                 ======================\r
@@ -407,7 +408,7 @@ is divided into following sections:
         <!-- Empty placeholder for easier customization. -->\r
         <!-- You can override this target in the ../build.xml file. -->\r
     </target>\r
-    <target 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." name="jar"/>\r
+    <target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar,jnlp" description="Build JAR." name="jar"/>\r
     <!--\r
                 =================\r
                 EXECUTION SECTION\r
diff --git a/nbproject/configs/JWS_generated.properties b/nbproject/configs/JWS_generated.properties
new file mode 100644 (file)
index 0000000..74df2c1
--- /dev/null
@@ -0,0 +1,4 @@
+#Mon Jan 07 02:20:53 JST 2008\r
+$label=Web Start\r
+$target.debug=jws-debug\r
+$target.run=jws-run\r
index 5ff6031..0260410 100644 (file)
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=66f0bf3c\r
+build.xml.data.CRC32=c5fd47ab\r
 build.xml.script.CRC32=c46c5d81\r
 build.xml.stylesheet.CRC32=be360661\r
 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.\r
 # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.\r
-nbproject/build-impl.xml.data.CRC32=66f0bf3c\r
-nbproject/build-impl.xml.script.CRC32=e5c7442a\r
+nbproject/build-impl.xml.data.CRC32=c5fd47ab\r
+nbproject/build-impl.xml.script.CRC32=9b6e51de\r
 nbproject/build-impl.xml.stylesheet.CRC32=f1d9da08\r
diff --git a/nbproject/jnlp-impl.xml b/nbproject/jnlp-impl.xml
new file mode 100644 (file)
index 0000000..df18b4f
--- /dev/null
@@ -0,0 +1,453 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+
+The contents of this file are subject to the terms of either the GNU
+General Public License Version 2 only ("GPL") or the Common
+Development and Distribution License("CDDL") (collectively, the
+"License"). You may not use this file except in compliance with the
+License. You can obtain a copy of the License at
+http://www.netbeans.org/cddl-gplv2.html
+or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+specific language governing permissions and limitations under the
+License.  When distributing the software, include this License Header
+Notice in each file and include the License file at
+nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
+particular file as subject to the "Classpath" exception as provided
+by Sun in the GPL Version 2 section of the License file that
+accompanied this code. If applicable, add the following below the
+License Header, with the fields enclosed by brackets [] replaced by
+your own identifying information:
+"Portions Copyrighted [year] [name of copyright owner]"
+
+Contributor(s):
+
+The Original Software is NetBeans. The Initial Developer of the Original
+Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
+Microsystems, Inc. All Rights Reserved.
+
+If you wish your version of this file to be governed by only the CDDL
+or only the GPL Version 2, indicate your decision by adding
+"[Contributor] elects to include this software in this distribution
+under the [CDDL or GPL Version 2] license." If you do not indicate a
+single choice of license, a recipient has the option to distribute
+your version of this file under either the CDDL, the GPL Version 2 or
+to extend the choice of license to its licensees as provided above.
+However, if you add GPL Version 2 code and therefore, elected the GPL
+Version 2 license, then the option applies only if the new code is
+made subject to such option by the copyright holder.
+-->
+
+<project name="jnlp-impl" default="default" basedir="..">
+
+    <property name="master.jnlp.file" location="master.jnlp"/>
+    <property name="launch.jnlp.file" value="launch.jnlp"/>
+    <property name="jnlp.dest.dir" location="dist"/>
+    
+    <!-- helper file to create list of arguments, etc. -->
+    <property name="helper.file" location="helper.txt"/>
+    
+    <target name="default">
+        <echo message="Default target is not set."/>
+    </target>
+    
+    <!-- Main target -->
+    
+    <target name="jnlp" depends="-init-check,-test-jnlp-enabled" if="is.jnlp.enabled">
+        <delete file="dist/lib/javaws.jar" failonerror="false"/>
+        <antcall target="generate-jnlp"/>
+    </target>
+    
+    <!-- Generate master -->
+    
+    <target name="-check-for-master.jnlp">
+        <available file="${master.jnlp.file}" property="master.jnlp.exists"/>
+    </target>
+    <target name="jnlp-init-generate-master" depends="-check-for-master.jnlp" unless="master.jnlp.exists">
+        <echo file="${master.jnlp.file}" encoding="UTF-8"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
+<jnlp spec="1.0+" codebase="$${jnlp.codebase}" href="launch.jnlp">
+    <information>
+        <title>$${APPLICATION.TITLE}</title>
+        <vendor>$${APPLICATION.VENDOR}</vendor>
+        <description>$${APPLICATION.DESC}</description>
+        <description kind="short">$${APPLICATION.DESC.SHORT}</description>
+        <homepage href="$${APPLICATION.HOMEPAGE}"/>
+<!--$${JNLP.ICONS}-->
+<!--$${JNLP.OFFLINE.ALLOWED}-->
+    </information>
+<!--$${JNLP.SECURITY}-->
+    <resources>
+<!--$${JNLP.RESOURCES.RUNTIME}-->
+<!--$${JNLP.RESOURCES.MAIN.JAR}-->
+<!--$${JNLP.RESOURCES.JARS}-->
+    </resources>
+    <application-desc main-class="$${jnlp.main.class}">
+<!--$${JNLP.APPLICATION.ARGS}-->
+    </application-desc>
+</jnlp>
+]]></echo>
+    </target>
+    
+    <!-- Initial check -->
+    
+    <target name="-init-check">
+        <fail unless="application.title" message="Must set application title."/>
+        <fail unless="application.vendor" message="Must set application vendor."/>
+    </target>
+    
+    <!-- Icons -->
+    
+    <target name="-init-icons" depends="-preinit-icons,-set-icon-elem,-set-splash-elem">
+        <property name="jnlp.icon.elem" value=""/>
+        <property name="application.splash.elem" value=""/>
+        <property name="icon.separator" value=""/>
+        <property name="jnlp.icons.value" value="${jnlp.icon.elem}${icon.separator}${application.splash.elem}"/>
+    </target>
+    <target name="-preinit-icons" depends="-copy-app-icon,-copy-app-splash"/>
+    <target name="-copy-app-icon" if="jnlp.icon" depends="-get-app-icon-name">
+        <copy file="${jnlp.icon}" todir="${jnlp.dest.dir}" failonerror="false"/>
+        <available file="${jnlp.dest.dir}${file.separator}${jnlp.icon.name}" property="jnlp.icon.copied"/>
+    </target>
+    <target name="-copy-app-splash" if="application.splash" depends="-get-app-splash-name">
+        <copy file="${application.splash}" todir="${jnlp.dest.dir}" failonerror="false"/>
+        <available file="${jnlp.dest.dir}${file.separator}${application.splash.name}" property="application.splash.copied"/>
+    </target>
+    <target name="-get-app-icon-name" if="jnlp.icon">
+        <dirname file="${jnlp.icon}" property="jnlp.icon.basedir"/>
+        <pathconvert property="jnlp.icon.name" setonempty="false">
+            <path location="${jnlp.icon}"/>
+            <map from="${jnlp.icon.basedir}${file.separator}" to=""/>
+        </pathconvert>
+    </target>
+    <target name="-get-app-splash-name" if="application.splash">
+        <dirname file="${application.splash}" property="application.splash.basedir"/>
+        <pathconvert property="application.splash.name" setonempty="false">
+            <path location="${application.splash}"/>
+            <map from="${application.splash.basedir}${file.separator}" to=""/>
+        </pathconvert>
+    </target>
+    <target name="-set-icon-elem" if="jnlp.icon.copied">
+        <property name="jnlp.icon.elem" value='        &lt;icon href="${jnlp.icon.name}" kind="default"/&gt;'/>
+    </target>
+    <target name="-set-splash-elem" if="application.splash.copied" depends="-set-icon-elem">
+        <property name="application.splash.elem" value='        &lt;icon href="${application.splash.name}" kind="splash"/&gt;'/>
+        <condition property="icon.separator" value="${line.separator}">
+            <isset property="jnlp.icon.elem"/>
+        </condition>
+    </target>
+    
+    <!-- Offline-Allowed -->
+    
+    <target name="-init-offline" if="offline.allowed.set" depends="-preinit-offline">
+        <property name="jnlp.offline.allowed.value" value="        &lt;offline-allowed/&gt;"/>
+    </target>
+    <target name="-preinit-offline">
+        <condition property="offline.allowed.set">
+            <equals arg1="${jnlp.offline-allowed}" arg2="true" trim="true"/>
+        </condition>
+    </target>
+    
+    <!-- Descriptions -->
+    
+    <target name="-init-descriptions" depends="-descriptions-props-check,-init-desc-value,-init-desc-value-short">
+        <property name="application.desc.value" value="${application.title}"/>
+        <property name="application.desc.short.value" value="${application.title}"/>
+    </target>
+    <target name="-descriptions-props-check">
+        <condition property="application.desc.set">
+            <and>
+                <isset property="application.desc"/>
+                <not>
+                    <equals arg1="${application.desc}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="application.desc.short.set">
+            <and>
+                <isset property="application.desc.short"/>
+                <not>
+                    <equals arg1="${application.desc.short}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+    </target>
+    <target name="-init-desc-value" if="application.desc.set">
+        <property name="application.desc.value" value="${application.desc}"/>
+    </target>
+    <target name="-init-desc-value-short" if="application.desc.short.set">
+        <property name="application.desc.short.value" value="${application.desc.short}"/>
+    </target>
+    
+    <!-- Security -->
+    
+    <target name="-init-security" depends="-check-signing-possible" if="jnlp.signed.true+signjarstask.available">
+        <property name="jnlp.security" value="    &lt;security&gt;${line.separator}        &lt;all-permissions/&gt;${line.separator}    &lt;/security&gt;"/>
+    </target>
+    <target name="-security-props-check">
+        <condition property="jnlp.signed.true">
+            <istrue value="${jnlp.signed}"/>
+        </condition>
+    </target>
+    <target name="-jnlp-init-keystore" depends="-jnlp-init-keystore-props,-check-keystore-exists" unless="jnlp.signjar.keystore.exists">
+        <echo message="${application.vendor}" file="${helper.file}"/>
+        <loadfile property="application.vendor.filtered" srcfile="${helper.file}">
+            <filterchain>
+                <deletecharacters chars=","/>
+            </filterchain>
+        </loadfile>
+        <delete file="${helper.file}"/>
+        <property name="jnlp.signjar.vendor" value="CN=${application.vendor.filtered}"/>
+        <echo message="Going to create default keystore in ${jnlp.signjar.keystore}"/>
+        <genkey dname="${jnlp.signjar.vendor}" alias="${jnlp.signjar.alias}" keystore="${jnlp.signjar.keystore}"
+            storepass="${jnlp.signjar.storepass}" keypass="${jnlp.signjar.keypass}"/>
+    </target>
+    <target name="-check-keystore-exists">
+        <available property="jnlp.signjar.keystore.exists" file="${jnlp.signjar.keystore}"/>
+    </target>
+    <target name="-jnlp-init-keystore-props">
+        <property name="jnlp.signjar.keystore" value="${basedir}/build/nb-jws.ks"/>
+        <property name="jnlp.signjar.storepass" value="storepass"/>
+        <property name="jnlp.signjar.keypass" value="keypass"/>
+        <property name="jnlp.signjar.alias" value="nb-jws"/>
+    </target>    
+    
+    <!-- Generating JNLP file -->
+    
+    <target name="generate-jnlp" depends="jnlp-init-generate-master,-init-codebase,-init-resources-runtime,-init-security,-init-resources-jars,-init-application-args,-init-icons,-init-offline,-init-descriptions,jnlp-init-notinited">
+        <copy file="${master.jnlp.file}" tofile="${jnlp.dest.dir}/${launch.jnlp.file}__" overwrite="true" encoding="UTF-8">
+            <filterchain>
+                <replacestring from="$${jnlp.codebase}" to="${jnlp.codebase.value}"/>
+                <replacestring from="&lt;!--$${JNLP.ICONS}--&gt;" to="${jnlp.icons.value}"/>
+                <replacestring from="&lt;!--$${JNLP.SECURITY}--&gt;" to="${jnlp.security}"/>
+                <replacestring from="&lt;!--$${JNLP.OFFLINE.ALLOWED}--&gt;" to="${jnlp.offline.allowed.value}"/>
+                <replacestring from="&lt;!--$${JNLP.RESOURCES.RUNTIME}--&gt;" to="${jnlp.resources.runtime.value}"/>
+                <replacestring from="&lt;!--$${JNLP.RESOURCES.MAIN.JAR}--&gt;" to="${jnlp.resources.main.jar.value}"/>
+                <replacestring from="&lt;!--$${JNLP.RESOURCES.JARS}--&gt;" to="${jnlp.resources.jars.value}"/>
+                <replacestring from="&lt;!--$${JNLP.APPLICATION.ARGS}--&gt;" to="${jnlp.application.args.value}"/>
+                <replacestring from="$${APPLICATION.TITLE}" to="${application.title}"/>
+                <replacestring from="$${APPLICATION.VENDOR}" to="${application.vendor}"/>
+                <replacestring from="$${APPLICATION.DESC}" to="${application.desc.value}"/>
+                <replacestring from="$${APPLICATION.DESC.SHORT}" to="${application.desc.short.value}"/>
+                <replacestring from="$${APPLICATION.HOMEPAGE}" to="${application.homepage}"/>
+                <replacestring from="$${jnlp.main.class}" to="${main.class}"/>
+            </filterchain>
+        </copy>
+        <antcall target="-strip-empty-lines"/>
+        <antcall target="-generate-html-page"/>
+    </target>
+    <target name="jnlp-init-notinited">
+        <property name="jnlp.security" value=""/>
+        <property name="jnlp.offline.allowed.value" value=""/>
+        <property name="application.homepage" value=""/>
+        <property name="jnlp.application.args.value" value=""/>
+    </target>
+    <target name="-strip-empty-lines">
+        <move file="${jnlp.dest.dir}/${launch.jnlp.file}__" tofile="${jnlp.dest.dir}/${launch.jnlp.file}" overwrite="true" encoding="UTF-8">
+            <filterchain>
+                <linecontainsregexp>
+                    <regexp pattern=".+"/>
+                </linecontainsregexp>
+            </filterchain>
+        </move>
+    </target>
+    
+    <!-- Codebase processing -->
+    
+    <target name="-init-codebase" depends="-codebase-props-check,-init-non-user-codebase,-init-user-codebase"/>
+    <target name="-codebase-props-check">
+        <condition property="local.codebase">
+            <or>
+                <not>
+                    <isset property="jnlp.codebase.type"/>
+                </not>
+                <equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
+            </or>
+        </condition>
+        <condition property="non.user.codebase">
+            <or>
+                <not>
+                    <isset property="jnlp.codebase.type"/>
+                </not>
+                <equals arg1="${jnlp.codebase.type}" arg2="local" trim="true"/>
+                <equals arg1="${jnlp.codebase.type}" arg2="web" trim="true"/>
+            </or>
+        </condition>
+        <condition property="user.codebase">
+            <equals arg1="${jnlp.codebase.type}" arg2="user" trim="true"/>
+        </condition>
+    </target>
+    <target name="-init-non-user-codebase" if="non.user.codebase">
+        <property name="jnlp.codebase.value" value="${jnlp.codebase.url}"/>
+    </target>
+    <target name="-init-user-codebase" if="user.codebase">
+        <property name="jnlp.codebase.value" value="${jnlp.codebase.user}"/>
+    </target>
+    
+    <!-- j2se resources -->
+    
+    <target name="-init-resources-runtime" depends="-init-runtime-props">
+        <property name="run.jvmargs.value" value=""/>
+        <property name="initial-heap-size.value" value=""/>
+        <property name="max-heap-size.value" value=""/>
+        <property name="jnlp.resources.runtime.value" 
+            value='        &lt;j2se version="${javac.target}+"${initial-heap-size.value}${max-heap-size.value}${run.jvmargs.value}/&gt;'/>
+    </target>
+    <target name="-init-runtime-props" depends="-runtime-props-check,-init-run-jvmargs-value,-init-initial-heap-size-value,-init-max-heap-size-value"/>
+    <target name="-runtime-props-check">
+        <condition property="run.jvmargs.set">
+            <and>
+                <isset property="run.jvmargs"/>
+                <not>
+                    <equals arg1="${run.jvmargs}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="jnlp.initial-heap-size.set">
+            <and>
+                <isset property="jnlp.initial-heap-size"/>
+                <not>
+                    <equals arg1="${jnlp.initial-heap-size}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+        <condition property="jnlp.max-heap-size.set">
+            <and>
+                <isset property="jnlp.max-heap-size"/>
+                <not>
+                    <equals arg1="${jnlp.max-heap-size}" arg2="" trim="true"/>
+                </not>
+            </and>
+        </condition>
+    </target>
+    <target name="-init-run-jvmargs-value" if="run.jvmargs.set">
+        <property name="run.jvmargs.value" value=' java-vm-args="${run.jvmargs}"'/>
+    </target>
+    <target name="-init-initial-heap-size-value" if="jnlp.initial-heap-size.set">
+        <property name="initial-heap-size.value" value=' initial-heap-size="${jnlp.initial-heap-size}"'/>
+    </target>
+    <target name="-init-max-heap-size-value" if="jnlp.max-heap-size.set">
+        <property name="max-heap-size.value" value=' max-heap-size="${jnlp.max-heap-size}"'/>
+    </target>
+    
+    <!-- JAR resources -->
+    
+    <target name="-init-resources-jars" depends="-preinit-resources-unsigned-jars,-preinit-resources-signed-jars,-preinit-resources-main-jar"/>
+    <target name="-preinit-resources-unsigned-jars" depends="-exclude-javaws-from-cp,-check-signing-possible" unless="jnlp.signed.true+signjarstask.available">
+        <pathconvert pathsep="${line.separator}" property="jnlp.resources.jars.value">
+            <path path="${run.classpath.without.javaws.jar}"/>
+            <mapper type="regexp" from="^.*[/\\]([^/\\]+\.jar)"
+                to='        &lt;jar href="lib/\1" download="eager"/&gt;'/>
+        </pathconvert>
+    </target>
+    <target name="-preinit-resources-main-jar">
+        <pathconvert pathsep="${line.separator}" property="jnlp.resources.main.jar.value">
+            <path location="${dist.jar}"/>
+            <mapper type="regexp" from="^.*[/\\]([^/\\]+\.jar)"
+                to='        &lt;jar href="\1" main="true" download="eager"/&gt;'/>
+        </pathconvert>
+    </target>
+    <target name="-exclude-javaws-from-cp">
+        <pathconvert property="path.element.to.be.removed">
+            <path path="${run.classpath}"/>
+            <mapper type="regexp" from="(^.*[/\\]javaws.jar)" to="\1"/>
+        </pathconvert>
+        <pathconvert property="run.classpath.without.javaws.jar">
+            <path path="${run.classpath}"/>
+            <map from="${path.element.to.be.removed}" to=""/>
+        </pathconvert>
+    </target>
+    <target name="-check-task-available">
+        <condition property="signjarstask.available">
+            <isset property="netbeans.home"/>
+        </condition>
+    </target>
+    <target name="-check-signing-possible" depends="-security-props-check,-check-task-available">
+        <condition property="jnlp.signed.true+signjarstask.available">
+            <and>
+                <isset property="jnlp.signed.true"/>
+                <isset property="signjarstask.available"/>
+            </and>
+        </condition>
+    </target>
+    <target name="-unavailable-task-warning" depends="-check-task-available" unless="signjarstask.available">
+        <echo message="Signtask is not available, jar files will not be signed. Task is available only when running inside NetBeans IDE."/>
+    </target>
+    <target name="-preinit-resources-signed-jars" depends="-unavailable-task-warning,-sign-jars" if="jnlp.signed.true+signjarstask.available">
+        <property name="jnlp.resources.jars.value" value="${jnlp.signed.jars}${jnlp.components}"/>
+    </target>
+    <target name="-sign-jars" depends="-jnlp-init-keystore,-check-signing-possible" if="jnlp.signed.true+signjarstask.available">
+        <jnlpsignjars keystore="${jnlp.signjar.keystore}" storepass="${jnlp.signjar.storepass}" 
+                keypass="${jnlp.signjar.keypass}" alias="${jnlp.signjar.alias}" mainjar="${dist.jar}" destdir="dist"
+                codebase="${jnlp.codebase.value}" signedjarsprop="jnlp.signed.jars"
+                componentsprop="jnlp.components">
+            <fileset dir="dist/lib">
+                <include name="*.jar"/>
+            </fileset>
+        </jnlpsignjars>
+    </target>
+    
+    <!-- Application arguments -->
+    
+    <target name="-init-application-args" if="application.args">
+        <echo message="${application.args}" file="${helper.file}"/>
+        <loadfile srcfile="${helper.file}" property="jnlp.application.args.value">
+            <filterchain>
+                <tokenfilter delimoutput="\n">
+                    <stringtokenizer/>
+                    <replaceregex pattern="(.+)" replace="        &lt;argument&gt;\1&lt;/argument&gt;"/>
+                </tokenfilter>
+            </filterchain>
+        </loadfile>
+        <delete file="${helper.file}"/>
+    </target>
+    
+    <!-- Running/Debugging -->
+    
+    <target name="jws-run" depends="jar,-verify-jnlp-enabled,-verify-codebase" description="Start javaws execution">
+        <exec executable="${java.home}/bin/javaws">
+            <arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
+        </exec>
+    </target>
+    <target name="jws-debug" if="netbeans.home" depends="jar,-verify-jnlp-enabled,-verify-codebase,-debug-start-debugger,-debug-javaws-debuggee" 
+        description="Debug javaws project in IDE"/>
+    <target name="-debug-javaws-debuggee">
+        <exec executable="${java.home}/bin/javaws">
+            <env key="JAVAWS_VM_ARGS" value="-Xdebug -Xnoagent -Djava.compiler=none -Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+            <arg file="${jnlp.dest.dir}/${launch.jnlp.file}"/>
+        </exec>
+    </target>
+    <target name="-verify-codebase" depends="-codebase-props-check" unless="local.codebase">
+        <fail message="Project cannot be run with non-local codebase. Open project properties dialog and set Web Start Codebase to Local Execution."/>
+    </target>
+    <target name="-verify-jnlp-enabled" depends="-test-jnlp-enabled" unless="is.jnlp.enabled">
+        <fail message="Project cannot be run with selected Run Configuration when Java Web Start is disabled."/>
+    </target>
+    
+    <!-- Test JNLP enabled-->
+    
+    <target name="-test-jnlp-enabled">
+        <condition property="is.jnlp.enabled">
+            <equals arg1="${jnlp.enabled}" arg2="true" casesensitive="false" trim="true"/>
+        </condition>
+    </target>
+    
+    <!-- Generate simple HTML test page -->
+    
+    <target name="-generate-html-page">
+        <echo file="${jnlp.dest.dir}/launch.html"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+    <head>
+        <title>Test page for launching the application via JNLP</title>
+    </head>
+    <body>
+        <h3>Test page for launching the application via JNLP</h3>
+        <a href="launch.jnlp">Launch the application</a>
+    </body>
+</html>
+]]></echo>
+    </target>
+    
+</project>
index d8879aa..7bd07a1 100644 (file)
@@ -1,3 +1,6 @@
+application.homepage=http://feather.cocolog-nifty.com/\r
+application.title=DEMO:\u30cb\u30b3\u30cb\u30b3\u52d5\u753bRSS\u30d6\u30e9\u30a6\u30b6\r
+application.vendor=yukihane\r
 build.classes.dir=${build.dir}/classes\r
 build.classes.excludes=**/*.java,**/*.form\r
 # This directory is removed when the project is cleaned:\r
@@ -43,6 +46,11 @@ javadoc.splitindex=true
 javadoc.use=true\r
 javadoc.version=false\r
 javadoc.windowtitle=\r
+jnlp.codebase.type=user\r
+jnlp.codebase.user=http://www.example.com\r
+jnlp.enabled=true\r
+jnlp.offline-allowed=false\r
+jnlp.signed=true\r
 # Property libs.Codec.classpath is set here just to make sharing of project simpler.\r
 # The library definition has always preference over this property.\r
 libs.Codec.classpath=../../../java/commons/commons-codec-1.3/commons-codec-1.3.jar\r
index c5be844..ae68a6a 100644 (file)
@@ -2,6 +2,11 @@
 <project xmlns="http://www.netbeans.org/ns/project/1">\r
     <type>org.netbeans.modules.java.j2seproject</type>\r
     <configuration>\r
+        <buildExtensions xmlns="http://www.netbeans.org/ns/ant-build-extender/1">\r
+            <extension file="jnlp-impl.xml" id="jws">\r
+                <dependency dependsOn="jnlp" target="jar"/>\r
+            </extension>\r
+        </buildExtensions>\r
         <data xmlns="http://www.netbeans.org/ns/j2se-project/3">\r
             <name>NicoBrowser</name>\r
             <minimum-ant-version>1.6.5</minimum-ant-version>\r
index fee150a..3902b21 100644 (file)
@@ -24,9 +24,9 @@
           <Group type="102" alignment="0" attributes="0">
               <EmptySpace max="-2" attributes="0"/>
               <Group type="103" groupAlignment="0" attributes="0">
-                  <Component id="jScrollPane1" alignment="1" pref="512" max="32767" attributes="0"/>
-                  <Component id="jPanel2" alignment="0" min="-2" max="-2" attributes="0"/>
-                  <Component id="jPanel1" alignment="0" min="-2" max="-2" attributes="0"/>
+                  <Component id="jScrollPane1" alignment="1" pref="755" max="32767" attributes="0"/>
+                  <Component id="jPanel1" alignment="0" min="-2" max="-2" attributes="1"/>
+                  <Component id="jPanel2" alignment="0" min="-2" max="-2" attributes="1"/>
               </Group>
               <EmptySpace max="-2" attributes="0"/>
           </Group>
@@ -36,7 +36,7 @@
       <Group type="103" groupAlignment="0" attributes="0">
           <Group type="102" alignment="1" attributes="0">
               <EmptySpace max="-2" attributes="0"/>
-              <Component id="jScrollPane1" pref="256" max="32767" attributes="0"/>
+              <Component id="jScrollPane1" pref="395" max="32767" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
               <Component id="jPanel1" min="-2" max="-2" attributes="0"/>
               <EmptySpace max="-2" attributes="0"/>
@@ -89,7 +89,9 @@
                   <EmptySpace max="-2" attributes="0"/>
                   <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
-                  <Component id="listNoField" pref="96" max="32767" attributes="0"/>
+                  <Component id="listNoField" min="-2" pref="70" max="-2" attributes="0"/>
+                  <EmptySpace pref="52" max="32767" attributes="0"/>
+                  <Component id="clearButton" min="-2" max="-2" attributes="0"/>
                   <EmptySpace max="-2" attributes="0"/>
               </Group>
           </Group>
                       <Component id="loadButton" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
                       <Component id="listNoField" alignment="3" min="-2" max="-2" attributes="0"/>
+                      <Component id="clearButton" alignment="3" min="-2" max="-2" attributes="0"/>
                   </Group>
                   <EmptySpace max="32767" attributes="0"/>
               </Group>
         </Component>
         <Component class="javax.swing.JTextField" name="listNoField">
           <Properties>
-            <Property name="text" type="java.lang.String" value="4315046"/>
+            <Property name="text" type="java.lang.String" value="1923688"/>
           </Properties>
         </Component>
+        <Component class="javax.swing.JButton" name="clearButton">
+          <Properties>
+            <Property name="text" type="java.lang.String" value="Clear"/>
+          </Properties>
+          <Events>
+            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="clearButtonActionPerformed"/>
+          </Events>
+        </Component>
       </SubComponents>
     </Container>
     <Container class="javax.swing.JPanel" name="jPanel1">
index d39e9d7..979bad0 100644 (file)
@@ -6,6 +6,7 @@
  */
 package nicobrowser;
 
+import java.awt.Component;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.List;
@@ -14,7 +15,14 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.swing.ImageIcon;
 import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableColumnModel;
 import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
 
 /**
  *
@@ -35,10 +43,61 @@ public class MainWindow extends javax.swing.JFrame {
     }
     private static final String COLUMN_NAMES[] = {"サムネイル", "タイトル", "説明", "ページリンク"};
     private DefaultTableModel tableModel = new MyTableModel(COLUMN_NAMES, 0);
-
+    // private DefaultTableModel tableModel = new NicoTableModel;
     /** Creates new form MainWindow */
     public MainWindow() {
         initComponents();
+        TableCellRenderer textAriaRenderer = new DefaultTableCellRenderer() {
+
+            @Override
+            public Component getTableCellRendererComponent(JTable table,
+                    Object value,
+                    boolean isSelected,
+                    boolean hasFocus,
+                    int row,
+                    int column) {
+                JTextArea comp = new JTextArea(value.toString());
+                comp.setLineWrap(true);
+                return comp;
+            }
+        };
+        TableCellRenderer buttonRenderer = new DefaultTableCellRenderer() {
+
+            @Override
+            public Component getTableCellRendererComponent(JTable table,
+                    Object value,
+                    boolean isSelected,
+                    boolean hasFocus,
+                    int row,
+                    int column) {
+                String[] splitted = value.toString().split("/");
+                String text = "";
+                if (splitted.length > 0) {
+                    text = splitted[splitted.length - 1];
+                }
+                JButton comp = new JButton(text);
+                return comp;
+            }
+        };
+
+        DefaultTableColumnModel cMoldel = (DefaultTableColumnModel) jTable1.getColumnModel();
+        TableColumn c;
+        c = cMoldel.getColumn(1);
+        c.setCellRenderer(textAriaRenderer);
+        c = cMoldel.getColumn(2);
+        c.setCellRenderer(textAriaRenderer);
+        c = cMoldel.getColumn(3);
+        c.setCellRenderer(buttonRenderer);
+
+        c = cMoldel.getColumn(0);
+        c.setPreferredWidth(130);
+        c = cMoldel.getColumn(1);
+        c.setPreferredWidth(100);
+        c = cMoldel.getColumn(2);
+        c.setPreferredWidth(400);
+        c = cMoldel.getColumn(3);
+        c.setPreferredWidth(110);
+
     }
 
     /** This method is called from within the constructor to
@@ -55,6 +114,7 @@ public class MainWindow extends javax.swing.JFrame {
         loadButton = new javax.swing.JButton();
         jLabel3 = new javax.swing.JLabel();
         listNoField = new javax.swing.JTextField();
+        clearButton = new javax.swing.JButton();
         jPanel1 = new javax.swing.JPanel();
         jLabel1 = new javax.swing.JLabel();
         jLabel2 = new javax.swing.JLabel();
@@ -80,7 +140,14 @@ public class MainWindow extends javax.swing.JFrame {
 
         jLabel3.setText("ListNo");
 
-        listNoField.setText("4315046");
+        listNoField.setText("1923688");
+
+        clearButton.setText("Clear");
+        clearButton.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                clearButtonActionPerformed(evt);
+            }
+        });
 
         javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
         jPanel2.setLayout(jPanel2Layout);
@@ -92,7 +159,9 @@ public class MainWindow extends javax.swing.JFrame {
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jLabel3)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
-                .addComponent(listNoField, javax.swing.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE)
+                .addComponent(listNoField, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
+                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE)
+                .addComponent(clearButton)
                 .addContainerGap())
         );
         jPanel2Layout.setVerticalGroup(
@@ -102,7 +171,8 @@ public class MainWindow extends javax.swing.JFrame {
                 .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                     .addComponent(loadButton)
                     .addComponent(jLabel3)
-                    .addComponent(listNoField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                    .addComponent(listNoField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(clearButton))
                 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
 
@@ -164,16 +234,16 @@ public class MainWindow extends javax.swing.JFrame {
             .addGroup(layout.createSequentialGroup()
                 .addContainerGap()
                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
-                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE)
-                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
-                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
+                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 755, Short.MAX_VALUE)
+                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                 .addContainerGap())
         );
         layout.setVerticalGroup(
             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                 .addContainerGap()
-                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE)
+                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@@ -191,7 +261,7 @@ public class MainWindow extends javax.swing.JFrame {
         List<NicoContent> contList = NicoHttpClient.getInstance().loadMyList(listNo);
         int rowHeight = -1;
         for (NicoContent cont : contList) {
-            Vector v = new Vector();
+            Vector<Object> v = new Vector<Object>();
             ImageIcon icon = new ImageIcon();
             try {
                 icon = new ImageIcon(new URL(cont.getImageLink()));
@@ -220,6 +290,13 @@ public class MainWindow extends javax.swing.JFrame {
         NicoHttpClient.getInstance().login(mail, password);
 }//GEN-LAST:event_loginButtonActionPerformed
 
+    private void clearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearButtonActionPerformed
+        int num = tableModel.getRowCount();
+        for (int i = num - 1; i >= 0; i--) {
+            tableModel.removeRow(i);
+        }
+}//GEN-LAST:event_clearButtonActionPerformed
+
     /**
      * @param args the command line arguments
      */
@@ -232,6 +309,7 @@ public class MainWindow extends javax.swing.JFrame {
         });
     }
     // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JButton clearButton;
     private javax.swing.JLabel jLabel1;
     private javax.swing.JLabel jLabel2;
     private javax.swing.JLabel jLabel3;
index e6eb26a..e3f282a 100644 (file)
@@ -206,7 +206,7 @@ public class NicoHttpClient extends HttpClient {
             }
         }
 
-        List contList = new ArrayList<NicoContent>();
+        List<NicoContent> contList = new ArrayList<NicoContent>();
 
         for (SyndEntryImpl entry : list) {
             NicoContent content = new NicoContent();
diff --git a/src/nicobrowser/NicoTableModel.java b/src/nicobrowser/NicoTableModel.java
new file mode 100644 (file)
index 0000000..01e71c8
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package nicobrowser;
+
+import java.awt.Component;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JTable;
+import javax.swing.JTextArea;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+
+/**
+ *
+ * @author yuki
+ */
+public class NicoTableModel extends DefaultTableModel {
+
+    private static final ColumnContext[] COLUMN_CONTEXT = {
+        new ColumnContext("サムネイル", ImageIcon.class),
+        new ColumnContext("タイトル", String.class),
+        new ColumnContext("説明", JTextArea.class),
+        new ColumnContext("リンク", JButton.class)
+    };
+
+    private static class ColumnContext {
+
+        private String columnName;
+        private Class renderer;
+
+        private ColumnContext(String columnName, Class renderer) {
+            this.columnName = columnName;
+            this.renderer = renderer;
+        }
+    }
+
+    static class MyCellRender extends DefaultTableCellRenderer {
+
+        @Override
+        public Component getTableCellRendererComponent(
+                JTable table, Object value,
+                boolean isSelected, boolean hasFocus, int row, int column) {
+            if (isSelected) {
+                table.setForeground(table.getSelectionForeground());
+                table.setBackground(table.getSelectionBackground());
+            } else {
+                table.setForeground(table.getForeground());
+                table.setBackground(table.getBackground());
+            }
+
+            //setFont(table.getFont());
+
+            try {
+                Object obj = COLUMN_CONTEXT[column].renderer.newInstance();
+
+
+                return (Component) obj;
+            } catch (InstantiationException ex) {
+                Logger.getLogger(NicoTableModel.class.getName()).log(Level.SEVERE, null, ex);
+            } catch (IllegalAccessException ex) {
+                Logger.getLogger(NicoTableModel.class.getName()).log(Level.SEVERE, null, ex);
+            }
+            return null;
+
+
+        }
+    }
+
+    public NicoTableModel() {
+        super();
+        for (ColumnContext c : COLUMN_CONTEXT) {
+            addColumn(c.columnName);
+        }
+        TableColumn column;
+        
+        
+    }
+
+    @Override
+    public Class<?> getColumnClass(int columnIndex) {
+        return COLUMN_CONTEXT[columnIndex].renderer;
+
+    }
+
+    @Override
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+        return false;
+    }
+}