xiaoxia 8 years ago
parent
commit
a3c0e0493b
  1. 54
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  2. 39
      designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
  3. 3
      designer_form/src/com/fr/design/mainframe/JForm.java

54
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -222,16 +222,16 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
return ChartTypeManager.getInstance().containsPlot(plotID); return ChartTypeManager.getInstance().containsPlot(plotID);
} }
/** /**
* 把所有的pane加到list里 * 把所有的pane加到list里
* *
* @param paneList pane容器 * @param paneList pane容器
*/ */
public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) { public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); List<Integer> priorityList = getPriorityInOrder();
while (iterator.hasNext()) { for (int i = 0; i < priorityList.size(); i++){
Map.Entry entry = (Map.Entry) iterator.next(); String priority = String.valueOf(priorityList.get(i));
String priority = (String) entry.getKey();
Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator(); Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator();
while (chartUIIterator.hasNext()) { while (chartUIIterator.hasNext()) {
Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next(); Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next();
@ -276,32 +276,40 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
} }
private String[] getTitle4PopupWindow(){ private String[] getTitle4PopupWindow(){
List<Integer> priorityList = new ArrayList<Integer>(); List<Integer> priorityList = getPriorityInOrder();
if (priorityList.size() == 0){
return new String[0];
}
int size = 0; int size = 0;
if (chartTypeInterfaces != null){ //获取总得图表格式
for (int i = 0; i < priorityList.size(); i++) {
size += getChartSize(String.valueOf(priorityList.get(i)));
}
String[] names = new String[size];
int index = 0;
for (int i = 0; i < priorityList.size(); i++){
String priority = String.valueOf(priorityList.get(i));
Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator();
index = fetchNames(chartUI, names, index);
}
return names;
}
private List<Integer> getPriorityInOrder() {
List<Integer> priorityList = new ArrayList<Integer>();
if (chartTypeInterfaces != null) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){ while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next(); Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey(); String priority = (String) entry.getKey();
priorityList.add(Integer.valueOf(priority)); priorityList.add(Integer.valueOf(priority));
size += getChartSize(priority);
} }
String[] names = new String[size];
priorityList = ChartTypeManager.orderInPriority(priorityList);
int index = 0;
for (int i = 0; i < priorityList.size(); i++){
String priority = String.valueOf(priorityList.get(i));
Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator();
index = fetchNames(chartUI, names, index);
}
return names;
} }
return ChartTypeManager.orderInPriority(priorityList);
return new String[0];
} }
private int fetchNames(Iterator chartUI, String[] names, int index) { private int fetchNames(Iterator chartUI, String[] names, int index) {

39
designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java

@ -2,9 +2,19 @@ package com.fr.design.designer.creator;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRAbsoluteBodyLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRAbsoluteBodyLayoutAdapter;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.widget.editors.PaddingMarginEditor;
import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.core.PropertyChangeAdapter;
import java.awt.*; import java.awt.*;
import java.beans.IntrospectionException;
/** /**
* Created by zhouping on 2016/10/14. * Created by zhouping on 2016/10/14.
@ -52,4 +62,33 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
public boolean isSupportDrag() { public boolean isSupportDrag() {
return false; return false;
} }
/**
* 得到属性名
*
* @return 属性名
* @throws java.beans.IntrospectionException
*/
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetName", this.data.getClass()).setI18NName(Inter
.getLocText("FR-Designer_Form-Widget_Name")),
new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass(
WLayoutBorderStyleEditor.class).setRendererClass(LayoutBorderStyleRenderer.class).setI18NName(
Inter.getLocText("FR-Engine_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
initStyle();
}
})
};
}
@Override
protected void initStyle() {
initBorderStyle();
}
} }

3
designer_form/src/com/fr/design/mainframe/JForm.java

@ -657,7 +657,8 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
* @return 是则返回true * @return 是则返回true
*/ */
public boolean isSelectRootPane() { public boolean isSelectRootPane() {
return formDesign.getRootComponent() == formDesign.getSelectionModel().getSelection().getSelectedCreator(); return (formDesign.getRootComponent() == formDesign.getSelectionModel().getSelection().getSelectedCreator())
|| (formDesign.getSelectionModel().getSelection().getSelectedCreator().acceptType(XWAbsoluteBodyLayout.class));
} }

Loading…
Cancel
Save