Software Product
Total Page:16
File Type:pdf, Size:1020Kb
DEVELOPERS GUIDE BIOVIA DRAW 2016 Copyright Notice ©2016 Dassault Systèmes. All rights reserved. 3DEXPERIENCE, the Compass icon and the 3DS logo, CATIA, SOLIDWORKS, ENOVIA, DELMIA, SIMULIA, GEOVIA, EXALEAD, 3D VIA, BIOVIA and NETVIBES are commercial trademarks or registered trademarks of Dassault Systèmes or its subsidiaries in the U.S. and/or other countries. All other trademarks are owned by their respective owners. Use of any Dassault Systèmes or its subsidiaries trademarks is subject to their express written approval. Acknowledgments and References To print photographs or files of computational results (figures and/or data) obtained using BIOVIA software, acknowledge the source in an appropriate format. For example: "Computational results obtained using software programs from Dassault Systèmes BIOVIA. The ab initio calculations were performed with the DMol3 program, and graphical displays generated with Draw." BIOVIA may grant permission to republish or reprint its copyrighted materials. Requests should be submitted to BIOVIA Support, either through electronic mail to [email protected], or in writing to: BIOVIA Support 5005 Wateridge Vista Drive, San Diego, CA 92121 USA ExtendableRenditorDemo 28 Contents StructureResolver API 29 Deployment of the Example 30 Draw Overview 1 DemoRendererCustomAssemblyResolver 34 Customizing Draw 1 DemoLateBoundRenditor 35 Important Files and Documents 1 Add-ins: Actions and Tools 37 The Draw Editor 2 About Add-in Actions 37 Using Draw in a .NET Application 2 Add-in Action Example: Using Draw in a Java Application 2 DisplaySmilesStringAction 37 Components, Classes, and Utilities of Draw 3 Files for the Add-in Action 37 Examples Summary 4 Setting up the AddIns Directory 38 DemoRenditorMulti Example 5 Editing the DisplaySmilesString.xml File 38 Supplemental Information 6 Testing the Example 39 API: Getting Started 8 Customizing the Menu 40 About the BIOVIA Draw API 8 Removing an Add-in Action 40 DemoHeadlessRenderer Example 8 Implementing the IAction Interface for Your .NET API GettingStarted Example 9 Add-in Action 40 Designing the Form 10 About Add-in Tools 41 Add-in Tool Example: Identify Atom, Bond, or Coding the Behavior 12 Sgroup 41 Testing the Application 13 Run the Example 41 DemoRenditorSimple Example 14 Making your Add-in Tool Project 43 DemoRenderer Example 15 Undo Incrementally for Action or Tool 45 Start the Demo Renditor Multi Example 17 Undo for an Action 45 Synchronize Preference Settings 18 Building the DLL for Undo Action 46 Special API Features 19 Examples: Internet Explorer and C++ 48 Determining if a Structure is a rReaction or a Molecule 19 Internet Explorer Examples 48 Enabling Structure Editing 19 Installation Requirements for Use in HTML 48 Removing the Rendered Structure 19 Renditor in the Internet Explorer Example 49 Setting Highlight for Implicit Carbons 19 How to Use the Renditor Example 49 Setting the XML Configuration File for a Renditor and Renderer in IE Example 50 Renditor 19 Writing your External JavaScript File 51 Example: How to Set the Primary XML COMStructureChanged Event Example 52 Config file Using the API 19 Demo Renderer Double Clicked Event V3000 molfile Output 20 Example 53 Example: ForceV3000 API 20 ASP Example 54 Disabling Chem Check from Transfer Back to Deploying the ASP example on the IIS server 54 Renditor 21 Launch the ASP example through the IE client 55 Edit the XML Configuration file for Starting IIS 55 donetoolbar 21 Deploying the ASP Example on the IIS server 55 Specify the XML Configuration File for the Renditor 22 Launching the ASP Through the IE Client 56 Java Native Interface 23 C++ Examples 58 Swing JPanel Version 23 Renderer_MFC 58 AWT Version 25 Renditor_MFC 59 Custom Ptable for a JMolRendererCom Java API References - Links 61 application 26 Draw .NET API Reference 61 JMolRendererCom API Method 27 Draw Java API 61 Facade API 27 Draw Overview Customizing Draw 1 Using Draw in a .NET Application 2 Using Draw in a Java Application 2 Components, Classes, and Utilities of Draw 3 Examples Summary 4 Supplemental Information 6 Customizing Draw Draw is an application for drawing, displaying, and editing chemical structures, including biopolymers. As an application developer, you can use the Draw API to create custom actions and add-ins that extend functionality for tools, buttons, and menu items. You can also create Isentris applications that call Draw, and add components such as the Renderer and Renditor in to Microsoft® Visual Studio® .NET applications. You can edit the XML configuration file to modify the chemical drawing environment match workflow needs in your organization. You can customize Draw in three ways: n Edit the XML Configuration File n Using Draw in a .NET application Draw includes example applications that involve the API as well as examples that involve the XML configuration file only. See Examples Summary for a list of examples available. Draw also allows you to work with biopolymers. See the Biopolymer Representation chapter in BIOVIA Chemical Representation, which is installed as [draw_home] \docs\Draw\devguide\BIOVIAChemicalRepresentation.pdf Important Files and Documents The following are important files that you use when modifying or running Draw. They are located in the root directory of the Draw installation. File Name Description BIOVIADraw.exe Draw executable (also available from the Start menu) AccelrysDraw-net.xml XML configuration file that specifies the XML files that define the Draw user interface. BIOVIA Chemical <draw_ Representation home>\docs\Draw\devguide\BIOVIAChemicalRepresentation.pdf Note: If you have a custom Ptable (periodic table), see the Customizing the BIOVIA Ptable chapter in BIOVIA Chemical Representation. Access Draw examples from within a Microsoft Visual Studio .NET environment by launching the Examples.sln solution file in the Examples directory of the Draw installation. For an overview of how to build your own application that customizes Draw, see API: Getting Started. BIOVIA Draw Overview | Page 1 The Draw Editor The Editor control allows you to create and modify structures. The Draw API does not provide direct access to the Editor. A user can interact with the Editor by launching Draw.exe or by double-clicking a Renditor, which then launches the Editor. Notes: For an example of how an application that adds functionality to Draw can get a handle to the Editor by using the IEditor interface, see Add-ins: Actions and Tools. For details and syntax, see Draw API Reference for .NET. Draw, by default, is a modeless application. There is no API to make the Draw editor modal. However: n If the form that contains the Renditor that invokes the editor is modal, then the editor will also be modal n If the form that contains the Renditor that invokes the editor is modeless, then the editor will also be modeless Using Draw in a .NET Application The Draw API provides a standard .NET interface that you can call from your application. See API: Getting Started and API References - Links. You can use the Draw API to perform tasks such as the following: n Use Draw in a .NET application. For example, including the Renderer or Renditor in a .NET form. n Use a Renderer and the Renditor in an HTML page. A web server application can accept query structures from web clients and return matching structures to those web clients. Both the web server and the clients must have an installation of Draw for .NET. n Extend the functionality of the structure Editor’s menu item actions and toolbar button tools by using: n Add-ins for third-party functionality n Custom Add-ins for functionality your write yourself. Interfaces exist to the structure Editor as well as to the selected molecule, atom, bond, Sgroup, menu item, or tool. n Generate multiple image files (bmp, gif, png, tif, wmf) from structure data for reporting by using the HeadlessRenderer’s SaveMoleculeAsImage method. n Create a common look and feel for the display of structures. For example, you can ensure that when a renditor calls an editor, the renditor’s DisplayPreferences (such as BackColor and AromaticRingsAsCircles) apply to the editor. Using Draw in a Java Application A Java application can launch the Draw .NET renderer and editor by using the API of com.mdli.draw.JMolRendererCom at <draw_home>\docs\Draw\api-java\index.html The API Reference is available at JMOLRendererCOM javadoc Page 2 | BIOVIA Draw • Developers Guide Components, Classes, and Utilities of Draw Draw provides components for drawing, displaying, and editing chemical structures (molecules and reactions), as well as a command-line utility for image file generation. To customize Draw for your application, use the following components, classes, and tools. To learn how to configure Draw by editing XML configuration files, see Draw Configuration Tasks in the Draw Configuration Guide. For More Info, see Component Description Draw API Reference for .NET structure Editor Enables the end-user to draw and modify chemical IEditor structures. The Editor is also the Draw standalone interface application. Renderer A control that displays structures Renderer class Renditor A special renderer control that enables the end-user to Renditor class launch a structure Editor by double-clicking anywhere on the canvas HeadlessRenderer An invisible renderer control that paints a structure to HeadlessRenderer an image file. class Note: A command-line utility also outputs image files (see Command-line Image File Conversion: ImageGenerator in the Draw Configuration Guide) Two classes are particularly important.