Browse Source

Merge pull request #5633 in DESIGN/design from release/11.0 to feature/x

* commit 'd61e68726613ff7d9f091cdedd90ec7fe2a70769':
  REPORT-58366 【主题切换】主题编辑界面-细节定制-组件样式、配色编辑 修改提示文字内容/字体/大小/颜色
  REPORT-55986 决策报表tap块 移动端属性国际化显示不全
  REPORT-57171 AF打不开
  无jira 加个切换时处理 防止工具栏残留
  REPORT-58296 调整参数面板高度消失问题
  CHART-20385【11.0】图例主题颜色控件展示异常
  REPORT-58159 组件编辑按钮-表单组件选中-设计器日志框无法置于设计器上方
  无jira 调整下日志等级
  REPORT-58260 组件包安装适配zip
  REPORT-58260 组件包安装适配zip
  CHART-20476 图表-超链悬浮窗代码回退
  REPORT-58270 新前端填报剥离插件
  REPORT-58270 新前端填报剥离插件
research/11.0
superman 3 years ago
parent
commit
c9592173d6
  1. 4
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java
  2. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/AsyncThemeFetcher.java
  3. 72
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java
  4. 25
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java
  5. 47
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java
  6. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java
  7. 39
      designer-base/src/main/java/com/fr/design/preview/NewWritePreview.java
  8. 10
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ColorSelectPaneWithOutTransparent.java
  9. 28
      designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java
  10. 6
      designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java
  11. 5
      designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java
  12. 2
      designer-form/src/main/java/com/fr/design/gui/xpane/LayoutStylePane.java
  13. 5
      designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java
  14. 11
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java
  15. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java
  16. 10
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  17. 21
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  18. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java
  19. 107
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java
  20. 2
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  21. 1
      designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java

4
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java

@ -88,4 +88,8 @@ public class LogMessageBar extends JPanel {
}
THIS = null;
}
public JFrame getLogFrame() {
return dlg;
}
}

7
designer-base/src/main/java/com/fr/design/mainframe/theme/AsyncThemeFetcher.java

