• 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

Revision29 (tree)
Time2014-05-17 13:50:14
Authoryu-tang

Log Message

ボタンパネルの透過・不透過の切り替えに対応

Change Summary

Incremental Difference

--- trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/MoeUI.java (revision 28)
+++ trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/MoeUI.java (revision 29)
@@ -37,7 +37,6 @@
3737 import javax.swing.JPanel;
3838 import javax.swing.JScrollPane;
3939 import org.omegat.core.Core;
40-import org.omegat.util.Log;
4140 import org.omegat.util.gui.UIThreadsUtil;
4241
4342 /**
@@ -54,7 +53,7 @@
5453 private JMenuBar menuBar;
5554 private DockingDesktop desktop;
5655 private JPanel statusBar;
57- private JPanel buttonPanel;
56+ private AutoHideButtonPanel buttonPanel;
5857
5958
6059 private boolean makeTransparentMenubar = true;
@@ -304,24 +303,33 @@
304303 return null;
305304 }
306305
307- private JPanel getButtonPanel(DockingDesktop desktop) {
306+ private AutoHideButtonPanel getButtonPanel(DockingDesktop desktop) {
308307 // desktop
309308 // + com.vlsolutions.swing.docking.AutoHideExpandPanel // 非表示
310309 // + com.vlsolutions.swing.docking.DockingDesktop$1 // ボタンパネルの上の領域、ボタンパネルが非表示の場合は下のパネルと同じサイズ
311310 // + javax.swing.JPanel // ボタンパネルを含む領域 <= this
312311
313- JPanel panel = getJPanel(desktop);
312+ JPanel panel = null;
313+ for (Component c: desktop.getComponents()) {
314+ // AutoHideExpandPanel も JPanel 派生のため、instanceof で判定すると
315+ // 先にそっちを掴むので注意
316+ if (c.getClass().getName().equals("javax.swing.JPanel")) {
317+ panel = (JPanel) c;
318+ break;
319+ }
320+ }
321+
314322 // panel
315323 // + com.vlsolutions.swing.docking.AutoHideButtonPanel // 非表示、未使用
316324 // + com.vlsolutions.swing.docking.AutoHideButtonPanel // 非表示、未使用
317- // + com.vlsolutions.swing.docking.AutoHideButtonPanel // ボタンがあれば表示(isShowing()、isVisible() ともに true)
325+ // + com.vlsolutions.swing.docking.AutoHideButtonPanel // ボタンがあれば表示(isShowing()、isVisible() ともに true) <= this
318326 // + com.vlsolutions.swing.docking.AutoHideButtonPanel // 非表示、未使用
319327 // + com.vlsolutions.swing.docking.DockingPanel // ボタンパネルの上の領域
320-
321- // 3番目の AutoHideButtonPanel を取得したい。
322- // 状態が不明(表示/非表示で識別できるかどうか分からない)なので、
323- // とりあえずインデックスで決め打ちする。
324- return (JPanel) panel.getComponent(2);
328+
329+ // ここでは 3 番目の AutoHideButtonPanel を取得したい。
330+ // 状態が不明(非表示の場合は、他の AutoHideButtonPanel と識別できない)
331+ // なので、とりあえずインデックスで決め打ちする。
332+ return (AutoHideButtonPanel) panel.getComponent(2);
325333 }
326334
327335 private JEditorPane getJEditorPaneFromEditor(DockingDesktop desktop) {