Browse Source

无jira 解决冲突

research/11.0
hades 3 years ago
parent
commit
7835538c08
  1. 8
      designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java
  2. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java
  4. 15
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ComponentStyleEditPane.java
  5. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java
  6. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java
  7. 9
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java
  8. BIN
      designer-form/src/main/resources/com/fr/design/form/images/theme4newTemplate.png
  9. 8
      designer-realize/src/main/java/com/fr/design/actions/insert/cell/GeneralCellAction.java
  10. 9
      designer-realize/src/main/java/com/fr/design/cell/editor/TextCellEditor.java
  11. 2
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/ThemedCellStyleListPane.java

8
designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java

@ -3,11 +3,7 @@ package com.fr.design.cell;
import com.fr.base.NameStyle; import com.fr.base.NameStyle;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.mainframe.theme.TemplateThemeBlock;
import com.fr.general.IOUtils;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
@ -25,14 +21,12 @@ public class CellStylePreviewPane extends JPanel {
private static final Image transparentBackgroundImage = Toolkit.getDefaultToolkit().createImage(CellStylePreviewPane.class.getResource("/com/fr/design/images/transparent_background.png")); private static final Image transparentBackgroundImage = Toolkit.getDefaultToolkit().createImage(CellStylePreviewPane.class.getResource("/com/fr/design/images/transparent_background.png"));
private final float transparentBackgroundWidth; private final float transparentBackgroundWidth;
private final float transparentBackgroundHeight; private final float transparentBackgroundHeight;
private final float transparentBackgroundAspect;
private String paintText = "Report"; private String paintText = "Report";
private Style style = Style.DEFAULT_STYLE; private Style style = Style.DEFAULT_STYLE;
public CellStylePreviewPane() { public CellStylePreviewPane() {
transparentBackgroundWidth = transparentBackgroundImage.getWidth(null); transparentBackgroundWidth = transparentBackgroundImage.getWidth(null);
transparentBackgroundHeight = transparentBackgroundImage.getHeight(null); transparentBackgroundHeight = transparentBackgroundImage.getHeight(null);
transparentBackgroundAspect = 1.0F * transparentBackgroundImage.getWidth(null) / transparentBackgroundImage.getHeight(null);
} }
public void setStyle(Style style) { public void setStyle(Style style) {
@ -72,7 +66,7 @@ public class CellStylePreviewPane extends JPanel {
Style.paintContent(g2d, paintText, style, width, height, resolution); Style.paintContent(g2d, paintText, style, width, height, resolution);
Style.paintBorder(g2d, style, getWidth() - 3, getHeight() - 3); Style.paintBorder(g2d, style, width, height);
} }
@Override @Override

2
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -251,7 +251,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
if (themeConfigChangeListener != null) { if (themeConfigChangeListener != null) {
TemplateThemeConfig<? extends TemplateTheme> config = getUsingTemplateThemeConfig(); TemplateThemeConfig<? extends TemplateTheme> config = getUsingTemplateThemeConfig();
if (config != null) { if (config != null) {
config.addThemeConfigChangeListener(themeConfigChangeListener); config.removeThemeConfigChangeListener(themeConfigChangeListener);
} }
} }
} }

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

