Browse Source

修改代码格式

master
mengao 7 years ago
parent
commit
a6770fbc2f
  1. 7
      designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java
  2. 3
      designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java
  3. 8
      designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java
  4. 12
      designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java
  5. 7
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java
  6. 25
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  7. 16
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  8. 20
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  9. 7
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java
  10. 179
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

7
designer_base/src/com/fr/design/hyperlink/AbstractHyperLinkPane.java

@ -34,11 +34,12 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
this.parameterViewPane = parameterViewPane;
}
public boolean accept(Object ob){
public boolean accept(Object ob) {
return ob instanceof JavaScript;
}
public void reset() {}
public void reset() {
}
protected int getChartParaType() {
return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE;
@ -48,7 +49,7 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
return ValueEditorPaneFactory.createVallueEditorPaneWithUseType(getChartParaType(), hyperLinkEditorMap);
}
protected boolean needRenamePane(){
protected boolean needRenamePane() {
return needRenamePane;
}

3
designer_base/src/com/fr/design/hyperlink/AbstractHyperNorthPane.java

@ -78,7 +78,8 @@ public abstract class AbstractHyperNorthPane<T extends Hyperlink> extends BasicB
this.add(this.setFootPanel(), BorderLayout.SOUTH);
}
protected String[] getTargetFrames(){
protected String[] getTargetFrames() {
return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")};
}

8
designer_base/src/com/fr/design/hyperlink/ReporletHyperNorthPane.java

@ -84,11 +84,11 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
});
Component[][] components;
if(!this.needRenamePane){
if (!this.needRenamePane) {
components = new Component[][]{
{new UILabel(" " + Inter.getLocText("Reportlet") + ":"), reportletNamePane},
};
}else{
} else {
itemNameTextField = new UITextField();
components = new Component[][]{
{new UILabel(" " + Inter.getLocText("Name") + ":"), itemNameTextField},
@ -107,7 +107,7 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
@Override
protected void populateSubHyperlinkBean(ReportletHyperlink link) {
if(itemNameTextField != null){
if (itemNameTextField != null) {
this.itemNameTextField.setText(link.getItemName());
}
this.reportPathTextField.setText(link.getReportletPath());
@ -125,7 +125,7 @@ public class ReporletHyperNorthPane extends AbstractHyperNorthPane<ReportletHype
@Override
protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) {
if(itemNameTextField != null){
if (itemNameTextField != null) {
reportletHyperlink.setItemName(this.itemNameTextField.getText());
}
reportletHyperlink.setReportletPath(this.reportPathTextField.getText());

12
designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java

@ -23,7 +23,7 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
private boolean needRenamePane = false;
private UITextField urlTextField;
public WebHyperNorthPane(boolean needRenamePane){
public WebHyperNorthPane(boolean needRenamePane) {
this.needRenamePane = needRenamePane;
this.inits();
}
@ -55,12 +55,12 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
urlWithHelp.add(GUICoreUtils.createNamedPane(urlPane, "URL:"));
//urlWithHelp.add(label);
if(this.needRenamePane){
headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE,LayoutConstants.VGAP_SMALL));
if (this.needRenamePane) {
headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_SMALL));
itemNameTextField = new UITextField();
headerPane.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Designer_Name") + ":"), BorderLayout.NORTH);
headerPane.add(urlWithHelp, BorderLayout.CENTER);
}else{
} else {
headerPane.add(urlWithHelp, BorderLayout.NORTH);
}
@ -83,7 +83,7 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
url = ConfigManager.getProviderInstance().getHyperlinkAddress();
}
this.urlTextField.setText(url);
if(itemNameTextField != null){
if (itemNameTextField != null) {
this.itemNameTextField.setText(link.getItemName());
}
}
@ -98,7 +98,7 @@ public class WebHyperNorthPane extends AbstractHyperNorthPane<WebHyperlink> {
protected void updateSubHyperlinkBean(WebHyperlink webHyperlink) {
webHyperlink.setURL(this.urlTextField.getText());
if(itemNameTextField != null){
if (itemNameTextField != null) {
webHyperlink.setItemName(this.itemNameTextField.getText());
}
}

7
designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java

@ -45,7 +45,7 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter"));
extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters"));
this.add(GUICoreUtils.createFlowPane(new Component[] {useCJKCheckBox, extendParametersCheckBox}, FlowLayout.LEFT), BorderLayout.SOUTH);
this.add(GUICoreUtils.createFlowPane(new Component[]{useCJKCheckBox, extendParametersCheckBox}, FlowLayout.LEFT), BorderLayout.SOUTH);
}
@Override
@ -91,10 +91,11 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected());
}
public static class CHART_NO_RENAME extends WebHyperlinkPane{
protected boolean needRenamePane(){
public static class CHART_NO_RENAME extends WebHyperlinkPane {
protected boolean needRenamePane() {
return false;
}
protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE;
}

25
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -21,6 +21,7 @@ import java.util.HashMap;
/**
* 类说明: 图表超链 -- 弹出 悬浮窗.
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-12-28 上午10:41:39
*/
@ -32,7 +33,6 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
private ChartComponent chartComponent;
public ChartHyperPoplinkPane() {
this(null, false);
}
@ -41,18 +41,18 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
super(hyperLinkEditorMap, needRenamePane);
this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
if(this.needRenamePane()){
if (this.needRenamePane()) {
itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("FR-Chart-Use_Name") + ":"), BorderLayout.NORTH);
}
hyperEditPane = new ChartHyperEditPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
hyperEditPane.setPreferredSize(new Dimension(EDIT_PANE_WIDTH, (int)hyperEditPane.getPreferredSize().getHeight()));// 固定属性配置面板大小,灵活调整图表显示面板.
hyperEditPane.setPreferredSize(new Dimension(EDIT_PANE_WIDTH, (int) hyperEditPane.getPreferredSize().getHeight()));// 固定属性配置面板大小,灵活调整图表显示面板.
this.add(hyperEditPane, BorderLayout.WEST);
ChartCollection cc = createChartCollection();
chartComponent = new ChartComponent();
chartComponent.setPreferredSize(new Dimension((int)this.getPreferredSize().getWidth()-EDIT_PANE_WIDTH, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth() - EDIT_PANE_WIDTH, 170));// 在单元格弹出时 需要调整保证属性表的大小.
chartComponent.setSupportEdit(false);
chartComponent.populate(cc);
@ -67,14 +67,14 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
ChartCollection cc = new ChartCollection();
Chart chart = ChartTypeManager.getFirstChart();
if (chart != null){
if (chart != null) {
try {
cc.addChart((Chart)chart.clone());
cc.addChart((Chart) chart.clone());
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error(e.getMessage(), e);
}
}else {
} else {
cc.addChart(new Chart(new Bar2DPlot()));
}
return cc;
@ -87,7 +87,7 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
@Override
public void populateBean(ChartHyperPoplink chartHyperlink) {
if(itemNameTextField != null){
if (itemNameTextField != null) {
this.itemNameTextField.setText(chartHyperlink.getItemName());
}
@ -103,12 +103,13 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
/**
* 超链数组HyperlinkGoup切换时 updateBean.
*
* @return 返回的弹出超链.
*/
public ChartHyperPoplink updateBean() {
ChartHyperPoplink chartLink = new ChartHyperPoplink();
updateBean(chartLink);
if(itemNameTextField != null){
if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText());
}
return chartLink;
@ -122,13 +123,13 @@ public class ChartHyperPoplinkPane extends AbstractHyperLinkPane<ChartHyperPopli
chartHyperlink.setChartCollection(chartComponent.update());
DesignModuleFactory.getChartPropertyPane().getChartEditPane().fire();// 响应整个图表保存事件等.
if(itemNameTextField != null){
if (itemNameTextField != null) {
chartHyperlink.setItemName(this.itemNameTextField.getText());
}
}
public static class CHART_NO_RENAME extends ChartHyperPoplinkPane{
protected boolean needRenamePane(){
public static class CHART_NO_RENAME extends ChartHyperPoplinkPane {
protected boolean needRenamePane() {
return false;
}
}

16
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java

@ -40,7 +40,7 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
private void initComponent() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
if(needRenamePane()){
if (needRenamePane()) {
itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH);
}
@ -61,13 +61,13 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
@Override
public void populateBean(ChartHyperRelateCellLink ob) {
if(ob == null) {
if (ob == null) {
return;
}
if(itemNameTextField != null){
if (itemNameTextField != null) {
itemNameTextField.setText(ob.getItemName());
}
if(ob.getRelateCCName() != null) {
if (ob.getRelateCCName() != null) {
ColumnRow colRow = ColumnRow.valueOf(ob.getRelateCCName());
colRowPane.populate(colRow);
} else {
@ -85,7 +85,7 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
public ChartHyperRelateCellLink updateBean() {
ChartHyperRelateCellLink chartLink = new ChartHyperRelateCellLink();
updateBean(chartLink);
if(itemNameTextField != null){
if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText());
}
return chartLink;
@ -106,7 +106,7 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
} else {
chartLink.setParameters(null);
}
if(itemNameTextField != null){
if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText());
}
}
@ -116,8 +116,8 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
return Inter.getLocText(new String[]{"Related", "Cell"});
}
public static class CHART_NO_RENAME extends ChartHyperRelateCellLinkPane{
protected boolean needRenamePane(){
public static class CHART_NO_RENAME extends ChartHyperRelateCellLinkPane {
protected boolean needRenamePane() {
return false;
}
}

20
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

@ -48,7 +48,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
if(needRenamePane()){
if (needRenamePane()) {
itemNameTextField = new UITextField();
this.add(GUICoreUtils.createNamedPane(itemNameTextField, Inter.getLocText("Name") + ":"), BorderLayout.NORTH);
}
@ -77,7 +77,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
private String[] getFloatNames() {
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
if(adapter != null ) {
if (adapter != null) {
return adapter.getFloatNames();
}
return new String[0];
@ -85,11 +85,11 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
@Override
public void populateBean(ChartHyperRelateFloatLink ob) {
if(ob == null) {
return ;
if (ob == null) {
return;
}
if(itemNameTextField != null){
if (itemNameTextField != null) {
itemNameTextField.setText(ob.getItemName());
}
@ -106,7 +106,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
public ChartHyperRelateFloatLink updateBean() {
ChartHyperRelateFloatLink chartLink = new ChartHyperRelateFloatLink();
updateBean(chartLink);
if(itemNameTextField != null){
if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText());
}
return chartLink;
@ -114,7 +114,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
public void updateBean(ChartHyperRelateFloatLink chartLink) {
if(floatNameBox.getSelectedItem() != null) {
if (floatNameBox.getSelectedItem() != null) {
chartLink.setRelateCCName(Utils.objectToString(floatNameBox.getSelectedItem()));
}
@ -127,7 +127,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
} else {
chartLink.setParameters(null);
}
if(itemNameTextField != null){
if (itemNameTextField != null) {
chartLink.setItemName(this.itemNameTextField.getText());
}
}
@ -137,8 +137,8 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
return Inter.getLocText(new String[]{"Related", "M_Insert-Float"});
}
public static class CHART_NO_RENAME extends ChartHyperRelateFloatLinkPane{
protected boolean needRenamePane(){
public static class CHART_NO_RENAME extends ChartHyperRelateFloatLinkPane {
protected boolean needRenamePane() {
return false;
}
}

7
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

@ -48,7 +48,7 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
}
protected int getHyperlinkType() {
if (northPane.getEditingEditor() != null){
if (northPane.getEditingEditor() != null) {
if (northPane.getEditingEditor().acceptType(ElementCaseEditorProvider.class)) {
return FormHyperlinkProvider.ELEMENTCASE;
}
@ -92,10 +92,11 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
}
}
public static class CHART_NO_RENAME extends FormHyperlinkPane{
protected boolean needRenamePane(){
public static class CHART_NO_RENAME extends FormHyperlinkPane {
protected boolean needRenamePane() {
return false;
}
protected int getChartParaType() {
return ParameterTableModel.CHART_NORMAL_USE;
}

179
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

@ -75,7 +75,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver{
public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver {
private static final long serialVersionUID = 3477409806918835992L;
private static HashMap normalMap = new HashMap();
@ -131,6 +131,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private static final int SIZEX = 258;
private static final int SIZEY = 209;
private static final int DET = 20;
public ChartInteractivePane(ChartOtherPane parent) {
super();
this.parent = parent;
@ -138,6 +139,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
/**
* 界面标题.
*
* @return 返回标题.
*/
public String title4PopupWindow() {
@ -153,9 +155,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent"));
dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
tooltipStyle = new UIComboBox(new String []{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")});
tooltipStyle = new UIComboBox(new String[]{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")});
tooltipStyleLabel = new UILabel(Inter.getLocText("Chart-Style_Name"));
tooltipShowType = new UIComboBox(new String []{Inter.getLocText("Chart-Series_SingleData"), Inter.getLocText("Chart-Series_AllData")});
tooltipShowType = new UIComboBox(new String[]{Inter.getLocText("Chart-Series_SingleData"), Inter.getLocText("Chart-Series_AllData")});
tooltipShowTypeLabel = new UILabel(Inter.getLocText("Chart-Use_Show"));
isAddressTittle = new UICheckBox(Inter.getLocText("Chart-Area_Title"));
@ -188,7 +190,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
@Override
public void itemStateChanged(ItemEvent e) {
timeSwitch.setEnabled(isAxisZoom.isSelected());
if(!isAxisZoom.isSelected()){
if (!isAxisZoom.isSelected()) {
timeSwitch.setSelected(false);
}
}
@ -260,6 +262,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
/**
* 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件.
*
* @return
*/
private JPanel initPaneWithListener() {
@ -287,13 +290,12 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
private void initTimeSwitchPane(){
private void initTimeSwitchPane() {
timeSwitchContainer = new JPanel(new BorderLayout());
timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER);
}
/**
* 全部初始化, 对所有的界面 都加入, 然后会加载事件响应. 后续再relayout.
*/
@ -306,12 +308,12 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat},
new Component[]{isAddress, null},
new Component[]{isAddressName,null},
new Component[]{isAddressName, null},
new Component[]{isAddressTittle, null},
new Component[]{tooltipShowTypeLabel, tooltipShowType},
new Component[]{tooltipStyleLabel, tooltipStyle}
};
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize);
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize);
}
private void relayoutDataPointToolTipPane(Plot plot) {
@ -320,21 +322,21 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p};
if(plot.isShowAllDataPointLabel()) {
if (plot.isShowAllDataPointLabel()) {
isDatapointPercent.setText(Inter.getLocText("Chart-Value_Conversion"));
}
if(plot.isSupportAddress4Gis()) {
if (plot.isSupportAddress4Gis()) {
UIButton tmpButton = new UIButton(); //用来调整对齐
tmpButton.setVisible(false);
rowSize = new double[]{p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{isAddress, null},
new Component[]{isAddressName,null},
new Component[]{isAddressName, null},
new Component[]{isAddressTittle, tmpButton},
new Component[]{isDatapointValue, dataPointValueFormat},
};
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize);
} else if(plot.isSupportValuePercent()) {
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize);
} else if (plot.isSupportValuePercent()) {
Component[][] components;
if (plot.isSupportTooltipSeriesType()) {
rowSize = new double[]{p, p, p, p};
@ -352,13 +354,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
getTooltipStyleComponent()
};
}
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize);
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize);
} else {
Component[][] components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat},
getTooltipStyleComponent()
};
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize);
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"}, components, rowSize, columnSize);
}
}
@ -369,8 +371,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{tooltipShowTypeLabel, tooltipShowType}
};
double[] newColumnSize = new double[]{f, p};
double []newRowSize = new double[]{p};
return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
double[] newRowSize = new double[]{p};
return new Component[]{TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
}
private Component[] getTooltipStyleComponent() {
@ -380,8 +382,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{tooltipStyleLabel, tooltipStyle}
};
double[] newColumnSize = new double[]{f, p};
double []newRowSize = new double[]{p};
return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
double[] newRowSize = new double[]{p};
return new Component[]{TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
}
private void initAxisShowPane() {
@ -391,17 +393,17 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
Component[][] components = new Component[][]{
new Component[]{isAxisShowToolTip},
};
axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize);
axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"}, components, rowSize, columnSize);
}
private void initAutoRefreshPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p,p};
double[] rowSize = new double[]{p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{isAutoRefresh,null},
new Component[]{isAutoRefresh, null},
new Component[]{GUICoreUtils.createFlowPane(new Component[]{
new UILabel(Inter.getLocText("Chart-Time_Interval")),
autoRefreshTime,
@ -409,7 +411,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}, 1)},
new Component[]{new UILabel("<html><font size='2' face='Microsoft Yahei' color='red'>" + Inter.getLocText("FR-Chart-AutoRefresh_NotSupportIMGAndReportData") + "</font></html>"), null},
};
autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"},components, rowSize, columnSize);
autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"}, components, rowSize, columnSize);
}
private void initSuperlinkPane() {
@ -421,7 +423,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{superLink, null},
};
superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize);
superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"}, components, rowSize, columnSize);
}
private void relayoutWithPlot(Plot plot) {
@ -445,7 +447,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private Component[] getChartAnimatePane(Plot plot, double[] row, double[] col) {
if(plot.isSupportAnimate() && plot.isSupportSeriesDrag()) {
if (plot.isSupportAnimate() && plot.isSupportSeriesDrag()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{
new Component[]{isChartAnimation},
@ -453,7 +455,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{new JSeparator()}
}, row, col)
};
}else if(plot.isSupportAnimate() && !plot.isSupportSeriesDrag()){
} else if (plot.isSupportAnimate() && !plot.isSupportSeriesDrag()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{
new Component[]{isChartAnimation},
@ -464,33 +466,33 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return new Component[]{null};
}
private void relayoutTimeSwitchPane(){
private void relayoutTimeSwitchPane() {
timeSwitchContainer.removeAll();
timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER);
if(timeSwitch.isSelected()){
if (timeSwitch.isSelected()) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{TIME_SWITCH_GAP,f};
double[] columnSize = new double[]{TIME_SWITCH_GAP, f};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{null, timeSwitchPane},
};
JPanel panel= TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
timeSwitchContainer.add(panel, BorderLayout.SOUTH);
}
timeSwitchContainer.revalidate();
}
private Component[] getChartScalePane(Plot plot, double[] row, double[] col) {
boolean isNeedTimeSwitch = plot.getxAxis()!=null && plot.getxAxis().isDate();
if(plot.isSupportZoomCategoryAxis() && !isNeedTimeSwitch) {
boolean isNeedTimeSwitch = plot.getxAxis() != null && plot.getxAxis().isDate();
if (plot.isSupportZoomCategoryAxis() && !isNeedTimeSwitch) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{
new Component[]{isAxisZoom},
new Component[]{new JSeparator()}
}, row, col)
};
}else if(plot.isSupportZoomCategoryAxis() && isNeedTimeSwitch){
} else if (plot.isSupportZoomCategoryAxis() && isNeedTimeSwitch) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{
new Component[]{isAxisZoom},
@ -504,7 +506,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private Component[] getDataTooltipPane(Plot plot, double[] row, double[] col) {
relayoutDataPointToolTipPane(plot);
if(plot.isSupportTooltipInInteractivePane()) {
if (plot.isSupportTooltipInInteractivePane()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{tooltipPane}, new Component[]{new JSeparator()}}, row, col)};
}
@ -512,7 +514,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
private Component[] getAxisTipPane(Plot plot, double[] row, double[] col) {
if(plot.isSupportAxisTip()) {
if (plot.isSupportAxisTip()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(new Component[][]{
new Component[]{axisShowPane}, new Component[]{new JSeparator()}}, row, col)};
@ -521,7 +523,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
private Component[] getAutoRefreshPane(Plot plot, double[] row, double[] col) {
if(plot.isSupportAutoRefresh()) {
if (plot.isSupportAutoRefresh()) {
return new Component[]{TableLayoutHelper.createTableLayoutPane(
new Component[][]{
new Component[]{autoRefreshPane},
@ -544,7 +546,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
Plot plot = chart.getPlot();
this.plot =plot;
this.plot = plot;
relayoutWithGis(chart, plot);
relayoutWithPlot(plot);
@ -559,59 +561,59 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
private void relayoutWithGis(Chart chart, Plot plot) {
if(plot.isSupportAddress4Gis()) {
if (plot.isSupportAddress4Gis()) {
TopDefinitionProvider definition = chart.getFilterDefinition();
boolean addressType = true;
if(definition instanceof GisMapTableDefinition){
addressType = ((GisMapTableDefinition)definition).isAddress();
}else if(definition instanceof GisMapReportDefinition){
addressType = ((GisMapReportDefinition)definition).isAddress();
if (definition instanceof GisMapTableDefinition) {
addressType = ((GisMapTableDefinition) definition).isAddress();
} else if (definition instanceof GisMapReportDefinition) {
addressType = ((GisMapReportDefinition) definition).isAddress();
}
if(addressType){
if (addressType) {
this.isAddress.setText(Inter.getLocText("Chart-Use_Address"));
}else{
} else {
this.isAddress.setText(Inter.getLocText("Chart-Use_LatLng"));
}
}
}
private void populateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) {
if (plot.isSupportAnimate()) {
isChartAnimation.setSelected(chart.isJSDraw());
}
if(plot.isSupportSeriesDrag()){
if (plot.isSupportSeriesDrag()) {
isSeriesDragEnable.setSelected(plot.isSeriesDragEnable());
}
}
private void populateChartScale(Plot plot) {
if(plot.isSupportZoomCategoryAxis()) {
if (plot.isSupportZoomCategoryAxis()) {
isAxisZoom.setSelected(plot.getxAxis() != null && plot.getxAxis().isZoom());
}
timeSwitch.setSelected(false);
timeSwitch.setEnabled(false);
//只有坐标轴为时间坐标轴,并且勾选了图表缩放的时候,才支持时间切换
if(!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()){
if (!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()) {
return;
}
if(plot.getxAxis() ==null && !plot.getxAxis().isDate()){
if (plot.getxAxis() == null && !plot.getxAxis().isDate()) {
return;
}
timeSwitch.setEnabled(true);
ArrayList<TimeSwitchAttr> timeMap=plot.getxAxis().getTimeSwitchMap();
ArrayList<TimeSwitchAttr> timeMap = plot.getxAxis().getTimeSwitchMap();
timeSwitch.setSelected(timeMap != null && !timeMap.isEmpty());
if(timeSwitch.isSelected()){
if (timeSwitch.isSelected()) {
timeSwitchPane.populate(plot);
}
}
private void populateDataTooltip(Plot plot) {
if(plot.isSupportTooltipInInteractivePane()) {
if (plot.isSupportTooltipInInteractivePane()) {
AttrContents contents = plot.getHotTooltipStyle();
if (contents == null) {
return;
@ -627,12 +629,12 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} else {
tooltipStyle.setSelectedIndex(1);
}
if(plot.isSupportValuePercent()) {
if (plot.isSupportValuePercent()) {
percentFormat = contents.getPercentFormat();
isDatapointPercent.setSelected(dataLabel.contains(ChartConstants.PERCENT_PARA));
}
if(plot.isSupportAddress4Gis()) {
if (plot.isSupportAddress4Gis()) {
isAddressTittle.setSelected(dataLabel.contains(ChartConstants.AREA_TITTLE_PARA));
isAddress.setSelected(dataLabel.contains(ChartConstants.ADDRESS_PARA));
isAddressName.setSelected(dataLabel.contains(ChartConstants.ADDRESS_NAME_PARA));
@ -649,14 +651,14 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
private void populateAxisTip(Plot plot) {
if(plot.isSupportAxisTip()) {
if (plot.isSupportAxisTip()) {
isAxisShowToolTip.setSelected(plot.isInteractiveAxisTooltip());
}
}
protected void populateAutoRefresh(Chart chart) {
Plot plot = chart.getPlot();
if(plot.isSupportAutoRefresh()) {
if (plot.isSupportAutoRefresh()) {
if (plot.getAutoRefreshPerSecond() < 1) {
isAutoRefresh.setSelected(false);
autoRefreshTime.setValue(2);
@ -682,9 +684,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
List<ChartUIMenuNameableCreator> hyperList = new ArrayList<ChartUIMenuNameableCreator>();
NameJavaScriptGroup nameGroup = plot.getHotHyperLink();
for(int i = 0; nameGroup != null && i < nameGroup.size(); i++) {
for (int i = 0; nameGroup != null && i < nameGroup.size(); i++) {
NameJavaScript javaScript = nameGroup.getNameHyperlink(i);
if(javaScript != null && javaScript.getJavaScript() != null) {
if (javaScript != null && javaScript.getJavaScript() != null) {
JavaScript script = javaScript.getJavaScript();
hyperList.add(new ChartUIMenuNameableCreator(plot.getHyperLinkEditorMap(), javaScript.getName(), script, getUseMap(paneMap, script.getClass())));
}
@ -711,35 +713,35 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
private void updateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) {
if (plot.isSupportAnimate()) {
chart.setJSDraw(isChartAnimation.isSelected());
}
if(plot.isSupportSeriesDrag()){
if (plot.isSupportSeriesDrag()) {
plot.setSeriesDragEnable(isSeriesDragEnable.isSelected());
}
}
private void updateChartScale(Plot plot) {
if(plot.isSupportZoomCategoryAxis() && plot.getxAxis() != null) {
if (plot.isSupportZoomCategoryAxis() && plot.getxAxis() != null) {
plot.getxAxis().setZoom(isAxisZoom.isSelected());
}
if(plot.getxAxis() == null){
if (plot.getxAxis() == null) {
return;
}
boolean isNeedTimeSwitch = plot.getxAxis()!=null && plot.getxAxis().isDate();
boolean isNeedTimeSwitch = plot.getxAxis() != null && plot.getxAxis().isDate();
boolean isClear = !isNeedTimeSwitch || !timeSwitch.isSelected();
if(isClear && plot.getxAxis().getTimeSwitchMap() != null){
if (isClear && plot.getxAxis().getTimeSwitchMap() != null) {
plot.getxAxis().getTimeSwitchMap().clear();
return;
}
if(plot.getxAxis().isDate() && timeSwitch.isSelected()){
if (plot.getxAxis().isDate() && timeSwitch.isSelected()) {
timeSwitchPane.update(plot);
}
}
private void updateDataTooltip(Plot plot) {
if(plot.isSupportTooltipInInteractivePane()) {
if (plot.isSupportTooltipInInteractivePane()) {
AttrContents seriesAttrContents = plot.getHotTooltipStyle();
if (seriesAttrContents == null) {
seriesAttrContents = new AttrContents();
@ -747,18 +749,18 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
String contents = plot.isSupportAddress4Gis() ? getGisTooltipContent() : getTooltipContent(plot);
seriesAttrContents.setSeriesLabel(contents);
if(tooltipStyle != null){
if (tooltipStyle != null) {
boolean isWhiteBackground = tooltipStyle.getSelectedIndex() == 0;
seriesAttrContents.setWhiteBackground(isWhiteBackground);
}
if(tooltipShowType != null){
if (tooltipShowType != null) {
boolean isShowMutiSeries = plot.isSupportTooltipSeriesType() && tooltipShowType.getSelectedIndex() == 1;
seriesAttrContents.setShowMutiSeries(isShowMutiSeries);
}
seriesAttrContents.setFormat(valueFormat);
if(plot.isSupportValuePercent()) {
if (plot.isSupportValuePercent()) {
if (percentFormat != null) {
seriesAttrContents.setPercentFormat(percentFormat);
}
@ -786,23 +788,24 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
String contents = StringUtils.EMPTY;
contents += ChartConstants.SERIES_PARA + ChartConstants.BREAKLINE_PARA + ChartConstants.CATEGORY_PARA;
boolean noPara = true;
if(isDatapointValue.isSelected()){
if (isDatapointValue.isSelected()) {
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.VALUE_PARA;
noPara = false;
}
if(isAddressTittle.isSelected()){
if (isAddressTittle.isSelected()) {
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.AREA_TITTLE_PARA;
noPara = false;
}
if(isAddress.isSelected()){
if (isAddress.isSelected()) {
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_PARA;
noPara = false;
}
if(isAddressName.isSelected()){
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_NAME_PARA;;
if (isAddressName.isSelected()) {
contents += ChartConstants.BREAKLINE_PARA + ChartConstants.ADDRESS_NAME_PARA;
;
noPara = false;
}
if(noPara){
if (noPara) {
contents = null;
}
@ -816,8 +819,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
private void updateAutoRefresh(Plot plot) {
if(plot.isSupportAutoRefresh()) {
if(isAutoRefresh.isSelected() && autoRefreshTime.getValue() >= 2) {
if (plot.isSupportAutoRefresh()) {
if (isAutoRefresh.isSelected() && autoRefreshTime.getValue() >= 2) {
plot.setAutoRefreshPerSecond((int) autoRefreshTime.getValue());
} else {
plot.setAutoRefreshPerSecond(0);
@ -831,9 +834,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
superLink.resetItemName();
List list = superLink.updateBean();
for(int i = 0; i < list.size(); i++) {
UIMenuNameableCreator menu = (UIMenuNameableCreator)list.get(i);
NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj());
for (int i = 0; i < list.size(); i++) {
UIMenuNameableCreator menu = (UIMenuNameableCreator) list.get(i);
NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript) menu.getObj());
nameGroup.addNameHyperlink(nameJava);
}
plot.setHotHyperLink(nameGroup);
@ -841,16 +844,16 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) {
if(map.get(key) != null){
return (Class<? extends BasicBeanPane>)map.get(key);
if (map.get(key) != null) {
return (Class<? extends BasicBeanPane>) map.get(key);
}
//引擎在这边放了个provider。。
Iterator iterator = map.keySet().iterator();
while (iterator.hasNext()){
Class clz = (Class)iterator.next();
if(clz.isAssignableFrom((Class)key)){
return (Class<? extends BasicBeanPane>)map.get(clz);
while (iterator.hasNext()) {
Class clz = (Class) iterator.next();
if (clz.isAssignableFrom((Class) key)) {
return (Class<? extends BasicBeanPane>) map.get(clz);
}
}
return null;
@ -884,7 +887,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
private HashMap getPlotHyperMap() {
if(normalMap.isEmpty()) {
if (normalMap.isEmpty()) {
FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.class);
@ -899,7 +902,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
normalMap.put(FormHyperlinkProvider.class, FormHyperlinkPane.class);
//兼容老的FormHyperlink.class
if(fp != null){
if (fp != null) {
normalMap.put(fp.getClass(), FormHyperlinkPane.class);
}
}

Loading…
Cancel
Save