An excellent platform independent
vector drawing gift for you!
 
Frequently Asked Questions
Home Products Download Documentations Order Now Contact  
 
 
FAQs
Quick Install
Developer Guide
ScreenShots
 
 Featured Sites
    Java.net
    AbleStable
    Softpedia
    FreeTrialSoft
    FreshMeat
    Download32
 

  Questions about JFDraw


  General

  Developers

  JFDraw Web Start Solution

  JFDraw Applet Solution

 

  Answers


  General

What is JFDraw?  Back to top

JFDraw is a vector based application and library package. It is used in vector graph drawing field, especially in architectural, electronic,mechanical graphs, or even in datagrams or business workflows.

Who will use JFDraw?  Back to top

JFDraw was designed to meet different users' demands. It can be used both in end user or developer user case. JFDraw will be released as three major formats for different purposes.

  • End user executable jar file, this is a release version for end users who are interested in building some vector graphs;
     
  • Developer binary library files and API documentations. This is for developers who want to incorporate JFDraw into their applications;
     
  • Developer source code files and API documentations. This is a totally source code version of JFDraw, so developers can easily look into JFDraw's source architecture and enhance its functions in their own fields.
     

Which OS that JFDraw supports?  Back to top

JFDraw is a pure java based application, so it can run under any operating system that supports java. We recommend you install JDK/JRE 1.4 or above on your machine before you run JFDraw. For MAC OSX users, JRE 1.4 is pre-installed already.

Is JFDraw completely free?  Back to top

Sure. We released a JFDraw free version now for users who are interested in java vector graph drawing. You can use it as a free graph tool, to complete your vector graphs, and export it as a JFD binary format file, or some popular image formats and print your graphs within JFDraw. And also, redistribute JFDraw Free Version is permitted by JingFei International.

We also supply a commercial copy of JFDraw binary library or source code for developers.

What about a jfdraw.jar file?  Back to top

jfdraw.jar file is an executable release version of JFDraw. It's an environment independent java package, so you can run it or incorporate it into your application anywhere.

jfdraw.jar can be downloaded here. If you have downloaded jfdraw.zip, just use a common unzip tool to extract jfdraw.jar from jfdraw.zip package. Or you can unpack jfdraw.zip under console prompt mode like below(assume you have installed JDK/JRE on your machine):

Prompt> jar xvf jfdraw.zip

What about a jfdraw.jnlp file?   Back to top

jfdraw.jnlp file is a web start script file for Java Web Start, it's an UNICODE text file, we use this JNLP file to web start JFDraw. If you have not already installed Java Web Start on your machine, your browser may not recognize this JNLP file, so it will simply download this file and give you a suprise--My god, a strange file with nothing.

How can I run JFDraw?  Back to top

There are several easy ways to run JFDraw:

  • By double click jfdraw.jar in your file system, if you have installed JDK/JRE in your machine.
  • Run command below under console prompt mode:
     
    Prompt> java -jar jfdraw.jar
     
  • Web start JFDraw online. If you have installed Java Web Start(Java Web Start is included in JDK/JRE 1.4.x or above), just enter url below in your browser to web start JFDraw.
    http://www.jfimagine.com/download/jfdraw.jnlp
By the way, if you really confused about how to install and run JFDraw, please read Quick Manual before you do it.

Can I release an online web start JFDraw like you have done?  Back to top

Absolutely. To redistribute JFDraw free version is permitted by JingFei International. Before you start to do that, you need a little knowledges about Java Web Start. The major things you need to do are:

  • You need a jnlp file, such as a jfdraw.jnlp at jfimagine.com website,then modify some content of jfdraw.jnlp,please notice that a jnlp file is just an Unicode text file.
     
  • You need a small startup jpg or gif image, so you can get an image icon when your Java Web Start tool startup,
     
  • You would have ability to add a new JNLP mime type(application/x-java-jnlp-file) into your web server, or you can ask your ISP's permission to do that,
     
  • You do need a jfdraw.jar file, sure you can download it simply from jfimagine.com website.
     
You can also go to see our JFDraw Web Start Solution for furthur informations. If you still have troubles on this topic, please consult support at JingFei International for details.

  Developers

Can I use a downloaded jfdraw.jar as a binary library?  Back to top

No, you can't. Since JFDraw is released as a free end user tool, it is encrypted and can not be referenced as a binary library.

If you want to use JFDraw as a binary library, you need to order a binary library copy or you can ask support at JingFei International for further informations.

Can I incorporate JFDraw into my JBuilder,Visual Age or Eclipse projects?  Back to top

Absolutely. Since JFDraw was written by pure text based editor , compiled by JDK and Apache ant, you can simply integrate it into your projects. No matter if you are using JBuilder,Visual Age,Eclipse or any other similar IDEs.

Do I need enough computer graphics or Java2D knowledges to start my vector graphics project that based on JFDraw?  Back to top

The answer is no. JFDraw has completed a variety type of basic graphic routines. So you can easily start your own project based on JFDraw. If there would be some troubles, please ask support at JingFei International for further technical support.

  JFDraw Web Start Solution

