Browse Source

Pull request #5078: REPORT-55715 & REPORT-55658

Merge in DESIGN/design from ~STARRYI/design:bug-final/10.0 to final/10.0

* commit 'ca6a506c5ab2562fe06b1cd494962d116ffc7d6a':
  REPORT-55658 【稳定共创】组件设置-图表块标题图案-删除后再操作
  REPORT-55715 【组件背景分离】组件复用-颜色选择器和设计器里其他地方的颜色选择器不太一样,看起来有点奇怪
final/10.0
Kara 3 years ago
parent
commit
dc3b150447
  1. 16
      designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java
  2. 20
      designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java

16
designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java

@ -26,6 +26,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.backgroundpane.ImagePreviewPane; import com.fr.design.mainframe.backgroundpane.ImagePreviewPane;
import com.fr.design.style.background.image.ImageFileChooser; import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.env.utils.DesignerInteractionHistory; import com.fr.env.utils.DesignerInteractionHistory;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.general.Background; import com.fr.general.Background;
@ -85,7 +86,7 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
private UIObserverListener uiObserverListener; private UIObserverListener uiObserverListener;
private BorderLineAndImageComboBox borderLineCombo; private BorderLineAndImageComboBox borderLineCombo;
private UIColorButton borderColorPane; private NewColorSelectBox borderColorPane;
private ImagePreviewPane imagePreviewPane; private ImagePreviewPane imagePreviewPane;
private UIButton chooseImageButton; private UIButton chooseImageButton;
private UIButton tweakNinePointHelpButton; private UIButton tweakNinePointHelpButton;
@ -104,10 +105,7 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
private void initComponents() { private void initComponents() {
borderLineCombo = new BorderLineAndImageComboBox(); borderLineCombo = new BorderLineAndImageComboBox();
borderColorPane = new UIColorButton(null) {{ borderColorPane = new NewColorSelectBox(145);
setUI(createButtonUI(this));
set4ToolbarButton();
}};
imagePreviewPane = new ImagePreviewPane() {{ imagePreviewPane = new ImagePreviewPane() {{
setImageStyle(Style.DEFAULT_STYLE); setImageStyle(Style.DEFAULT_STYLE);
}}; }};
@ -228,7 +226,7 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
getComponent(2).setVisible(borderLineCombo.isSelectedBorderImage()); getComponent(2).setVisible(borderLineCombo.isSelectedBorderImage());
if (!borderLineCombo.isSelectedBorderLine()) { if (!borderLineCombo.isSelectedBorderLine()) {
borderColorPane.setColor(Color.BLACK); borderColorPane.setSelectObject(Color.BLACK);
} }
if (!borderLineCombo.isSelectedBorderImage()) { if (!borderLineCombo.isSelectedBorderImage()) {
imagePreviewPane.setImageWithSuffix(null); imagePreviewPane.setImageWithSuffix(null);
@ -294,7 +292,7 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
Color borderColor = style.getColor(); Color borderColor = style.getColor();
this.borderLineCombo.setSelectedLineStyle(borderLine); this.borderLineCombo.setSelectedLineStyle(borderLine);
this.borderColorPane.setColor(borderColor); this.borderColorPane.setSelectObject(borderColor);
Background borderImage = style.getBorderImage(); Background borderImage = style.getBorderImage();
if (borderImage instanceof ImageBackground) { if (borderImage instanceof ImageBackground) {
@ -332,13 +330,13 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
} }
this.borderLineCombo.setSelectedLineStyle(style.getBorder()); this.borderLineCombo.setSelectedLineStyle(style.getBorder());
this.borderColorPane.setColor(style.getColor()); this.borderColorPane.setSelectObject(style.getColor());
} }
public void updateBean(LayoutBorderStyle style) { public void updateBean(LayoutBorderStyle style) {
style.setBorder(this.borderLineCombo.getSelectedLineStyle()); style.setBorder(this.borderLineCombo.getSelectedLineStyle());
style.setColor(this.borderColorPane.getColor()); style.setColor(this.borderColorPane.getSelectObject());
style.setBorderImage(null); style.setBorderImage(null);
if (this.borderLineCombo.isSelectedBorderImage()) { if (this.borderLineCombo.isSelectedBorderImage()) {

20
designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java

@ -57,6 +57,7 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
private UIButton imageChooseButton; private UIButton imageChooseButton;
private UIButton imageDeleteButton; private UIButton imageDeleteButton;
private ImagePreviewPane imagePreviewPane; private ImagePreviewPane imagePreviewPane;
private JPanel imagePreviewOverlayPane;
private UIButtonGroup<Integer> imageLocationPane; private UIButtonGroup<Integer> imageLocationPane;
private UISpinner imagePaddingPane; private UISpinner imagePaddingPane;
@ -89,24 +90,24 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
deletableImagePreviewPane.setLayout(null); deletableImagePreviewPane.setLayout(null);
deletableImagePreviewPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5)); deletableImagePreviewPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 5));
deletableImagePreviewPane.setPreferredSize(new Dimension(IMAGE_PREVIEW_SIZE, IMAGE_PREVIEW_SIZE)); deletableImagePreviewPane.setPreferredSize(new Dimension(IMAGE_PREVIEW_SIZE, IMAGE_PREVIEW_SIZE));
JPanel overlayPane = new JPanel(); imagePreviewOverlayPane = new JPanel();
overlayPane.setPreferredSize(new Dimension(IMAGE_PREVIEW_SIZE - 2, IMAGE_PREVIEW_SIZE - 2)); imagePreviewOverlayPane.setPreferredSize(new Dimension(IMAGE_PREVIEW_SIZE - 2, IMAGE_PREVIEW_SIZE - 2));
overlayPane.setBackground(IMAGE_PREVIEW_OVERLAY_COLOR); imagePreviewOverlayPane.setBackground(IMAGE_PREVIEW_OVERLAY_COLOR);
imagePreviewPane.setBounds(0, 0, IMAGE_PREVIEW_SIZE, IMAGE_PREVIEW_SIZE); imagePreviewPane.setBounds(0, 0, IMAGE_PREVIEW_SIZE, IMAGE_PREVIEW_SIZE);
overlayPane.setBounds(1, 1, IMAGE_PREVIEW_SIZE - 2, IMAGE_PREVIEW_SIZE - 2); imagePreviewOverlayPane.setBounds(1, 1, IMAGE_PREVIEW_SIZE - 2, IMAGE_PREVIEW_SIZE - 2);
imageDeleteButton.setBounds(IMAGE_PREVIEW_SIZE - DELETE_BUTTON_SIZE, 0, DELETE_BUTTON_SIZE, DELETE_BUTTON_SIZE); imageDeleteButton.setBounds(IMAGE_PREVIEW_SIZE - DELETE_BUTTON_SIZE, 0, DELETE_BUTTON_SIZE, DELETE_BUTTON_SIZE);
deletableImagePreviewPane.add(imageDeleteButton, 0); deletableImagePreviewPane.add(imageDeleteButton, 0);
deletableImagePreviewPane.add(overlayPane, 1); deletableImagePreviewPane.add(imagePreviewOverlayPane, 1);
deletableImagePreviewPane.add(imagePreviewPane, 2); deletableImagePreviewPane.add(imagePreviewPane, 2);
overlayPane.setVisible(false); imagePreviewOverlayPane.setVisible(false);
imageDeleteButton.setVisible(false); imageDeleteButton.setVisible(false);
imageDeleteButton.setEnabled(false); imageDeleteButton.setEnabled(false);
deletableImagePreviewPane.addMouseListener(new MouseAdapter() { deletableImagePreviewPane.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
super.mouseEntered(e); super.mouseEntered(e);
overlayPane.setVisible(true); imagePreviewOverlayPane.setVisible(true);
imageDeleteButton.setVisible(true); imageDeleteButton.setVisible(true);
imageDeleteButton.setEnabled(true); imageDeleteButton.setEnabled(true);
} }
@ -117,7 +118,7 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
int x = e.getX(); int x = e.getX();
int y = e.getY(); int y = e.getY();
if (x <= 0 || getWidth() <= x || y <= 0 || y >= getHeight()) { if (x <= 0 || getWidth() <= x || y <= 0 || y >= getHeight()) {
overlayPane.setVisible(false); imagePreviewOverlayPane.setVisible(false);
imageDeleteButton.setVisible(false); imageDeleteButton.setVisible(false);
imageDeleteButton.setEnabled(false); imageDeleteButton.setEnabled(false);
} }
@ -216,6 +217,9 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
imagePreviewPane.setImageWithSuffix(null); imagePreviewPane.setImageWithSuffix(null);
imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX); imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX);
imagePaddingPane.setValue(DEFAULT_INSET_PADDING); imagePaddingPane.setValue(DEFAULT_INSET_PADDING);
imagePreviewOverlayPane.setVisible(false);
imageDeleteButton.setVisible(false);
imageDeleteButton.setEnabled(false);
getComponent(1).setVisible(false); getComponent(1).setVisible(false);
fireStateChanged(); fireStateChanged();

Loading…
Cancel
Save