source: trunk/greenstone3-extensions/vishnu/src/vishnu/testvis/visual/VishnuSingle.java@ 8189

Last change on this file since 8189 was 8189, checked in by kjdon, 20 years ago

first version of Imperial College's Visualiser code

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1package vishnu.testvis.visual;
2import vishnu.testvis.treemap.visual.TMNavigator;
3import vishnu.testvis.sammon.*;
4import vishnu.testvis.object.*;
5import vishnu.testvis.evaluate.*;
6import vishnu.testvis.dendro.*;
7import java.awt.*;
8import javax.swing.*;
9import java.awt.event.*;
10import java.beans.*;
11import javax.swing.event.*;
12import java.io.*;
13import java.util.Vector;
14import java.util.Properties;
15import java.applet.*;
16import java.net.*;
17import vishnu.datablock.*;
18
19public class VishnuSingle extends Vishnu
20{
21
22 protected void initCollections() {
23 // put in a dummy Collection
24 Collection c = new Collection(coll, coll, coll, 0, coll);
25 dataManager.currentCollection = c;
26
27 // and sneak in a call to dataManager
28 String engine = getParameter("engine");
29 if (engine != null && !engine.equals("")) {
30 dataManager.setEngineType(engine);
31 } else {
32 dataManager.setEngineType("GSDLEngine");
33 }
34 }
35
36 // overwrite this to remove the collection stuff - cos we are working within one collection only
37 protected void jbInit() throws Exception {
38 JPanel pane = new JPanel();
39 setContentPane(pane);
40 pane.setBorder(BorderFactory.createLineBorder(Color.black, 2));
41 pane.setLayout(new BorderLayout());
42
43 JPanel searchPanel = new JPanel();
44 searchPanel.setLayout(new BorderLayout(5,5));
45 searchPanel.setBackground(SystemColor.control);
46 searchBox = new JTextField();
47 searchBox.setPreferredSize(new Dimension((int)(size.width/5), 26));
48 searchBox.setEditable(true);
49 searchBox.addKeyListener(new java.awt.event.KeyAdapter(){
50 public void keyPressed(KeyEvent e)
51 {
52 findButton_keyPressed(e);
53 }
54 });
55
56 JLabel searchLabel = new JLabel();
57 searchLabel.setFont(new java.awt.Font("Monospaced", 0, largeFont));
58 searchLabel.setForeground(Color.black);
59 searchLabel.setText("Search:");
60
61 searchPanel.add(searchLabel, BorderLayout.WEST);
62 searchPanel.add(searchBox, BorderLayout.CENTER);
63
64
65 JPanel topPanel = new JPanel();
66 topPanel.setLayout(new BorderLayout(10,10));
67 topPanel.setBackground(SystemColor.control);
68 topPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
69
70 JPanel backPanel = new JPanel();
71 backPanel.setPreferredSize(new Dimension(size.width,size.height));
72 backPanel.setBackground(SystemColor.control);
73 backPanel.setLayout(new BorderLayout());
74
75 theTabbedPane.setBackground(SystemColor.control);
76 theTabbedPane.setFont(new java.awt.Font("Monospaced", Font.BOLD, largeFont));
77 theTabbedPane.addChangeListener(new javax.swing.event.ChangeListener(){
78 public void stateChanged(ChangeEvent e)
79 {
80 theTabbedPane_stateChanged(e);
81 }
82 });
83
84 findButton.setBackground(SystemColor.control);
85 findButton.setFont(new java.awt.Font("Monospaced", 0, largeFont));
86 findButton.setBorder(BorderFactory.createEtchedBorder());
87 findButton.setText("Find");
88 findButton.addKeyListener(new java.awt.event.KeyAdapter(){
89 public void keyPressed(KeyEvent e)
90 {
91 findButton_keyPressed(e);
92 }
93 });
94
95 findButton.addMouseListener(new java.awt.event.MouseAdapter(){
96 public void mouseClicked(MouseEvent e)
97 {
98 findButton_mouseClicked(e);
99 }
100 });
101
102 pane.add(backPanel, BorderLayout.CENTER);
103 backPanel.add(theTabbedPane, BorderLayout.CENTER);
104
105 theTabbedPane.add(plainPanel, "PlainVis");
106 theTabbedPane.add(radVizPanel, "RadialVis");
107 theTabbedPane.add(sammonPanel,"SammonVis");
108 theTabbedPane.add(dendroPanel,"DendroVis");
109 theTabbedPane.setForegroundAt(0,Color.blue);
110
111 pane.add(topPanel, BorderLayout.NORTH);
112
113 topPanel.add(searchPanel, BorderLayout.CENTER);
114 topPanel.add(findButton, BorderLayout.EAST);
115
116 theTabbedPane.setPreferredSize(size);
117
118 }
119
120
121}
122
123
124
125
126
Note: See TracBrowser for help on using the repository browser.