<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Depth-First: Tag eclipse</title>
    <link>http://depth-first.com/articles/tag/eclipse</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Walking the Web of Chemical Informatics</description>
    <item>
      <title>Hacking JSpecView: Enhancing the User Interface</title>
      <description>&lt;p&gt;&lt;center&gt;&lt;applet code="jspecview/applet/JSVApplet.class" name= "jsv" mayscript="true" archive="http://depth-first.com/demo/20080201/jspecview.jar" width="490" height="350"&gt;&lt;param name="script" value="load http://depth-first.com/demo/20080128/demo/demo1/netanilineH.jdx; reverseplot true; gridon false; plotcolor 150,100,200;" /&gt;&lt;/applet&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://depth-first.com/articles/2008/01/28/hacking-jspecview-creating-an-html-test-harness"&gt;last installment&lt;/a&gt; of this series showed how to set up an HTML testing harness for JSpecView. With the preliminaries taken care of, this installment will show how to enhance the user interface.&lt;/p&gt;

&lt;h4&gt;The Goal&lt;/h4&gt;

&lt;p&gt;The live applet shown above illustrates the changes that were made. As you move your mouse cursor into the spectrum area, you'll see a vertical red line appear and track the movements of the mouse. As you presss the mouse key to begin a selection, a grey rectangle will show you exactly where the selection area will be.&lt;/p&gt;

&lt;p&gt;If you can't view the applet, be sure you system has &lt;a href="http://www.java.com/en/download/index.jsp"&gt;JDK 1.5 or higher&lt;/a&gt; installed, and that you've enabled applets for your browser.&lt;/p&gt;

&lt;p&gt;Clearly, these modifications need more work. For example, you can extend the selection box outside the boundary of the spectrum area. And green might be a better color for the cursor. Then again, maybe the cursor should use an alpha channel. But I digress.&lt;/p&gt;

&lt;h4&gt;One More Thing&lt;/h4&gt;

&lt;p&gt;Being a &lt;a href="http://depth-first.com/articles/2008/01/11/my-favorite-eclipse-shortcut-quick-fix"&gt;longtime Eclipse user&lt;/a&gt;, I prefer this tool for my Java development. So far, only the use of Ant has been described. Fortunately, Eclipse offers an elegant way to import an existing Ant project. File-&gt;New gives a dialog like the one shown below:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080201/new_project.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Selecting "Java Project from Existing Ant Buildfile" gives this dialog:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080201/create_project.png"&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Filling in the fields as shown should give a fully-functional Eclipse project.&lt;/p&gt;

&lt;h4&gt;Still One More Thing&lt;/h4&gt;

&lt;p&gt;If you check the HTML source for this page, you'll notice that the &lt;tt&gt;applet&lt;/tt&gt; tag is used to display the applet. Yet on Internet Explorer, there is no "click to activate" message. The reason is that Depth-First is using the excellent JavaScript library &lt;a href="http://depth-first.com/articles/2007/11/02/eolas-and-jactivating-working-around-a-workaround"&gt;JActivating&lt;/a&gt;, which re-writes the &lt;tt&gt;applet&lt;/tt&gt; tag so that it isn't detected by the Eolas workaround. This lets us stick with plain HTML, rather than using &lt;tt&gt;document.write&lt;/tt&gt; to specify the applet.&lt;/p&gt;

&lt;h4&gt;Changing the Source Code&lt;/h4&gt;

&lt;p&gt;Too many changes were made to detail individually. In general, they related to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Removing non-applet classes such as those involved with the desktop application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Removing code flagged by Eclipse as unused.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Editing the &lt;tt&gt;jspecview.common.JSVPanel&lt;/tt&gt; source to add the UI modifications. The &lt;tt&gt;drawGraph&lt;/tt&gt;, &lt;tt&gt;drawCursor&lt;/tt&gt;, and &lt;tt&gt;drawZoomBox&lt;/tt&gt; methods contained most of the changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The complete Eclipse project should be &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=161398&amp;amp;package_id=260592"&gt;available from SourceForge&lt;/a&gt; shortly.&lt;/p&gt;

