forked from nikitamahoviya/Plugins_VCell-ImageJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TextHelp.java
343 lines (261 loc) · 11.9 KB
/
TextHelp.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
/*
* #%L
* Core commands for SciJava applications.
* %%
* Copyright (C) 2010 - 2017 Board of Regents of the University of
* Wisconsin-Madison, Broad Institute of MIT and Harvard, and Max Planck
* Institute of Molecular Cell Biology and Genetics.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package org.vcell.imagej.plugin;
import java.awt.Dimension;
import org.scijava.ItemIO;
import org.scijava.ItemVisibility;
import org.scijava.command.Command;
import org.scijava.command.ContextCommand;
import org.scijava.command.Previewable;
import org.scijava.io.RecentFileService;
import org.scijava.menu.MenuConstants;
import org.scijava.plugin.Attr;
import org.scijava.plugin.Menu;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;
import org.scijava.ui.DialogPrompt;
import org.scijava.ui.UIService;
import org.scijava.widget.Button;
import org.scijava.widget.NumberWidget;
//import org.vcell.util.BeanUtils;
import net.imagej.ImageJ;
/*import cbit.vcell.client.PopupGenerator;
import cbit.vcell.resource.PropertyLoader*/
import java.awt.Font;
import java.awt.event.ActionEvent;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.JToolBar;
/**
* A test of text displays.
*
* @author Curtis Rueden
*/
@Plugin(type = Command.class, label = "VCell-ImageJ Help", iconPath="help.gif",menu = {
@Menu(label = MenuConstants.PLUGINS_LABEL, weight = MenuConstants.FILE_WEIGHT,
mnemonic = MenuConstants.FILE_MNEMONIC),
@Menu(label = "VCell Plugins", weight = 4, mnemonic = 'V'),
@Menu(label = "VCell-ImageJ Help", weight = 1,
mnemonic = 'h',accelerator = "^H") }, attrs = { @Attr(name = "no-legacy") })
public class TextHelp implements Command, Previewable {
//"(c) Copyright 1998-2020 UConn Health"
@Parameter
private UIService uiService;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header1 = "<html><h2 style=\"font-family:'Times New Roman';color:green;\">Hello " + System.getProperty("user.name") + " ! Welcome to VCell Help</h2><html>";
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header2 = "<html><h3 style=\"font-family:'Optima';color:red;\">About your machine </h2><html>";
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header3 = "<html><pstyle=\"font-family:'Optima'\">Java Version: "+" " + System.getProperty("java.version") +"<br> Operating System: "+" " +System.getProperty("os.name")+ " " + System.getProperty("os.arch")+"<br>(c) Copyright 1998-2020 UConn Health</p><html>";
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header4 = "<html><h3 style=\"font-family:'Optima';color:red;\">Pre-Requirements for running VCell Plugins </h2><html>";
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header5 = "<html><p style=\"font-family:'Optima'\">Virtual Cell is an advanced software platform for modeling and simulating reaction <br> "
+ " kinetics,membrane transport and diffusion in the complex geometries</p><html>";
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header6 = "<html><p style=\"font-family:'Optima'\">To run various VCell Plugins there are certain pre requirements which are listed below <p> "
+ "<ul> <li>VCell Client ImageJ service should be activated.</li>"
+"<li>Check your connectivity and login to VCell with your userId or as a guest.</li></ul></html>";
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header7 = "<html><h3 style=\"font-family:'Optima';color:red;\">Online Resources</h2><html>";
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header08 = "<html><p style=\"font-family:'Optima'\">To know more about VCell, visit our website. </p><html>";
@Parameter(label="VCell Webiste", callback = "website")
private Button buttonWebsite;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header09 = "<html><p style=\"font-family:'Optima'\">Having doubts or want to discuss with the community, visit the discussion forum</p><html>";
@Parameter(label="Disucssion Forum", callback = "forum")
private Button buttonForum;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header010 = "<html><p style=\"font-family:'Optima'\">Want to learn about changing permission for your model, checkout the permission changing page </p><html>";
@Parameter(label="Change Permission", callback = "permission")
private Button buttonPermission;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header011 = "<html><p style=\"font-family:'Optima'\">Want to make your model public, checkout the publishing model guidelines</p><html>";
@Parameter(label="Publish your Model", callback = "publish")
private Button buttonModel;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header012 = "<html><p style=\"font-family:'Optima'\">Visit VCell Support for your encountered problems</p><html>";
@Parameter(label="Contact Support", callback = "support")
private Button buttonSupport;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header8 = "<html><p style=\"font-family:'Optima'\">Featuring COPASI prameter estimation technology </p><html>";
@Parameter(label="Visit COPASI", callback = "copasi")
private Button buttonCopasi;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header9 = "<html><p style=\"font-family:'Optima'\">Featuring spatial stochastic simulations powered by SMOLDYN </p><html>";
@Parameter(label="Visit SMOLYDYN", callback = "smoldyn")
private Button buttonSmoldyn;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header10 = "<html><p style=\"font-family:'Optima'\">Featuring rule-based simulations powered by BIONETGEN </p><html>";
@Parameter(label="Visit BIONETGEN", callback = "bionetgen", description = "help.gif")
private Button buttonBionetgen;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header11 = "<html><p style=\"font-family:'Optima'\">Featuring network-free stochastic simulations powered by NFsim </p><html>";
@Parameter(label="Visit NFsim", callback = "nfsim")
private Button buttonNfsim;
@Parameter(visibility = ItemVisibility.MESSAGE)
private final String header12 = "<html><p style=\"font-family:'Optima';color: blue;\">Virtual Cell is supported by NIH Grant R24 GM137787 from the National Institute <br> "
+ " for General Medical Sciences</p><html>";
public static void main(final String... args) throws Exception {
// create the ImageJ application context with all available services
final ImageJ ij = new ImageJ();
ij.ui().showUI();
}
private JDialog progressDialog = null;
private final Dimension dim = new Dimension(200,25);
private final JProgressBar jProgressBar = new JProgressBar(0,100) {
@Override
public Dimension getPreferredSize() {
// TODO Auto-generated method stub
return dim;
}
@Override
public Dimension getSize(Dimension rv) {
// TODO Auto-generated method stub
return dim;
}
};
//for launching the VCell Website
protected void website()
{
try {
String myurl = "https://vcell.org/";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
//for launching the discussion forum
protected void forum()
{
try {
String myurl = "https://groups.google.com/g/vcell-discuss";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
//for launching the changing permission dialog
protected void permission()
{
try {
String myurl = "https://vcell.org/webstart/VCell_Tutorials/VCell_Help/topics/ch_1/Introduction/Permissions.html";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
//for publising your model
protected void publish()
{
try {
String myurl = "https://vcell.org/publish-a-vcell-model";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
//for launching the support
protected void support()
{
try {
String myurl = "https://vcell.org/support";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
//for launching the COPASI
protected void copasi()
{
try {
String myurl = "http://copasi.org/";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
//for launching the SMOLDYN
protected void smoldyn()
{
try {
String myurl = "http://www.smoldyn.org/";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
//for launching the BIONETEGEN
protected void bionetgen()
{
try {
String myurl = "http://bionetgen.org/";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
//for launching the BIONETEGEN
protected void nfsim()
{
try {
String myurl = "http://michaelsneddon.net/nfsim/";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
@Override
public void preview() {
// TODO Auto-generated method stub
}
@Override
public void cancel() {
// TODO Auto-generated method stub
}
@Override
public void run() {
// TODO Auto-generated method stub
}
}