Browse Source

小调整

master
richie 5 years ago
parent
commit
87546555fb
  1. 87
      src/main/java/com/fanruan/api/design/ui/component/present/DictionaryPane.java
  2. 10
      src/main/java/com/fanruan/api/design/ui/container/DictionaryPane.java
  3. 15
      src/main/java/com/fanruan/api/design/work/EncoderCellRenderer.java
  4. 2
      src/main/java/com/fanruan/api/design/work/form/Item.java
  5. 2
      src/main/java/com/fanruan/api/design/work/form/basic/AccessiblePropertyEditor.java
  6. 53
      src/main/java/com/fanruan/api/design/work/form/basic/EncoderCellRenderer.java
  7. 2
      src/main/java/com/fanruan/api/design/work/form/basic/ItemCellEditor.java
  8. 2
      src/main/java/com/fanruan/api/design/work/form/basic/UneditableAccessibleEditor.java
  9. 2
      src/main/java/com/fanruan/api/design/work/form/container/AbstractDataModify.java
  10. 2
      src/main/java/com/fanruan/api/design/work/form/container/XLayoutContainer.java
  11. 2
      src/main/java/com/fanruan/api/design/work/form/creator/CustomWriteAbleRepeatEditor.java
  12. 2
      src/main/java/com/fanruan/api/design/work/form/creator/XFieldEditor.java
  13. 14
      src/main/java/com/fanruan/api/design/work/form/editors/StringEditor.java
  14. 4
      src/main/java/com/fanruan/api/design/work/form/editors/WidgetValueEditor.java
  15. 3
      src/main/java/com/fanruan/api/design/work/form/macro/XCreatorConstants.java

87
src/main/java/com/fanruan/api/design/ui/component/present/DictionaryPane.java

@ -0,0 +1,87 @@
package com.fanruan.api.design.ui.component.present;
import com.fanruan.api.design.DesignKit;
import com.fr.data.Dictionary;
import com.fr.data.impl.DynamicSQLDict;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.present.dict.CustomDictPane;
import com.fr.design.present.dict.DatabaseDictPane;
import com.fr.design.present.dict.FormulaDictPane;
import com.fr.design.present.dict.TableDataDictPane;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 数据字典容器获取数据字典
*/
public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI {
private TableDataDictPane tableDataDictPane;
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(0, 4));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p};
int[][] rowCount = {{1, 1}, {1, 1}};
Component[][] components = new Component[][]{
new Component[]{new UILabel(DesignKit.i18nText("Fine-Design_Basic_Type_Set"), UILabel.LEFT), jcb},
new Component[]{null, null}
};
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_MEDIUM);
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
}
@Override
protected String title4PopupWindow() {
return DesignKit.i18nText("Fine-Design_Form_DS_Dictionary");
}
@Override
public JComponent toSwingComponent() {
return this;
}
@Override
public void populateBean(Dictionary ob) {
for (int i = 0; i < this.cards.size(); i++) {
FurtherBasicBeanPane pane = cards.get(i);
if (pane.accept(ob)) {
pane.populateBean(ob);
jcb.setSelectedIndex(i);
} else {
pane.reset();
}
}
if (ob instanceof DynamicSQLDict) {
jcb.setSelectedIndex(1);
tableDataDictPane.populateBean((DynamicSQLDict) ob);
}
}
@Override
protected List<FurtherBasicBeanPane<? extends Dictionary>> initPaneList() {
List<FurtherBasicBeanPane<? extends Dictionary>> paneList = new ArrayList<FurtherBasicBeanPane<? extends Dictionary>>();
paneList.add(new DatabaseDictPane());
paneList.add(tableDataDictPane = new TableDataDictPane());
paneList.add(new CustomDictPane());
paneList.add(new FormulaDictPane());
return paneList;
}
}

10
src/main/java/com/fanruan/api/design/ui/container/DictionaryPane.java

@ -1,10 +0,0 @@
package com.fanruan.api.design.ui.container;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 数据字典容器获取数据字典
*/
public class DictionaryPane extends com.fr.design.present.dict.DictionaryPane {
}

15
src/main/java/com/fanruan/api/design/work/EncoderCellRenderer.java

@ -1,15 +0,0 @@
package com.fanruan.api.design.work;
import com.fr.design.designer.properties.Encoder;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 根据控件属性渲染单元格
*/
public class EncoderCellRenderer extends com.fr.design.mainframe.widget.renderer.EncoderCellRenderer {
public EncoderCellRenderer(Encoder encoder) {
super(encoder);
}
}

