• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

OmegaT の背景に画像を表示します。


Commit MetaInfo

Revision51 (tree)
Time2014-05-23 11:05:02
Authoryu-tang

Log Message

ペインの個別指定を、エディターについても対応

Change Summary

Incremental Difference

--- trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/MoeUI.java (revision 50)
+++ trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/MoeUI.java (revision 51)
@@ -301,7 +301,7 @@
301301 return true;
302302 }
303303
304- private JTextPane getTextPane(Parts pane) {
304+ private JEditorPane getTextPane(Parts pane) {
305305 /*
306306 dockable.getDockKey().getKey()
307307 dockable.getComponent().class.name
@@ -330,19 +330,24 @@
330330 MULTIPLE_TRANS
331331 org.omegat.gui.main.DockableScrollPane
332332 org.omegat.gui.multtrans.MultipleTransPane
333-
333+
334334 xxxTextArea は、基本的に全部 JEditorPane の拡張。
335335 MULTIPLE_TRANS も、同じ。
336336 EntryInfoThreadPane -> EntryInfoPane -> JTextPane -> JEditorPane という感じ。
337-
338- //@@TODOエディターも同じで扱えるのか?
337+ EDITOR だけちょっと特殊なので、分岐処理しておく。
339338 */
340- final String PANE_NAME = pane.name();
341- for (DockableState d: desktop.getDockables()) {
342- Dockable dockable = d.getDockable();
343- if (dockable.getDockKey().getKey().equalsIgnoreCase(PANE_NAME)) {
344- JScrollPane sp = (JScrollPane) dockable.getComponent();
345- return (JTextPane) sp.getViewport().getView();
339+ // エディターの場合
340+ if (pane == Parts.EDITOR) {
341+ return getJEditorPaneFromEditor(desktop);
342+ } else {
343+ // エディター以外の場合
344+ final String PANE_NAME = pane.name();
345+ for (DockableState d: desktop.getDockables()) {
346+ Dockable dockable = d.getDockable();
347+ if (dockable.getDockKey().getKey().equalsIgnoreCase(PANE_NAME)) {
348+ JScrollPane sp = (JScrollPane) dockable.getComponent();
349+ return (JTextPane) sp.getViewport().getView();
350+ }
346351 }
347352 }
348353 return null;
@@ -525,7 +530,7 @@
525530 private JEditorPane getJEditorPaneFromEditor(DockingDesktop desktop) {
526531 for (DockableState d: desktop.getDockables()) {
527532 Dockable dockable = d.getDockable();
528- if (dockable.getDockKey().getKey().equalsIgnoreCase("EDITOR")) {
533+ if (dockable.getDockKey().getKey().equals(Parts.EDITOR.name())) {
529534 JScrollPane sp;
530535
531536 // OmegaT 3.1.0 or later