#25598 C#,Javaの分を実装;Qtの分が未実装
@@ -1,255 +0,0 @@ | ||
1 | -package org.kbinani.cadencii; | |
2 | - | |
3 | -//SECTION-BEGIN-IMPORT | |
4 | -import java.awt.Dimension; | |
5 | -import java.awt.GridBagConstraints; | |
6 | -import java.awt.GridBagLayout; | |
7 | -import java.awt.Insets; | |
8 | -import javax.swing.BorderFactory; | |
9 | -import javax.swing.JPanel; | |
10 | -import javax.swing.JScrollPane; | |
11 | -import javax.swing.ListSelectionModel; | |
12 | -import org.kbinani.windows.forms.BButton; | |
13 | -import org.kbinani.windows.forms.BDialog; | |
14 | -import org.kbinani.windows.forms.BLabel; | |
15 | -import org.kbinani.windows.forms.BListView; | |
16 | -import org.kbinani.windows.forms.BPanel; | |
17 | - | |
18 | -//SECTION-END-IMPORT | |
19 | -public class FormWordDictionary extends BDialog { | |
20 | - //SECTION-BEGIN-FIELD | |
21 | - | |
22 | - private static final long serialVersionUID = 1L; | |
23 | - private JPanel jPanel = null; | |
24 | - private BLabel lblAvailableDictionaries = null; | |
25 | - private BPanel jPanel2 = null; | |
26 | - private BButton btnOK = null; | |
27 | - private BButton btnCancel = null; | |
28 | - private BPanel jPanel21 = null; | |
29 | - private BButton btnUp = null; | |
30 | - private BButton btnDown = null; | |
31 | - private BListView listDictionaries = null; | |
32 | - private JScrollPane jScrollPane = null; | |
33 | - private BLabel lblSpacer = null; | |
34 | - private BLabel lblSpacer1 = null; | |
35 | - | |
36 | - //SECTION-END-FIELD | |
37 | - /** | |
38 | - * This method initializes | |
39 | - * | |
40 | - */ | |
41 | - public FormWordDictionary() { | |
42 | - super(); | |
43 | - initialize(); | |
44 | - } | |
45 | - //SECTION-BEGIN-METHOD | |
46 | - | |
47 | - /** | |
48 | - * This method initializes this | |
49 | - * | |
50 | - */ | |
51 | - private void initialize() { | |
52 | - this.setSize(new Dimension(327, 404)); | |
53 | - this.setTitle("User Dictionary Configuration"); | |
54 | - this.setContentPane(getJPanel()); | |
55 | - setCancelButton( btnCancel ); | |
56 | - } | |
57 | - | |
58 | - /** | |
59 | - * This method initializes jPanel | |
60 | - * | |
61 | - * @return javax.swing.JPanel | |
62 | - */ | |
63 | - private JPanel getJPanel() { | |
64 | - if (jPanel == null) { | |
65 | - GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); | |
66 | - gridBagConstraints2.fill = GridBagConstraints.BOTH; | |
67 | - gridBagConstraints2.gridy = 1; | |
68 | - gridBagConstraints2.weightx = 1.0; | |
69 | - gridBagConstraints2.weighty = 1.0; | |
70 | - gridBagConstraints2.insets = new Insets(6, 12, 6, 12); | |
71 | - gridBagConstraints2.gridx = 0; | |
72 | - GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); | |
73 | - gridBagConstraints4.gridx = 0; | |
74 | - gridBagConstraints4.anchor = GridBagConstraints.EAST; | |
75 | - gridBagConstraints4.insets = new Insets(6, 0, 12, 12); | |
76 | - gridBagConstraints4.fill = GridBagConstraints.HORIZONTAL; | |
77 | - gridBagConstraints4.gridy = 3; | |
78 | - GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); | |
79 | - gridBagConstraints3.gridx = 0; | |
80 | - gridBagConstraints3.anchor = GridBagConstraints.EAST; | |
81 | - gridBagConstraints3.insets = new Insets(6, 0, 6, 12); | |
82 | - gridBagConstraints3.fill = GridBagConstraints.HORIZONTAL; | |
83 | - gridBagConstraints3.gridy = 2; | |
84 | - GridBagConstraints gridBagConstraints = new GridBagConstraints(); | |
85 | - gridBagConstraints.gridx = 0; | |
86 | - gridBagConstraints.anchor = GridBagConstraints.WEST; | |
87 | - gridBagConstraints.insets = new Insets(12, 12, 6, 0); | |
88 | - gridBagConstraints.gridy = 0; | |
89 | - lblAvailableDictionaries = new BLabel(); | |
90 | - lblAvailableDictionaries.setText("Available Dictionaries"); | |
91 | - jPanel = new JPanel(); | |
92 | - jPanel.setLayout(new GridBagLayout()); | |
93 | - jPanel.add(lblAvailableDictionaries, gridBagConstraints); | |
94 | - jPanel.add(getJPanel21(), gridBagConstraints3); | |
95 | - jPanel.add(getJPanel2(), gridBagConstraints4); | |
96 | - jPanel.add(getJScrollPane(), gridBagConstraints2); | |
97 | - } | |
98 | - return jPanel; | |
99 | - } | |
100 | - | |
101 | - /** | |
102 | - * This method initializes jPanel2 | |
103 | - * | |
104 | - * @return org.kbinani.windows.forms.BPanel | |
105 | - */ | |
106 | - private BPanel getJPanel2() { | |
107 | - if (jPanel2 == null) { | |
108 | - GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); | |
109 | - gridBagConstraints5.gridx = 0; | |
110 | - gridBagConstraints5.weightx = 1.0D; | |
111 | - gridBagConstraints5.gridy = 0; | |
112 | - lblSpacer1 = new BLabel(); | |
113 | - lblSpacer1.setPreferredSize(new Dimension(4, 4)); | |
114 | - lblSpacer1.setText(""); | |
115 | - GridBagConstraints gridBagConstraints52 = new GridBagConstraints(); | |
116 | - gridBagConstraints52.anchor = GridBagConstraints.SOUTHWEST; | |
117 | - gridBagConstraints52.gridx = 1; | |
118 | - gridBagConstraints52.gridy = 0; | |
119 | - gridBagConstraints52.insets = new Insets(0, 0, 0, 0); | |
120 | - GridBagConstraints gridBagConstraints42 = new GridBagConstraints(); | |
121 | - gridBagConstraints42.anchor = GridBagConstraints.WEST; | |
122 | - gridBagConstraints42.gridx = 2; | |
123 | - gridBagConstraints42.gridy = 0; | |
124 | - gridBagConstraints42.insets = new Insets(0, 0, 0, 0); | |
125 | - jPanel2 = new BPanel(); | |
126 | - jPanel2.setLayout(new GridBagLayout()); | |
127 | - jPanel2.add(getBtnOK(), gridBagConstraints42); | |
128 | - jPanel2.add(getBtnCancel(), gridBagConstraints52); | |
129 | - jPanel2.add(lblSpacer1, gridBagConstraints5); | |
130 | - } | |
131 | - return jPanel2; | |
132 | - } | |
133 | - | |
134 | - /** | |
135 | - * This method initializes btnOK | |
136 | - * | |
137 | - * @return org.kbinani.windows.forms.BButton | |
138 | - */ | |
139 | - private BButton getBtnOK() { | |
140 | - if (btnOK == null) { | |
141 | - btnOK = new BButton(); | |
142 | - btnOK.setText("OK"); | |
143 | - btnOK.setPreferredSize(new Dimension(100, 29)); | |
144 | - } | |
145 | - return btnOK; | |
146 | - } | |
147 | - | |
148 | - /** | |
149 | - * This method initializes btnCancel | |
150 | - * | |
151 | - * @return org.kbinani.windows.forms.BButton | |
152 | - */ | |
153 | - private BButton getBtnCancel() { | |
154 | - if (btnCancel == null) { | |
155 | - btnCancel = new BButton(); | |
156 | - btnCancel.setText("Cancel"); | |
157 | - btnCancel.setPreferredSize(new Dimension(100, 29)); | |
158 | - } | |
159 | - return btnCancel; | |
160 | - } | |
161 | - | |
162 | - /** | |
163 | - * This method initializes jPanel21 | |
164 | - * | |
165 | - * @return org.kbinani.windows.forms.BPanel | |
166 | - */ | |
167 | - private BPanel getJPanel21() { | |
168 | - if (jPanel21 == null) { | |
169 | - GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); | |
170 | - gridBagConstraints1.gridx = 0; | |
171 | - gridBagConstraints1.weightx = 1.0D; | |
172 | - gridBagConstraints1.gridy = 0; | |
173 | - lblSpacer = new BLabel(); | |
174 | - lblSpacer.setPreferredSize(new Dimension(4, 4)); | |
175 | - lblSpacer.setText(""); | |
176 | - GridBagConstraints gridBagConstraints521 = new GridBagConstraints(); | |
177 | - gridBagConstraints521.anchor = GridBagConstraints.SOUTHWEST; | |
178 | - gridBagConstraints521.gridx = 2; | |
179 | - gridBagConstraints521.gridy = 0; | |
180 | - gridBagConstraints521.insets = new Insets(0, 0, 0, 0); | |
181 | - GridBagConstraints gridBagConstraints421 = new GridBagConstraints(); | |
182 | - gridBagConstraints421.anchor = GridBagConstraints.WEST; | |
183 | - gridBagConstraints421.gridx = 1; | |
184 | - gridBagConstraints421.gridy = 0; | |
185 | - gridBagConstraints421.insets = new Insets(0, 0, 0, 16); | |
186 | - jPanel21 = new BPanel(); | |
187 | - jPanel21.setLayout(new GridBagLayout()); | |
188 | - jPanel21.add(getBtnUp(), gridBagConstraints421); | |
189 | - jPanel21.add(getBtnDown(), gridBagConstraints521); | |
190 | - jPanel21.add(lblSpacer, gridBagConstraints1); | |
191 | - } | |
192 | - return jPanel21; | |
193 | - } | |
194 | - | |
195 | - /** | |
196 | - * This method initializes btnUp | |
197 | - * | |
198 | - * @return org.kbinani.windows.forms.BButton | |
199 | - */ | |
200 | - private BButton getBtnUp() { | |
201 | - if (btnUp == null) { | |
202 | - btnUp = new BButton(); | |
203 | - btnUp.setText("Up"); | |
204 | - btnUp.setPreferredSize(new Dimension(75, 29)); | |
205 | - } | |
206 | - return btnUp; | |
207 | - } | |
208 | - | |
209 | - /** | |
210 | - * This method initializes btnDown | |
211 | - * | |
212 | - * @return org.kbinani.windows.forms.BButton | |
213 | - */ | |
214 | - private BButton getBtnDown() { | |
215 | - if (btnDown == null) { | |
216 | - btnDown = new BButton(); | |
217 | - btnDown.setText("Down"); | |
218 | - btnDown.setPreferredSize(new Dimension(75, 29)); | |
219 | - } | |
220 | - return btnDown; | |
221 | - } | |
222 | - | |
223 | - /** | |
224 | - * This method initializes listDictionaries | |
225 | - * | |
226 | - * @return javax.swing.JPanel | |
227 | - */ | |
228 | - private BListView getListDictionaries() { | |
229 | - if (listDictionaries == null) { | |
230 | - listDictionaries = new BListView(); | |
231 | - listDictionaries.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); | |
232 | - listDictionaries.setRowSelectionAllowed(true); | |
233 | - } | |
234 | - return listDictionaries; | |
235 | - } | |
236 | - | |
237 | - /** | |
238 | - * This method initializes jScrollPane | |
239 | - * | |
240 | - * @return javax.swing.JScrollPane | |
241 | - */ | |
242 | - private JScrollPane getJScrollPane() { | |
243 | - if (jScrollPane == null) { | |
244 | - jScrollPane = new JScrollPane(); | |
245 | - jScrollPane.setPreferredSize(new Dimension(100, 100)); | |
246 | - jScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); | |
247 | - jScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); | |
248 | - jScrollPane.setViewportBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); | |
249 | - jScrollPane.setViewportView(getListDictionaries()); | |
250 | - } | |
251 | - return jScrollPane; | |
252 | - } | |
253 | - | |
254 | - //SECTION-END-METHOD | |
255 | -} // @jve:decl-index=0:visual-constraint="10,10" |
@@ -0,0 +1,414 @@ | ||
1 | +package org.kbinani.cadencii; | |
2 | + | |
3 | +import java.awt.Dimension; | |
4 | +import java.awt.GridBagConstraints; | |
5 | +import java.awt.GridBagLayout; | |
6 | +import java.awt.Insets; | |
7 | +import javax.swing.BorderFactory; | |
8 | +import javax.swing.JPanel; | |
9 | +import javax.swing.JScrollPane; | |
10 | +import javax.swing.ListSelectionModel; | |
11 | +import org.kbinani.windows.forms.BButton; | |
12 | +import org.kbinani.windows.forms.BDialog; | |
13 | +import org.kbinani.windows.forms.BDialogResult; | |
14 | +import org.kbinani.windows.forms.BLabel; | |
15 | +import org.kbinani.windows.forms.BListView; | |
16 | +import org.kbinani.windows.forms.BPanel; | |
17 | + | |
18 | +public class FormWordDictionaryUiImpl extends BDialog implements FormWordDictionaryUi | |
19 | +{ | |
20 | + private static final long serialVersionUID = 1L; | |
21 | + private JPanel jPanel = null; | |
22 | + private BLabel lblAvailableDictionaries = null; | |
23 | + private BPanel jPanel2 = null; | |
24 | + private BButton btnOK = null; | |
25 | + private BButton btnCancel = null; | |
26 | + private BPanel jPanel21 = null; | |
27 | + private BButton btnUp = null; | |
28 | + private BButton btnDown = null; | |
29 | + private BListView listDictionaries = null; | |
30 | + private JScrollPane jScrollPane = null; | |
31 | + private BLabel lblSpacer = null; | |
32 | + private BLabel lblSpacer1 = null; | |
33 | + | |
34 | + /** | |
35 | + * This method initializes | |
36 | + * | |
37 | + */ | |
38 | + public FormWordDictionaryUiImpl() | |
39 | + { | |
40 | + super(); | |
41 | + initialize(); | |
42 | + } | |
43 | + | |
44 | + /** | |
45 | + * This method initializes this | |
46 | + * | |
47 | + */ | |
48 | + private void initialize() | |
49 | + { | |
50 | + this.setSize( new Dimension( 327, 404 ) ); | |
51 | + this.setTitle( "User Dictionary Configuration" ); | |
52 | + this.setContentPane( getJPanel() ); | |
53 | + setCancelButton( btnCancel ); | |
54 | + } | |
55 | + | |
56 | + /** | |
57 | + * This method initializes jPanel | |
58 | + * | |
59 | + * @return javax.swing.JPanel | |
60 | + */ | |
61 | + private JPanel getJPanel() | |
62 | + { | |
63 | + if( jPanel == null ){ | |
64 | + GridBagConstraints gridBagConstraints2 = new GridBagConstraints(); | |
65 | + gridBagConstraints2.fill = GridBagConstraints.BOTH; | |
66 | + gridBagConstraints2.gridy = 1; | |
67 | + gridBagConstraints2.weightx = 1.0; | |
68 | + gridBagConstraints2.weighty = 1.0; | |
69 | + gridBagConstraints2.insets = new Insets( 6, 12, 6, 12 ); | |
70 | + gridBagConstraints2.gridx = 0; | |
71 | + GridBagConstraints gridBagConstraints4 = new GridBagConstraints(); | |
72 | + gridBagConstraints4.gridx = 0; | |
73 | + gridBagConstraints4.anchor = GridBagConstraints.EAST; | |
74 | + gridBagConstraints4.insets = new Insets( 6, 0, 12, 12 ); | |
75 | + gridBagConstraints4.fill = GridBagConstraints.HORIZONTAL; | |
76 | + gridBagConstraints4.gridy = 3; | |
77 | + GridBagConstraints gridBagConstraints3 = new GridBagConstraints(); | |
78 | + gridBagConstraints3.gridx = 0; | |
79 | + gridBagConstraints3.anchor = GridBagConstraints.EAST; | |
80 | + gridBagConstraints3.insets = new Insets( 6, 0, 6, 12 ); | |
81 | + gridBagConstraints3.fill = GridBagConstraints.HORIZONTAL; | |
82 | + gridBagConstraints3.gridy = 2; | |
83 | + GridBagConstraints gridBagConstraints = new GridBagConstraints(); | |
84 | + gridBagConstraints.gridx = 0; | |
85 | + gridBagConstraints.anchor = GridBagConstraints.WEST; | |
86 | + gridBagConstraints.insets = new Insets( 12, 12, 6, 0 ); | |
87 | + gridBagConstraints.gridy = 0; | |
88 | + lblAvailableDictionaries = new BLabel(); | |
89 | + lblAvailableDictionaries.setText( "Available Dictionaries" ); | |
90 | + jPanel = new JPanel(); | |
91 | + jPanel.setLayout( new GridBagLayout() ); | |
92 | + jPanel.add( lblAvailableDictionaries, gridBagConstraints ); | |
93 | + jPanel.add( getJPanel21(), gridBagConstraints3 ); | |
94 | + jPanel.add( getJPanel2(), gridBagConstraints4 ); | |
95 | + jPanel.add( getJScrollPane(), gridBagConstraints2 ); | |
96 | + } | |
97 | + return jPanel; | |
98 | + } | |
99 | + | |
100 | + /** | |
101 | + * This method initializes jPanel2 | |
102 | + * | |
103 | + * @return org.kbinani.windows.forms.BPanel | |
104 | + */ | |
105 | + private BPanel getJPanel2() | |
106 | + { | |
107 | + if( jPanel2 == null ){ | |
108 | + GridBagConstraints gridBagConstraints5 = new GridBagConstraints(); | |
109 | + gridBagConstraints5.gridx = 0; | |
110 | + gridBagConstraints5.weightx = 1.0D; | |
111 | + gridBagConstraints5.gridy = 0; | |
112 | + lblSpacer1 = new BLabel(); | |
113 | + lblSpacer1.setPreferredSize( new Dimension( 4, 4 ) ); | |
114 | + lblSpacer1.setText( "" ); | |
115 | + GridBagConstraints gridBagConstraints52 = new GridBagConstraints(); | |
116 | + gridBagConstraints52.anchor = GridBagConstraints.SOUTHWEST; | |
117 | + gridBagConstraints52.gridx = 1; | |
118 | + gridBagConstraints52.gridy = 0; | |
119 | + gridBagConstraints52.insets = new Insets( 0, 0, 0, 0 ); | |
120 | + GridBagConstraints gridBagConstraints42 = new GridBagConstraints(); | |
121 | + gridBagConstraints42.anchor = GridBagConstraints.WEST; | |
122 | + gridBagConstraints42.gridx = 2; | |
123 | + gridBagConstraints42.gridy = 0; | |
124 | + gridBagConstraints42.insets = new Insets( 0, 0, 0, 0 ); | |
125 | + jPanel2 = new BPanel(); | |
126 | + jPanel2.setLayout( new GridBagLayout() ); | |
127 | + jPanel2.add( getBtnOK(), gridBagConstraints42 ); | |
128 | + jPanel2.add( getBtnCancel(), gridBagConstraints52 ); | |
129 | + jPanel2.add( lblSpacer1, gridBagConstraints5 ); | |
130 | + } | |
131 | + return jPanel2; | |
132 | + } | |
133 | + | |
134 | + /** | |
135 | + * This method initializes btnOK | |
136 | + * | |
137 | + * @return org.kbinani.windows.forms.BButton | |
138 | + */ | |
139 | + private BButton getBtnOK() | |
140 | + { | |
141 | + if( btnOK == null ){ | |
142 | + btnOK = new BButton(); | |
143 | + btnOK.setText( "OK" ); | |
144 | + btnOK.setPreferredSize( new Dimension( 100, 29 ) ); | |
145 | + } | |
146 | + return btnOK; | |
147 | + } | |
148 | + | |
149 | + /** | |
150 | + * This method initializes btnCancel | |
151 | + * | |
152 | + * @return org.kbinani.windows.forms.BButton | |
153 | + */ | |
154 | + private BButton getBtnCancel() | |
155 | + { | |
156 | + if( btnCancel == null ){ | |
157 | + btnCancel = new BButton(); | |
158 | + btnCancel.setText( "Cancel" ); | |
159 | + btnCancel.setPreferredSize( new Dimension( 100, 29 ) ); | |
160 | + } | |
161 | + return btnCancel; | |
162 | + } | |
163 | + | |
164 | + /** | |
165 | + * This method initializes jPanel21 | |
166 | + * | |
167 | + * @return org.kbinani.windows.forms.BPanel | |
168 | + */ | |
169 | + private BPanel getJPanel21() | |
170 | + { | |
171 | + if( jPanel21 == null ){ | |
172 | + GridBagConstraints gridBagConstraints1 = new GridBagConstraints(); | |
173 | + gridBagConstraints1.gridx = 0; | |
174 | + gridBagConstraints1.weightx = 1.0D; | |
175 | + gridBagConstraints1.gridy = 0; | |
176 | + lblSpacer = new BLabel(); | |
177 | + lblSpacer.setPreferredSize( new Dimension( 4, 4 ) ); | |
178 | + lblSpacer.setText( "" ); | |
179 | + GridBagConstraints gridBagConstraints521 = new GridBagConstraints(); | |
180 | + gridBagConstraints521.anchor = GridBagConstraints.SOUTHWEST; | |
181 | + gridBagConstraints521.gridx = 2; | |
182 | + gridBagConstraints521.gridy = 0; | |
183 | + gridBagConstraints521.insets = new Insets( 0, 0, 0, 0 ); | |
184 | + GridBagConstraints gridBagConstraints421 = new GridBagConstraints(); | |
185 | + gridBagConstraints421.anchor = GridBagConstraints.WEST; | |
186 | + gridBagConstraints421.gridx = 1; | |
187 | + gridBagConstraints421.gridy = 0; | |
188 | + gridBagConstraints421.insets = new Insets( 0, 0, 0, 16 ); | |
189 | + jPanel21 = new BPanel(); | |
190 | + jPanel21.setLayout( new GridBagLayout() ); | |
191 | + jPanel21.add( getBtnUp(), gridBagConstraints421 ); | |
192 | + jPanel21.add( getBtnDown(), gridBagConstraints521 ); | |
193 | + jPanel21.add( lblSpacer, gridBagConstraints1 ); | |
194 | + } | |
195 | + return jPanel21; | |
196 | + } | |
197 | + | |
198 | + /** | |
199 | + * This method initializes btnUp | |
200 | + * | |
201 | + * @return org.kbinani.windows.forms.BButton | |
202 | + */ | |
203 | + private BButton getBtnUp() | |
204 | + { | |
205 | + if( btnUp == null ){ | |
206 | + btnUp = new BButton(); | |
207 | + btnUp.setText( "Up" ); | |
208 | + btnUp.setPreferredSize( new Dimension( 75, 29 ) ); | |
209 | + } | |
210 | + return btnUp; | |
211 | + } | |
212 | + | |
213 | + /** | |
214 | + * This method initializes btnDown | |
215 | + * | |
216 | + * @return org.kbinani.windows.forms.BButton | |
217 | + */ | |
218 | + private BButton getBtnDown() | |
219 | + { | |
220 | + if( btnDown == null ){ | |
221 | + btnDown = new BButton(); | |
222 | + btnDown.setText( "Down" ); | |
223 | + btnDown.setPreferredSize( new Dimension( 75, 29 ) ); | |
224 | + } | |
225 | + return btnDown; | |
226 | + } | |
227 | + | |
228 | + /** | |
229 | + * This method initializes listDictionaries | |
230 | + * | |
231 | + * @return javax.swing.JPanel | |
232 | + */ | |
233 | + private BListView getListDictionaries() | |
234 | + { | |
235 | + if( listDictionaries == null ){ | |
236 | + listDictionaries = new BListView(); | |
237 | + listDictionaries.setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); | |
238 | + listDictionaries.setRowSelectionAllowed( true ); | |
239 | + } | |
240 | + return listDictionaries; | |
241 | + } | |
242 | + | |
243 | + /** | |
244 | + * This method initializes jScrollPane | |
245 | + * | |
246 | + * @return javax.swing.JScrollPane | |
247 | + */ | |
248 | + private JScrollPane getJScrollPane() | |
249 | + { | |
250 | + if( jScrollPane == null ){ | |
251 | + jScrollPane = new JScrollPane(); | |
252 | + jScrollPane.setPreferredSize( new Dimension( 100, 100 ) ); | |
253 | + jScrollPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS ); | |
254 | + jScrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS ); | |
255 | + jScrollPane.setViewportBorder( BorderFactory.createEmptyBorder( 0, 0, 0, 0 ) ); | |
256 | + jScrollPane.setViewportView( getListDictionaries() ); | |
257 | + } | |
258 | + return jScrollPane; | |
259 | + } | |
260 | + | |
261 | + @Override | |
262 | + public int showDialog( | |
263 | + Object parent_form ) | |
264 | + { | |
265 | + BDialogResult ret = BDialogResult.CANCEL; | |
266 | + if( parent_form == null || (parent_form != null && !(parent_form instanceof BDialog)) ){ | |
267 | + ret = super.showDialog( null ); | |
268 | + }else{ | |
269 | + BDialog form = (BDialog)parent_form; | |
270 | + ret = super.showDialog( form ); | |
271 | + } | |
272 | + if( ret == BDialogResult.OK || ret == BDialogResult.YES ){ | |
273 | + return 1; | |
274 | + }else{ | |
275 | + return 0; | |
276 | + } | |
277 | + } | |
278 | + | |
279 | + @Override | |
280 | + public void setDialogResult( | |
281 | + boolean value ) | |
282 | + { | |
283 | + super.setDialogResult( value ? BDialogResult.OK : BDialogResult.CANCEL ); | |
284 | + } | |
285 | + | |
286 | + @Override | |
287 | + public void listDictionariesSetColumnWidth( | |
288 | + int columnIndex, | |
289 | + int columnWidth ) | |
290 | + { | |
291 | + this.listDictionaries.setColumnWidth( columnIndex, columnWidth ); | |
292 | + } | |
293 | + | |
294 | + @Override | |
295 | + public int listDictionariesGetSelectedRow() | |
296 | + { | |
297 | + return this.listDictionaries.getSelectedRow(); | |
298 | + } | |
299 | + | |
300 | + @Override | |
301 | + public int listDictionariesGetItemCountRow() | |
302 | + { | |
303 | + return this.listDictionaries.getItemCountRow(); | |
304 | + } | |
305 | + | |
306 | + @Override | |
307 | + public void listDictionariesClear() | |
308 | + { | |
309 | + this.listDictionaries.clear(); | |
310 | + } | |
311 | + | |
312 | + @Override | |
313 | + public String listDictionariesGetItemAt( | |
314 | + int row, | |
315 | + int column ) | |
316 | + { | |
317 | + return this.listDictionaries.getItemAt( row, column ); | |
318 | + } | |
319 | + | |
320 | + @Override | |
321 | + public boolean listDictionariesIsRowChecked( | |
322 | + int row ) | |
323 | + { | |
324 | + return this.listDictionaries.isRowChecked( row ); | |
325 | + } | |
326 | + | |
327 | + @Override | |
328 | + public void listDictionariesSetItemAt( | |
329 | + int row, | |
330 | + int column, | |
331 | + String value ) | |
332 | + { | |
333 | + this.listDictionaries.setItemAt( row, column, value ); | |
334 | + } | |
335 | + | |
336 | + @Override | |
337 | + public void listDictionariesSetRowChecked( | |
338 | + int row, | |
339 | + boolean value ) | |
340 | + { | |
341 | + this.listDictionaries.setRowChecked( row, value ); | |
342 | + } | |
343 | + | |
344 | + @Override | |
345 | + public void listDictionariesSetSelectedRow( | |
346 | + int row ) | |
347 | + { | |
348 | + this.listDictionaries.setSelectedRow( row ); | |
349 | + } | |
350 | + | |
351 | + @Override | |
352 | + public void listDictionariesClearSelection() | |
353 | + { | |
354 | + this.listDictionaries.clearSelection(); | |
355 | + } | |
356 | + | |
357 | + @Override | |
358 | + public void listDictionariesAddRow( | |
359 | + String[] values, | |
360 | + boolean selected ) | |
361 | + { | |
362 | + this.listDictionaries.addRow( values, selected ); | |
363 | + } | |
364 | + | |
365 | + @Override | |
366 | + public int listDictionariesGetColumnWidth( | |
367 | + int column ) | |
368 | + { | |
369 | + return this.listDictionaries.getColumnWidth( column ); | |
370 | + } | |
371 | + | |
372 | + @Override | |
373 | + public void listDictionariesSetColumnHeaders( | |
374 | + String[] headers ) | |
375 | + { | |
376 | + this.listDictionaries.setColumnHeaders( headers ); | |
377 | + } | |
378 | + | |
379 | + @Override | |
380 | + public void labelAvailableDictionariesSetText( | |
381 | + String value ) | |
382 | + { | |
383 | + this.lblAvailableDictionaries.setText( value ); | |
384 | + } | |
385 | + | |
386 | + @Override | |
387 | + public void buttonOkSetText( | |
388 | + String value ) | |
389 | + { | |
390 | + this.btnOK.setText( value ); | |
391 | + } | |
392 | + | |
393 | + @Override | |
394 | + public void buttonCancelSetText( | |
395 | + String value ) | |
396 | + { | |
397 | + this.btnCancel.setText( value ); | |
398 | + } | |
399 | + | |
400 | + @Override | |
401 | + public void buttonUpSetText( | |
402 | + String value ) | |
403 | + { | |
404 | + this.btnUp.setText( value ); | |
405 | + } | |
406 | + | |
407 | + @Override | |
408 | + public void buttonDownSetText( | |
409 | + String value ) | |
410 | + { | |
411 | + this.btnDown.setText( value ); | |
412 | + } | |
413 | + | |
414 | +} |
@@ -1,359 +0,0 @@ | ||
1 | -/* | |
2 | - * FormWordDictionary.cs | |
3 | - * Copyright © 2008-2011 kbinani | |
4 | - * | |
5 | - * This file is part of org.kbinani.cadencii. | |
6 | - * | |
7 | - * org.kbinani.cadencii is free software; you can redistribute it and/or | |
8 | - * modify it under the terms of the GPLv3 License. | |
9 | - * | |
10 | - * org.kbinani.cadencii is distributed in the hope that it will be useful, | |
11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
13 | - */ | |
14 | -#if JAVA | |
15 | -package org.kbinani.cadencii; | |
16 | - | |
17 | -//INCLUDE-SECTION IMPORT ../BuildJavaUI/src/org/kbinani/cadencii/FormWordDictionary.java | |
18 | - | |
19 | -import java.util.*; | |
20 | -import org.kbinani.*; | |
21 | -import org.kbinani.apputil.*; | |
22 | -import org.kbinani.vsq.*; | |
23 | -import org.kbinani.windows.forms.*; | |
24 | -#else | |
25 | -using System; | |
26 | -using org.kbinani.apputil; | |
27 | -using org.kbinani.vsq; | |
28 | -using org.kbinani; | |
29 | -using org.kbinani.java.util; | |
30 | -using org.kbinani.windows.forms; | |
31 | - | |
32 | -namespace org.kbinani.cadencii | |
33 | -{ | |
34 | - using BEventArgs = System.EventArgs; | |
35 | - using boolean = System.Boolean; | |
36 | - using BEventHandler = System.EventHandler; | |
37 | - using BFormClosingEventHandler = System.Windows.Forms.FormClosingEventHandler; | |
38 | - using BFormClosingEventArgs = System.Windows.Forms.FormClosingEventArgs; | |
39 | -#endif | |
40 | - | |
41 | -#if JAVA | |
42 | - public class FormWordDictionary extends BDialog { | |
43 | -#else | |
44 | - class FormWordDictionary : BDialog | |
45 | - { | |
46 | -#endif | |
47 | - private static int mColumnWidth = 256; | |
48 | - private static int mWidth = 327; | |
49 | - private static int mHeight = 404; | |
50 | - | |
51 | - public FormWordDictionary() | |
52 | - { | |
53 | -#if JAVA | |
54 | - super(); | |
55 | - initialize(); | |
56 | -#else | |
57 | - InitializeComponent(); | |
58 | -#endif | |
59 | - registerEventHandlers(); | |
60 | - setResources(); | |
61 | - applyLanguage(); | |
62 | - Util.applyFontRecurse( this, AppManager.editorConfig.getBaseFont() ); | |
63 | - this.setSize( mWidth, mHeight ); | |
64 | - listDictionaries.setColumnWidth( 0, mColumnWidth ); | |
65 | - } | |
66 | - | |
67 | - #region public methods | |
68 | - public void applyLanguage() | |
69 | - { | |
70 | - setTitle( _( "User Dictionary Configuration" ) ); | |
71 | - lblAvailableDictionaries.setText( _( "Available Dictionaries" ) ); | |
72 | - btnOK.setText( _( "OK" ) ); | |
73 | - btnCancel.setText( _( "Cancel" ) ); | |
74 | - btnUp.setText( _( "Up" ) ); | |
75 | - btnDown.setText( _( "Down" ) ); | |
76 | - listDictionaries.setColumnHeaders( new String[]{ _( "Name of dictionary" ) } ); | |
77 | - } | |
78 | - | |
79 | - public Vector<ValuePair<String, Boolean>> getResult() | |
80 | - { | |
81 | - Vector<ValuePair<String, Boolean>> ret = new Vector<ValuePair<String, Boolean>>(); | |
82 | - int count = listDictionaries.getItemCountRow(); | |
83 | -#if DEBUG | |
84 | - sout.println( "FormWordDictionary#getResult; count=" + count ); | |
85 | -#endif | |
86 | - for ( int i = 0; i < count; i++ ) { | |
87 | - String name = listDictionaries.getItemAt( i, 0 ); | |
88 | - | |
89 | - ret.add( new ValuePair<String, Boolean>( | |
90 | - listDictionaries.getItemAt( i, 0 ), listDictionaries.isRowChecked( i ) ) ); | |
91 | - } | |
92 | - return ret; | |
93 | - } | |
94 | - #endregion | |
95 | - | |
96 | - #region helper methods | |
97 | - private static String _( String id ) | |
98 | - { | |
99 | - return Messaging.getMessage( id ); | |
100 | - } | |
101 | - | |
102 | - private void registerEventHandlers() | |
103 | - { | |
104 | - this.Load += new BEventHandler( FormWordDictionary_Load ); | |
105 | - this.FormClosing += new BFormClosingEventHandler( FormWordDictionary_FormClosing ); | |
106 | - btnOK.Click += new BEventHandler( btnOK_Click ); | |
107 | - btnUp.Click += new BEventHandler( btnUp_Click ); | |
108 | - btnDown.Click += new BEventHandler( btnDown_Click ); | |
109 | - btnCancel.Click += new BEventHandler( btnCancel_Click ); | |
110 | - } | |
111 | - | |
112 | - private void setResources() | |
113 | - { | |
114 | - } | |
115 | - #endregion | |
116 | - | |
117 | - #region event handlers | |
118 | - public void FormWordDictionary_FormClosing( Object sender, BFormClosingEventArgs e ) | |
119 | - { | |
120 | - mColumnWidth = listDictionaries.getColumnWidth( 0 ); | |
121 | - mWidth = getWidth(); | |
122 | - mHeight = getHeight(); | |
123 | - } | |
124 | - | |
125 | - public void FormWordDictionary_Load( Object sender, BEventArgs e ) | |
126 | - { | |
127 | - listDictionaries.clear(); | |
128 | - for ( int i = 0; i < SymbolTable.getCount(); i++ ) { | |
129 | - String name = SymbolTable.getSymbolTable( i ).getName(); | |
130 | - boolean enabled = SymbolTable.getSymbolTable( i ).isEnabled(); | |
131 | - listDictionaries.addRow( new String[]{ name }, enabled ); | |
132 | - } | |
133 | - } | |
134 | - | |
135 | - public void btnOK_Click( Object sender, BEventArgs e ) | |
136 | - { | |
137 | - setDialogResult( BDialogResult.OK ); | |
138 | - } | |
139 | - | |
140 | - public void btnUp_Click( Object sender, BEventArgs e ) | |
141 | - { | |
142 | - int index = listDictionaries.getSelectedRow(); | |
143 | - if ( index >= 1 ) { | |
144 | - try { | |
145 | - listDictionaries.clearSelection(); | |
146 | - String upper_name = listDictionaries.getItemAt( index - 1, 0 ); | |
147 | - boolean upper_enabled = listDictionaries.isRowChecked( index - 1 ); | |
148 | - String lower_name = listDictionaries.getItemAt( index, 0 ); | |
149 | - boolean lower_enabled = listDictionaries.isRowChecked( index ); | |
150 | - | |
151 | - listDictionaries.setItemAt( index - 1, 0, lower_name ); | |
152 | - listDictionaries.setRowChecked( index - 1, lower_enabled ); | |
153 | - listDictionaries.setItemAt( index, 0, upper_name ); | |
154 | - listDictionaries.setRowChecked( index, upper_enabled ); | |
155 | - | |
156 | - listDictionaries.setSelectedRow( index - 1 ); | |
157 | - } catch ( Exception ex ) { | |
158 | - serr.println( "FormWordDictionary#btnUp_Click; ex=" + ex ); | |
159 | - } | |
160 | - } | |
161 | - } | |
162 | - | |
163 | - public void btnDown_Click( Object sender, BEventArgs e ) | |
164 | - { | |
165 | - int index = listDictionaries.getSelectedRow(); | |
166 | - if ( 0 <= index && index + 1 < listDictionaries.getItemCountRow() ) { | |
167 | - try { | |
168 | - listDictionaries.clearSelection(); | |
169 | - String upper_name = listDictionaries.getItemAt( index, 0 ); | |
170 | - boolean upper_enabled = listDictionaries.isRowChecked( index ); | |
171 | - String lower_name = listDictionaries.getItemAt( index + 1, 0 ); | |
172 | - boolean lower_enabled = listDictionaries.isRowChecked( index + 1 ); | |
173 | - | |
174 | - listDictionaries.setItemAt( index + 1, 0, upper_name ); | |
175 | - listDictionaries.setRowChecked( index + 1, upper_enabled ); | |
176 | - listDictionaries.setItemAt( index, 0, lower_name ); | |
177 | - listDictionaries.setRowChecked( index, lower_enabled ); | |
178 | - | |
179 | - listDictionaries.setSelectedRow( index + 1 ); | |
180 | - } catch ( Exception ex ) { | |
181 | - serr.println( "FormWordDictionary#btnDown_Click; ex=" + ex ); | |
182 | - } | |
183 | - } | |
184 | - } | |
185 | - | |
186 | - public void btnCancel_Click( Object sender, BEventArgs e ) | |
187 | - { | |
188 | - setDialogResult( BDialogResult.CANCEL ); | |
189 | - } | |
190 | - #endregion | |
191 | - | |
192 | - #region UI implementation | |
193 | -#if JAVA | |
194 | - #region UI Impl for Java | |
195 | - //INCLUDE-SECTION FIELD ../BuildJavaUI/src/org/kbinani/cadencii/FormWordDictionary.java | |
196 | - //INCLUDE-SECTION METHOD ../BuildJavaUI/src/org/kbinani/cadencii/FormWordDictionary.java | |
197 | - #endregion | |
198 | -#else | |
199 | - #region UI Impl for C# | |
200 | - /// <summary> | |
201 | - /// 必要なデザイナ変数です。 | |
202 | - /// </summary> | |
203 | - private System.ComponentModel.IContainer components = null; | |
204 | - | |
205 | - /// <summary> | |
206 | - /// 使用中のリソースをすべてクリーンアップします。 | |
207 | - /// </summary> | |
208 | - /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param> | |
209 | - protected override void Dispose( boolean disposing ) | |
210 | - { | |
211 | - if ( disposing && (components != null) ) { | |
212 | - components.Dispose(); | |
213 | - } | |
214 | - base.Dispose( disposing ); | |
215 | - } | |
216 | - | |
217 | - #region Windows フォーム デザイナで生成されたコード | |
218 | - | |
219 | - /// <summary> | |
220 | - /// デザイナ サポートに必要なメソッドです。このメソッドの内容を | |
221 | - /// コード エディタで変更しないでください。 | |
222 | - /// </summary> | |
223 | - private void InitializeComponent() | |
224 | - { | |
225 | - System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup( "ListViewGroup", System.Windows.Forms.HorizontalAlignment.Left ); | |
226 | - System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup( "ListViewGroup", System.Windows.Forms.HorizontalAlignment.Left ); | |
227 | - System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup( "ListViewGroup", System.Windows.Forms.HorizontalAlignment.Left ); | |
228 | - System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem( "DEFAULT_JP" ); | |
229 | - this.listDictionaries = new org.kbinani.windows.forms.BListView(); | |
230 | - this.lblAvailableDictionaries = new org.kbinani.windows.forms.BLabel(); | |
231 | - this.btnOK = new org.kbinani.windows.forms.BButton(); | |
232 | - this.btnCancel = new org.kbinani.windows.forms.BButton(); | |
233 | - this.btnUp = new org.kbinani.windows.forms.BButton(); | |
234 | - this.btnDown = new org.kbinani.windows.forms.BButton(); | |
235 | - this.SuspendLayout(); | |
236 | - // | |
237 | - // listDictionaries | |
238 | - // | |
239 | - this.listDictionaries.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | |
240 | - | System.Windows.Forms.AnchorStyles.Left) | |
241 | - | System.Windows.Forms.AnchorStyles.Right))); | |
242 | - this.listDictionaries.CheckBoxes = true; | |
243 | - listViewGroup1.Header = "ListViewGroup"; | |
244 | - listViewGroup1.Name = null; | |
245 | - listViewGroup2.Header = "ListViewGroup"; | |
246 | - listViewGroup2.Name = null; | |
247 | - listViewGroup3.Header = "ListViewGroup"; | |
248 | - listViewGroup3.Name = null; | |
249 | - this.listDictionaries.Groups.AddRange( new System.Windows.Forms.ListViewGroup[] { | |
250 | - listViewGroup1, | |
251 | - listViewGroup2, | |
252 | - listViewGroup3} ); | |
253 | - this.listDictionaries.HideSelection = false; | |
254 | - listViewItem1.Checked = true; | |
255 | - listViewItem1.Group = listViewGroup3; | |
256 | - listViewItem1.StateImageIndex = 1; | |
257 | - this.listDictionaries.Items.AddRange( new System.Windows.Forms.ListViewItem[] { | |
258 | - listViewItem1} ); | |
259 | - this.listDictionaries.Location = new System.Drawing.Point( 12, 33 ); | |
260 | - this.listDictionaries.Name = "listDictionaries"; | |
261 | - this.listDictionaries.Size = new System.Drawing.Size( 248, 186 ); | |
262 | - this.listDictionaries.TabIndex = 0; | |
263 | - this.listDictionaries.UseCompatibleStateImageBehavior = false; | |
264 | - this.listDictionaries.View = System.Windows.Forms.View.List; | |
265 | - // | |
266 | - // lblAvailableDictionaries | |
267 | - // | |
268 | - this.lblAvailableDictionaries.AutoSize = true; | |
269 | - this.lblAvailableDictionaries.Location = new System.Drawing.Point( 12, 13 ); | |
270 | - this.lblAvailableDictionaries.Name = "lblAvailableDictionaries"; | |
271 | - this.lblAvailableDictionaries.Size = new System.Drawing.Size( 117, 12 ); | |
272 | - this.lblAvailableDictionaries.TabIndex = 1; | |
273 | - this.lblAvailableDictionaries.Text = "Available Dictionaries"; | |
274 | - // | |
275 | - // btnOK | |
276 | - // | |
277 | - this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
278 | - this.btnOK.Location = new System.Drawing.Point( 91, 277 ); | |
279 | - this.btnOK.Name = "btnOK"; | |
280 | - this.btnOK.Size = new System.Drawing.Size( 75, 23 ); | |
281 | - this.btnOK.TabIndex = 4; | |
282 | - this.btnOK.Text = "OK"; | |
283 | - this.btnOK.UseVisualStyleBackColor = true; | |
284 | - // | |
285 | - // btnCancel | |
286 | - // | |
287 | - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
288 | - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; | |
289 | - this.btnCancel.Location = new System.Drawing.Point( 185, 277 ); | |
290 | - this.btnCancel.Name = "btnCancel"; | |
291 | - this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); | |
292 | - this.btnCancel.TabIndex = 3; | |
293 | - this.btnCancel.Text = "Cancel"; | |
294 | - this.btnCancel.UseVisualStyleBackColor = true; | |
295 | - // | |
296 | - // btnUp | |
297 | - // | |
298 | - this.btnUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
299 | - this.btnUp.Location = new System.Drawing.Point( 142, 229 ); | |
300 | - this.btnUp.Name = "btnUp"; | |
301 | - this.btnUp.Size = new System.Drawing.Size( 56, 23 ); | |
302 | - this.btnUp.TabIndex = 5; | |
303 | - this.btnUp.Text = "Up"; | |
304 | - this.btnUp.UseVisualStyleBackColor = true; | |
305 | - // | |
306 | - // btnDown | |
307 | - // | |
308 | - this.btnDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
309 | - this.btnDown.Location = new System.Drawing.Point( 204, 229 ); | |
310 | - this.btnDown.Name = "btnDown"; | |
311 | - this.btnDown.Size = new System.Drawing.Size( 56, 23 ); | |
312 | - this.btnDown.TabIndex = 6; | |
313 | - this.btnDown.Text = "Down"; | |
314 | - this.btnDown.UseVisualStyleBackColor = true; | |
315 | - // | |
316 | - // FormWordDictionary | |
317 | - // | |
318 | - this.AcceptButton = this.btnOK; | |
319 | - this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); | |
320 | - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |
321 | - this.CancelButton = this.btnCancel; | |
322 | - this.ClientSize = new System.Drawing.Size( 272, 315 ); | |
323 | - this.Controls.Add( this.btnDown ); | |
324 | - this.Controls.Add( this.btnUp ); | |
325 | - this.Controls.Add( this.btnOK ); | |
326 | - this.Controls.Add( this.btnCancel ); | |
327 | - this.Controls.Add( this.lblAvailableDictionaries ); | |
328 | - this.Controls.Add( this.listDictionaries ); | |
329 | - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; | |
330 | - this.MaximizeBox = false; | |
331 | - this.MinimizeBox = false; | |
332 | - this.Name = "FormWordDictionary"; | |
333 | - this.ShowIcon = false; | |
334 | - this.ShowInTaskbar = false; | |
335 | - this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; | |
336 | - this.Text = "User Dictionary Configuration"; | |
337 | - this.ResumeLayout( false ); | |
338 | - this.PerformLayout(); | |
339 | - | |
340 | - } | |
341 | - | |
342 | - #endregion | |
343 | - | |
344 | - private BListView listDictionaries; | |
345 | - private BLabel lblAvailableDictionaries; | |
346 | - private BButton btnOK; | |
347 | - private BButton btnCancel; | |
348 | - private BButton btnUp; | |
349 | - private BButton btnDown; | |
350 | - #endregion | |
351 | - | |
352 | -#endif | |
353 | - #endregion | |
354 | - | |
355 | - } | |
356 | - | |
357 | -#if !JAVA | |
358 | -} | |
359 | -#endif |
@@ -1,4 +1,4 @@ | ||
1 | -/* | |
1 | +/* | |
2 | 2 | * PureVirtualFunctionAttribute.cs |
3 | 3 | * Copyright © 2011 kbinani |
4 | 4 | * |
@@ -21,9 +21,22 @@ | ||
21 | 21 | /// メソッドが純粋仮想関数であることをpp_cs2javaに通知するための属性です. |
22 | 22 | /// 通知したいメソッドの直前の行にこの属性を記述してください. |
23 | 23 | /// </summary> |
24 | - public class PureVirtualFunctionAttribute : Attribute | |
25 | - { | |
26 | - } | |
24 | + /// <example> | |
25 | + /// C#のコードに以下のように記述したとします. | |
26 | + /// <code> | |
27 | + /// interface Foo{ | |
28 | + /// [PureVirtualFunction] | |
29 | + /// void someMethod(); | |
30 | + /// } | |
31 | + /// </code> | |
32 | + /// すると,pp_cs2javaに--replace-cppオプションを付けて処理させると次のようになります. | |
33 | + /// <code> | |
34 | + /// interface Foo{ | |
35 | + /// virtual void someMethod() = 0; | |
36 | + /// } | |
37 | + /// </code> | |
38 | + /// </example> | |
39 | + public class PureVirtualFunctionAttribute : Attribute { } | |
27 | 40 | |
28 | 41 | } |
29 | 42 | #endif |
@@ -0,0 +1,62 @@ | ||
1 | +#if !__FormWordDictionaryUiListener__ | |
2 | +#define __FormWordDictionaryUiListener__ | |
3 | +/* | |
4 | + * FormWordDictionaryUiListener.cs | |
5 | + * Copyright © 2011 kbinani | |
6 | + * | |
7 | + * This file is part of org.kbinani.cadencii. | |
8 | + * | |
9 | + * org.kbinani.cadencii is free software; you can redistribute it and/or | |
10 | + * modify it under the terms of the GPLv3 License. | |
11 | + * | |
12 | + * org.kbinani.cadencii is distributed in the hope that it will be useful, | |
13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
15 | + */ | |
16 | +#if JAVA | |
17 | + | |
18 | +package org.kbinani.cadencii; | |
19 | + | |
20 | +#else | |
21 | + | |
22 | +namespace org | |
23 | +{ | |
24 | + namespace kbinani | |
25 | + { | |
26 | + namespace cadencii | |
27 | + { | |
28 | + | |
29 | +#endif | |
30 | + | |
31 | +#if __cplusplus | |
32 | + class FormWordDictionaryUiListener | |
33 | +#else | |
34 | + public interface FormWordDictionaryUiListener | |
35 | +#endif | |
36 | + { | |
37 | + [PureVirtualFunction] | |
38 | + void formClosing(); | |
39 | + | |
40 | + [PureVirtualFunction] | |
41 | + void formLoad(); | |
42 | + | |
43 | + [PureVirtualFunction] | |
44 | + void buttonOkClick(); | |
45 | + | |
46 | + [PureVirtualFunction] | |
47 | + void buttonUpClick(); | |
48 | + | |
49 | + [PureVirtualFunction] | |
50 | + void buttonDownClick(); | |
51 | + | |
52 | + [PureVirtualFunction] | |
53 | + void buttonCancelClick(); | |
54 | + } | |
55 | + | |
56 | +#if !JAVA | |
57 | + } | |
58 | + } | |
59 | +} | |
60 | +#endif | |
61 | + | |
62 | +#endif |
@@ -0,0 +1,450 @@ | ||
1 | +/* | |
2 | + * FormWordDictionaryUiImpl.cs | |
3 | + * Copyright © 2008-2011 kbinani | |
4 | + * | |
5 | + * This file is part of org.kbinani.cadencii. | |
6 | + * | |
7 | + * org.kbinani.cadencii is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GPLv3 License. | |
9 | + * | |
10 | + * org.kbinani.cadencii is distributed in the hope that it will be useful, | |
11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
13 | + */ | |
14 | +using System; | |
15 | +using System.Windows.Forms; | |
16 | +using org.kbinani.apputil; | |
17 | +using org.kbinani.vsq; | |
18 | +using org.kbinani; | |
19 | +using org.kbinani.java.util; | |
20 | +using org.kbinani.windows.forms; | |
21 | + | |
22 | +namespace org.kbinani.cadencii | |
23 | +{ | |
24 | + using BEventArgs = System.EventArgs; | |
25 | + using boolean = System.Boolean; | |
26 | + using BEventHandler = System.EventHandler; | |
27 | + using BFormClosingEventHandler = System.Windows.Forms.FormClosingEventHandler; | |
28 | + using BFormClosingEventArgs = System.Windows.Forms.FormClosingEventArgs; | |
29 | + | |
30 | + class FormWordDictionaryUiImpl : Form, FormWordDictionaryUi | |
31 | + { | |
32 | + private FormWordDictionaryUiListener listener; | |
33 | + | |
34 | + public FormWordDictionaryUiImpl( FormWordDictionaryUiListener listener ) | |
35 | + { | |
36 | + this.listener = listener; | |
37 | + InitializeComponent(); | |
38 | + Util.applyFontRecurse( this, AppManager.editorConfig.getBaseFont() ); | |
39 | + } | |
40 | + | |
41 | + | |
42 | + #region FormWordDictionaryUiの実装 | |
43 | + | |
44 | + public void setTitle( string value ) | |
45 | + { | |
46 | + this.Text = value; | |
47 | + } | |
48 | + | |
49 | + public int getWidth() | |
50 | + { | |
51 | + return this.Width; | |
52 | + } | |
53 | + | |
54 | + public int getHeight() | |
55 | + { | |
56 | + return this.Height; | |
57 | + } | |
58 | + | |
59 | + public void setLocation( int x, int y ) | |
60 | + { | |
61 | + this.Location = new System.Drawing.Point( x, y ); | |
62 | + } | |
63 | + | |
64 | + public void close() | |
65 | + { | |
66 | + this.Close(); | |
67 | + } | |
68 | + | |
69 | + public void listDictionariesSetColumnHeaders( string[] headers ) | |
70 | + { | |
71 | + if ( listDictionaries.Columns.Count < headers.Length ) | |
72 | + { | |
73 | + for ( int i = listDictionaries.Columns.Count; i < headers.Length; i++ ) | |
74 | + { | |
75 | + listDictionaries.Columns.Add( "" ); | |
76 | + } | |
77 | + } | |
78 | + for ( int i = 0; i < headers.Length; i++ ) | |
79 | + { | |
80 | + listDictionaries.Columns[i].Text = headers[i]; | |
81 | + } | |
82 | + } | |
83 | + | |
84 | + public void listDictionariesClearSelection() | |
85 | + { | |
86 | + listDictionaries.SelectedIndices.Clear(); | |
87 | + } | |
88 | + | |
89 | + public void listDictionariesAddRow( string[] values, bool selected ) | |
90 | + { | |
91 | + ListViewItem item = new ListViewItem( values ); | |
92 | + if ( listDictionaries.Columns.Count < values.Length ) | |
93 | + { | |
94 | + for ( int i = listDictionaries.Columns.Count; i < values.Length; i++ ) | |
95 | + { | |
96 | + listDictionaries.Columns.Add( "" ); | |
97 | + } | |
98 | + } | |
99 | + item.Selected = selected; | |
100 | + listDictionaries.Items.Add( item ); | |
101 | + } | |
102 | + | |
103 | + public int listDictionariesGetColumnWidth( int column ) | |
104 | + { | |
105 | + return listDictionaries.Columns[column].Width; | |
106 | + } | |
107 | + | |
108 | + public void listDictionariesSetRowChecked( int row, bool value ) | |
109 | + { | |
110 | + listDictionaries.Items[row].Checked = value; | |
111 | + } | |
112 | + | |
113 | + public void listDictionariesSetSelectedRow( int row ) | |
114 | + { | |
115 | + for ( int i = 0; i < listDictionaries.Items.Count; i++ ) | |
116 | + { | |
117 | + listDictionaries.Items[i].Selected = (i == row); | |
118 | + } | |
119 | + } | |
120 | + | |
121 | + public void listDictionariesSetItemAt( int row, int column, string value ) | |
122 | + { | |
123 | + listDictionaries.Items[row].SubItems[column].Text = value; | |
124 | + } | |
125 | + | |
126 | + public bool listDictionariesIsRowChecked( int row ) | |
127 | + { | |
128 | + return listDictionaries.Items[row].Checked; | |
129 | + } | |
130 | + | |
131 | + public string listDictionariesGetItemAt( int row, int column ) | |
132 | + { | |
133 | + return listDictionaries.Items[row].SubItems[column].Text; | |
134 | + } | |
135 | + | |
136 | + public int listDictionariesGetSelectedRow() | |
137 | + { | |
138 | + if ( listDictionaries.SelectedIndices.Count == 0 ) | |
139 | + { | |
140 | + return -1; | |
141 | + } | |
142 | + else | |
143 | + { | |
144 | + return listDictionaries.SelectedIndices[0]; | |
145 | + } | |
146 | + } | |
147 | + | |
148 | + public int listDictionariesGetItemCountRow() | |
149 | + { | |
150 | + return listDictionaries.Items.Count; | |
151 | + } | |
152 | + | |
153 | + public void listDictionariesClear() | |
154 | + { | |
155 | + listDictionaries.Items.Clear(); | |
156 | + } | |
157 | + | |
158 | + public void listDictionariesSetColumnWidth( int columnIndex, int columnWidth ) | |
159 | + { | |
160 | + listDictionaries.Columns[columnIndex].Width = columnWidth; | |
161 | + } | |
162 | + | |
163 | + public void buttonDownSetText( string value ) | |
164 | + { | |
165 | + btnDown.Text = value; | |
166 | + } | |
167 | + | |
168 | + public void buttonUpSetText( string value ) | |
169 | + { | |
170 | + btnUp.Text = value; | |
171 | + } | |
172 | + | |
173 | + public void buttonOkSetText( string value ) | |
174 | + { | |
175 | + btnOK.Text = value; | |
176 | + } | |
177 | + | |
178 | + public void buttonCancelSetText( string value ) | |
179 | + { | |
180 | + btnCancel.Text = value; | |
181 | + } | |
182 | + | |
183 | + public void labelAvailableDictionariesSetText( string value ) | |
184 | + { | |
185 | + lblAvailableDictionaries.Text = value; | |
186 | + } | |
187 | + | |
188 | + public void setSize( int width, int height ) | |
189 | + { | |
190 | + this.Size = new System.Drawing.Size( width, height ); | |
191 | + } | |
192 | + | |
193 | + public void setDialogResult( bool value ) | |
194 | + { | |
195 | + if ( value ) | |
196 | + { | |
197 | + this.DialogResult = DialogResult.OK; | |
198 | + } | |
199 | + else | |
200 | + { | |
201 | + this.DialogResult = DialogResult.Cancel; | |
202 | + } | |
203 | + } | |
204 | + | |
205 | + #endregion | |
206 | + | |
207 | + | |
208 | + #region UiBaseの実装 | |
209 | + | |
210 | + public int showDialog( object parent_form ) | |
211 | + { | |
212 | + DialogResult ret; | |
213 | + if ( parent_form == null || (parent_form != null && !(parent_form is Form)) ) | |
214 | + { | |
215 | + ret = base.ShowDialog(); | |
216 | + } | |
217 | + else | |
218 | + { | |
219 | + Form form = (Form)parent_form; | |
220 | + ret = base.ShowDialog( form ); | |
221 | + } | |
222 | + if ( ret == DialogResult.OK || ret == DialogResult.Yes ) | |
223 | + { | |
224 | + return 1; | |
225 | + } | |
226 | + else | |
227 | + { | |
228 | + return 0; | |
229 | + } | |
230 | + } | |
231 | + | |
232 | + #endregion | |
233 | + | |
234 | + | |
235 | + #region イベントハンドラ | |
236 | + | |
237 | + void btnCancel_Click( object sender, EventArgs e ) | |
238 | + { | |
239 | + if ( listener != null ) | |
240 | + { | |
241 | + listener.buttonCancelClick(); | |
242 | + } | |
243 | + } | |
244 | + | |
245 | + void btnDown_Click( object sender, EventArgs e ) | |
246 | + { | |
247 | + if ( listener != null ) | |
248 | + { | |
249 | + listener.buttonDownClick(); | |
250 | + } | |
251 | + } | |
252 | + | |
253 | + void btnUp_Click( object sender, EventArgs e ) | |
254 | + { | |
255 | + if ( listener != null ) | |
256 | + { | |
257 | + listener.buttonUpClick(); | |
258 | + } | |
259 | + } | |
260 | + | |
261 | + void btnOK_Click( object sender, EventArgs e ) | |
262 | + { | |
263 | + if ( listener != null ) | |
264 | + { | |
265 | + listener.buttonOkClick(); | |
266 | + } | |
267 | + } | |
268 | + | |
269 | + void FormWordDictionaryUiImpl_FormClosing( object sender, System.Windows.Forms.FormClosingEventArgs e ) | |
270 | + { | |
271 | + if ( listener != null ) | |
272 | + { | |
273 | + listener.formClosing(); | |
274 | + } | |
275 | + } | |
276 | + | |
277 | + void FormWordDictionaryUiImpl_Load( object sender, EventArgs e ) | |
278 | + { | |
279 | + if ( listener != null ) | |
280 | + { | |
281 | + listener.formLoad(); | |
282 | + } | |
283 | + } | |
284 | + | |
285 | + #endregion | |
286 | + | |
287 | + | |
288 | + #region UI implementation | |
289 | + | |
290 | + /// <summary> | |
291 | + /// 必要なデザイナ変数です。 | |
292 | + /// </summary> | |
293 | + private System.ComponentModel.IContainer components = null; | |
294 | + | |
295 | + /// <summary> | |
296 | + /// 使用中のリソースをすべてクリーンアップします。 | |
297 | + /// </summary> | |
298 | + /// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param> | |
299 | + protected override void Dispose( boolean disposing ) | |
300 | + { | |
301 | + if ( disposing && (components != null) ) { | |
302 | + components.Dispose(); | |
303 | + } | |
304 | + base.Dispose( disposing ); | |
305 | + } | |
306 | + | |
307 | + #region Windows フォーム デザイナで生成されたコード | |
308 | + | |
309 | + /// <summary> | |
310 | + /// デザイナ サポートに必要なメソッドです。このメソッドの内容を | |
311 | + /// コード エディタで変更しないでください。 | |
312 | + /// </summary> | |
313 | + private void InitializeComponent() | |
314 | + { | |
315 | + System.Windows.Forms.ListViewGroup listViewGroup10 = new System.Windows.Forms.ListViewGroup( "ListViewGroup", System.Windows.Forms.HorizontalAlignment.Left ); | |
316 | + System.Windows.Forms.ListViewGroup listViewGroup11 = new System.Windows.Forms.ListViewGroup( "ListViewGroup", System.Windows.Forms.HorizontalAlignment.Left ); | |
317 | + System.Windows.Forms.ListViewGroup listViewGroup12 = new System.Windows.Forms.ListViewGroup( "ListViewGroup", System.Windows.Forms.HorizontalAlignment.Left ); | |
318 | + System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem( "DEFAULT_JP" ); | |
319 | + this.listDictionaries = new org.kbinani.windows.forms.BListView(); | |
320 | + this.lblAvailableDictionaries = new System.Windows.Forms.Label(); | |
321 | + this.btnOK = new System.Windows.Forms.Button(); | |
322 | + this.btnCancel = new System.Windows.Forms.Button(); | |
323 | + this.btnUp = new System.Windows.Forms.Button(); | |
324 | + this.btnDown = new System.Windows.Forms.Button(); | |
325 | + this.SuspendLayout(); | |
326 | + // | |
327 | + // listDictionaries | |
328 | + // | |
329 | + this.listDictionaries.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | |
330 | + | System.Windows.Forms.AnchorStyles.Left) | |
331 | + | System.Windows.Forms.AnchorStyles.Right))); | |
332 | + this.listDictionaries.CheckBoxes = true; | |
333 | + listViewGroup10.Header = "ListViewGroup"; | |
334 | + listViewGroup10.Name = null; | |
335 | + listViewGroup11.Header = "ListViewGroup"; | |
336 | + listViewGroup11.Name = null; | |
337 | + listViewGroup12.Header = "ListViewGroup"; | |
338 | + listViewGroup12.Name = null; | |
339 | + this.listDictionaries.Groups.AddRange( new System.Windows.Forms.ListViewGroup[] { | |
340 | + listViewGroup10, | |
341 | + listViewGroup11, | |
342 | + listViewGroup12} ); | |
343 | + this.listDictionaries.HideSelection = false; | |
344 | + listViewItem4.Checked = true; | |
345 | + listViewItem4.Group = listViewGroup12; | |
346 | + listViewItem4.StateImageIndex = 1; | |
347 | + this.listDictionaries.Items.AddRange( new System.Windows.Forms.ListViewItem[] { | |
348 | + listViewItem4} ); | |
349 | + this.listDictionaries.Location = new System.Drawing.Point( 12, 33 ); | |
350 | + this.listDictionaries.Name = "listDictionaries"; | |
351 | + this.listDictionaries.Size = new System.Drawing.Size( 248, 186 ); | |
352 | + this.listDictionaries.TabIndex = 0; | |
353 | + this.listDictionaries.UseCompatibleStateImageBehavior = false; | |
354 | + this.listDictionaries.View = System.Windows.Forms.View.List; | |
355 | + // | |
356 | + // lblAvailableDictionaries | |
357 | + // | |
358 | + this.lblAvailableDictionaries.AutoSize = true; | |
359 | + this.lblAvailableDictionaries.Location = new System.Drawing.Point( 12, 13 ); | |
360 | + this.lblAvailableDictionaries.Name = "lblAvailableDictionaries"; | |
361 | + this.lblAvailableDictionaries.Size = new System.Drawing.Size( 117, 12 ); | |
362 | + this.lblAvailableDictionaries.TabIndex = 1; | |
363 | + this.lblAvailableDictionaries.Text = "Available Dictionaries"; | |
364 | + // | |
365 | + // btnOK | |
366 | + // | |
367 | + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
368 | + this.btnOK.Location = new System.Drawing.Point( 91, 277 ); | |
369 | + this.btnOK.Name = "btnOK"; | |
370 | + this.btnOK.Size = new System.Drawing.Size( 75, 23 ); | |
371 | + this.btnOK.TabIndex = 4; | |
372 | + this.btnOK.Text = "OK"; | |
373 | + this.btnOK.UseVisualStyleBackColor = true; | |
374 | + this.btnOK.Click += new System.EventHandler( this.btnOK_Click ); | |
375 | + // | |
376 | + // btnCancel | |
377 | + // | |
378 | + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
379 | + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; | |
380 | + this.btnCancel.Location = new System.Drawing.Point( 185, 277 ); | |
381 | + this.btnCancel.Name = "btnCancel"; | |
382 | + this.btnCancel.Size = new System.Drawing.Size( 75, 23 ); | |
383 | + this.btnCancel.TabIndex = 3; | |
384 | + this.btnCancel.Text = "Cancel"; | |
385 | + this.btnCancel.UseVisualStyleBackColor = true; | |
386 | + this.btnCancel.Click += new System.EventHandler( this.btnCancel_Click ); | |
387 | + // | |
388 | + // btnUp | |
389 | + // | |
390 | + this.btnUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
391 | + this.btnUp.Location = new System.Drawing.Point( 142, 229 ); | |
392 | + this.btnUp.Name = "btnUp"; | |
393 | + this.btnUp.Size = new System.Drawing.Size( 56, 23 ); | |
394 | + this.btnUp.TabIndex = 5; | |
395 | + this.btnUp.Text = "Up"; | |
396 | + this.btnUp.UseVisualStyleBackColor = true; | |
397 | + this.btnUp.Click += new System.EventHandler( this.btnUp_Click ); | |
398 | + // | |
399 | + // btnDown | |
400 | + // | |
401 | + this.btnDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); | |
402 | + this.btnDown.Location = new System.Drawing.Point( 204, 229 ); | |
403 | + this.btnDown.Name = "btnDown"; | |
404 | + this.btnDown.Size = new System.Drawing.Size( 56, 23 ); | |
405 | + this.btnDown.TabIndex = 6; | |
406 | + this.btnDown.Text = "Down"; | |
407 | + this.btnDown.UseVisualStyleBackColor = true; | |
408 | + this.btnDown.Click += new System.EventHandler( this.btnDown_Click ); | |
409 | + // | |
410 | + // FormWordDictionaryUiImpl | |
411 | + // | |
412 | + this.AcceptButton = this.btnOK; | |
413 | + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 12F ); | |
414 | + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |
415 | + this.CancelButton = this.btnCancel; | |
416 | + this.ClientSize = new System.Drawing.Size( 272, 315 ); | |
417 | + this.Controls.Add( this.btnDown ); | |
418 | + this.Controls.Add( this.btnUp ); | |
419 | + this.Controls.Add( this.btnOK ); | |
420 | + this.Controls.Add( this.btnCancel ); | |
421 | + this.Controls.Add( this.lblAvailableDictionaries ); | |
422 | + this.Controls.Add( this.listDictionaries ); | |
423 | + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; | |
424 | + this.MaximizeBox = false; | |
425 | + this.MinimizeBox = false; | |
426 | + this.Name = "FormWordDictionaryUiImpl"; | |
427 | + this.ShowIcon = false; | |
428 | + this.ShowInTaskbar = false; | |
429 | + this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; | |
430 | + this.Text = "User Dictionary Configuration"; | |
431 | + this.Load += new System.EventHandler( this.FormWordDictionaryUiImpl_Load ); | |
432 | + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler( this.FormWordDictionaryUiImpl_FormClosing ); | |
433 | + this.ResumeLayout( false ); | |
434 | + this.PerformLayout(); | |
435 | + | |
436 | + } | |
437 | + | |
438 | + #endregion | |
439 | + | |
440 | + private BListView listDictionaries; | |
441 | + private Label lblAvailableDictionaries; | |
442 | + private Button btnOK; | |
443 | + private Button btnCancel; | |
444 | + private Button btnUp; | |
445 | + private Button btnDown; | |
446 | + #endregion | |
447 | + | |
448 | + } | |
449 | + | |
450 | +} |
@@ -0,0 +1,230 @@ | ||
1 | +/* | |
2 | + * FormWordDictionaryUi.cs | |
3 | + * Copyright © 2011 kbinani | |
4 | + * | |
5 | + * This file is part of org.kbinani.cadencii. | |
6 | + * | |
7 | + * org.kbinani.cadencii is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GPLv3 License. | |
9 | + * | |
10 | + * org.kbinani.cadencii is distributed in the hope that it will be useful, | |
11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
13 | + */ | |
14 | +#if JAVA | |
15 | + | |
16 | +package org.kbinani.cadencii; | |
17 | + | |
18 | +#else | |
19 | + | |
20 | +namespace org | |
21 | +{ | |
22 | + namespace kbinani | |
23 | + { | |
24 | + namespace cadencii | |
25 | + { | |
26 | + | |
27 | +#endif | |
28 | + | |
29 | +#if JAVA | |
30 | + public interface FormWordDictionaryUi extends UiBase | |
31 | +#elif __cplusplus | |
32 | + class FormWordDictionaryUi : UiBase | |
33 | +#else | |
34 | + public interface FormWordDictionaryUi : UiBase | |
35 | +#endif | |
36 | + { | |
37 | +#if __cplusplus | |
38 | + public: | |
39 | +#endif | |
40 | + /// <summary> | |
41 | + /// ウィンドウのタイトル文字列を設定します | |
42 | + /// </summary> | |
43 | + /// <param name="value">設定する文字列</param> | |
44 | + [PureVirtualFunction] | |
45 | + void setTitle( string value ); | |
46 | + | |
47 | + /// <summary> | |
48 | + /// ダイアログの戻り値を設定します. | |
49 | + /// </summary> | |
50 | + /// <param name="value">ダイアログの戻り値を「キャンセル」にする場合はfalseを,それ以外はtreuを設定します.</param> | |
51 | + [PureVirtualFunction] | |
52 | + void setDialogResult( bool value ); | |
53 | + | |
54 | + /// <summary> | |
55 | + /// TODO: comment | |
56 | + /// </summary> | |
57 | + /// <param name="width"></param> | |
58 | + /// <param name="height"></param> | |
59 | + [PureVirtualFunction] | |
60 | + void setSize( int width, int height ); | |
61 | + | |
62 | + /// <summary> | |
63 | + /// ウィンドウの幅を取得します | |
64 | + /// </summary> | |
65 | + /// <returns>ウィンドウの幅(単位はピクセル)</returns> | |
66 | + [PureVirtualFunction] | |
67 | + int getWidth(); | |
68 | + | |
69 | + /// <summary> | |
70 | + /// ウィンドウの高さを取得します | |
71 | + /// </summary> | |
72 | + /// <returns>ウィンドウの高さ(単位はピクセル)</returns> | |
73 | + [PureVirtualFunction] | |
74 | + int getHeight(); | |
75 | + | |
76 | + /// <summary> | |
77 | + /// ウィンドウの位置を設定します | |
78 | + /// </summary> | |
79 | + /// <param name="x">ウィンドウのx座標</param> | |
80 | + /// <param name="y">ウィンドウのy座標</param> | |
81 | + [PureVirtualFunction] | |
82 | + void setLocation( int x, int y ); | |
83 | + | |
84 | + /// <summary> | |
85 | + /// ウィンドウを閉じます | |
86 | + /// </summary> | |
87 | + [PureVirtualFunction] | |
88 | + void close(); | |
89 | + | |
90 | + | |
91 | + /// <summary> | |
92 | + /// TODO: comment | |
93 | + /// </summary> | |
94 | + /// <param name="columIndex"></param> | |
95 | + /// <param name="columnWidth"></param> | |
96 | + [PureVirtualFunction] | |
97 | + void listDictionariesSetColumnWidth( int columIndex, int columnWidth ); | |
98 | + | |
99 | + /// <summary> | |
100 | + /// TODO: comment | |
101 | + /// </summary> | |
102 | + /// <returns></returns> | |
103 | + [PureVirtualFunction] | |
104 | + int listDictionariesGetSelectedRow(); | |
105 | + | |
106 | + /// <summary> | |
107 | + /// リストに登録されたアイテムの個数を取得します | |
108 | + /// </summary> | |
109 | + /// <returns>アイテムの個数</returns> | |
110 | + [PureVirtualFunction] | |
111 | + int listDictionariesGetItemCountRow(); | |
112 | + | |
113 | + /// <summary> | |
114 | + /// TODO: comment | |
115 | + /// </summary> | |
116 | + [PureVirtualFunction] | |
117 | + void listDictionariesClear(); | |
118 | + | |
119 | + /// <summary> | |
120 | + /// TODO: comment | |
121 | + /// </summary> | |
122 | + /// <param name="row"></param> | |
123 | + /// <param name="column"></param> | |
124 | + /// <returns></returns> | |
125 | + [PureVirtualFunction] | |
126 | + string listDictionariesGetItemAt( int row, int column ); | |
127 | + | |
128 | + /// <summary> | |
129 | + /// TODO: | |
130 | + /// </summary> | |
131 | + /// <param name="row"></param> | |
132 | + /// <returns></returns> | |
133 | + [PureVirtualFunction] | |
134 | + bool listDictionariesIsRowChecked( int row ); | |
135 | + | |
136 | + /// <summary> | |
137 | + /// TODO: | |
138 | + /// </summary> | |
139 | + /// <param name="row"></param> | |
140 | + /// <param name="column"></param> | |
141 | + /// <param name="value"></param> | |
142 | + [PureVirtualFunction] | |
143 | + void listDictionariesSetItemAt( int row, int column, string value ); | |
144 | + | |
145 | + /// <summary> | |
146 | + /// TODO: | |
147 | + /// </summary> | |
148 | + /// <param name="row"></param> | |
149 | + /// <param name="value"></param> | |
150 | + [PureVirtualFunction] | |
151 | + void listDictionariesSetRowChecked( int row, bool value ); | |
152 | + | |
153 | + /// <summary> | |
154 | + /// TODO: | |
155 | + /// </summary> | |
156 | + /// <param name="row"></param> | |
157 | + [PureVirtualFunction] | |
158 | + void listDictionariesSetSelectedRow( int row ); | |
159 | + | |
160 | + /// <summary> | |
161 | + /// TODO: comment | |
162 | + /// </summary> | |
163 | + [PureVirtualFunction] | |
164 | + void listDictionariesClearSelection(); | |
165 | + | |
166 | + /// <summary> | |
167 | + /// TODO: comment | |
168 | + /// </summary> | |
169 | + /// <param name="values"></param> | |
170 | + /// <param name="selected"></param> | |
171 | + [PureVirtualFunction] | |
172 | + void listDictionariesAddRow( string[] values, bool selected ); | |
173 | + | |
174 | + /// <summary> | |
175 | + /// TODO: comment | |
176 | + /// </summary> | |
177 | + /// <param name="column"></param> | |
178 | + /// <returns></returns> | |
179 | + [PureVirtualFunction] | |
180 | + int listDictionariesGetColumnWidth( int column ); | |
181 | + | |
182 | + /// <summary> | |
183 | + /// リストのヘッダーの文字列を一括設定します | |
184 | + /// </summary> | |
185 | + /// <param name="headers">リストのヘッダー文字列のリスト</param> | |
186 | + [PureVirtualFunction] | |
187 | + void listDictionariesSetColumnHeaders( string[] headers ); | |
188 | + | |
189 | + | |
190 | + /// <summary> | |
191 | + /// 「利用可能な辞書」という意味の説明文の文字列を設定します. | |
192 | + /// </summary> | |
193 | + /// <param name="value">設定する文字列</param> | |
194 | + [PureVirtualFunction] | |
195 | + void labelAvailableDictionariesSetText( string value ); | |
196 | + | |
197 | + /// <summary> | |
198 | + /// OKボタンの表示文字列を設定します. | |
199 | + /// </summary> | |
200 | + /// <param name="value">設定する文字列</param> | |
201 | + [PureVirtualFunction] | |
202 | + void buttonOkSetText( string value ); | |
203 | + | |
204 | + /// <summary> | |
205 | + /// Cancelボタンの表示文字列を設定します. | |
206 | + /// </summary> | |
207 | + /// <param name="value">設定する文字列</param> | |
208 | + [PureVirtualFunction] | |
209 | + void buttonCancelSetText( string value ); | |
210 | + | |
211 | + /// <summary> | |
212 | + /// Upボタンの表示文字列を設定します. | |
213 | + /// </summary> | |
214 | + /// <param name="value">設定する文字列</param> | |
215 | + [PureVirtualFunction] | |
216 | + void buttonUpSetText( string value ); | |
217 | + | |
218 | + /// <summary> | |
219 | + /// Downボタンの表示文字列を設定します. | |
220 | + /// </summary> | |
221 | + /// <param name="value">設定する文字列</param> | |
222 | + [PureVirtualFunction] | |
223 | + void buttonDownSetText( string value ); | |
224 | + } | |
225 | + | |
226 | +#if !JAVA | |
227 | + } | |
228 | + } | |
229 | +} | |
230 | +#endif |
@@ -13430,12 +13430,13 @@ | ||
13430 | 13430 | |
13431 | 13431 | public void menuLyricDictionary_Click( Object sender, EventArgs e ) |
13432 | 13432 | { |
13433 | - FormWordDictionary dlg = null; | |
13433 | + FormWordDictionaryController dlg = null; | |
13434 | 13434 | try { |
13435 | - dlg = new FormWordDictionary(); | |
13436 | - dlg.setLocation( getFormPreferedLocation( dlg ) ); | |
13437 | - BDialogResult dr = AppManager.showModalDialog( dlg, this ); | |
13438 | - if ( dr == BDialogResult.OK ) { | |
13435 | + dlg = new FormWordDictionaryController(); | |
13436 | + Point p = getFormPreferedLocation( dlg.getWidth(), dlg.getHeight() ); | |
13437 | + dlg.setLocation( p.x, p.y ); | |
13438 | + int dr = AppManager.showModalDialog( dlg.getUi(), this ); | |
13439 | + if ( dr == 1 ) { | |
13439 | 13440 | Vector<ValuePair<String, Boolean>> result = dlg.getResult(); |
13440 | 13441 | SymbolTable.changeOrder( result ); |
13441 | 13442 | } |
@@ -0,0 +1,223 @@ | ||
1 | +/* | |
2 | + * FormWordDictionaryController.cs | |
3 | + * Copyright © 2011 kbinani | |
4 | + * | |
5 | + * This file is part of org.kbinani.cadencii. | |
6 | + * | |
7 | + * org.kbinani.cadencii is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GPLv3 License. | |
9 | + * | |
10 | + * org.kbinani.cadencii is distributed in the hope that it will be useful, | |
11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
13 | + */ | |
14 | +#if JAVA | |
15 | + | |
16 | +package org.kbinani.cadencii; | |
17 | + | |
18 | +#else | |
19 | + | |
20 | +namespace org | |
21 | +{ | |
22 | + namespace kbinani | |
23 | + { | |
24 | + namespace cadencii | |
25 | + { | |
26 | +#if __cplusplus | |
27 | +#else | |
28 | + using System; | |
29 | + using System.Windows.Forms; | |
30 | + using org.kbinani.apputil; | |
31 | + using org.kbinani.vsq; | |
32 | + using org.kbinani; | |
33 | + using org.kbinani.java.util; | |
34 | + using org.kbinani.windows.forms; | |
35 | + using BEventArgs = System.EventArgs; | |
36 | + using boolean = System.Boolean; | |
37 | + using BEventHandler = System.EventHandler; | |
38 | + using BFormClosingEventHandler = System.Windows.Forms.FormClosingEventHandler; | |
39 | + using BFormClosingEventArgs = System.Windows.Forms.FormClosingEventArgs; | |
40 | +#endif | |
41 | + | |
42 | +#endif | |
43 | + | |
44 | +#if JAVA | |
45 | + public class FormWordDictionaryController extends ControllerBase implements FormWordDictionaryUiListener | |
46 | +#else | |
47 | + public class FormWordDictionaryController : ControllerBase, FormWordDictionaryUiListener | |
48 | +#endif | |
49 | + { | |
50 | + private FormWordDictionaryUiImpl ui; | |
51 | + private static int mColumnWidth = 256; | |
52 | + private static int mWidth = 327; | |
53 | + private static int mHeight = 404; | |
54 | + | |
55 | + public FormWordDictionaryController() | |
56 | + { | |
57 | + ui = new FormWordDictionaryUiImpl( this ); | |
58 | + applyLanguage(); | |
59 | + ui.setSize( mWidth, mHeight ); | |
60 | + ui.listDictionariesSetColumnWidth( 0, mColumnWidth ); | |
61 | + } | |
62 | + | |
63 | + | |
64 | + #region FormWordDictionaryUiListenerの実装 | |
65 | + | |
66 | + public void buttonCancelClick() | |
67 | + { | |
68 | + ui.setDialogResult( false ); | |
69 | + } | |
70 | + | |
71 | + public void buttonDownClick() | |
72 | + { | |
73 | + int index = ui.listDictionariesGetSelectedRow(); | |
74 | + if ( 0 <= index && index + 1 < ui.listDictionariesGetItemCountRow() ) | |
75 | + { | |
76 | + try | |
77 | + { | |
78 | + ui.listDictionariesClear(); | |
79 | + String upper_name = ui.listDictionariesGetItemAt( index, 0 ); | |
80 | + boolean upper_enabled = ui.listDictionariesIsRowChecked( index ); | |
81 | + String lower_name = ui.listDictionariesGetItemAt( index + 1, 0 ); | |
82 | + boolean lower_enabled = ui.listDictionariesIsRowChecked( index + 1 ); | |
83 | + | |
84 | + ui.listDictionariesSetItemAt( index + 1, 0, upper_name ); | |
85 | + ui.listDictionariesSetRowChecked( index + 1, upper_enabled ); | |
86 | + ui.listDictionariesSetItemAt( index, 0, lower_name ); | |
87 | + ui.listDictionariesSetRowChecked( index, lower_enabled ); | |
88 | + | |
89 | + ui.listDictionariesSetSelectedRow( index + 1 ); | |
90 | + } | |
91 | + catch ( Exception ex ) | |
92 | + { | |
93 | + serr.println( "FormWordDictionary#btnDown_Click; ex=" + ex ); | |
94 | + } | |
95 | + } | |
96 | + } | |
97 | + | |
98 | + public void buttonUpClick() | |
99 | + { | |
100 | + int index = ui.listDictionariesGetSelectedRow(); | |
101 | + if ( index >= 1 ) | |
102 | + { | |
103 | + try | |
104 | + { | |
105 | + ui.listDictionariesClearSelection(); | |
106 | + String upper_name = ui.listDictionariesGetItemAt( index - 1, 0 ); | |
107 | + boolean upper_enabled = ui.listDictionariesIsRowChecked( index - 1 ); | |
108 | + String lower_name = ui.listDictionariesGetItemAt( index, 0 ); | |
109 | + boolean lower_enabled = ui.listDictionariesIsRowChecked( index ); | |
110 | + | |
111 | + ui.listDictionariesSetItemAt( index - 1, 0, lower_name ); | |
112 | + ui.listDictionariesSetRowChecked( index - 1, lower_enabled ); | |
113 | + ui.listDictionariesSetItemAt( index, 0, upper_name ); | |
114 | + ui.listDictionariesSetRowChecked( index, upper_enabled ); | |
115 | + | |
116 | + ui.listDictionariesSetSelectedRow( index - 1 ); | |
117 | + } | |
118 | + catch ( Exception ex ) | |
119 | + { | |
120 | + serr.println( "FormWordDictionary#btnUp_Click; ex=" + ex ); | |
121 | + } | |
122 | + } | |
123 | + } | |
124 | + | |
125 | + public void buttonOkClick() | |
126 | + { | |
127 | + ui.setDialogResult( true ); | |
128 | + } | |
129 | + | |
130 | + public void formLoad() | |
131 | + { | |
132 | + ui.listDictionariesClear(); | |
133 | + for ( int i = 0; i < SymbolTable.getCount(); i++ ) | |
134 | + { | |
135 | + String name = SymbolTable.getSymbolTable( i ).getName(); | |
136 | + boolean enabled = SymbolTable.getSymbolTable( i ).isEnabled(); | |
137 | + ui.listDictionariesAddRow( new String[] { name }, enabled ); | |
138 | + } | |
139 | + } | |
140 | + | |
141 | + public void formClosing() | |
142 | + { | |
143 | + mColumnWidth = ui.listDictionariesGetColumnWidth( 0 ); | |
144 | + mWidth = ui.getWidth(); | |
145 | + mHeight = ui.getHeight(); | |
146 | + } | |
147 | + | |
148 | + #endregion | |
149 | + | |
150 | + | |
151 | + #region public methods | |
152 | + | |
153 | + public void close() | |
154 | + { | |
155 | + ui.close(); | |
156 | + } | |
157 | + | |
158 | + public UiBase getUi() | |
159 | + { | |
160 | + return ui; | |
161 | + } | |
162 | + | |
163 | + public int getWidth() | |
164 | + { | |
165 | + return ui.getWidth(); | |
166 | + } | |
167 | + | |
168 | + public int getHeight() | |
169 | + { | |
170 | + return ui.getHeight(); | |
171 | + } | |
172 | + | |
173 | + public void setLocation( int x, int y ) | |
174 | + { | |
175 | + ui.setLocation( x, y ); | |
176 | + } | |
177 | + | |
178 | + public void applyLanguage() | |
179 | + { | |
180 | + ui.setTitle( _( "User Dictionary Configuration" ) ); | |
181 | + ui.labelAvailableDictionariesSetText( _( "Available Dictionaries" ) ); | |
182 | + ui.buttonOkSetText( _( "OK" ) ); | |
183 | + ui.buttonCancelSetText( _( "Cancel" ) ); | |
184 | + ui.buttonUpSetText( _( "Up" ) ); | |
185 | + ui.buttonDownSetText( _( "Down" ) ); | |
186 | + ui.listDictionariesSetColumnHeaders( new String[] { _( "Name of dictionary" ) } ); | |
187 | + } | |
188 | + | |
189 | + public Vector<ValuePair<String, Boolean>> getResult() | |
190 | + { | |
191 | + Vector<ValuePair<String, Boolean>> ret = new Vector<ValuePair<String, Boolean>>(); | |
192 | + int count = ui.listDictionariesGetItemCountRow(); | |
193 | +#if DEBUG | |
194 | + sout.println( "FormWordDictionary#getResult; count=" + count ); | |
195 | +#endif | |
196 | + for ( int i = 0; i < count; i++ ) | |
197 | + { | |
198 | + String name = ui.listDictionariesGetItemAt( i, 0 ); | |
199 | + | |
200 | + ret.add( new ValuePair<String, Boolean>( | |
201 | + ui.listDictionariesGetItemAt( i, 0 ), ui.listDictionariesIsRowChecked( i ) ) ); | |
202 | + } | |
203 | + return ret; | |
204 | + } | |
205 | + | |
206 | + #endregion | |
207 | + | |
208 | + | |
209 | + #region private methods | |
210 | + | |
211 | + private static String _( String id ) | |
212 | + { | |
213 | + return Messaging.getMessage( id ); | |
214 | + } | |
215 | + | |
216 | + #endregion | |
217 | + } | |
218 | + | |
219 | +#if !JAVA | |
220 | + } | |
221 | + } | |
222 | +} | |
223 | +#endif |