Jalview Imported Sources
[jalview.git] / src / jalview / gui / CutAndPasteTransfer.java
1 /********************
2  * 2004 Jalview Reengineered
3  * Barton Group
4  * Dundee University
5  *
6  * AM Waterhouse
7  *******************/
8
9 package jalview.gui;
10
11 import jalview.jbgui.GCutAndPasteTransfer;
12 import java.awt.*;
13
14 public class CutAndPasteTransfer extends GCutAndPasteTransfer
15 {
16   public CutAndPasteTransfer(boolean forImport)
17   {
18     super();
19     for (int i = 0; i < jalview.io.FormatProperties.getFormats().size(); i++) {
20      formatChoice.addItem((String)jalview.io.FormatProperties.getFormats().elementAt(i));
21    }
22
23
24     if(forImport)
25     {
26       formatLabel.setVisible(false);
27       formatChoice.setVisible(false);
28       textarea.setBounds(new Rectangle(9, 6, 383, 284));
29     }
30   }
31
32   // this method is called once the user has selected an output format
33   public void formatForOutput()
34   {
35     textarea.setFont(new Font("Monospaced", Font.PLAIN, 12));
36     setLayout(new BorderLayout());
37     add(scrollPane, BorderLayout.CENTER);
38     remove(formatLabel);
39     remove(formatChoice);
40   }
41
42   public String getFormat()
43   {
44     return formatChoice.getSelectedItem().toString();
45   }
46   public String getText()
47   {
48     return textarea.getText();
49   }
50
51   public void setText(String text)
52   {
53     textarea.setText(text);
54   }
55 }