@ -193,7 +193,7 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
} }
if (displayTheme4NewTemplateMarker && StringUtils.equals(config.getThemeName4NewTemplate(), name)) { if (displayTheme4NewTemplateMarker && StringUtils.equals(config.getThemeName4NewTemplate(), name)) {
theme4NewTemplateMarkIcon.paintIcon(this, g, 0, 0); theme4NewTemplateMarkIcon.paintIcon(this, g, 0, thumbnailPane.getHeight() - 16);
} }
if (selected || this.hovering) { if (selected || this.hovering) {

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe.theme.edit;
import com.fr.base.theme.settings.ThemedComponentStyle; import com.fr.base.theme.settings.ThemedComponentStyle;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.AttrScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.ComponentBodyStylePane; import com.fr.design.gui.style.ComponentBodyStylePane;
import com.fr.design.gui.style.ComponentIntegralStylePane; import com.fr.design.gui.style.ComponentIntegralStylePane;
@ -113,7 +114,7 @@ public class ComponentStyleEditPane extends JPanel {
} }
} }
private JComponent createTabContainer(final JComponent component) { private JComponent createTabContainer(final JPanel component) {
JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane();
container.setPreferredSize(new Dimension(container.getPreferredSize().width, 220)); container.setPreferredSize(new Dimension(container.getPreferredSize().width, 220));
@ -123,12 +124,12 @@ public class ComponentStyleEditPane extends JPanel {
tipLabelPane.add(tipLabel); tipLabelPane.add(tipLabel);
container.add(tipLabelPane, BorderLayout.NORTH); container.add(tipLabelPane, BorderLayout.NORTH);
JScrollPane scrollPane = new JScrollPane(component); container.add(new AttrScrollPane() {
scrollPane.setPreferredSize(new Dimension(container.getPreferredSize().width, 220)); @Override
scrollPane.setBorder(BorderFactory.createEmptyBorder()); protected JPanel createContentPane() {
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); return component;
}
container.add(scrollPane, BorderLayout.CENTER); }, BorderLayout.CENTER);
return container; return container;

4
designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java

@ -251,7 +251,7 @@ public class CreateComponentAction extends UpdateAction {
private Image componentToImage(Component comp, Rectangle rect) { private Image componentToImage(Component comp, Rectangle rect) {
BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_RGB);
comp.paint(im.getGraphics()); comp.paint(im.getGraphics());
return im; return im;
} }
@ -260,7 +260,7 @@ public class CreateComponentAction extends UpdateAction {
private Image moduleToImage(Form form, ElementCaseEditor editor, Map<String, Object> parameterMap, Rectangle rect) { private Image moduleToImage(Form form, ElementCaseEditor editor, Map<String, Object> parameterMap, Rectangle rect) {
if (editor == null) { if (editor == null) {
return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_RGB);
} }
FormElementCaseProvider provider = editor.getElementCase(); FormElementCaseProvider provider = editor.getElementCase();
provider.setName(editor.getWidgetName()); provider.setName(editor.getWidgetName());

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

@ -95,7 +95,9 @@ public class InstallComponentAction extends UpdateAction {
} }
ShareWidgetInfoManager.getInstance().saveXmlInfo(); ShareWidgetInfoManager.getInstance().saveXmlInfo();
boolean needShowMessage = (chosenFiles.length > 1 && chosenFiles.length != failureList.size()) || containRues(chosenFiles); boolean reuNeedShowMessage = chosenFiles.length > 1 && chosenFiles.length != failureList.size();
boolean reusNeedShowMessage = containRues(chosenFiles) && !failureList.isEmpty();
boolean needShowMessage = reuNeedShowMessage || reusNeedShowMessage;
return new InstallBackInfo(installStatus, needShowMessage, failureList); return new InstallBackInfo(installStatus, needShowMessage, failureList);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);

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

@ -30,9 +30,14 @@ public class InstallUtils {
* 安装组件包 * 安装组件包
*/ */
public static boolean installReusFile(File chosenFile, long installTime, List<String> list) { public static boolean installReusFile(File chosenFile, long installTime, List<String> list) {
return installReusFile(chosenFile, installTime, list, o -> { InstallResult installResult = installReusFile(chosenFile, installTime, list, o -> {
//do nothing //do nothing
}).installStatus; });
Group group = installResult.group;
if (group.getAllBindInfoList().length == 0) {
DefaultShareGroupManager.getInstance().removeGroup(group);
}
return installResult.installStatus;
} }
/** /**

BIN
designer-form/src/main/resources/com/fr/design/form/images/theme4newTemplate.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

After

Width:  |  Height:  |  Size: 611 B

8
designer-realize/src/main/java/com/fr/design/actions/insert/cell/GeneralCellAction.java

@ -10,6 +10,7 @@ import com.fr.design.menu.MenuKeySet;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent;
/** /**
* *
@ -52,4 +53,11 @@ public class GeneralCellAction extends AbstractCellAction implements WorkBookSup
public Class getCellValueClass() { public Class getCellValueClass() {
return String.class; return String.class;
} }
@Override
public void actionPerformed(ActionEvent evt) {
super.actionPerformed(evt);
this.getEditingComponent().getGrid().getCellEditor().stopCellEditing();
}
} }

9
designer-realize/src/main/java/com/fr/design/cell/editor/TextCellEditor.java

@ -129,7 +129,7 @@ public class TextCellEditor extends AbstractCellEditor {
} }
this.oldValue = Utils.objectToString(value); this.oldValue = Utils.objectToString(value);
this.textField.setText(oldValue); resetTextWithoutDocumentListener(oldValue);
//peter:只读方式获得Style. //peter:只读方式获得Style.
Style style = null; Style style = null;
if(cellElement != null) { if(cellElement != null) {
@ -176,4 +176,11 @@ public class TextCellEditor extends AbstractCellEditor {
public void keyReleased(KeyEvent evt) { public void keyReleased(KeyEvent evt) {
} }
}; };
private void resetTextWithoutDocumentListener(String text) {
this.textField.getDocument().removeDocumentListener(documentlistener);
this.textField.setText(text);
this.textField.getDocument().addDocumentListener(documentlistener);
}
} }

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

@ -42,6 +42,8 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane<NameStyle> imp
defaultListModel = new DefaultListModel<>(); defaultListModel = new DefaultListModel<>();
styleList = new JList<>(defaultListModel); styleList = new JList<>(defaultListModel);
styleList.setCellRenderer(new RadioButtonListCellRenderer()); styleList.setCellRenderer(new RadioButtonListCellRenderer());
styleList.setOpaque(false);
styleList.setBackground(null);
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
add(styleList, BorderLayout.CENTER); add(styleList, BorderLayout.CENTER);
setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER)); setBorder(BorderFactory.createEmptyBorder(0 ,LEFT_BORDER, 0, RIGHT_BORDER));

Loading…
Cancel
Save