|
|
@ -32,313 +32,324 @@ import java.beans.IntrospectionException; |
|
|
|
import java.beans.PropertyDescriptor; |
|
|
|
import java.beans.PropertyDescriptor; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ |
|
|
|
public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider { |
|
|
|
private UILabel imageLable; |
|
|
|
private UILabel imageLable; |
|
|
|
private FormDesigner designer; |
|
|
|
private FormDesigner designer; |
|
|
|
private static BufferedImage DEFAULT_BACKGROUND; |
|
|
|
private static BufferedImage DEFAULT_BACKGROUND; |
|
|
|
private boolean isHovering = false; |
|
|
|
private boolean isHovering = false; |
|
|
|
|
|
|
|
|
|
|
|
static{ |
|
|
|
static { |
|
|
|
try{ |
|
|
|
try { |
|
|
|
DEFAULT_BACKGROUND = BaseUtils.readImageWithCache("com/fr/base/images/report/elementcase.png"); |
|
|
|
DEFAULT_BACKGROUND = BaseUtils.readImageWithCache("com/fr/base/images/report/elementcase.png"); |
|
|
|
}catch (Throwable e) { |
|
|
|
} catch (Throwable e) { |
|
|
|
//IBM jdk 1.5.0_22 并发下读取图片有时会异常(EOFException), 这个图片反正只有设计器用到, 捕获住
|
|
|
|
//IBM jdk 1.5.0_22 并发下读取图片有时会异常(EOFException), 这个图片反正只有设计器用到, 捕获住
|
|
|
|
DEFAULT_BACKGROUND = CoreGraphHelper.createBufferedImage(0, 0); |
|
|
|
DEFAULT_BACKGROUND = CoreGraphHelper.createBufferedImage(0, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public XElementCase(ElementCaseEditor widget, Dimension initSize) { |
|
|
|
public XElementCase(ElementCaseEditor widget, Dimension initSize) { |
|
|
|
super(widget, initSize); |
|
|
|
super(widget, initSize); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initXCreatorProperties() { |
|
|
|
protected void initXCreatorProperties() { |
|
|
|
super.initXCreatorProperties(); |
|
|
|
super.initXCreatorProperties(); |
|
|
|
|
|
|
|
|
|
|
|
// 报表块初始化时要加载对应的borderStyle
|
|
|
|
// 报表块初始化时要加载对应的borderStyle
|
|
|
|
initBorderStyle(); |
|
|
|
initBorderStyle(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否支持设置标题 |
|
|
|
* 是否支持设置标题 |
|
|
|
* @return 是返回true |
|
|
|
* @return 是返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean hasTitleStyle() { |
|
|
|
public boolean hasTitleStyle() { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回组件属性值 |
|
|
|
* 返回组件属性值 |
|
|
|
* @return 返回组件属性值 |
|
|
|
* @return 返回组件属性值 |
|
|
|
* @throws IntrospectionException 异常 |
|
|
|
* @throws IntrospectionException 异常 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
|
|
|
|
|
|
|
|
CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ |
|
|
|
CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ |
|
|
|
new CRPropertyDescriptor("widgetName", this.data.getClass()) |
|
|
|
new CRPropertyDescriptor("widgetName", this.data.getClass()) |
|
|
|
.setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), |
|
|
|
.setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), |
|
|
|
new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( |
|
|
|
new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void propertyChange() { |
|
|
|
public void propertyChange() { |
|
|
|
makeVisible(toData().isVisible()); |
|
|
|
makeVisible(toData().isVisible()); |
|
|
|
} |
|
|
|
} |
|
|
|
}), |
|
|
|
}), |
|
|
|
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( |
|
|
|
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( |
|
|
|
WLayoutBorderStyleEditor.class).setI18NName( |
|
|
|
WLayoutBorderStyleEditor.class).setI18NName( |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") |
|
|
|
.setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
.setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void propertyChange() { |
|
|
|
public void propertyChange() { |
|
|
|
initStyle(); |
|
|
|
initStyle(); |
|
|
|
} |
|
|
|
} |
|
|
|
}), |
|
|
|
}), |
|
|
|
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) |
|
|
|
new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) |
|
|
|
.setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding")) |
|
|
|
.setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding")) |
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), |
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), |
|
|
|
new CRPropertyDescriptor("toolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) |
|
|
|
new CRPropertyDescriptor("toolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) |
|
|
|
.setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_EC_Toolbar")) |
|
|
|
.setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_EC_Toolbar")) |
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") |
|
|
|
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
CRPropertyDescriptor[] extraTableEditor = getExtraTableEditor(); |
|
|
|
CRPropertyDescriptor[] extraTableEditor = getExtraTableEditor(); |
|
|
|
return ArrayUtils.addAll(propertyTableEditor, extraTableEditor); |
|
|
|
return ArrayUtils.addAll(propertyTableEditor, extraTableEditor); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CRPropertyDescriptor[] getExtraTableEditor(){ |
|
|
|
public CRPropertyDescriptor[] getExtraTableEditor() { |
|
|
|
CRPropertyDescriptor[] extraTableEditor = resolveCompatible(); |
|
|
|
CRPropertyDescriptor[] extraTableEditor = resolveCompatible(); |
|
|
|
CRPropertyDescriptor reportFitEditor = getReportFitEditor(); |
|
|
|
CRPropertyDescriptor reportFitEditor = getReportFitEditor(); |
|
|
|
if (reportFitEditor == null) { |
|
|
|
if (reportFitEditor == null) { |
|
|
|
return extraTableEditor; |
|
|
|
return extraTableEditor; |
|
|
|
} |
|
|
|
} |
|
|
|
return ArrayUtils.add(extraTableEditor, reportFitEditor); |
|
|
|
return ArrayUtils.add(extraTableEditor, reportFitEditor); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean supportMobileStyle() { |
|
|
|
public boolean supportMobileStyle() { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private CRPropertyDescriptor getReportFitEditor() { |
|
|
|
private CRPropertyDescriptor getReportFitEditor() { |
|
|
|
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
FitProvider wbTpl = designer.getTarget(); |
|
|
|
FitProvider wbTpl = designer.getTarget(); |
|
|
|
ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); |
|
|
|
ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); |
|
|
|
ElementCaseEditor editor = this.toData(); |
|
|
|
ElementCaseEditor editor = this.toData(); |
|
|
|
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
|
|
|
|
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
|
|
|
|
if (editor.getFitStateInPC() == 0) { |
|
|
|
if (editor.getFitStateInPC() == 0) { |
|
|
|
editor.setReportFitAttr(null); |
|
|
|
editor.setReportFitAttr(null); |
|
|
|
} |
|
|
|
} |
|
|
|
ReportFitAttr reportFit = editor.getReportFitAttr(); |
|
|
|
ReportFitAttr reportFit = editor.getReportFitAttr(); |
|
|
|
if(fitAttr != null){ |
|
|
|
if (fitAttr != null) { |
|
|
|
reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; |
|
|
|
reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; |
|
|
|
} |
|
|
|
} |
|
|
|
ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; |
|
|
|
ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; |
|
|
|
BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); |
|
|
|
BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); |
|
|
|
CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); |
|
|
|
CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); |
|
|
|
if (editor.getReportFitAttr() == null) { |
|
|
|
if (editor.getReportFitAttr() == null) { |
|
|
|
editor.setReportFitInPc(browserFitPropertyEditor.getFitStateInPC(fitAttr)); |
|
|
|
editor.setReportFitInPc(browserFitPropertyEditor.getFitStateInPC(fitAttr)); |
|
|
|
} |
|
|
|
} |
|
|
|
return extraEditor; |
|
|
|
return extraEditor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private CRPropertyDescriptor[] resolveCompatible() { |
|
|
|
private CRPropertyDescriptor[] resolveCompatible() { |
|
|
|
CRPropertyDescriptor[] extraProperty = new CRPropertyDescriptor[0]; |
|
|
|
CRPropertyDescriptor[] extraProperty = new CRPropertyDescriptor[0]; |
|
|
|
//这边有个插件兼容问题,之后还是要改回process才行
|
|
|
|
//这边有个插件兼容问题,之后还是要改回process才行
|
|
|
|
Set<FormElementCaseEditorProvider> set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); |
|
|
|
Set<FormElementCaseEditorProvider> set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); |
|
|
|
for (FormElementCaseEditorProvider provider : set) { |
|
|
|
for (FormElementCaseEditorProvider provider : set) { |
|
|
|
if (provider == null) { |
|
|
|
if (provider == null) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); |
|
|
|
FormProvider formProvider = designer.getTarget(); |
|
|
|
FormProvider formProvider = designer.getTarget(); |
|
|
|
ElementCaseEditorProvider elementCaseEditorProvider = this.toData(); |
|
|
|
ElementCaseEditorProvider elementCaseEditorProvider = this.toData(); |
|
|
|
PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider); |
|
|
|
PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider); |
|
|
|
extraProperty = (CRPropertyDescriptor[]) ArrayUtils.addAll(extraProperty, extraEditor); |
|
|
|
extraProperty = (CRPropertyDescriptor[]) ArrayUtils.addAll(extraProperty, extraEditor); |
|
|
|
} |
|
|
|
} |
|
|
|
return extraProperty; |
|
|
|
return extraProperty; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String getIconName() { |
|
|
|
protected String getIconName() { |
|
|
|
return "text_field_16.png"; |
|
|
|
return "text_field_16.png"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回组件默认名 |
|
|
|
* 返回组件默认名 |
|
|
|
* @return 组件类名(小写) |
|
|
|
* @return 组件类名(小写) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public String createDefaultName() { |
|
|
|
public String createDefaultName() { |
|
|
|
return "report"; |
|
|
|
return "report"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected JComponent initEditor() { |
|
|
|
protected JComponent initEditor() { |
|
|
|
if (editor == null) { |
|
|
|
if (editor == null) { |
|
|
|
setBorder(DEFALUTBORDER); |
|
|
|
setBorder(DEFALUTBORDER); |
|
|
|
editor = new JPanel(); |
|
|
|
editor = new JPanel(); |
|
|
|
editor.setBackground(null); |
|
|
|
editor.setBackground(null); |
|
|
|
editor.setLayout(null); |
|
|
|
editor.setLayout(null); |
|
|
|
imageLable = initImageBackground(); |
|
|
|
imageLable = initImageBackground(); |
|
|
|
|
|
|
|
|
|
|
|
coverPanel = new CoverReportPane(); |
|
|
|
coverPanel = new CoverReportPane(); |
|
|
|
coverPanel.setPreferredSize(imageLable.getPreferredSize()); |
|
|
|
coverPanel.setPreferredSize(imageLable.getPreferredSize()); |
|
|
|
coverPanel.setBounds(imageLable.getBounds()); |
|
|
|
coverPanel.setBounds(imageLable.getBounds()); |
|
|
|
|
|
|
|
|
|
|
|
editor.add(coverPanel); |
|
|
|
editor.add(coverPanel); |
|
|
|
coverPanel.setVisible(false); |
|
|
|
coverPanel.setVisible(false); |
|
|
|
editor.add(imageLable); |
|
|
|
editor.add(imageLable); |
|
|
|
} |
|
|
|
} |
|
|
|
return editor; |
|
|
|
return editor; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 从data中获取到图片背景, 并设置到Label上 |
|
|
|
* 从data中获取到图片背景, 并设置到Label上 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private UILabel initImageBackground(){ |
|
|
|
private UILabel initImageBackground() { |
|
|
|
UILabel imageLable = new UILabel(); |
|
|
|
UILabel imageLable = new UILabel(); |
|
|
|
BufferedImage image = toData().getECImage(); |
|
|
|
BufferedImage image = toData().getECImage(); |
|
|
|
if (image == null) { |
|
|
|
if (image == null) { |
|
|
|
image = DEFAULT_BACKGROUND; |
|
|
|
image = DEFAULT_BACKGROUND; |
|
|
|
} |
|
|
|
} |
|
|
|
setLabelBackground(image, imageLable); |
|
|
|
setLabelBackground(image, imageLable); |
|
|
|
|
|
|
|
|
|
|
|
return imageLable; |
|
|
|
return imageLable; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置指定Label的背景 |
|
|
|
* 设置指定Label的背景 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void setLabelBackground(Image image, UILabel imageLable){ |
|
|
|
private void setLabelBackground(Image image, UILabel imageLable) { |
|
|
|
ImageIcon icon = new ImageIcon(image); |
|
|
|
ImageIcon icon = new ImageIcon(image); |
|
|
|
imageLable.setIcon(icon); |
|
|
|
imageLable.setIcon(icon); |
|
|
|
imageLable.setOpaque(true); |
|
|
|
imageLable.setOpaque(true); |
|
|
|
imageLable.setLayout(null); |
|
|
|
imageLable.setLayout(null); |
|
|
|
imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); |
|
|
|
imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void paintBorder(Graphics g, Rectangle bounds){ |
|
|
|
public void paintBorder(Graphics g, Rectangle bounds) { |
|
|
|
if (!isHovering) { |
|
|
|
if (!isHovering) { |
|
|
|
super.paintBorder(g, bounds); |
|
|
|
super.paintBorder(g, bounds); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 初始化大小 |
|
|
|
* 初始化大小 |
|
|
|
* @return 尺寸 |
|
|
|
* @return 尺寸 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Dimension initEditorSize() { |
|
|
|
public Dimension initEditorSize() { |
|
|
|
return BORDER_PREFERRED_SIZE; |
|
|
|
return BORDER_PREFERRED_SIZE; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 是否是报表块 |
|
|
|
* 是否是报表块 |
|
|
|
* @return 是 |
|
|
|
* @return 是 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isReport() { |
|
|
|
public boolean isReport() { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 该组件是否可以拖入参数面板 |
|
|
|
* 该组件是否可以拖入参数面板 |
|
|
|
* @return 是则返回true |
|
|
|
* @return 是则返回true |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean canEnterIntoParaPane(){ |
|
|
|
public boolean canEnterIntoParaPane() { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回报表块对应的widget |
|
|
|
* 返回报表块对应的widget |
|
|
|
* @return 返回ElementCaseEditor |
|
|
|
* @return 返回ElementCaseEditor |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public ElementCaseEditor toData() { |
|
|
|
public ElementCaseEditor toData() { |
|
|
|
return ((ElementCaseEditor) data); |
|
|
|
return ((ElementCaseEditor) data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public FormElementCaseProvider getElementCase() { |
|
|
|
public FormElementCaseProvider getElementCase() { |
|
|
|
return toData().getElementCase(); |
|
|
|
return toData().getElementCase(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getElementCaseContainerName() { |
|
|
|
public String getElementCaseContainerName() { |
|
|
|
return toData().getWidgetName(); |
|
|
|
return toData().getWidgetName(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setElementCase(FormElementCaseProvider el) { |
|
|
|
public void setElementCase(FormElementCaseProvider el) { |
|
|
|
toData().setElementCase(el); |
|
|
|
toData().setElementCase(el); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setBackground(BufferedImage image){ |
|
|
|
public void setBackground(BufferedImage image) { |
|
|
|
toData().setECImage(image); |
|
|
|
toData().getElementCaseImage().adjustImageBytes(image); |
|
|
|
setEditorIcon(image); |
|
|
|
setEditorIcon(toData().getECImage() == null ? DEFAULT_BACKGROUND : toData().getECImage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void setEditorIcon(BufferedImage image){ |
|
|
|
public void updateECImage() { |
|
|
|
setLabelBackground(image, imageLable); |
|
|
|
XElementCase self = this; |
|
|
|
} |
|
|
|
self.toData().getElementCaseImage().updateImage(() -> { |
|
|
|
|
|
|
|
self.setEditorIcon(self.toData().getECImage() == null ? DEFAULT_BACKGROUND : self.toData().getECImage()); |
|
|
|
public Dimension getSize(){ |
|
|
|
if (self.designer != null) { |
|
|
|
return new Dimension(this.getWidth(), this.getHeight()); |
|
|
|
self.designer.repaint(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
/** |
|
|
|
} |
|
|
|
* 响应点击事件 |
|
|
|
|
|
|
|
* @param editingMouseListener 事件处理器 |
|
|
|
|
|
|
|
* @param e 点击事件 |
|
|
|
private void setEditorIcon(BufferedImage image) { |
|
|
|
*/ |
|
|
|
setLabelBackground(image, imageLable); |
|
|
|
public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ |
|
|
|
} |
|
|
|
super.respondClick(editingMouseListener, e); |
|
|
|
|
|
|
|
editingMouseListener.refreshTopXCreator(); |
|
|
|
public Dimension getSize() { |
|
|
|
if (this.isShareConfigButtonFocus()) { |
|
|
|
return new Dimension(this.getWidth(), this.getHeight()); |
|
|
|
CoverReportPane.showShareConfig(((XCreator)this.getParent()).toData()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
switchTab(e, editingMouseListener); |
|
|
|
/** |
|
|
|
} |
|
|
|
* 响应点击事件 |
|
|
|
} |
|
|
|
* @param editingMouseListener 事件处理器 |
|
|
|
|
|
|
|
* @param e 点击事件 |
|
|
|
|
|
|
|
*/ |
|
|
|
private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){ |
|
|
|
public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { |
|
|
|
FormDesigner designer = editingMouseListener.getDesigner(); |
|
|
|
super.respondClick(editingMouseListener, e); |
|
|
|
if (e.getButton() == MouseEvent.BUTTON1 && |
|
|
|
editingMouseListener.refreshTopXCreator(); |
|
|
|
(e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR)){ |
|
|
|
if (this.isShareConfigButtonFocus()) { |
|
|
|
FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e); |
|
|
|
CoverReportPane.showShareConfig(((XCreator) this.getParent()).toData()); |
|
|
|
//切换设计器
|
|
|
|
} else { |
|
|
|
designer.switchTab(component); |
|
|
|
switchTab(e, editingMouseListener); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { |
|
|
|
private void switchTab(MouseEvent e, EditingMouseListener editingMouseListener) { |
|
|
|
return new WidgetPropertyUIProvider[]{ new ElementCasePropertyUI(this)}; |
|
|
|
FormDesigner designer = editingMouseListener.getDesigner(); |
|
|
|
} |
|
|
|
if (e.getButton() == MouseEvent.BUTTON1 && |
|
|
|
|
|
|
|
(e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR)) { |
|
|
|
/** |
|
|
|
FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e); |
|
|
|
* data属性改变触发其他操作 |
|
|
|
//切换设计器
|
|
|
|
* |
|
|
|
designer.switchTab(component); |
|
|
|
*/ |
|
|
|
} |
|
|
|
public void firePropertyChange(){ |
|
|
|
} |
|
|
|
initStyle(); |
|
|
|
|
|
|
|
} |
|
|
|
@Override |
|
|
|
|
|
|
|
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { |
|
|
|
/** |
|
|
|
return new WidgetPropertyUIProvider[]{new ElementCasePropertyUI(this)}; |
|
|
|
* 是否支持设置可用 |
|
|
|
} |
|
|
|
* return boolean |
|
|
|
|
|
|
|
*/ |
|
|
|
/** |
|
|
|
public boolean supportSetEnable(){ |
|
|
|
* data属性改变触发其他操作 |
|
|
|
return false; |
|
|
|
* |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
public void firePropertyChange() { |
|
|
|
/** |
|
|
|
initStyle(); |
|
|
|
* 是否支持共享-现只支持报表块、图表、tab块、绝对布局 |
|
|
|
} |
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
/** |
|
|
|
public boolean isSupportShared() { |
|
|
|
* 是否支持设置可用 |
|
|
|
return true; |
|
|
|
* return boolean |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
public boolean supportSetEnable() { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 是否支持共享-现只支持报表块、图表、tab块、绝对布局 |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public boolean isSupportShared() { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|