Browse Source

fix: 调整规范问题

fbp/merge
lemon 4 months ago
parent
commit
d8dc0e6e38
  1. 22
      designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java

22
designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java

@ -130,21 +130,25 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
colorButtons.get(j).setLastButton(false);
panel.add(colorButtons.get(j));
}
if (i + maxCountOfRow > colorButtons.size() && colorButtons.size() != MAX_BUTTON) {
panel.add(new AddColorButton());
this.add(panel);
} else if (i + maxCountOfRow == colorButtons.size() && colorButtons.size() != MAX_BUTTON) {
this.add(panel);
this.add(new AddColorButton());
} else {
this.add(panel);
}
addPanel(panel, i);
}
if (colorButtons.size() == 1) {
colorButtons.get(0).setLastButton(true);
}
}
private void addPanel(JPanel panel, int index) {
if (index + maxCountOfRow > colorButtons.size() && colorButtons.size() != MAX_BUTTON) {
panel.add(new AddColorButton());
this.add(panel);
} else if (index + maxCountOfRow == colorButtons.size() && colorButtons.size() != MAX_BUTTON) {
this.add(panel);
this.add(new AddColorButton());
} else {
this.add(panel);
}
}
private void createColorButton(Color[] colors) {
colorButtons.clear();
int size = Math.min(colors.length, MAX_BUTTON);

Loading…
Cancel
Save