2
src/main/java/com/fanruan/api/design/work/Item.java → src/main/java/com/fanruan/api/design/work/form/Item.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.work; package com.fanruan.api.design.work.form;
/** /**
* @author Kalven * @author Kalven

2
src/main/java/com/fanruan/api/design/ui/editor/AccessiblePropertyEditor.java → src/main/java/com/fanruan/api/design/work/form/basic/AccessiblePropertyEditor.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.ui.editor; package com.fanruan.api.design.work.form.basic;
import com.fr.design.mainframe.widget.accessibles.AccessibleEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleEditor;

53
src/main/java/com/fanruan/api/design/work/form/basic/EncoderCellRenderer.java

@ -0,0 +1,53 @@
package com.fanruan.api.design.work.form.basic;
import com.fr.design.designer.properties.Encoder;
import com.fr.design.mainframe.widget.renderer.GenericCellRenderer;
import java.awt.*;
/**
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/9/4
* 根据控件属性渲染单元格
*/
public class EncoderCellRenderer extends GenericCellRenderer {
private static int LEFT = 1;
protected Encoder encoder;
protected Object value;
public EncoderCellRenderer(Encoder encoder) {
this.encoder = encoder;
}
@Override
public void paint(Graphics g) {
int width = getWidth();
int height = getHeight();
g.setColor(getBackground());
g.fillRect(0, 0, width, height);
int x = LEFT;
g.setColor(getForeground());
FontMetrics fm = g.getFontMetrics();
int y = ((height - fm.getHeight()) / 2) + fm.getAscent();
String txt = getValueText();
if (txt != null) {
g.drawString(txt, x, y);
}
if (getBorder() != null) {
getBorder().paintBorder(this, g, 0, 0, width, height);
}
}
@Override
public void setValue(Object value) {
this.value = value;
}
private String getValueText() {
return encoder.encode(value);
}
}

2
src/main/java/com/fanruan/api/design/ui/editor/ItemCellEditor.java → src/main/java/com/fanruan/api/design/work/form/basic/ItemCellEditor.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.ui.editor; package com.fanruan.api.design.work.form.basic;
import com.fr.design.designer.properties.items.Item; import com.fr.design.designer.properties.items.Item;

2
src/main/java/com/fanruan/api/design/ui/editor/UneditableAccessibleEditor.java → src/main/java/com/fanruan/api/design/work/form/basic/UneditableAccessibleEditor.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.ui.editor; package com.fanruan.api.design.work.form.basic;
import com.fr.design.designer.properties.Encoder; import com.fr.design.designer.properties.Encoder;

2
src/main/java/com/fanruan/api/design/ui/container/AbstractDataModify.java → src/main/java/com/fanruan/api/design/work/form/container/AbstractDataModify.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.ui.container; package com.fanruan.api.design.work.form.container;
/** /**
* 抽象数据定义实现数据可序列化 * 抽象数据定义实现数据可序列化

2
src/main/java/com/fanruan/api/design/ui/container/XLayoutContainer.java → src/main/java/com/fanruan/api/design/work/form/container/XLayoutContainer.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.ui.container; package com.fanruan.api.design.work.form.container;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;

2
src/main/java/com/fanruan/api/design/ui/editor/CustomWriteAbleRepeatEditor.java → src/main/java/com/fanruan/api/design/work/form/creator/CustomWriteAbleRepeatEditor.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.ui.editor; package com.fanruan.api.design.work.form.creator;
/** /**
* 允许自定义值的允许直接编辑的带重复的 --- 下拉框 下拉复选框 下拉树 * 允许自定义值的允许直接编辑的带重复的 --- 下拉框 下拉复选框 下拉树

2
src/main/java/com/fanruan/api/design/ui/editor/XFieldEditor.java → src/main/java/com/fanruan/api/design/work/form/creator/XFieldEditor.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.ui.editor; package com.fanruan.api.design.work.form.creator;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;

14
src/main/java/com/fanruan/api/design/work/form/editors/StringEditor.java

@ -0,0 +1,14 @@
package com.fanruan.api.design.work.form.editors;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-09-05
* 字符串编辑器
*/
public class StringEditor extends com.fr.design.mainframe.widget.editors.StringEditor {
public StringEditor() {
super();
}
}

4
src/main/java/com/fanruan/api/design/ui/editor/WidgetValueEditor.java → src/main/java/com/fanruan/api/design/work/form/editors/WidgetValueEditor.java

@ -1,10 +1,10 @@
package com.fanruan.api.design.ui.editor; package com.fanruan.api.design.work.form.editors;
/** /**
* @author Kalven * @author Kalven
* @version 10.0 * @version 10.0
* Created by Kalven on 2019/9/4 * Created by Kalven on 2019/9/4
* 控件值编辑器 * 控件值编辑器
*/ */
public class WidgetValueEditor extends com.fr.design.mainframe.widget.editors.WidgetValueEditor { public class WidgetValueEditor extends com.fr.design.mainframe.widget.editors.WidgetValueEditor {

3
src/main/java/com/fanruan/api/design/macro/XCreatorConstants.java → src/main/java/com/fanruan/api/design/work/form/macro/XCreatorConstants.java

@ -1,4 +1,4 @@
package com.fanruan.api.design.macro; package com.fanruan.api.design.work.form.macro;
/** /**
* 存放XCreator的常量 * 存放XCreator的常量
@ -7,5 +7,6 @@ package com.fanruan.api.design.macro;
* Created by Kalven on 2019/9/3 * Created by Kalven on 2019/9/3
*/ */
public class XCreatorConstants { public class XCreatorConstants {
public static final String PROPERTY_CATEGORY = com.fr.design.form.util.XCreatorConstants.PROPERTY_CATEGORY; public static final String PROPERTY_CATEGORY = com.fr.design.form.util.XCreatorConstants.PROPERTY_CATEGORY;
} }
Loading…
Cancel
Save