|
|
@ -28,328 +28,333 @@ import javax.swing.BorderFactory; |
|
|
|
import javax.swing.JComponent; |
|
|
|
import javax.swing.JComponent; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
|
|
|
import java.beans.IntrospectionException; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.Cursor; |
|
|
|
import java.awt.Cursor; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Graphics; |
|
|
|
import java.awt.Graphics; |
|
|
|
import java.awt.Rectangle; |
|
|
|
import java.awt.Rectangle; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
import java.beans.IntrospectionException; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* form中的图表按钮弹出的控件, 创建初始化图表内容. |
|
|
|
* form中的图表按钮弹出的控件, 创建初始化图表内容. |
|
|
|
* |
|
|
|
* |
|
|
|
* @author kunsnat E-mail:kunsnat@gmail.com |
|
|
|
* @author kunsnat E-mail:kunsnat@gmail.com |
|
|
|
* @version 创建时间:2013-7-5 上午10:28:30 |
|
|
|
* @version 创建时间:2013-7-5 上午10:28:30 |
|
|
|
* 类说明 |
|
|
|
* 类说明 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class XChartEditor extends XBorderStyleWidgetCreator { |
|
|
|
public class XChartEditor extends XBorderStyleWidgetCreator { |
|
|
|
private static final long serialVersionUID = -7009439442104836657L; |
|
|
|
private static final long serialVersionUID = -7009439442104836657L; |
|
|
|
private static final int BORDER_WIDTH = 2; |
|
|
|
private static final int BORDER_WIDTH = 2; |
|
|
|
//具体来说是DesignerEditor<SimpleChartComponent>
|
|
|
|
//具体来说是DesignerEditor<SimpleChartComponent>
|
|
|
|
private DesignerEditor<JComponent> designerEditor; |
|
|
|
private DesignerEditor<JComponent> designerEditor; |
|
|
|
// private DesignerEditor<SimpleChartComponent> designerEditor;
|
|
|
|
// private DesignerEditor<SimpleChartComponent> designerEditor;
|
|
|
|
//marro:无奈的属性,暂时想不出好办法
|
|
|
|
//marro:无奈的属性,暂时想不出好办法
|
|
|
|
private boolean isRefreshing = false; |
|
|
|
private boolean isRefreshing = false; |
|
|
|
|
|
|
|
|
|
|
|
private boolean isEditing = false; |
|
|
|
protected boolean isEditing = false; |
|
|
|
|
|
|
|
|
|
|
|
private boolean isHovering = false; |
|
|
|
private boolean isHovering = false; |
|
|
|
private static final Color OUTER_BORDER_COLOR = new Color(65, 155, 249, 30); |
|
|
|
private static final Color OUTER_BORDER_COLOR = new Color(65, 155, 249, 30); |
|
|
|
private static final Color INNER_BORDER_COLOR = new Color(65, 155, 249); |
|
|
|
private static final Color INNER_BORDER_COLOR = new Color(65, 155, 249); |
|
|
|
|
|
|
|
|
|
|
|
public XChartEditor(BaseChartEditor editor) { |
|
|
|
public XChartEditor(BaseChartEditor editor) { |
|
|
|
this(editor, new Dimension(250, 150)); |
|
|
|
this(editor, new Dimension(250, 150)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public XChartEditor(BaseChartEditor editor, Dimension size) { |
|
|
|
public XChartEditor(BaseChartEditor editor, Dimension size) { |
|
|
|
super((Widget)editor, size); |
|
|
|
super((Widget) editor, size); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String getIconPath() { |
|
|
|
public String getIconPath() { |
|
|
|
return super.getIconPath(); |
|
|
|
return super.getIconPath(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String getIconName() { |
|
|
|
protected String getIconName() { |
|
|
|
return "Chart.png"; |
|
|
|
return "Chart.png"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 返回组件默认名 |
|
|
|
* 返回组件默认名 |
|
|
|
* @return 组件类名(小写) |
|
|
|
* |
|
|
|
*/ |
|
|
|
* @return 组件类名(小写) |
|
|
|
public String createDefaultName() { |
|
|
|
*/ |
|
|
|
return "chart"; |
|
|
|
public String createDefaultName() { |
|
|
|
} |
|
|
|
return "chart"; |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
|
|
|
|
|
* 是否支持设置标题 |
|
|
|
/** |
|
|
|
* @return 是返回true |
|
|
|
* 是否支持设置标题 |
|
|
|
*/ |
|
|
|
* |
|
|
|
public boolean hasTitleStyle() { |
|
|
|
* @return 是返回true |
|
|
|
return true; |
|
|
|
*/ |
|
|
|
} |
|
|
|
public boolean hasTitleStyle() { |
|
|
|
|
|
|
|
return true; |
|
|
|
@Override |
|
|
|
} |
|
|
|
public void stopEditing() { |
|
|
|
|
|
|
|
isEditing = false; |
|
|
|
@Override |
|
|
|
} |
|
|
|
public void stopEditing() { |
|
|
|
|
|
|
|
isEditing = false; |
|
|
|
/** |
|
|
|
} |
|
|
|
* 得到属性名 |
|
|
|
|
|
|
|
* @return 属性名 |
|
|
|
|
|
|
|
* @throws java.beans.IntrospectionException |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* 得到属性名 |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
* |
|
|
|
return new CRPropertyDescriptor[] { |
|
|
|
* @return 属性名 |
|
|
|
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), |
|
|
|
* @throws java.beans.IntrospectionException |
|
|
|
new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( |
|
|
|
*/ |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { |
|
|
|
|
|
|
|
return new CRPropertyDescriptor[]{ |
|
|
|
@Override |
|
|
|
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), |
|
|
|
public void propertyChange() { |
|
|
|
new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( |
|
|
|
makeVisible(toData().isVisible());} |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
}), |
|
|
|
|
|
|
|
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( |
|
|
|
@Override |
|
|
|
WLayoutBorderStyleEditor.class).setI18NName( |
|
|
|
public void propertyChange() { |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") |
|
|
|
makeVisible(toData().isVisible()); |
|
|
|
.setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
} |
|
|
|
|
|
|
|
}), |
|
|
|
@Override |
|
|
|
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( |
|
|
|
public void propertyChange() { |
|
|
|
WLayoutBorderStyleEditor.class).setI18NName( |
|
|
|
initStyle(); |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") |
|
|
|
} |
|
|
|
.setPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
}), |
|
|
|
|
|
|
|
}; |
|
|
|
@Override |
|
|
|
} |
|
|
|
public void propertyChange() { |
|
|
|
|
|
|
|
initStyle(); |
|
|
|
/** |
|
|
|
} |
|
|
|
* 该组件是否可以拖入参数面板 |
|
|
|
}), |
|
|
|
* @return 是则返回true |
|
|
|
}; |
|
|
|
*/ |
|
|
|
} |
|
|
|
public boolean canEnterIntoParaPane(){ |
|
|
|
|
|
|
|
return false; |
|
|
|
/** |
|
|
|
} |
|
|
|
* 该组件是否可以拖入参数面板 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return 是则返回true |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* 编辑状态的时候需要重新绘制下边框 |
|
|
|
public boolean canEnterIntoParaPane() { |
|
|
|
* |
|
|
|
return false; |
|
|
|
*/ |
|
|
|
} |
|
|
|
@Override |
|
|
|
|
|
|
|
public void paintBorder(Graphics g, Rectangle bounds){ |
|
|
|
|
|
|
|
if(isEditing){ |
|
|
|
/** |
|
|
|
g.setColor(OUTER_BORDER_COLOR); |
|
|
|
* 编辑状态的时候需要重新绘制下边框 |
|
|
|
GraphHelper.draw(g, new Rectangle(bounds.x - BORDER_WIDTH, bounds.y - BORDER_WIDTH, bounds.width + BORDER_WIDTH + 1, bounds.height + BORDER_WIDTH + 1), Constants.LINE_LARGE); |
|
|
|
*/ |
|
|
|
}else if(!isHovering){ |
|
|
|
@Override |
|
|
|
super.paintBorder(g, bounds); |
|
|
|
public void paintBorder(Graphics g, Rectangle bounds) { |
|
|
|
} |
|
|
|
if (isEditing) { |
|
|
|
} |
|
|
|
g.setColor(OUTER_BORDER_COLOR); |
|
|
|
|
|
|
|
GraphHelper.draw(g, new Rectangle(bounds.x - BORDER_WIDTH, bounds.y - BORDER_WIDTH, bounds.width + BORDER_WIDTH + 1, bounds.height + BORDER_WIDTH + 1), Constants.LINE_LARGE); |
|
|
|
|
|
|
|
} else if (!isHovering) { |
|
|
|
/** |
|
|
|
super.paintBorder(g, bounds); |
|
|
|
* 返回设计器的Editor |
|
|
|
} |
|
|
|
*/ |
|
|
|
} |
|
|
|
public DesignerEditor<JComponent> getDesignerEditor() { |
|
|
|
|
|
|
|
return designerEditor; |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
|
|
|
|
|
* 返回设计器的Editor |
|
|
|
@Override |
|
|
|
*/ |
|
|
|
protected void initXCreatorProperties() { |
|
|
|
public DesignerEditor<JComponent> getDesignerEditor() { |
|
|
|
super.initXCreatorProperties(); |
|
|
|
return designerEditor; |
|
|
|
initBorderStyle(); |
|
|
|
} |
|
|
|
BaseChartCollection collection = ((BaseChartEditor) data).getChartCollection(); |
|
|
|
|
|
|
|
isRefreshing = true; |
|
|
|
@Override |
|
|
|
((MiddleChartComponent) designerEditor.getEditorTarget()).populate(collection); |
|
|
|
protected void initXCreatorProperties() { |
|
|
|
isRefreshing = false; |
|
|
|
super.initXCreatorProperties(); |
|
|
|
} |
|
|
|
initBorderStyle(); |
|
|
|
|
|
|
|
BaseChartCollection collection = ((BaseChartEditor) data).getChartCollection(); |
|
|
|
/** |
|
|
|
isRefreshing = true; |
|
|
|
* 点击选中的时候, 刷新界面 |
|
|
|
((MiddleChartComponent) designerEditor.getEditorTarget()).populate(collection); |
|
|
|
* 右键 reset之后, 触发事件 populate此方法 |
|
|
|
isRefreshing = false; |
|
|
|
* |
|
|
|
} |
|
|
|
* @param jform 表单 |
|
|
|
|
|
|
|
* @param formDesigner 表单设计器 |
|
|
|
/** |
|
|
|
* @return 控件. |
|
|
|
* 点击选中的时候, 刷新界面 |
|
|
|
*/ |
|
|
|
* 右键 reset之后, 触发事件 populate此方法 |
|
|
|
public JComponent createToolPane(final BaseJForm jform, final FormDesigner formDesigner) { |
|
|
|
* |
|
|
|
MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); |
|
|
|
* @param jform 表单 |
|
|
|
if (null != middleChartComponent) { |
|
|
|
* @param formDesigner 表单设计器 |
|
|
|
middleChartComponent.addStopEditingListener(new PropertyChangeAdapter() { |
|
|
|
* @return 控件. |
|
|
|
public void propertyChange() { |
|
|
|
*/ |
|
|
|
JComponent pane = jform.getEditingPane(); |
|
|
|
public JComponent createToolPane(final BaseJForm jform, final FormDesigner formDesigner) { |
|
|
|
if (pane instanceof BaseChartPropertyPane) { |
|
|
|
MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); |
|
|
|
((BaseChartPropertyPane) pane).setSupportCellData(true); |
|
|
|
if (null != middleChartComponent) { |
|
|
|
MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); |
|
|
|
middleChartComponent.addStopEditingListener(new PropertyChangeAdapter() { |
|
|
|
if (null != middleChartComponent) { |
|
|
|
public void propertyChange() { |
|
|
|
((BaseChartPropertyPane) pane).populateChartPropertyPane(middleChartComponent.update(), formDesigner); |
|
|
|
JComponent pane = jform.getEditingPane(); |
|
|
|
} |
|
|
|
if (pane instanceof BaseChartPropertyPane) { |
|
|
|
} |
|
|
|
((BaseChartPropertyPane) pane).setSupportCellData(true); |
|
|
|
} |
|
|
|
MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); |
|
|
|
}); |
|
|
|
if (null != middleChartComponent) { |
|
|
|
} |
|
|
|
((BaseChartPropertyPane) pane).populateChartPropertyPane(middleChartComponent.update(), formDesigner); |
|
|
|
if (isEditing){ |
|
|
|
} |
|
|
|
final BaseChartPropertyPane propertyPane = DesignModuleFactory.getChartPropertyPane(); |
|
|
|
} |
|
|
|
SwingUtilities.invokeLater(new Runnable() { |
|
|
|
} |
|
|
|
@Override |
|
|
|
}); |
|
|
|
public void run() { |
|
|
|
} |
|
|
|
if (getDesignerEditor().getEditorTarget() != null) { |
|
|
|
if (isEditing) { |
|
|
|
propertyPane.setSupportCellData(true); |
|
|
|
final BaseChartPropertyPane propertyPane = DesignModuleFactory.getChartPropertyPane(); |
|
|
|
MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); |
|
|
|
SwingUtilities.invokeLater(new Runnable() { |
|
|
|
if (null != middleChartComponent) { |
|
|
|
@Override |
|
|
|
propertyPane.populateChartPropertyPane(middleChartComponent.update(), formDesigner); |
|
|
|
public void run() { |
|
|
|
} |
|
|
|
if (getDesignerEditor().getEditorTarget() != null) { |
|
|
|
} |
|
|
|
propertyPane.setSupportCellData(true); |
|
|
|
} |
|
|
|
MiddleChartComponent middleChartComponent = getDesignerEditorTarget(); |
|
|
|
}); |
|
|
|
if (null != middleChartComponent) { |
|
|
|
return (JComponent)propertyPane; |
|
|
|
propertyPane.populateChartPropertyPane(middleChartComponent.update(), formDesigner); |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
} |
|
|
|
return (JComponent)DesignModuleFactory.getWidgetPropertyPane(formDesigner); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
return (JComponent) propertyPane; |
|
|
|
|
|
|
|
} else { |
|
|
|
private MiddleChartComponent getDesignerEditorTarget() { |
|
|
|
return (JComponent) DesignModuleFactory.getWidgetPropertyPane(formDesigner); |
|
|
|
MiddleChartComponent bcc = null; |
|
|
|
} |
|
|
|
if (getDesignerEditor().getEditorTarget() instanceof MiddleChartComponent) { |
|
|
|
} |
|
|
|
bcc = (MiddleChartComponent) getDesignerEditor().getEditorTarget(); |
|
|
|
|
|
|
|
} |
|
|
|
private MiddleChartComponent getDesignerEditorTarget() { |
|
|
|
return bcc; |
|
|
|
MiddleChartComponent bcc = null; |
|
|
|
} |
|
|
|
if (getDesignerEditor().getEditorTarget() instanceof MiddleChartComponent) { |
|
|
|
|
|
|
|
bcc = (MiddleChartComponent) getDesignerEditor().getEditorTarget(); |
|
|
|
/** |
|
|
|
} |
|
|
|
* 渲染Painter |
|
|
|
return bcc; |
|
|
|
*/ |
|
|
|
} |
|
|
|
public void paint(Graphics g) { |
|
|
|
|
|
|
|
designerEditor.paintEditor(g, this.getSize()); |
|
|
|
/** |
|
|
|
super.paint(g); |
|
|
|
* 渲染Painter |
|
|
|
if(isEditing){ |
|
|
|
*/ |
|
|
|
g.setColor(INNER_BORDER_COLOR); |
|
|
|
public void paint(Graphics g) { |
|
|
|
GraphHelper.draw(g, new Rectangle(0, 0, getWidth(), getHeight()), Constants.LINE_MEDIUM); |
|
|
|
designerEditor.paintEditor(g, this.getSize()); |
|
|
|
} |
|
|
|
super.paint(g); |
|
|
|
} |
|
|
|
if (isEditing) { |
|
|
|
|
|
|
|
g.setColor(INNER_BORDER_COLOR); |
|
|
|
/** |
|
|
|
GraphHelper.draw(g, new Rectangle(0, 0, getWidth(), getHeight()), Constants.LINE_MEDIUM); |
|
|
|
* 初始化Editor大小. |
|
|
|
} |
|
|
|
* |
|
|
|
} |
|
|
|
* @return 返回大小. |
|
|
|
|
|
|
|
*/ |
|
|
|
/** |
|
|
|
public Dimension initEditorSize() { |
|
|
|
* 初始化Editor大小. |
|
|
|
return BORDER_PREFERRED_SIZE; |
|
|
|
* |
|
|
|
} |
|
|
|
* @return 返回大小. |
|
|
|
|
|
|
|
*/ |
|
|
|
/** |
|
|
|
public Dimension initEditorSize() { |
|
|
|
* 响应点击事件 |
|
|
|
return BORDER_PREFERRED_SIZE; |
|
|
|
* |
|
|
|
} |
|
|
|
* @param editingMouseListener 鼠标点击,位置处理器 |
|
|
|
|
|
|
|
* @param e 鼠标点击事件 |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* 响应点击事件 |
|
|
|
public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ |
|
|
|
* |
|
|
|
FormDesigner designer = editingMouseListener.getDesigner(); |
|
|
|
* @param editingMouseListener 鼠标点击,位置处理器 |
|
|
|
SelectionModel selectionModel = editingMouseListener.getSelectionModel(); |
|
|
|
* @param e 鼠标点击事件 |
|
|
|
isEditing = e.getButton() == MouseEvent.BUTTON1 && |
|
|
|
*/ |
|
|
|
(e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR); |
|
|
|
public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { |
|
|
|
displayCoverPane(!isEditing); |
|
|
|
FormDesigner designer = editingMouseListener.getDesigner(); |
|
|
|
selectionModel.selectACreatorAtMouseEvent(e); |
|
|
|
SelectionModel selectionModel = editingMouseListener.getSelectionModel(); |
|
|
|
|
|
|
|
isEditing = e.getButton() == MouseEvent.BUTTON1 && |
|
|
|
if (editingMouseListener.stopEditing()) { |
|
|
|
(e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR); |
|
|
|
if (this != (XCreator)designer.getRootComponent()) { |
|
|
|
displayCoverPane(!isEditing); |
|
|
|
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); |
|
|
|
selectionModel.selectACreatorAtMouseEvent(e); |
|
|
|
editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); |
|
|
|
|
|
|
|
} |
|
|
|
if (editingMouseListener.stopEditing()) { |
|
|
|
} |
|
|
|
if (this != (XCreator) designer.getRootComponent()) { |
|
|
|
HelpDialogManager.getInstance().setPane(coverPanel); |
|
|
|
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); |
|
|
|
if (this.isHelpBtnOnFocus()) { |
|
|
|
editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); |
|
|
|
coverPanel.setMsgDisplay(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
HelpDialogManager.getInstance().setPane(coverPanel); |
|
|
|
|
|
|
|
if (this.isHelpBtnOnFocus()) { |
|
|
|
@Override |
|
|
|
coverPanel.setMsgDisplay(e); |
|
|
|
protected JComponent initEditor() { |
|
|
|
} |
|
|
|
if (designerEditor == null) { |
|
|
|
} |
|
|
|
final MiddleChartComponent chartComponent = DesignModuleFactory.getChartComponent(((BaseChartEditor) data).getChartCollection()); |
|
|
|
|
|
|
|
if (chartComponent != null) { |
|
|
|
@Override |
|
|
|
JComponent jChart = chartComponent; |
|
|
|
protected JComponent initEditor() { |
|
|
|
jChart.setBorder(BorderFactory.createLineBorder(Color.lightGray)); |
|
|
|
if (designerEditor == null) { |
|
|
|
designerEditor = new DesignerEditor<JComponent>(jChart); |
|
|
|
final MiddleChartComponent chartComponent = DesignModuleFactory.getChartComponent(((BaseChartEditor) data).getChartCollection()); |
|
|
|
chartComponent.addStopEditingListener(designerEditor); |
|
|
|
if (chartComponent != null) { |
|
|
|
designerEditor.addPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
JComponent jChart = chartComponent; |
|
|
|
public void propertyChange() { |
|
|
|
jChart.setBorder(BorderFactory.createLineBorder(Color.lightGray)); |
|
|
|
if (!isRefreshing) { |
|
|
|
designerEditor = new DesignerEditor<JComponent>(jChart); |
|
|
|
((BaseChartEditor) data).resetChangeChartCollection(chartComponent.update()); |
|
|
|
chartComponent.addStopEditingListener(designerEditor); |
|
|
|
} |
|
|
|
designerEditor.addPropertyChangeListener(new PropertyChangeAdapter() { |
|
|
|
} |
|
|
|
public void propertyChange() { |
|
|
|
}); |
|
|
|
if (!isRefreshing) { |
|
|
|
} |
|
|
|
((BaseChartEditor) data).resetChangeChartCollection(chartComponent.update()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (editor == null) { |
|
|
|
}); |
|
|
|
setBorder(DEFALUTBORDER); |
|
|
|
} |
|
|
|
editor = new JPanel(); |
|
|
|
} |
|
|
|
editor.setBackground(null); |
|
|
|
|
|
|
|
editor.setLayout(null); |
|
|
|
if (editor == null) { |
|
|
|
editor.setOpaque(false); |
|
|
|
setBorder(DEFALUTBORDER); |
|
|
|
|
|
|
|
editor = new JPanel(); |
|
|
|
coverPanel = new CoverReportPane(); |
|
|
|
editor.setBackground(null); |
|
|
|
coverPanel.setPreferredSize(this.getPreferredSize()); |
|
|
|
editor.setLayout(null); |
|
|
|
coverPanel.setBounds(this.getBounds()); |
|
|
|
editor.setOpaque(false); |
|
|
|
|
|
|
|
|
|
|
|
editor.add(coverPanel); |
|
|
|
coverPanel = new CoverReportPane(); |
|
|
|
coverPanel.setVisible(false); |
|
|
|
coverPanel.setPreferredSize(this.getPreferredSize()); |
|
|
|
} |
|
|
|
coverPanel.setBounds(this.getBounds()); |
|
|
|
return editor; |
|
|
|
|
|
|
|
} |
|
|
|
editor.add(coverPanel); |
|
|
|
|
|
|
|
coverPanel.setVisible(false); |
|
|
|
/** |
|
|
|
} |
|
|
|
* 是否展现覆盖的pane |
|
|
|
return editor; |
|
|
|
* @param display 是否 |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
public void displayCoverPane(boolean display){ |
|
|
|
/** |
|
|
|
isHovering = display; |
|
|
|
* 是否展现覆盖的pane |
|
|
|
coverPanel.setVisible(display); |
|
|
|
* |
|
|
|
coverPanel.setPreferredSize(editor.getPreferredSize()); |
|
|
|
* @param display 是否 |
|
|
|
coverPanel.setBounds(editor.getBounds()); |
|
|
|
*/ |
|
|
|
editor.repaint(); |
|
|
|
public void displayCoverPane(boolean display) { |
|
|
|
} |
|
|
|
isHovering = display; |
|
|
|
|
|
|
|
coverPanel.setVisible(display); |
|
|
|
public JComponent getCoverPane(){ |
|
|
|
coverPanel.setPreferredSize(editor.getPreferredSize()); |
|
|
|
return coverPanel; |
|
|
|
coverPanel.setBounds(editor.getBounds()); |
|
|
|
} |
|
|
|
editor.repaint(); |
|
|
|
|
|
|
|
} |
|
|
|
/** |
|
|
|
|
|
|
|
* 是否支持设置可用 |
|
|
|
public JComponent getCoverPane() { |
|
|
|
* return boolean |
|
|
|
return coverPanel; |
|
|
|
*/ |
|
|
|
} |
|
|
|
public boolean supportSetEnable(){ |
|
|
|
|
|
|
|
return false; |
|
|
|
/** |
|
|
|
} |
|
|
|
* 是否支持设置可用 |
|
|
|
|
|
|
|
* return boolean |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* data属性改变触发其他操作 |
|
|
|
public boolean supportSetEnable() { |
|
|
|
* |
|
|
|
return false; |
|
|
|
*/ |
|
|
|
} |
|
|
|
public void firePropertyChange(){ |
|
|
|
|
|
|
|
initStyle(); |
|
|
|
/** |
|
|
|
} |
|
|
|
* data属性改变触发其他操作 |
|
|
|
|
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void firePropertyChange() { |
|
|
|
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { |
|
|
|
initStyle(); |
|
|
|
return new WidgetPropertyUIProvider[]{ new ChartEditorPropertyUI(this)}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
/** |
|
|
|
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { |
|
|
|
* 是否支持共享-现只支持报表块、图表、tab块、绝对布局 |
|
|
|
return new WidgetPropertyUIProvider[]{new ChartEditorPropertyUI(this)}; |
|
|
|
* @return |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
public boolean isSupportShared() { |
|
|
|
/** |
|
|
|
return true; |
|
|
|
* 是否支持共享-现只支持报表块、图表、tab块、绝对布局 |
|
|
|
} |
|
|
|
* |
|
|
|
|
|
|
|
* @return |
|
|
|
@Override |
|
|
|
*/ |
|
|
|
public boolean supportMobileStyle() { |
|
|
|
public boolean isSupportShared() { |
|
|
|
return false; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean supportMobileStyle() { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|