URL:
  <http://gna.org/task/?6114>

                 Summary: Submission of UTF8 Java entering tool
                 Project: Gna! Administration
            Submitted by: jkark
            Submitted on: Tuesday 07/29/08 at 11:43
                  Status: None
         Approval Status: None
         Should Start On: Tuesday 07/29/08 at 00:00
   Should be Finished on: Friday 08/08/08 at 00:00
                Category: Project Approval
                Priority: 5 - Normal
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

A new project has been registered at Gna! 
This project account will remain inactive until a site admin approves or
discards the registration.


= Registration Administration =

While this item will be useful to track the registration process, *approving
or discarding the registration must be done using the specific Group
Administration <https://gna.org/siteadmin/groupedit.php?group_id=2735> page*,
accessible only to site administrators, effectively *logged as site
administrators* (superuser):

* Group Administration
<https://gna.org/siteadmin/groupedit.php?group_id=2735>


= Registration Details =

* Name: *UTF8 Java entering tool*
* System Name:  *utfjenter*
* Type: Programs
* License: GNU General Public License V3 or later

----

==== Description: ====
A Java intering tool for users to Enter UTF8 files,

the source code as such :


import javax.swing.*;
import java.awt.*;
import java.net.URL;
import java.net.MalformedURLException;
import java.io.*;
import javax.swing.text.*;
import javax.swing.event.*;

/*
 * @version 1.1, 15 Mar 2002
 * @author Quan Nguyen
 */

class HtmlPane extends JScrollPane implements HyperlinkListener {
    JEditorPane html;
    private final ClassLoader cLoader;

    public HtmlPane() {
        cLoader = getClass().getClassLoader();
        setPreferredSize(new Dimension(600, 300));      
        try {
            URL url =
cLoader.getResource("net/sourceforge/unicodeconvert/resources/readme.html");
            html = new JEditorPane(url);
            html.setEditable(false);
            html.setMargin(new Insets(5,10,5,5));
            html.addHyperlinkListener(this);
            JViewport vp = getViewport();
            vp.add(html);
        } catch (MalformedURLException e) {
            System.out.println("Malformed URL: " + e);
        } catch (IOException e) {
            System.out.println("IOException: " + e);
        }   
    }

    /**
     * Notification of a change relative to a 
     * hyperlink.
     */
    public void hyperlinkUpdate(HyperlinkEvent e) {
        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
            linkActivated(e.getURL());
        }
    }

    /**
     * Follows the reference in an
     * link.  The given url is the requested reference.
     * By default this calls <a href="#setPage">setPage</a>,
     * and if an exception is thrown the original previous
     * document is restored and a beep sounded.  If an 
     * attempt was made to follow a link, but it represented
     * a malformed url, this method will be called with a
     * null argument.
     *
     * @param u the URL to follow
     */
    protected void linkActivated(URL u) {
        try {
            BrowserControl.displayURL(u.toString());
        } catch (Exception e) {
            System.err.println("Error message: " + e.getMessage()); 
            Cursor c = html.getCursor();
            Cursor waitCursor =
Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
            html.setCursor(waitCursor);
            SwingUtilities.invokeLater(new PageLoader(u, c));   
        }
    }

    /**
     * temporary class that loads synchronously (although
     * later than the request so that a cursor change
     * can be done).
     */
    class PageLoader implements Runnable {
        URL url;
        Cursor cursor;
        
        PageLoader(URL u, Cursor c) {
            url = u;
            cursor = c;
        }

        public void run() {
            if (url == null) {
                // restore the original cursor
                html.setCursor(cursor);

                // PENDING(prinz) remove this hack when 
                // automatic validation is activated.
                Container parent = html.getParent();
                parent.repaint();
            } else {
                Document doc = html.getDocument();
                try {
                    html.setPage(url);
                } catch (IOException ioe) {
                    html.setDocument(doc);
                    getToolkit().beep();
                } finally {
                    // schedule the cursor to revert after
                    // the paint has happended.
                    url = null;
                    SwingUtilities.invokeLater(this);
                }
            }
        }
    }
}
www.myspace.com/kark/


==== Other Software Required: ====
java jre1.5 or later


==== Other Comments: ====
UTF8 entering tool






    _______________________________________________________

Reply to this item at:

  <http://gna.org/task/?6114>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Register mailing list
[email protected]
https://mail.gna.org/listinfo/register

Reply via email to