Team:BU Wellesley Software/Notebook/JenhanNotebook

From 2011.igem.org

(Difference between revisions)
Line 174: Line 174:
     Keymap k = myTextField.getKeymap();
     Keymap k = myTextField.getKeymap();
     JTextComponent.loadKeymap(k, newBindings, myTextField.getActions());
     JTextComponent.loadKeymap(k, newBindings, myTextField.getActions());
 +
 +
Use this to add a right click menu in clotho
 +
_lister.addMouseListener(new MouseAdapter() {
 +
            @Override
 +
            public void mouseClicked(MouseEvent e) {
 +
                if(e.getClickCount()==2) {
 +
                    try {
 +
                        ObjBase obj = (ObjBase) _lister.getSelectedValue();
 +
                        obj.launchDefaultViewer();
 +
                    } catch(Exception ex) {
 +
                    }
 +
                }
 +
            }
 +
        });

Revision as of 20:38, 1 July 2011

Contents

Daily Updates

(6/3)
Today was the Clotho boot camp. Trying to build an application on the fly revealed how much I still had to learn about the infrastructure. Most of what I'm missing relates to the Clotho connection and how an object is persisted. I learned about the existence of a transient collection.

I also spent the better part of the boot camp tracking down an error that caused the Sequence View to crash. Turns out it was just an xml error. Xml errors and build file errors combined make up the vast majority of errors that I've encountered while building Clotho.

With the Sequence View stabilized in Clotho Biofab Edition, I can begin looking for quick conversions to a TopComponent. I think I should be able to grab the Content Pane of the JFrame and then use that to populate the TopComponent. Once I confirm this works, then I can begin completing the Sequence View. There is a lot remaining to be done and learned.

(6/7)
Still quite a bit confused about what everyone is doing. Chenkai gets back tomorrow and so will Swapnil; hopefully the comp team can have a meeting to coordinate a bit better. We need to agree on some things about Clotho architecture. I'm learning a lot about swing, and at the rate things are going, I can actually get the Sequence View done pretty soon. Next thing on my list is to work on the actual ide interface or maybe spreadedit features. Sequence View depends on spreadit features right now, but I might change that. I'm not quite sure about how encapsulated an app should be.
(6/10)
Presented my ideas for the new ClothoTool definition to the comp team today; they were generally receptive.

Main points:

  1. drag and drop
  2. size constraints
  3. jframe implementation
  4. windowing compatibility*

I will be drafting a formal proposal for Doug soon, and so more to follow next week.

(6/13)
Still felling like I'm still learning java swing fundamentals: highlighting, caret positioning, etc. A little bland, but the Sequence View should be in working order in a day or two.
(6/15)
Finished Sequence View today. Admittedly, there is more that could be added. However, the core of the challenge, highlighting features/orfs, has been implemented in full. The code has been rigorously tested and it is bullet proof. I want to present the app to the wetlab team but Traci is at sb 5.0 I think. I think I will consider following the instructions to deploy a clotho app. Also, need to make my wiki look nicer; Janoo has incited a wiki war.
(6/16)
I drafted my proposal for a new format for ClothoTools today: Media:New_Clothotool_Specifications.pdf. I will be polishing the contents and using this document to create a presentation. I hope to present this to the the Wellesley team. Maybe they can optimize the interface or something. I'm still unsure what Wellesley will contribute to the team, and so I am looking forward to the upcoming meeting on the 27th.

Asides from the working on the proposal today, I spent a decent chunk of time learning how to produce proper wiki pages. When this notebook is complete, I hope it is something that I can be reasonably proud of.

