2 |
26 Feb 07 |
jari |
1 |
/* |
2 |
26 Feb 07 |
jari |
Copyright @ 1999-2004, The Institute for Genomic Research (TIGR). |
2 |
26 Feb 07 |
jari |
All rights reserved. |
2 |
26 Feb 07 |
jari |
4 |
*/ |
2 |
26 Feb 07 |
jari |
5 |
/* |
2 |
26 Feb 07 |
jari |
* TextViewer.java |
2 |
26 Feb 07 |
jari |
7 |
* |
2 |
26 Feb 07 |
jari |
* Created on October 8, 2004, 12:56 PM |
2 |
26 Feb 07 |
jari |
9 |
*/ |
2 |
26 Feb 07 |
jari |
10 |
|
2 |
26 Feb 07 |
jari |
11 |
package org.tigr.microarray.mev.cluster.gui.helpers; |
2 |
26 Feb 07 |
jari |
12 |
|
2 |
26 Feb 07 |
jari |
13 |
import java.awt.Color; |
2 |
26 Feb 07 |
jari |
14 |
import java.awt.GridBagConstraints; |
2 |
26 Feb 07 |
jari |
15 |
import java.awt.GridBagLayout; |
2 |
26 Feb 07 |
jari |
16 |
import java.awt.Insets; |
2 |
26 Feb 07 |
jari |
17 |
import java.io.IOException; |
2 |
26 Feb 07 |
jari |
18 |
import java.io.ObjectInputStream; |
2 |
26 Feb 07 |
jari |
19 |
import java.io.ObjectOutputStream; |
2 |
26 Feb 07 |
jari |
20 |
import java.io.Serializable; |
2 |
26 Feb 07 |
jari |
21 |
|
2 |
26 Feb 07 |
jari |
22 |
import javax.swing.JComponent; |
2 |
26 Feb 07 |
jari |
23 |
import javax.swing.JPanel; |
2 |
26 Feb 07 |
jari |
24 |
import javax.swing.JTextPane; |
2 |
26 Feb 07 |
jari |
25 |
|
2 |
26 Feb 07 |
jari |
26 |
import org.tigr.microarray.mev.cluster.gui.Experiment; |
2 |
26 Feb 07 |
jari |
27 |
import org.tigr.microarray.mev.cluster.gui.impl.ViewerAdapter; |
2 |
26 Feb 07 |
jari |
28 |
/** |
2 |
26 Feb 07 |
jari |
29 |
* |
2 |
26 Feb 07 |
jari |
* @author braisted |
2 |
26 Feb 07 |
jari |
31 |
*/ |
2 |
26 Feb 07 |
jari |
32 |
public class TextViewer extends ViewerAdapter implements Serializable { |
2 |
26 Feb 07 |
jari |
33 |
|
2 |
26 Feb 07 |
jari |
34 |
private JPanel content; |
2 |
26 Feb 07 |
jari |
35 |
private JTextPane pane; |
2 |
26 Feb 07 |
jari |
36 |
private String text; |
2 |
26 Feb 07 |
jari |
37 |
|
2 |
26 Feb 07 |
jari |
38 |
|
2 |
26 Feb 07 |
jari |
39 |
public String getText() {return text;} |
2 |
26 Feb 07 |
jari |
40 |
|
2 |
26 Feb 07 |
jari |
41 |
public static String[] getPersistenceDelegateArgs() { |
2 |
26 Feb 07 |
jari |
42 |
return new String[]{"text"}; |
2 |
26 Feb 07 |
jari |
43 |
} |
2 |
26 Feb 07 |
jari |
44 |
public TextViewer(JPanel content, Object header){ |
2 |
26 Feb 07 |
jari |
45 |
this.content = content; |
2 |
26 Feb 07 |
jari |
46 |
} |
2 |
26 Feb 07 |
jari |
47 |
public void setExperiment(Experiment e){} |
2 |
26 Feb 07 |
jari |
48 |
|
2 |
26 Feb 07 |
jari |
/** Creates a new instance of TextViewer */ |
2 |
26 Feb 07 |
jari |
50 |
public TextViewer(String message) { |
2 |
26 Feb 07 |
jari |
51 |
text = message; |
2 |
26 Feb 07 |
jari |
52 |
content = new JPanel(new GridBagLayout()); |
2 |
26 Feb 07 |
jari |
53 |
content.setBackground(Color.white); |
2 |
26 Feb 07 |
jari |
54 |
pane = new JTextPane(); |
2 |
26 Feb 07 |
jari |
55 |
pane.setEditable(false); |
2 |
26 Feb 07 |
jari |
56 |
pane.setContentType("text/html"); |
2 |
26 Feb 07 |
jari |
57 |
pane.setMargin(new Insets(5,5,5,5)); |
2 |
26 Feb 07 |
jari |
58 |
pane.setText(message); |
2 |
26 Feb 07 |
jari |
59 |
content.add(pane, new GridBagConstraints(0,0,1,1,1,1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5,5,5,5),0,0)); |
2 |
26 Feb 07 |
jari |
60 |
} |
2 |
26 Feb 07 |
jari |
61 |
|
2 |
26 Feb 07 |
jari |
62 |
public JComponent getContentComponent() { |
2 |
26 Feb 07 |
jari |
63 |
return content; |
2 |
26 Feb 07 |
jari |
64 |
} |
2 |
26 Feb 07 |
jari |
65 |
|
2 |
26 Feb 07 |
jari |
66 |
} |