Browse Source

Merge branch 'release/11.0' of https://code.fineres.com/scm/~bruce.deng/design into feature/x

 Conflicts:
	designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
research/11.0
Bruce.Deng 3 years ago
parent
commit
6a0f6a4c1b
  1. 7
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  2. 11
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  3. 5
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java
  4. 39
      designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java
  5. 15
      designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java
  6. 15
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java
  7. 49
      designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java
  8. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java
  9. 3
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

7
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -10,6 +10,7 @@ import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.UILookAndFeel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.ui.util.UIUtil;
import com.fr.exit.DesignerExiter;
import com.fr.file.FileFILE;
import com.fr.general.ComparatorUtils;
@ -205,8 +206,14 @@ public class DesignUtils {
isMatch = isMatch || path.endsWith(suffix);
}
if (isMatch) {
// ui线程作为打开入口
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
DesignerContext.getDesignerFrame().openTemplate(new FileFILE(f));
}
});
}
}
}
reader.close();

11
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -363,8 +363,8 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
@Override
public RemoteDesignerWorkspaceInfo updateBean() {
String url = this.remoteWorkspaceURL.getURL();
String username = this.usernameInput.getText();
String url = removeSpaces(this.remoteWorkspaceURL.getURL());
String username = removeSpaces(this.usernameInput.getText());
String password = new String(this.passwordInput.getPassword());
boolean rememberPwd = this.rememberPwdCheckbox.isSelected();
DesignerEnvProcessor envProcessor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG);
@ -384,6 +384,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
return info;
}
private String removeSpaces(String str) {
if (StringUtils.isNotEmpty(str)) {
return str.trim();
}
return str;
}
@Override
protected String title4PopupWindow() {
return "Remote";

5
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java

@ -415,7 +415,10 @@ public class XWCardMainBorderLayout extends XWBorderLayout {
*/
@Override
public void firePropertyChange(){
return;
XWCardLayout cardLayout = this.getCardPart();
if (cardLayout != null && cardLayout.toData() != null) {
cardLayout.initStyle();
}
}

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

@ -98,13 +98,13 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
private int[] ninePoint = new int[] {-1, -1, -1, -1};
public BorderLineAndImagePane() {
this.initComponents();
public BorderLineAndImagePane(boolean supportBorderImage) {
this.initComponents(supportBorderImage);
this.initLayout();
}
private void initComponents() {
borderLineCombo = new BorderLineAndImageComboBox();
private void initComponents(boolean supportBorderImage) {
borderLineCombo = new BorderLineAndImageComboBox(supportBorderImage);
borderColorPane = new NewColorSelectBox(145);
imagePreviewPane = new ImagePreviewPane() {{
setImageStyle(Style.DEFAULT_STYLE);
@ -386,16 +386,25 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
protected static class BorderLineAndImageComboBox extends LineComboBox {
public static final int LINE_PICTURE = -1;
public final static int[] BORDER_LINE_STYLE_ARRAY = new int[] {
public final static int[] BORDER_LINE_AND_IMAGE_STYLE_ARRAY = new int[] {
Constants.LINE_NONE,
LINE_PICTURE,
Constants.LINE_THIN, //1px
Constants.LINE_MEDIUM, //2px
Constants.LINE_THICK, //3px
};
public final static int[] BORDER_LINE_STYLE_ARRAY = new int[] {
Constants.LINE_NONE,
Constants.LINE_THIN, //1px
Constants.LINE_MEDIUM, //2px
Constants.LINE_THICK, //3px
};
private boolean supportBorderImage = false;
public BorderLineAndImageComboBox() {
super(BORDER_LINE_STYLE_ARRAY);
public BorderLineAndImageComboBox(boolean supportBorderImage) {
super(supportBorderImage ? BORDER_LINE_AND_IMAGE_STYLE_ARRAY : BORDER_LINE_STYLE_ARRAY);
this.supportBorderImage = supportBorderImage;
}
@Override
@ -407,17 +416,29 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
}
public boolean isSelectedBorderLine() {
return getSelectedIndex() > 1;
Object object = getSelectedItem();
if (object != null) {
int value = (int) object;
return value > 0;
}
return false;
}
public boolean isSelectedBorderImage() {
return getSelectedIndex() == 1;
Object object = getSelectedItem();
if (object != null) {
int value = (int) object;
return value == LINE_PICTURE;
}
return false;
}
public void selectBorderImage() {
if (supportBorderImage) {
this.setSelectedIndex(1);
}
}
}
private class NinePointImageTweakDialogPane extends BasicPane {
public final NinePointLinePreviewPane previewPane = new NinePointLinePreviewPane();

15
designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java

@ -3,9 +3,7 @@
*/
package com.fr.design.gui.xpane;
import com.fr.form.ui.LayoutBorderStyle;
import javax.swing.*;
import javax.swing.JPanel;
/**
* CardTagLayoutBorderPane Pane.
@ -14,14 +12,13 @@ public class CardTagLayoutStylePane extends LayoutStylePane {
@Override
protected JPanel createTitleStylePane(){
return null;
JPanel panel = super.createTitleStylePane();
panel.setVisible(false);
return panel;
}
@Override
public void updateTitle(LayoutBorderStyle style) {
protected JPanel createBackgroundStylePane(boolean supportCornerRadius) {
return super.createBackgroundStylePane(false);
}
@Override
protected void populateTitle() { }
}

15
designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java

@ -88,7 +88,14 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
//标题背景透明度
protected UIPercentDragPane titleBackgroundOpacityPane;
private boolean supportBorderImage = false;
public LayoutStylePane() {
this(false);
}
public LayoutStylePane(boolean supportBorderImage) {
this.supportBorderImage = supportBorderImage;
this.initLayout();
}
@ -103,7 +110,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
JPanel titlePane = createTitleStylePane();
JPanel bodyContentPane = currentIsRootLayout ? createBodyContentPane4RootLayout() : createBodyContentPane();
JPanel backgroundPane = createBackgroundStylePane();
JPanel backgroundPane = createBackgroundStylePane(true);
if (titlePane != null) {
container.add(titlePane, BorderLayout.NORTH);
@ -128,14 +135,14 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
this.add(container, BorderLayout.CENTER);
}
protected JPanel createBackgroundStylePane() {
protected JPanel createBackgroundStylePane(boolean supportCornerRadius) {
borderStyleCombo = new UIComboBox(BORDER_STYLE);
borderLineAndImagePane = new BorderLineAndImagePane();
borderLineAndImagePane = new BorderLineAndImagePane(this.supportBorderImage);
cornerSpinner = new UISpinner(0,1000,1,0);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] rowSize = {p, p, p, p};
double[] rowSize = supportCornerRadius ? new double[] {p, p, p, p} : new double[]{p, p, p};
double[] columnSize = {SETTING_LABEL_WIDTH, f};
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget-Style_Background_Style"));

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

@ -35,7 +35,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.RoundRectangle2D;
/**
@ -96,14 +95,21 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
imagePreviewPane.setBounds(0, 0, IMAGE_PREVIEW_SIZE, IMAGE_PREVIEW_SIZE);
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);
deletableImagePreviewPane.add(imageDeleteButton, 0);
deletableImagePreviewPane.add(imagePreviewOverlayPane, 1);
deletableImagePreviewPane.add(imagePreviewPane, 2);
JPanel mousePane = new JPanel();
mousePane.setBounds(0, 0, IMAGE_PREVIEW_SIZE, IMAGE_PREVIEW_SIZE);
mousePane.setOpaque(false);
mousePane.setBackground(null);
deletableImagePreviewPane.add(mousePane, 0);
deletableImagePreviewPane.add(imageDeleteButton, 1);
deletableImagePreviewPane.add(imagePreviewOverlayPane, 2);
deletableImagePreviewPane.add(imagePreviewPane, 3);
imagePreviewOverlayPane.setVisible(false);
imageDeleteButton.setVisible(false);
imageDeleteButton.setEnabled(false);
deletableImagePreviewPane.addMouseListener(new MouseAdapter() {
mousePane.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
super.mouseEntered(e);
@ -119,6 +125,25 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
imageDeleteButton.setVisible(false);
imageDeleteButton.setEnabled(false);
}
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
int x = e.getX();
int y = e.getY();
Rectangle bounds = imageDeleteButton.getBounds();
if (bounds.x < x && x < bounds.x + bounds.width && bounds.y < y && y < bounds.y + bounds.height) {
imagePreviewPane.setImageWithSuffix(null);
imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX);
imagePaddingPane.setValue(DEFAULT_INSET_PADDING);
imagePreviewOverlayPane.setVisible(false);
imageDeleteButton.setVisible(false);
imageDeleteButton.setEnabled(false);
getComponent(1).setVisible(false);
fireStateChanged();
}
}
});
return TableLayoutHelper.createCommonTableLayoutPane(
@ -207,20 +232,6 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
}).dealWithImageFile(returnVal);
}
});
this.imageDeleteButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
imagePreviewPane.setImageWithSuffix(null);
imageLocationPane.setSelectedIndex(DEFAULT_INSET_LOCATION_INDEX);
imagePaddingPane.setValue(DEFAULT_INSET_PADDING);
imagePreviewOverlayPane.setVisible(false);
imageDeleteButton.setVisible(false);
imageDeleteButton.setEnabled(false);
getComponent(1).setVisible(false);
fireStateChanged();
}
});
}
public void populateBean(TitlePacker packer) {

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WTitleLayoutDefinePane.java

@ -27,7 +27,7 @@ public abstract class WTitleLayoutDefinePane<T extends AbstractBorderStyleWidget
public void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
stylePane = new LayoutStylePane();
stylePane = new LayoutStylePane(true);
advancePane.add(stylePane, BorderLayout.NORTH);
JPanel centerPane = createCenterPane();
if(centerPane!=null){

3
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -56,7 +56,6 @@ import com.fr.design.parameter.ParameterDefinitePane;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.preview.MobilePreview;
import com.fr.design.preview.NewWritePreview;
import com.fr.design.preview.PagePlusPreview;
import com.fr.design.preview.PagePreview;
import com.fr.design.preview.ViewPreview;
import com.fr.design.preview.WritePreview;
@ -929,7 +928,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
public PreviewProvider[] supportPreview() {
PreviewProvider[] templatePreviews = super.supportPreview();
return ArrayUtils.addAll(new PreviewProvider[]{
new PagePreview(), new WritePreview(), new ViewPreview(), new MobilePreview(), new PagePlusPreview(),new NewWritePreview()
new PagePreview(), new WritePreview(), new ViewPreview(), new MobilePreview(), new NewWritePreview()
}, templatePreviews);
}

Loading…
Cancel
Save