Neurogami-roir 1.3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +22 -0
- data/Manifest.txt +250 -0
- data/README.md +12 -0
- data/Rakefile +63 -0
- data/bin/roir +176 -0
- data/data/GenericJavaApp.icns +0 -0
- data/data/JavaApplicationStub +0 -0
- data/data/Rawr logo 1 large.png +0 -0
- data/data/Rawr logo 2 large.png +0 -0
- data/data/Rawr logo2.png +0 -0
- data/data/website/_notes/dwsync.xml +1 -0
- data/data/website/css/1.css +254 -0
- data/data/website/css/_notes/dwsync.xml +1 -0
- data/data/website/images/_notes/dwsync.xml +1 -0
- data/data/website/images/body_bg.jpg +0 -0
- data/data/website/images/bullet.gif +0 -0
- data/data/website/images/content.jpg +0 -0
- data/data/website/images/content_h2.gif +0 -0
- data/data/website/images/details.gif +0 -0
- data/data/website/images/details.jpg +0 -0
- data/data/website/images/header_bg.jpg +0 -0
- data/data/website/images/nav_a_hover.gif +0 -0
- data/data/website/images/rawr_logo.png +0 -0
- data/data/website/index.html +164 -0
- data/lib/app_bundler.rb +138 -0
- data/lib/bundler.rb +36 -0
- data/lib/command.rb +68 -0
- data/lib/exe_bundler.rb +106 -0
- data/lib/generator.rb +127 -0
- data/lib/jar_builder.rb +57 -0
- data/lib/jruby_batch_compiler.rb +127 -0
- data/lib/jruby_release.rb +104 -0
- data/lib/launch4j/LICENSE.txt +30 -0
- data/lib/launch4j/bin-linux/COPYING +340 -0
- data/lib/launch4j/bin-linux/ld +0 -0
- data/lib/launch4j/bin-linux/windres +0 -0
- data/lib/launch4j/bin-mac/COPYING +340 -0
- data/lib/launch4j/bin-mac/ld +0 -0
- data/lib/launch4j/bin-mac/readme.txt +1 -0
- data/lib/launch4j/bin-mac/windres +0 -0
- data/lib/launch4j/bin-win/COPYING +340 -0
- data/lib/launch4j/bin-win/ld.exe +0 -0
- data/lib/launch4j/bin-win/windres.exe +0 -0
- data/lib/launch4j/build.xml +62 -0
- data/lib/launch4j/demo/ConsoleApp/ConsoleApp.jar +0 -0
- data/lib/launch4j/demo/ConsoleApp/build.xml +57 -0
- data/lib/launch4j/demo/ConsoleApp/l4j/ConsoleApp.ico +0 -0
- data/lib/launch4j/demo/ConsoleApp/lib/readme.txt +8 -0
- data/lib/launch4j/demo/ConsoleApp/readme.txt +1 -0
- data/lib/launch4j/demo/ConsoleApp/src/net/sf/launch4j/example/ConsoleApp.java +72 -0
- data/lib/launch4j/demo/LICENSE.txt +30 -0
- data/lib/launch4j/demo/SimpleApp/SimpleApp.jar +0 -0
- data/lib/launch4j/demo/SimpleApp/build.xml +52 -0
- data/lib/launch4j/demo/SimpleApp/l4j/SimpleApp.ico +0 -0
- data/lib/launch4j/demo/SimpleApp/l4j/SimpleApp.xml +18 -0
- data/lib/launch4j/demo/SimpleApp/l4j/splash.bmp +0 -0
- data/lib/launch4j/demo/SimpleApp/lib/readme.txt +8 -0
- data/lib/launch4j/demo/SimpleApp/readme.txt +1 -0
- data/lib/launch4j/demo/SimpleApp/src/net/sf/launch4j/example/SimpleApp.java +104 -0
- data/lib/launch4j/demo/readme.txt +3 -0
- data/lib/launch4j/head/LICENSE.txt +23 -0
- data/lib/launch4j/head/consolehead.o +0 -0
- data/lib/launch4j/head/guihead.o +0 -0
- data/lib/launch4j/head/head.o +0 -0
- data/lib/launch4j/head_src/LICENSE.txt +23 -0
- data/lib/launch4j/head_src/consolehead/Makefile.win +33 -0
- data/lib/launch4j/head_src/consolehead/consolehead.c +65 -0
- data/lib/launch4j/head_src/consolehead/consolehead.dev +108 -0
- data/lib/launch4j/head_src/guihead/Makefile.win +33 -0
- data/lib/launch4j/head_src/guihead/guihead.c +185 -0
- data/lib/launch4j/head_src/guihead/guihead.dev +109 -0
- data/lib/launch4j/head_src/guihead/guihead.h +43 -0
- data/lib/launch4j/head_src/head.c +807 -0
- data/lib/launch4j/head_src/head.h +113 -0
- data/lib/launch4j/head_src/resource.h +71 -0
- data/lib/launch4j/launch4j +8 -0
- data/lib/launch4j/launch4j.jar +0 -0
- data/lib/launch4j/launch4j.jfpr +0 -0
- data/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt +31 -0
- data/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt +31 -0
- data/lib/launch4j/lib/Nuvola.Icon.Theme.LICENSE.txt +504 -0
- data/lib/launch4j/lib/XStream.LICENSE.txt +27 -0
- data/lib/launch4j/lib/commons-beanutils.jar +0 -0
- data/lib/launch4j/lib/commons-logging.jar +0 -0
- data/lib/launch4j/lib/commons.LICENSE.txt +50 -0
- data/lib/launch4j/lib/forms.jar +0 -0
- data/lib/launch4j/lib/formsrt.jar +0 -0
- data/lib/launch4j/lib/foxtrot.LICENSE.txt +25 -0
- data/lib/launch4j/lib/foxtrot.jar +0 -0
- data/lib/launch4j/lib/looks.jar +0 -0
- data/lib/launch4j/lib/xstream.jar +0 -0
- data/lib/launch4j/manifest/uac.exe.manifest +12 -0
- data/lib/launch4j/manifest/xp-themes.exe.manifest +14 -0
- data/lib/launch4j/src/images/asterix-o.gif +0 -0
- data/lib/launch4j/src/images/asterix.gif +0 -0
- data/lib/launch4j/src/images/build.png +0 -0
- data/lib/launch4j/src/images/button_ok.png +0 -0
- data/lib/launch4j/src/images/cancel16.png +0 -0
- data/lib/launch4j/src/images/down16.png +0 -0
- data/lib/launch4j/src/images/edit_add16.png +0 -0
- data/lib/launch4j/src/images/info.png +0 -0
- data/lib/launch4j/src/images/new.png +0 -0
- data/lib/launch4j/src/images/new16.png +0 -0
- data/lib/launch4j/src/images/ok16.png +0 -0
- data/lib/launch4j/src/images/open.png +0 -0
- data/lib/launch4j/src/images/open16.png +0 -0
- data/lib/launch4j/src/images/run.png +0 -0
- data/lib/launch4j/src/images/save.png +0 -0
- data/lib/launch4j/src/images/up16.png +0 -0
- data/lib/launch4j/src/launch4j.properties +2 -0
- data/lib/launch4j/src/net/sf/launch4j/Builder.java +207 -0
- data/lib/launch4j/src/net/sf/launch4j/BuilderException.java +52 -0
- data/lib/launch4j/src/net/sf/launch4j/ExecException.java +66 -0
- data/lib/launch4j/src/net/sf/launch4j/FileChooserFilter.java +76 -0
- data/lib/launch4j/src/net/sf/launch4j/Log.java +105 -0
- data/lib/launch4j/src/net/sf/launch4j/Main.java +99 -0
- data/lib/launch4j/src/net/sf/launch4j/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/OptionParser.java +71 -0
- data/lib/launch4j/src/net/sf/launch4j/RcBuilder.java +340 -0
- data/lib/launch4j/src/net/sf/launch4j/Util.java +197 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntClassPath.java +61 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntConfig.java +129 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntJre.java +69 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/Launch4jTask.java +162 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/StringWrapper.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/messages.properties +35 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/messages_es.properties +35 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Binding.java +62 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/BindingException.java +52 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Bindings.java +317 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/IValidatable.java +44 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/InvariantViolationException.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JComboBoxBinding.java +119 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JListBinding.java +118 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JRadioButtonBinding.java +146 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JTextAreaBinding.java +123 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JTextComponentBinding.java +108 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JToggleButtonBinding.java +108 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/OptComponentBinding.java +119 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/OptJTextAreaBinding.java +141 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Validator.java +259 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/messages.properties +52 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/messages_es.properties +51 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ClassPath.java +87 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Config.java +396 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ConfigPersister.java +249 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ConfigPersisterException.java +51 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Jre.java +235 -0
- data/lib/launch4j/src/net/sf/launch4j/config/LdDefaults.java +62 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Msg.java +111 -0
- data/lib/launch4j/src/net/sf/launch4j/config/SingleInstance.java +74 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Splash.java +103 -0
- data/lib/launch4j/src/net/sf/launch4j/config/VersionInfo.java +168 -0
- data/lib/launch4j/src/net/sf/launch4j/config/messages.properties +93 -0
- data/lib/launch4j/src/net/sf/launch4j/config/messages_es.properties +75 -0
- data/lib/launch4j/src/net/sf/launch4j/form/BasicForm.java +283 -0
- data/lib/launch4j/src/net/sf/launch4j/form/BasicForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ClassPathForm.java +193 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ClassPathForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ConfigForm.java +132 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ConfigForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/EnvironmentVarsForm.java +127 -0
- data/lib/launch4j/src/net/sf/launch4j/form/EnvironmentVarsForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/HeaderForm.java +171 -0
- data/lib/launch4j/src/net/sf/launch4j/form/HeaderForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/JreForm.java +266 -0
- data/lib/launch4j/src/net/sf/launch4j/form/JreForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/form/MessagesForm.java +183 -0
- data/lib/launch4j/src/net/sf/launch4j/form/MessagesForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SingleInstanceForm.java +141 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SingleInstanceForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SplashForm.java +166 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SplashForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/VersionInfoForm.java +232 -0
- data/lib/launch4j/src/net/sf/launch4j/form/VersionInfoForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/messages.properties +146 -0
- data/lib/launch4j/src/net/sf/launch4j/form/messages_es.properties +118 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/AbstractAcceptListener.java +75 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/BasicFormImpl.java +101 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/BrowseActionListener.java +79 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/ClassPathFormImpl.java +222 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/ConfigFormImpl.java +100 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/EnvironmentVarsFormImpl.java +50 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/FileChooser.java +65 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/GlassPane.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/HeaderFormImpl.java +102 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/JreFormImpl.java +166 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/MainFrame.java +358 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/MessagesFormImpl.java +58 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/SingleInstanceFormImpl.java +54 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/SplashFormImpl.java +61 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/VersionInfoFormImpl.java +63 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/messages.properties +74 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/messages_es.properties +56 -0
- data/lib/launch4j/src/net/sf/launch4j/messages.properties +45 -0
- data/lib/launch4j/src/net/sf/launch4j/messages_es.properties +45 -0
- data/lib/launch4j/w32api/MinGW.LICENSE.txt +25 -0
- data/lib/launch4j/w32api/crt2.o +0 -0
- data/lib/launch4j/w32api/libadvapi32.a +0 -0
- data/lib/launch4j/w32api/libgcc.a +0 -0
- data/lib/launch4j/w32api/libkernel32.a +0 -0
- data/lib/launch4j/w32api/libmingw32.a +0 -0
- data/lib/launch4j/w32api/libmsvcrt.a +0 -0
- data/lib/launch4j/w32api/libshell32.a +0 -0
- data/lib/launch4j/w32api/libuser32.a +0 -0
- data/lib/launch4j/web/bullet.gif +0 -0
- data/lib/launch4j/web/changelog.html +356 -0
- data/lib/launch4j/web/docs.html +585 -0
- data/lib/launch4j/web/index.html +128 -0
- data/lib/launch4j/web/launch4j-use.gif +0 -0
- data/lib/launch4j/web/launch4j.gif +0 -0
- data/lib/launch4j/web/links.html +73 -0
- data/lib/launch4j/web/style.css +159 -0
- data/lib/options.rb +101 -0
- data/lib/platform.rb +28 -0
- data/lib/rawr.rb +178 -0
- data/lib/rawr_bundle.rb +26 -0
- data/lib/rawr_version.rb +3 -0
- data/lib/web_bundler.rb +114 -0
- data/lib/zip/ioextras.rb +155 -0
- data/lib/zip/stdrubyext.rb +111 -0
- data/lib/zip/tempfile_bugfixed.rb +195 -0
- data/lib/zip/zip.rb +1848 -0
- data/lib/zip/zipfilesystem.rb +609 -0
- data/lib/zip/ziprequire.rb +90 -0
- data/tasks/ann.rake +81 -0
- data/tasks/bones.rake +21 -0
- data/tasks/gem.rake +121 -0
- data/tasks/manifest.rake +49 -0
- data/tasks/notes.rake +28 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +51 -0
- data/tasks/rubyforge.rake +57 -0
- data/tasks/setup.rb +269 -0
- data/tasks/spec.rake +63 -0
- data/tasks/svn.rake +48 -0
- data/tasks/test.rake +38 -0
- data/test/unit/app_bundler_spec.rb +65 -0
- data/test/unit/bundler_spec.rb +27 -0
- data/test/unit/generator_spec.rb +49 -0
- data/test/unit/jar_builder_spec.rb +5 -0
- data/test/unit/options_spec.rb +97 -0
- data/test/unit/platform_spec.rb +29 -0
- data/test/unit/spec_helpers.rb +22 -0
- data/test/unit/web_bundler_spec.rb +83 -0
- metadata +501 -0
@@ -0,0 +1,283 @@
|
|
1
|
+
package net.sf.launch4j.form;
|
2
|
+
|
3
|
+
import com.jeta.forms.components.separator.TitledSeparator;
|
4
|
+
import com.jgoodies.forms.layout.CellConstraints;
|
5
|
+
import com.jgoodies.forms.layout.FormLayout;
|
6
|
+
import java.awt.BorderLayout;
|
7
|
+
import java.awt.Container;
|
8
|
+
import java.awt.Dimension;
|
9
|
+
import javax.swing.Box;
|
10
|
+
import javax.swing.ButtonGroup;
|
11
|
+
import javax.swing.ImageIcon;
|
12
|
+
import javax.swing.JButton;
|
13
|
+
import javax.swing.JCheckBox;
|
14
|
+
import javax.swing.JLabel;
|
15
|
+
import javax.swing.JPanel;
|
16
|
+
import javax.swing.JRadioButton;
|
17
|
+
import javax.swing.JTextField;
|
18
|
+
|
19
|
+
public abstract class BasicForm extends JPanel
|
20
|
+
{
|
21
|
+
protected final JButton _outfileButton = new JButton();
|
22
|
+
protected final JLabel _outfileLabel = new JLabel();
|
23
|
+
protected final JLabel _iconLabel = new JLabel();
|
24
|
+
protected final JLabel _jarLabel = new JLabel();
|
25
|
+
protected final JButton _jarButton = new JButton();
|
26
|
+
protected final JButton _iconButton = new JButton();
|
27
|
+
protected final JLabel _cmdLineLabel = new JLabel();
|
28
|
+
protected final JLabel _optionsLabel = new JLabel();
|
29
|
+
protected final JLabel _chdirLabel = new JLabel();
|
30
|
+
protected final JLabel _processPriorityLabel = new JLabel();
|
31
|
+
protected final JRadioButton _normalPriorityRadio = new JRadioButton();
|
32
|
+
protected final ButtonGroup _buttongroup1 = new ButtonGroup();
|
33
|
+
protected final JRadioButton _idlePriorityRadio = new JRadioButton();
|
34
|
+
protected final JRadioButton _highPriorityRadio = new JRadioButton();
|
35
|
+
protected final JCheckBox _customProcNameCheck = new JCheckBox();
|
36
|
+
protected final JCheckBox _stayAliveCheck = new JCheckBox();
|
37
|
+
protected final JTextField _cmdLineField = new JTextField();
|
38
|
+
protected final JTextField _chdirField = new JTextField();
|
39
|
+
protected final JTextField _iconField = new JTextField();
|
40
|
+
protected final JCheckBox _dontWrapJarCheck = new JCheckBox();
|
41
|
+
protected final JTextField _jarField = new JTextField();
|
42
|
+
protected final JTextField _outfileField = new JTextField();
|
43
|
+
protected final JLabel _errorTitleLabel = new JLabel();
|
44
|
+
protected final JTextField _errorTitleField = new JTextField();
|
45
|
+
protected final JLabel _downloadUrlLabel = new JLabel();
|
46
|
+
protected final JTextField _downloadUrlField = new JTextField();
|
47
|
+
protected final JLabel _supportUrlLabel = new JLabel();
|
48
|
+
protected final JTextField _supportUrlField = new JTextField();
|
49
|
+
protected final JTextField _manifestField = new JTextField();
|
50
|
+
protected final JButton _manifestButton = new JButton();
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Default constructor
|
54
|
+
*/
|
55
|
+
public BasicForm()
|
56
|
+
{
|
57
|
+
initializePanel();
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Adds fill components to empty cells in the first row and first column of the grid.
|
62
|
+
* This ensures that the grid spacing will be the same as shown in the designer.
|
63
|
+
* @param cols an array of column indices in the first row where fill components should be added.
|
64
|
+
* @param rows an array of row indices in the first column where fill components should be added.
|
65
|
+
*/
|
66
|
+
void addFillComponents( Container panel, int[] cols, int[] rows )
|
67
|
+
{
|
68
|
+
Dimension filler = new Dimension(10,10);
|
69
|
+
|
70
|
+
boolean filled_cell_11 = false;
|
71
|
+
CellConstraints cc = new CellConstraints();
|
72
|
+
if ( cols.length > 0 && rows.length > 0 )
|
73
|
+
{
|
74
|
+
if ( cols[0] == 1 && rows[0] == 1 )
|
75
|
+
{
|
76
|
+
/** add a rigid area */
|
77
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) );
|
78
|
+
filled_cell_11 = true;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
for( int index = 0; index < cols.length; index++ )
|
83
|
+
{
|
84
|
+
if ( cols[index] == 1 && filled_cell_11 )
|
85
|
+
{
|
86
|
+
continue;
|
87
|
+
}
|
88
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) );
|
89
|
+
}
|
90
|
+
|
91
|
+
for( int index = 0; index < rows.length; index++ )
|
92
|
+
{
|
93
|
+
if ( rows[index] == 1 && filled_cell_11 )
|
94
|
+
{
|
95
|
+
continue;
|
96
|
+
}
|
97
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) );
|
98
|
+
}
|
99
|
+
|
100
|
+
}
|
101
|
+
|
102
|
+
/**
|
103
|
+
* Helper method to load an image file from the CLASSPATH
|
104
|
+
* @param imageName the package and name of the file to load relative to the CLASSPATH
|
105
|
+
* @return an ImageIcon instance with the specified image file
|
106
|
+
* @throws IllegalArgumentException if the image resource cannot be loaded.
|
107
|
+
*/
|
108
|
+
public ImageIcon loadImage( String imageName )
|
109
|
+
{
|
110
|
+
try
|
111
|
+
{
|
112
|
+
ClassLoader classloader = getClass().getClassLoader();
|
113
|
+
java.net.URL url = classloader.getResource( imageName );
|
114
|
+
if ( url != null )
|
115
|
+
{
|
116
|
+
ImageIcon icon = new ImageIcon( url );
|
117
|
+
return icon;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
catch( Exception e )
|
121
|
+
{
|
122
|
+
e.printStackTrace();
|
123
|
+
}
|
124
|
+
throw new IllegalArgumentException( "Unable to load image: " + imageName );
|
125
|
+
}
|
126
|
+
|
127
|
+
public JPanel createPanel()
|
128
|
+
{
|
129
|
+
JPanel jpanel1 = new JPanel();
|
130
|
+
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:3DLU:NONE,FILL:26PX:NONE,FILL:7DLU:NONE","CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE");
|
131
|
+
CellConstraints cc = new CellConstraints();
|
132
|
+
jpanel1.setLayout(formlayout1);
|
133
|
+
|
134
|
+
_outfileButton.setIcon(loadImage("images/open16.png"));
|
135
|
+
_outfileButton.setName("outfileButton");
|
136
|
+
jpanel1.add(_outfileButton,cc.xy(12,2));
|
137
|
+
|
138
|
+
_outfileLabel.setIcon(loadImage("images/asterix.gif"));
|
139
|
+
_outfileLabel.setName("outfileLabel");
|
140
|
+
_outfileLabel.setText(Messages.getString("outfile"));
|
141
|
+
jpanel1.add(_outfileLabel,cc.xy(2,2));
|
142
|
+
|
143
|
+
_iconLabel.setName("iconLabel");
|
144
|
+
_iconLabel.setText(Messages.getString("icon"));
|
145
|
+
jpanel1.add(_iconLabel,cc.xy(2,10));
|
146
|
+
|
147
|
+
_jarLabel.setIcon(loadImage("images/asterix.gif"));
|
148
|
+
_jarLabel.setName("jarLabel");
|
149
|
+
_jarLabel.setText(Messages.getString("jar"));
|
150
|
+
jpanel1.add(_jarLabel,cc.xy(2,4));
|
151
|
+
|
152
|
+
_jarButton.setIcon(loadImage("images/open16.png"));
|
153
|
+
_jarButton.setName("jarButton");
|
154
|
+
jpanel1.add(_jarButton,cc.xy(12,4));
|
155
|
+
|
156
|
+
_iconButton.setIcon(loadImage("images/open16.png"));
|
157
|
+
_iconButton.setName("iconButton");
|
158
|
+
jpanel1.add(_iconButton,cc.xy(12,10));
|
159
|
+
|
160
|
+
_cmdLineLabel.setName("cmdLineLabel");
|
161
|
+
_cmdLineLabel.setText(Messages.getString("cmdLine"));
|
162
|
+
_cmdLineLabel.setToolTipText("");
|
163
|
+
jpanel1.add(_cmdLineLabel,cc.xy(2,14));
|
164
|
+
|
165
|
+
_optionsLabel.setName("optionsLabel");
|
166
|
+
_optionsLabel.setText(Messages.getString("options"));
|
167
|
+
jpanel1.add(_optionsLabel,cc.xy(2,18));
|
168
|
+
|
169
|
+
_chdirLabel.setName("chdirLabel");
|
170
|
+
_chdirLabel.setText(Messages.getString("chdir"));
|
171
|
+
jpanel1.add(_chdirLabel,cc.xy(2,12));
|
172
|
+
|
173
|
+
_processPriorityLabel.setName("processPriorityLabel");
|
174
|
+
_processPriorityLabel.setText(Messages.getString("priority"));
|
175
|
+
jpanel1.add(_processPriorityLabel,cc.xy(2,16));
|
176
|
+
|
177
|
+
_normalPriorityRadio.setActionCommand(Messages.getString("normalPriority"));
|
178
|
+
_normalPriorityRadio.setName("normalPriorityRadio");
|
179
|
+
_normalPriorityRadio.setText(Messages.getString("normalPriority"));
|
180
|
+
_buttongroup1.add(_normalPriorityRadio);
|
181
|
+
jpanel1.add(_normalPriorityRadio,cc.xy(4,16));
|
182
|
+
|
183
|
+
_idlePriorityRadio.setActionCommand(Messages.getString("idlePriority"));
|
184
|
+
_idlePriorityRadio.setName("idlePriorityRadio");
|
185
|
+
_idlePriorityRadio.setText(Messages.getString("idlePriority"));
|
186
|
+
_buttongroup1.add(_idlePriorityRadio);
|
187
|
+
jpanel1.add(_idlePriorityRadio,cc.xy(6,16));
|
188
|
+
|
189
|
+
_highPriorityRadio.setActionCommand(Messages.getString("highPriority"));
|
190
|
+
_highPriorityRadio.setName("highPriorityRadio");
|
191
|
+
_highPriorityRadio.setText(Messages.getString("highPriority"));
|
192
|
+
_buttongroup1.add(_highPriorityRadio);
|
193
|
+
jpanel1.add(_highPriorityRadio,cc.xy(8,16));
|
194
|
+
|
195
|
+
_customProcNameCheck.setActionCommand("Custom process name");
|
196
|
+
_customProcNameCheck.setName("customProcNameCheck");
|
197
|
+
_customProcNameCheck.setText(Messages.getString("customProcName"));
|
198
|
+
jpanel1.add(_customProcNameCheck,cc.xywh(4,18,7,1));
|
199
|
+
|
200
|
+
_stayAliveCheck.setActionCommand("Stay alive after launching a GUI application");
|
201
|
+
_stayAliveCheck.setName("stayAliveCheck");
|
202
|
+
_stayAliveCheck.setText(Messages.getString("stayAlive"));
|
203
|
+
jpanel1.add(_stayAliveCheck,cc.xywh(4,20,7,1));
|
204
|
+
|
205
|
+
_cmdLineField.setName("cmdLineField");
|
206
|
+
_cmdLineField.setToolTipText(Messages.getString("cmdLineTip"));
|
207
|
+
jpanel1.add(_cmdLineField,cc.xywh(4,14,7,1));
|
208
|
+
|
209
|
+
_chdirField.setName("chdirField");
|
210
|
+
_chdirField.setToolTipText(Messages.getString("chdirTip"));
|
211
|
+
jpanel1.add(_chdirField,cc.xywh(4,12,7,1));
|
212
|
+
|
213
|
+
_iconField.setName("iconField");
|
214
|
+
_iconField.setToolTipText(Messages.getString("iconTip"));
|
215
|
+
jpanel1.add(_iconField,cc.xywh(4,10,7,1));
|
216
|
+
|
217
|
+
_dontWrapJarCheck.setActionCommand("Don't wrap the jar, launch it only");
|
218
|
+
_dontWrapJarCheck.setName("dontWrapJarCheck");
|
219
|
+
_dontWrapJarCheck.setText(Messages.getString("dontWrapJar"));
|
220
|
+
jpanel1.add(_dontWrapJarCheck,cc.xywh(4,6,7,1));
|
221
|
+
|
222
|
+
_jarField.setName("jarField");
|
223
|
+
_jarField.setToolTipText(Messages.getString("jarTip"));
|
224
|
+
jpanel1.add(_jarField,cc.xywh(4,4,7,1));
|
225
|
+
|
226
|
+
_outfileField.setName("outfileField");
|
227
|
+
_outfileField.setToolTipText(Messages.getString("outfileTip"));
|
228
|
+
jpanel1.add(_outfileField,cc.xywh(4,2,7,1));
|
229
|
+
|
230
|
+
TitledSeparator titledseparator1 = new TitledSeparator();
|
231
|
+
titledseparator1.setText(Messages.getString("downloadAndSupport"));
|
232
|
+
jpanel1.add(titledseparator1,cc.xywh(2,22,11,1));
|
233
|
+
|
234
|
+
_errorTitleLabel.setName("errorTitleLabel");
|
235
|
+
_errorTitleLabel.setText(Messages.getString("errorTitle"));
|
236
|
+
jpanel1.add(_errorTitleLabel,cc.xy(2,24));
|
237
|
+
|
238
|
+
_errorTitleField.setName("errorTitleField");
|
239
|
+
_errorTitleField.setToolTipText(Messages.getString("errorTitleTip"));
|
240
|
+
jpanel1.add(_errorTitleField,cc.xywh(4,24,7,1));
|
241
|
+
|
242
|
+
_downloadUrlLabel.setIcon(loadImage("images/asterix.gif"));
|
243
|
+
_downloadUrlLabel.setName("downloadUrlLabel");
|
244
|
+
_downloadUrlLabel.setText(Messages.getString("downloadUrl"));
|
245
|
+
jpanel1.add(_downloadUrlLabel,cc.xy(2,26));
|
246
|
+
|
247
|
+
_downloadUrlField.setName("downloadUrlField");
|
248
|
+
jpanel1.add(_downloadUrlField,cc.xywh(4,26,7,1));
|
249
|
+
|
250
|
+
_supportUrlLabel.setName("supportUrlLabel");
|
251
|
+
_supportUrlLabel.setText(Messages.getString("supportUrl"));
|
252
|
+
jpanel1.add(_supportUrlLabel,cc.xy(2,28));
|
253
|
+
|
254
|
+
_supportUrlField.setName("supportUrlField");
|
255
|
+
jpanel1.add(_supportUrlField,cc.xywh(4,28,7,1));
|
256
|
+
|
257
|
+
JLabel jlabel1 = new JLabel();
|
258
|
+
jlabel1.setText(Messages.getString("manifest"));
|
259
|
+
jpanel1.add(jlabel1,cc.xy(2,8));
|
260
|
+
|
261
|
+
_manifestField.setName("manifestField");
|
262
|
+
_manifestField.setToolTipText(Messages.getString("manifestTip"));
|
263
|
+
jpanel1.add(_manifestField,cc.xywh(4,8,7,1));
|
264
|
+
|
265
|
+
_manifestButton.setIcon(loadImage("images/open16.png"));
|
266
|
+
_manifestButton.setName("manifestButton");
|
267
|
+
jpanel1.add(_manifestButton,cc.xy(12,8));
|
268
|
+
|
269
|
+
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13 },new int[]{ 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 });
|
270
|
+
return jpanel1;
|
271
|
+
}
|
272
|
+
|
273
|
+
/**
|
274
|
+
* Initializer
|
275
|
+
*/
|
276
|
+
protected void initializePanel()
|
277
|
+
{
|
278
|
+
setLayout(new BorderLayout());
|
279
|
+
add(createPanel(), BorderLayout.CENTER);
|
280
|
+
}
|
281
|
+
|
282
|
+
|
283
|
+
}
|
Binary file
|
@@ -0,0 +1,193 @@
|
|
1
|
+
package net.sf.launch4j.form;
|
2
|
+
|
3
|
+
import com.jgoodies.forms.layout.CellConstraints;
|
4
|
+
import com.jgoodies.forms.layout.FormLayout;
|
5
|
+
import java.awt.BorderLayout;
|
6
|
+
import java.awt.Container;
|
7
|
+
import java.awt.Dimension;
|
8
|
+
import javax.swing.Box;
|
9
|
+
import javax.swing.ImageIcon;
|
10
|
+
import javax.swing.JButton;
|
11
|
+
import javax.swing.JCheckBox;
|
12
|
+
import javax.swing.JLabel;
|
13
|
+
import javax.swing.JList;
|
14
|
+
import javax.swing.JPanel;
|
15
|
+
import javax.swing.JScrollPane;
|
16
|
+
import javax.swing.JTextField;
|
17
|
+
|
18
|
+
public abstract class ClassPathForm extends JPanel
|
19
|
+
{
|
20
|
+
protected final JTextField _classpathField = new JTextField();
|
21
|
+
protected final JLabel _classpathFieldLabel = new JLabel();
|
22
|
+
protected final JLabel _classpathListLabel = new JLabel();
|
23
|
+
protected final JList _classpathList = new JList();
|
24
|
+
protected final JLabel _mainclassLabel = new JLabel();
|
25
|
+
protected final JTextField _mainclassField = new JTextField();
|
26
|
+
protected final JButton _acceptClasspathButton = new JButton();
|
27
|
+
protected final JButton _removeClasspathButton = new JButton();
|
28
|
+
protected final JButton _importClasspathButton = new JButton();
|
29
|
+
protected final JButton _classpathUpButton = new JButton();
|
30
|
+
protected final JButton _classpathDownButton = new JButton();
|
31
|
+
protected final JCheckBox _classpathCheck = new JCheckBox();
|
32
|
+
protected final JButton _newClasspathButton = new JButton();
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Default constructor
|
36
|
+
*/
|
37
|
+
public ClassPathForm()
|
38
|
+
{
|
39
|
+
initializePanel();
|
40
|
+
}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Adds fill components to empty cells in the first row and first column of the grid.
|
44
|
+
* This ensures that the grid spacing will be the same as shown in the designer.
|
45
|
+
* @param cols an array of column indices in the first row where fill components should be added.
|
46
|
+
* @param rows an array of row indices in the first column where fill components should be added.
|
47
|
+
*/
|
48
|
+
void addFillComponents( Container panel, int[] cols, int[] rows )
|
49
|
+
{
|
50
|
+
Dimension filler = new Dimension(10,10);
|
51
|
+
|
52
|
+
boolean filled_cell_11 = false;
|
53
|
+
CellConstraints cc = new CellConstraints();
|
54
|
+
if ( cols.length > 0 && rows.length > 0 )
|
55
|
+
{
|
56
|
+
if ( cols[0] == 1 && rows[0] == 1 )
|
57
|
+
{
|
58
|
+
/** add a rigid area */
|
59
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) );
|
60
|
+
filled_cell_11 = true;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
for( int index = 0; index < cols.length; index++ )
|
65
|
+
{
|
66
|
+
if ( cols[index] == 1 && filled_cell_11 )
|
67
|
+
{
|
68
|
+
continue;
|
69
|
+
}
|
70
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) );
|
71
|
+
}
|
72
|
+
|
73
|
+
for( int index = 0; index < rows.length; index++ )
|
74
|
+
{
|
75
|
+
if ( rows[index] == 1 && filled_cell_11 )
|
76
|
+
{
|
77
|
+
continue;
|
78
|
+
}
|
79
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) );
|
80
|
+
}
|
81
|
+
|
82
|
+
}
|
83
|
+
|
84
|
+
/**
|
85
|
+
* Helper method to load an image file from the CLASSPATH
|
86
|
+
* @param imageName the package and name of the file to load relative to the CLASSPATH
|
87
|
+
* @return an ImageIcon instance with the specified image file
|
88
|
+
* @throws IllegalArgumentException if the image resource cannot be loaded.
|
89
|
+
*/
|
90
|
+
public ImageIcon loadImage( String imageName )
|
91
|
+
{
|
92
|
+
try
|
93
|
+
{
|
94
|
+
ClassLoader classloader = getClass().getClassLoader();
|
95
|
+
java.net.URL url = classloader.getResource( imageName );
|
96
|
+
if ( url != null )
|
97
|
+
{
|
98
|
+
ImageIcon icon = new ImageIcon( url );
|
99
|
+
return icon;
|
100
|
+
}
|
101
|
+
}
|
102
|
+
catch( Exception e )
|
103
|
+
{
|
104
|
+
e.printStackTrace();
|
105
|
+
}
|
106
|
+
throw new IllegalArgumentException( "Unable to load image: " + imageName );
|
107
|
+
}
|
108
|
+
|
109
|
+
public JPanel createPanel()
|
110
|
+
{
|
111
|
+
JPanel jpanel1 = new JPanel();
|
112
|
+
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:3DLU:NONE,FILL:26PX:NONE,FILL:7DLU:NONE","CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:GROW(1.0),CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE");
|
113
|
+
CellConstraints cc = new CellConstraints();
|
114
|
+
jpanel1.setLayout(formlayout1);
|
115
|
+
|
116
|
+
_classpathField.setName("classpathField");
|
117
|
+
jpanel1.add(_classpathField,cc.xywh(4,11,7,1));
|
118
|
+
|
119
|
+
_classpathFieldLabel.setIcon(loadImage("images/asterix.gif"));
|
120
|
+
_classpathFieldLabel.setName("classpathFieldLabel");
|
121
|
+
_classpathFieldLabel.setText(Messages.getString("editClassPath"));
|
122
|
+
jpanel1.add(_classpathFieldLabel,cc.xy(2,11));
|
123
|
+
|
124
|
+
_classpathListLabel.setName("classpathListLabel");
|
125
|
+
_classpathListLabel.setText(Messages.getString("classPath"));
|
126
|
+
jpanel1.add(_classpathListLabel,cc.xy(2,6));
|
127
|
+
|
128
|
+
_classpathList.setName("classpathList");
|
129
|
+
JScrollPane jscrollpane1 = new JScrollPane();
|
130
|
+
jscrollpane1.setViewportView(_classpathList);
|
131
|
+
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
|
132
|
+
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
133
|
+
jpanel1.add(jscrollpane1,cc.xywh(4,6,7,4));
|
134
|
+
|
135
|
+
_mainclassLabel.setIcon(loadImage("images/asterix.gif"));
|
136
|
+
_mainclassLabel.setName("mainclassLabel");
|
137
|
+
_mainclassLabel.setText(Messages.getString("mainClass"));
|
138
|
+
jpanel1.add(_mainclassLabel,cc.xy(2,4));
|
139
|
+
|
140
|
+
_mainclassField.setName("mainclassField");
|
141
|
+
jpanel1.add(_mainclassField,cc.xywh(4,4,7,1));
|
142
|
+
|
143
|
+
_acceptClasspathButton.setActionCommand("Add");
|
144
|
+
_acceptClasspathButton.setIcon(loadImage("images/ok16.png"));
|
145
|
+
_acceptClasspathButton.setName("acceptClasspathButton");
|
146
|
+
_acceptClasspathButton.setText(Messages.getString("accept"));
|
147
|
+
jpanel1.add(_acceptClasspathButton,cc.xy(8,13));
|
148
|
+
|
149
|
+
_removeClasspathButton.setActionCommand("Remove");
|
150
|
+
_removeClasspathButton.setIcon(loadImage("images/cancel16.png"));
|
151
|
+
_removeClasspathButton.setName("removeClasspathButton");
|
152
|
+
_removeClasspathButton.setText(Messages.getString("remove"));
|
153
|
+
jpanel1.add(_removeClasspathButton,cc.xy(10,13));
|
154
|
+
|
155
|
+
_importClasspathButton.setIcon(loadImage("images/open16.png"));
|
156
|
+
_importClasspathButton.setName("importClasspathButton");
|
157
|
+
_importClasspathButton.setToolTipText(Messages.getString("importClassPath"));
|
158
|
+
jpanel1.add(_importClasspathButton,cc.xy(12,4));
|
159
|
+
|
160
|
+
_classpathUpButton.setIcon(loadImage("images/up16.png"));
|
161
|
+
_classpathUpButton.setName("classpathUpButton");
|
162
|
+
jpanel1.add(_classpathUpButton,cc.xy(12,6));
|
163
|
+
|
164
|
+
_classpathDownButton.setIcon(loadImage("images/down16.png"));
|
165
|
+
_classpathDownButton.setName("classpathDownButton");
|
166
|
+
jpanel1.add(_classpathDownButton,cc.xy(12,8));
|
167
|
+
|
168
|
+
_classpathCheck.setActionCommand("Custom classpath");
|
169
|
+
_classpathCheck.setName("classpathCheck");
|
170
|
+
_classpathCheck.setText(Messages.getString("customClassPath"));
|
171
|
+
jpanel1.add(_classpathCheck,cc.xy(4,2));
|
172
|
+
|
173
|
+
_newClasspathButton.setActionCommand("New");
|
174
|
+
_newClasspathButton.setIcon(loadImage("images/new16.png"));
|
175
|
+
_newClasspathButton.setName("newClasspathButton");
|
176
|
+
_newClasspathButton.setText(Messages.getString("new"));
|
177
|
+
jpanel1.add(_newClasspathButton,cc.xy(6,13));
|
178
|
+
|
179
|
+
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14 });
|
180
|
+
return jpanel1;
|
181
|
+
}
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Initializer
|
185
|
+
*/
|
186
|
+
protected void initializePanel()
|
187
|
+
{
|
188
|
+
setLayout(new BorderLayout());
|
189
|
+
add(createPanel(), BorderLayout.CENTER);
|
190
|
+
}
|
191
|
+
|
192
|
+
|
193
|
+
}
|
Binary file
|
@@ -0,0 +1,132 @@
|
|
1
|
+
package net.sf.launch4j.form;
|
2
|
+
|
3
|
+
import com.jeta.forms.components.separator.TitledSeparator;
|
4
|
+
import com.jgoodies.forms.layout.CellConstraints;
|
5
|
+
import com.jgoodies.forms.layout.FormLayout;
|
6
|
+
import java.awt.BorderLayout;
|
7
|
+
import java.awt.Container;
|
8
|
+
import java.awt.Dimension;
|
9
|
+
import javax.swing.Box;
|
10
|
+
import javax.swing.ImageIcon;
|
11
|
+
import javax.swing.JPanel;
|
12
|
+
import javax.swing.JScrollPane;
|
13
|
+
import javax.swing.JTabbedPane;
|
14
|
+
import javax.swing.JTextArea;
|
15
|
+
|
16
|
+
public abstract class ConfigForm extends JPanel
|
17
|
+
{
|
18
|
+
protected final JTextArea _logTextArea = new JTextArea();
|
19
|
+
protected final TitledSeparator _logSeparator = new TitledSeparator();
|
20
|
+
protected final JTabbedPane _tab = new JTabbedPane();
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Default constructor
|
24
|
+
*/
|
25
|
+
public ConfigForm()
|
26
|
+
{
|
27
|
+
initializePanel();
|
28
|
+
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Adds fill components to empty cells in the first row and first column of the grid.
|
32
|
+
* This ensures that the grid spacing will be the same as shown in the designer.
|
33
|
+
* @param cols an array of column indices in the first row where fill components should be added.
|
34
|
+
* @param rows an array of row indices in the first column where fill components should be added.
|
35
|
+
*/
|
36
|
+
void addFillComponents( Container panel, int[] cols, int[] rows )
|
37
|
+
{
|
38
|
+
Dimension filler = new Dimension(10,10);
|
39
|
+
|
40
|
+
boolean filled_cell_11 = false;
|
41
|
+
CellConstraints cc = new CellConstraints();
|
42
|
+
if ( cols.length > 0 && rows.length > 0 )
|
43
|
+
{
|
44
|
+
if ( cols[0] == 1 && rows[0] == 1 )
|
45
|
+
{
|
46
|
+
/** add a rigid area */
|
47
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) );
|
48
|
+
filled_cell_11 = true;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
for( int index = 0; index < cols.length; index++ )
|
53
|
+
{
|
54
|
+
if ( cols[index] == 1 && filled_cell_11 )
|
55
|
+
{
|
56
|
+
continue;
|
57
|
+
}
|
58
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) );
|
59
|
+
}
|
60
|
+
|
61
|
+
for( int index = 0; index < rows.length; index++ )
|
62
|
+
{
|
63
|
+
if ( rows[index] == 1 && filled_cell_11 )
|
64
|
+
{
|
65
|
+
continue;
|
66
|
+
}
|
67
|
+
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) );
|
68
|
+
}
|
69
|
+
|
70
|
+
}
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Helper method to load an image file from the CLASSPATH
|
74
|
+
* @param imageName the package and name of the file to load relative to the CLASSPATH
|
75
|
+
* @return an ImageIcon instance with the specified image file
|
76
|
+
* @throws IllegalArgumentException if the image resource cannot be loaded.
|
77
|
+
*/
|
78
|
+
public ImageIcon loadImage( String imageName )
|
79
|
+
{
|
80
|
+
try
|
81
|
+
{
|
82
|
+
ClassLoader classloader = getClass().getClassLoader();
|
83
|
+
java.net.URL url = classloader.getResource( imageName );
|
84
|
+
if ( url != null )
|
85
|
+
{
|
86
|
+
ImageIcon icon = new ImageIcon( url );
|
87
|
+
return icon;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
catch( Exception e )
|
91
|
+
{
|
92
|
+
e.printStackTrace();
|
93
|
+
}
|
94
|
+
throw new IllegalArgumentException( "Unable to load image: " + imageName );
|
95
|
+
}
|
96
|
+
|
97
|
+
public JPanel createPanel()
|
98
|
+
{
|
99
|
+
JPanel jpanel1 = new JPanel();
|
100
|
+
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE","CENTER:3DLU:NONE,FILL:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
|
101
|
+
CellConstraints cc = new CellConstraints();
|
102
|
+
jpanel1.setLayout(formlayout1);
|
103
|
+
|
104
|
+
_logTextArea.setName("logTextArea");
|
105
|
+
JScrollPane jscrollpane1 = new JScrollPane();
|
106
|
+
jscrollpane1.setViewportView(_logTextArea);
|
107
|
+
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
|
108
|
+
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
109
|
+
jpanel1.add(jscrollpane1,cc.xy(2,6));
|
110
|
+
|
111
|
+
_logSeparator.setName("logSeparator");
|
112
|
+
_logSeparator.setText(Messages.getString("log"));
|
113
|
+
jpanel1.add(_logSeparator,cc.xy(2,4));
|
114
|
+
|
115
|
+
_tab.setName("tab");
|
116
|
+
jpanel1.add(_tab,cc.xywh(1,2,3,1));
|
117
|
+
|
118
|
+
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,3,4,5,6,7 });
|
119
|
+
return jpanel1;
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Initializer
|
124
|
+
*/
|
125
|
+
protected void initializePanel()
|
126
|
+
{
|
127
|
+
setLayout(new BorderLayout());
|
128
|
+
add(createPanel(), BorderLayout.CENTER);
|
129
|
+
}
|
130
|
+
|
131
|
+
|
132
|
+
}
|
Binary file
|