X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fcharactermanaj%2Fui%2FPartsRandomChooserDialog.java;fp=src%2Fmain%2Fjava%2Fcharactermanaj%2Fui%2FPartsRandomChooserDialog.java;h=8aab86b5bd97bbf50e3e127239173d5773057b3c;hb=c2f484e8955f938c47c7c23e72f16ccbe494563f;hp=f513eca9d40a7601b5f4af441dfd6fe9fcde2858;hpb=21cee78598a66c59a913536befbf62ebaf1cf5d7;p=charactermanaj%2FCharacterManaJ.git diff --git a/src/main/java/charactermanaj/ui/PartsRandomChooserDialog.java b/src/main/java/charactermanaj/ui/PartsRandomChooserDialog.java index f513eca..8aab86b 100644 --- a/src/main/java/charactermanaj/ui/PartsRandomChooserDialog.java +++ b/src/main/java/charactermanaj/ui/PartsRandomChooserDialog.java @@ -47,6 +47,7 @@ import charactermanaj.model.CharacterData; import charactermanaj.model.PartsCategory; import charactermanaj.model.PartsIdentifier; import charactermanaj.model.PartsSet; +import charactermanaj.ui.util.ScaleSupport; import charactermanaj.util.LocalizedResourcePropertyLoader; /** @@ -195,6 +196,8 @@ public class PartsRandomChooserDialog extends JDialog { setTitle(strings.getProperty("partsRandomChooser")); + ScaleSupport scaleSupport = ScaleSupport.getInstance(this); + Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); @@ -232,7 +235,8 @@ public class PartsRandomChooserDialog extends JDialog { int idx = centerPnl.getComponentCount(); RandomChooserPanel pnl = addPartsChooserPanel(centerPnl, idx, category, lastInCategory, - changePartsIdentifierListener); + changePartsIdentifierListener, + scaleSupport); // 未選択の場合、もしくは複数選択カテゴリの場合はランダムはディセーブルとする pnl.setEnableRandom(enable @@ -290,7 +294,8 @@ public class PartsRandomChooserDialog extends JDialog { JButton btnBack = new JButton(actBack); Box btnPanel = Box.createHorizontalBox(); - btnPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 42)); + int mergin = (int)(5 * scaleSupport.getManualScaleX()); + btnPanel.setBorder(BorderFactory.createEmptyBorder(mergin, mergin, mergin, mergin * 8)); // 5, 5, 5, 40 btnPanel.add(btnRandomAll); btnPanel.add(btnBack); @@ -493,16 +498,18 @@ public class PartsRandomChooserDialog extends JDialog { private JToggleButton btnReject; public RandomChooserPanel(final PartsCategory category, - final boolean lastInCategory) { + final boolean lastInCategory, + final ScaleSupport scaleSupport) { Properties strings = LocalizedResourcePropertyLoader .getCachedInstance().getLocalizedProperties( STRINGS_RESOURCE); + int gap = (int)(3 * scaleSupport.getManualScaleX()); setBorder(BorderFactory.createCompoundBorder( - BorderFactory.createEmptyBorder(3, 3, 3, 3), + BorderFactory.createEmptyBorder(gap, gap, gap, gap), BorderFactory.createCompoundBorder( BorderFactory.createEtchedBorder(), - BorderFactory.createEmptyBorder(3, 3, 3, 3)))); + BorderFactory.createEmptyBorder(gap, gap, gap, gap)))); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); @@ -696,9 +703,10 @@ public class PartsRandomChooserDialog extends JDialog { final int addPos, final PartsCategory category, final boolean lastInCategory, - final ActionListener changePartsIdentifierListener) { + final ActionListener changePartsIdentifierListener, + final ScaleSupport scaleSupport) { RandomChooserPanel pnl = new RandomChooserPanel(category, - lastInCategory) { + lastInCategory, scaleSupport) { private static final long serialVersionUID = 1L; @Override @@ -709,7 +717,8 @@ public class PartsRandomChooserDialog extends JDialog { if (comp.equals(this)) { // 同じカテゴリのものを追加する addPartsChooserPanel(centerPnl, idx + 1, category, - lastInCategory, changePartsIdentifierListener); + lastInCategory, changePartsIdentifierListener, + scaleSupport); centerPnl.validate(); // Addボタンを非表示にする. ((JButton) e.getSource()).setVisible(false);