|
|
@ -22,12 +22,10 @@ import com.fr.form.ui.container.WSortLayout; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
import com.fr.general.SiteCenter; |
|
|
|
import com.fr.general.SiteCenter; |
|
|
|
import com.fr.json.JSONException; |
|
|
|
import com.fr.json.JSONException; |
|
|
|
import com.fr.json.JSONObject; |
|
|
|
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.report.ExtraReportClassManager; |
|
|
|
import com.fr.report.ExtraReportClassManager; |
|
|
|
import com.fr.report.fun.LocationAttrProvider; |
|
|
|
import com.fr.report.fun.MobileParamStyleProvider; |
|
|
|
import com.fr.report.fun.impl.AbstractLocationAttrProvider; |
|
|
|
import com.fr.report.mobile.DefaultMobileParamStyle; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
@ -90,10 +88,10 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
if (ExtraReportClassManager.getInstance().getArray(LocationAttrProvider.MARK_STRING).size() != 0) { |
|
|
|
if (ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING).size() != 0) { |
|
|
|
tipLabel = null; |
|
|
|
tipLabel = null; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
((WParameterLayout) (paraCreator.toData())).setProvider((LocationAttrProvider) ((Item) paramLocationComboBox.getItemAt(0)).getValue()); |
|
|
|
((WParameterLayout) (paraCreator.toData())).setProvider((MobileParamStyleProvider) ((Item) paramLocationComboBox.getItemAt(0)).getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Parameter_Panel")), paramLocationComboBox}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Parameter_Panel")), paramLocationComboBox}, |
|
|
@ -107,9 +105,9 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Item[] getItems() { |
|
|
|
private Item[] getItems() { |
|
|
|
Set<LocationAttrProvider> pluginCreators = ExtraReportClassManager.getInstance().getArray(LocationAttrProvider.MARK_STRING); |
|
|
|
Set<MobileParamStyleProvider> pluginCreators = ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING); |
|
|
|
Item[] items = new Item[pluginCreators.size() + 1]; |
|
|
|
Item[] items = new Item[pluginCreators.size() + 1]; |
|
|
|
LocationAttrProvider provider = getDefaultLocationAttr(); |
|
|
|
MobileParamStyleProvider provider = new DefaultMobileParamStyle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")); |
|
|
|
items[0] = new Item(provider.descriptor(), provider); |
|
|
|
items[0] = new Item(provider.descriptor(), provider); |
|
|
|
for (int i = 0; i < pluginCreators.size(); i++) { |
|
|
|
for (int i = 0; i < pluginCreators.size(); i++) { |
|
|
|
provider = pluginCreators.iterator().next(); |
|
|
|
provider = pluginCreators.iterator().next(); |
|
|
@ -120,11 +118,10 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
|
|
|
|
|
|
|
|
private UILabel getTipLabel() { |
|
|
|
private UILabel getTipLabel() { |
|
|
|
UILabel tipLabel = new UILabel(); |
|
|
|
UILabel tipLabel = new UILabel(); |
|
|
|
String[] strings = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile_Tip").split("\\|"); |
|
|
|
|
|
|
|
StringBuilder text = new StringBuilder(); |
|
|
|
StringBuilder text = new StringBuilder(); |
|
|
|
text.append("<html><font color=gray>").append(strings[0]) |
|
|
|
text.append("<html><font color=gray>").append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile_Tip")) |
|
|
|
.append("</font><font color=blue><u>").append(strings[1]) |
|
|
|
.append("</font><font color=blue><u>").append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile_Install_Parameter_Pane_Plugin")) |
|
|
|
.append("</u></font><font color=gray>").append(strings[2]) |
|
|
|
.append("</u></font><font color=gray>").append(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Properties_Mobile_To_Get_More_Style")) |
|
|
|
.append("</font></html>"); |
|
|
|
.append("</font></html>"); |
|
|
|
tipLabel.setText(text.toString()); |
|
|
|
tipLabel.setText(text.toString()); |
|
|
|
tipLabel.addMouseListener(new MouseAdapter() { |
|
|
|
tipLabel.addMouseListener(new MouseAdapter() { |
|
|
@ -169,33 +166,13 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
|
|
if (e.getStateChange() == ItemEvent.SELECTED) { |
|
|
|
((WParameterLayout) (paraCreator.toData())).setProvider((LocationAttrProvider) ((Item) e.getItem()).getValue()); |
|
|
|
((WParameterLayout) (paraCreator.toData())).setProvider((MobileParamStyleProvider) ((Item) e.getItem()).getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
return paramLocationComoBox; |
|
|
|
return paramLocationComoBox; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private LocationAttrProvider getDefaultLocationAttr() { |
|
|
|
|
|
|
|
return new AbstractLocationAttrProvider() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String descriptor() { |
|
|
|
|
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public JSONObject createJSON() { |
|
|
|
|
|
|
|
JSONObject jo = JSONObject.create(); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
jo.put("queryType", "default"); |
|
|
|
|
|
|
|
} catch (JSONException e) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return jo; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 控件顺序
|
|
|
|
// 控件顺序
|
|
|
|
private UIExpandablePane getMobileWidgetListPane() { |
|
|
|
private UIExpandablePane getMobileWidgetListPane() { |
|
|
|
mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); |
|
|
|
mobileWidgetListPane = new MobileWidgetListPane(designer, (WSortLayout) paraCreator.toData()); |
|
|
@ -232,10 +209,10 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { |
|
|
|
this.addAttributeChangeListener(changeListener); |
|
|
|
this.addAttributeChangeListener(changeListener); |
|
|
|
int index = 0; |
|
|
|
int index = 0; |
|
|
|
try { |
|
|
|
try { |
|
|
|
LocationAttrProvider provider = ((WParameterLayout) paraCreator.toData()).getProvider(); |
|
|
|
MobileParamStyleProvider provider = ((WParameterLayout) paraCreator.toData()).getProvider(); |
|
|
|
String currentQueryType = provider.createJSON().getString("queryType"); |
|
|
|
String currentQueryType = provider.createJSON().getString("queryType"); |
|
|
|
for (int i = 0; i < items.length; i++) { |
|
|
|
for (int i = 0; i < items.length; i++) { |
|
|
|
String existedQueryType = ((LocationAttrProvider) items[i].getValue()).createJSON().getString("queryType"); |
|
|
|
String existedQueryType = ((MobileParamStyleProvider) items[i].getValue()).createJSON().getString("queryType"); |
|
|
|
if (ComparatorUtils.equals(existedQueryType, currentQueryType)) { |
|
|
|
if (ComparatorUtils.equals(existedQueryType, currentQueryType)) { |
|
|
|
index = i; |
|
|
|
index = i; |
|
|
|
break; |
|
|
|
break; |
|
|
|