import charactermanaj.model.PartsCategory;
import charactermanaj.model.PartsIdentifier;
import charactermanaj.model.PartsSet;
+import charactermanaj.ui.util.ScaleSupport;
import charactermanaj.util.LocalizedResourcePropertyLoader;
/**
setTitle(strings.getProperty("partsRandomChooser"));
+ ScaleSupport scaleSupport = ScaleSupport.getInstance(this);
+
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
int idx = centerPnl.getComponentCount();
RandomChooserPanel pnl = addPartsChooserPanel(centerPnl,
idx, category, lastInCategory,
- changePartsIdentifierListener);
+ changePartsIdentifierListener,
+ scaleSupport);
// 未選択の場合、もしくは複数選択カテゴリの場合はランダムはディセーブルとする
pnl.setEnableRandom(enable
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);
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();
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
if (comp.equals(this)) {
// 同じカテゴリのものを追加する
addPartsChooserPanel(centerPnl, idx + 1, category,
- lastInCategory, changePartsIdentifierListener);
+ lastInCategory, changePartsIdentifierListener,
+ scaleSupport);
centerPnl.validate();
// Addボタンを非表示にする.
((JButton) e.getSource()).setVisible(false);