@ -5,6 +5,7 @@ import com.fr.base.theme.TemplateThemeConfig;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.module.ModuleContext;
import javax.swing.SwingUtilities;
import java.util.concurrent.ExecutorService;
/**
@ -48,8 +49,14 @@ public class AsyncThemeFetcher<T extends TemplateTheme> {
return;
}
if (callback != null) {
// 后续任务不要在工作线程中执行,从而确保只在EDT线程操作UI
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
callback.afterCachedFetch(theme);
}
});
}
}
});
}

72
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java

@ -16,7 +16,6 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
@ -27,10 +26,10 @@ import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.concurrent.ExecutorService;
/**
* @author Starryi
@ -51,7 +50,7 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
private final Icon profileIcon = IOUtils.readIcon("/com/fr/design/icon/icon_edit.png");
private final boolean displayTheme4NewTemplateMarker;
private UILabel thumbnailLabel;
private final ThumbnailPane thumbnailPane;
// UIButton会影响Block的手势监听,这里使用UILabel代替,点击事件也有Block代为处理
private UILabel profileButton;
private boolean selected = false;
@ -67,6 +66,7 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker;
this.config = config;
this.profilePane = profilePane;
this.thumbnailPane = new ThumbnailPane();
initializePane();
addMouseListener(new MouseAdapter() {
@ -100,8 +100,8 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
setPreferredSize(new Dimension(getPreferredSize().width, HEIGHT));
setBackground(Color.WHITE);
thumbnailLabel = new UILabel();
thumbnailLabel.setPreferredSize(new Dimension(getPreferredSize().width, THUMBNAIL_HEIGHT));
thumbnailPane.setBackground(Color.WHITE);
thumbnailPane.setPreferredSize(new Dimension(getPreferredSize().width, THUMBNAIL_HEIGHT));
JPanel infoPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
infoPane.setBackground(Color.WHITE);
@ -115,23 +115,20 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
addProfileButton(infoPane);
}
add(thumbnailLabel, BorderLayout.CENTER);
add(thumbnailPane, BorderLayout.CENTER);
add(infoPane, BorderLayout.SOUTH);
}
public void setTheme(T theme) {
this.theme = theme;
thumbnailLabel.setIcon(null);
Image image = null;
if (theme != null) {
ThemeThumbnail thumbnail = theme.getThumbnail();
if (thumbnail != null) {
Image image = thumbnail.getImage();
if (image != null) {
thumbnailLabel.setIcon(new ImageIcon(image));
image = thumbnail.getImage();
}
}
}
repaint();
thumbnailPane.setThumbnail(image);
}
public T getTheme() {
@ -158,7 +155,7 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
int y = e.getY();
int profileButtonX = profileButton.getX();
int profileButtonY = thumbnailLabel.getHeight() + profileButton.getY();
int profileButtonY = thumbnailPane.getHeight() + profileButton.getY();
boolean inX = profileButtonX <= x && x <= profileButtonX + profileButton.getWidth();
boolean inY = profileButtonY <= y && y <= profileButtonY + profileButton.getHeight();
@ -205,4 +202,53 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
GraphHelper.draw(g, rectangle, Constants.LINE_MEDIUM);
}
}
private static class ThumbnailPane extends JPanel {
private static final Image LOADING_IMAGE = Toolkit.getDefaultToolkit().createImage(ThumbnailPane.class.getResource("/com/fr/design/images/mainframe/loading.gif"));
private Image thumbnail = null;
@Override
public void paint(Graphics g) {
super.paint(g);
Graphics2D g2d = (Graphics2D) g;
paintCenterImage(g2d, thumbnail != null ? thumbnail : LOADING_IMAGE);
}
private void paintCenterImage(Graphics2D g2d, Image image) {
if (image == null) {
return;
}
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
int width = getWidth();
int height = getHeight();
int imgWidth = image.getWidth(null);
int imgHeight = image.getHeight(null);
if (width <= 0 || height <= 0 || imgWidth <= 0 || imgHeight <= 0) {
return;
}
float imgAspect = 1.0F * imgWidth / imgHeight;
if (1.0F * width / height > 1.0F * imgWidth / imgHeight) {
imgHeight = height;
imgWidth = (int) (1.0F * imgHeight * imgAspect);
} else {
imgWidth = width;
imgHeight = (int) (1.0F * imgWidth / imgAspect);
}
int x = (width - imgWidth) / 2;
int y = (height - imgHeight) / 2;
g2d.drawImage(image, x, y, imgWidth, imgHeight, null);
}
public void setThumbnail(Image thumbnail) {
this.thumbnail = thumbnail;
invalidate();
repaint();
}
}
}

25
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java

@ -17,11 +17,13 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog;
import com.fr.design.mainframe.theme.edit.CellStyleListEditPane;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.transaction.CallBackAdaptor;
import com.fr.transaction.Configurations;
import com.fr.transaction.WorkerFacade;
@ -45,6 +47,8 @@ import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fr.design.i18n.Toolkit.i18nText;
/**
* @author Starryi
* @version 1.0
@ -172,7 +176,16 @@ public class TemplateThemeManagePane<T extends TemplateTheme> extends BasicPane
public void actionPerformed(ActionEvent e) {
T theme = themeListPane.getSelectedTheme();
if (theme != null) {
config.setThemeName4NewTemplate(theme.getName());
config.setThemeName4NewTemplate(theme.getName(), new CallBackAdaptor() {
@Override
public void afterRollback() {
super.afterRollback();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TemplateThemeManagePane.this),
i18nText("Fine-Design_Basic_Template_Theme_Operation_Failed_Tip"),
i18nText("Fine-Design_Basic_Alert"),
JOptionPane.WARNING_MESSAGE);
}
});
}
}
});
@ -221,10 +234,14 @@ public class TemplateThemeManagePane<T extends TemplateTheme> extends BasicPane
Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Delete_Tip", theme.getName()),
Toolkit.i18nText("Fine-Design_Basic_Delete"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (result == JOptionPane.YES_OPTION) {
Configurations.modify(new WorkerFacade(config.getClass()) {
config.removeTheme(theme.getName(), new CallBackAdaptor() {
@Override
public void run() {
config.removeTheme(theme.getName());
public void afterRollback() {
super.afterRollback();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TemplateThemeManagePane.this),
i18nText("Fine-Design_Basic_Template_Theme_Operation_Failed_Tip"),
i18nText("Fine-Design_Basic_Alert"),
JOptionPane.WARNING_MESSAGE);
}
});
}

47
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

@ -7,6 +7,7 @@ import com.fr.base.theme.settings.ThemeThumbnail;
import com.fr.base.theme.settings.ThemedCellStyleList;
import com.fr.base.theme.settings.ThemedChartStyle;
import com.fr.base.theme.settings.ThemedColorScheme;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UITabbedPane;
@ -34,7 +35,9 @@ import com.fr.transaction.WorkerFacade;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
@ -51,6 +54,8 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.List;
import static com.fr.design.i18n.Toolkit.i18nText;
/**
* @author Starryi
* @version 1.0
@ -238,9 +243,12 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
JPanel previewLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewLabelPane.add(LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Preview_Label")), BorderLayout.NORTH);
UILabel tipLabel = LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Edit_Tip"), new Color(153, 153, 153));
tipLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
JPanel content = TableLayoutHelper.createGapTableLayoutPane(new JComponent[][]{
{LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Edit_Label")), colorListPane},
{null, LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Edit_Tip"), new Color(0XC6C6C6), 10)},
{null, tipLabel},
{previewLabelPane, extendedContainer},
},
rowSize, columnSize, 18, 7);
@ -384,12 +392,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
boolean canBeSaved = checkThemeCanBeSavedAndUpdateUI(currentIsNewTheme, nameTextField, nameErrorLabel, saveButton);
if (canBeSaved && theme != null) {
theme.setName(nameTextField.getText());
Configurations.modify(new WorkerFacade(config.getClass()) {
@Override
public void run() {
config.addTheme(theme, true);
}
}.addCallBack(new CallBackAdaptor() {
config.addTheme(theme, true, new CallBackAdaptor() {
@Override
public void afterCommit() {
super.afterCommit();
@ -397,7 +400,16 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
nameTextField.setEnabled(false);
saveAsButton.setEnabled(true);
}
}));
@Override
public void afterRollback() {
super.afterRollback();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TemplateThemeProfilePane.this),
i18nText("Fine-Design_Basic_Template_Theme_Operation_Failed_Tip"),
i18nText("Fine-Design_Basic_Alert"),
JOptionPane.WARNING_MESSAGE);
}
});
}
}
});
@ -540,20 +552,23 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
newThemeObject.setName(name);
newThemeObject.setRemovable(true);
newThemeObject.setMutable(true);
T finalNewThemeObject = newThemeObject;
Configurations.modify(new WorkerFacade(config.getClass()) {
@Override
public void run() {
config.addTheme(finalNewThemeObject, true);
}
}.addCallBack(new CallBackAdaptor() {
config.addTheme(newThemeObject, true, new CallBackAdaptor() {
@Override
public void afterCommit() {
super.afterCommit();
exit();
parent.exit();
}
}));
@Override
public void afterRollback() {
super.afterRollback();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TemplateThemeProfilePane.this),
i18nText("Fine-Design_Basic_Template_Theme_Operation_Failed_Tip"),
i18nText("Fine-Design_Basic_Alert"),
JOptionPane.WARNING_MESSAGE);
}
});
}
}

4
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java

@ -45,7 +45,7 @@ public class ComponentStyleEditPane extends JPanel {
new String[] {
Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Title"),
Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Body"),
Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Background")
Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Integral")
},
new JComponent[] { createTabContainer(componentTitleStylePane), createTabContainer(componentBodyStylePane), createTabContainer(componentIntegralStylePane) }
);
@ -119,7 +119,7 @@ public class ComponentStyleEditPane extends JPanel {
JPanel tipLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
tipLabelPane.setBorder(BorderFactory.createEmptyBorder(3, 0, 0, 0));
UILabel tipLabel = LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Style_Tip"), new Color(0XC6C6C6), 10);
UILabel tipLabel = LabelUtils.createLabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Component_Style_Tip"), new Color(153, 153, 153));
tipLabelPane.add(tipLabel);
container.add(tipLabelPane, BorderLayout.NORTH);

39
designer-base/src/main/java/com/fr/design/preview/NewWritePreview.java

@ -1,39 +0,0 @@
package com.fr.design.preview;
import com.fr.design.fun.impl.AbstractPreviewProvider;
import java.util.HashMap;
import java.util.Map;
/**
* 新前端填报预览
* by abel 2021/07/08
*/
public class NewWritePreview extends AbstractPreviewProvider {
@Override
public String nameForPopupItem() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Write_New_Preview");
}
@Override
public String iconPathForPopupItem() {
return "com/fr/design/images/buttonicon/writes.png";
}
@Override
public String iconPathForLarge() {
return "com/fr/design/images/buttonicon/writeb24.png";
}
@Override
public int previewTypeCode() {
return 99;
}
@Override
public Map<String, Object> parametersForPreview() {
Map<String, Object> map = new HashMap<String, Object>();
map.put("op", "write_new");
return map;
}
}

