|
|
|
@ -2,12 +2,8 @@ package com.fr.design.mainframe;
|
|
|
|
|
|
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.base.chart.BaseChartCollection; |
|
|
|
|
import com.fr.base.theme.TemplateThemeAware; |
|
|
|
|
import com.fr.base.theme.TemplateThemeCompatible; |
|
|
|
|
import com.fr.chart.chartattr.ChartCollection; |
|
|
|
|
import com.fr.chartx.attr.ChartProvider; |
|
|
|
|
import com.fr.base.theme.FormTheme; |
|
|
|
|
import com.fr.base.theme.TemplateTheme; |
|
|
|
|
import com.fr.design.DesignModelAdapter; |
|
|
|
|
import com.fr.design.data.DesignTableDataManager; |
|
|
|
|
import com.fr.design.data.datapane.TableDataTreePane; |
|
|
|
@ -22,7 +18,6 @@ import com.fr.design.designer.creator.XLayoutContainer;
|
|
|
|
|
import com.fr.design.designer.creator.XWAbsoluteLayout; |
|
|
|
|
import com.fr.design.designer.creator.XWFitLayout; |
|
|
|
|
import com.fr.design.designer.creator.XWParameterLayout; |
|
|
|
|
import com.fr.design.file.HistoryTemplateListCache; |
|
|
|
|
import com.fr.design.form.util.XCreatorConstants; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.icon.IconPathConstants; |
|
|
|
@ -32,24 +27,16 @@ import com.fr.design.mod.bean.ContentChangeItem;
|
|
|
|
|
import com.fr.design.mod.event.TableDataModifyEvent; |
|
|
|
|
import com.fr.design.utils.ComponentUtils; |
|
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
|
import com.fr.form.main.Form; |
|
|
|
|
import com.fr.form.main.WidgetGather; |
|
|
|
|
import com.fr.form.share.editor.SharableEditorProvider; |
|
|
|
|
import com.fr.form.share.SharableWidgetProvider; |
|
|
|
|
import com.fr.form.share.ShareLoader; |
|
|
|
|
import com.fr.form.ui.AbstractBorderStyleWidget; |
|
|
|
|
import com.fr.form.ui.ChartEditor; |
|
|
|
|
import com.fr.form.ui.ElementCaseEditor; |
|
|
|
|
import com.fr.form.share.editor.SharableEditorProvider; |
|
|
|
|
import com.fr.form.ui.Widget; |
|
|
|
|
import com.fr.stable.Constants; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JWindow; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.Point; |
|
|
|
@ -59,7 +46,10 @@ import java.awt.dnd.DropTarget;
|
|
|
|
|
import java.awt.dnd.DropTargetDragEvent; |
|
|
|
|
import java.awt.dnd.DropTargetDropEvent; |
|
|
|
|
import java.awt.dnd.DropTargetEvent; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加模式下鼠标事件处理器。 |
|
|
|
@ -150,9 +140,6 @@ public class FormCreatorDropTarget extends DropTarget {
|
|
|
|
|
EventDispatcher.fire(TableDataModifyEvent.INSTANCE, new ContentChangeItem(tdNameMap, widget, ChangeItem.TABLE_DATA_NAME)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 新疆的图表块和报表块默认主题化
|
|
|
|
|
addThemeToNewWidget(addingXCreator); |
|
|
|
|
|
|
|
|
|
designer.getSelectionModel().setSelectedCreators( |
|
|
|
|
FormSelectionUtils.rebuildSelection(xCreator, new Widget[]{widget})); |
|
|
|
|
designer.getEditListenerTable().fireCreatorModified(addingModel.getXCreator(), DesignerEvent.CREATOR_ADDED); |
|
|
|
@ -363,37 +350,4 @@ public class FormCreatorDropTarget extends DropTarget {
|
|
|
|
|
public TabDragInner getTabDragInner() { |
|
|
|
|
return this.tabDragInner; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void addThemeToNewWidget(XCreator addingXCreator) { |
|
|
|
|
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
|
if (template == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
TemplateTheme theme = template.getTemplateTheme(); |
|
|
|
|
if (!(theme instanceof FormTheme)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
FormTheme formTheme = (FormTheme) theme; |
|
|
|
|
|
|
|
|
|
Form.traversalWidget(addingXCreator.toData(), new WidgetGather() { |
|
|
|
|
@Override |
|
|
|
|
public void dealWith(Widget widget) { |
|
|
|
|
if (widget instanceof AbstractBorderStyleWidget) { |
|
|
|
|
AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) widget; |
|
|
|
|
if (!styleWidget.supportThemed()) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean followingTheme = (!addingXCreator.isShared()) || styleWidget.isBorderStyleFollowingTheme(); |
|
|
|
|
styleWidget.setBorderStyleFollowingTheme(followingTheme); |
|
|
|
|
if (followingTheme) { |
|
|
|
|
styleWidget.onTemplateUsingThemeChange(formTheme, TemplateThemeCompatible.NONE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
public boolean dealWithAllCards() { return true; } |
|
|
|
|
}, AbstractBorderStyleWidget.class); |
|
|
|
|
addingXCreator.rebuid(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|