• R/O
  • SSH
  • HTTPS

smart-gs: コミット


コミットメタ情報

リビジョン1204 (tree)
日時2017-01-30 14:29:04
作者ohura

ログメッセージ

[editor-simplyhtml-merge] 新しいPreferenceの設定Frame
Preferenceメニューの「Open Preference Menu」から開く。

変更サマリ

差分

--- branches/editor-simplyhtml-merge/src/smart_gs/menu/PreferenceMenu.java (revision 1203)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/PreferenceMenu.java (revision 1204)
@@ -27,6 +27,7 @@
2727 import smart_gs.menu.action.MarkerChangeDefaultColorAction;
2828 import smart_gs.menu.action.MemoPadChangeDefaultColorAction;
2929 import smart_gs.menu.action.RectangleMoveAction;
30+import smart_gs.menu.preference.PreferenceFrame;
3031 import smart_gs.smleditor.swingui.GSEditor;
3132 import smart_gs.swingui.AbstractGSWindow;
3233 import smart_gs.swingui.WorkspaceWindow;
@@ -33,11 +34,15 @@
3334 import webdav.preference.ProxySetting;
3435 import webdav.preference.WebDavSetting;
3536
36-public class PreferenceMenu extends JMenu {
37+public class PreferenceMenu extends JMenu implements ActionListener {
3738
3839 public PreferenceMenu(String title, AbstractGSWindow window) {
3940 super(title);
4041
42+ JMenuItem preferenceFrame = new JMenuItem("Open Preference Menu");
43+ preferenceFrame.addActionListener(this);
44+ this.add(preferenceFrame);
45+
4146 JMenuItem userName = new JMenuItem("User Name");
4247 userName.addActionListener(new ChangeUserNameAction());
4348 this.add(userName);
@@ -636,4 +641,10 @@
636641
637642
638643 }
644+
645+ @Override
646+ public void actionPerformed(ActionEvent e) {
647+ PreferenceFrame.getInstance().setVisible(true);
648+
649+ }
639650 }
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/XMLPanel.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/XMLPanel.java (revision 1204)
@@ -0,0 +1,14 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JPanel;
4+
5+public class XMLPanel extends JPanel {
6+
7+ /**
8+ * Create the panel.
9+ */
10+ public XMLPanel() {
11+
12+ }
13+
14+}
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/BasicPanel.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/BasicPanel.java (revision 1204)
@@ -0,0 +1,182 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JFileChooser;
4+import javax.swing.JPanel;
5+import javax.swing.JButton;
6+
7+import java.awt.GridBagLayout;
8+import java.awt.GridBagConstraints;
9+import javax.swing.JLabel;
10+import javax.swing.JTextField;
11+
12+import smart_gs.logical.Preference;
13+import smart_gs.swingui.WorkspaceWindow;
14+import smart_gs.util.CanonicalPathString;
15+
16+import java.awt.Insets;
17+import java.awt.event.ActionEvent;
18+import java.awt.event.ActionListener;
19+import java.io.File;
20+
21+public class BasicPanel extends JPanel {
22+ private JTextField textField_UserName;
23+ private JTextField textField_FirstIdat;
24+ private JTextField textField_SecondIdat;
25+ private JTextField textField_ThirdIdat;
26+ private JTextField textField_ExternalEditor;
27+ private JButton btnSelect_ExternalEditor;
28+
29+ /**
30+ * Create the panel.
31+ */
32+ public BasicPanel() {
33+ GridBagLayout gridBagLayout = new GridBagLayout();
34+ gridBagLayout.columnWidths = new int[]{40, 151, 127, 0, 0};
35+ gridBagLayout.rowHeights = new int[]{20, 20, 20, 20, 20, 20, 0};
36+ gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
37+ gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
38+ setLayout(gridBagLayout);
39+
40+ JLabel lblUserName = new JLabel("User Name:");
41+ GridBagConstraints gbc_lblUserName = new GridBagConstraints();
42+ gbc_lblUserName.fill = GridBagConstraints.BOTH;
43+ gbc_lblUserName.insets = new Insets(0, 0, 5, 5);
44+ gbc_lblUserName.gridx = 1;
45+ gbc_lblUserName.gridy = 1;
46+ add(lblUserName, gbc_lblUserName);
47+
48+ textField_UserName = new JTextField();
49+ textField_UserName.setToolTipText("Enter your user name.");
50+ GridBagConstraints gbc_textField_UserName = new GridBagConstraints();
51+ gbc_textField_UserName.anchor = GridBagConstraints.NORTH;
52+ gbc_textField_UserName.fill = GridBagConstraints.HORIZONTAL;
53+ gbc_textField_UserName.insets = new Insets(0, 0, 5, 5);
54+ gbc_textField_UserName.gridx = 2;
55+ gbc_textField_UserName.gridy = 1;
56+ add(textField_UserName, gbc_textField_UserName);
57+ textField_UserName.setColumns(10);
58+
59+ JLabel lblFirstIdat = new JLabel("First IDAT:");
60+ GridBagConstraints gbc_lblFirstIdat = new GridBagConstraints();
61+ gbc_lblFirstIdat.anchor = GridBagConstraints.WEST;
62+ gbc_lblFirstIdat.insets = new Insets(0, 0, 5, 5);
63+ gbc_lblFirstIdat.gridx = 1;
64+ gbc_lblFirstIdat.gridy = 2;
65+ add(lblFirstIdat, gbc_lblFirstIdat);
66+
67+ textField_FirstIdat = new JTextField();
68+ GridBagConstraints gbc_textField_FirstIdat = new GridBagConstraints();
69+ gbc_textField_FirstIdat.anchor = GridBagConstraints.NORTH;
70+ gbc_textField_FirstIdat.fill = GridBagConstraints.HORIZONTAL;
71+ gbc_textField_FirstIdat.insets = new Insets(0, 0, 5, 5);
72+ gbc_textField_FirstIdat.gridx = 2;
73+ gbc_textField_FirstIdat.gridy = 2;
74+ add(textField_FirstIdat, gbc_textField_FirstIdat);
75+ textField_FirstIdat.setColumns(10);
76+
77+ JLabel lblSecondIdat = new JLabel("Second IDAT:");
78+ GridBagConstraints gbc_lblSecondIdat = new GridBagConstraints();
79+ gbc_lblSecondIdat.anchor = GridBagConstraints.WEST;
80+ gbc_lblSecondIdat.insets = new Insets(0, 0, 5, 5);
81+ gbc_lblSecondIdat.gridx = 1;
82+ gbc_lblSecondIdat.gridy = 3;
83+ add(lblSecondIdat, gbc_lblSecondIdat);
84+
85+ textField_SecondIdat = new JTextField();
86+ textField_SecondIdat.setColumns(10);
87+ GridBagConstraints gbc_textField_SecondIdat = new GridBagConstraints();
88+ gbc_textField_SecondIdat.anchor = GridBagConstraints.NORTH;
89+ gbc_textField_SecondIdat.fill = GridBagConstraints.HORIZONTAL;
90+ gbc_textField_SecondIdat.insets = new Insets(0, 0, 5, 5);
91+ gbc_textField_SecondIdat.gridx = 2;
92+ gbc_textField_SecondIdat.gridy = 3;
93+ add(textField_SecondIdat, gbc_textField_SecondIdat);
94+
95+ JLabel lblThirdIdat = new JLabel("Third IDAT:");
96+ GridBagConstraints gbc_lblThirdIdat = new GridBagConstraints();
97+ gbc_lblThirdIdat.anchor = GridBagConstraints.WEST;
98+ gbc_lblThirdIdat.insets = new Insets(0, 0, 5, 5);
99+ gbc_lblThirdIdat.gridx = 1;
100+ gbc_lblThirdIdat.gridy = 4;
101+ add(lblThirdIdat, gbc_lblThirdIdat);
102+
103+ textField_ThirdIdat = new JTextField();
104+ textField_ThirdIdat.setColumns(10);
105+ GridBagConstraints gbc_textField_ThirdIdat = new GridBagConstraints();
106+ gbc_textField_ThirdIdat.anchor = GridBagConstraints.NORTH;
107+ gbc_textField_ThirdIdat.fill = GridBagConstraints.HORIZONTAL;
108+ gbc_textField_ThirdIdat.insets = new Insets(0, 0, 5, 5);
109+ gbc_textField_ThirdIdat.gridx = 2;
110+ gbc_textField_ThirdIdat.gridy = 4;
111+ add(textField_ThirdIdat, gbc_textField_ThirdIdat);
112+
113+ JLabel lblExternalEditor = new JLabel("External Editor:");
114+ GridBagConstraints gbc_lblExternalEditor = new GridBagConstraints();
115+ gbc_lblExternalEditor.fill = GridBagConstraints.HORIZONTAL;
116+ gbc_lblExternalEditor.insets = new Insets(0, 0, 0, 5);
117+ gbc_lblExternalEditor.gridx = 1;
118+ gbc_lblExternalEditor.gridy = 5;
119+ add(lblExternalEditor, gbc_lblExternalEditor);
120+
121+ textField_ExternalEditor = new JTextField();
122+ textField_ExternalEditor.setColumns(10);
123+ GridBagConstraints gbc_textField_ExternalEditor = new GridBagConstraints();
124+ gbc_textField_ExternalEditor.insets = new Insets(0, 0, 0, 5);
125+ gbc_textField_ExternalEditor.anchor = GridBagConstraints.NORTH;
126+ gbc_textField_ExternalEditor.fill = GridBagConstraints.HORIZONTAL;
127+ gbc_textField_ExternalEditor.gridx = 2;
128+ gbc_textField_ExternalEditor.gridy = 5;
129+ add(textField_ExternalEditor, gbc_textField_ExternalEditor);
130+
131+ btnSelect_ExternalEditor = new JButton("Select");
132+ btnSelect_ExternalEditor.addActionListener(new ActionListener(){
133+
134+ @Override
135+ public void actionPerformed(ActionEvent e) {
136+ JFileChooser chooser = new JFileChooser();
137+ int returnVal = chooser.showOpenDialog(WorkspaceWindow.getInstance());
138+ try {
139+ if (returnVal == JFileChooser.APPROVE_OPTION) {
140+ File file = chooser.getSelectedFile();
141+ textField_ExternalEditor.setText(CanonicalPathString.get(file));
142+ }
143+ } catch(Exception ex){}
144+
145+ }
146+
147+ });
148+ GridBagConstraints gbc_btnSelect_ExternalEditor = new GridBagConstraints();
149+ gbc_btnSelect_ExternalEditor.gridx = 3;
150+ gbc_btnSelect_ExternalEditor.gridy = 5;
151+ add(btnSelect_ExternalEditor, gbc_btnSelect_ExternalEditor);
152+
153+ // Default Settings
154+ textField_UserName.setText(Preference.getInstance().getUserName());
155+ textField_FirstIdat.setText(Preference.getInstance().getFirstIDATName());
156+ textField_SecondIdat.setText(Preference.getInstance().getSecondIDATName());
157+ textField_ThirdIdat.setText(Preference.getInstance().getThirdIDATName());
158+ textField_ExternalEditor.setText(Preference.getInstance().getEditor());
159+ }
160+
161+ public String getUserName() {
162+ return textField_UserName.getText();
163+ }
164+
165+ public String getFirstIDATName() {
166+ return textField_FirstIdat.getText();
167+ }
168+
169+ public String getSecondIDATName() {
170+ return textField_SecondIdat.getText();
171+ }
172+
173+ public String getThirdIDATName() {
174+ return textField_ThirdIdat.getText();
175+ }
176+
177+ public String getEditor() {
178+ return textField_ExternalEditor.getText();
179+ }
180+
181+
182+}
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/FilesPanel.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/FilesPanel.java (revision 1204)
@@ -0,0 +1,335 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JPanel;
4+import javax.swing.JLabel;
5+
6+import java.awt.GridBagLayout;
7+import java.awt.GridBagConstraints;
8+import java.awt.Insets;
9+
10+import javax.swing.JTextField;
11+import javax.swing.JButton;
12+import javax.swing.JRadioButton;
13+import javax.swing.JComboBox;
14+import javax.swing.SwingConstants;
15+
16+import smart_gs.logical.Preference;
17+import smart_gs.menu.SetDefaultGsFileAction;
18+import smart_gs.menu.action.SetCurrentDirectoryAction;
19+import smart_gs.menu.action.SetImageFolderPathAction;
20+import smart_gs.menu.action.SetRWBackgroundFilePathAction;
21+import smart_gs.menu.action.SetWorkspaceDirectoryPathAction;
22+import smart_gs.network.ProjectHandler;
23+import smart_gs.util.GSImageFileUtils;
24+import smart_gs.util.GSPathStringGrammarChecker;
25+
26+import javax.swing.AbstractAction;
27+
28+import java.awt.event.ActionEvent;
29+import java.util.List;
30+
31+import javax.swing.Action;
32+import javax.swing.ButtonGroup;
33+
34+import jp.ac.nii.hcp.shared.model.HCPProject;
35+
36+public class FilesPanel extends JPanel {
37+ private JTextField textField_GSFiles;
38+ private JTextField textField_Images;
39+ private JTextField textField_RWBackgroundFile;
40+ private JTextField textField_WorkspaceDirectory;
41+ private JTextField textField_GSXFile;
42+ private final ButtonGroup buttonGroup = new ButtonGroup();
43+ private JRadioButton rdbtnGsxFile;
44+ private JRadioButton rdbtnHcpProject;
45+ private JComboBox<String> comboBox;
46+
47+ /**
48+ * Create the panel.
49+ */
50+ public FilesPanel() {
51+ GridBagLayout gridBagLayout = new GridBagLayout();
52+ gridBagLayout.columnWidths = new int[]{10, 63, 100, 108, 0, 0, 0};
53+ gridBagLayout.rowHeights = new int[]{16, 0, 0, 0, 0, 0, 0, 0, 0};
54+ gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE};
55+ gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
56+ setLayout(gridBagLayout);
57+
58+ JLabel lblGSFiles = new JLabel("GS Files:");
59+ GridBagConstraints gbc_lblGSFiles = new GridBagConstraints();
60+ gbc_lblGSFiles.insets = new Insets(0, 0, 5, 5);
61+ gbc_lblGSFiles.anchor = GridBagConstraints.WEST;
62+ gbc_lblGSFiles.gridx = 1;
63+ gbc_lblGSFiles.gridy = 1;
64+ add(lblGSFiles, gbc_lblGSFiles);
65+
66+ textField_GSFiles = new JTextField();
67+ GridBagConstraints gbc_textField_GSFiles = new GridBagConstraints();
68+ gbc_textField_GSFiles.insets = new Insets(0, 0, 5, 5);
69+ gbc_textField_GSFiles.fill = GridBagConstraints.HORIZONTAL;
70+ gbc_textField_GSFiles.gridx = 3;
71+ gbc_textField_GSFiles.gridy = 1;
72+ add(textField_GSFiles, gbc_textField_GSFiles);
73+ textField_GSFiles.setColumns(10);
74+
75+ JButton btnSelect_GSFiles = new JButton("Select");
76+ SetCurrentDirectoryAction gsAction = new SetCurrentDirectoryAction();
77+ btnSelect_GSFiles.addActionListener(gsAction);
78+ GridBagConstraints gbc_btnSelect_GSFiles = new GridBagConstraints();
79+ gbc_btnSelect_GSFiles.insets = new Insets(0, 0, 5, 5);
80+ gbc_btnSelect_GSFiles.gridx = 4;
81+ gbc_btnSelect_GSFiles.gridy = 1;
82+ add(btnSelect_GSFiles, gbc_btnSelect_GSFiles);
83+
84+ JLabel lblImages = new JLabel("Images:");
85+ GridBagConstraints gbc_lblImages = new GridBagConstraints();
86+ gbc_lblImages.anchor = GridBagConstraints.WEST;
87+ gbc_lblImages.insets = new Insets(0, 0, 5, 5);
88+ gbc_lblImages.gridx = 1;
89+ gbc_lblImages.gridy = 2;
90+ add(lblImages, gbc_lblImages);
91+
92+ textField_Images = new JTextField();
93+ GridBagConstraints gbc_textField_Images = new GridBagConstraints();
94+ gbc_textField_Images.insets = new Insets(0, 0, 5, 5);
95+ gbc_textField_Images.fill = GridBagConstraints.HORIZONTAL;
96+ gbc_textField_Images.gridx = 3;
97+ gbc_textField_Images.gridy = 2;
98+ add(textField_Images, gbc_textField_Images);
99+ textField_Images.setColumns(10);
100+
101+ JButton btnSelect_Images = new JButton("Select");
102+ SetImageFolderPathAction imageAction = new SetImageFolderPathAction();
103+ btnSelect_Images.addActionListener(imageAction);
104+ GridBagConstraints gbc_btnSelect_Images = new GridBagConstraints();
105+ gbc_btnSelect_Images.insets = new Insets(0, 0, 5, 5);
106+ gbc_btnSelect_Images.gridx = 4;
107+ gbc_btnSelect_Images.gridy = 2;
108+ add(btnSelect_Images, gbc_btnSelect_Images);
109+
110+ JLabel lblRWBackgroundFile = new JLabel("RW Background File:");
111+ GridBagConstraints gbc_lblRWBackgroundFile = new GridBagConstraints();
112+ gbc_lblRWBackgroundFile.anchor = GridBagConstraints.WEST;
113+ gbc_lblRWBackgroundFile.insets = new Insets(0, 0, 5, 5);
114+ gbc_lblRWBackgroundFile.gridx = 1;
115+ gbc_lblRWBackgroundFile.gridy = 3;
116+ add(lblRWBackgroundFile, gbc_lblRWBackgroundFile);
117+
118+ textField_RWBackgroundFile = new JTextField();
119+ GridBagConstraints gbc_textField_RWBackgroundFile = new GridBagConstraints();
120+ gbc_textField_RWBackgroundFile.insets = new Insets(0, 0, 5, 5);
121+ gbc_textField_RWBackgroundFile.fill = GridBagConstraints.HORIZONTAL;
122+ gbc_textField_RWBackgroundFile.gridx = 3;
123+ gbc_textField_RWBackgroundFile.gridy = 3;
124+ add(textField_RWBackgroundFile, gbc_textField_RWBackgroundFile);
125+ textField_RWBackgroundFile.setColumns(10);
126+
127+ JButton btnSelect_RWBackgroundFile = new JButton("Select");
128+ SetRWBackgroundFilePathAction RWBackgroundFileAction = new SetRWBackgroundFilePathAction();
129+ btnSelect_RWBackgroundFile.addActionListener(RWBackgroundFileAction);
130+ GridBagConstraints gbc_btnSelect_RWBackgroundFile = new GridBagConstraints();
131+ gbc_btnSelect_RWBackgroundFile.insets = new Insets(0, 0, 5, 5);
132+ gbc_btnSelect_RWBackgroundFile.gridx = 4;
133+ gbc_btnSelect_RWBackgroundFile.gridy = 3;
134+ add(btnSelect_RWBackgroundFile, gbc_btnSelect_RWBackgroundFile);
135+
136+ JLabel lblWorkspaceDirectory = new JLabel("Workspace Directory:");
137+ GridBagConstraints gbc_lblWorkspaceDirectory = new GridBagConstraints();
138+ gbc_lblWorkspaceDirectory.anchor = GridBagConstraints.WEST;
139+ gbc_lblWorkspaceDirectory.insets = new Insets(0, 0, 5, 5);
140+ gbc_lblWorkspaceDirectory.gridx = 1;
141+ gbc_lblWorkspaceDirectory.gridy = 4;
142+ add(lblWorkspaceDirectory, gbc_lblWorkspaceDirectory);
143+
144+ textField_WorkspaceDirectory = new JTextField();
145+ GridBagConstraints gbc_textField_WorkspaceDirectory = new GridBagConstraints();
146+ gbc_textField_WorkspaceDirectory.insets = new Insets(0, 0, 5, 5);
147+ gbc_textField_WorkspaceDirectory.fill = GridBagConstraints.HORIZONTAL;
148+ gbc_textField_WorkspaceDirectory.gridx = 3;
149+ gbc_textField_WorkspaceDirectory.gridy = 4;
150+ add(textField_WorkspaceDirectory, gbc_textField_WorkspaceDirectory);
151+ textField_WorkspaceDirectory.setColumns(10);
152+
153+ JButton btnSelect_WorkspaceDirectory = new JButton("Select");
154+ SetWorkspaceDirectoryPathAction workspaceDirectoryAction = new SetWorkspaceDirectoryPathAction();
155+ btnSelect_WorkspaceDirectory.addActionListener(workspaceDirectoryAction);
156+ GridBagConstraints gbc_btnSelect_WorkspaceDirectory = new GridBagConstraints();
157+ gbc_btnSelect_WorkspaceDirectory.insets = new Insets(0, 0, 5, 5);
158+ gbc_btnSelect_WorkspaceDirectory.gridx = 4;
159+ gbc_btnSelect_WorkspaceDirectory.gridy = 4;
160+ add(btnSelect_WorkspaceDirectory, gbc_btnSelect_WorkspaceDirectory);
161+
162+ JLabel lblDefaultGsxFile = new JLabel("Default GS File:");
163+ GridBagConstraints gbc_lblDefaultGsxFile = new GridBagConstraints();
164+ gbc_lblDefaultGsxFile.anchor = GridBagConstraints.WEST;
165+ gbc_lblDefaultGsxFile.insets = new Insets(0, 0, 5, 5);
166+ gbc_lblDefaultGsxFile.gridx = 1;
167+ gbc_lblDefaultGsxFile.gridy = 6;
168+ add(lblDefaultGsxFile, gbc_lblDefaultGsxFile);
169+
170+ rdbtnGsxFile = new JRadioButton("GSX File");
171+ buttonGroup.add(rdbtnGsxFile);
172+ GridBagConstraints gbc_rdbtnGsxFile = new GridBagConstraints();
173+ gbc_rdbtnGsxFile.insets = new Insets(0, 0, 5, 5);
174+ gbc_rdbtnGsxFile.gridx = 2;
175+ gbc_rdbtnGsxFile.gridy = 6;
176+ add(rdbtnGsxFile, gbc_rdbtnGsxFile);
177+
178+ textField_GSXFile = new JTextField();
179+ GridBagConstraints gbc_textField_GSXFile = new GridBagConstraints();
180+ gbc_textField_GSXFile.insets = new Insets(0, 0, 5, 5);
181+ gbc_textField_GSXFile.fill = GridBagConstraints.HORIZONTAL;
182+ gbc_textField_GSXFile.gridx = 3;
183+ gbc_textField_GSXFile.gridy = 6;
184+ add(textField_GSXFile, gbc_textField_GSXFile);
185+ textField_GSXFile.setColumns(10);
186+
187+ JButton btnSelect_GSXFile = new JButton("Select");
188+ SetDefaultGsFileAction defaultGSXFileAction = new SetDefaultGsFileAction();
189+ btnSelect_GSXFile.addActionListener(defaultGSXFileAction);
190+ GridBagConstraints gbc_btnSelect_GSXFile = new GridBagConstraints();
191+ gbc_btnSelect_GSXFile.insets = new Insets(0, 0, 5, 5);
192+ gbc_btnSelect_GSXFile.gridx = 4;
193+ gbc_btnSelect_GSXFile.gridy = 6;
194+ add(btnSelect_GSXFile, gbc_btnSelect_GSXFile);
195+
196+ rdbtnHcpProject = new JRadioButton("HCP Project");
197+ buttonGroup.add(rdbtnHcpProject);
198+ GridBagConstraints gbc_rdbtnHcpProject = new GridBagConstraints();
199+ gbc_rdbtnHcpProject.insets = new Insets(0, 0, 0, 5);
200+ gbc_rdbtnHcpProject.gridx = 2;
201+ gbc_rdbtnHcpProject.gridy = 7;
202+ add(rdbtnHcpProject, gbc_rdbtnHcpProject);
203+
204+ comboBox = new JComboBox<String>();
205+ GridBagConstraints gbc_comboBox = new GridBagConstraints();
206+ gbc_comboBox.insets = new Insets(0, 0, 0, 5);
207+ gbc_comboBox.fill = GridBagConstraints.HORIZONTAL;
208+ gbc_comboBox.gridx = 3;
209+ gbc_comboBox.gridy = 7;
210+ add(comboBox, gbc_comboBox);
211+
212+ // Default Settings
213+ this.textField_GSFiles.setText(Preference.getInstance().getGsFolderPathString());
214+ this.textField_Images.setText(Preference.getInstance().getImageFolderPathString());
215+ this.textField_RWBackgroundFile.setText(Preference.getInstance().getRWBackgroundFilePathString());
216+ this.textField_WorkspaceDirectory.setText(Preference.getInstance().getWorkspaceDirectory());
217+
218+ String preferredFileType = Preference.getInstance().getFileType();
219+ boolean gsxIsPreferred = preferredFileType.equals(Preference.GSX);
220+ boolean hcpIsPreferred = preferredFileType.equals(Preference.HCPProject);
221+ if(gsxIsPreferred){
222+ rdbtnGsxFile.setSelected(true);
223+ } else if(hcpIsPreferred){
224+ rdbtnHcpProject.setSelected(true);
225+ } else {
226+ rdbtnGsxFile.setSelected(true);
227+ }
228+ this.textField_GSXFile.setText(Preference.getInstance().getDefaultGsFilePathString());
229+ btnSelect_GSXFile.setEnabled(gsxIsPreferred);
230+
231+ List<HCPProject> projects = ProjectHandler.getInstance().getProjectsFromWorkspace();
232+ for(int i = 0; i < projects.size(); i++) {
233+ comboBox.addItem(projects.get(i).name);
234+ }
235+ comboBox.setSelectedItem(Preference.getInstance().getDefaultHCPProjectNameString());
236+
237+ }
238+
239+ public String getGsFolderPathString() {
240+ return this.textField_GSFiles.getText();
241+ }
242+
243+ public String getImageFolderPathString() {
244+ return this.textField_Images.getText();
245+ }
246+
247+ public String getRWBackgroundFilePathString() {
248+ return this.textField_RWBackgroundFile.getText();
249+ }
250+
251+ public String getWorkspaceDirectory() {
252+ return this.textField_WorkspaceDirectory.getText();
253+ }
254+
255+ public String getDefaultGsFilePath() {
256+ return this.textField_GSXFile.getText();
257+ }
258+
259+ public String[] checkPath() {
260+ boolean gsFilesCondition = false;
261+ boolean imagesCondition = false;
262+ boolean defaultGsFileCondition = false;
263+ boolean rWBackgroundFileCondition = false;
264+// boolean workspaceDirectoryCondition = false;
265+
266+ String gsFilesPathString = this.textField_GSFiles.getText();
267+ String imagesPathString = this.textField_Images.getText();
268+ String rWBackgroundFilePathString = this.textField_RWBackgroundFile.getText();
269+// String workspaceDirectoryPathString = this.textField_WorkspaceDirectory.getText();
270+ String defaultGsFilePathString = "";
271+// String defaultHCPProjectNameString = "";
272+ if (this.rdbtnGsxFile.isSelected()) {
273+ defaultGsFilePathString = this.textField_GSXFile.getText();
274+ } else if (this.rdbtnHcpProject.isSelected()) {
275+// defaultHCPProjectNameString = (String)this.comboBox.getSelectedItem();
276+ }
277+
278+ gsFilesCondition = GSPathStringGrammarChecker.isGsPath(gsFilesPathString);
279+ imagesCondition = GSPathStringGrammarChecker.isGsPath(imagesPathString);
280+ rWBackgroundFileCondition = GSPathStringGrammarChecker.isGsPath(rWBackgroundFilePathString) || rWBackgroundFilePathString.isEmpty();
281+// workspaceDirectoryCondition = GSPathStringGrammarChecker.isGsPath(workspaceDirectoryPathString);
282+ defaultGsFileCondition = GSPathStringGrammarChecker.isGsPath(defaultGsFilePathString) || defaultGsFilePathString.equals("");
283+
284+
285+ String errorMessage = "";
286+ String warningMessage = "";
287+ String message[] = new String[2];
288+
289+ if (gsFilesCondition == false) {
290+ errorMessage += "GS Files Path Error: not fit to the GS file path grammar.\n";
291+ } else {
292+ if (GSPathStringGrammarChecker.confusingSeparators(gsFilesPathString)) {
293+ warningMessage += "GS Files Path Warnig: both of \\ and / present.\n";
294+ }
295+ if (!GSPathStringGrammarChecker.endsWithSeparator(gsFilesPathString)) {
296+ warningMessage += "GS Files Path Warnig: it ends not with a separator.\n";
297+ }
298+ }
299+ if (imagesCondition == false) {
300+ errorMessage += "Images Path Error: not fit to the GS file path grammar.\n";
301+ } else {
302+ if (GSPathStringGrammarChecker.confusingSeparators(imagesPathString)) {
303+ warningMessage += "Images Path Warnig: both of \\ and / present.\n";
304+ }
305+ if (!GSPathStringGrammarChecker.endsWithSeparator(imagesPathString)) {
306+ warningMessage += "Images Path Warnig: it ends not with a separator.\n";
307+ }
308+ }
309+ if (rWBackgroundFileCondition == false) {
310+ errorMessage += "RW Backgroundfile Path Error: not fit to the GS file path grammar.\n";
311+ } else if (! rWBackgroundFilePathString.isEmpty() && GSPathStringGrammarChecker.confusingSeparators(rWBackgroundFilePathString)) {
312+ warningMessage += "RW Backgroundfile Path Warnig: both of \\ and / present.\n";
313+ }
314+ if (! rWBackgroundFilePathString.isEmpty() && ! GSImageFileUtils.isAcceptable(rWBackgroundFilePathString)) {
315+ errorMessage += "RW Backgroundfile Name Error: must ends with one of "
316+ + GSImageFileUtils.getDescription() + ".\n";
317+ }
318+
319+ if (defaultGsFileCondition == false) {
320+ errorMessage += "Default GS File Path Error: not fit to the GS file path grammar.\n";
321+ } else if (GSPathStringGrammarChecker.confusingSeparators(defaultGsFilePathString)) {
322+ warningMessage += "Default GS File Path Warnig: both of \\ and / present.\n";
323+ }
324+
325+ if (! defaultGsFilePathString.endsWith(".gsx2")) {
326+ errorMessage += "Default GS File Name Error: must ends with \".gsx2\".\n";
327+ }
328+ message[0]=errorMessage;
329+ message[1]=warningMessage;
330+ return message;
331+
332+ }
333+
334+
335+}
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/ImageMarkupPanel.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/ImageMarkupPanel.java (revision 1204)
@@ -0,0 +1,551 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JOptionPane;
4+import javax.swing.JPanel;
5+import javax.swing.JLabel;
6+import javax.swing.JCheckBox;
7+import javax.swing.JButton;
8+
9+import java.awt.event.ActionListener;
10+import java.awt.event.ActionEvent;
11+import java.awt.Font;
12+import java.awt.Color;
13+import java.awt.GridBagLayout;
14+import java.awt.GridBagConstraints;
15+import java.awt.Insets;
16+
17+import javax.swing.JRadioButton;
18+import javax.swing.JTextField;
19+import javax.swing.ButtonGroup;
20+
21+import smart_gs.drawing_tool.state.UniSelectedState;
22+import smart_gs.drawing_tool.view.BookmarkView;
23+import smart_gs.drawing_tool.view.MarkerView;
24+import smart_gs.drawing_tool.view.MemoPadView;
25+import smart_gs.logical.Preference;
26+
27+public class ImageMarkupPanel extends JPanel {
28+ private JTextField textField_MarkerDefaultBreadth;
29+ private final ButtonGroup buttonGroup = new ButtonGroup();
30+ private final ButtonGroup buttonGroup_1 = new ButtonGroup();
31+ private final ButtonGroup buttonGroup_2 = new ButtonGroup();
32+ private final ButtonGroup buttonGroup_3 = new ButtonGroup();
33+ private final ButtonGroup buttonGroup_4 = new ButtonGroup();
34+ private JRadioButton rdbtnMovable;
35+ private JRadioButton rdbtnUnmovable;
36+ private JRadioButton rdbtnMemoPadYellow;
37+ private JRadioButton rdbtnMemoPadCyan;
38+ private JRadioButton rdbtnMemoPadMagenta;
39+ private JRadioButton rdbtnMemoPadGreen;
40+ private JRadioButton rdbtnMarkerYellow;
41+ private JRadioButton rdbtnMarkerCyan;
42+ private JRadioButton rdbtnMarkerMagenta;
43+ private JRadioButton rdbtnMarkerGreen;
44+ private JRadioButton rdbtnBookmarkRed;
45+ private JRadioButton rdbtnBookmarkBlue;
46+ private JRadioButton rdbtnBookmarkPurple;
47+ private JRadioButton rdbtnBookmarkGray;
48+ private JRadioButton rdbtnBookmarkGreen;
49+ private JRadioButton rdbtnBookmarkSizeHuge;
50+ private JRadioButton rdbtnBookmarkSizeLarge;
51+ private JRadioButton rdbtnBookmarkSizeNormal;
52+ private JRadioButton rdbtnBookmarkSizeSmall;
53+ private JRadioButton rdbtnBookmarkSizeTiny;
54+ private JRadioButton rdbtnSave;
55+ private JRadioButton rdbtnNotSave;
56+ private JRadioButton rdbtnOn;
57+ private JRadioButton rdbtnOff;
58+ private final ButtonGroup buttonGroup_5 = new ButtonGroup();
59+ private final ButtonGroup buttonGroup_6 = new ButtonGroup();
60+
61+ /**
62+ * Create the panel.
63+ */
64+ public ImageMarkupPanel() {
65+ GridBagLayout gridBagLayout = new GridBagLayout();
66+ gridBagLayout.columnWidths = new int[]{40, 183, 75, 75, 75, 75, 75, 10, 0};
67+ gridBagLayout.rowHeights = new int[]{31, 24, 0, 24, 24, 20, 10, 16, 0, 10, 0, 0, 0};
68+ gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
69+ gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
70+ setLayout(gridBagLayout);
71+
72+ JLabel lblMovability = new JLabel("Movability");
73+ GridBagConstraints gbc_lblMovability = new GridBagConstraints();
74+ gbc_lblMovability.anchor = GridBagConstraints.WEST;
75+ gbc_lblMovability.insets = new Insets(0, 0, 5, 5);
76+ gbc_lblMovability.gridx = 1;
77+ gbc_lblMovability.gridy = 1;
78+ add(lblMovability, gbc_lblMovability);
79+
80+ rdbtnMovable = new JRadioButton("Movable");
81+ buttonGroup.add(rdbtnMovable);
82+ GridBagConstraints gbc_rdbtnMovable = new GridBagConstraints();
83+ gbc_rdbtnMovable.gridwidth = 2;
84+ gbc_rdbtnMovable.anchor = GridBagConstraints.NORTH;
85+ gbc_rdbtnMovable.insets = new Insets(0, 0, 5, 5);
86+ gbc_rdbtnMovable.gridx = 2;
87+ gbc_rdbtnMovable.gridy = 1;
88+ add(rdbtnMovable, gbc_rdbtnMovable);
89+
90+ rdbtnUnmovable = new JRadioButton("Unmovable");
91+ buttonGroup.add(rdbtnUnmovable);
92+ GridBagConstraints gbc_rdbtnUnmovable = new GridBagConstraints();
93+ gbc_rdbtnUnmovable.gridwidth = 2;
94+ gbc_rdbtnUnmovable.insets = new Insets(0, 0, 5, 5);
95+ gbc_rdbtnUnmovable.gridx = 4;
96+ gbc_rdbtnUnmovable.gridy = 1;
97+ add(rdbtnUnmovable, gbc_rdbtnUnmovable);
98+
99+
100+ JLabel lblMemoPadDefaultColor = new JLabel("MemoPad Default Color:");
101+ GridBagConstraints gbc_lblMemoPadDefaultColor = new GridBagConstraints();
102+ gbc_lblMemoPadDefaultColor.anchor = GridBagConstraints.WEST;
103+ gbc_lblMemoPadDefaultColor.insets = new Insets(0, 0, 5, 5);
104+ gbc_lblMemoPadDefaultColor.gridx = 1;
105+ gbc_lblMemoPadDefaultColor.gridy = 3;
106+ add(lblMemoPadDefaultColor, gbc_lblMemoPadDefaultColor);
107+
108+ rdbtnMemoPadYellow = new JRadioButton("Yellow");
109+ buttonGroup_1.add(rdbtnMemoPadYellow);
110+ rdbtnMemoPadYellow.setBackground(Color.YELLOW);
111+ rdbtnMemoPadYellow.setFont(new Font("Dialog", Font.BOLD, 11));
112+ GridBagConstraints gbc_rdbtnMemoPadYellow = new GridBagConstraints();
113+ gbc_rdbtnMemoPadYellow.anchor = GridBagConstraints.NORTH;
114+ gbc_rdbtnMemoPadYellow.insets = new Insets(0, 0, 5, 5);
115+ gbc_rdbtnMemoPadYellow.gridx = 2;
116+ gbc_rdbtnMemoPadYellow.gridy = 3;
117+ add(rdbtnMemoPadYellow, gbc_rdbtnMemoPadYellow);
118+
119+ rdbtnMemoPadCyan = new JRadioButton("Cyan");
120+ buttonGroup_1.add(rdbtnMemoPadCyan);
121+ rdbtnMemoPadCyan.setBackground(Color.CYAN);
122+ rdbtnMemoPadCyan.setFont(new Font("Dialog", Font.BOLD, 11));
123+ GridBagConstraints gbc_rdbtnMemoPadCyan = new GridBagConstraints();
124+ gbc_rdbtnMemoPadCyan.fill = GridBagConstraints.HORIZONTAL;
125+ gbc_rdbtnMemoPadCyan.anchor = GridBagConstraints.NORTH;
126+ gbc_rdbtnMemoPadCyan.insets = new Insets(0, 0, 5, 5);
127+ gbc_rdbtnMemoPadCyan.gridx = 3;
128+ gbc_rdbtnMemoPadCyan.gridy = 3;
129+ add(rdbtnMemoPadCyan, gbc_rdbtnMemoPadCyan);
130+
131+ rdbtnMemoPadMagenta = new JRadioButton("Magenta");
132+ buttonGroup_1.add(rdbtnMemoPadMagenta);
133+ rdbtnMemoPadMagenta.setBackground(Color.MAGENTA);
134+ rdbtnMemoPadMagenta.setFont(new Font("Dialog", Font.BOLD, 11));
135+ GridBagConstraints gbc_rdbtnMemoPadMagenta = new GridBagConstraints();
136+ gbc_rdbtnMemoPadMagenta.anchor = GridBagConstraints.NORTH;
137+ gbc_rdbtnMemoPadMagenta.insets = new Insets(0, 0, 5, 5);
138+ gbc_rdbtnMemoPadMagenta.gridx = 4;
139+ gbc_rdbtnMemoPadMagenta.gridy = 3;
140+ add(rdbtnMemoPadMagenta, gbc_rdbtnMemoPadMagenta);
141+
142+ rdbtnMemoPadGreen = new JRadioButton("Green");
143+ buttonGroup_1.add(rdbtnMemoPadGreen);
144+ rdbtnMemoPadGreen.setBackground(Color.GREEN);
145+ rdbtnMemoPadGreen.setFont(new Font("Dialog", Font.BOLD, 11));
146+ GridBagConstraints gbc_rdbtnMemoPadGreen = new GridBagConstraints();
147+ gbc_rdbtnMemoPadGreen.fill = GridBagConstraints.HORIZONTAL;
148+ gbc_rdbtnMemoPadGreen.anchor = GridBagConstraints.NORTH;
149+ gbc_rdbtnMemoPadGreen.insets = new Insets(0, 0, 5, 5);
150+ gbc_rdbtnMemoPadGreen.gridx = 5;
151+ gbc_rdbtnMemoPadGreen.gridy = 3;
152+ add(rdbtnMemoPadGreen, gbc_rdbtnMemoPadGreen);
153+
154+
155+ JLabel lblMarkerDefaultColor = new JLabel("Marker Default Color:");
156+ GridBagConstraints gbc_lblMarkerDefaultColor = new GridBagConstraints();
157+ gbc_lblMarkerDefaultColor.anchor = GridBagConstraints.WEST;
158+ gbc_lblMarkerDefaultColor.insets = new Insets(0, 0, 5, 5);
159+ gbc_lblMarkerDefaultColor.gridx = 1;
160+ gbc_lblMarkerDefaultColor.gridy = 4;
161+ add(lblMarkerDefaultColor, gbc_lblMarkerDefaultColor);
162+
163+ rdbtnMarkerYellow = new JRadioButton("Yellow");
164+ buttonGroup_2.add(rdbtnMarkerYellow);
165+ rdbtnMarkerYellow.setFont(new Font("Dialog", Font.BOLD, 11));
166+ rdbtnMarkerYellow.setBackground(Color.YELLOW);
167+ GridBagConstraints gbc_rdbtnMarkerYellow = new GridBagConstraints();
168+ gbc_rdbtnMarkerYellow.anchor = GridBagConstraints.NORTH;
169+ gbc_rdbtnMarkerYellow.insets = new Insets(0, 0, 5, 5);
170+ gbc_rdbtnMarkerYellow.gridx = 2;
171+ gbc_rdbtnMarkerYellow.gridy = 4;
172+ add(rdbtnMarkerYellow, gbc_rdbtnMarkerYellow);
173+
174+ rdbtnMarkerCyan = new JRadioButton("Cyan");
175+ buttonGroup_2.add(rdbtnMarkerCyan);
176+ rdbtnMarkerCyan.setFont(new Font("Dialog", Font.BOLD, 11));
177+ rdbtnMarkerCyan.setBackground(Color.CYAN);
178+ GridBagConstraints gbc_rdbtnMarkerCyan = new GridBagConstraints();
179+ gbc_rdbtnMarkerCyan.fill = GridBagConstraints.HORIZONTAL;
180+ gbc_rdbtnMarkerCyan.anchor = GridBagConstraints.NORTH;
181+ gbc_rdbtnMarkerCyan.insets = new Insets(0, 0, 5, 5);
182+ gbc_rdbtnMarkerCyan.gridx = 3;
183+ gbc_rdbtnMarkerCyan.gridy = 4;
184+ add(rdbtnMarkerCyan, gbc_rdbtnMarkerCyan);
185+
186+ rdbtnMarkerMagenta = new JRadioButton("Magenta");
187+ buttonGroup_2.add(rdbtnMarkerMagenta);
188+ rdbtnMarkerMagenta.setFont(new Font("Dialog", Font.BOLD, 11));
189+ rdbtnMarkerMagenta.setBackground(Color.MAGENTA);
190+ GridBagConstraints gbc_rdbtnMarkerMagenta = new GridBagConstraints();
191+ gbc_rdbtnMarkerMagenta.anchor = GridBagConstraints.NORTHWEST;
192+ gbc_rdbtnMarkerMagenta.insets = new Insets(0, 0, 5, 5);
193+ gbc_rdbtnMarkerMagenta.gridx = 4;
194+ gbc_rdbtnMarkerMagenta.gridy = 4;
195+ add(rdbtnMarkerMagenta, gbc_rdbtnMarkerMagenta);
196+
197+ rdbtnMarkerGreen = new JRadioButton("Green");
198+ buttonGroup_2.add(rdbtnMarkerGreen);
199+ rdbtnMarkerGreen.setFont(new Font("Dialog", Font.BOLD, 11));
200+ rdbtnMarkerGreen.setBackground(Color.GREEN);
201+ GridBagConstraints gbc_rdbtnMarkerGreen = new GridBagConstraints();
202+ gbc_rdbtnMarkerGreen.fill = GridBagConstraints.HORIZONTAL;
203+ gbc_rdbtnMarkerGreen.anchor = GridBagConstraints.NORTH;
204+ gbc_rdbtnMarkerGreen.insets = new Insets(0, 0, 5, 5);
205+ gbc_rdbtnMarkerGreen.gridx = 5;
206+ gbc_rdbtnMarkerGreen.gridy = 4;
207+ add(rdbtnMarkerGreen, gbc_rdbtnMarkerGreen);
208+
209+ JLabel lblMarkerDefaultBreadth = new JLabel("Marker Default Breadth:");
210+ GridBagConstraints gbc_lblMarkerDefaultBreadth = new GridBagConstraints();
211+ gbc_lblMarkerDefaultBreadth.anchor = GridBagConstraints.WEST;
212+ gbc_lblMarkerDefaultBreadth.insets = new Insets(0, 0, 5, 5);
213+ gbc_lblMarkerDefaultBreadth.gridx = 1;
214+ gbc_lblMarkerDefaultBreadth.gridy = 5;
215+ add(lblMarkerDefaultBreadth, gbc_lblMarkerDefaultBreadth);
216+
217+ textField_MarkerDefaultBreadth = new JTextField();
218+ GridBagConstraints gbc_textField_MarkerDefaultBreadth = new GridBagConstraints();
219+ gbc_textField_MarkerDefaultBreadth.insets = new Insets(0, 0, 5, 5);
220+ gbc_textField_MarkerDefaultBreadth.fill = GridBagConstraints.HORIZONTAL;
221+ gbc_textField_MarkerDefaultBreadth.gridx = 2;
222+ gbc_textField_MarkerDefaultBreadth.gridy = 5;
223+ add(textField_MarkerDefaultBreadth, gbc_textField_MarkerDefaultBreadth);
224+ textField_MarkerDefaultBreadth.setColumns(10);
225+
226+ JLabel lblBookmarkDefaultColor = new JLabel("Bookmark Default Color:");
227+ GridBagConstraints gbc_lblBookmarkDefaultColor = new GridBagConstraints();
228+ gbc_lblBookmarkDefaultColor.anchor = GridBagConstraints.WEST;
229+ gbc_lblBookmarkDefaultColor.insets = new Insets(0, 0, 5, 5);
230+ gbc_lblBookmarkDefaultColor.gridx = 1;
231+ gbc_lblBookmarkDefaultColor.gridy = 7;
232+ add(lblBookmarkDefaultColor, gbc_lblBookmarkDefaultColor);
233+
234+ rdbtnBookmarkRed = new JRadioButton("Red");
235+ buttonGroup_3.add(rdbtnBookmarkRed);
236+ rdbtnBookmarkRed.setBackground(Color.RED);
237+ rdbtnBookmarkRed.setFont(new Font("Dialog", Font.BOLD, 11));
238+ GridBagConstraints gbc_rdbtnBookmarkRed = new GridBagConstraints();
239+ gbc_rdbtnBookmarkRed.fill = GridBagConstraints.HORIZONTAL;
240+ gbc_rdbtnBookmarkRed.insets = new Insets(0, 0, 5, 5);
241+ gbc_rdbtnBookmarkRed.gridx = 2;
242+ gbc_rdbtnBookmarkRed.gridy = 7;
243+ add(rdbtnBookmarkRed, gbc_rdbtnBookmarkRed);
244+
245+ rdbtnBookmarkBlue = new JRadioButton("Blue");
246+ buttonGroup_3.add(rdbtnBookmarkBlue);
247+ rdbtnBookmarkBlue.setBackground(Color.BLUE);
248+ rdbtnBookmarkBlue.setFont(new Font("Dialog", Font.BOLD, 11));
249+ GridBagConstraints gbc_rdbtnBookmarkBlue = new GridBagConstraints();
250+ gbc_rdbtnBookmarkBlue.fill = GridBagConstraints.HORIZONTAL;
251+ gbc_rdbtnBookmarkBlue.insets = new Insets(0, 0, 5, 5);
252+ gbc_rdbtnBookmarkBlue.gridx = 3;
253+ gbc_rdbtnBookmarkBlue.gridy = 7;
254+ add(rdbtnBookmarkBlue, gbc_rdbtnBookmarkBlue);
255+
256+ rdbtnBookmarkPurple = new JRadioButton("Purple");
257+ buttonGroup_3.add(rdbtnBookmarkPurple);
258+ rdbtnBookmarkPurple.setBackground(new Color(128, 0, 128));
259+ rdbtnBookmarkPurple.setFont(new Font("Dialog", Font.BOLD, 11));
260+ GridBagConstraints gbc_rdbtnBookmarkPurple = new GridBagConstraints();
261+ gbc_rdbtnBookmarkPurple.fill = GridBagConstraints.HORIZONTAL;
262+ gbc_rdbtnBookmarkPurple.insets = new Insets(0, 0, 5, 5);
263+ gbc_rdbtnBookmarkPurple.gridx = 4;
264+ gbc_rdbtnBookmarkPurple.gridy = 7;
265+ add(rdbtnBookmarkPurple, gbc_rdbtnBookmarkPurple);
266+
267+ rdbtnBookmarkGray = new JRadioButton("Gray");
268+ buttonGroup_3.add(rdbtnBookmarkGray);
269+ rdbtnBookmarkGray.setBackground(Color.GRAY);
270+ rdbtnBookmarkGray.setFont(new Font("Dialog", Font.BOLD, 11));
271+ GridBagConstraints gbc_rdbtnBookmarkGray = new GridBagConstraints();
272+ gbc_rdbtnBookmarkGray.fill = GridBagConstraints.HORIZONTAL;
273+ gbc_rdbtnBookmarkGray.insets = new Insets(0, 0, 5, 5);
274+ gbc_rdbtnBookmarkGray.gridx = 5;
275+ gbc_rdbtnBookmarkGray.gridy = 7;
276+ add(rdbtnBookmarkGray, gbc_rdbtnBookmarkGray);
277+
278+ rdbtnBookmarkGreen = new JRadioButton("Green");
279+ rdbtnBookmarkGreen.setFont(new Font("Dialog", Font.BOLD, 11));
280+ buttonGroup_3.add(rdbtnBookmarkGreen);
281+ rdbtnBookmarkGreen.setBackground(Color.GREEN);
282+ GridBagConstraints gbc_rdbtnBookmarkGreen = new GridBagConstraints();
283+ gbc_rdbtnBookmarkGreen.fill = GridBagConstraints.HORIZONTAL;
284+ gbc_rdbtnBookmarkGreen.insets = new Insets(0, 0, 5, 5);
285+ gbc_rdbtnBookmarkGreen.gridx = 6;
286+ gbc_rdbtnBookmarkGreen.gridy = 7;
287+ add(rdbtnBookmarkGreen, gbc_rdbtnBookmarkGreen);
288+
289+ JLabel lblBookmarkDefaultSize = new JLabel("Bookmark Default Size:");
290+ GridBagConstraints gbc_lblBookmarkDefaultSize = new GridBagConstraints();
291+ gbc_lblBookmarkDefaultSize.anchor = GridBagConstraints.WEST;
292+ gbc_lblBookmarkDefaultSize.insets = new Insets(0, 0, 5, 5);
293+ gbc_lblBookmarkDefaultSize.gridx = 1;
294+ gbc_lblBookmarkDefaultSize.gridy = 8;
295+ add(lblBookmarkDefaultSize, gbc_lblBookmarkDefaultSize);
296+
297+ rdbtnBookmarkSizeHuge = new JRadioButton((int)(100 * BookmarkView.HUGE) + "%");
298+ rdbtnBookmarkSizeHuge.setFont(new Font("Dialog", Font.BOLD, 11));
299+ buttonGroup_4.add(rdbtnBookmarkSizeHuge);
300+ GridBagConstraints gbc_rdbtnBookmarkSizeHuge = new GridBagConstraints();
301+ gbc_rdbtnBookmarkSizeHuge.insets = new Insets(0, 0, 5, 5);
302+ gbc_rdbtnBookmarkSizeHuge.gridx = 2;
303+ gbc_rdbtnBookmarkSizeHuge.gridy = 8;
304+ add(rdbtnBookmarkSizeHuge, gbc_rdbtnBookmarkSizeHuge);
305+
306+ rdbtnBookmarkSizeLarge = new JRadioButton((int)(100 * BookmarkView.LARGE) + "%");
307+ rdbtnBookmarkSizeLarge.setFont(new Font("Dialog", Font.BOLD, 11));
308+ buttonGroup_4.add(rdbtnBookmarkSizeLarge);
309+ GridBagConstraints gbc_rdbtnBookmarkSizeLarge = new GridBagConstraints();
310+ gbc_rdbtnBookmarkSizeLarge.insets = new Insets(0, 0, 5, 5);
311+ gbc_rdbtnBookmarkSizeLarge.gridx = 3;
312+ gbc_rdbtnBookmarkSizeLarge.gridy = 8;
313+ add(rdbtnBookmarkSizeLarge, gbc_rdbtnBookmarkSizeLarge);
314+
315+ rdbtnBookmarkSizeNormal = new JRadioButton((int)(100 * BookmarkView.NORMAL) + "%");
316+ rdbtnBookmarkSizeNormal.setFont(new Font("Dialog", Font.BOLD, 11));
317+ buttonGroup_4.add(rdbtnBookmarkSizeNormal);
318+ GridBagConstraints gbc_rdbtnBookmarkSizeNormal = new GridBagConstraints();
319+ gbc_rdbtnBookmarkSizeNormal.insets = new Insets(0, 0, 5, 5);
320+ gbc_rdbtnBookmarkSizeNormal.gridx = 4;
321+ gbc_rdbtnBookmarkSizeNormal.gridy = 8;
322+ add(rdbtnBookmarkSizeNormal, gbc_rdbtnBookmarkSizeNormal);
323+
324+ rdbtnBookmarkSizeSmall = new JRadioButton((int)(100 * BookmarkView.SMALL) + "%");
325+ rdbtnBookmarkSizeSmall.setFont(new Font("Dialog", Font.BOLD, 11));
326+ buttonGroup_4.add(rdbtnBookmarkSizeSmall);
327+ GridBagConstraints gbc_rdbtnBookmarkSizeSmall = new GridBagConstraints();
328+ gbc_rdbtnBookmarkSizeSmall.insets = new Insets(0, 0, 5, 5);
329+ gbc_rdbtnBookmarkSizeSmall.gridx = 5;
330+ gbc_rdbtnBookmarkSizeSmall.gridy = 8;
331+ add(rdbtnBookmarkSizeSmall, gbc_rdbtnBookmarkSizeSmall);
332+
333+ rdbtnBookmarkSizeTiny = new JRadioButton((int)(100 * BookmarkView.TINY) + "%");
334+ rdbtnBookmarkSizeTiny.setFont(new Font("Dialog", Font.BOLD, 11));
335+ buttonGroup_4.add(rdbtnBookmarkSizeTiny);
336+ GridBagConstraints gbc_rdbtnBookmarkSizeTiny = new GridBagConstraints();
337+ gbc_rdbtnBookmarkSizeTiny.insets = new Insets(0, 0, 5, 5);
338+ gbc_rdbtnBookmarkSizeTiny.gridx = 6;
339+ gbc_rdbtnBookmarkSizeTiny.gridy = 8;
340+ add(rdbtnBookmarkSizeTiny, gbc_rdbtnBookmarkSizeTiny);
341+
342+ JLabel lblResourceBasket = new JLabel("Resource Basket:");
343+ GridBagConstraints gbc_lblResourceBasket = new GridBagConstraints();
344+ gbc_lblResourceBasket.anchor = GridBagConstraints.WEST;
345+ gbc_lblResourceBasket.insets = new Insets(0, 0, 5, 5);
346+ gbc_lblResourceBasket.gridx = 1;
347+ gbc_lblResourceBasket.gridy = 10;
348+ add(lblResourceBasket, gbc_lblResourceBasket);
349+
350+ rdbtnSave = new JRadioButton("Save");
351+ buttonGroup_5.add(rdbtnSave);
352+ rdbtnSave.setFont(new Font("Dialog", Font.BOLD, 11));
353+ GridBagConstraints gbc_rdbtnSave = new GridBagConstraints();
354+ gbc_rdbtnSave.insets = new Insets(0, 0, 5, 5);
355+ gbc_rdbtnSave.gridx = 2;
356+ gbc_rdbtnSave.gridy = 10;
357+ add(rdbtnSave, gbc_rdbtnSave);
358+
359+ rdbtnNotSave = new JRadioButton("Not Save");
360+ buttonGroup_5.add(rdbtnNotSave);
361+ rdbtnNotSave.setFont(new Font("Dialog", Font.BOLD, 11));
362+ GridBagConstraints gbc_rdbtnNotSave = new GridBagConstraints();
363+ gbc_rdbtnNotSave.insets = new Insets(0, 0, 5, 5);
364+ gbc_rdbtnNotSave.gridx = 3;
365+ gbc_rdbtnNotSave.gridy = 10;
366+ add(rdbtnNotSave, gbc_rdbtnNotSave);
367+
368+ JLabel lblTempolaryResion = new JLabel("Tempolary Resion:");
369+ GridBagConstraints gbc_lblTempolaryResion = new GridBagConstraints();
370+ gbc_lblTempolaryResion.anchor = GridBagConstraints.WEST;
371+ gbc_lblTempolaryResion.insets = new Insets(0, 0, 0, 5);
372+ gbc_lblTempolaryResion.gridx = 1;
373+ gbc_lblTempolaryResion.gridy = 11;
374+ add(lblTempolaryResion, gbc_lblTempolaryResion);
375+
376+ rdbtnOn = new JRadioButton("On");
377+ buttonGroup_6.add(rdbtnOn);
378+ rdbtnOn.setFont(new Font("Dialog", Font.BOLD, 11));
379+ GridBagConstraints gbc_rdbtnOn = new GridBagConstraints();
380+ gbc_rdbtnOn.insets = new Insets(0, 0, 0, 5);
381+ gbc_rdbtnOn.gridx = 2;
382+ gbc_rdbtnOn.gridy = 11;
383+ add(rdbtnOn, gbc_rdbtnOn);
384+
385+ rdbtnOff = new JRadioButton("Off");
386+ buttonGroup_6.add(rdbtnOff);
387+ rdbtnOff.setFont(new Font("Dialog", Font.BOLD, 11));
388+ GridBagConstraints gbc_rdbtnOff = new GridBagConstraints();
389+ gbc_rdbtnOff.insets = new Insets(0, 0, 0, 5);
390+ gbc_rdbtnOff.gridx = 3;
391+ gbc_rdbtnOff.gridy = 11;
392+ add(rdbtnOff, gbc_rdbtnOff);
393+
394+ // Default Settings
395+ boolean markupMovability = UniSelectedState.getInstance().getMarkupMovability();
396+ if(markupMovability){
397+ rdbtnMovable.setSelected(true);
398+ } else {
399+ rdbtnUnmovable.setSelected(true);
400+ }
401+
402+ Color memoPad_dc = MemoPadView.stringToColor(Preference.getInstance().getMemoPadColor());
403+ if(memoPad_dc == MemoPadView.MEMOPAD_YELLOW){
404+ rdbtnMemoPadYellow.setSelected(true);
405+ } else if(memoPad_dc == MemoPadView.MEMOPAD_CYAN){
406+ rdbtnMemoPadCyan.setSelected(true);
407+ } else if(memoPad_dc == MemoPadView.MEMOPAD_MAGENTA){
408+ rdbtnMemoPadMagenta.setSelected(true);
409+ } else if(memoPad_dc == MemoPadView.MEMOPAD_GREEN){
410+ rdbtnMemoPadGreen.setSelected(true);
411+ } else {
412+ rdbtnMemoPadYellow.setSelected(true);
413+ }
414+
415+ Color marker_dc = MarkerView.stringToColor(Preference.getInstance().getMarkerColor());
416+ if(marker_dc == MarkerView.MARKER_YELLOW){
417+ rdbtnMarkerYellow.setSelected(true);
418+ } else if(marker_dc == MarkerView.MARKER_CYAN){
419+ rdbtnMarkerCyan.setSelected(true);
420+ } else if(marker_dc == MarkerView.MARKER_MAGENTA){
421+ rdbtnMarkerMagenta.setSelected(true);
422+ } else if(marker_dc == MarkerView.MARKER_GREEN){
423+ rdbtnMarkerGreen.setSelected(true);
424+ } else {
425+ rdbtnMarkerYellow.setSelected(true);
426+ }
427+
428+ String breadth = Preference.getInstance().getMarkerBreadth();
429+ this.textField_MarkerDefaultBreadth.setText(breadth);
430+
431+ String bookmark_dc = Preference.getInstance().getDefaultBookmarkPath();
432+ if(bookmark_dc == BookmarkView.PATH_TO_RED){
433+ this.rdbtnBookmarkRed.setSelected(true);
434+ } else if(bookmark_dc == BookmarkView.PATH_TO_BLUE){
435+ this.rdbtnBookmarkBlue.setSelected(true);
436+ } else if(bookmark_dc == BookmarkView.PATH_TO_PURPLE){
437+ this.rdbtnBookmarkPurple.setSelected(true);
438+ } else if(bookmark_dc == BookmarkView.PATH_TO_PURPLE){
439+ this.rdbtnBookmarkPurple.setSelected(true);
440+ } else if(bookmark_dc == BookmarkView.PATH_TO_GREEN){
441+ this.rdbtnBookmarkGreen.setSelected(true);
442+ } else {
443+ this.rdbtnBookmarkRed.setSelected(true);
444+ }
445+
446+ double bookmark_size = new Double(Preference.getInstance().getBookmarkSize());
447+ if(bookmark_size == BookmarkView.HUGE){
448+ this.rdbtnBookmarkSizeHuge.setSelected(true);
449+ } else if(bookmark_size == BookmarkView.LARGE){
450+ this.rdbtnBookmarkSizeLarge.setSelected(true);
451+ } else if(bookmark_size == BookmarkView.NORMAL){
452+ this.rdbtnBookmarkSizeNormal.setSelected(true);
453+ } else if(bookmark_size == BookmarkView.SMALL){
454+ this.rdbtnBookmarkSizeSmall.setSelected(true);
455+ } else if(bookmark_size == BookmarkView.TINY){
456+ this.rdbtnBookmarkSizeTiny.setSelected(true);
457+ } else {
458+ this.rdbtnBookmarkSizeNormal.setSelected(true);
459+ }
460+
461+ this.rdbtnSave.setSelected(new Boolean(Preference.getInstance().getResourceBasketSaveOption()));
462+ this.rdbtnOn.setSelected(Preference.getInstance().isTempRegionOn());
463+ }
464+
465+ public boolean getMarkupMovability() {
466+ return rdbtnMovable.isSelected();
467+ }
468+
469+ public String getMemoPadColor() {
470+ if(rdbtnMemoPadYellow.isSelected()){
471+ return MemoPadView.colorToString(MemoPadView.MEMOPAD_YELLOW);
472+ } else if(rdbtnMemoPadCyan.isSelected()){
473+ return MemoPadView.colorToString(MemoPadView.MEMOPAD_CYAN);
474+ } else if(rdbtnMemoPadMagenta.isSelected()){
475+ return MemoPadView.colorToString(MemoPadView.MEMOPAD_MAGENTA);
476+ } else if(rdbtnMemoPadGreen.isSelected()){
477+ return MemoPadView.colorToString(MemoPadView.MEMOPAD_GREEN);
478+ } else {
479+ return MemoPadView.colorToString(MemoPadView.MEMOPAD_YELLOW);
480+ }
481+ }
482+
483+ public String getMarkerColor() {
484+ if(rdbtnMarkerYellow.isSelected()){
485+ return MarkerView.colorToString(MarkerView.MARKER_YELLOW);
486+ } else if(rdbtnMarkerCyan.isSelected()){
487+ return MarkerView.colorToString(MarkerView.MARKER_CYAN);
488+ } else if(rdbtnMarkerMagenta.isSelected()){
489+ return MarkerView.colorToString(MarkerView.MARKER_MAGENTA);
490+ } else if(rdbtnMarkerGreen.isSelected()){
491+ return MarkerView.colorToString(MarkerView.MARKER_GREEN);
492+ } else {
493+ return MarkerView.colorToString(MarkerView.MARKER_YELLOW);
494+ }
495+ }
496+
497+ public String getMarkerBreadth() {
498+ String breadth = this.textField_MarkerDefaultBreadth.getText();
499+ if(breadth == null || Integer.parseInt(breadth) < 5){
500+ JOptionPane.showMessageDialog(null, "Please input a positive integer greater than 5.");
501+ return Preference.getInstance().getMarkerBreadth();
502+ }
503+ return breadth;
504+
505+ }
506+
507+ public String getBookmarkPath() {
508+ if(this.rdbtnBookmarkRed.isSelected()){
509+ return BookmarkView.PATH_TO_RED;
510+ } else if(this.rdbtnBookmarkBlue.isSelected()){
511+ return BookmarkView.PATH_TO_BLUE;
512+ } else if(this.rdbtnBookmarkPurple.isSelected()){
513+ return BookmarkView.PATH_TO_PURPLE;
514+ } else if(this.rdbtnBookmarkGray.isSelected()){
515+ return BookmarkView.PATH_TO_GRAY;
516+ } else if(this.rdbtnBookmarkGreen.isSelected()){
517+ return BookmarkView.PATH_TO_GREEN;
518+ } else {
519+ return BookmarkView.PATH_TO_RED;
520+ }
521+ }
522+
523+ public String getBookmarkSize() {
524+ if(this.rdbtnBookmarkSizeHuge.isSelected()){
525+ return Double.toString(BookmarkView.HUGE);
526+ } else if(this.rdbtnBookmarkSizeLarge.isSelected()){
527+ return Double.toString(BookmarkView.LARGE);
528+ } else if(this.rdbtnBookmarkSizeNormal.isSelected()){
529+ return Double.toString(BookmarkView.NORMAL);
530+ } else if(this.rdbtnBookmarkSizeSmall.isSelected()){
531+ return Double.toString(BookmarkView.SMALL);
532+ } else if(this.rdbtnBookmarkSizeTiny.isSelected()){
533+ return Double.toString(BookmarkView.TINY);
534+ } else {
535+ return Double.toString(BookmarkView.NORMAL);
536+ }
537+ }
538+
539+ public String getResourceBasketSaveOption() {
540+ if(this.rdbtnSave.isSelected()){
541+ return "true";
542+ } else {
543+ return "false";
544+ }
545+ }
546+
547+ public boolean getTempRegionOn() {
548+ return this.rdbtnOn.isSelected();
549+ }
550+
551+}
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/TextMarkupPanel.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/TextMarkupPanel.java (revision 1204)
@@ -0,0 +1,14 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JPanel;
4+
5+public class TextMarkupPanel extends JPanel {
6+
7+ /**
8+ * Create the panel.
9+ */
10+ public TextMarkupPanel() {
11+
12+ }
13+
14+}
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/DisplayPanel.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/DisplayPanel.java (revision 1204)
@@ -0,0 +1,148 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JPanel;
4+import javax.swing.JLabel;
5+
6+import java.awt.GridBagLayout;
7+import java.awt.GridBagConstraints;
8+import java.awt.Insets;
9+
10+import javax.swing.JRadioButton;
11+import javax.swing.ButtonGroup;
12+
13+import smart_gs.GSConstants;
14+import smart_gs.logical.Preference;
15+
16+public class DisplayPanel extends JPanel {
17+ private final ButtonGroup buttonGroup = new ButtonGroup();
18+ private final ButtonGroup buttonGroup_1 = new ButtonGroup();
19+ private JRadioButton rdbtnTop;
20+ private JRadioButton rdbtnBottum;
21+ private JRadioButton rdbtnLeft;
22+ private JRadioButton rdbtnRight;
23+ private JRadioButton rdbtnTopLeft;
24+ private JRadioButton rdbtnTopRight;
25+
26+ /**
27+ * Create the panel.
28+ */
29+ public DisplayPanel() {
30+ GridBagLayout gridBagLayout = new GridBagLayout();
31+ gridBagLayout.columnWidths = new int[]{0, 150, 63, 0, 0, 0, 0};
32+ gridBagLayout.rowHeights = new int[]{16, 0, 0, 0};
33+ gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
34+ gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, Double.MIN_VALUE};
35+ setLayout(gridBagLayout);
36+
37+ JLabel lblWindowDisplayMode = new JLabel("Window Display Mode:");
38+ GridBagConstraints gbc_lblWindowDisplayMode = new GridBagConstraints();
39+ gbc_lblWindowDisplayMode.anchor = GridBagConstraints.WEST;
40+ gbc_lblWindowDisplayMode.insets = new Insets(0, 0, 5, 5);
41+ gbc_lblWindowDisplayMode.gridx = 1;
42+ gbc_lblWindowDisplayMode.gridy = 1;
43+ add(lblWindowDisplayMode, gbc_lblWindowDisplayMode);
44+
45+ rdbtnTop = new JRadioButton("Top");
46+ buttonGroup.add(rdbtnTop);
47+ GridBagConstraints gbc_rdbtnTop = new GridBagConstraints();
48+ gbc_rdbtnTop.insets = new Insets(0, 0, 5, 5);
49+ gbc_rdbtnTop.gridx = 2;
50+ gbc_rdbtnTop.gridy = 1;
51+ add(rdbtnTop, gbc_rdbtnTop);
52+
53+ rdbtnBottum = new JRadioButton("Bottom");
54+ buttonGroup.add(rdbtnBottum);
55+ GridBagConstraints gbc_rdbtnBottum = new GridBagConstraints();
56+ gbc_rdbtnBottum.insets = new Insets(0, 0, 5, 5);
57+ gbc_rdbtnBottum.gridx = 3;
58+ gbc_rdbtnBottum.gridy = 1;
59+ add(rdbtnBottum, gbc_rdbtnBottum);
60+
61+ rdbtnLeft = new JRadioButton("Left");
62+ buttonGroup.add(rdbtnLeft);
63+ GridBagConstraints gbc_rdbtnLeft = new GridBagConstraints();
64+ gbc_rdbtnLeft.insets = new Insets(0, 0, 5, 5);
65+ gbc_rdbtnLeft.gridx = 4;
66+ gbc_rdbtnLeft.gridy = 1;
67+ add(rdbtnLeft, gbc_rdbtnLeft);
68+
69+ rdbtnRight = new JRadioButton("Right");
70+ buttonGroup.add(rdbtnRight);
71+ GridBagConstraints gbc_rdbtnRight = new GridBagConstraints();
72+ gbc_rdbtnRight.insets = new Insets(0, 0, 5, 0);
73+ gbc_rdbtnRight.gridx = 5;
74+ gbc_rdbtnRight.gridy = 1;
75+ add(rdbtnRight, gbc_rdbtnRight);
76+
77+ JLabel lblImagePosition = new JLabel("Image Position:");
78+ GridBagConstraints gbc_lblImagePosition = new GridBagConstraints();
79+ gbc_lblImagePosition.anchor = GridBagConstraints.WEST;
80+ gbc_lblImagePosition.insets = new Insets(0, 0, 0, 5);
81+ gbc_lblImagePosition.gridx = 1;
82+ gbc_lblImagePosition.gridy = 2;
83+ add(lblImagePosition, gbc_lblImagePosition);
84+
85+ rdbtnTopLeft = new JRadioButton("Top Left");
86+ buttonGroup_1.add(rdbtnTopLeft);
87+ GridBagConstraints gbc_rdbtnTopLeft = new GridBagConstraints();
88+ gbc_rdbtnTopLeft.gridwidth = 2;
89+ gbc_rdbtnTopLeft.insets = new Insets(0, 0, 0, 5);
90+ gbc_rdbtnTopLeft.gridx = 2;
91+ gbc_rdbtnTopLeft.gridy = 2;
92+ add(rdbtnTopLeft, gbc_rdbtnTopLeft);
93+
94+ rdbtnTopRight = new JRadioButton("Top Right");
95+ buttonGroup_1.add(rdbtnTopRight);
96+ GridBagConstraints gbc_rdbtnTopRight = new GridBagConstraints();
97+ gbc_rdbtnTopRight.gridwidth = 2;
98+ gbc_rdbtnTopRight.gridx = 4;
99+ gbc_rdbtnTopRight.gridy = 2;
100+ add(rdbtnTopRight, gbc_rdbtnTopRight);
101+
102+ // Default Settings
103+ if(Preference.windowModeIsTop()){
104+ this.rdbtnTop.setSelected(true);
105+ } else if(Preference.windowModeIsBottom()){
106+ this.rdbtnBottum.setSelected(true);
107+ } else if(Preference.windowModeIsLeft()){
108+ this.rdbtnLeft.setSelected(true);
109+ } else if(Preference.windowModeIsRight()){
110+ this.rdbtnRight.setSelected(true);
111+ }
112+
113+ int imagePosition = Preference.getInstance().getImagePosition();
114+ if(imagePosition == GSConstants.TOP_LEFT){
115+ this.rdbtnTopLeft.setSelected(true);
116+ } else if(imagePosition == GSConstants.TOP_RIGHT){
117+ this.rdbtnTopRight.setSelected(true);
118+ } else {
119+ this.rdbtnTopLeft.setSelected(true);
120+ }
121+ }
122+
123+ public int getWindowMode() {
124+ if(this.rdbtnTop.isSelected()){
125+ return GSConstants.WINDOW_VERTICAL_IMAGE_TOP_MODE;
126+ } else if(this.rdbtnBottum.isSelected()){
127+ return GSConstants.WINDOW_VERTICAL_IMAGE_BOTTOM_MODE;
128+ } else if(this.rdbtnLeft.isSelected()){
129+ return GSConstants.WINDOW_HORIZONTAL_IMAGE_LEFT_MODE;
130+ } else if(this.rdbtnRight.isSelected()){
131+ return GSConstants.WINDOW_HORIZONTAL_IMAGE_RIGHT_MODE;
132+ } else {
133+ return GSConstants.WINDOW_VERTICAL_IMAGE_TOP_MODE;
134+ }
135+ }
136+
137+ public int getImagePosition() {
138+ if(this.rdbtnTopLeft.isSelected()){
139+ return GSConstants.TOP_LEFT;
140+ } else if(this.rdbtnTopRight.isSelected()){
141+ return GSConstants.TOP_RIGHT;
142+ } else {
143+ return GSConstants.TOP_LEFT;
144+ }
145+
146+ }
147+
148+}
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/SearchPanel.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/SearchPanel.java (revision 1204)
@@ -0,0 +1,257 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JPanel;
4+import javax.swing.JLabel;
5+import javax.swing.JRadioButton;
6+import javax.swing.ButtonGroup;
7+import javax.swing.JTextField;
8+
9+import smart_gs.GSConstants;
10+import smart_gs.image_search.GSSearchEngine;
11+import smart_gs.logical.Preference;
12+
13+import java.awt.GridBagLayout;
14+import java.awt.GridBagConstraints;
15+import java.awt.Insets;
16+
17+public class SearchPanel extends JPanel {
18+ private final ButtonGroup buttonGroup = new ButtonGroup();
19+ private final ButtonGroup buttonGroup_1 = new ButtonGroup();
20+ private JTextField textField_SearchSizeBound;
21+ private JRadioButton rdbtnExternal;
22+ private JRadioButton rdbtnType1;
23+ private JRadioButton rdbtnType2;
24+ private JRadioButton rdbtnType3;
25+ private JRadioButton rdbtnHorizontal;
26+ private JRadioButton rdbtnVertical;
27+ private JRadioButton rdbtnXml;
28+ private JRadioButton rdbtnSegfo;
29+ private final ButtonGroup buttonGroup_2 = new ButtonGroup();
30+ private final ButtonGroup buttonGroup_3 = new ButtonGroup();
31+
32+ /**
33+ * Create the panel.
34+ */
35+ public SearchPanel() {
36+ GridBagLayout gridBagLayout = new GridBagLayout();
37+ gridBagLayout.columnWidths = new int[]{38, 160, 96, 28, 46, 75, 0};
38+ gridBagLayout.rowHeights = new int[]{34, 24, 28, 24, 24, 20, 0};
39+ gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
40+ gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
41+ setLayout(gridBagLayout);
42+
43+ JLabel lblImageSearchEngine = new JLabel("Image Search Engine:");
44+ GridBagConstraints gbc_lblImageSearchEngine = new GridBagConstraints();
45+ gbc_lblImageSearchEngine.fill = GridBagConstraints.HORIZONTAL;
46+ gbc_lblImageSearchEngine.insets = new Insets(0, 0, 5, 5);
47+ gbc_lblImageSearchEngine.gridx = 1;
48+ gbc_lblImageSearchEngine.gridy = 1;
49+ add(lblImageSearchEngine, gbc_lblImageSearchEngine);
50+
51+ JRadioButton rdbtnInternal = new JRadioButton("Internal");
52+ buttonGroup.add(rdbtnInternal);
53+ GridBagConstraints gbc_rdbtnInternal = new GridBagConstraints();
54+ gbc_rdbtnInternal.anchor = GridBagConstraints.NORTH;
55+ gbc_rdbtnInternal.fill = GridBagConstraints.HORIZONTAL;
56+ gbc_rdbtnInternal.insets = new Insets(0, 0, 5, 5);
57+ gbc_rdbtnInternal.gridwidth = 2;
58+ gbc_rdbtnInternal.gridx = 2;
59+ gbc_rdbtnInternal.gridy = 1;
60+ add(rdbtnInternal, gbc_rdbtnInternal);
61+
62+ rdbtnExternal = new JRadioButton("External");
63+ buttonGroup.add(rdbtnExternal);
64+ GridBagConstraints gbc_rdbtnExternal = new GridBagConstraints();
65+ gbc_rdbtnExternal.anchor = GridBagConstraints.NORTHWEST;
66+ gbc_rdbtnExternal.insets = new Insets(0, 0, 5, 0);
67+ gbc_rdbtnExternal.gridwidth = 2;
68+ gbc_rdbtnExternal.gridx = 4;
69+ gbc_rdbtnExternal.gridy = 1;
70+ add(rdbtnExternal, gbc_rdbtnExternal);
71+
72+
73+ JLabel lblImageSearchType = new JLabel("Image Search Type in Dictionary:");
74+ GridBagConstraints gbc_lblImageSearchType = new GridBagConstraints();
75+ gbc_lblImageSearchType.fill = GridBagConstraints.BOTH;
76+ gbc_lblImageSearchType.insets = new Insets(0, 0, 5, 5);
77+ gbc_lblImageSearchType.gridx = 1;
78+ gbc_lblImageSearchType.gridy = 2;
79+ add(lblImageSearchType, gbc_lblImageSearchType);
80+
81+
82+ rdbtnType1 = new JRadioButton("Type1");
83+ buttonGroup_1.add(rdbtnType1);
84+ GridBagConstraints gbc_rdbtnType1 = new GridBagConstraints();
85+ gbc_rdbtnType1.anchor = GridBagConstraints.NORTH;
86+ gbc_rdbtnType1.fill = GridBagConstraints.HORIZONTAL;
87+ gbc_rdbtnType1.insets = new Insets(0, 0, 5, 5);
88+ gbc_rdbtnType1.gridx = 2;
89+ gbc_rdbtnType1.gridy = 2;
90+ add(rdbtnType1, gbc_rdbtnType1);
91+
92+ rdbtnType2 = new JRadioButton("Type2");
93+ buttonGroup_1.add(rdbtnType2);
94+ GridBagConstraints gbc_rdbtnType2 = new GridBagConstraints();
95+ gbc_rdbtnType2.anchor = GridBagConstraints.NORTH;
96+ gbc_rdbtnType2.fill = GridBagConstraints.HORIZONTAL;
97+ gbc_rdbtnType2.insets = new Insets(0, 0, 5, 5);
98+ gbc_rdbtnType2.gridwidth = 2;
99+ gbc_rdbtnType2.gridx = 3;
100+ gbc_rdbtnType2.gridy = 2;
101+ add(rdbtnType2, gbc_rdbtnType2);
102+
103+ rdbtnType3 = new JRadioButton("Type3");
104+ buttonGroup_1.add(rdbtnType3);
105+ GridBagConstraints gbc_rdbtnType3 = new GridBagConstraints();
106+ gbc_rdbtnType3.anchor = GridBagConstraints.NORTH;
107+ gbc_rdbtnType3.fill = GridBagConstraints.HORIZONTAL;
108+ gbc_rdbtnType3.insets = new Insets(0, 0, 5, 0);
109+ gbc_rdbtnType3.gridx = 5;
110+ gbc_rdbtnType3.gridy = 2;
111+ add(rdbtnType3, gbc_rdbtnType3);
112+
113+
114+ JLabel lblDefaultLineDirection = new JLabel("Default Line Direction:");
115+ GridBagConstraints gbc_lblDefaultLineDirection = new GridBagConstraints();
116+ gbc_lblDefaultLineDirection.anchor = GridBagConstraints.WEST;
117+ gbc_lblDefaultLineDirection.insets = new Insets(0, 0, 5, 5);
118+ gbc_lblDefaultLineDirection.gridx = 1;
119+ gbc_lblDefaultLineDirection.gridy = 3;
120+ add(lblDefaultLineDirection, gbc_lblDefaultLineDirection);
121+
122+ rdbtnHorizontal = new JRadioButton("Horizontal");
123+ buttonGroup_2.add(rdbtnHorizontal);
124+ GridBagConstraints gbc_rdbtnHorizontal = new GridBagConstraints();
125+ gbc_rdbtnHorizontal.anchor = GridBagConstraints.NORTH;
126+ gbc_rdbtnHorizontal.fill = GridBagConstraints.HORIZONTAL;
127+ gbc_rdbtnHorizontal.insets = new Insets(0, 0, 5, 5);
128+ gbc_rdbtnHorizontal.gridwidth = 2;
129+ gbc_rdbtnHorizontal.gridx = 2;
130+ gbc_rdbtnHorizontal.gridy = 3;
131+ add(rdbtnHorizontal, gbc_rdbtnHorizontal);
132+
133+ rdbtnVertical = new JRadioButton("Vertical");
134+ buttonGroup_2.add(rdbtnVertical);
135+ GridBagConstraints gbc_rdbtnVertical = new GridBagConstraints();
136+ gbc_rdbtnVertical.anchor = GridBagConstraints.NORTHWEST;
137+ gbc_rdbtnVertical.insets = new Insets(0, 0, 5, 0);
138+ gbc_rdbtnVertical.gridwidth = 2;
139+ gbc_rdbtnVertical.gridx = 4;
140+ gbc_rdbtnVertical.gridy = 3;
141+ add(rdbtnVertical, gbc_rdbtnVertical);
142+
143+
144+ JLabel lblDefaultLineSegInfoFileType = new JLabel("Default Line Seg Info File Type:");
145+ GridBagConstraints gbc_lblDefaultLineSegInfoFileType = new GridBagConstraints();
146+ gbc_lblDefaultLineSegInfoFileType.fill = GridBagConstraints.HORIZONTAL;
147+ gbc_lblDefaultLineSegInfoFileType.insets = new Insets(0, 0, 5, 5);
148+ gbc_lblDefaultLineSegInfoFileType.gridx = 1;
149+ gbc_lblDefaultLineSegInfoFileType.gridy = 4;
150+ add(lblDefaultLineSegInfoFileType, gbc_lblDefaultLineSegInfoFileType);
151+
152+ rdbtnXml = new JRadioButton("XML");
153+ buttonGroup_3.add(rdbtnXml);
154+ GridBagConstraints gbc_rdbtnXml = new GridBagConstraints();
155+ gbc_rdbtnXml.anchor = GridBagConstraints.NORTHWEST;
156+ gbc_rdbtnXml.insets = new Insets(0, 0, 5, 5);
157+ gbc_rdbtnXml.gridx = 2;
158+ gbc_rdbtnXml.gridy = 4;
159+ add(rdbtnXml, gbc_rdbtnXml);
160+
161+ rdbtnSegfo = new JRadioButton("segfo");
162+ buttonGroup_3.add(rdbtnSegfo);
163+ GridBagConstraints gbc_rdbtnSegfo = new GridBagConstraints();
164+ gbc_rdbtnSegfo.anchor = GridBagConstraints.NORTH;
165+ gbc_rdbtnSegfo.insets = new Insets(0, 0, 5, 0);
166+ gbc_rdbtnSegfo.gridwidth = 3;
167+ gbc_rdbtnSegfo.gridx = 3;
168+ gbc_rdbtnSegfo.gridy = 4;
169+ add(rdbtnSegfo, gbc_rdbtnSegfo);
170+
171+ JLabel lblSearchSizeBound = new JLabel("Search Size Bound:");
172+ GridBagConstraints gbc_lblSearchSizeBound = new GridBagConstraints();
173+ gbc_lblSearchSizeBound.fill = GridBagConstraints.HORIZONTAL;
174+ gbc_lblSearchSizeBound.insets = new Insets(0, 0, 0, 5);
175+ gbc_lblSearchSizeBound.gridx = 1;
176+ gbc_lblSearchSizeBound.gridy = 5;
177+ add(lblSearchSizeBound, gbc_lblSearchSizeBound);
178+
179+ textField_SearchSizeBound = new JTextField();
180+ textField_SearchSizeBound.setToolTipText("Input Max Found Size");
181+ GridBagConstraints gbc_textField_SearchSizeBound = new GridBagConstraints();
182+ gbc_textField_SearchSizeBound.anchor = GridBagConstraints.NORTHEAST;
183+ gbc_textField_SearchSizeBound.insets = new Insets(0, 0, 0, 5);
184+ gbc_textField_SearchSizeBound.gridx = 2;
185+ gbc_textField_SearchSizeBound.gridy = 5;
186+ add(textField_SearchSizeBound, gbc_textField_SearchSizeBound);
187+ textField_SearchSizeBound.setColumns(10);
188+
189+ // Default Settings
190+ rdbtnExternal.setSelected(GSSearchEngine.getInstance().isUseExternalEngine());
191+ String type = Preference.getInstance().getSearchImageDictionaryLogic();
192+ if(type.equals("0")){
193+ rdbtnType1.setSelected(true);
194+ }else if(type.equals("1")){
195+ rdbtnType2.setSelected(true);
196+ }else if(type.equals("2")){
197+ rdbtnType3.setSelected(true);
198+ }else {
199+ rdbtnType1.setSelected(true);
200+ }
201+
202+ int defaultLineDirection = Preference.getInstance().getDefaultLineDirection();
203+ if(defaultLineDirection == GSConstants.TEXT_TYPE_HORIZONTAL){
204+ rdbtnHorizontal.setSelected(true);
205+ } else {
206+ rdbtnVertical.setSelected(true);
207+ }
208+
209+ String lineSegFileDefaultType = Preference.getInstance().getLineSegFileDefaultType();
210+ if(lineSegFileDefaultType.equals("xml")){
211+ rdbtnXml.setSelected(true);
212+ } else if(lineSegFileDefaultType.equals("segfo")){
213+ rdbtnSegfo.setSelected(true);
214+ }
215+
216+ textField_SearchSizeBound.setText(new Integer(GSSearchEngine.getInstance().getMaxFound()).toString());
217+
218+ }
219+
220+ public boolean getUseExternalEngine() {
221+ return rdbtnExternal.isSelected();
222+ }
223+
224+ public String getSearchImageDictionaryLogic() {
225+ if(rdbtnType1.isSelected()){
226+ return "0";
227+ } else if(rdbtnType2.isSelected()){
228+ return "1";
229+ } else if(rdbtnType3.isSelected()){
230+ return "2";
231+ } else {
232+ return "0";
233+ }
234+ }
235+
236+ public int getDefaultLineDirection() {
237+ if(rdbtnHorizontal.isSelected()){
238+ return GSConstants.TEXT_TYPE_HORIZONTAL;
239+ } else if(rdbtnVertical.isSelected()){
240+ return GSConstants.TEXT_TYPE_VERTICAL;
241+ }
242+ return 0;
243+ }
244+
245+ public String getLineSegFileDefaultType() {
246+ if(rdbtnXml.isSelected()){
247+ return "xml";
248+ } else if(rdbtnSegfo.isSelected()){
249+ return "segfo";
250+ }
251+ return null;
252+ }
253+
254+ public int getMaxFound() {
255+ return Integer.valueOf(textField_SearchSizeBound.getText());
256+ }
257+}
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/NetworkPanel.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/NetworkPanel.java (revision 1204)
@@ -0,0 +1,221 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JFileChooser;
4+import javax.swing.JPanel;
5+
6+import java.awt.GridBagLayout;
7+
8+import javax.swing.JLabel;
9+
10+import java.awt.GridBagConstraints;
11+
12+import javax.swing.JTextField;
13+
14+import java.awt.Insets;
15+import java.awt.event.ActionEvent;
16+import java.awt.event.ActionListener;
17+import java.io.File;
18+
19+import javax.swing.JButton;
20+
21+import smart_gs.logical.Preference;
22+import smart_gs.swingui.WorkspaceWindow;
23+import smart_gs.util.CanonicalPathString;
24+
25+import javax.swing.JPasswordField;
26+
27+public class NetworkPanel extends JPanel {
28+ private JTextField textField_WebDav_ServerPath;
29+ private JTextField textField_Proxy_Address;
30+ private JTextField textField_WebBrowser;
31+ private JLabel lblServerPath;
32+ private JLabel lblUserId;
33+ private JLabel lblPassword;
34+ private JLabel lblAddress;
35+ private JLabel lblPort;
36+ private JTextField textField_WebDav_UserId;
37+ private JPasswordField passwordField_WebDav_Password;
38+ private JTextField textField_Proxy_Port;
39+ private JButton btnSelect_WebBrowser;
40+
41+ /**
42+ * Create the panel.
43+ */
44+ public NetworkPanel() {
45+ GridBagLayout gridBagLayout = new GridBagLayout();
46+ gridBagLayout.columnWidths = new int[]{0, 93, 0, 277, 0, 0, 0};
47+ gridBagLayout.rowHeights = new int[]{20, 0, 0, 0, 0, 0, 0, 0, 0, 0};
48+ gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 1.0, 0.0, 0.0, Double.MIN_VALUE};
49+ gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
50+ setLayout(gridBagLayout);
51+
52+ JLabel lblWebDav = new JLabel("WebDAV");
53+ GridBagConstraints gbc_lblWebDav = new GridBagConstraints();
54+ gbc_lblWebDav.insets = new Insets(0, 0, 5, 5);
55+ gbc_lblWebDav.gridx = 1;
56+ gbc_lblWebDav.gridy = 1;
57+ add(lblWebDav, gbc_lblWebDav);
58+
59+ lblServerPath = new JLabel("Server Path:");
60+ GridBagConstraints gbc_lblServerPath = new GridBagConstraints();
61+ gbc_lblServerPath.insets = new Insets(0, 0, 5, 5);
62+ gbc_lblServerPath.anchor = GridBagConstraints.EAST;
63+ gbc_lblServerPath.gridx = 2;
64+ gbc_lblServerPath.gridy = 1;
65+ add(lblServerPath, gbc_lblServerPath);
66+
67+ textField_WebDav_ServerPath = new JTextField();
68+ GridBagConstraints gbc_textField_WebDav_ServerPath = new GridBagConstraints();
69+ gbc_textField_WebDav_ServerPath.insets = new Insets(0, 0, 5, 5);
70+ gbc_textField_WebDav_ServerPath.fill = GridBagConstraints.HORIZONTAL;
71+ gbc_textField_WebDav_ServerPath.gridx = 3;
72+ gbc_textField_WebDav_ServerPath.gridy = 1;
73+ add(textField_WebDav_ServerPath, gbc_textField_WebDav_ServerPath);
74+ textField_WebDav_ServerPath.setColumns(10);
75+
76+ lblUserId = new JLabel("User ID:");
77+ GridBagConstraints gbc_lblUserId = new GridBagConstraints();
78+ gbc_lblUserId.anchor = GridBagConstraints.EAST;
79+ gbc_lblUserId.insets = new Insets(0, 0, 5, 5);
80+ gbc_lblUserId.gridx = 2;
81+ gbc_lblUserId.gridy = 2;
82+ add(lblUserId, gbc_lblUserId);
83+
84+ textField_WebDav_UserId = new JTextField();
85+ GridBagConstraints gbc_textField_WebDav_UserId = new GridBagConstraints();
86+ gbc_textField_WebDav_UserId.insets = new Insets(0, 0, 5, 5);
87+ gbc_textField_WebDav_UserId.fill = GridBagConstraints.HORIZONTAL;
88+ gbc_textField_WebDav_UserId.gridx = 3;
89+ gbc_textField_WebDav_UserId.gridy = 2;
90+ add(textField_WebDav_UserId, gbc_textField_WebDav_UserId);
91+ textField_WebDav_UserId.setColumns(10);
92+
93+ lblPassword = new JLabel("Password:");
94+ GridBagConstraints gbc_lblPassword = new GridBagConstraints();
95+ gbc_lblPassword.anchor = GridBagConstraints.EAST;
96+ gbc_lblPassword.insets = new Insets(0, 0, 5, 5);
97+ gbc_lblPassword.gridx = 2;
98+ gbc_lblPassword.gridy = 3;
99+ add(lblPassword, gbc_lblPassword);
100+
101+ passwordField_WebDav_Password = new JPasswordField();
102+ GridBagConstraints gbc_passwordField_WebDav_Password = new GridBagConstraints();
103+ gbc_passwordField_WebDav_Password.insets = new Insets(0, 0, 5, 5);
104+ gbc_passwordField_WebDav_Password.fill = GridBagConstraints.HORIZONTAL;
105+ gbc_passwordField_WebDav_Password.gridx = 3;
106+ gbc_passwordField_WebDav_Password.gridy = 3;
107+ add(passwordField_WebDav_Password, gbc_passwordField_WebDav_Password);
108+ passwordField_WebDav_Password.setColumns(10);
109+
110+ JLabel lblProxy = new JLabel("Proxy");
111+ GridBagConstraints gbc_lblProxy = new GridBagConstraints();
112+ gbc_lblProxy.insets = new Insets(0, 0, 5, 5);
113+ gbc_lblProxy.gridx = 1;
114+ gbc_lblProxy.gridy = 5;
115+ add(lblProxy, gbc_lblProxy);
116+
117+ lblAddress = new JLabel("Address:");
118+ GridBagConstraints gbc_lblAddress = new GridBagConstraints();
119+ gbc_lblAddress.insets = new Insets(0, 0, 5, 5);
120+ gbc_lblAddress.anchor = GridBagConstraints.EAST;
121+ gbc_lblAddress.gridx = 2;
122+ gbc_lblAddress.gridy = 5;
123+ add(lblAddress, gbc_lblAddress);
124+
125+ textField_Proxy_Address = new JTextField();
126+ GridBagConstraints gbc_textField_Proxy_Address = new GridBagConstraints();
127+ gbc_textField_Proxy_Address.insets = new Insets(0, 0, 5, 5);
128+ gbc_textField_Proxy_Address.fill = GridBagConstraints.HORIZONTAL;
129+ gbc_textField_Proxy_Address.gridx = 3;
130+ gbc_textField_Proxy_Address.gridy = 5;
131+ add(textField_Proxy_Address, gbc_textField_Proxy_Address);
132+ textField_Proxy_Address.setColumns(10);
133+
134+ lblPort = new JLabel("Port:");
135+ GridBagConstraints gbc_lblPort = new GridBagConstraints();
136+ gbc_lblPort.anchor = GridBagConstraints.EAST;
137+ gbc_lblPort.insets = new Insets(0, 0, 5, 5);
138+ gbc_lblPort.gridx = 2;
139+ gbc_lblPort.gridy = 6;
140+ add(lblPort, gbc_lblPort);
141+
142+ textField_Proxy_Port = new JTextField();
143+ GridBagConstraints gbc_textField_Proxy_Port = new GridBagConstraints();
144+ gbc_textField_Proxy_Port.insets = new Insets(0, 0, 5, 5);
145+ gbc_textField_Proxy_Port.fill = GridBagConstraints.HORIZONTAL;
146+ gbc_textField_Proxy_Port.gridx = 3;
147+ gbc_textField_Proxy_Port.gridy = 6;
148+ add(textField_Proxy_Port, gbc_textField_Proxy_Port);
149+ textField_Proxy_Port.setColumns(10);
150+
151+ JLabel lblWebBrowser = new JLabel("Web Browser");
152+ GridBagConstraints gbc_lblWebBrowser = new GridBagConstraints();
153+ gbc_lblWebBrowser.insets = new Insets(0, 0, 0, 5);
154+ gbc_lblWebBrowser.gridx = 1;
155+ gbc_lblWebBrowser.gridy = 8;
156+ add(lblWebBrowser, gbc_lblWebBrowser);
157+
158+ textField_WebBrowser = new JTextField();
159+ GridBagConstraints gbc_textField_WebBrowser = new GridBagConstraints();
160+ gbc_textField_WebBrowser.insets = new Insets(0, 0, 0, 5);
161+ gbc_textField_WebBrowser.fill = GridBagConstraints.HORIZONTAL;
162+ gbc_textField_WebBrowser.gridx = 3;
163+ gbc_textField_WebBrowser.gridy = 8;
164+ add(textField_WebBrowser, gbc_textField_WebBrowser);
165+ textField_WebBrowser.setColumns(10);
166+
167+ btnSelect_WebBrowser = new JButton("Select");
168+ btnSelect_WebBrowser.addActionListener(new ActionListener(){
169+ @Override
170+ public void actionPerformed(ActionEvent e) {
171+ JFileChooser chooser = new JFileChooser();
172+ int returnVal = chooser.showOpenDialog(WorkspaceWindow.getInstance());
173+ try {
174+ if (returnVal == JFileChooser.APPROVE_OPTION) {
175+ File file = chooser.getSelectedFile();
176+ textField_WebBrowser.setText(CanonicalPathString.get(file));
177+ }
178+ } catch(Exception ex){}
179+ }
180+ });
181+ GridBagConstraints gbc_btnSelect_WebBrowser = new GridBagConstraints();
182+ gbc_btnSelect_WebBrowser.insets = new Insets(0, 0, 0, 5);
183+ gbc_btnSelect_WebBrowser.gridx = 4;
184+ gbc_btnSelect_WebBrowser.gridy = 8;
185+ add(btnSelect_WebBrowser, gbc_btnSelect_WebBrowser);
186+
187+ // Default Settings
188+ this.textField_WebDav_ServerPath.setText(Preference.getInstance().getWebdavServerPathString());
189+ this.textField_WebDav_UserId.setText(Preference.getInstance().getWebdavUserName());
190+ this.passwordField_WebDav_Password.setText(Preference.getInstance().getWebdavPassword());
191+
192+ this.textField_Proxy_Address.setText(Preference.getInstance().getProxyAddress());
193+ this.textField_Proxy_Port.setText(Preference.getInstance().getProxyPort());
194+
195+ }
196+
197+ public String getWebdavServerPathString() {
198+ return this.textField_WebDav_ServerPath.getText();
199+ }
200+
201+ public String getWebdavUserName() {
202+ return this.textField_WebDav_UserId.getText();
203+ }
204+
205+ public String getWebdavPassword() {
206+ return this.passwordField_WebDav_Password.getPassword().toString();
207+ }
208+
209+ public String getProxyAddress() {
210+ return this.textField_Proxy_Address.getText();
211+ }
212+
213+ public String getProxyPort() {
214+ return this.textField_Proxy_Port.getText();
215+ }
216+
217+ public String getBrowser() {
218+ return this.textField_WebBrowser.getText();
219+ }
220+
221+}
--- branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/PreferenceFrame.java (revision 0)
+++ branches/editor-simplyhtml-merge/src/smart_gs/menu/preference/PreferenceFrame.java (revision 1204)
@@ -0,0 +1,139 @@
1+package smart_gs.menu.preference;
2+
3+import javax.swing.JOptionPane;
4+import javax.swing.JTabbedPane;
5+
6+import smart_gs.GSConstants;
7+import smart_gs.drawing_tool.state.UniSelectedState;
8+import smart_gs.image_search.GSSearchEngine;
9+import smart_gs.logical.Preference;
10+import smart_gs.swingui.ButtonFrame;
11+import smart_gs.swingui.WorkspaceWindow;
12+
13+public class PreferenceFrame extends ButtonFrame {
14+
15+ /**
16+ *
17+ */
18+ private static final long serialVersionUID = 1L;
19+
20+ private static PreferenceFrame singleton = new PreferenceFrame();
21+
22+ private BasicPanel basic;
23+ private FilesPanel files;
24+ private SearchPanel search;
25+ private ImageMarkupPanel imagemarkup;
26+ private TextMarkupPanel textmarkup;
27+ private NetworkPanel network;
28+ private DisplayPanel display;
29+ private XMLPanel xml;
30+
31+
32+ private PreferenceFrame(){
33+ super("Preference");
34+ this.setSize(600, 400);
35+ JTabbedPane tp = new JTabbedPane();
36+ basic = new BasicPanel();
37+ files = new FilesPanel();
38+ search = new SearchPanel();
39+ imagemarkup = new ImageMarkupPanel();
40+ textmarkup = new TextMarkupPanel();
41+ network = new NetworkPanel();
42+ display = new DisplayPanel();
43+ xml = new XMLPanel();
44+
45+ tp.addTab("Basic", basic);
46+ tp.addTab("Files", files);
47+ tp.addTab("Search", search);
48+ tp.addTab("Image Markup", imagemarkup);
49+ tp.addTab("Text Markup", textmarkup);
50+ tp.addTab("Newtork", network);
51+ tp.addTab("Display", display);
52+ tp.addTab("XML", xml);
53+
54+ this.add(tp);
55+
56+
57+ }
58+ public static PreferenceFrame getInstance() {
59+ // TODO Auto-generated method stub
60+ return singleton;
61+ }
62+ @Override
63+ public void ok() {
64+ Preference pref = Preference.getInstance();
65+ GSSearchEngine gsse = GSSearchEngine.getInstance();
66+ WorkspaceWindow window = WorkspaceWindow.getInstance();
67+
68+ pref.setUserName(basic.getUserName());
69+ pref.setFirstIDATName(basic.getFirstIDATName());
70+ pref.setSecondIDATName(basic.getSecondIDATName());
71+ pref.setThirdIDATName(basic.getThirdIDATName());
72+ pref.setBrowser(basic.getEditor());
73+
74+ String message[] = files.checkPath();
75+ String errowMessage = message[0];
76+ String warningMessage = message[1];
77+ if(!errowMessage.isEmpty()){
78+ JOptionPane.showMessageDialog(null, errowMessage + warningMessage, "message", JOptionPane.INFORMATION_MESSAGE);
79+ } else {
80+ pref.setGsFolderPathString(files.getGsFolderPathString());
81+ pref.setImageFolderPathString(files.getImageFolderPathString());
82+ pref.setRWBackgroundFilePathString(files.getRWBackgroundFilePathString());
83+ pref.setWorkspaceDirectory(files.getWorkspaceDirectory());
84+ pref.setDefaultGsFilePath(files.getDefaultGsFilePath());
85+// JOptionPane.showMessageDialog(null,
86+// "Pathes are set.\n" + "Reboot SMAR-GS to validate path settings.\n" + warningMessage, "message",
87+// JOptionPane.INFORMATION_MESSAGE);
88+ }
89+
90+ gsse.setUseExternalEngine(search.getUseExternalEngine());
91+ pref.setSearchImageDictionaryLogic(search.getSearchImageDictionaryLogic());
92+ pref.setDefaultLineDirection(search.getDefaultLineDirection());
93+ pref.setLineSegFileDefaultType(search.getLineSegFileDefaultType());
94+ gsse.setMaxFound(search.getMaxFound());
95+
96+ UniSelectedState.getInstance().setMarkupMovability(imagemarkup.getMarkupMovability());
97+ pref.setMarkupMovability(imagemarkup.getMarkupMovability()+"");
98+ pref.setMemoPadColor(imagemarkup.getMemoPadColor());
99+ pref.setMarkerColor(imagemarkup.getMarkerColor());
100+ pref.setMarkerBreadth(imagemarkup.getMarkerBreadth());
101+ pref.setBookmarkPath(imagemarkup.getBookmarkPath());
102+ pref.setBookmarkSize(imagemarkup.getBookmarkSize());
103+ pref.setResourceBasketSaveOption(imagemarkup.getResourceBasketSaveOption());
104+ pref.setTempRegionOn(imagemarkup.getTempRegionOn());
105+
106+ pref.setWebdavServerPathString(network.getWebdavServerPathString());
107+ pref.setWebdavUserName(network.getWebdavUserName());
108+ pref.setWebdavPassword(network.getWebdavPassword());
109+ pref.setProxyAddress(network.getProxyAddress());
110+ pref.setProxyPort(network.getProxyPort());
111+ pref.setBrowser(network.getBrowser());
112+
113+ int windowmode = display.getWindowMode();
114+ if(windowmode == GSConstants.WINDOW_VERTICAL_IMAGE_TOP_MODE){
115+ Preference.setWindowModeToTop();
116+ window.displayWorksapceWindow(windowmode);
117+ } else if(windowmode == GSConstants.WINDOW_VERTICAL_IMAGE_BOTTOM_MODE){
118+ Preference.setWindowModeToBottom();
119+ window.displayWorksapceWindow(windowmode);
120+ } else if(windowmode == GSConstants.WINDOW_HORIZONTAL_IMAGE_LEFT_MODE){
121+ Preference.setWindowModeToLeft();
122+ window.displayWorksapceWindow(windowmode);
123+ } else if(windowmode == GSConstants.WINDOW_HORIZONTAL_IMAGE_RIGHT_MODE){
124+ Preference.setWindowModeToRight();
125+ window.displayWorksapceWindow(windowmode);
126+ }
127+ pref.setImagePostion(display.getImagePosition());
128+
129+ pref.save();
130+
131+ this.dispose();
132+ }
133+ @Override
134+ public void cancel() {
135+ // TODO Auto-generated method stub
136+ this.dispose();
137+ }
138+
139+}
旧リポジトリブラウザで表示