10
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ColorSelectPaneWithOutTransparent.java

@ -3,8 +3,7 @@ package com.fr.design.mainframe.chart.gui;
import com.fr.chart.base.ChartConstants;
import com.fr.design.style.color.NewColorSelectPane;
import javax.swing.*;
import java.awt.*;
import java.awt.Color;
/**
* Created by Fangjie on 2016/4/8.
@ -19,11 +18,4 @@ public class ColorSelectPaneWithOutTransparent extends NewColorSelectPane {
return ChartConstants.MAP_COLOR_ARRAY;
}
protected JPanel getMenuColorPane() {
JPanel menuColorPane = new JPanel();
menuColorPane.setLayout(new GridLayout(0, 8, 1, 1));
menuColorPane.setBorder(BorderFactory.createEmptyBorder(8, 8, 0, 8));
return menuColorPane;
}
}

28
designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java

@ -58,21 +58,26 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup {
if (template == null) {
return false;
}
if (template.isJWorkBook() || DesignModeContext.isDuchampMode()) {
// 如果是普通报表单元格,那么没有 FormHyperlink 选项
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
//返回true表示可用,返回false表示不可用
return !ComparatorUtils.equals(clazz, formHyperlink.getClass());
} else {
// 如果是决策报表
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
for (Class aClass : classes) {
if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) {
// 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
return !ArrayUtils.contains(classes, clazz);
if (ComparatorUtils.equals(aClass, clazz)) {
return false;
}
} else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) {
// 编辑的是决策报表中的报表块,那么没有 ChartHyperPoplink 和 ChartHyperRelateFloatLink
Class[] classes = new Class[]{ChartHyperPoplink.class, ChartHyperRelateFloatLink.class};
return !ArrayUtils.contains(classes, clazz);
// 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项
return !ComparatorUtils.equals(clazz, ChartHyperRelateFloatLink.class);
}
}
}
return true;
@ -96,14 +101,17 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup {
return !ComparatorUtils.equals(object.getClass(), formHyperlink.getClass());
} else {
// 如果是决策报表
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
for (Class aClass : classes) {
if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) {
// 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项
Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class};
return !ArrayUtils.contains(classes, object.getClass());
if (ComparatorUtils.equals(aClass, object.getClass())) {
return false;
}
} else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) {
// 编辑的是决策报表中的报表块,那么没有 ChartHyperPoplink 和 ChartHyperRelateFloatLink
Class[] classes = new Class[]{ChartHyperPoplink.class, ChartHyperRelateFloatLink.class};
return !ArrayUtils.contains(classes, object.getClass());
// 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项
return !ComparatorUtils.equals(object.getClass(), ChartHyperRelateFloatLink.class);
}
}
}
return true;

6
designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java

@ -23,6 +23,7 @@ import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.NoSupportAuthorityEdit;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.loghandler.LogMessageBar;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.Widget;
@ -33,6 +34,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.border.Border;
@ -776,6 +778,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
if (popup == null) {
popup = new SelectedPopupDialog(this, designer);
}
JFrame frame = LogMessageBar.getInstance().getLogFrame();
if (frame!= null && frame.isActive()) {
return;
}
int creatorRightX = (int) ((bounds.x + bounds.width + SelectedPopupDialog.OFFSET_X) * designer.getScale());
int creatorRightY = (int) (bounds.y * designer.getScale());
int formDesignerWidth = designer.getWidth();

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

@ -108,11 +108,6 @@ public class XWParameterLayout extends XWAbsoluteLayout {
return false;
}
@Override
public boolean canEnterIntoAdaptPane() {
return false;
}
/**
* 该组件是否可以拖拽(表单中参数面板和自适应布局不可以拖拽)
* @return 是则返回true

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

@ -97,7 +97,7 @@ public class LayoutStylePane extends BasicBeanPane<LayoutBorderStyle> {
return null;
}
this.integralStylePane = new ComponentIntegralStylePane(SETTING_LABEL_WIDTH, supportBorderImage, supportCornerRadius);
return this.createNamedSubStylePane(i18nText("Fine-Design_Form_Widget-Style_Background_Style"), this.integralStylePane);
return this.createNamedSubStylePane(i18nText("Fine-Design_Form_Widget-Style_Integral_Style"), this.integralStylePane);
}
protected JPanel createNamedSubStylePane(String name, JPanel stylePane) {

5
designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java

@ -120,7 +120,7 @@ public class InstallComponentAction extends UpdateAction {
private boolean containRues(File[] chosenFiles) {
for (File file : chosenFiles) {
if (file.getName().endsWith(ReuxUtils.REUS_SUFFIX))
if (ReuxUtils.isReusFile(file))
return true;
}
return false;
@ -142,8 +142,7 @@ public class InstallComponentAction extends UpdateAction {
return false;
}
ShareComponentUtils.checkReadMe();
boolean isReus = chosenFile.getName().endsWith(ReuxUtils.REUS_SUFFIX);
return isReus ? InstallUtils.installReusFile(chosenFile, installTime, failList) : InstallUtils.installReuFile(chosenFile, installTime, failList);
return ReuxUtils.isReusFile(chosenFile) ? InstallUtils.installReusFile(chosenFile, installTime, failList) : InstallUtils.installReuFile(chosenFile, installTime, failList);
}
private static class InstallBackInfo {

11
designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java

@ -84,7 +84,7 @@ public class InstallUtils {
@Nullable
private static Group createComponentGroup(String fileName) {
String groupName = fileName.substring(0, fileName.indexOf(DOT + ReuxUtils.REUS_SUFFIX));
String groupName = createGroupName(fileName);
//有重名分组则加后缀
if (DefaultShareGroupManager.getInstance().getGroup(groupName) != null) {
@ -101,6 +101,15 @@ public class InstallUtils {
return DefaultShareGroupManager.getInstance().getGroup(groupName);
}
private static String createGroupName(String fileName) {
for (String suffix : ReuxUtils.SUPPORT_REUS_SUFFIX) {
if (fileName.endsWith(suffix)) {
return fileName.substring(0, fileName.indexOf(DOT + suffix));
}
}
return fileName;
}
private static boolean installReuFile(Group group, File chosenFile, long installTime) {
try {
if (!group.installModule(chosenFile)) {

4
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/TabMobileWidgetDefinePane.java

@ -46,7 +46,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
public TabMobileWidgetDefinePane(XCreator xCreator) {
this.xCreator = xCreator;
contentJPanel = FRGUIPaneFactory.createCenterFlowZeroGapBorderPane();
contentJPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
scrollPane = new AttrScrollPane() {
@Override
protected JPanel createContentPane() {
@ -117,7 +117,7 @@ public class TabMobileWidgetDefinePane extends MobileWidgetDefinePane {
//高级
holder.add(advancePane, BorderLayout.CENTER);
contentJPanel.add(holder, BorderLayout.CENTER);
contentJPanel.add(holder, BorderLayout.NORTH);
this.add(scrollPane, BorderLayout.CENTER);
}

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

@ -62,7 +62,6 @@ import com.fr.design.module.DesignModuleFactory;
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.PagePreview;
import com.fr.design.preview.ViewPreview;
import com.fr.design.preview.WritePreview;
@ -152,6 +151,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
super(workBook, fileName);
populateReportParameterAttr();
}
public JWorkBook(WorkBook workBook, FILE file, Parameter[] parameters) {
super(workBook, file, parameters);
populateReportParameterAttr();
@ -510,7 +510,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
double creatorWidth = blockCreator.getEditorBounds().width;
double areaHeight = polyDezi.polyArea.getHeight();
double areaWidth = polyDezi.polyArea.getWidth();
if(AssistUtils.equals(creatorWidth,0) || AssistUtils.equals(creatorHeight,0)){
if (AssistUtils.equals(creatorWidth, 0) || AssistUtils.equals(creatorHeight, 0)) {
return resolution;
}
double time = (areaHeight / creatorHeight) < (areaWidth / creatorWidth) ? (areaHeight / creatorHeight) : (areaWidth / creatorWidth);
@ -527,7 +527,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
int row = reportPane.getSelection().getSelectedRows()[0];
double rowLength = reportPane.getSelection().getSelectedRows().length;
double rowExtent = reportPane.getGrid().getVerticalExtent();
if(AssistUtils.equals(columnLength,0) || AssistUtils.equals(rowLength,0)){
if (AssistUtils.equals(columnLength, 0) || AssistUtils.equals(rowLength, 0)) {
return resolution;
}
double time = (columnExtent / columnLength) < (rowExtent / rowLength) ? (columnExtent / columnLength) : (rowExtent / rowLength);
@ -950,7 +950,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 NewWritePreview()
new PagePreview(), new WritePreview(), new ViewPreview(), new MobilePreview()
}, templatePreviews);
}
@ -1233,7 +1233,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
addExtraChooseFILEFilter(fileChooser);
}
protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){
protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser) {
Set<ReportSupportedFileUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG);
for (ReportSupportedFileUIProvider provider : providers) {
provider.addChooseFileFilter(fileChooser, this.suffix());

21
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -57,8 +57,6 @@ import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.Timer;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Color;
@ -242,21 +240,28 @@ public class AlphaFineDialog extends UIDialog {
if (hotData == null) {
hotData = HotIssuesManager.getInstance().getHotIssues();
}
for (int i = 0; i < hotData.length; i++) {
panel.add(new HotIssueJpanel(hotData[i], i + 1));
}
} else {
hotData = null;
for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) {
panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1));
}
}
initHotPane(panel, hotData);
hotPane.add(uiLabel, BorderLayout.NORTH);
hotPane.add(panel, BorderLayout.CENTER);
add(hotPane, BorderLayout.SOUTH);
setSize(AlphaFineConstants.FULL_SIZE);
}
private void initHotPane(JPanel panel, String[][] hotData) {
if (hotData == null) {
for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) {
panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1));
}
} else {
for (int i = 0; i < hotData.length; i++) {
panel.add(new HotIssueJpanel(hotData[i], i + 1));
}
}
}
/**
* 初始化输入框
*/

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/HotIssuesManager.java

@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jetbrains.annotations.Nullable;
/**
@ -71,6 +72,7 @@ public class HotIssuesManager {
* 从热门问题接口获取热门问题
* @return
*/
@Nullable
public String[][] getHotIssues() {
try {
@ -84,7 +86,7 @@ public class HotIssuesManager {
}
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error("hotissues search error: " + e.getMessage());
FineLoggerFactory.getLogger().error("hotissues search error: " + e.getMessage(), e);
return null;
}
return data;

107
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java

@ -7,18 +7,20 @@ import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedCellStyle;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListCellRenderer;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
@ -28,52 +30,21 @@ import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.Serializable;
import java.util.List;
public class ThemedCellStyleListPane extends FurtherBasicBeanPane<NameStyle> implements DesignerBean {
private static final int LEFT_BORDER = 10;
private static final int RIGHT_BORDER = 10;
private DefaultListModel<NameStyle> defaultListModel;
private JList<NameStyle> styleList;
private final DefaultListModel<NameStyle> defaultListModel;
private final JList<NameStyle> styleList;
private ChangeListener changeListener;
public ThemedCellStyleListPane() {
defaultListModel = new DefaultListModel<>();
styleList = new JList<>(defaultListModel);
DefaultListCellRenderer render = new DefaultListCellRenderer() {
private Style nameStyle;
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Style) {
this.nameStyle = (Style) value;
this.setText(" ");
}
this.setPreferredSize(new Dimension(210, 22));
return this;
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if (nameStyle == null) {
return;
}
String text = "abcedfgh";
if (nameStyle instanceof NameStyle) {
text = ((NameStyle) nameStyle).getName();
}
Style.paintBackground((Graphics2D) g, nameStyle, getWidth() - 1, getHeight() - 1);
Style.paintContent((Graphics2D) g, text, nameStyle, getWidth() - 1, getHeight() - 1, ScreenResolution.getScreenResolution());
Style.paintBorder((Graphics2D) g, nameStyle, getWidth() - 1, getHeight() - 1);
}
};
styleList.setCellRenderer(render);
styleList.setCellRenderer(new RadioButtonListCellRenderer());
setLayout(FRGUIPaneFactory.createBorderLayout());
add(styleList, BorderLayout.CENTER);
setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));
@ -167,4 +138,66 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane<NameStyle> imp
styleList.setModel(defaultListModel);
}
private static class RadioButtonListCellRenderer extends JPanel implements ListCellRenderer<Object>, Serializable {
private final UIRadioButton button;
private final PreviewArea previewArea;
public RadioButtonListCellRenderer() {
super();
setLayout(new BorderLayout(20, 0));
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
setPreferredSize(new Dimension(getPreferredSize().width, 40));
button = new UIRadioButton();
previewArea = new PreviewArea();
add(button, BorderLayout.WEST);
add(previewArea, BorderLayout.CENTER);
}
@Override
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
button.setSelected(isSelected);
previewArea.setStyle((Style) value);
return this;
}
}
private static class PreviewArea extends JComponent {
private String paintText = "Report";
private Style style = Style.DEFAULT_STYLE;
public void setStyle(Style style) {
this.style = style;
if (style instanceof NameStyle) {
paintText = ((NameStyle) style).getName();
}
repaint();
}
@Override
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
int resolution = ScreenResolution.getScreenResolution();
g.clipRect(0, 0, getWidth() - 3, getHeight() - 3);
if (style == Style.DEFAULT_STYLE) {
// 如果是默认的style,就只写"Report"上去
Style.paintContent(g2d, paintText, style, getWidth() - 3, getHeight() - 3, resolution);
return;
}
Style.paintBackground(g2d, style, getWidth() - 3, getHeight() - 3);
Style.paintContent(g2d, paintText, style, getWidth() - 3, getHeight() - 3, resolution);
Style.paintBorder(g2d, style, getWidth() - 3, getHeight() - 3);
}
@Override
public Dimension getMinimumSize() {
return getPreferredSize();
}
}
}

2
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -173,7 +173,7 @@ public class DesignerSocketIO {
RemoteDesignConstants.USER_LOCK_ID,
connection.getId());
}
FineLoggerFactory.getLogger().error("Available ports: {}, current Protocol: {}", Arrays.toString(ports), currentProtocol);
FineLoggerFactory.getLogger().info("Available ports: {}, current Protocol: {}", Arrays.toString(ports), currentProtocol);
return result;
}

1
designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceActivator.java

@ -53,6 +53,7 @@ public class DesignerWorkspaceActivator extends Activator {
public void on(Event event, Workspace workspace) {
PluginClassRefreshManager.getInstance().removePluginListener();
HistoryTemplateListCache.getInstance().stash();
PluginClassRefreshManager.getInstance().fireTabChange();
}
});

Loading…
Cancel
Save