The team some time coming up with a new name for a tool current called the Plasmid Architecture Design Suite (or PADS...). I am a fan of Flipper, but I'm not sure that would be serious enough. I also suggested IDEAS (Invertase DEsign Alogrithm Suite). I have a sneaking suspicion that Swapnil's suggestion of Kirigami will win though. [http://en.wikipedia.org/wiki/Kirigami Kirigami] is a form of Japanese papercraft.

(6/17)
Rewrote the DocumentListener for Sequence View. For now, I think the sequence view is finished:

Sequenceview.JPG

I fixed a lot of highlighting issues, and I would argue that the highlighting behaves better than comparable features in ApE. I plan on writing documentation in the wiki over the weekend. I should probably also comment the code.

On a different note, I had a good conversation with Viktor today about the Clotho use case. I feel like I need to have more similar conversations to better understand where Clotho should go.

(6/20)
Doug came back to Boston today; just in time to deliver what he claims to be enough work to make all of us nervous about taking vacations. Luckily for me, Boston is my vacation in a sense.

I finished a number of upgrades to Sequence View today along with a number of bug fixes. I also finished the accompanying [http://wiki.bu.edu/ece-clotho/index.php/Sequence_View documentation]. The tool should be ready for testing by the wet lab team.

I still need to make a presentation and generate a timeline for tomorrow's meeting. I still need to decide what I would like to do next month. Most likely I'll work on cleaning up the ide dashboard or fabdash. I want the dry lab team to start using the fabdash exclusively. I hope to convince the rest of the team about my vision of Clotho. I should probably clean up the Tool App Browser a bit, so I can begin to convince Doug that the older dashboard is unnecessary.

For tomorrow, I'll be presenting this powerpoint. A pdf version is provided File:6-20JointMeeting.pdf

(6/21)
I will be covering the following points today at the joint meeting between the wetlab and the drylab team:

Current Work

  • Sequence View- a tool for visualizing DNA sequences: wiki
  • Planning new Clotho Interface
  • Learning Java Swing- graphic user interface design

How it Fits I am writing code for the following reasons:

  • iGEM software tools are Clotho apps
  • Wetware team will use Clotho tools to make work easier
  • No one will use a tool if its difficult to use

Timeline

  • 6/20-6/24: stabilize new IDE dashboard
    • Revise dashboard/clotho tool plans based on feedback
  • 6/27-7/1: begin implementing new ClothoTool format in Sequence View + drag/drop inventory tab
  • 7/4-7/15: functionalize/stabilize drag/drop, incorporate into Spectacles

What I Need from the Team

  • Feedback
  • Suggestions
  • Guidance

The last three bullet points summarizes my approach to iGEM. I am here to listen to and learn from others. Although I feel fortunate that my qualifications earned me a place on the team, I hope I can expand beyond my existing skill set; I hope I can grow to be an even greater asset to the team. On that note, I am somewhat curious about the wetlab work. Time permitting, I would like to visit the wetlab more often.

(6/22)

At the dry lab meeting today Doug mentioned that I should do the following:

  1. Finish the Sequence View- Doug wants the tool to be deployed to the wetlab and the anderson lab as oon as possible. Remaining things to do for the Sequence View:
    1. Fix dialog boxes
    2. Write documentation, emphasize why Sequence View is a superior tool
    3. Import ApE features
    4. waiting dialog
  2. Clotho data management
    1. remote vs local connection
    2. Draft proposal about deleting from database
  3. I need to design a primer design tool within a week. I should plan to talk to the wetlab either tomorrow or on Friday.
  4. Time permitting, I may work on a J5 client that interacts with Spectacles

I also need to find time to implement parts of my proposal for a better Clotho tool. I've drafted a rough proposal here: Media:New_Clothotool_Specifications.pdf

Swapnil mentioned an interesting invertase puzzle today. A way to design a sort of sorter. For a given sort of inputs, this sorter would produce one result. All other inputs would produce a different defined result. This is related to prior work done in this [http://www.sciencemag.org/content/324/5931/1199.abstract paper]. It looks fun.

(6/29)

It's been about a week since I've updated this. Since then, the Sequence View has grown in the following regards:

  • added ability to import genbank and ape features
  • added melting temperature and GC content calculations
  • tested deployment both as an exe install file and a .clo file
    • ORF highlighting doesn't work in the .clo file for some reason
  • cleaned the code and removed unnecessary classes and imports

I have been in touch with Prof Anderson at UC Berkeley and Noah Young from Johns Hopkins. Hopefully both parties will begin using the Sequence View. I will work to clean up the documentation and code.

I'll be moving onto a new project this week. I still need to wait to talk to Swapnil; I expect it to be an interesting conversation. Asides from this, I'll be working on straightening out the Clotho connection system.

Useful code snippets

Use the following to convert a jframe to a topComponent private void topComponentViewButtonActionPerformed(java.awt.event.ActionEvent evt) {

   guiContentPane = (JComponent) this.getContentPane();
   guiRootPane = this.getRootPane();
   SwingUtilities.invokeLater(new Runnable() {
       @Override
       public void run() {
           TopComponent tc = new TopComponent();
           tc.setLayout(new BorderLayout());
           JScrollPane sp = new JScrollPane(guiContentPane);
           tc.add(jMenuBar, BorderLayout.NORTH);
           tc.add(sp, BorderLayout.CENTER);
           tc.setName("Sequence View");
           tc.open();
           tc.requestActive();
       }
   });
   this.dispose();}

Use the following to add actions to buttons someButton.addActionListener(new java.awt.event.ActionListener() {

    public void actionPerformed(java.awt.event.ActionEvent evt) {
       someButtonActionPerformed(evt); //implement in same cass as someButton
    }
    });

Use this to run things in the background thread:

       new SwingWorker() {
           @Override
           protected Object doInBackground() throws Exception {
               //Insert todo code
               return null;
           }
       }.execute();

Found this online, useful for implementing copy/paste:

// If a string is on the system clipboard, this method returns it;
// otherwise it returns null.
public static String getClipboard() {
   Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);
   try {
       if (t != null && t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
           String text = (String)t.getTransferData(DataFlavor.stringFlavor);
           return text;
       }
   } catch (UnsupportedFlavorException e) {
   } catch (IOException e) {
   }
   return null;
}
// This method writes a string to the system clipboard.
// otherwise it returns null.
public static void setClipboard(String str) {
   StringSelection ss = new StringSelection(str);
   Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
}

Good example of keybinding in JTextComponents

   JTextComponent.KeyBinding[] newBindings = {
       new JTextComponent.KeyBinding(
         KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK),
         DefaultEditorKit.beepAction),
       new JTextComponent.KeyBinding(
         KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK),
         DefaultEditorKit.beepAction),
       new JTextComponent.KeyBinding(
           KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK),
           DefaultEditorKit.beepAction)
     };
           
   Keymap k = myTextField.getKeymap();
   JTextComponent.loadKeymap(k, newBindings, myTextField.getActions());

Use this to add a right click menu in clotho

_lister.addMouseListener(new MouseAdapter() {
           @Override
           public void mouseClicked(MouseEvent e) {
               if(e.getClickCount()==2) {
                   try {
                       ObjBase obj = (ObjBase) _lister.getSelectedValue();
                       obj.launchDefaultViewer();
                   } catch(Exception ex) {
                   }
               }
           }
       });