Browse Source

REPORT-134742 fix: 修改编码质量

fbp/release
lemon 2 months ago
parent
commit
479c60d0ac
  1. 19
      designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java

19
designer-base/src/main/java/com/fr/design/gui/date/UICalendarPanel.java

@ -556,16 +556,9 @@ public class UICalendarPanel extends JPanel {
panel.setOpaque(false); panel.setOpaque(false);
Insets insets = FineUIUtils.getUIInsets("InputTextField.borderInsets", defaultInsets); Insets insets = FineUIUtils.getUIInsets("InputTextField.borderInsets", defaultInsets);
field.setBorder(new ScaledEmptyBorder(insets.top, insets.left, insets.bottom, insets.right)); field.setBorder(new ScaledEmptyBorder(insets.top, insets.left, insets.bottom, insets.right));
UIButton preButton = createArrowButton(new LazyIcon("up_arrow", ICON_WIDTH)); UIButton preButton = createArrowButton(new LazyIcon("up_arrow", ICON_WIDTH));
UIButton nextButton = createArrowButton(new LazyIcon("down_arrow", ICON_WIDTH)); UIButton nextButton = createArrowButton(new LazyIcon("down_arrow", ICON_WIDTH));
JPanel arrowPane = new JPanel(); JPanel arrowPane = createArrowPane(preButton, nextButton);
arrowPane.setPreferredSize(createScaleDimension(12, 24));
arrowPane.setLayout(new GridLayout(2, 1));
arrowPane.add(preButton);
arrowPane.add(nextButton);
arrowPane.setOpaque(false);
panel.add(field, BorderLayout.CENTER); panel.add(field, BorderLayout.CENTER);
panel.add(arrowPane, BorderLayout.EAST); panel.add(arrowPane, BorderLayout.EAST);
panel.setBorder(new FineRoundBorder()); panel.setBorder(new FineRoundBorder());
@ -590,6 +583,16 @@ public class UICalendarPanel extends JPanel {
return panel; return panel;
} }
private JPanel createArrowPane(UIButton preButton, UIButton nextButton) {
JPanel arrowPane = new JPanel();
arrowPane.setPreferredSize(createScaleDimension(12, 24));
arrowPane.setLayout(new GridLayout(2, 1));
arrowPane.add(preButton);
arrowPane.add(nextButton);
arrowPane.setOpaque(false);
return arrowPane;
}
private UIButton createArrowButton(Icon icon) { private UIButton createArrowButton(Icon icon) {
UIButton arrowButton = new UIButton(icon) { UIButton arrowButton = new UIButton(icon) {
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {

Loading…
Cancel
Save