• 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

Revision75 (tree)
Time2014-07-15 23:47:06
Authoryu-tang

Log Message

OmegaT 3.1.3 対応

Change Summary

Incremental Difference

--- trunk/manifest.mf (revision 74)
+++ trunk/manifest.mf (revision 75)
@@ -2,7 +2,7 @@
22 Main-Class: org.omegat.Main
33 License: GNU Public License version 3 or later
44 Specification-Version: 1.0
5-Implementation-Version: 0.2
5+Implementation-Version: 0.3
66 Permissions: all-permissions
77 Class-Path: lib/lib-mnemonics.jar
88 OmegaT-Plugins:
--- trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/gui/ConfigEditDialog.java (nonexistent)
+++ trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/gui/ConfigEditDialog.java (revision 75)
@@ -0,0 +1,133 @@
1+/**************************************************************************
2+ Moenizer - Allow to set background image for OmegaT.
3+
4+ Copyright (C) 2014 Yu Tang
5+ Home page: http://sourceforge.jp/users/yu-tang/
6+ Support center: http://sourceforge.jp/users/yu-tang/pf/Moenizer/
7+
8+ This file is part of plugin for OmegaT.
9+ http://www.omegat.org/
10+
11+ License: GNU GPL version 3 or (at your option) any later version.
12+
13+ You should have received a copy of the GNU General Public License
14+ along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ **************************************************************************/
16+
17+package jp.sourceforge.users.yutang.omegat.plugin.moenizer.gui;
18+
19+import groovy.util.ConfigObject;
20+import java.util.Set;
21+import jp.sourceforge.users.yutang.omegat.plugin.moenizer.L10n;
22+import jp.sourceforge.users.yutang.omegat.plugin.moenizer.ThemeChanger;
23+import org.omegat.core.Core;
24+import org.omegat.util.StaticUtils;
25+
26+/**
27+ *
28+ * @author Yu-Tang
29+ */
30+public class ConfigEditDialog extends javax.swing.JDialog {
31+
32+ private final Set<ConfigObject> sortedConfigs;
33+ private final ThemeChanger themeChanger;
34+
35+ /**
36+ * Creates new form MoeConfigEditDialog
37+ * @param sortedConfigs
38+ * @param themeChanger
39+ */
40+ public ConfigEditDialog(Set<ConfigObject> sortedConfigs, ThemeChanger themeChanger) {
41+ super(Core.getMainWindow().getApplicationFrame(), true);
42+ this.sortedConfigs = sortedConfigs;
43+ this.themeChanger = themeChanger;
44+ initComponents();
45+ initUI();
46+ }
47+
48+ private void initUI() {
49+ this.setTitle(StaticUtils.format(L10n.get(L10n.Key.DIALOG_TITLE),
50+ L10n.get(L10n.Key.CURRENT_VERSION)));
51+ }
52+
53+ private void initComponents() {
54+
55+ jSplitPane1 = new javax.swing.JSplitPane();
56+ jLabel2 = new javax.swing.JLabel();
57+ jScrollPane1 = new javax.swing.JScrollPane();
58+ jTree1 = new javax.swing.JTree();
59+ jPanel1 = new javax.swing.JPanel();
60+ jSeparator1 = new javax.swing.JSeparator();
61+ jLabel1 = new javax.swing.JLabel();
62+
63+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
64+ setModal(true);
65+
66+ jSplitPane1.setName("jSplitPane1"); // NOI18N
67+
68+ jLabel2.setText("jLabel2");
69+ jLabel2.setName("jLabel2"); // NOI18N
70+ jSplitPane1.setRightComponent(jLabel2);
71+
72+ jScrollPane1.setName("jScrollPane1"); // NOI18N
73+
74+ jTree1.setName("jTree1"); // NOI18N
75+ jScrollPane1.setViewportView(jTree1);
76+
77+ jSplitPane1.setLeftComponent(jScrollPane1);
78+
79+ jPanel1.setName("jPanel1"); // NOI18N
80+
81+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
82+ jPanel1.setLayout(jPanel1Layout);
83+ jPanel1Layout.setHorizontalGroup(
84+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
85+ .addGap(0, 316, Short.MAX_VALUE)
86+ );
87+ jPanel1Layout.setVerticalGroup(
88+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
89+ .addGap(0, 196, Short.MAX_VALUE)
90+ );
91+
92+ jSplitPane1.setRightComponent(jPanel1);
93+
94+ jSeparator1.setName("jSeparator1"); // NOI18N
95+
96+ jLabel1.setText("jLabel1");
97+ jLabel1.setName("jLabel1"); // NOI18N
98+
99+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
100+ getContentPane().setLayout(layout);
101+ layout.setHorizontalGroup(
102+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
103+ .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
104+ .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
105+ .addGroup(layout.createSequentialGroup()
106+ .addContainerGap()
107+ .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
108+ .addContainerGap())
109+ );
110+ layout.setVerticalGroup(
111+ layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
112+ .addGroup(layout.createSequentialGroup()
113+ .addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
114+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
115+ .addComponent(jLabel1)
116+ .addGap(6, 6, 6)
117+ .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
118+ .addGap(0, 64, Short.MAX_VALUE))
119+ );
120+
121+ pack();
122+ setLocationRelativeTo(null);
123+ }
124+
125+ // Variables declaration
126+ private javax.swing.JLabel jLabel1;
127+ private javax.swing.JLabel jLabel2;
128+ private javax.swing.JPanel jPanel1;
129+ private javax.swing.JScrollPane jScrollPane1;
130+ private javax.swing.JSeparator jSeparator1;
131+ private javax.swing.JSplitPane jSplitPane1;
132+ private javax.swing.JTree jTree1;
133+}
--- trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/MoeUI.java (revision 74)
+++ trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/MoeUI.java (revision 75)
@@ -21,7 +21,7 @@
2121 import com.vlsolutions.swing.docking.DockView;
2222 import com.vlsolutions.swing.docking.DockViewTitleBar;
2323 import com.vlsolutions.swing.docking.Dockable;
24-import com.vlsolutions.swing.docking.DockableState;
24+import com.vlsolutions.swing.docking.DockableState.Location;
2525 import com.vlsolutions.swing.docking.DockingDesktop;
2626 import com.vlsolutions.swing.docking.SplitContainer;
2727 import java.awt.Color;
@@ -265,8 +265,7 @@
265265 }
266266
267267 private int getDockViewTitleBarHeight(DockingDesktop desktop) {
268- ArrayList<Dockable> dockables = desktop.getContext()
269- .getDockablesByState(desktop, DockableState.STATE_DOCKED);
268+ ArrayList<Dockable> dockables = getDockedDockables(desktop);
270269 if (!dockables.isEmpty()) {
271270 Dockable dockable = dockables.get(0);
272271
@@ -459,8 +458,7 @@
459458 // + splitContainer(VERTICAL) <-- DockView.getParent()
460459 // + DockView <-- Dockable.getParent()
461460 // + Dockable <-- DockableState.getDockable()
462- ArrayList<Dockable> dockables = desktop.getContext()
463- .getDockablesByState(desktop, DockableState.STATE_DOCKED);
461+ ArrayList<Dockable> dockables = getDockedDockables(desktop);
464462 for (Dockable d : dockables) {
465463 Parts part = Parts.valueOf(d.getDockKey().getKey());
466464 if (!exclude.contains(part)) {
@@ -469,6 +467,11 @@
469467 }
470468 }
471469
470+ private ArrayList<Dockable> getDockedDockables(DockingDesktop desktop) {
471+ return desktop.getContext().
472+ getDockablesByState(desktop, Location.DOCKED);
473+ }
474+
472475 private void transparentRecursive(Dockable dockable) {
473476 // DockView
474477 Container container = dockable.getComponent().getParent();
--- trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/Moenizer.java (revision 74)
+++ trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/Moenizer.java (revision 75)
@@ -19,6 +19,7 @@
1919 import groovy.util.ConfigObject;
2020 import java.util.Set;
2121 import javax.swing.SwingUtilities;
22+import jp.sourceforge.users.yutang.omegat.plugin.moenizer.gui.ConfigEditDialog;
2223 import org.omegat.core.Core;
2324 import org.omegat.core.CoreEvents;
2425 import org.omegat.core.events.IApplicationEventListener;
@@ -41,11 +42,15 @@
4142 public static void loadPlugins() {
4243 try {
4344 // Not initialize in console mode
44- if (!instantiated) {
45+ if (instantiated) {
46+ throw new RuntimeException("Moenizer plugin could be instantiated only once.");
47+ } else if (!isSupportedVLDockingFramework()) {
48+ throw new RuntimeException("Moenizer plugin is not compatibled "
49+ + "with current VLDocking framework library.\n"
50+ + "Please update to OmegaT 3.1.2u1 or later.");
51+ } else {
4552 CoreEvents.registerApplicationEventListener(new Moenizer());
4653 instantiated = true;
47- } else {
48- throw new RuntimeException("Moenizer plugin could be instantiated only once.");
4954 }
5055 } catch (Throwable ex) {
5156 String msg = ex.getMessage();
@@ -54,6 +59,11 @@
5459 }
5560 }
5661
62+ private static boolean isSupportedVLDockingFramework() {
63+ return !"2.1.4".equals(com.vlsolutions.swing.docking.DockingDesktop
64+ .getDockingFrameworkVersion());
65+ }
66+
5767 public static void unloadPlugins() {
5868 // do nothing
5969 }
@@ -63,6 +73,7 @@
6373 try {
6474 config = new MoeConfig(MoeUtil.getMoeConfigFile());
6575 ui = MoeUI.getInstance();
76+ /*
6677 menu = new MenuHandler(new Runnable() {
6778 @Override
6879 public void run() {
@@ -69,6 +80,7 @@
6980 showSettingDialog();
7081 }
7182 });
83+ */
7284 themeChanger = new ThemeChanger(ui);
7385 themeChanger.setTheme(config.getCurrentConfig());
7486
@@ -96,9 +108,10 @@
96108 private void showSettingDialog() {
97109 //@@TODO 前処理 -- 自動保存中断など
98110 Set<ConfigObject> sortedConfigs = config.getSortedConfigs();
99- MoeConfigEditDialog dialog = new MoeConfigEditDialog(sortedConfigs, themeChanger);
100- dialog.setSize(400, 200); //@@TODO remain size
101- dialog.setLocationRelativeTo(null); // positioning at the center of the screen
111+ //MoeConfigEditDialog dialog = new MoeConfigEditDialog(sortedConfigs, themeChanger);
112+ ConfigEditDialog dialog = new ConfigEditDialog(sortedConfigs, themeChanger);
113+ //dialog.setSize(400, 200); //@@TODO remain size
114+ //dialog.setLocationRelativeTo(null); // positioning at the center of the screen
102115 dialog.setVisible(true);
103116 onConfigUpdate();
104117 //@@TODO 後処理 -- 自動保存再開など
@@ -105,7 +118,7 @@
105118 }
106119
107120 private void onConfigUpdate() {
108- Log.log("-- onConfigUpdate()"); //@@TODO 要・実装
121+ //Log.log("-- onConfigUpdate()"); //@@TODO 要・実装
109122 }
110123
111124 }
--- trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/MoeConfigEditDialog.java (revision 74)
+++ trunk/src/jp/sourceforge/users/yutang/omegat/plugin/moenizer/MoeConfigEditDialog.java (revision 75)
@@ -47,20 +47,74 @@
4747 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
4848 private void initComponents() {
4949
50+ jSplitPane1 = new javax.swing.JSplitPane();
51+ jLabel2 = new javax.swing.JLabel();
52+ jScrollPane1 = new javax.swing.JScrollPane();
53+ jTree1 = new javax.swing.JTree();
54+ jPanel1 = new javax.swing.JPanel();
55+ jSeparator1 = new javax.swing.JSeparator();
56+ jLabel1 = new javax.swing.JLabel();
57+
5058 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
59+ setModal(true);
5160
61+ jSplitPane1.setName("jSplitPane1"); // NOI18N
62+
63+ jLabel2.setText("jLabel2");
64+ jLabel2.setName("jLabel2"); // NOI18N
65+ jSplitPane1.setRightComponent(jLabel2);
66+
67+ jScrollPane1.setName("jScrollPane1"); // NOI18N
68+
69+ jTree1.setName("jTree1"); // NOI18N
70+ jScrollPane1.setViewportView(jTree1);
71+
72+ jSplitPane1.setLeftComponent(jScrollPane1);
73+
74+ jPanel1.setName("jPanel1"); // NOI18N
75+
76+ javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
77+ jPanel1.setLayout(jPanel1Layout);
78+ jPanel1Layout.setHorizontalGroup(
79+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
80+ .addGap(0, 316, Short.MAX_VALUE)
81+ );
82+ jPanel1Layout.setVerticalGroup(
83+ jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
84+ .addGap(0, 196, Short.MAX_VALUE)
85+ );
86+
87+ jSplitPane1.setRightComponent(jPanel1);
88+
89+ jSeparator1.setName("jSeparator1"); // NOI18N
90+
91+ jLabel1.setText("jLabel1");
92+ jLabel1.setName("jLabel1"); // NOI18N
93+
5294 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
5395 getContentPane().setLayout(layout);
5496 layout.setHorizontalGroup(
5597 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
56- .addGap(0, 400, Short.MAX_VALUE)
98+ .addComponent(jSplitPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
99+ .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
100+ .addGroup(layout.createSequentialGroup()
101+ .addContainerGap()
102+ .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
103+ .addContainerGap())
57104 );
58105 layout.setVerticalGroup(
59106 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
60- .addGap(0, 300, Short.MAX_VALUE)
107+ .addGroup(layout.createSequentialGroup()
108+ .addComponent(jSplitPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
109+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
110+ .addComponent(jLabel1)
111+ .addGap(6, 6, 6)
112+ .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
113+ .addGap(0, 64, Short.MAX_VALUE))
61114 );
62115
63116 pack();
117+ setLocationRelativeTo(null);
64118 }// </editor-fold>//GEN-END:initComponents
65119
66120 /*
@@ -78,5 +132,12 @@
78132 });*/
79133
80134 // Variables declaration - do not modify//GEN-BEGIN:variables
135+ private javax.swing.JLabel jLabel1;
136+ private javax.swing.JLabel jLabel2;
137+ private javax.swing.JPanel jPanel1;
138+ private javax.swing.JScrollPane jScrollPane1;
139+ private javax.swing.JSeparator jSeparator1;
140+ private javax.swing.JSplitPane jSplitPane1;
141+ private javax.swing.JTree jTree1;
81142 // End of variables declaration//GEN-END:variables
82143 }