forked from fanruan/finekit
zjz1993
5 years ago
9 changed files with 241 additions and 2 deletions
@ -0,0 +1,73 @@ |
|||||||
|
package com.fanruan.api.design; |
||||||
|
import com.fr.base.TableData; |
||||||
|
import com.fr.design.data.datapane.preview.PreviewTablePane; |
||||||
|
import com.fr.design.layout.TableLayoutHelper; |
||||||
|
import com.fr.design.utils.gui.GUICoreUtils; |
||||||
|
import com.fr.design.gui.itextfield.UIIntNumberField; |
||||||
|
|
||||||
|
import javax.swing.*; |
||||||
|
import java.awt.*; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
|
||||||
|
public class DesignKit { |
||||||
|
public static class UpdateAction extends com.fr.design.actions.UpdateAction{ |
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent evt) {} |
||||||
|
} |
||||||
|
/** |
||||||
|
* 直接预览数据集,没有实际值及显示值 |
||||||
|
* @param tableData 数据集 |
||||||
|
*/ |
||||||
|
public static void previewTableData(TableData tableData){ |
||||||
|
PreviewTablePane.previewTableData(tableData, -1, -1); |
||||||
|
} |
||||||
|
public static class ParameterTableModel extends com.fr.design.gui.itableeditorpane.ParameterTableModel{ |
||||||
|
|
||||||
|
} |
||||||
|
public static class UITableEditAction extends com.fr.design.gui.itableeditorpane.UITableEditAction{ |
||||||
|
@Override |
||||||
|
public void checkEnabled() { |
||||||
|
} |
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
public static class BasicPane extends com.fr.design.dialog.BasicPane{ |
||||||
|
@Override |
||||||
|
protected String title4PopupWindow() { |
||||||
|
return ""; |
||||||
|
} |
||||||
|
} |
||||||
|
/** |
||||||
|
* 标题布局 |
||||||
|
* @param components 组件 |
||||||
|
* @param rowSize 行宽 |
||||||
|
* @param columnSize 列宽 |
||||||
|
* @return 布局后的组件 |
||||||
|
*/ |
||||||
|
public static JPanel createTableLayoutPane(Component[][] components, double[] rowSize, double[] columnSize) { |
||||||
|
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); |
||||||
|
} |
||||||
|
/** |
||||||
|
* 生成一个边界布局 |
||||||
|
* @param args 布局内部的元素,位置等 |
||||||
|
* @return 具有边界布局的面板 |
||||||
|
*/ |
||||||
|
public static JPanel createBorderLayoutPane(Object... args) { |
||||||
|
return GUICoreUtils.createBorderLayoutPane(args); |
||||||
|
} |
||||||
|
/** |
||||||
|
* 产生一个Flow Pane, flowAligment是FlowLayout.LEFT, CENTER, RIGHT. |
||||||
|
* @param comps 组件 |
||||||
|
* @param flowAlignment 对齐方式 |
||||||
|
* @return 具有边界布局的面板 |
||||||
|
*/ |
||||||
|
public static JPanel createFlowPane(Component comps, int flowAlignment) { |
||||||
|
return GUICoreUtils.createFlowPane(comps,flowAlignment); |
||||||
|
} |
||||||
|
public static class UIIntNumberField extends com.fr.design.gui.itextfield.UIIntNumberField{ |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
package com.fanruan.api.i18n; |
||||||
|
import com.fr.locale.InterProviderFactory; |
||||||
|
|
||||||
|
public class I18nKit { |
||||||
|
/** |
||||||
|
* 获取国际化文本 |
||||||
|
* |
||||||
|
* @param string 需要国际化的值对应的键 |
||||||
|
* @return 返回国际化文本 |
||||||
|
*/ |
||||||
|
public static String getLocText(String string) { |
||||||
|
return InterProviderFactory.getProvider().getLocText(string); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,7 @@ |
|||||||
|
package com.fanruan.api.layout; |
||||||
|
import com.fr.design.layout.TableLayout; |
||||||
|
|
||||||
|
public class LayoutKit { |
||||||
|
public static final double PREFERRED = TableLayout.PREFERRED; |
||||||
|
public static final double FILL = TableLayout.FILL; |
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
package com.fanruan.api.xml; |
||||||
|
|
||||||
|
import com.fr.stable.xml.XMLReadable; |
||||||
|
import com.fr.stable.xml.XMLTools; |
||||||
|
import com.fr.stable.xml.XMLableReader; |
||||||
|
import com.fr.stable.xml.XMLPrintWriter; |
||||||
|
|
||||||
|
import java.io.InputStream; |
||||||
|
|
||||||
|
public class XmlKit { |
||||||
|
/** |
||||||
|
* 从输入流中读取对象 |
||||||
|
* @param xmlReadable xml读取对象 |
||||||
|
* @param inputStream xml输入流 |
||||||
|
* |
||||||
|
*/ |
||||||
|
public static class XMLFileManager extends com.fr.file.XMLFileManager { |
||||||
|
@Override |
||||||
|
public String fileName() { |
||||||
|
return ""; |
||||||
|
} |
||||||
|
@Override |
||||||
|
public void writeXML(XMLPrintWriter writer) { |
||||||
|
|
||||||
|
} |
||||||
|
@Override |
||||||
|
public void readXML(XMLableReader reader) { |
||||||
|
} |
||||||
|
} |
||||||
|
public static void readInputStreamXML(XMLReadable xmlReadable, InputStream inputStream) throws Exception { |
||||||
|
XMLTools.readInputStreamXML(xmlReadable, inputStream); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue