{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "chem-bla-ics",
  "description": "Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.",
  "home_page_url": "https://chem-bla-ics.linkedchemistry.info/",
  "feed_url": "https://chem-bla-ics.linkedchemistry.info/2008/11/20/scripting-jchempaint.json",
  "icon": "https://chem-bla-ics.linkedchemistry.info/assets/images/chem-bla-ics_logo.png",
  "language": "en",
  "authors": [
    {
      "name": "Egon Willighagen",
      "url": "https://orcid.org/0000-0001-7542-0286",
      "_orcid": "0000-0001-7542-0286"
    }
  ],
  "items": [

    {
      "id": "https://doi.org/10.59350/yhdxa-ft783",
      "url": "https://chem-bla-ics.linkedchemistry.info/2008/11/20/scripting-jchempaint.html",
      "title": "Scripting JChemPaint",
      "content_html": "<p>Today and tomorrow, Stefan, <a href=\"http://gilleain.blogspot.com/\">Gilleain</a>, Arvid and I are having a <a href=\"https://apps.sourceforge.net/mediawiki/cdk/index.php?title=JChemPaintWorkshop2008\">JChemPaint Developers Workshop</a>\nin Uppsala, to sprint the development of JChemPaint3, for which <a href=\"http://progz-jchem.blogspot.com/\">Niels</a> layed out the foundation already a long time ago.</p>\n\n<p>Gilleain and Arvid are merging their branches into a <a href=\"http://cdk.svn.sourceforge.net/viewvc/cdk/cdk/branches/jchempaint-primary/\">single code base</a>,\nwhile Stefan is working on the <a href=\"http://cdk.svn.sourceforge.net/viewvc/cdk/jchempaint/trunk/\">Swing application and applet</a>. The Bioclipse SWT-based widget is being developed for\n<a href=\"http://bioclipse.svn.sourceforge.net/viewvc/bioclipse/bioclipse2/trunk/plugins/net.bioclipse.cdk.jchempaint.view/\">Bioclipse2</a>.</p>\n\n<p>The new design separates widget/graphics toolkit specifics from the chemical drawing and editing logic. Regarding the editing functionality, this basically comes down to have a\nsemantically meaningful edit API. This allows us to convert both Swing and SWT mouse events into things like <code class=\"language-plaintext highlighter-rouge\">addAtom(\"C\", atom)</code>, which would add a carbon to an already\nexisting <em>atom</em>. However, without too much phantasy, it allows adding a scripting language. This is what I have been working on. Right now, the following API is available\nfrom the Bioclipse2 JavaScript console (via the <em>jcp</em> namespace, in random order):</p>\n\n<ul>\n  <li>ICDKMolecule jcp.getModel()</li>\n  <li>IAtom getClosestAtom(Point2d)</li>\n  <li>setModel(ICDKMolecule) <em>(for really fancy things)</em></li>\n  <li>removeAtom(IAtom)</li>\n  <li>IBond getClosestBond(Point2d)</li>\n  <li>updateView() <em>(all edit command issue this automatically)</em></li>\n  <li>addAtom(String,Point2d)</li>\n  <li>addAtom(String,IAtom) <em>(which works out coordinates automatically)</em></li>\n  <li>Point2d newPoint2d(double,double)</li>\n  <li>updateImplicitHydrogenCounts()</li>\n  <li>moveTo(IAtom, Point2d)</li>\n  <li>setSymbol(IAtom,String)</li>\n  <li>setCharge(IAtom,int)</li>\n  <li>setMassNumber(IAtom,int)</li>\n  <li>addBond(IAtom,IAtom)</li>\n  <li>moveTo(IBond,Point2d)</li>\n  <li>setOrder(IBond,IBond.Order)</li>\n  <li>setWedgeType(IBond,int)</li>\n  <li>IBond.Order getOrder(int)</li>\n  <li>zap() <em>(sort of <code class=\"language-plaintext highlighter-rouge\">sudo rm -Rf /*</code>)</em></li>\n  <li>cleanup() <em>(calculate 2D coordinates from scratch)</em></li>\n  <li>addRing(IAtom,int)</li>\n  <li>addPhenyl(IAtom)</li>\n</ul>\n\n<p>This API (many more method will follow) is not really aimed at the end user, who will simply point and click. The goal of this scripting language is, at least at this moment,\nto test the underlying implementation using Bioclipse. Future applications, however, may include simple scripts which use some logic to convert the editor content. For example,\nreplacing a t-butyl fragment into a pseudo atom “t-Bu”. The key thing to remember, is that this will allow Bioclipse to have non-CDK-based programs act on the JChemPaint editor\ncontent (e.g. using <code class=\"language-plaintext highlighter-rouge\">getModel()</code> and <code class=\"language-plaintext highlighter-rouge\">setModel(ICDKMolecule)</code>). More on that later.</p>\n\n<p>A simple script could look like: Or, as screenshot:</p>\n\n<p><img src=\"/assets/images/jcpScripting.png\" alt=\"\" /></p>",
      "summary": "Today and tomorrow, Stefan, Gilleain, Arvid and I are having a JChemPaint Developers Workshop in Uppsala, to sprint the development of JChemPaint3, for which Niels layed out the foundation already a long time ago.",
      "image": "https://chem-bla-ics.linkedchemistry.info/assets/images/jcpScripting.png",
      "date_published": "2008-11-20T00:00:00+00:00",
      "date_modified": "2008-11-20T00:00:00+00:00",
      
      
      
      
      
      
      
        "authors": [ { "name": "Egon Willighagen", "url": "https://orcid.org/0000-0001-7542-0286" } ]
      
    }

  ]
}