What's a JFDraw Web Start Solution?  Back to top

A JFDraw Web Start Solution is designed for users who are interested in building a web based vector graph library. Now it's possible by JFDraw Web Start Solution.

Just follow the JFDraw Web Start Solution page,you are now allowed to build such static or dynamic vector graph libraries without experienced web technologies.

Is it really supported by any popular web technologies?  Back to top

Absolutely! First of all, such a JFDraw Web Start application can be deployed under any major web servers, such as Internet Information Server(MS-IIS), Apache web server, Tomcat web server and etc.The only work you need to do is to add a new mime type,

And then, since JFDraw Web Start Solution is focused at a regular automatic HTTP Response, you can easily use your favorite programming tool, such as jsp/servlet, java script, vb script, c#, perl, cgi and etc. to build such a dynamic HTTP response.

How can I transfer a file name as a parameter to JFDraw?  Back to top

Below are two methods you can transfer a parameter(file name) in your WEB PAGES to JNLP(JFDraw) files. You can go to see its actions at JFDraw Web Start Solution.

  • One method is to use a static link, such as the Static Demo has done, When you press "Launch It" there would be a hyper-link such as http://www.jfimagine.com/webstart/webstart.jsp?fileName=http://www.jfimagine.com/webstart/mechanical.jfd under "Launch it". The background routine,http://www.jfimagine.com/webStart, is a very simple routine that is used to generate a dynamic JNLP http response with the file name parameter included, so the client machine can get a reference of the file name(http://www.jfimagine.com/webstart/mechanical.jfd) as soon as JFDraw startup.
     
  • The second method, as you know at the Dynamic Demo is almost a same solution as the static demo above. It uses a html form to dynamically pass the four text boxes' value,fileName,fileName2, fileName3 and fileName4 to the http://www.jfimagine.com/webstart/webstart.jsp routine, then dynamically generate a JNLP http response to tell the client machine to download and start JFDraw application, and load the four files(fileName,fileName2,fileName3 and fileName4) if specified.
     
And also, you can transfer a URL file name directly to JFDraw at client machine side, other than the transfer method descibed above.
  • First of all, download the jfdraw_webstart.jar file to your local machine,
     
  • then under command prompt box, go to the directory the file jfdraw_webstart.jar located, type the command below:

    java -jar jfdraw_webstart.jar http://www.jfimagine.com/webstart/datagram.jfd

    The command above would run JFDraw in your local machine, and concurrently load the JFD file at http://www.jfimagine.com/webstart/datagram.jfd.

Dynamic JNLP http response?What's that?  Back to top

A dynamic JNLP http response can be generated by a normal web languages, then send it to client browser by server, as soon as you transfer some data to http://www.jfimagine.com/webStart routine. You can view or download the source code of webstart routine in java/servlet and jsp now.

The format of a JFDraw JNLP http response text will like below:

 
<!---------------------JFDraw JNLP http response start--------------------->
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+"  codebase="http://www.jfimagine.com/webstart">
     <information>    
         <title>JFDraw Web Start Solution</title>    
         <vendor>JingFei International Cooperation LTD.</vendor>    
         <homepage href="http://www.jfimagine.com"/>    
         <description>JFDraw Web Start Solution</description>    
         <description kind="short">A vector graphs application and library package</description>
         <icon href="jfimagine.small.jpg"/>     
         <offline-allowed/>
     </information>
     <resources>
         <j2se version="1.4+" />   
         <jar href="jfdraw_webstart.jar"/>
     </resources>
     <application-desc main-class="JFDraw">
         <argument>http://www.jfimagine.com/webstart/mechanical.jfd</argument>
         <argument>http://www.jfimagine.com/webstart/datagram.jfd</argument>
     </application-desc>
     <security>    
         <all-permissions/>
     </security>
 </jnlp>
<!---------------------JFDraw JNLP http response end--------------------->

The major factors/parameters to generate such a dynamic JNLP file are:

  • codebase="http://www.jfimagine.com/webstart", you can change this codebase directory to another url in your own web server. you need to place the two files, jfdraw_webstart.jar and jfimagine.small.jpg under this directory.
    Note: the code base, http://www.jfimagine.com/webstart is just a directory, not the routine name webStart, they're different.
     
  • You can write such a webStart routine use your own web languages,when you start to generate such a jnlp text http response, notice to set the header content type of http response as "application/x-java-jnlp-file". and the encode type of http response would be 'UTF-8'.
    and, you'd better to the set the http header expires immediately, or please always set a new date-time for the response.So the browser will be forced to fetch jnlp content each time.

    In jsp/servlet, the setup for response would like below:

    response.setContentType("application/x-java-jnlp-file");
    response.setHeader("Expires", "0");
    response.addDateHeader("Date", java.util.Calendar.getInstance().getTime().getTime());
    response.addDateHeader("Last-Modified", java.util.Calendar.getInstance().getTime().getTime());

     
  • The arguments in JNLP. such as:

    <argument>http://www.jfimagine.com/webstart/mechanical.jfd</argument>
    <argument>http://www.jfimagine.com/webstart/datagram.jfd</argument>

    These arguments are the file names you transfer from web pages to JFDraw, now it would be re-packaged between <argument></argument> elements, each file name would occupy one line of <argument></argument> pair.
     
  • by the way, a local file path(the file will be in client local machine), or an UNC file path (the file will be in local network)are also supported by JFDraw, you can try to package such a file name in <argument> element pair. But notice that only specified local machine can access such files in JFDraw.
     
  • Never forget to add a new JNLP mime type(application/x-java-jnlp-file)into your web server and restart web server before you doing these all above.
     
