/*
Copyright (c) 2008 The Regents of the University of California.
All rights reserved.
Permission is hereby granted, without written agreement and without
license or royalty fees, to use, copy, modify, and distribute this
software and its documentation for any purpose, provided that the above
copyright notice and the following two paragraphs appear in all copies
of this software.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS..
*/
package org.clothocad.tool.sequenceview;
import javax.swing.ImageIcon;
/**
*
* @author Douglas Densmore/Nade Sritanyaratana
*/
public class SequenceViewSearchTools extends javax.swing.JFrame {
/** Creates new form SequenceViewsTools */
public SequenceViewSearchTools() {
initComponents();
}
public SequenceViewSearchTools(SequenceView sv) {
initComponents();
_sv = sv;
}
public String getBeginIndex()
{
return toTextField.getText();
}
public String getEndIndex()
{
return fromTextField.getText();
}
public javax.swing.JTextField get_ReplaceFindField() {
return replaceFindField;
}
public javax.swing.JTextField get_ReplaceField() {
return replaceField;
}
public void store_ToolsFields() {
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
}
public javax.swing.JTextField get_AddressField() {
return addressTextField;
}
public javax.swing.JCheckBox get_BothCheckBox() {
return findBothCheck;
}
public javax.swing.JComboBox get_connectionsComboBox()
{
return connectionsComboBox;
}
public javax.swing.JTextField get_CurrentReplaceFindField() {
return _currentReplaceFindField;
}
public javax.swing.JTextField get_CurrentReplaceField() {
return _currentReplaceField;
}
public javax.swing.JCheckBox get_PasteRevCompCheckbox() {
return pasteRevCompCheckbox;
}
public javax.swing.JTabbedPane get_toolsTabbedPane()
{
return toolsTabbedPane;
}
public javax.swing.JCheckBox get_RevCompCheckBox() {
return findRevCompCheck;
}
public boolean highlightSeqSel()
{
return selSeqRadioButton.isSelected();
}
public boolean intervalSeqSel()
{
return intervalSeqRadioButton.isSelected();
}
public boolean wholeSeqSel()
{
return wholeSeqRadioButton.isSelected();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
dnaToolsPanel = new javax.swing.JPanel();
revCompButton = new javax.swing.JButton();
translationButton = new javax.swing.JButton();
highlightRestrictionSitesButton = new javax.swing.JButton();
switchCaseButton = new javax.swing.JButton();
lowerCaseButton = new javax.swing.JButton();
upperCaseButton = new javax.swing.JButton();
packageAsPartButton = new javax.swing.JButton();
highlightFeaturesButton = new javax.swing.JButton();
revTranslationButton = new javax.swing.JButton();
exportPanel = new javax.swing.JPanel();
connectionsComboBox = new javax.swing.JComboBox();
wholeSeqRadioButton = new javax.swing.JRadioButton();
selSeqRadioButton = new javax.swing.JRadioButton();
intervalSeqRadioButton = new javax.swing.JRadioButton();
toTextField = new javax.swing.JTextField();
fromTextField = new javax.swing.JTextField();
exportButton = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
addressTextField = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
seqbuttonGroup = new javax.swing.ButtonGroup();
toolsTabbedPane = new javax.swing.JTabbedPane();
goToPanel = new javax.swing.JPanel();
findField = new javax.swing.JTextField();
findNextButton = new javax.swing.JButton();
findPrevButton = new javax.swing.JButton();
sequenceLabel = new javax.swing.JLabel();
goField = new javax.swing.JTextField();
goLabel = new javax.swing.JLabel();
goButton = new javax.swing.JButton();
selectButton = new javax.swing.JToggleButton();
selectToField = new javax.swing.JTextField();
selectFromField = new javax.swing.JTextField();
selectFromLabel = new javax.swing.JLabel();
selectToLabel = new javax.swing.JLabel();
selectAllButton = new javax.swing.JButton();
replacePanel = new javax.swing.JPanel();
replaceButton = new javax.swing.JButton();
replaceAllButton = new javax.swing.JButton();
replaceField = new javax.swing.JTextField();
replacePrevButton = new javax.swing.JButton();
replaceNextButton = new javax.swing.JButton();
replaceFindField = new javax.swing.JTextField();
replaceFindLabel = new javax.swing.JLabel();
replaceWithLabel = new javax.swing.JLabel();
pasteRevCompCheckbox = new javax.swing.JCheckBox();
caseSensitiveCheck = new javax.swing.JCheckBox();
findRevCompCheck = new javax.swing.JCheckBox();
findBothCheck = new javax.swing.JCheckBox();
revCompButton.setToolTipText("Reverse-Complement");
revCompButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
revCompButtonActionPerformed(evt);
}
});
translationButton.setToolTipText("Translation");
translationButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
translationButtonActionPerformed(evt);
}
});
highlightRestrictionSitesButton.setToolTipText("Highlight Restriction Sites");
highlightRestrictionSitesButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
highlightRestrictionSitesButtonActionPerformed(evt);
}
});
switchCaseButton.setToolTipText("Switch Case");
switchCaseButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
switchCaseButtonActionPerformed(evt);
}
});
lowerCaseButton.setToolTipText("lower case");
lowerCaseButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lowerCaseButtonActionPerformed(evt);
}
});
upperCaseButton.setToolTipText("UPPER CASE");
upperCaseButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
upperCaseButtonActionPerformed(evt);
}
});
packageAsPartButton.setToolTipText("Package as Part");
packageAsPartButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
packageAsPartButtonActionPerformed(evt);
}
});
highlightFeaturesButton.setToolTipText("Highlight Features");
highlightFeaturesButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
highlightFeaturesButtonActionPerformed(evt);
}
});
revTranslationButton.setToolTipText("Reverse Translation");
revTranslationButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
revTranslationButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout dnaToolsPanelLayout = new javax.swing.GroupLayout(dnaToolsPanel);
dnaToolsPanel.setLayout(dnaToolsPanelLayout);
dnaToolsPanelLayout.setHorizontalGroup(
dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(dnaToolsPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(revCompButton, 0, 0, Short.MAX_VALUE)
.addComponent(lowerCaseButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(dnaToolsPanelLayout.createSequentialGroup()
.addComponent(translationButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(revTranslationButton))
.addGroup(dnaToolsPanelLayout.createSequentialGroup()
.addComponent(upperCaseButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(switchCaseButton)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 96, Short.MAX_VALUE)
.addGroup(dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(dnaToolsPanelLayout.createSequentialGroup()
.addComponent(highlightFeaturesButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(highlightRestrictionSitesButton))
.addComponent(packageAsPartButton))
.addContainerGap())
);
dnaToolsPanelLayout.setVerticalGroup(
dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dnaToolsPanelLayout.createSequentialGroup()
.addGroup(dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(dnaToolsPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(highlightRestrictionSitesButton)
.addGroup(dnaToolsPanelLayout.createSequentialGroup()
.addComponent(highlightFeaturesButton, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(packageAsPartButton))))
.addGroup(dnaToolsPanelLayout.createSequentialGroup()
.addGap(15, 15, 15)
.addGroup(dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(revCompButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(translationButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)
.addComponent(revTranslationButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE))
.addGap(24, 24, 24)
.addGroup(dnaToolsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(upperCaseButton)
.addComponent(switchCaseButton)
.addComponent(lowerCaseButton))))
.addGap(72, 72, 72))
);
exportPanel.setToolTipText("Export the sequence view information to other connections");
connectionsComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
seqbuttonGroup.add(wholeSeqRadioButton);
wholeSeqRadioButton.setText("Whole Sequence");
seqbuttonGroup.add(selSeqRadioButton);
selSeqRadioButton.setText("Selected Sequence");
seqbuttonGroup.add(intervalSeqRadioButton);
intervalSeqRadioButton.setText("Interval ");
exportButton.setText("Export");
exportButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
exportButtonActionPerformed(evt);
}
});
jLabel1.setText("To");
jLabel2.setText("From");
jLabel3.setText("Connection");
jLabel4.setText("Address");
javax.swing.GroupLayout exportPanelLayout = new javax.swing.GroupLayout(exportPanel);
exportPanel.setLayout(exportPanelLayout);
exportPanelLayout.setHorizontalGroup(
exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(exportPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(exportPanelLayout.createSequentialGroup()
.addComponent(connectionsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel3))
.addGroup(exportPanelLayout.createSequentialGroup()
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(selSeqRadioButton)
.addComponent(intervalSeqRadioButton)
.addComponent(wholeSeqRadioButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(addressTextField, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel1)
.addComponent(toTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(exportPanelLayout.createSequentialGroup()
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(fromTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(10, 10, 10)
.addComponent(exportButton))
.addComponent(jLabel4))))
.addContainerGap(101, Short.MAX_VALUE))
);
exportPanelLayout.setVerticalGroup(
exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(exportPanelLayout.createSequentialGroup()
.addGap(11, 11, 11)
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(connectionsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(exportPanelLayout.createSequentialGroup()
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(wholeSeqRadioButton)
.addComponent(addressTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(selSeqRadioButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(intervalSeqRadioButton))
.addGroup(exportPanelLayout.createSequentialGroup()
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(exportPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(fromTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(toTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, exportPanelLayout.createSequentialGroup()
.addContainerGap(64, Short.MAX_VALUE)
.addComponent(exportButton)
.addContainerGap())
);
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Clotho: Sequence View Tools");
setIconImage(new ImageIcon("data/icons/ClothoIcon.png").getImage());
setLocationByPlatform(true);
toolsTabbedPane.setMinimumSize(new java.awt.Dimension(65, 30));
findField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
findFieldActionPerformed(evt);
}
});
findField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
findFieldKeyPressed(evt);
}
public void keyTyped(java.awt.event.KeyEvent evt) {
findFieldKeyTyped(evt);
}
});
findNextButton.setText("Find next");
findNextButton.setToolTipText("Find next match");
findNextButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
findNextButtonActionPerformed(evt);
}
});
findPrevButton.setText("Find previous");
findPrevButton.setToolTipText("Find previous match");
findPrevButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
findPrevButtonActionPerformed(evt);
}
});
sequenceLabel.setText("Sequence:");
goField.setText("#");
goField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
goFieldActionPerformed(evt);
}
});
goField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
goFieldFocusGained(evt);
}
public void focusLost(java.awt.event.FocusEvent evt) {
goFieldFocusLost(evt);
}
});
goLabel.setText("Base Pair:");
goButton.setText("Go");
goButton.setToolTipText("Go");
goButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
goButtonActionPerformed(evt);
}
});
selectButton.setText("Select");
selectButton.setToolTipText("Select");
selectButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
selectButtonActionPerformed(evt);
}
});
selectToField.setText("#");
selectToField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
selectToFieldActionPerformed(evt);
}
});
selectToField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
selectToFieldFocusGained(evt);
}
public void focusLost(java.awt.event.FocusEvent evt) {
selectToFieldFocusLost(evt);
}
});
selectFromField.setText("#");
selectFromField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
selectFromFieldActionPerformed(evt);
}
});
selectFromField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
selectFromFieldFocusGained(evt);
}
public void focusLost(java.awt.event.FocusEvent evt) {
selectFromFieldFocusLost(evt);
}
});
selectFromLabel.setText("Select from:");
selectToLabel.setText("to:");
selectAllButton.setText("Select All");
selectAllButton.setToolTipText("Select All");
selectAllButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
selectAllButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout goToPanelLayout = new javax.swing.GroupLayout(goToPanel);
goToPanel.setLayout(goToPanelLayout);
goToPanelLayout.setHorizontalGroup(
goToPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(goToPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(goToPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(goToPanelLayout.createSequentialGroup()
.addComponent(sequenceLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(goToPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(goToPanelLayout.createSequentialGroup()
.addComponent(findNextButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(findPrevButton))
.addComponent(findField, javax.swing.GroupLayout.DEFAULT_SIZE, 373, Short.MAX_VALUE)))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, goToPanelLayout.createSequentialGroup()
.addComponent(goLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(goField, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(goButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(selectFromLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(selectFromField, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(5, 5, 5)
.addComponent(selectToLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(selectToField, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(selectButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)
.addComponent(selectAllButton)))
.addContainerGap())
);
goToPanelLayout.setVerticalGroup(
goToPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(goToPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(goToPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(findField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(sequenceLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(goToPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(findNextButton)
.addComponent(findPrevButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
.addGroup(goToPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(goLabel)
.addComponent(goField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(goButton)
.addComponent(selectAllButton)
.addComponent(selectButton)
.addComponent(selectToField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(selectFromLabel)
.addComponent(selectFromField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(selectToLabel))
.addContainerGap())
);
toolsTabbedPane.addTab("Go to...", goToPanel);
replaceButton.setText("Replace");
replaceButton.setToolTipText("Replace Current Hit");
replaceButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
replaceButtonActionPerformed(evt);
}
});
replaceAllButton.setText("Replace all");
replaceAllButton.setToolTipText("Replace all");
replaceAllButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
replaceAllButtonActionPerformed(evt);
}
});
replaceField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
replaceFieldKeyPressed(evt);
}
public void keyTyped(java.awt.event.KeyEvent evt) {
replaceFieldKeyTyped(evt);
}
});
replacePrevButton.setText("Find Prev.");
replacePrevButton.setToolTipText("Find Previous Match");
replacePrevButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
replacePrevButtonActionPerformed(evt);
}
});
replaceNextButton.setText("Find Next");
replaceNextButton.setToolTipText("Find Next Match");
replaceNextButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
replaceNextButtonActionPerformed(evt);
}
});
replaceFindField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
replaceFindFieldActionPerformed(evt);
}
});
replaceFindField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
replaceFindFieldKeyPressed(evt);
}
public void keyTyped(java.awt.event.KeyEvent evt) {
replaceFindFieldKeyTyped(evt);
}
});
replaceFindLabel.setText("Find what:");
replaceWithLabel.setText("Replace with:");
pasteRevCompCheckbox.setText("Paste Rev-Comp");
pasteRevCompCheckbox.setToolTipText("Paste the Reverse Complement of the Replace With Field");
javax.swing.GroupLayout replacePanelLayout = new javax.swing.GroupLayout(replacePanel);
replacePanel.setLayout(replacePanelLayout);
replacePanelLayout.setHorizontalGroup(
replacePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(replacePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(replacePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(pasteRevCompCheckbox)
.addGroup(replacePanelLayout.createSequentialGroup()
.addGroup(replacePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(replaceWithLabel)
.addComponent(replaceFindLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(replacePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(replacePanelLayout.createSequentialGroup()
.addComponent(replaceNextButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(replacePrevButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(replaceButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(replaceAllButton))
.addComponent(replaceFindField, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE)
.addComponent(replaceField, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE))))
.addContainerGap())
);
replacePanelLayout.setVerticalGroup(
replacePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(replacePanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(replacePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(replaceFindLabel)
.addComponent(replaceFindField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(replacePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(replaceField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(replaceWithLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(replacePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(replaceButton)
.addComponent(replaceNextButton)
.addComponent(replaceAllButton)
.addComponent(replacePrevButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(pasteRevCompCheckbox)
.addContainerGap())
);
toolsTabbedPane.addTab("Replace", replacePanel);
caseSensitiveCheck.setText("Case Sensitive");
caseSensitiveCheck.setToolTipText("Check to search only case-sensitive matches");
caseSensitiveCheck.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
caseSensitiveCheckItemStateChanged(evt);
}
});
caseSensitiveCheck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
caseSensitiveCheckActionPerformed(evt);
}
});
findRevCompCheck.setText("Find only rev-comp");
findRevCompCheck.setToolTipText("Check to find only reverse-complement");
findBothCheck.setText("Find both");
findBothCheck.setToolTipText("Check to finds both original sequence and its reverse-complement");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(toolsTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 466, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(findRevCompCheck)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(findBothCheck)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 171, Short.MAX_VALUE)
.addComponent(caseSensitiveCheck)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(toolsTabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(caseSensitiveCheck)
.addComponent(findRevCompCheck)
.addComponent(findBothCheck))
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void findNextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findNextButtonActionPerformed
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
_sv.processSearchToolAction(evt, "findNextButton");
}//GEN-LAST:event_findNextButtonActionPerformed
private void findPrevButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findPrevButtonActionPerformed
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
_sv.processSearchToolAction(evt, "findPrevButton");
}//GEN-LAST:event_findPrevButtonActionPerformed
private void findFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_findFieldActionPerformed
findNextButtonActionPerformed(evt);
}//GEN-LAST:event_findFieldActionPerformed
private void goButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_goButtonActionPerformed
goFieldActionPerformed(evt);
}//GEN-LAST:event_goButtonActionPerformed
private void selectButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectButtonActionPerformed
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
_sv.processSearchToolAction(evt, "Select");
}//GEN-LAST:event_selectButtonActionPerformed
private void selectFromFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectFromFieldActionPerformed
selectButtonActionPerformed(evt);
}//GEN-LAST:event_selectFromFieldActionPerformed
private void selectToFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectToFieldActionPerformed
selectButtonActionPerformed(evt);
}//GEN-LAST:event_selectToFieldActionPerformed
private void selectAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_selectAllButtonActionPerformed
_sv.processSearchToolAction(evt, "SelectAll");
}//GEN-LAST:event_selectAllButtonActionPerformed
private void replaceNextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_replaceNextButtonActionPerformed
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
_sv.processSearchToolAction(evt, "replaceNextButton");
}//GEN-LAST:event_replaceNextButtonActionPerformed
private void replacePrevButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_replacePrevButtonActionPerformed
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
_sv.processSearchToolAction(evt, "replacePrevButton");
}//GEN-LAST:event_replacePrevButtonActionPerformed
private void replaceFindFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_replaceFindFieldActionPerformed
replaceNextButtonActionPerformed(evt);
}//GEN-LAST:event_replaceFindFieldActionPerformed
private void replaceButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_replaceButtonActionPerformed
if (replaceField.getText().equalsIgnoreCase("Replace text goes here"))
replaceField.setText("");
//_sv.setSearch(replaceFindField);
_sv.processSearchToolAction(evt, "replaceButton");
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
}//GEN-LAST:event_replaceButtonActionPerformed
private void replaceAllButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_replaceAllButtonActionPerformed
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
_sv.processSearchToolAction(evt, "replaceAllButton");
}//GEN-LAST:event_replaceAllButtonActionPerformed
private void caseSensitiveCheckItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_caseSensitiveCheckItemStateChanged
_sv.update_caseSensitive(evt);
}//GEN-LAST:event_caseSensitiveCheckItemStateChanged
private void findFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_findFieldKeyTyped
_sv.validateKeyTyped(evt);
}//GEN-LAST:event_findFieldKeyTyped
private void replaceFindFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_replaceFindFieldKeyTyped
_sv.validateKeyTyped(evt);
}//GEN-LAST:event_replaceFindFieldKeyTyped
private void replaceFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_replaceFieldKeyTyped
_sv.validateKeyTyped(evt);
}//GEN-LAST:event_replaceFieldKeyTyped
private void goFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_goFieldFocusGained
if (goField.getText().equalsIgnoreCase("#"))
goField.setText("");
}//GEN-LAST:event_goFieldFocusGained
private void selectFromFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_selectFromFieldFocusGained
if (selectFromField.getText().equalsIgnoreCase("#"))
selectFromField.setText("");
}//GEN-LAST:event_selectFromFieldFocusGained
private void selectToFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_selectToFieldFocusGained
if (selectToField.getText().equalsIgnoreCase("#"))
selectToField.setText("");
}//GEN-LAST:event_selectToFieldFocusGained
private void goFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_goFieldFocusLost
if (goField.getText().equalsIgnoreCase(""))
goField.setText("#");
}//GEN-LAST:event_goFieldFocusLost
private void selectFromFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_selectFromFieldFocusLost
if (selectFromField.getText().equalsIgnoreCase(""))
selectFromField.setText("#");
}//GEN-LAST:event_selectFromFieldFocusLost
private void selectToFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_selectToFieldFocusLost
if (selectToField.getText().equalsIgnoreCase(""))
selectToField.setText("#");
}//GEN-LAST:event_selectToFieldFocusLost
private void goFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_goFieldActionPerformed
_sv.setToolsFields(findField, goField, selectFromField,
selectToField, replaceField, replaceFindField);
_sv.processSearchToolAction(evt, "Go");
}//GEN-LAST:event_goFieldActionPerformed
private void findFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_findFieldKeyPressed
_sv.validateKeyPressed(evt);
}//GEN-LAST:event_findFieldKeyPressed
private void replaceFindFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_replaceFindFieldKeyPressed
_sv.validateKeyPressed(evt);
}//GEN-LAST:event_replaceFindFieldKeyPressed
private void replaceFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_replaceFieldKeyPressed
_sv.validateKeyPressed(evt);
}//GEN-LAST:event_replaceFieldKeyPressed
private void revCompButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_revCompButtonActionPerformed
_sv.processSearchToolAction(evt, "Reverse Complement");
}//GEN-LAST:event_revCompButtonActionPerformed
private void translationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_translationButtonActionPerformed
_sv.processSearchToolAction(evt, "Translation");
}//GEN-LAST:event_translationButtonActionPerformed
private void switchCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_switchCaseButtonActionPerformed
_sv.processSearchToolAction(evt, "Switch Case");
}//GEN-LAST:event_switchCaseButtonActionPerformed
private void highlightRestrictionSitesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_highlightRestrictionSitesButtonActionPerformed
_sv.processSearchToolAction(evt, "Highlight Restriction Sites");
}//GEN-LAST:event_highlightRestrictionSitesButtonActionPerformed
private void highlightFeaturesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_highlightFeaturesButtonActionPerformed
_sv.processSearchToolAction(evt, "Highlight Features");
}//GEN-LAST:event_highlightFeaturesButtonActionPerformed
private void revTranslationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_revTranslationButtonActionPerformed
_sv.processSearchToolAction(evt, "Reverse Translation");
}//GEN-LAST:event_revTranslationButtonActionPerformed
private void lowerCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lowerCaseButtonActionPerformed
_sv.changeCase(false);
}//GEN-LAST:event_lowerCaseButtonActionPerformed
private void upperCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_upperCaseButtonActionPerformed
_sv.changeCase(true);
}//GEN-LAST:event_upperCaseButtonActionPerformed
private void packageAsPartButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_packageAsPartButtonActionPerformed
_sv.packagePartOpen();
}//GEN-LAST:event_packageAsPartButtonActionPerformed
@Deprecated
/**
* Not used by any button
*/
private void exportButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exportButtonActionPerformed
_sv.exportSeq();
}//GEN-LAST:event_exportButtonActionPerformed
private void caseSensitiveCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_caseSensitiveCheckActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_caseSensitiveCheckActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SequenceViewSearchTools().setVisible(true);
}
});
}
private SequenceView _sv;
private javax.swing.JTextField _currentReplaceFindField;
private javax.swing.JTextField _currentReplaceField;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField addressTextField;
private javax.swing.JCheckBox caseSensitiveCheck;
private javax.swing.JComboBox connectionsComboBox;
private javax.swing.JPanel dnaToolsPanel;
private javax.swing.JButton exportButton;
private javax.swing.JPanel exportPanel;
private javax.swing.JCheckBox findBothCheck;
private javax.swing.JTextField findField;
private javax.swing.JButton findNextButton;
private javax.swing.JButton findPrevButton;
private javax.swing.JCheckBox findRevCompCheck;
private javax.swing.JTextField fromTextField;
private javax.swing.JButton goButton;
private javax.swing.JTextField goField;
private javax.swing.JLabel goLabel;
private javax.swing.JPanel goToPanel;
private javax.swing.JButton highlightFeaturesButton;
private javax.swing.JButton highlightRestrictionSitesButton;
private javax.swing.JRadioButton intervalSeqRadioButton;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JButton lowerCaseButton;
private javax.swing.JButton packageAsPartButton;
private javax.swing.JCheckBox pasteRevCompCheckbox;
private javax.swing.JButton replaceAllButton;
private javax.swing.JButton replaceButton;
private javax.swing.JTextField replaceField;
private javax.swing.JTextField replaceFindField;
private javax.swing.JLabel replaceFindLabel;
private javax.swing.JButton replaceNextButton;
private javax.swing.JPanel replacePanel;
private javax.swing.JButton replacePrevButton;
private javax.swing.JLabel replaceWithLabel;
private javax.swing.JButton revCompButton;
private javax.swing.JButton revTranslationButton;
private javax.swing.JRadioButton selSeqRadioButton;
private javax.swing.JButton selectAllButton;
private javax.swing.JToggleButton selectButton;
private javax.swing.JTextField selectFromField;
private javax.swing.JLabel selectFromLabel;
private javax.swing.JTextField selectToField;
private javax.swing.JLabel selectToLabel;
private javax.swing.ButtonGroup seqbuttonGroup;
private javax.swing.JLabel sequenceLabel;
private javax.swing.JButton switchCaseButton;
private javax.swing.JTextField toTextField;
private javax.swing.JTabbedPane toolsTabbedPane;
private javax.swing.JButton translationButton;
private javax.swing.JButton upperCaseButton;
private javax.swing.JRadioButton wholeSeqRadioButton;
// End of variables declaration//GEN-END:variables
}