Browse Source

Merge pull request #5125 in DESIGN/design from feature/10.0 to research/10.0

* commit '9eacc8c31b2a4873ebd12abbb15333011716cac7':
  REPORT-55757 【组件背景分离】组件复用-标题图案预览图,悬浮时出现的遮罩和删除图标,鼠标如果从左边/上边滑出,则删除图标消失;但从右边/下边滑出,删除图标还在
  REPORT-55800 【组件背景分离】 通过组件树最终选中的组件与展示工具栏的组件不是同一个
  REPORT-54183 加密的复用组件无法修改组件名
research/10.0
superman 3 years ago
parent
commit
87c212b533
  1. 4
      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

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

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

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()) {
return;
}
XCreator currentCreator = designer.getSelectionModel().getSelection().getSelectedCreator();
// 以当前选中的为准
if (currentCreator != selectedCreator) {
selectedCreator = currentCreator;
}
if (e.getButton() == MouseEvent.BUTTON1 && selectedCreator != null) {
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);
}
public static Appearance getDefinePane(Class<? extends Widget> widget) {
return defineMap.get(widget);
}
public static RN createWidgetDefinePane(XCreator creator, FormDesigner designer, Widget widget, Operator operator) {
if (isExtraXWidget(widget)) {
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.encrypt.clipboard.impl.EncryptSelectionClipboardHandler;
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.util.ShareComponentUtils;
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.json.JSONArray;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.bridge.BridgeMark;
import com.fr.stable.bridge.StableFactory;
import java.util.List;
@ -27,6 +34,7 @@ public class SharableManager {
listenEnv();
ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance());
ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance());
registerSharableEncryptDefinePanes();
}
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