Grid
public class DhtmlxGridRow {
Object id;
Object data;
public Object getId() {
return id;
}
public void setId(Object id) {
this.id = id;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
import java.util.ArrayList;
import java.util.List;
public class DhtmlxGridTable {
List<DhtmlxGridRow> rows;
int total_count;
int pos;
public int getPos() {
return pos;
}
public void setPos(int pos) {
this.pos = pos;
}
public int getTotal_count() {
return total_count;
}
public void setTotal_count(int total_count) {
this.total_count = total_count;
}
public List<DhtmlxGridRow> getRows() {
if(rows ==null){
rows = new ArrayList<DhtmlxGridRow>();
}
return rows;
}
public void setRows(List<DhtmlxGridRow> rows) {
this.rows = rows;
}
}
Tree
import java.io.Serializable;
import java.util.List;
/**
* @Description:DhtmlxTree节点类
*
*
* @Version: 1.0
*
*/
public class DhtmlxTreeItem implements Serializable {
/**
* 2011-8-2
*/
private static final long serialVersionUID = 1L;
public static Long ROOTID = 0L;// 要求树的根的id为0
public static final String[] INCLUDE_SIMPLE = { "id", "text", "item" };
public static final String[] INCLUDE_CHECKED = { "id", "text", "item",
"checked" };
public static final String[] INCLUDE_OPEN = { "id", "text", "item", "open" };
public static final String[] INCLUDE_OPEN_CHECKED = { "id", "text", "item",
"open", "checked" };
public static final String[] INCLUDE_ALL = { "id", "text", "item", "open",
"checked", "child", "im0", "im1", "im2", "aCol", "sCol", "style",
"select", "call", "tooltip", "nocheckbox", "radio", "imheight",
"imwidth", "topoffset" };
private String id;// id of the node
private String text;// label of the node
private String im0;// image for a node without child items (tree will get
// images from the path specified in setImagePath()
// method)
private String im1;// image for an expanded node with child items
private String im2;// image for a collapsed node with child items
private String aCol;// colour of an item that is not selected
private String sCol;// colour of a selected item
private String style;// text style of a node
private String open;// show a node opened (any value)
private String select;// select a node on load (any value)
private String call;// call function on select(any value)
private String tooltip;// tooltip of the node
private String checked;// check checkbox if exists (in case of 3-state
// checkboxes values can be 1 - checked or -1 -
// unsure)
private String nocheckbox;// instruct component, to not render checkbox for
// related item, optional
private String child;// specifies whether a node has child items (1) or not
// (0)
private String radio;// if not empty, child items of this node will have
// radio buttons
private int imheight;// height of the icon
private int imwidth;// width of the icon
private int topoffset;// offset of the item from the node above
private List<DhtmlxTreeItem> item;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public String getIm0() {
return im0;
}
public void setIm0(String im0) {
this.im0 = im0;
}
public String getIm1() {
return im1;
}
public void setIm1(String im1) {
this.im1 = im1;
}
public String getIm2() {
return im2;
}
public void setIm2(String im2) {
this.im2 = im2;
}
public List<DhtmlxTreeItem> getItem() {
return item;
}
public void setItem(List<DhtmlxTreeItem> item) {
this.item = item;
}
public String getOpen() {
return open;
}
public void setOpen(String open) {
this.open = open;
}
public String getSelect() {
return select;
}
public void setSelect(String select) {
this.select = select;
}
public String getCall() {
return call;
}
public void setCall(String call) {
this.call = call;
}
public String getTooltip() {
return tooltip;
}
public void setTooltip(String tooltip) {
this.tooltip = tooltip;
}
public String getaCol() {
return aCol;
}
public void setaCol(String aCol) {
this.aCol = aCol;
}
public String getsCol() {
return sCol;
}
public void setsCol(String sCol) {
this.sCol = sCol;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public String getChecked() {
return checked;
}
public void setChecked(String checked) {
this.checked = checked;
}
public String getNocheckbox() {
return nocheckbox;
}
public void setNocheckbox(String nocheckbox) {
this.nocheckbox = nocheckbox;
}
public String getChild() {
return child;
}
public void setChild(String child) {
this.child = child;
}
public String getRadio() {
return radio;
}
public void setRadio(String radio) {
this.radio = radio;
}
public int getImheight() {
return imheight;
}
public void setImheight(int imheight) {
this.imheight = imheight;
}
public int getImwidth() {
return imwidth;
}
public void setImwidth(int imwidth) {
this.imwidth = imwidth;
}
public int getTopoffset() {
return topoffset;
}
public void setTopoffset(int topoffset) {
this.topoffset = topoffset;
}
}
import java.util.ArrayList;
import java.util.List;
public class DhtmlxTreeGridRow {
Object id;
Object data;
String xmlkids;
List<DhtmlxTreeGridRow> rows;
public Object getId() {
return id;
}
public void setId(Object id) {
this.id = id;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public List<DhtmlxTreeGridRow> getRows() {
if(rows==null){
rows = new ArrayList<DhtmlxTreeGridRow>();
}
return rows;
}
public void setRows(List<DhtmlxTreeGridRow> rows) {
this.rows = rows;
}
public String getXmlkids() {
return xmlkids;
}
public void setXmlkids(String xmlkids) {
this.xmlkids = xmlkids;
}
}
import java.util.ArrayList;
import java.util.List;
public class DhtmlxTreeGridTable {
int total_count;
int pos;
List<DhtmlxTreeGridRow> rows;
public int getTotal_count() {
return total_count;
}
public void setTotal_count(int total_count) {
this.total_count = total_count;
}
public int getPos() {
return pos;
}
public void setPos(int pos) {
this.pos = pos;
}
public List<DhtmlxTreeGridRow> getRows() {
if(rows==null){
rows = new ArrayList<DhtmlxTreeGridRow>();
}
return rows;
}
public void setRows(List<DhtmlxTreeGridRow> rows) {
this.rows = rows;
}
}
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import org.apache.commons.lang.StringUtils;
import com.mogenesis.mobileadplatform.web.util.ArrayUtil;
/**
*
* @Description: dhtmxTree JSON输出构建类,使用方法见
*
*
* @Date: 2011-8-3 下午10:57:19
* @Version: 1.0
*
*/
public class DhtmlxTreeBuilder {
/**
* 递归构建json字符串
*
* @param <T>
* @param root
* @param cb
* @return
*/
public static <T> String buildRecursiveJson(T root,
DhtmlxTreeBuildCallback<T> cb) {
DhtmlxTreeItem d = buildRecursive(root, cb);
if (d == null) {
return "{}";
}
String[] includeProperties = cb.includeProperties();
String[] excludeProperties = cb.excludeProperties();
Set<String> includes = null;
if ((includeProperties != null) && (includeProperties.length > 0)) {
includes = new TreeSet<String>();
for (String property : includeProperties) {
if (StringUtils.isNotEmpty(property)) {
includes.add(property);
}
}
if (includes.size() == 0)
includes = null;
}
Set<String> excludes = null;
if ((excludeProperties != null) && (excludeProperties.length > 0)) {
excludes = new TreeSet<String>();
for (String property : excludeProperties) {
if (StringUtils.isNotEmpty(property)) {
excludes.add(property);
}
}
if (excludes.size() == 0) {
excludes = null;
}
}
JsonConfig config = null;
if ((excludes == null) && (includes == null)) {
return JSONObject.fromObject(d).toString();
}
Set<String> ex;
if (includes != null) {
ex = new HashSet<String>();
for (String s : DhtmlxTreeItem.INCLUDE_ALL) {
if (!(includes.contains(s)))
ex.add(s);
}
if (ex.size() > 0) {
config = new JsonConfig();
config.setExcludes((String[]) ArrayUtil.toArray(ex));
}
}
if (excludes != null) {
config = new JsonConfig();
config.setExcludes((String[]) ArrayUtil.toArray(excludes));
}
if ((excludes != null) && (includes != null)) {
ex = new HashSet<String>();
for (String s : DhtmlxTreeItem.INCLUDE_ALL) {
if (excludes.contains(s))
ex.add(s);
else if (!(includes.contains(s)))
ex.add(s);
}
if (ex.size() > 0) {
config = new JsonConfig();
config.setExcludes((String[]) ArrayUtil.toArray(ex));
}
}
return ((String) JSONObject.fromObject(d, config).toString());
}
public static <T> DhtmlxTreeItem buildRecursive(T root,
DhtmlxTreeBuildCallback<T> cb) {
if ((root == null) || (cb == null)) {
return null;
}
DhtmlxTreeItem dRoot = cb.getDhtmlxTreeItem(root);
if (dRoot != null)
buildRecursiveJson(root, dRoot, cb);
return dRoot;
}
private static <T> void buildRecursiveJson(T t, DhtmlxTreeItem dT,
DhtmlxTreeBuildCallback<T> cb) {
T[] nodes = cb.getChildren(t);
if ((nodes == null) || (nodes.length == 0))
return;
List<DhtmlxTreeItem> children = dT.getItem();
if (children == null) {
children = new ArrayList<DhtmlxTreeItem>();
dT.setItem(children);
}
for (int i = 0; i < nodes.length; ++i) {
T node = nodes[i];
if (node == null) {
continue;
}
DhtmlxTreeItem o = cb.getDhtmlxTreeItem(node);
buildRecursiveJson(node, o, cb);
children.add(o);
}
}
}
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize;
public class PojoMapper {
private static final ObjectMapper objectMapper = new ObjectMapper();
private static final JsonFactory jsonFactory = new JsonFactory();
private static final String JSON_DATE_FROMATE = "yyyy-MM-dd HH:mm:ss";
static{
SimpleDateFormat dateFormate = new SimpleDateFormat(JSON_DATE_FROMATE);
objectMapper.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
objectMapper.getSerializationConfig().setDateFormat(dateFormate);//the withDateFormate method can not effect
objectMapper.getDeserializationConfig().setDateFormat(dateFormate);
objectMapper.getSerializationConfig().set(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING, true);
}
/**
* deserializea a json string to an object
*
* @param <T>
* @param jsonAsString
* @param pojoClass
* @return
* @throws Exception
*/
public static <T> T fromJson(String jsonAsString, Class<T> pojoClass)
throws Exception {
return (T)objectMapper.readValue(jsonAsString, pojoClass);
}
/**
* serializea an object to a json string
* @param pojo
* @param prettyPrint if true,enabling pretty-printing using the default pretty printer
* @return
* @throws Exception
*/
public static String toJson(Object pojo, boolean prettyPrint)
throws Exception {
StringWriter sw = new StringWriter();
JsonGenerator jg = jsonFactory.createJsonGenerator(sw);
if (prettyPrint) {
jg.useDefaultPrettyPrinter();
}
objectMapper.writeValue(jg, pojo);
return sw.toString();
}
public static String toJson(Object pojo) throws Exception{
return toJson(pojo, false);
}
}
分享到:
相关推荐
DWR的XML和注解配置方式使得设置变得简单,同时支持容器管理的安全性,允许开发者使用普通的POJO(Plain Old Java Object)进行开发,降低了学习和使用的门槛。此外,DWR还简化了客户端编码,使得前端开发更为高效。...
JESD79-2F DDR2 JESD79-3F DDR3 JESD79-4D DDR4 JESD79-5C DDR5 JESD209-2F LPDDR2 JESD209-3C LPDDR3 JESD209-4E LPDDR4 JESD209-4-1A LPDDR4X JESD209-5C LPDDR5(X)
COMSOL二维光子晶体角态研究:单胞与超胞能带计算及边界态与角态特性分析,COMSOL二维光子晶体角态研究:单胞与超胞能带计算及边界态与角态特性分析,comsol二维光子晶体角态。 单胞能带,超胞能带,边界态以及角态计算。 ,comsol;二维光子晶体;角态;单胞能带;超胞能带;边界态计算,基于Comsol的二维光子晶体角态及能带边界计算研究
六自由度机械臂抓取动作仿真与代码解析:抓取动画、关节参数变化及轨迹图解详解,六自由度机械臂抓取动作仿真指南:掌握两套代码实现动画与轨迹图模拟学习攻略,六自由度机械臂抓取动作仿真-8 两套关于抓取动作的代码,包括抓取动画、关节角、角速度、角加速度的变化仿真、以及抓取轨迹图 简单易懂好上手~ ,六自由度机械臂;抓取动作仿真;抓取动画;关节角变化;角速度角加速度;抓取轨迹图;两套代码;简单易懂好上手,六自由度机械臂抓取动作仿真演示:代码与轨迹图解
ITC网络广播工具软件
Multisim四位密码锁电路仿真设计:设定、开锁与声光报警功能演示资料包,Multisim四位密码锁电路仿真设计:设定、输入、开锁与报警功能详解,附源文件、原理说明书与演示视频,multisim四位密码锁电路仿真设计 功能: 1.通过拨码开关1进行初始密码设定。 2.通过拨码开关2输入密码,实现开锁判断。 3.如果密码正确,LED绿灯亮,表示开锁。 4.如果密码不正确,LED红灯亮,蜂鸣器鸣叫,声光报警。 资料包含:仿真源文件+原理说明书+演示视频 ,四位密码锁电路、Multisim仿真设计、初始密码设定;拨码开关输入;开锁判断;LED灯显示;声光报警;仿真源文件;原理说明书;演示视频,Multisim四位密码锁电路仿真设计:初始密码设置与智能解锁功能的声光报警展示
俗话说,摸鱼摸的好,上班没烦恼,毕竟谁能拒绝带薪拉屎呢(手动狗头) 这是一个云开发职场打工人专属上班摸鱼划水微信小程序源码,没有后台 直接导入微信开发者工具即可运行,UI简约大气漂亮,只需登录微信公众平台配置完合法域名即可轻松上线。 用户进入摸鱼小程序,可以自由设置薪资,上班时间、下班时间、发薪日、 月工作天数以提醒自己摸鱼,全民打酱油,让自己成为摸鱼冠军,《商鞅摸鱼哲学》 摸鱼不是自我放纵,而是个人实力的积蓄,我们的小目标是晚睡晚起 小程序中的今日待办会提醒用户带薪拉屎和闲逛,下方展示的是距离休息日的天数,距离下一次发工资的天数和节日的天数。
【毕业设计】基于Java的开发的一个集合校园二手交易、拼车、失物招领等功能的app_pgj
个人记录:PICkit3离线烧录流程 使用软件:MPLAB X IDE v5.30 记录时间:20250215
基于Matlab代码的电力系统状态估计与实验仿真研究:扩展卡尔曼滤波和无迹卡尔曼滤波在电力系统动态状态估计中的应用及效果分析,Matlab仿真实验研究:基于扩展卡尔曼滤波器与无迹卡尔曼滤波器对电力系统状态估计的影响及验证,状态估计 电力系统状态估计 Matlab代码 实验仿真研究 电力系统由于测量值和传输误差,还有测量噪声的影响,会对状态估计产生影响。 因此,需要对嘈杂的测量进行滤波,以获得准确的电力系统运行动态。 本文使用扩展卡尔曼滤波器(EKF)和无迹卡尔曼滤波器(UKF)来估计电力系统的动态状态。 扩展卡尔曼滤波EKF、无迹卡尔曼滤波UKF 利用扩展的无迹卡尔曼滤波器估计了动力系统的动态状态。 对WECC 3机9总线系统和新英格兰10机39总线系统进行了案例研究。 结果表明EKF和UKF都能准确地估计电力系统的动态状态。 ,核心关键词:状态估计; 电力系统状态估计; Matlab代码; 实验仿真; 测量值误差; 测量噪声; 扩展卡尔曼滤波器(EKF); 无迹卡尔曼滤波器(UKF); 动力系统; 动态状态估计; WECC 3机9总线系统; 新英格兰10机39总线系统。,Matlab
springboot在线考试--
台达DVP EH3与MS300 PLC&变频器通讯程序的全面解决方案,台达DVP EH3与MS300通讯程序:稳定可靠的频率控制与启停管理系统,台达DVP EH3与台达MS300通讯程序(TDEH-9) 可直接用于实际的程序,程序带注释,并附送触摸屏程序,有接线方式和设置,通讯地址说明等。 程序采用轮询,可靠稳定 器件:台达DVP EH3系列PLC,台达MS300系列变频器,昆仑通态7022Ni 功能:实现频率设定,启停控制,实际频率读取,加减速时间设定。 资料:带注释程序,触摸屏程序,接线和设置说明,后续有技术咨询。 ,核心关键词:台达DVP EH3; 台达MS300; 通讯程序(TDEH-9); 轮询; 稳定; 频率设定; 启停控制; 实际频率读取; 加减速时间设定; 触摸屏程序; 接线方式; 设置说明; 技术咨询。,台达PLC与变频器通讯程序(带注释、触摸屏控制)
项目资源包含:可运行源码+sql文件 适用人群:学习不同技术领域的小白或进阶学习者;可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。项目具有较高的学习借鉴价值,也可拿来修改、二次开发。 个人账户管理:支持用户注册、登录与个人信息编辑;提供密码找回及账号安全保护措施。 声纹采集:利用麦克风设备录制用户的声纹样本;支持多种录音格式和质量调整,确保采集到清晰、准确的声纹数据。 声纹模板库管理:建立和维护一个安全的声纹模板库;支持声纹模板的添加、删除、更新和查询操作。 声纹比对与识别:运用深度学习算法对输入的声纹数据进行特征提取和匹配;实现快速、准确的声纹身份验证。 多场景应用支持:适用于多种场景,如门禁系统、移动支付、远程登录等;可根据实际需求定制开发相应的应用场景。 实时监控与报警:实时监控系统运行状态,包括声纹识别成功率、处理速度等指标;当出现异常情况时,及时发出报警信息。 数据分析与报告生成:收集并分析声纹识别过程中的数据,如识别准确率、处理时间等;根据用户需求输出包含详细图表说明的专业级文档供下载打印保存。 社区互动交流:设立论坛版块鼓励用户分享心得体会讨论热点话题;定期邀请行业专家举办线上讲座传授实用技巧知识。 音乐筛选与推荐:集成音乐平台API,根据用户的浏览习惯和情绪状态推荐背景音乐,增强用户体验。 数据可视化:提供交互式的数据可视化面板,使非技术用户也能轻松理解复杂的数据集,从而做出更明智的决策。
三相与多相开绕组永磁同步电机仿真模型的先进控制策略探讨与实现,三相与多相开绕组永磁同步电机的Simulink仿真模型与先进控制策略研究,开绕组电机,开绕组永磁同步电机仿真模型、simulink仿真 共直流母线、独立直流母线,两相容错,三相容错控制,零序电流抑制,控制策略很多 三相开绕组永磁同步电机,六相开绕组永磁同步电机 五相开绕组永磁同步电机,五相开绕组电机 ,开绕组电机; 永磁同步电机仿真模型; simulink仿真; 共直流母线; 独立直流母线; 两相容错; 三相容错控制; 零序电流抑制; 控制策略; 六相开绕组永磁同步电机; 五相开绕组永磁同步电机,开绕组电机仿真研究:共直流母线与独立直流母线的容错控制策略
【毕业设计】基于Java的开发的网上汽车租赁管理系统_pgj
csv 模块是 Python 的标准库,无需额外安装。 运行结果如下图: ['姓名', '年龄', '城市'] ['张三', '25', '北京'] ['李四', '30', '上海'] ['王五', '22', '广州']
【毕业设计】基于Java+Springboot+Vue的宠物领养系统_pgj
让前端开发者学习“机器学习”!
【毕业设计】基于Java的实现的以宠物为主体的论坛式的APP
大模型应用工具实战2-有好玩的数字人