You can view or download the source code of webstart routine in java/servlet and jsp now.

How can I add a JNLP MIME type to my web server?  Back to top

Let us take a look at a MIME type first. A MIME type will tell the web server what kind of file is associated with a particular extension. For example, the type image/gif is associated with gif graphics, and application/x-zip-compressed is accociated with a zip compressed package.

Ok, now you know, the Java Web start MIME type is an application/x-java-jnlp file,and the jnlp extension is associated with this file type.

The process of setting up a new MIME type varies, depending on the type of Web server.

Apache Web Server:

To configure Apache server, change to the conf directory in the server's home directory. For example, in the conf director (/home/apache/conf.) there is a file called mime.types. Edit this file by adding the line:

application/x-java-jnlp-file jnlp

After adding this line, restart your apache web server.

Tomcat Web Server:

To configure Tomcat web server, change to the conf directory in the server's home directory. For example, in the conf director (/home/tomcat/conf.) Edit the file web.xml by adding lines below:

<mime-mapping>
         <extension>jnlp</extension>
         <mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>

Restart your tomcat server after adding lines above.

Windows 2000 Internet Information Services (IIS):

To configure IIS, start the IIS Management Console and perform the following steps:

  • Right-click server computer in left pane, then select Properties from the drop-down menu.
     
  • In the 'Computer MIME Map' click the Edit button.
     
  • The File Types window is displayed. Click New Type.
     
  • In the File Type box, enter the following in the Associated Extension edit box: jnlp
     
  • In the Content Type (MIME) box, enter: application/x-java-jnlp-file
     
  • Click Ok to close the File Type box. Click Ok again to close the File Types Window. Click Ok in the Server properties window to save the changes.
     
  • Restart the IIS Admin Service.
     
Note: Sometimes client side Java Web Start can't download JNLP files from your IIS server probably, or the IIS server requests extra authentication to prevent you downloading JNLP files. In that case, there maybe some mistakes in your proxy configuration.
  • Maybe your proxy settings has something wrong, use the java web start manager to set correctly proxy settings.
     
  • Old Java web start may not support NTLM authentification in microsoft proxy, we recommend you to use web start within JDK/JRE 1.4.2(or above), or you can use "proxy ntlm", a little software written in python, to pass NTLM authentification.

  

  JFDraw Applet Solution  Back to top

 

What's an JFDraw Applet Solution?  Back to top

A JFDraw Applet Solution is a totally Java Applet like solution for everyone who are interested in building such a web based vector graph drawing application, other than a JWS JFDraw solution.

Just follow the JFDraw Applet Solution page,you are now allowed to build such a static or dynamic vector graph libraries without experienced web technologies.

Can I make such a JFDraw Applet myself?  Back to top

Sure, you can build such a JFDraw applet yourself on your website. To redistribute such a free version of JFDraw Applet is also free.

You may need the JFDraw applet jar package, and write some codes in your HTML page to load this jar library as soon as the page is opened. Add the applet codes below into your HTML page:

<applet code="JFDrawApplet.class"
width="600" height="450"
archive="jfdraw_applet.jar">
</applet>

A complete JFDraw applet sample is now available for download. Also, you can go to run this applet online at JFDraw Applet Solution page

How can I transfer a file name as a parameter to JFDraw Applet?  Back to top

To transfer a file name as a parameter to JFDraw Applet is quite easy. Just look into codes below for detail, (Note: do not forget to download another demo version of parameter driven JFDraw applet library ):

<applet code="JFDrawApplet.class"
width="600" height="450"
archive="jfdraw_para.jar">

<param name=file1 value="http://www.jfimagine.com/webstart/datagram.jfd">
</applet>

Also, you can go to run this parameter driven applet online at JFDraw Applet Solution page

Dynamic parameters transfering to JFDraw Applet?  Back to top

If you use some regular web technologies(asp/jsp/php/perl/cgi,etc), you can easily build such a dynamic parameter transfering to JFDraw applet now, just have a look at the codes below(in jsp), (Note: do not forget to download another demo version of parameter driven JFDraw applet library ):

<applet code="JFDrawApplet.class"
width="600" height="450"
archive="jfdraw_para.jar">

<param name=file1 value="<%=request.getParameter("file1")%>">
</applet>

Also, you can go to run this parameter driven applet online at JFDraw Applet Solution page

 

COPYRIGHT 2004 - 2005 JingFei International Cooperation LTD. - ALL RIGHTS RESERVED
WEBMASTER: WebMaster@jfimagine.com