Browse Source

Merge pull request #5122 in DESIGN/design from final/10.0 to release/10.0

* commit 'fd207872f35d0e9d31d22f269f8da88bc3c6b1a6':
  REPORT-55757 【组件背景分离】组件复用-标题图案预览图,悬浮时出现的遮罩和删除图标,鼠标如果从左边/上边滑出,则删除图标消失;但从右边/下边滑出,删除图标还在
  REPORT-55800 【组件背景分离】 通过组件树最终选中的组件与展示工具栏的组件不是同一个
  REPORT-54183 加密的复用组件无法修改组件名
zheng-1641779399395
superman 3 years ago
parent
commit
6e0635beae
  1. 10
      designer-form/src/main/java/com/fr/design/gui/xpane/TitleInsetImagePane.java
  2. 5
      designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java
  3. 4
      designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java
  4. 33
      designer-realize/src/main/java/com/fr/design/share/SharableManager.java

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

@ -115,13 +115,9 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
@Override @Override
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
super.mouseExited(e); super.mouseExited(e);
int x = e.getX(); imagePreviewOverlayPane.setVisible(false);
int y = e.getY(); imageDeleteButton.setVisible(false);
if (x <= 0 || getWidth() <= x || y <= 0 || y >= getHeight()) { imageDeleteButton.setEnabled(false);
imagePreviewOverlayPane.setVisible(false);
imageDeleteButton.setVisible(false);
imageDeleteButton.setEnabled(false);
}
} }
}); });

5
designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java

@ -411,6 +411,11 @@ public class ComponentTree extends JTree {
if (e.isControlDown() || e.isShiftDown()) { if (e.isControlDown() || e.isShiftDown()) {
return; return;
} }
XCreator currentCreator = designer.getSelectionModel().getSelection().getSelectedCreator();
// 以当前选中的为准
if (currentCreator != selectedCreator) {
selectedCreator = currentCreator;
}
if (e.getButton() == MouseEvent.BUTTON1 && selectedCreator != null) { if (e.getButton() == MouseEvent.BUTTON1 && selectedCreator != null) {
showSelectedPopup(selectedCreator); showSelectedPopup(selectedCreator);
} }

4
designer-form/src/main/java/com/fr/design/widget/FormWidgetDefinePaneFactoryBase.java

@ -132,6 +132,10 @@ public class FormWidgetDefinePaneFactoryBase {
defineMap.put(widget, appearance); defineMap.put(widget, appearance);
} }
public static Appearance getDefinePane(Class<? extends Widget> widget) {
return defineMap.get(widget);
}
public static RN createWidgetDefinePane(XCreator creator, FormDesigner designer, Widget widget, Operator operator) { public static RN createWidgetDefinePane(XCreator creator, FormDesigner designer, Widget widget, Operator operator) {
if (isExtraXWidget(widget)) { if (isExtraXWidget(widget)) {
WidgetDefinePane widgetDefinePane = new WidgetDefinePane(creator, designer); WidgetDefinePane widgetDefinePane = new WidgetDefinePane(creator, designer);

33
designer-realize/src/main/java/com/fr/design/share/SharableManager.java

@ -10,14 +10,21 @@ import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.collect.SharableCollectorManager; import com.fr.design.mainframe.share.collect.SharableCollectorManager;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler;
import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler;
import com.fr.design.mainframe.share.ui.block.LocalWidgetBlock;
import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
import com.fr.design.mainframe.share.util.ShareComponentUtils; import com.fr.design.mainframe.share.util.ShareComponentUtils;
import com.fr.design.share.utils.EffectItemUtils; import com.fr.design.share.utils.EffectItemUtils;
import com.fr.form.share.ShareLoader; import com.fr.design.widget.FormWidgetDefinePaneFactoryBase;
import com.fr.form.share.encrypt.engine.ClazzCreatorFactory;
import com.fr.form.ui.AbstractBorderStyleWidget;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.stable.EnvChangedListener; import com.fr.stable.EnvChangedListener;
import com.fr.stable.bridge.BridgeMark;
import com.fr.stable.bridge.StableFactory;
import java.util.List; import java.util.List;
@ -27,6 +34,7 @@ public class SharableManager {
listenEnv(); listenEnv();
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance());
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance());
registerSharableEncryptDefinePanes();
} }
public static void saveTemplate(JTemplate jt) { public static void saveTemplate(JTemplate jt) {
@ -61,4 +69,25 @@ public class SharableManager {
} }
}); });
} }
private static void registerSharableEncryptDefinePane(Class<? extends Widget> mainClazz) {
String newClazzName = ClazzCreatorFactory.getInstance().createName(mainClazz);
Class<? extends Widget> newClazz;
try {
newClazz = (Class<? extends Widget>) Class.forName(newClazzName, false, mainClazz.getClassLoader());
} catch (Exception e) {
newClazz = (Class<? extends Widget>) ClazzCreatorFactory.getInstance().newSharableClazz(mainClazz.getClassLoader(), mainClazz);
}
if (FormWidgetDefinePaneFactoryBase.getDefinePane(newClazz) == null) {
FormWidgetDefinePaneFactoryBase.registerDefinePane(newClazz, FormWidgetDefinePaneFactoryBase.getDefinePane(mainClazz));
}
}
private static void registerSharableEncryptDefinePanes() {
registerSharableEncryptDefinePane(ElementCaseEditor.class);
registerSharableEncryptDefinePane(StableFactory.getMarkedClass(BridgeMark.CHART_EDITOR, AbstractBorderStyleWidget.class));
registerSharableEncryptDefinePane(WAbsoluteLayout.class);
registerSharableEncryptDefinePane(WCardMainBorderLayout.class);
}
} }

Loading…
Cancel
Save