OSDN Git Service

キャラクタープロファイルの作成と複製のボタンを分けた。
authorseraphy <seraphy@5b6e9025-a2e8-4882-b233-f889982098c5>
Sat, 23 Nov 2013 06:34:56 +0000 (06:34 +0000)
committerseraphy <seraphy@5b6e9025-a2e8-4882-b233-f889982098c5>
Sat, 23 Nov 2013 06:34:56 +0000 (06:34 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/charactermanaj/trunk@78 5b6e9025-a2e8-4882-b233-f889982098c5

resources/languages/profileselectordialog.xml
resources/languages/profileselectordialog_ja.xml
src/charactermanaj/ui/ProfileSelectorDialog.java

index a3dcccd..9b5d1b5 100644 (file)
@@ -2,7 +2,7 @@
 <properties version="1.0">\r
        <entry key="title">Profile Selector</entry>\r
        <entry key="profile.new">New</entry>\r
-       <entry key="profile.new.tooltip">If the shift key is pressed, the default profile is made.</entry>\r
+       <entry key="profile.copy">Copy Struct.</entry>\r
        <entry key="profile.edit">Edit</entry>\r
        <entry key="profile.edit.readonly">View</entry>\r
        <entry key="profile.remove">Remove</entry>\r
index 5577ab0..5f24129 100644 (file)
@@ -2,7 +2,7 @@
 <properties version="1.0">\r
        <entry key="title">プロファイルの選択</entry>\r
        <entry key="profile.new">新規</entry>\r
-       <entry key="profile.new.tooltip">シフトキーでデフォルトのプロファイルを作成します。</entry>\r
+       <entry key="profile.copy">構造の複製</entry>\r
        <entry key="profile.edit">修正</entry>\r
        <entry key="profile.edit.readonly">照会</entry>\r
        <entry key="profile.remove">削除</entry>\r
index 2a8543f..3ea416d 100644 (file)
@@ -33,6 +33,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;\r
 \r
 import javax.swing.AbstractAction;\r
+import javax.swing.Action;\r
 import javax.swing.ActionMap;\r
 import javax.swing.BorderFactory;\r
 import javax.swing.Box;\r
@@ -117,17 +118,19 @@ public class ProfileSelectorDialog extends JDialog {
        \r
        private JButton btnOK;\r
        \r
-       private JButton btnProfileNew;\r
-       \r
-       private JButton btnProfileEdit;\r
+       private Action actProfileNew;\r
 \r
-       private JButton btnProfileRemove;\r
-       \r
-       private JButton btnProfileBrowse;\r
+       private Action actProfileCopy;\r
+\r
+       private Action actProfileEdit;\r
+\r
+       private Action actProfileRemove;\r
 \r
-       private JButton btnProfileImport;\r
+       private Action actProfileBrowse;\r
 \r
-       private JButton btnProfileExport;\r
+       private Action actProfileImport;\r
+\r
+       private Action actProfileExport;\r
 \r
        /**\r
         * プロファイル一覧を表示するリストコンポーネント\r
@@ -233,51 +236,70 @@ public class ProfileSelectorDialog extends JDialog {
                characterListSP.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);\r
                pnlProfiles.add(characterListSP, BorderLayout.CENTER);\r
                \r
-               JPanel pnlProfileEditButtons = new JPanel();\r
-               pnlProfileEditButtons.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3));\r
-               GridBagLayout pnlProfileEditButtonsLayout = new GridBagLayout();\r
-               GridBagConstraints gbc = new GridBagConstraints();\r
-               pnlProfileEditButtons.setLayout(pnlProfileEditButtonsLayout);\r
-               \r
-               btnProfileNew = new JButton(new AbstractAction(strings.getProperty("profile.new")) {\r
+               actProfileNew = new AbstractAction(strings.getProperty("profile.new")) {\r
                        private static final long serialVersionUID = 1L;\r
                        public void actionPerformed(ActionEvent e) {\r
-                               boolean makeDefault = ((e.getModifiers() & ActionEvent.SHIFT_MASK) != 0);\r
-                               onProfileNew(makeDefault);\r
+                               onProfileNew(true);\r
                        }\r
-               });\r
-               btnProfileEdit = new JButton(new AbstractAction(strings.getProperty("profile.edit")) {\r
+               };\r
+\r
+               actProfileCopy = new AbstractAction(strings.getProperty("profile.copy")) {\r
+                       private static final long serialVersionUID = 1L;\r
+                       public void actionPerformed(ActionEvent e) {\r
+                               onProfileNew(false);\r
+                       }\r
+               };\r
+\r
+               actProfileEdit = new AbstractAction(strings.getProperty("profile.edit")) {\r
                        private static final long serialVersionUID = 1L;\r
                        public void actionPerformed(ActionEvent e) {\r
                                onProfileEdit();\r
                        }\r
-               });\r
-               btnProfileRemove = new JButton(new AbstractAction(strings.getProperty("profile.remove")) {\r
+               };\r
+\r
+               actProfileRemove = new AbstractAction(\r
+                               strings.getProperty("profile.remove")) {\r
                        private static final long serialVersionUID = 1L;\r
                        public void actionPerformed(ActionEvent e) {\r
                                onProfileRemove();\r
                        }\r
-               });\r
-               btnProfileBrowse = new JButton(new AbstractAction(strings.getProperty("profile.browse")) {\r
+               };\r
+\r
+               actProfileBrowse = new AbstractAction(\r
+                               strings.getProperty("profile.browse")) {\r
                        private static final long serialVersionUID = 1L;\r
                        public void actionPerformed(ActionEvent e) {\r
                                onProfileBrowse();\r
                        }\r
-               });\r
-               btnProfileImport = new JButton(new AbstractAction(strings.getProperty("profile.import")) {\r
+               };\r
+\r
+               actProfileImport = new AbstractAction(\r
+                               strings.getProperty("profile.import")) {\r
                        private static final long serialVersionUID = 1L;\r
                        public void actionPerformed(ActionEvent e) {\r
                                onProfileImport();\r
                        }\r
-               });\r
-               btnProfileExport = new JButton(new AbstractAction(strings.getProperty("profile.export")) {\r
+               };\r
+\r
+               actProfileExport = new AbstractAction(\r
+                               strings.getProperty("profile.export")) {\r
                        private static final long serialVersionUID = 1L;\r
                        public void actionPerformed(ActionEvent e) {\r
                                onProfileExport();\r
                        }\r
-               });\r
+               };\r
+\r
+               JButton btnProfileNew = new JButton(actProfileNew);\r
+               JButton btnProfileCopy = new JButton(actProfileCopy);\r
+               JButton btnProfileEdit = new JButton(actProfileEdit);\r
+               JButton btnProfileRemove = new JButton(actProfileRemove);\r
+               JButton btnProfileBrowse = new JButton(actProfileBrowse);\r
+               JButton btnProfileImport = new JButton(actProfileImport);\r
+               JButton btnProfileExport = new JButton(actProfileExport);\r
                \r
-               btnProfileNew.setToolTipText(strings.getProperty("profile.new.tooltip"));\r
+               JPanel pnlProfileEditButtons = new JPanel();\r
+               pnlProfileEditButtons.setLayout(new GridBagLayout());\r
+               GridBagConstraints gbc = new GridBagConstraints();\r
                \r
                gbc.gridx = 0;\r
                gbc.gridy = 0;\r
@@ -290,44 +312,46 @@ public class ProfileSelectorDialog extends JDialog {
                gbc.ipadx = 0;\r
                gbc.ipady = 0;\r
                gbc.insets = new Insets(0, 3, 0, 3);\r
-               pnlProfileEditButtons.add(btnProfileNew,gbc);\r
+               pnlProfileEditButtons.add(btnProfileNew, gbc);\r
 \r
                gbc.gridx = 0;\r
                gbc.gridy = 1;\r
-               pnlProfileEditButtons.add(btnProfileEdit, gbc);\r
+               pnlProfileEditButtons.add(btnProfileCopy, gbc);\r
 \r
                gbc.gridx = 0;\r
                gbc.gridy = 2;\r
-               pnlProfileEditButtons.add(btnProfileRemove, gbc);\r
+               pnlProfileEditButtons.add(btnProfileEdit, gbc);\r
 \r
                gbc.gridx = 0;\r
                gbc.gridy = 3;\r
+               pnlProfileEditButtons.add(btnProfileRemove, gbc);\r
+\r
+               gbc.gridx = 0;\r
+               gbc.gridy = 4;\r
                gbc.weighty = 1.;\r
                pnlProfileEditButtons.add(Box.createGlue(), gbc);\r
 \r
                gbc.gridx = 0;\r
-               gbc.gridy = 4;\r
+               gbc.gridy = 5;\r
                gbc.weighty = 0.;\r
                pnlProfileEditButtons.add(btnProfileBrowse, gbc);\r
                \r
                gbc.gridx = 0;\r
-               gbc.gridy = 5;\r
+               gbc.gridy = 6;\r
                gbc.weighty = 0.;\r
                pnlProfileEditButtons.add(btnProfileImport, gbc);\r
 \r
                gbc.gridx = 0;\r
-               gbc.gridy = 6;\r
+               gbc.gridy = 7;\r
                pnlProfileEditButtons.add(btnProfileExport, gbc);\r
-               \r
+\r
                JPanel pnlProfilesGroup = new JPanel(new BorderLayout());\r
                pnlProfilesGroup.setBorder(BorderFactory.createCompoundBorder(BorderFactory\r
                                .createEmptyBorder(3, 3, 3, 3), BorderFactory\r
                                .createTitledBorder(strings.getProperty("profiles"))));\r
                pnlProfilesGroup.add(pnlProfiles, BorderLayout.CENTER);\r
                pnlProfilesGroup.add(pnlProfileEditButtons, BorderLayout.EAST);\r
-               \r
 \r
-               \r
                JPanel infoPanel = new JPanel(new GridLayout(1, 2));\r
                JPanel descriptionPanel = new JPanel(new BorderLayout());\r
                descriptionPanel.setBorder(BorderFactory.createCompoundBorder(\r
@@ -487,17 +511,20 @@ public class ProfileSelectorDialog extends JDialog {
 \r
                btnOK.setEnabled(selected);\r
        \r
-               btnProfileNew.setEnabled(true);\r
-               btnProfileEdit.setEnabled(selected);\r
-               btnProfileRemove.setEnabled(selected && enableEdit);\r
-               btnProfileImport.setEnabled(true);\r
-               btnProfileExport.setEnabled(selected);\r
-               btnProfileBrowse.setEnabled(selected);\r
+               actProfileNew.setEnabled(true);\r
+               actProfileCopy.setEnabled(selected);\r
+               actProfileEdit.setEnabled(selected);\r
+               actProfileRemove.setEnabled(selected && enableEdit);\r
+               actProfileImport.setEnabled(true);\r
+               actProfileExport.setEnabled(selected);\r
+               actProfileBrowse.setEnabled(selected);\r
                \r
                if (enableEdit) {\r
-                       btnProfileEdit.setText(strings.getProperty("profile.edit"));\r
+                       actProfileEdit.putValue(Action.NAME,\r
+                                       strings.getProperty("profile.edit"));\r
                } else {\r
-                       btnProfileEdit.setText(strings.getProperty("profile.edit.readonly"));\r
+                       actProfileEdit.putValue(Action.NAME,\r
+                                       strings.getProperty("profile.edit.readonly"));\r
                }\r
                \r
                // 有効なキャラクターデータであり、且つ、書き込み可能であり、且つ、使用中でなければ削除可能\r
@@ -505,7 +532,7 @@ public class ProfileSelectorDialog extends JDialog {
                                && !ProfileListManager.isUsingCharacterData(characterData)\r
                                && characterData.canWrite();\r
 \r
-               btnProfileRemove.setEnabled(removable);\r
+               actProfileRemove.setEnabled(removable);\r
 \r
                boolean canWriteSamplePicture = false;\r
                BufferedImage sampleImage = null;\r