&lt;h4&gt;Conclusions&lt;/h4&gt;

&lt;p&gt;Given the right tools, modifying JSpecView is not that difficult. We've gone from raw souce code to a complete Eclipse project, and even added some functionality in the process.&lt;/p&gt;

&lt;p&gt;Where would you like to take JSpecView?&lt;/p&gt;</description>
      <pubDate>Fri, 01 Feb 2008 11:25:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:29a83e80-30b1-4da8-b4a1-be5958312bca</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/02/01/hacking-jspecview-enhancing-the-user-interface</link>
      <category>Tools</category>
      <category>jspecview</category>
      <category>applet</category>
      <category>eclipse</category>
      <category>ant</category>
      <category>xydata</category>
    </item>
    <item>
      <title>My Favorite Eclipse Shortcut: Quick Fix</title>
      <description>&lt;p&gt;&lt;a href="http://eclipse.org"&gt;&lt;img src="http://depth-first.com/demo/20080111/eclipse_logo.jpg" align="right"&gt;&lt;/img&gt;&lt;/img&gt;&lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt; is one of those great tools that is both easy to learn and extremely powerful. Eclipse's power comes, in part, from the number of features it offers, which seems to grow with every new release. This creates a problem though; the more features that are added to Eclipse, the more difficult it is to find them. This article focuses on one feature that every Eclipse user should know about: &lt;a href="http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/tasks-175.htm"&gt;Quick Fix&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let's say you're creating a class from scratch and you need to add a variable. Because you're working in Java, you'll also need to specify a type. If that type is one that doesn't already appear in the file you're working on, you'll either need to create it or import it. It may not seem like a big deal to scroll to the top of your file, add an &lt;tt&gt;import&lt;/tt&gt; statement, and scroll back down to continue writing, but it can really break the flow of concentration - especially considering that it may need to be done several times in just one method.&lt;/p&gt;

&lt;p&gt;Wouldn't it be great if Eclipse could handle this tedium for you?&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/tasks-175.htm"&gt;Quick Fix&lt;/a&gt;. In this example, we're creating a class called &lt;tt&gt;Molecule&lt;/tt&gt; and need to add a &lt;tt&gt;List&lt;/tt&gt; to hold its atoms. We begin by declaring the &lt;tt&gt;atoms&lt;/tt&gt; variable:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080111/list_error.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Eclipse recognizes that &lt;tt&gt;List&lt;/tt&gt; is a new type. Instead of manually inserting an &lt;tt&gt;import&lt;/tt&gt; statement at the top of the file, let's use Quick Fix.&lt;/p&gt;

&lt;p&gt;Highlighting the error and pressing [Ctrl-1] opens Quick Fix and gives us a list of options to choose from:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080111/list_options.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Quick Fix can also create a class or interface template instead of importing a class, as the screenshot above suggests.&lt;/p&gt;

&lt;p&gt;We need to import the &lt;tt&gt;java.util.List&lt;/tt&gt; interface. Double clicking on the &lt;tt&gt;Import 'List'(java.util)&lt;/tt&gt; option inserts the import statement and allows us to continue writing:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20080111/list_fix.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;p&gt;Eclipse is packed with these kinds of useful but hard to find features. Future Depth-First articles will highlight some of them.&lt;/p&gt;</description>
      <pubDate>Fri, 11 Jan 2008 10:27:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e67b05db-06a5-4172-b39b-9fd0ea28e3e1</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2008/01/11/my-favorite-eclipse-shortcut-quick-fix</link>
      <category>Tools</category>
      <category>eclipse</category>
      <category>quickfix</category>
      <category>designingtheobvious</category>
    </item>
  </channel>
</rss>
