blob_id stringlengths 40 40 | __id__ int64 225 39,780B | directory_id stringlengths 40 40 | path stringlengths 6 313 | content_id stringlengths 40 40 | detected_licenses list | license_type stringclasses 2
values | repo_name stringlengths 6 132 | repo_url stringlengths 25 151 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 70 | visit_date timestamp[ns] | revision_date timestamp[ns] | committer_date timestamp[ns] | github_id int64 7.28k 689M ⌀ | star_events_count int64 0 131k | fork_events_count int64 0 48k | gha_license_id stringclasses 23
values | gha_fork bool 2
classes | gha_event_created_at timestamp[ns] | gha_created_at timestamp[ns] | gha_updated_at timestamp[ns] | gha_pushed_at timestamp[ns] | gha_size int64 0 40.4M ⌀ | gha_stargazers_count int32 0 112k ⌀ | gha_forks_count int32 0 39.4k ⌀ | gha_open_issues_count int32 0 11k ⌀ | gha_language stringlengths 1 21 ⌀ | gha_archived bool 2
classes | gha_disabled bool 1
class | content stringlengths 7 4.37M | src_encoding stringlengths 3 16 | language stringclasses 1
value | length_bytes int64 7 4.37M | extension stringclasses 24
values | filename stringlengths 4 174 | language_id stringclasses 1
value | entities list | contaminating_dataset stringclasses 0
values | malware_signatures list | redacted_content stringlengths 7 4.37M | redacted_length_bytes int64 7 4.37M | alphanum_fraction float32 0.25 0.94 | alpha_fraction float32 0.25 0.94 | num_lines int32 1 84k | avg_line_length float32 0.76 99.9 | std_line_length float32 0 220 | max_line_length int32 5 998 | is_vendor bool 2
classes | is_generated bool 1
class | max_hex_length int32 0 319 | hex_fraction float32 0 0.38 | max_unicode_length int32 0 408 | unicode_fraction float32 0 0.36 | max_base64_length int32 0 506 | base64_fraction float32 0 0.5 | avg_csv_sep_count float32 0 4 | is_autogen_header bool 1
class | is_empty_html bool 1
class | shard stringclasses 16
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fad3a9351c92921445913a0b0053176a9e18d9db | 36,395,552,912,127 | bed694975114a88346cdb320b3c36ea89ab6e9a8 | /sdi-entrega1-303-302/src/main/java/com/uniovi/entities/Message.java | f7c65dc9080a214ed3d0c1fca9a459827baefcf6 | [] | no_license | UO247346/sdi-entrega1-303-302-master | https://github.com/UO247346/sdi-entrega1-303-302-master | b908cffb076cf1d6289f661a705e489825588c77 | de51aa15abda4e8008348c0f0fd592853e1b2526 | refs/heads/master | 2022-04-18T13:29:41.932000 | 2020-04-06T17:08:03 | 2020-04-06T17:08:03 | 253,564,419 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.uniovi.entities;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
@Entity
public class Message {
@Id
@GeneratedValue
private long id;
@ManyToOne
private Chat chat;
@Transient
private User from;
@Transient
private User to;
private String message;
public User getFrom() {
return from;
}
public void setFrom(User from) {
this.from = from;
}
public User getTo() {
return to;
}
public void setTo(User to) {
this.to = to;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Chat getChat() {
return chat;
}
public void setChat(Chat chat) {
this.chat = chat;
}
public Message(long id, Chat chat, User from, User to, String message) {
super();
this.id = id;
this.chat = chat;
this.from = from;
this.to = to;
this.message = message;
}
public Message() {
}
}
| UTF-8 | Java | 1,025 | java | Message.java | Java | [] | null | [] | package com.uniovi.entities;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
@Entity
public class Message {
@Id
@GeneratedValue
private long id;
@ManyToOne
private Chat chat;
@Transient
private User from;
@Transient
private User to;
private String message;
public User getFrom() {
return from;
}
public void setFrom(User from) {
this.from = from;
}
public User getTo() {
return to;
}
public void setTo(User to) {
this.to = to;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Chat getChat() {
return chat;
}
public void setChat(Chat chat) {
this.chat = chat;
}
public Message(long id, Chat chat, User from, User to, String message) {
super();
this.id = id;
this.chat = chat;
this.from = from;
this.to = to;
this.message = message;
}
public Message() {
}
}
| 1,025 | 0.69561 | 0.69561 | 59 | 16.372881 | 13.701291 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.542373 | false | false | 0 |
a9a395d765dc69cc8de0b10fc8837819043b57ab | 24,292,335,064,715 | 6ba094fc7938f641080d62925034e6f0f32ba3c4 | /FInal_project_CS/build/generated/src/org/apache/jsp/Info_005fadmin_jsp.java | 3586db55221461e7c381c4702ccfdd151de003ff | [] | no_license | Khushi-Jain-developer/Online-Service-Provider-CS- | https://github.com/Khushi-Jain-developer/Online-Service-Provider-CS- | 7ca42f773a6039ebd389e4f811362765a1ea0253 | 3db523276af09be56add11d3ca0cf44c242c1e12 | refs/heads/master | 2022-11-11T15:37:18.803000 | 2020-07-05T08:40:23 | 2020-07-05T08:40:23 | 277,261,066 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import CRUD.Read_values;
import Common.Category_bean;
import java.util.List;
public final class Info_005fadmin_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
static {
_jspx_dependants = new java.util.ArrayList<String>(2);
_jspx_dependants.add("/category_action.jsp");
_jspx_dependants.add("/admin_header.jsp");
}
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("<body>\n");
out.write(" ");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <title>Drop down menu design</title>\r\n");
out.write(" <meta charset=\"utf-8\" />\r\n");
out.write(" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\" />\r\n");
out.write(" <style>\r\n");
out.write(" * {\r\n");
out.write(" margin:0;\r\n");
out.write(" padding:0;\r\n");
out.write(" box-sizing: border-box;\r\n");
out.write(" }\r\n");
out.write(" #category {\r\n");
out.write(" margin-top:100px;\r\n");
out.write(" font-family:san-serif;\r\n");
out.write(" text-align:center;\r\n");
out.write(" font-size:20px;\r\n");
out.write(" background:#800080;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar {\r\n");
out.write(" background:rgb(0,0,100);\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul {\r\n");
out.write(" display:inline-flex;\r\n");
out.write(" list-style:none;\r\n");
out.write(" color: #fff;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li {\r\n");
out.write(" width:120px;\r\n");
out.write(" margin:15px;\r\n");
out.write(" padding:15px;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li a {\r\n");
out.write(" text-decoration:none;\r\n");
out.write(" color: #fff;\r\n");
out.write(" }\r\n");
out.write(" .active,#menu-bar ul li:hover {\r\n");
out.write(" background:#2bab0d;\r\n");
out.write(" border-radius: 3px;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar .fa {\r\n");
out.write(" margin-right:10px;\r\n");
out.write(" }\r\n");
out.write(" #sub-menu {\r\n");
out.write(" display:none;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu {\r\n");
out.write(" display:block;\r\n");
out.write(" position:absolute;\r\n");
out.write(" background:rgb(0,120,0);\r\n");
out.write(" margin-top:15px;\r\n");
out.write(" margin-left:-15px;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu ul {\r\n");
out.write(" display:block;\r\n");
out.write(" margin:10px;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu ul li {\r\n");
out.write(" width:150px;\r\n");
out.write(" padding:10px;\r\n");
out.write(" border-bottom:1px dotted #fff;\r\n");
out.write(" background:transparent;\r\n");
out.write(" border-radius:o;\r\n");
out.write(" text-align:left;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu ul li:last-child {\r\n");
out.write(" border-bottom:none;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu ul li a:hover {\r\n");
out.write(" color:#b2ff00;\r\n");
out.write(" }\r\n");
out.write(" .fa-angle-right {\r\n");
out.write(" float:right;\r\n");
out.write(" }\r\n");
out.write(" </style>\r\n");
out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css\">\r\n");
out.write(" </head>\r\n");
out.write(" <body style =\"background-image: url(img/portfolio/3.jpg); background-repeat: no-repeat; background-size: cover\">\r\n");
out.write(" ");
out.write("<style>\r\n");
out.write(" body{\r\n");
out.write(" margin :0;\r\n");
out.write(" padding: 0;\r\n");
out.write(" font-family:verdana,san-serif,Geneva;\r\n");
out.write(" font-size:30px;\r\n");
out.write(" }\r\n");
out.write(" header {\r\n");
out.write(" height:150px;\r\n");
out.write(" position:fixed;\r\n");
out.write(" background:#505050;\r\n");
out.write(" width:100%;\r\n");
out.write(" top:0;}\r\n");
out.write(" .logo {\r\n");
out.write(" float:left;\r\n");
out.write(" margin-left:10%;\r\n");
out.write(" }\r\n");
out.write(" .logo a {\r\n");
out.write(" color:blue;\r\n");
out.write(" font-size:30px;\r\n");
out.write(" margin-top:25px;\r\n");
out.write(" display:block;\r\n");
out.write(" text-decoration:none;\r\n");
out.write(" }.menu {\r\n");
out.write(" float:right;\r\n");
out.write(" margin-right:10%;\r\n");
out.write(" margin-top:35px;\r\n");
out.write(" }\r\n");
out.write(" .menu ul {\r\n");
out.write(" margin:0px;\r\n");
out.write(" padding:0px;\r\n");
out.write(" list-style:none;\r\n");
out.write(" }\r\n");
out.write(" .menu ul li {\r\n");
out.write(" float:left;\r\n");
out.write(" }\r\n");
out.write(" .menu ul li a {\r\n");
out.write(" color:#fff;\r\n");
out.write(" text-decoration:none;\r\n");
out.write(" margin-left:10px;\r\n");
out.write(" margin-right:10px;\r\n");
out.write(" }\r\n");
out.write("</style>\r\n");
out.write("<title>Insert title here</title>\r\n");
out.write("</head>\r\n");
out.write("<body class=\"admin_header\">\r\n");
out.write(" <header ><div class=\"logo\">\r\n");
out.write(" <a href=\"index_admin.jsp\">MENU</a></div>\r\n");
out.write(" <div class=\"menu\">\r\n");
out.write(" <p style=\"color:#fff;font-size: 30px\">Welcome In Admin-Panel</p>\r\n");
out.write(" </div><!-- menu -->\r\n");
out.write(" </header><!-- header -->\r\n");
out.write("</body>");
out.write("\r\n");
out.write(" <div id =\"category\">\r\n");
out.write(" <h1>Categories</h1>\r\n");
out.write(" <div id = \"menu-bar\">\r\n");
out.write(" <ul>\r\n");
out.write(" <li class=\"active\"><a href=\"#\"><i class=\"fa fa-clone\"></i>View Category</a>\r\n");
out.write(" <div id=\"sub-menu\">\r\n");
out.write(" <ul>\r\n");
out.write(" ");
List<Category_bean> al = Read_values.fetchAllCategory();
for (Category_bean u : al) {
out.write("\r\n");
out.write(" <li><a href=\"");
out.print(u.getCategory_id());
out.write('"');
out.write('>');
out.print(u.getCategory_name());
out.write("</a><i class=\"fa fa-angle-right\"></i></li>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" </div>\r\n");
out.write(" </li>\r\n");
out.write(" <li><a href=\"category_form.jsp\"><i class=\"fa fa-user\"></i>Add New</a></li>\r\n");
out.write(" <li><a href=\"Info_admin.jsp\"><i class=\"fa fa-info\"></i>Information</a></li>\r\n");
out.write(" </ul>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write("\r\n");
out.write("\r\n");
out.write(" </body>\r\n");
out.write("</html>");
out.write("\n");
out.write(" <div style=\"width:100%;\">\n");
out.write(" <h1 align =\"center\">Added Categories Info</h1>\n");
out.write(" <table align =\"center\" border=\"1\" style=\"color:#fff\">\n");
out.write(" <tr style=\"color:black\">\n");
out.write(" <th>Category-Id</th>\n");
out.write(" <th>Name of Category</th>\n");
out.write(" <th>Description</th>\n");
out.write(" <th>Image</th>\n");
out.write(" </tr>\n");
out.write(" ");
List<Category_bean> a1 = Read_values.fetchAllCategory();
for (Category_bean s2 : a1) {
out.write("\n");
out.write(" <tr>\n");
out.write(" <td>");
out.print( s2.getCategory_id());
out.write("</td>\n");
out.write(" <td>");
out.print( s2.getCategory_name());
out.write("</td>\n");
out.write(" <td>");
out.print( s2.getCategory_desc());
out.write("</td>\n");
out.write(" <td><img src=UploadedData/");
out.print(s2.getCategory_img());
out.write(" height=\"100\" width=\"100\"></td>\n");
out.write(" <td><a href=\"RegDeleteServ?id=");
out.print(s2.getCategory_id());
out.write("\" style=\"background-color:#505050 ;color:#fff\">Delete</a></td>\n");
out.write(" <td><a href=\"edit.jsp?id=");
out.print(s2.getCategory_id());
out.write("\" style=\"background-color:#505050 ;color:#fff\">Update</a></td>\n");
out.write(" </tr>\n");
out.write(" <tr></tr>\n");
out.write(" <tr></tr>\n");
out.write(" ");
}
out.write("\n");
out.write(" </table>\n");
out.write(" </div>\n");
out.write("</body>\n");
out.write("\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| UTF-8 | Java | 13,258 | java | Info_005fadmin_jsp.java | Java | [] | null | [] | package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import CRUD.Read_values;
import Common.Category_bean;
import java.util.List;
public final class Info_005fadmin_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List<String> _jspx_dependants;
static {
_jspx_dependants = new java.util.ArrayList<String>(2);
_jspx_dependants.add("/category_action.jsp");
_jspx_dependants.add("/admin_header.jsp");
}
private org.glassfish.jsp.api.ResourceInjector _jspx_resourceInjector;
public java.util.List<String> getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
_jspx_resourceInjector = (org.glassfish.jsp.api.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");
out.write("<body>\n");
out.write(" ");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write(" <head>\r\n");
out.write(" <title>Drop down menu design</title>\r\n");
out.write(" <meta charset=\"utf-8\" />\r\n");
out.write(" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\" />\r\n");
out.write(" <style>\r\n");
out.write(" * {\r\n");
out.write(" margin:0;\r\n");
out.write(" padding:0;\r\n");
out.write(" box-sizing: border-box;\r\n");
out.write(" }\r\n");
out.write(" #category {\r\n");
out.write(" margin-top:100px;\r\n");
out.write(" font-family:san-serif;\r\n");
out.write(" text-align:center;\r\n");
out.write(" font-size:20px;\r\n");
out.write(" background:#800080;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar {\r\n");
out.write(" background:rgb(0,0,100);\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul {\r\n");
out.write(" display:inline-flex;\r\n");
out.write(" list-style:none;\r\n");
out.write(" color: #fff;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li {\r\n");
out.write(" width:120px;\r\n");
out.write(" margin:15px;\r\n");
out.write(" padding:15px;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li a {\r\n");
out.write(" text-decoration:none;\r\n");
out.write(" color: #fff;\r\n");
out.write(" }\r\n");
out.write(" .active,#menu-bar ul li:hover {\r\n");
out.write(" background:#2bab0d;\r\n");
out.write(" border-radius: 3px;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar .fa {\r\n");
out.write(" margin-right:10px;\r\n");
out.write(" }\r\n");
out.write(" #sub-menu {\r\n");
out.write(" display:none;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu {\r\n");
out.write(" display:block;\r\n");
out.write(" position:absolute;\r\n");
out.write(" background:rgb(0,120,0);\r\n");
out.write(" margin-top:15px;\r\n");
out.write(" margin-left:-15px;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu ul {\r\n");
out.write(" display:block;\r\n");
out.write(" margin:10px;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu ul li {\r\n");
out.write(" width:150px;\r\n");
out.write(" padding:10px;\r\n");
out.write(" border-bottom:1px dotted #fff;\r\n");
out.write(" background:transparent;\r\n");
out.write(" border-radius:o;\r\n");
out.write(" text-align:left;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu ul li:last-child {\r\n");
out.write(" border-bottom:none;\r\n");
out.write(" }\r\n");
out.write(" #menu-bar ul li:hover #sub-menu ul li a:hover {\r\n");
out.write(" color:#b2ff00;\r\n");
out.write(" }\r\n");
out.write(" .fa-angle-right {\r\n");
out.write(" float:right;\r\n");
out.write(" }\r\n");
out.write(" </style>\r\n");
out.write(" <link rel=\"stylesheet\" type=\"text/css\" href=\"https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css\">\r\n");
out.write(" </head>\r\n");
out.write(" <body style =\"background-image: url(img/portfolio/3.jpg); background-repeat: no-repeat; background-size: cover\">\r\n");
out.write(" ");
out.write("<style>\r\n");
out.write(" body{\r\n");
out.write(" margin :0;\r\n");
out.write(" padding: 0;\r\n");
out.write(" font-family:verdana,san-serif,Geneva;\r\n");
out.write(" font-size:30px;\r\n");
out.write(" }\r\n");
out.write(" header {\r\n");
out.write(" height:150px;\r\n");
out.write(" position:fixed;\r\n");
out.write(" background:#505050;\r\n");
out.write(" width:100%;\r\n");
out.write(" top:0;}\r\n");
out.write(" .logo {\r\n");
out.write(" float:left;\r\n");
out.write(" margin-left:10%;\r\n");
out.write(" }\r\n");
out.write(" .logo a {\r\n");
out.write(" color:blue;\r\n");
out.write(" font-size:30px;\r\n");
out.write(" margin-top:25px;\r\n");
out.write(" display:block;\r\n");
out.write(" text-decoration:none;\r\n");
out.write(" }.menu {\r\n");
out.write(" float:right;\r\n");
out.write(" margin-right:10%;\r\n");
out.write(" margin-top:35px;\r\n");
out.write(" }\r\n");
out.write(" .menu ul {\r\n");
out.write(" margin:0px;\r\n");
out.write(" padding:0px;\r\n");
out.write(" list-style:none;\r\n");
out.write(" }\r\n");
out.write(" .menu ul li {\r\n");
out.write(" float:left;\r\n");
out.write(" }\r\n");
out.write(" .menu ul li a {\r\n");
out.write(" color:#fff;\r\n");
out.write(" text-decoration:none;\r\n");
out.write(" margin-left:10px;\r\n");
out.write(" margin-right:10px;\r\n");
out.write(" }\r\n");
out.write("</style>\r\n");
out.write("<title>Insert title here</title>\r\n");
out.write("</head>\r\n");
out.write("<body class=\"admin_header\">\r\n");
out.write(" <header ><div class=\"logo\">\r\n");
out.write(" <a href=\"index_admin.jsp\">MENU</a></div>\r\n");
out.write(" <div class=\"menu\">\r\n");
out.write(" <p style=\"color:#fff;font-size: 30px\">Welcome In Admin-Panel</p>\r\n");
out.write(" </div><!-- menu -->\r\n");
out.write(" </header><!-- header -->\r\n");
out.write("</body>");
out.write("\r\n");
out.write(" <div id =\"category\">\r\n");
out.write(" <h1>Categories</h1>\r\n");
out.write(" <div id = \"menu-bar\">\r\n");
out.write(" <ul>\r\n");
out.write(" <li class=\"active\"><a href=\"#\"><i class=\"fa fa-clone\"></i>View Category</a>\r\n");
out.write(" <div id=\"sub-menu\">\r\n");
out.write(" <ul>\r\n");
out.write(" ");
List<Category_bean> al = Read_values.fetchAllCategory();
for (Category_bean u : al) {
out.write("\r\n");
out.write(" <li><a href=\"");
out.print(u.getCategory_id());
out.write('"');
out.write('>');
out.print(u.getCategory_name());
out.write("</a><i class=\"fa fa-angle-right\"></i></li>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" </div>\r\n");
out.write(" </li>\r\n");
out.write(" <li><a href=\"category_form.jsp\"><i class=\"fa fa-user\"></i>Add New</a></li>\r\n");
out.write(" <li><a href=\"Info_admin.jsp\"><i class=\"fa fa-info\"></i>Information</a></li>\r\n");
out.write(" </ul>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write("\r\n");
out.write("\r\n");
out.write(" </body>\r\n");
out.write("</html>");
out.write("\n");
out.write(" <div style=\"width:100%;\">\n");
out.write(" <h1 align =\"center\">Added Categories Info</h1>\n");
out.write(" <table align =\"center\" border=\"1\" style=\"color:#fff\">\n");
out.write(" <tr style=\"color:black\">\n");
out.write(" <th>Category-Id</th>\n");
out.write(" <th>Name of Category</th>\n");
out.write(" <th>Description</th>\n");
out.write(" <th>Image</th>\n");
out.write(" </tr>\n");
out.write(" ");
List<Category_bean> a1 = Read_values.fetchAllCategory();
for (Category_bean s2 : a1) {
out.write("\n");
out.write(" <tr>\n");
out.write(" <td>");
out.print( s2.getCategory_id());
out.write("</td>\n");
out.write(" <td>");
out.print( s2.getCategory_name());
out.write("</td>\n");
out.write(" <td>");
out.print( s2.getCategory_desc());
out.write("</td>\n");
out.write(" <td><img src=UploadedData/");
out.print(s2.getCategory_img());
out.write(" height=\"100\" width=\"100\"></td>\n");
out.write(" <td><a href=\"RegDeleteServ?id=");
out.print(s2.getCategory_id());
out.write("\" style=\"background-color:#505050 ;color:#fff\">Delete</a></td>\n");
out.write(" <td><a href=\"edit.jsp?id=");
out.print(s2.getCategory_id());
out.write("\" style=\"background-color:#505050 ;color:#fff\">Update</a></td>\n");
out.write(" </tr>\n");
out.write(" <tr></tr>\n");
out.write(" <tr></tr>\n");
out.write(" ");
}
out.write("\n");
out.write(" </table>\n");
out.write(" </div>\n");
out.write("</body>\n");
out.write("\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| 13,258 | 0.456253 | 0.445241 | 284 | 44.700703 | 24.766199 | 163 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.183099 | false | false | 0 |
c6ca44a5e8052fc9fe65761ef4bcaa01b6966eb1 | 15,058,155,381,614 | ab639dc381ff6e5a355ae0cc01d2a5b046c9b09c | /core/cn.gotom.service/src/main/java/cn/gotom/service/UserService.java | 15e73750a995c7cfe1514c759e0bb6bfcd8d25ce | [] | no_license | peixere/gotom | https://github.com/peixere/gotom | 69a970278605a802367ae53b15a2767ac42acaad | 46f04fdc9ac97deb52ecdfb01062c1c1db7b2367 | refs/heads/master | 2021-01-17T13:05:34.299000 | 2017-04-12T16:23:38 | 2017-04-12T16:23:38 | 26,008,848 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.gotom.service;
import java.util.List;
import cn.gotom.pojos.Custom;
import cn.gotom.pojos.Organization;
import cn.gotom.pojos.User;
import cn.gotom.service.impl.UserServiceImpl;
import com.google.inject.ImplementedBy;
@ImplementedBy(UserServiceImpl.class)
public interface UserService extends GenericService<User, String>
{
public User getByUsername(String username);
public User getByMobile(String mobile);
public List<User> findAllByOrg(List<Organization> orgList);
void updateEmpty(Custom custom);
public List<Custom> findCustomByUserIdList(String userId);
public void delete(User user);
}
| UTF-8 | Java | 647 | java | UserService.java | Java | [] | null | [] | package cn.gotom.service;
import java.util.List;
import cn.gotom.pojos.Custom;
import cn.gotom.pojos.Organization;
import cn.gotom.pojos.User;
import cn.gotom.service.impl.UserServiceImpl;
import com.google.inject.ImplementedBy;
@ImplementedBy(UserServiceImpl.class)
public interface UserService extends GenericService<User, String>
{
public User getByUsername(String username);
public User getByMobile(String mobile);
public List<User> findAllByOrg(List<Organization> orgList);
void updateEmpty(Custom custom);
public List<Custom> findCustomByUserIdList(String userId);
public void delete(User user);
}
| 647 | 0.769706 | 0.769706 | 26 | 22.884615 | 21.571575 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.846154 | false | false | 0 |
fd49ac4b0e1c231d1bef7c672402f9de4c99b0ea | 11,751,030,522,326 | 4f7450c57ce3b735036db6fa2412c653b17e09c7 | /Client/src/main/java/de/schweinefilet/prototype/client/frame/paint/PaintStrategy.java | 6e56464de327020d21bf859fbf5b4027be8b0cca | [] | no_license | trnscvr/protoypefinal | https://github.com/trnscvr/protoypefinal | 6aa9debd703b1d0edaa26a7ca461323b64d3a9f1 | 5545f4b582dfb0f115003f1ca0f4061f72b9cb83 | refs/heads/master | 2020-12-20T10:51:36.061000 | 2020-01-24T17:24:03 | 2020-01-24T17:24:03 | 236,048,565 | 0 | 0 | null | false | 2020-02-03T11:30:39 | 2020-01-24T17:21:01 | 2020-01-24T17:24:23 | 2020-01-24T17:24:43 | 2,294 | 0 | 0 | 0 | Java | false | false | package de.schweinefilet.prototype.client.frame.paint;
import static de.schweinefilet.prototype.client.Client.CONTROL_HANDLER;
import static de.schweinefilet.prototype.client.Client.ENTITY_HOLDER;
import static de.schweinefilet.prototype.client.Client.FRAME_HANDLER;
import static de.schweinefilet.prototype.client.Client.HUD_HOLDER;
import static de.schweinefilet.prototype.client.Client.MAP_HOLDER;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
/**
* Describes a method to paint the game. Different strategies have different CPU/GPU usages. This
* are some benchmarks: CPU: Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz, RAM: 2GB, Screen
* resolution: 1440x900 <p><b>All benchmarks were run with the server on the same PC!</b></p>
* <p>Data:
* <ul>
* <li>{@link PaintStrategyBufferedImage} - around 75% CPU usage, screen tearing, doesn't need dedicated GPU</li>
* <li>{@link PaintStrategyPageFlipping} - around 35% CPU usage, no screen tearing, needs dedicated GPU to function correctly</li>
* <li>{@link PaintStrategyVolatileImage} - around 25% CPU usage, some screen tearing, a dedicated GPU is advised</li>
* </ul>
*/
public interface PaintStrategy {
/**
* See {@link PaintStrategyBufferedImage}.
*/
int BUFFERED_IMAGE = 1;
/**
* See {@link PaintStrategyPageFlipping}.
*/
int PAGE_FLIPPING = 2;
/**
* See {@link PaintStrategyVolatileImage}.
*/
int VOLATILE_IMAGE = 3;
/**
* The public paint method. Should call {@link PaintStrategy#paintGame(Graphics2D)}
*
* @param graphics {@link Graphics} object based on the current {@link PaintStrategy}.
*/
void paint(Graphics graphics);
/**
* -
*
* @return true, when an {@link java.awt.Image} is used for drawing
*/
boolean isImagePowered();
/**
* Returns the strategy specifics name.
*
* @return the name of the {@link PaintStrategy}
*/
String getName();
/**
* Returns the strategy specifics ID.
*
* @return the ID of the {@link PaintStrategy}
*/
int getId();
/**
* Draws the game with the {@link Graphics2D} object.
*
* @param graphics2D the {@link Graphics2D} object based on the current {@link PaintStrategy}.
*/
default void paintGame(Graphics2D graphics2D) {
if (MAP_HOLDER.getOptionalMap().isPresent()) {
MAP_HOLDER.getOptionalMap().ifPresent(map -> {
ENTITY_HOLDER.getUser()
.setDimensions(FRAME_HANDLER.getWidth(), FRAME_HANDLER.getHeight());
//paint the background
graphics2D.setColor(Color.DARK_GRAY);
graphics2D.fillRect(0, 0, FRAME_HANDLER.getWidth(), FRAME_HANDLER.getHeight());
//calculate the offset and set it
int offsetX =
-ENTITY_HOLDER.getUser().getLocation().x + (FRAME_HANDLER.getWidth()
/ 2);
int offsetY =
-ENTITY_HOLDER.getUser().getLocation().y + (FRAME_HANDLER.getHeight()
/ 2);
//paint the map
map.draw(graphics2D, offsetX, offsetY, MAP_HOLDER.getMapWidth(),
MAP_HOLDER.getMapHeight());
//paint the projectiles
ENTITY_HOLDER.getProjectiles()
.forEach(projectile -> projectile.draw(graphics2D, offsetX, offsetY));
//paint the blocks, when the map has some
map.getBlocks().forEach(block -> block.draw(graphics2D, offsetX, offsetY));
//paint the two spawns
map.getSpawns().forEach(spawn -> spawn.draw(graphics2D, offsetX, offsetY));
//paint all the players
ENTITY_HOLDER.getPlayers()
.forEach(player -> player.draw(graphics2D, offsetX, offsetY));
//paint the user
ENTITY_HOLDER.getUser().draw(graphics2D, offsetX, offsetY);
//paint the flag
map.getFlag().draw(graphics2D, offsetX, offsetY);
//paint the HUD
HUD_HOLDER.drawAll(graphics2D);
//paint the mouse
CONTROL_HANDLER.getMouse().draw(graphics2D);
});
}
}
}
| UTF-8 | Java | 4,361 | java | PaintStrategy.java | Java | [] | null | [] | package de.schweinefilet.prototype.client.frame.paint;
import static de.schweinefilet.prototype.client.Client.CONTROL_HANDLER;
import static de.schweinefilet.prototype.client.Client.ENTITY_HOLDER;
import static de.schweinefilet.prototype.client.Client.FRAME_HANDLER;
import static de.schweinefilet.prototype.client.Client.HUD_HOLDER;
import static de.schweinefilet.prototype.client.Client.MAP_HOLDER;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
/**
* Describes a method to paint the game. Different strategies have different CPU/GPU usages. This
* are some benchmarks: CPU: Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz, RAM: 2GB, Screen
* resolution: 1440x900 <p><b>All benchmarks were run with the server on the same PC!</b></p>
* <p>Data:
* <ul>
* <li>{@link PaintStrategyBufferedImage} - around 75% CPU usage, screen tearing, doesn't need dedicated GPU</li>
* <li>{@link PaintStrategyPageFlipping} - around 35% CPU usage, no screen tearing, needs dedicated GPU to function correctly</li>
* <li>{@link PaintStrategyVolatileImage} - around 25% CPU usage, some screen tearing, a dedicated GPU is advised</li>
* </ul>
*/
public interface PaintStrategy {
/**
* See {@link PaintStrategyBufferedImage}.
*/
int BUFFERED_IMAGE = 1;
/**
* See {@link PaintStrategyPageFlipping}.
*/
int PAGE_FLIPPING = 2;
/**
* See {@link PaintStrategyVolatileImage}.
*/
int VOLATILE_IMAGE = 3;
/**
* The public paint method. Should call {@link PaintStrategy#paintGame(Graphics2D)}
*
* @param graphics {@link Graphics} object based on the current {@link PaintStrategy}.
*/
void paint(Graphics graphics);
/**
* -
*
* @return true, when an {@link java.awt.Image} is used for drawing
*/
boolean isImagePowered();
/**
* Returns the strategy specifics name.
*
* @return the name of the {@link PaintStrategy}
*/
String getName();
/**
* Returns the strategy specifics ID.
*
* @return the ID of the {@link PaintStrategy}
*/
int getId();
/**
* Draws the game with the {@link Graphics2D} object.
*
* @param graphics2D the {@link Graphics2D} object based on the current {@link PaintStrategy}.
*/
default void paintGame(Graphics2D graphics2D) {
if (MAP_HOLDER.getOptionalMap().isPresent()) {
MAP_HOLDER.getOptionalMap().ifPresent(map -> {
ENTITY_HOLDER.getUser()
.setDimensions(FRAME_HANDLER.getWidth(), FRAME_HANDLER.getHeight());
//paint the background
graphics2D.setColor(Color.DARK_GRAY);
graphics2D.fillRect(0, 0, FRAME_HANDLER.getWidth(), FRAME_HANDLER.getHeight());
//calculate the offset and set it
int offsetX =
-ENTITY_HOLDER.getUser().getLocation().x + (FRAME_HANDLER.getWidth()
/ 2);
int offsetY =
-ENTITY_HOLDER.getUser().getLocation().y + (FRAME_HANDLER.getHeight()
/ 2);
//paint the map
map.draw(graphics2D, offsetX, offsetY, MAP_HOLDER.getMapWidth(),
MAP_HOLDER.getMapHeight());
//paint the projectiles
ENTITY_HOLDER.getProjectiles()
.forEach(projectile -> projectile.draw(graphics2D, offsetX, offsetY));
//paint the blocks, when the map has some
map.getBlocks().forEach(block -> block.draw(graphics2D, offsetX, offsetY));
//paint the two spawns
map.getSpawns().forEach(spawn -> spawn.draw(graphics2D, offsetX, offsetY));
//paint all the players
ENTITY_HOLDER.getPlayers()
.forEach(player -> player.draw(graphics2D, offsetX, offsetY));
//paint the user
ENTITY_HOLDER.getUser().draw(graphics2D, offsetX, offsetY);
//paint the flag
map.getFlag().draw(graphics2D, offsetX, offsetY);
//paint the HUD
HUD_HOLDER.drawAll(graphics2D);
//paint the mouse
CONTROL_HANDLER.getMouse().draw(graphics2D);
});
}
}
}
| 4,361 | 0.601926 | 0.591149 | 124 | 34.169353 | 33.234436 | 134 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.491935 | false | false | 0 |
84aa2b34c9a303d4946ca9e9c6e3d1da3c058030 | 13,632,226,257,260 | 94799154dd15c6f630836272014e61f48c279290 | /src/main/java/com/xmx/ssm/entity/TBookType.java | c650ff98ee992861f590c1854bc3fa2e178c0d62 | [] | no_license | findxme/xiaoxiaoworld | https://github.com/findxme/xiaoxiaoworld | 397280cd6fe10e724f9321519e1fc29d9d122161 | 60812e9d10801543c2e53dd23a1fc80d5893be61 | refs/heads/master | 2022-12-21T09:37:42.673000 | 2019-10-17T04:58:57 | 2019-10-17T04:58:57 | 215,697,393 | 1 | 0 | null | false | 2022-12-16T10:52:15 | 2019-10-17T03:40:18 | 2020-06-03T00:08:31 | 2022-12-16T10:52:12 | 7,364 | 1 | 0 | 13 | JavaScript | false | false | package com.xmx.ssm.entity;
public class TBookType {
private Integer bBookTypeId;
private String bBookTypeNo;
private String bBookType;
public Integer getbBookTypeId() {
return bBookTypeId;
}
public void setbBookTypeId(Integer bBookTypeId) {
this.bBookTypeId = bBookTypeId;
}
public String getbBookTypeNo() {
return bBookTypeNo;
}
public void setbBookTypeNo(String bBookTypeNo) {
this.bBookTypeNo = bBookTypeNo == null ? null : bBookTypeNo.trim();
}
public String getbBookType() {
return bBookType;
}
public void setbBookType(String bBookType) {
this.bBookType = bBookType == null ? null : bBookType.trim();
}
} | UTF-8 | Java | 728 | java | TBookType.java | Java | [] | null | [] | package com.xmx.ssm.entity;
public class TBookType {
private Integer bBookTypeId;
private String bBookTypeNo;
private String bBookType;
public Integer getbBookTypeId() {
return bBookTypeId;
}
public void setbBookTypeId(Integer bBookTypeId) {
this.bBookTypeId = bBookTypeId;
}
public String getbBookTypeNo() {
return bBookTypeNo;
}
public void setbBookTypeNo(String bBookTypeNo) {
this.bBookTypeNo = bBookTypeNo == null ? null : bBookTypeNo.trim();
}
public String getbBookType() {
return bBookType;
}
public void setbBookType(String bBookType) {
this.bBookType = bBookType == null ? null : bBookType.trim();
}
} | 728 | 0.65522 | 0.65522 | 33 | 21.09091 | 21.483418 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.30303 | false | false | 0 |
5947b2508490cf838da941430ac0f4ba2bab02a7 | 24,541,443,131,203 | 30e1ab2d03ab45d3efd73c98ce7adec1717cd735 | /Android/app/src/main/java/com/mickmelon/carshare/util/FragmentHelper.java | 1a97854e50270fb700e6af48029617dfa6476af0 | [
"MIT"
] | permissive | MickMelon/AutoMarket | https://github.com/MickMelon/AutoMarket | d90f7f0b7dc91e1a0c842313cfd15ee29a95d57d | 9b1b17f197687fab4a14563acfd0f8d4adf27d35 | refs/heads/master | 2023-02-08T20:26:38.162000 | 2020-05-25T15:19:03 | 2020-05-25T15:19:03 | 171,731,992 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.mickmelon.carshare.util;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import com.mickmelon.carshare.R;
import com.mickmelon.carshare.presentation.MainActivity;
/**
* Helpful functions to show and close fragments.
*/
public class FragmentHelper {
/**
* Indicates whether a fragment has been shown.
*/
private static boolean _fragmentShown = false;
/**
* Checks whether a fragment has been shown.
* @return Whether a fragment has been shown.
*/
public static boolean isFragmentShown() { return _fragmentShown; }
/**
* Shows a fragment.
* @param activity The calling activity.
* @param fragment The fragment to be shown.
*/
public static void showFragment(AppCompatActivity activity, Fragment fragment, boolean closeOldFragment) {
if (activity == null || fragment == null) return;
if (closeOldFragment) {
closeCurrentFragment(activity);
}
fragment.setRetainInstance(true);
FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, fragment, "CurrentFragment");
transaction.addToBackStack(null);
transaction.commit();
_fragmentShown = true;
}
/**
* Closes the currently open fragment that is identified by the tag parameter.
* @param activity The calling activity.
*/
public static void closeCurrentFragment(AppCompatActivity activity) {
closeFragment(activity, "CurrentFragment");
}
/**
* Closes a fragment that is identified by the tag parameter.
* @param activity The calling activity.
* @param tag The fragment tag.
*/
public static void closeFragment(AppCompatActivity activity, String tag) {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
Fragment oldFragment = fragmentManager.findFragmentByTag(tag);
if (oldFragment != null) {
fragmentManager.beginTransaction().remove(oldFragment).commit();
}
_fragmentShown = false;
}
}
| UTF-8 | Java | 2,274 | java | FragmentHelper.java | Java | [] | null | [] | package com.mickmelon.carshare.util;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import com.mickmelon.carshare.R;
import com.mickmelon.carshare.presentation.MainActivity;
/**
* Helpful functions to show and close fragments.
*/
public class FragmentHelper {
/**
* Indicates whether a fragment has been shown.
*/
private static boolean _fragmentShown = false;
/**
* Checks whether a fragment has been shown.
* @return Whether a fragment has been shown.
*/
public static boolean isFragmentShown() { return _fragmentShown; }
/**
* Shows a fragment.
* @param activity The calling activity.
* @param fragment The fragment to be shown.
*/
public static void showFragment(AppCompatActivity activity, Fragment fragment, boolean closeOldFragment) {
if (activity == null || fragment == null) return;
if (closeOldFragment) {
closeCurrentFragment(activity);
}
fragment.setRetainInstance(true);
FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
transaction.replace(R.id.fragment_container, fragment, "CurrentFragment");
transaction.addToBackStack(null);
transaction.commit();
_fragmentShown = true;
}
/**
* Closes the currently open fragment that is identified by the tag parameter.
* @param activity The calling activity.
*/
public static void closeCurrentFragment(AppCompatActivity activity) {
closeFragment(activity, "CurrentFragment");
}
/**
* Closes a fragment that is identified by the tag parameter.
* @param activity The calling activity.
* @param tag The fragment tag.
*/
public static void closeFragment(AppCompatActivity activity, String tag) {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
Fragment oldFragment = fragmentManager.findFragmentByTag(tag);
if (oldFragment != null) {
fragmentManager.beginTransaction().remove(oldFragment).commit();
}
_fragmentShown = false;
}
}
| 2,274 | 0.689534 | 0.687775 | 71 | 31.02817 | 28.516352 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.422535 | false | false | 0 |
3ee2b60307b1bff79e69dff76eb3d678dc069007 | 27,401,891,382,005 | 32b72e1dc8b6ee1be2e80bb70a03a021c83db550 | /ast_results/Andre1299_TUI-ConsoleLauncher/app/src/main/java/ohi/andre/consolelauncher/tuils/Assist.java | 064db49ac3989aac0663099e8b4df208b8843af2 | [] | no_license | cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning | https://github.com/cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning | d90c41a17e88fcd99d543124eeb6e93f9133cb4a | 0564143d92f8024ff5fa6b659c2baebf827582b1 | refs/heads/master | 2020-07-13T13:53:40.297000 | 2019-01-11T11:51:18 | 2019-01-11T11:51:18 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | // isComment
package ohi.andre.consolelauncher.tuils;
import android.app.Activity;
import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import java.lang.reflect.Field;
public class isClassOrIsInterface {
// isComment
// isComment
public static void isMethod(Activity isParameter) {
new Assist(isNameExpr);
}
private View isVariable;
private int isVariable;
private FrameLayout.LayoutParams isVariable;
private isConstructor(Activity isParameter) {
FrameLayout isVariable = (FrameLayout) isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr = isNameExpr.isMethod(isIntegerConstant);
isNameExpr.isMethod().isMethod(new ViewTreeObserver.OnGlobalLayoutListener() {
public void isMethod() {
isMethod();
}
});
isNameExpr = (FrameLayout.LayoutParams) isNameExpr.isMethod();
}
private void isMethod() {
int isVariable = isMethod();
if (isNameExpr != isNameExpr) {
int isVariable = isNameExpr.isMethod().isMethod();
int isVariable = isNameExpr - isNameExpr;
if (isNameExpr > (isNameExpr / isIntegerConstant)) {
// isComment
isNameExpr.isFieldAccessExpr = isNameExpr - isNameExpr;
} else {
// isComment
isNameExpr.isFieldAccessExpr = isNameExpr;
}
if (isNameExpr.isFieldAccessExpr.isFieldAccessExpr >= isIntegerConstant) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
} else {
isMethod(isNameExpr, "isStringConstant", isNameExpr.isFieldAccessExpr);
}
isNameExpr.isMethod();
isNameExpr = isNameExpr;
}
}
private int isMethod() {
Rect isVariable = new Rect();
isNameExpr.isMethod(isNameExpr);
return (isNameExpr.isFieldAccessExpr - isNameExpr.isFieldAccessExpr);
}
private void isMethod(Object isParameter, String isParameter, Object isParameter) {
try {
Class<?> isVariable = isNameExpr.isMethod(View.class.isMethod());
Field isVariable = isNameExpr.isMethod(isNameExpr);
isNameExpr.isMethod(true);
isNameExpr.isMethod(isNameExpr, isNameExpr);
} catch (ClassNotFoundException isParameter) {
isNameExpr.isMethod();
} catch (NoSuchFieldException isParameter) {
isNameExpr.isMethod();
} catch (IllegalAccessException isParameter) {
isNameExpr.isMethod();
} catch (IllegalArgumentException isParameter) {
isNameExpr.isMethod();
}
}
}
| UTF-8 | Java | 2,838 | java | Assist.java | Java | [] | null | [] | // isComment
package ohi.andre.consolelauncher.tuils;
import android.app.Activity;
import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import java.lang.reflect.Field;
public class isClassOrIsInterface {
// isComment
// isComment
public static void isMethod(Activity isParameter) {
new Assist(isNameExpr);
}
private View isVariable;
private int isVariable;
private FrameLayout.LayoutParams isVariable;
private isConstructor(Activity isParameter) {
FrameLayout isVariable = (FrameLayout) isNameExpr.isMethod(isNameExpr.isFieldAccessExpr.isFieldAccessExpr.isFieldAccessExpr);
isNameExpr = isNameExpr.isMethod(isIntegerConstant);
isNameExpr.isMethod().isMethod(new ViewTreeObserver.OnGlobalLayoutListener() {
public void isMethod() {
isMethod();
}
});
isNameExpr = (FrameLayout.LayoutParams) isNameExpr.isMethod();
}
private void isMethod() {
int isVariable = isMethod();
if (isNameExpr != isNameExpr) {
int isVariable = isNameExpr.isMethod().isMethod();
int isVariable = isNameExpr - isNameExpr;
if (isNameExpr > (isNameExpr / isIntegerConstant)) {
// isComment
isNameExpr.isFieldAccessExpr = isNameExpr - isNameExpr;
} else {
// isComment
isNameExpr.isFieldAccessExpr = isNameExpr;
}
if (isNameExpr.isFieldAccessExpr.isFieldAccessExpr >= isIntegerConstant) {
isNameExpr.isMethod(isNameExpr.isFieldAccessExpr);
} else {
isMethod(isNameExpr, "isStringConstant", isNameExpr.isFieldAccessExpr);
}
isNameExpr.isMethod();
isNameExpr = isNameExpr;
}
}
private int isMethod() {
Rect isVariable = new Rect();
isNameExpr.isMethod(isNameExpr);
return (isNameExpr.isFieldAccessExpr - isNameExpr.isFieldAccessExpr);
}
private void isMethod(Object isParameter, String isParameter, Object isParameter) {
try {
Class<?> isVariable = isNameExpr.isMethod(View.class.isMethod());
Field isVariable = isNameExpr.isMethod(isNameExpr);
isNameExpr.isMethod(true);
isNameExpr.isMethod(isNameExpr, isNameExpr);
} catch (ClassNotFoundException isParameter) {
isNameExpr.isMethod();
} catch (NoSuchFieldException isParameter) {
isNameExpr.isMethod();
} catch (IllegalAccessException isParameter) {
isNameExpr.isMethod();
} catch (IllegalArgumentException isParameter) {
isNameExpr.isMethod();
}
}
}
| 2,838 | 0.641649 | 0.641649 | 82 | 33.609756 | 26.833158 | 133 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.512195 | false | false | 0 |
9769822ee48abe8ea60b2706cfa9b363f1927911 | 2,353,642,092,610 | 984570c51b4a151133761750ce330962a0d93347 | /Methods2.java | 1a89695b0fc2e7cf50baf613eb5315428afbb1f3 | [] | no_license | fearlessfreap24/StringTwoJava | https://github.com/fearlessfreap24/StringTwoJava | 3781e8fbd2cf3143d00d787061eb96c9769d4be1 | db19862fa82e1e4809ef2fd8a26fcee9c2f62074 | refs/heads/master | 2022-12-28T19:20:31.710000 | 2020-10-09T20:34:55 | 2020-10-09T20:34:55 | 300,079,602 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class Methods2 {
public boolean prefixAgain(String str, int n) {
// Given a string, consider the prefix string made of the first N chars of the
// string. Does that prefix string appear somewhere else in the string? Assume
// that the string is not empty and that N is in the range 1..str.length().
//
// prefixAgain("abXYabc", 1) → true
// prefixAgain("abXYabc", 2) → true
// prefixAgain("abXYabc", 3) → false
String endOfWord = str.substring(n);
String prefix = str.substring(0, n);
return endOfWord.contains(prefix);
}
public boolean xyzMiddle(String str) {
// Given a string, does "xyz" appear in the middle of the string? To define middle,
// we'll say that the number of chars to the left and right of the "xyz" must differ
// by at most one. This problem is harder than it looks.
//
// xyzMiddle("AAxyzBB") → true
// xyzMiddle("AxyzBB") → true
// xyzMiddle("AxyzBBB") → false
if ( str.length() < 3 ) return false;
int strHalf = str.length() / 2;
String firstHalf = str.substring(0, strHalf);
String lastHalf = str.substring(strHalf);
if ( str.length() % 2 == 1 ) {
return firstHalf.substring(firstHalf.length() - 1).equals("x")
&& lastHalf.substring(0, 2).equals("yz");
}
else {
return (firstHalf.substring(firstHalf.length() - 2).equals("xy")
&& lastHalf.substring(0, 1).equals("z"))
|| firstHalf.substring(firstHalf.length() - 1).equals("x")
&& lastHalf.substring(0, 2).equals("yz");
}
}
public String getSandwich(String str) {
// A sandwich is two pieces of bread with something in between. Return the string that
// is between the first and last appearance of "bread" in the given string, or return
// the empty string "" if there are not two pieces of bread.
//
// getSandwich("breadjambread") → "jam"
// getSandwich("xxbreadjambreadyy") → "jam"
// getSandwich("xxbreadyy") → ""
String getsandwich = "";
int bread1 = str.indexOf("bread");
if ( bread1 + 5 > str.length() ) return "";
else bread1 = bread1 + 5;
int bread2 = str.lastIndexOf("bread");
if ( bread1 == bread2 + 5 ) return "";
if ( bread1 > 0 && bread2 > 0 ) {
getsandwich = str.substring(bread1, bread2);
}
return getsandwich;
}
public boolean sameStarChar(String str) {
// Returns true if for every '*' (star) in the string, if there are chars both immediately
// before and after the star, they are the same.
//
// sameStarChar("xy*yzz") → true
// sameStarChar("xy*zzz") → false
// sameStarChar("*xa*az") → true
// found answer here : https://stackoverflow.com/questions/22443662/codingbat-samestarchar-exercise
// answer number 2
// Since I copied this code, I'll explain how it works
// loop over the letters in the word until the last one
for ( int i = 1; i < str.length() - 1; i++ ) {
// if the character at 'i' is a '*', check to see if the characters around it are the same.
if ( str.charAt(i) == '*' && str.charAt(i-1) != str.charAt(i+1) ) {
// if they aren't the same, return false
return false;
}
}
// else, return true
return true;
// my original code was similar to this. When I ran it, everything worked except for "abcDEF".
// There's no explanation that if there are no '*' that it should be true. That's why this code
// I found only checks if the characters around the start are not the same.
}
public String oneTwo(String str) {
// Given a string, compute a new string by moving the first char to come after the next two chars,
// so "abc" yields "bca". Repeat this process for each subsequent group of 3 chars, so "abcdef"
// yields "bcaefd". Ignore any group of fewer than 3 chars at the end.
//
// oneTwo("abc") → "bca"
// oneTwo("tca") → "cat"
// oneTwo("tcagdo") → "catdog"
String onetwo = "";
int strLenDiv3 = str.length() / 3;
for ( int i = 0; i < strLenDiv3; i++ ){
char one = str.substring(i*3).charAt(0);
char two = str.substring(i*3).charAt(1);
char three = str.substring(i*3).charAt(2);
onetwo = onetwo + two + three + one;
}
return onetwo;
}
public String zipZap(String str) {
// Look for patterns like "zip" and "zap" in the string -- length-3, starting with 'z' and ending
// with 'p'. Return a string where for all such words, the middle letter is gone, so "zipXzap"
// yields "zpXzp".
//
// zipZap("zipXzap") → "zpXzp"
// zipZap("zopzop") → "zpzp"
// zipZap("zzzopzop") → "zzzpzp"
String zipzap = "";
if ( str.length() < 3 ) return str;
if ( str.length() == 3 && str.charAt(0) == 'z' && str.charAt(2) == 'p') return "zp";
if ( str.length() == 3 ) return str;
for ( int i = 0; i < str.length() - 2; i++ ){
char one = str.substring(i).charAt(0);
char three = str.substring(i).charAt(2);
if ( one == 'z' && three == 'p' ){
zipzap = zipzap + one + three;
i = i + 2;
}
else if ( i == str.length() - 3 && ( one != 'z' || three != 'p') ){
zipzap = zipzap + str.substring(i);
}
else zipzap = zipzap + str.charAt(i);
}
return zipzap;
}
public String starOut(String str) {
// Return a version of the given string, where for every star (*) in the string the star and
// the chars immediately to its left and right are gone. So "ab*cd" yields "ad" and "ab**cd"
// also yields "ad".
//
// starOut("ab*cd") → "ad"
// starOut("ab**cd") → "ad"
// starOut("sm*eilly") → "silly"
int length = str.length();
String starout = "";
for (int i = 0; i < length; i++) {
if (i == 0 && str.charAt(i) != '*') starout += str.charAt(i);
if (i > 0 && str.charAt(i) != '*' && str.charAt(i-1) != '*') starout += str.charAt(i);
if (i > 0 && str.charAt(i) == '*' && str.charAt(i-1) != '*') starout = starout.substring(0,starout.length()-1);
}
return starout;
}
public String plusOut(String str, String word) {
// Given a string and a non-empty word string, return a version of the original String where
// all chars have been replaced by pluses ("+"), except for appearances of the word string
// which are preserved unchanged.
//
// plusOut("12xy34", "xy") → "++xy++"
// plusOut("12xy34", "1") → "1+++++"
// plusOut("12xy34xyabcxy", "xy") → "++xy++xy+++xy"
String plusout = "";
int strLen = str.length();
int wordLen = word.length();
for ( int i = 0; i < strLen; i++ ){
String subStr = str.substring(i);
int indexOfWord = subStr.indexOf(word);
if ( indexOfWord == 0 ){
plusout += subStr.substring(0, wordLen );
i += wordLen - 1;
}
else plusout += '+';
}
return plusout;
}
public String wordEnds(String str, String word) {
// Given a string and a non-empty word string, return a string made of each char just before and
// just after every appearance of the word in the string. Ignore cases where there is no char
// before or after the word, and a char may be included twice if it is between two words.
//
// wordEnds("abcXY123XYijk", "XY") → "c13i"
// wordEnds("XY123XY", "XY") → "13"
// wordEnds("XY1XY", "XY") → "11"
String wordends = "";
int wordLen = word.length();
if ( str.indexOf(word) < 0 ) return wordends;
if ( str.equals(word) ) return wordends;
for ( int i = 0; i <= str.length(); i++ ) {
String subStr = str.substring(i);
int subLen = subStr.length();
int indexOfWord = subStr.indexOf(word);
if ( i > 0 && indexOfWord == 0 ) wordends += str.charAt(i -1);
if ( i + wordLen < str.length() && indexOfWord == 0 ) wordends += str.charAt(i + wordLen);
}
return wordends;
}
}
| UTF-8 | Java | 7,751 | java | Methods2.java | Java | [] | null | [] |
public class Methods2 {
public boolean prefixAgain(String str, int n) {
// Given a string, consider the prefix string made of the first N chars of the
// string. Does that prefix string appear somewhere else in the string? Assume
// that the string is not empty and that N is in the range 1..str.length().
//
// prefixAgain("abXYabc", 1) → true
// prefixAgain("abXYabc", 2) → true
// prefixAgain("abXYabc", 3) → false
String endOfWord = str.substring(n);
String prefix = str.substring(0, n);
return endOfWord.contains(prefix);
}
public boolean xyzMiddle(String str) {
// Given a string, does "xyz" appear in the middle of the string? To define middle,
// we'll say that the number of chars to the left and right of the "xyz" must differ
// by at most one. This problem is harder than it looks.
//
// xyzMiddle("AAxyzBB") → true
// xyzMiddle("AxyzBB") → true
// xyzMiddle("AxyzBBB") → false
if ( str.length() < 3 ) return false;
int strHalf = str.length() / 2;
String firstHalf = str.substring(0, strHalf);
String lastHalf = str.substring(strHalf);
if ( str.length() % 2 == 1 ) {
return firstHalf.substring(firstHalf.length() - 1).equals("x")
&& lastHalf.substring(0, 2).equals("yz");
}
else {
return (firstHalf.substring(firstHalf.length() - 2).equals("xy")
&& lastHalf.substring(0, 1).equals("z"))
|| firstHalf.substring(firstHalf.length() - 1).equals("x")
&& lastHalf.substring(0, 2).equals("yz");
}
}
public String getSandwich(String str) {
// A sandwich is two pieces of bread with something in between. Return the string that
// is between the first and last appearance of "bread" in the given string, or return
// the empty string "" if there are not two pieces of bread.
//
// getSandwich("breadjambread") → "jam"
// getSandwich("xxbreadjambreadyy") → "jam"
// getSandwich("xxbreadyy") → ""
String getsandwich = "";
int bread1 = str.indexOf("bread");
if ( bread1 + 5 > str.length() ) return "";
else bread1 = bread1 + 5;
int bread2 = str.lastIndexOf("bread");
if ( bread1 == bread2 + 5 ) return "";
if ( bread1 > 0 && bread2 > 0 ) {
getsandwich = str.substring(bread1, bread2);
}
return getsandwich;
}
public boolean sameStarChar(String str) {
// Returns true if for every '*' (star) in the string, if there are chars both immediately
// before and after the star, they are the same.
//
// sameStarChar("xy*yzz") → true
// sameStarChar("xy*zzz") → false
// sameStarChar("*xa*az") → true
// found answer here : https://stackoverflow.com/questions/22443662/codingbat-samestarchar-exercise
// answer number 2
// Since I copied this code, I'll explain how it works
// loop over the letters in the word until the last one
for ( int i = 1; i < str.length() - 1; i++ ) {
// if the character at 'i' is a '*', check to see if the characters around it are the same.
if ( str.charAt(i) == '*' && str.charAt(i-1) != str.charAt(i+1) ) {
// if they aren't the same, return false
return false;
}
}
// else, return true
return true;
// my original code was similar to this. When I ran it, everything worked except for "abcDEF".
// There's no explanation that if there are no '*' that it should be true. That's why this code
// I found only checks if the characters around the start are not the same.
}
public String oneTwo(String str) {
// Given a string, compute a new string by moving the first char to come after the next two chars,
// so "abc" yields "bca". Repeat this process for each subsequent group of 3 chars, so "abcdef"
// yields "bcaefd". Ignore any group of fewer than 3 chars at the end.
//
// oneTwo("abc") → "bca"
// oneTwo("tca") → "cat"
// oneTwo("tcagdo") → "catdog"
String onetwo = "";
int strLenDiv3 = str.length() / 3;
for ( int i = 0; i < strLenDiv3; i++ ){
char one = str.substring(i*3).charAt(0);
char two = str.substring(i*3).charAt(1);
char three = str.substring(i*3).charAt(2);
onetwo = onetwo + two + three + one;
}
return onetwo;
}
public String zipZap(String str) {
// Look for patterns like "zip" and "zap" in the string -- length-3, starting with 'z' and ending
// with 'p'. Return a string where for all such words, the middle letter is gone, so "zipXzap"
// yields "zpXzp".
//
// zipZap("zipXzap") → "zpXzp"
// zipZap("zopzop") → "zpzp"
// zipZap("zzzopzop") → "zzzpzp"
String zipzap = "";
if ( str.length() < 3 ) return str;
if ( str.length() == 3 && str.charAt(0) == 'z' && str.charAt(2) == 'p') return "zp";
if ( str.length() == 3 ) return str;
for ( int i = 0; i < str.length() - 2; i++ ){
char one = str.substring(i).charAt(0);
char three = str.substring(i).charAt(2);
if ( one == 'z' && three == 'p' ){
zipzap = zipzap + one + three;
i = i + 2;
}
else if ( i == str.length() - 3 && ( one != 'z' || three != 'p') ){
zipzap = zipzap + str.substring(i);
}
else zipzap = zipzap + str.charAt(i);
}
return zipzap;
}
public String starOut(String str) {
// Return a version of the given string, where for every star (*) in the string the star and
// the chars immediately to its left and right are gone. So "ab*cd" yields "ad" and "ab**cd"
// also yields "ad".
//
// starOut("ab*cd") → "ad"
// starOut("ab**cd") → "ad"
// starOut("sm*eilly") → "silly"
int length = str.length();
String starout = "";
for (int i = 0; i < length; i++) {
if (i == 0 && str.charAt(i) != '*') starout += str.charAt(i);
if (i > 0 && str.charAt(i) != '*' && str.charAt(i-1) != '*') starout += str.charAt(i);
if (i > 0 && str.charAt(i) == '*' && str.charAt(i-1) != '*') starout = starout.substring(0,starout.length()-1);
}
return starout;
}
public String plusOut(String str, String word) {
// Given a string and a non-empty word string, return a version of the original String where
// all chars have been replaced by pluses ("+"), except for appearances of the word string
// which are preserved unchanged.
//
// plusOut("12xy34", "xy") → "++xy++"
// plusOut("12xy34", "1") → "1+++++"
// plusOut("12xy34xyabcxy", "xy") → "++xy++xy+++xy"
String plusout = "";
int strLen = str.length();
int wordLen = word.length();
for ( int i = 0; i < strLen; i++ ){
String subStr = str.substring(i);
int indexOfWord = subStr.indexOf(word);
if ( indexOfWord == 0 ){
plusout += subStr.substring(0, wordLen );
i += wordLen - 1;
}
else plusout += '+';
}
return plusout;
}
public String wordEnds(String str, String word) {
// Given a string and a non-empty word string, return a string made of each char just before and
// just after every appearance of the word in the string. Ignore cases where there is no char
// before or after the word, and a char may be included twice if it is between two words.
//
// wordEnds("abcXY123XYijk", "XY") → "c13i"
// wordEnds("XY123XY", "XY") → "13"
// wordEnds("XY1XY", "XY") → "11"
String wordends = "";
int wordLen = word.length();
if ( str.indexOf(word) < 0 ) return wordends;
if ( str.equals(word) ) return wordends;
for ( int i = 0; i <= str.length(); i++ ) {
String subStr = str.substring(i);
int subLen = subStr.length();
int indexOfWord = subStr.indexOf(word);
if ( i > 0 && indexOfWord == 0 ) wordends += str.charAt(i -1);
if ( i + wordLen < str.length() && indexOfWord == 0 ) wordends += str.charAt(i + wordLen);
}
return wordends;
}
}
| 7,751 | 0.60725 | 0.591919 | 222 | 32.662163 | 29.114689 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.400901 | false | false | 0 |
b55b6b5406467eba5b8a5bc5ce1ac2d362984991 | 1,778,116,507,072 | cad4587c008cf759e5f62dd5348a4c2e1914a60c | /chart6/oauth2/auth-server/src/main/java/com/laowan/oauth2/auth/mapper/AuthRoleMapper.java | a527de75a074c6c5278a2d452f45288d4f94ecec | [] | no_license | StarlightWANLI/oauth2 | https://github.com/StarlightWANLI/oauth2 | 6437646e1d3daa79f0d2ede43924f1a8399f9c19 | ebac6a60c09a4a7130dd4fd8d08b04c458cfdc87 | refs/heads/master | 2023-08-19T09:16:13.895000 | 2019-08-04T16:31:00 | 2019-08-04T16:31:00 | 188,530,843 | 1 | 1 | null | false | 2023-07-22T06:40:25 | 2019-05-25T06:45:24 | 2021-11-18T01:45:27 | 2023-07-22T06:40:24 | 110 | 2 | 1 | 8 | Java | false | false | package com.laowan.oauth2.auth.mapper;
import com.laowan.oauth2.auth.model.AuthRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AuthRoleMapper{
List<AuthRole> selectByUserId(@Param("userId") Long id);
} | UTF-8 | Java | 251 | java | AuthRoleMapper.java | Java | [] | null | [] | package com.laowan.oauth2.auth.mapper;
import com.laowan.oauth2.auth.model.AuthRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface AuthRoleMapper{
List<AuthRole> selectByUserId(@Param("userId") Long id);
} | 251 | 0.784861 | 0.776892 | 11 | 21.90909 | 21.631016 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.454545 | false | false | 0 |
50f9b2693eb55ccc7b7f8accb0d71314d325af00 | 21,174,188,808,385 | 0c8ab029ab5d087920a0f17fe1139f0f440008fb | /src/ro/mirodone/DisariumFindM2.java | 238daad4e52bcd033e67db0ae118aab47991970d | [] | no_license | apartment81/CodingExercisesDay076 | https://github.com/apartment81/CodingExercisesDay076 | 7bc348472ddaa5849de882b812a44b9aa7e7b66c | a973dd52bfe128240db87f922f6c77807ebcecf8 | refs/heads/master | 2020-07-18T03:57:57.407000 | 2019-09-03T23:07:26 | 2019-09-03T23:07:26 | 206,170,550 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package ro.mirodone;
public class DisariumFindM2 {
public void disariumNumber(int number) {
int sum = 0;
char[] arr = String.valueOf(number).toCharArray();
for (int i = 0; i < arr.length; i++)
sum += Math.pow(arr[i] - '0', i + 1);
if (sum == number) {
System.out.println(sum);
}
}
}
| UTF-8 | Java | 362 | java | DisariumFindM2.java | Java | [] | null | [] | package ro.mirodone;
public class DisariumFindM2 {
public void disariumNumber(int number) {
int sum = 0;
char[] arr = String.valueOf(number).toCharArray();
for (int i = 0; i < arr.length; i++)
sum += Math.pow(arr[i] - '0', i + 1);
if (sum == number) {
System.out.println(sum);
}
}
}
| 362 | 0.51105 | 0.497238 | 19 | 18.052631 | 19.564936 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.421053 | false | false | 0 |
32e2dd17d27fa27f08e978b4dc15f165a10f0c39 | 33,492,155,003,756 | f5d9f9f314017528a28264635262b56300493c7a | /Implementation/irsa-data/domain-model/src/main/java/com/irsatools/entities/global/OriginalText.java | 36ded3baeb3555058bc5e30e1d9f2dd560fdf7c6 | [] | no_license | JNikolas/IRSA-Tools | https://github.com/JNikolas/IRSA-Tools | c493a28ad0a62af1f2f524d657267fd4f8167331 | 798338be8992919d97d47dcb618392281ab480b2 | refs/heads/master | 2015-08-06T08:41:04.796000 | 2012-09-14T08:47:57 | 2012-09-14T08:47:57 | 3,484,093 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* File: OriginalText
* Author: Nikolay Semenov <ns.semenov@gmail.com>
* Date: 24.02.12
*/
package com.irsatools.entities.global;
import com.irsatools.entities.global.base.UUIDBase;
import javax.persistence.Entity;
import javax.persistence.Lob;
/**
* Store the original text data in <b>XML format</b>
* <br/>
* Important: should be XML valid
*/
@Entity
public class OriginalText extends UUIDBase {
private String data;
@Lob
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
| UTF-8 | Java | 579 | java | OriginalText.java | Java | [
{
"context": "/**\n * File: OriginalText\n * Author: Nikolay Semenov <ns.semenov@gmail.com>\n * Date: 24.02.12\n */\npack",
"end": 52,
"score": 0.9998864531517029,
"start": 37,
"tag": "NAME",
"value": "Nikolay Semenov"
},
{
"context": " * File: OriginalText\n * Author: Nikolay Semeno... | null | [] | /**
* File: OriginalText
* Author: <NAME> <<EMAIL>>
* Date: 24.02.12
*/
package com.irsatools.entities.global;
import com.irsatools.entities.global.base.UUIDBase;
import javax.persistence.Entity;
import javax.persistence.Lob;
/**
* Store the original text data in <b>XML format</b>
* <br/>
* Important: should be XML valid
*/
@Entity
public class OriginalText extends UUIDBase {
private String data;
@Lob
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
| 557 | 0.671848 | 0.661485 | 31 | 17.67742 | 17.257793 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.225806 | false | false | 9 |
48a8bab61f8ec15dadf58517df30a58296bff3be | 26,560,077,761,813 | 74b3a931c200e3e20eb65766c7fb3ee937b40422 | /app/src/main/java/com/example/mehrbod/downloadmanager/Adapter/DownloadsAdapter.java | 8a00cffdde40b9cd9602804ed28b4b54611f0761 | [] | no_license | mehrbodkh/DownloadManager | https://github.com/mehrbodkh/DownloadManager | ab67ec69a41189ba6b7418df1cffa3500d6ee37b | d1c803397d5a9d7f12f0393a5f84936e1910e755 | refs/heads/master | 2021-01-01T15:49:14.372000 | 2017-07-25T07:01:27 | 2017-07-25T07:01:27 | 97,710,760 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.mehrbod.downloadmanager.Adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.example.mehrbod.downloadmanager.Model.Download;
import com.example.mehrbod.downloadmanager.R;
import java.util.List;
/**
* Created by mehrbod on 7/22/17.
*/
public class DownloadsAdapter extends RecyclerView.Adapter<DownloadsAdapter.MyViewHolder> {
private Context mContext;
private List<Download> downloadList;
public class MyViewHolder extends RecyclerView.ViewHolder {
public TextView name;
public ProgressBar progressBar;
public MyViewHolder(View itemView) {
super(itemView);
name = (TextView) itemView.findViewById(R.id.cardViewNameTextView);
progressBar = (ProgressBar) itemView.findViewById(R.id.cardViewProgressBar);
}
}
public DownloadsAdapter(Context context, List<Download> downloadList) {
this.mContext = context;
this.downloadList = downloadList;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.download_card, parent, false);
return new MyViewHolder(itemView);
}
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
Download download = downloadList.get(position);
holder.name.setText(download.getName());
holder.progressBar.setProgress(download.getProgressBar().getProgress());
}
@Override
public int getItemCount() {
return downloadList.size();
}
}
| UTF-8 | Java | 1,825 | java | DownloadsAdapter.java | Java | [
{
"context": "ager.R;\n\nimport java.util.List;\n\n/**\n * Created by mehrbod on 7/22/17.\n */\n\npublic class DownloadsAdapter ex",
"end": 449,
"score": 0.9995229244232178,
"start": 442,
"tag": "USERNAME",
"value": "mehrbod"
}
] | null | [] | package com.example.mehrbod.downloadmanager.Adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.example.mehrbod.downloadmanager.Model.Download;
import com.example.mehrbod.downloadmanager.R;
import java.util.List;
/**
* Created by mehrbod on 7/22/17.
*/
public class DownloadsAdapter extends RecyclerView.Adapter<DownloadsAdapter.MyViewHolder> {
private Context mContext;
private List<Download> downloadList;
public class MyViewHolder extends RecyclerView.ViewHolder {
public TextView name;
public ProgressBar progressBar;
public MyViewHolder(View itemView) {
super(itemView);
name = (TextView) itemView.findViewById(R.id.cardViewNameTextView);
progressBar = (ProgressBar) itemView.findViewById(R.id.cardViewProgressBar);
}
}
public DownloadsAdapter(Context context, List<Download> downloadList) {
this.mContext = context;
this.downloadList = downloadList;
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext())
.inflate(R.layout.download_card, parent, false);
return new MyViewHolder(itemView);
}
@Override
public void onBindViewHolder(MyViewHolder holder, int position) {
Download download = downloadList.get(position);
holder.name.setText(download.getName());
holder.progressBar.setProgress(download.getProgressBar().getProgress());
}
@Override
public int getItemCount() {
return downloadList.size();
}
}
| 1,825 | 0.716712 | 0.713425 | 61 | 28.918034 | 26.804266 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.508197 | false | false | 9 |
d1843e90f72f6cf542a59253fc20c7e525f6dcc2 | 22,797,686,431,408 | 4b354daa8f6f9a2f5fe437a0f6f00cd352b13679 | /src/main/java/no/uka/findmyapp/configuration/SearchConfiguration.java | ae4ab8a233d53c336f52b029b30ce5c304093c07 | [] | no_license | findmyapp/findmyapp | https://github.com/findmyapp/findmyapp | 099511045f74f6745ac6a552ee99cbcb9899453b | 9fb71f4b3b28cab284f103edda2eb2dd3b33d12e | refs/heads/master | 2016-09-05T19:51:11.210000 | 2011-10-12T18:54:14 | 2011-10-12T18:54:14 | 1,875,329 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package no.uka.findmyapp.configuration;
/**
* Used to hold properties. Populated as bean in root-context.xml
*
* @author kare.blakstad
*
*/
public class SearchConfiguration {
/**
* Default values
*/
int minLength = 1;
int depth = 1;
public int getMinLength() {
return minLength;
}
public void setMinLength(int minLength) {
this.minLength = minLength;
}
public int getDepth() {
return depth;
}
public void setDepth(int depth) {
this.depth = depth;
}
}
| UTF-8 | Java | 487 | java | SearchConfiguration.java | Java | [
{
"context": "pulated as bean in root-context.xml\n * \n * @author kare.blakstad\n *\n */\npublic class SearchConfiguration {\n\n\t/**\n\t",
"end": 139,
"score": 0.9827877879142761,
"start": 126,
"tag": "NAME",
"value": "kare.blakstad"
}
] | null | [] | package no.uka.findmyapp.configuration;
/**
* Used to hold properties. Populated as bean in root-context.xml
*
* @author kare.blakstad
*
*/
public class SearchConfiguration {
/**
* Default values
*/
int minLength = 1;
int depth = 1;
public int getMinLength() {
return minLength;
}
public void setMinLength(int minLength) {
this.minLength = minLength;
}
public int getDepth() {
return depth;
}
public void setDepth(int depth) {
this.depth = depth;
}
}
| 487 | 0.673511 | 0.669405 | 33 | 13.757576 | 15.926023 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.848485 | false | false | 9 |
2af3d5f870bca536239f8136b441493fa3958418 | 22,797,686,428,279 | 4c4ab2384d53d36e6d17aa1ef0a2efb67c967119 | /app/src/main/java/com/lezhi/wshi/module/ui/view/NewsChannelView.java | 7fc6a42f5144035b75bcc94166753252642dcf68 | [] | no_license | ebnrdwan/MVP-Retrofit | https://github.com/ebnrdwan/MVP-Retrofit | b6385263ad6b9442baddc004aa3fc39385beea50 | 678674180ee853fa698621b38336e8180107912f | refs/heads/master | 2021-04-03T09:43:38.553000 | 2018-03-07T02:56:46 | 2018-03-07T02:56:46 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lezhi.wshi.module.ui.view;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import com.lezhi.wshi.R;
import com.lezhi.wshi.api.modle.BaseResult;
import com.lezhi.wshi.module.base.RootView;
import com.lezhi.wshi.module.persenter.contract.NewsChannelContract;
import com.lezhi.wshi.module.ui.activitys.NewsChannelActivity;
import com.lezhi.wshi.module.ui.adapter.RecycleItemClickListener;
import com.lezhi.wshi.module.ui.adapter.channerl.ChannelAdapter;
import com.lezhi.wshi.module.ui.adapter.channerl.ChannelHotAdapter;
import com.lezhi.wshi.module.ui.adapter.channerl.ChannelMoreAdapter;
import com.lezhi.wshi.utils.EventUtil;
import com.lezhi.wshi.utils.JumpUtil;
import com.lezhi.wshi.utils.Preconditions;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
/**
* Created by ${二星} on 2017/4/26 0026.
* 频道管理
* 删除/增加
* 3个rv公用一个adapter 创建了3次 如何删除点击的时候 更新不同的adapter
*/
public class NewsChannelView extends RootView<NewsChannelContract.Presenter> implements NewsChannelContract.View {
@BindView(R.id.indicator_back)
TextView indicatorBack;
@BindView(R.id.indicator_title)
TextView indicatorTitle;
@BindView(R.id.indicator_ok)
TextView indicatorOk;
@BindView(R.id.news_channel_mine_rv)
RecyclerView newsChannelMineRv;
@BindView(R.id.news_channel_more_rv)
RecyclerView newsChannelMoreRv;
@BindView(R.id.news_channel_hot_rv)
RecyclerView newsChannelHotRv;
ChannelAdapter channelAdapterMine;
ChannelMoreAdapter channelAdapterMore;
ChannelHotAdapter channelAdapterHot;
public NewsChannelView(Context context) {
super(context);
}
public NewsChannelView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void getLayout() {
inflate(mContext, R.layout.activity_news_channel_view, this);
}
@Override
protected void initView() {
indicatorTitle.setText("搜索");
List<String> list = new ArrayList<>();
list.add("热门");
list.add("新高考改革");
list.add("新高考改革");
list.add("新高考改革");
list.add("新高考改革");
list.add("新高考改革");
List<String> More_list = new ArrayList<>();
More_list.add("语文");
More_list.add("数学");
More_list.add("政治");
More_list.add("英语");
More_list.add("物理");
More_list.add("化学");
More_list.add("生物");
More_list.add("历史");
More_list.add("综合");
List<String> Hot_list = new ArrayList<>();
Hot_list.add("教学政策");
Hot_list.add("教学理论");
// 我的频道
channelAdapterMine = new ChannelAdapter(mContext, list);
newsChannelMineRv.setLayoutManager(new GridLayoutManager(mContext, 3));
newsChannelMineRv.setAdapter(channelAdapterMine);
// 学科
channelAdapterMore = new ChannelMoreAdapter(mContext, More_list);
newsChannelMoreRv.setLayoutManager(new GridLayoutManager(mContext, 3));
newsChannelMoreRv.setAdapter(channelAdapterMore);
// 热门
channelAdapterHot = new ChannelHotAdapter(mContext, Hot_list);
newsChannelHotRv.setLayoutManager(new GridLayoutManager(mContext, 3));
newsChannelHotRv.setAdapter(channelAdapterHot);
channelAdapterMine.setPingCallBack(new ChannelAdapter.PingCallBack() {
@Override
public void ClickBack(int position) {
EventUtil.showToast(mContext," A "+position);
}
});
channelAdapterMore.setPingCallBack(new ChannelMoreAdapter.PingCallBack() {
@Override
public void ClickBack(int position) {
EventUtil.showToast(mContext," B "+position);
}
});
channelAdapterHot.setPingCallBack(new ChannelHotAdapter.PingCallBack() {
@Override
public void ClickBack(int position) {
EventUtil.showToast(mContext," C "+position);
}
});
}
@Override
protected void initEvent() {
}
@Override
public void setPresenter(NewsChannelContract.Presenter presenter) {
mPresenter = Preconditions.checkNotNull(presenter);
}
@Override
public void showError(String msg) {
EventUtil.showToast(mContext, msg);
}
@Override
public boolean isActive() {
return mActive;
}
@Override
public void showContent(BaseResult videoRes) {
}
@Override
public void refreshFaild(String msg) {
}
@OnClick({R.id.indicator_back, R.id.indicator_ok})
public void onClick(View view) {
switch (view.getId()) {
// 返回上次界面
case R.id.indicator_back:
if (mContext instanceof NewsChannelActivity)
// 设置override , 不然会使动画失效
JumpUtil.overiderAnimsition((NewsChannelActivity) mContext);
break;
case R.id.indicator_ok:
break;
}
}
}
| UTF-8 | Java | 5,420 | java | NewsChannelView.java | Java | [] | null | [] | package com.lezhi.wshi.module.ui.view;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;
import com.lezhi.wshi.R;
import com.lezhi.wshi.api.modle.BaseResult;
import com.lezhi.wshi.module.base.RootView;
import com.lezhi.wshi.module.persenter.contract.NewsChannelContract;
import com.lezhi.wshi.module.ui.activitys.NewsChannelActivity;
import com.lezhi.wshi.module.ui.adapter.RecycleItemClickListener;
import com.lezhi.wshi.module.ui.adapter.channerl.ChannelAdapter;
import com.lezhi.wshi.module.ui.adapter.channerl.ChannelHotAdapter;
import com.lezhi.wshi.module.ui.adapter.channerl.ChannelMoreAdapter;
import com.lezhi.wshi.utils.EventUtil;
import com.lezhi.wshi.utils.JumpUtil;
import com.lezhi.wshi.utils.Preconditions;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
/**
* Created by ${二星} on 2017/4/26 0026.
* 频道管理
* 删除/增加
* 3个rv公用一个adapter 创建了3次 如何删除点击的时候 更新不同的adapter
*/
public class NewsChannelView extends RootView<NewsChannelContract.Presenter> implements NewsChannelContract.View {
@BindView(R.id.indicator_back)
TextView indicatorBack;
@BindView(R.id.indicator_title)
TextView indicatorTitle;
@BindView(R.id.indicator_ok)
TextView indicatorOk;
@BindView(R.id.news_channel_mine_rv)
RecyclerView newsChannelMineRv;
@BindView(R.id.news_channel_more_rv)
RecyclerView newsChannelMoreRv;
@BindView(R.id.news_channel_hot_rv)
RecyclerView newsChannelHotRv;
ChannelAdapter channelAdapterMine;
ChannelMoreAdapter channelAdapterMore;
ChannelHotAdapter channelAdapterHot;
public NewsChannelView(Context context) {
super(context);
}
public NewsChannelView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void getLayout() {
inflate(mContext, R.layout.activity_news_channel_view, this);
}
@Override
protected void initView() {
indicatorTitle.setText("搜索");
List<String> list = new ArrayList<>();
list.add("热门");
list.add("新高考改革");
list.add("新高考改革");
list.add("新高考改革");
list.add("新高考改革");
list.add("新高考改革");
List<String> More_list = new ArrayList<>();
More_list.add("语文");
More_list.add("数学");
More_list.add("政治");
More_list.add("英语");
More_list.add("物理");
More_list.add("化学");
More_list.add("生物");
More_list.add("历史");
More_list.add("综合");
List<String> Hot_list = new ArrayList<>();
Hot_list.add("教学政策");
Hot_list.add("教学理论");
// 我的频道
channelAdapterMine = new ChannelAdapter(mContext, list);
newsChannelMineRv.setLayoutManager(new GridLayoutManager(mContext, 3));
newsChannelMineRv.setAdapter(channelAdapterMine);
// 学科
channelAdapterMore = new ChannelMoreAdapter(mContext, More_list);
newsChannelMoreRv.setLayoutManager(new GridLayoutManager(mContext, 3));
newsChannelMoreRv.setAdapter(channelAdapterMore);
// 热门
channelAdapterHot = new ChannelHotAdapter(mContext, Hot_list);
newsChannelHotRv.setLayoutManager(new GridLayoutManager(mContext, 3));
newsChannelHotRv.setAdapter(channelAdapterHot);
channelAdapterMine.setPingCallBack(new ChannelAdapter.PingCallBack() {
@Override
public void ClickBack(int position) {
EventUtil.showToast(mContext," A "+position);
}
});
channelAdapterMore.setPingCallBack(new ChannelMoreAdapter.PingCallBack() {
@Override
public void ClickBack(int position) {
EventUtil.showToast(mContext," B "+position);
}
});
channelAdapterHot.setPingCallBack(new ChannelHotAdapter.PingCallBack() {
@Override
public void ClickBack(int position) {
EventUtil.showToast(mContext," C "+position);
}
});
}
@Override
protected void initEvent() {
}
@Override
public void setPresenter(NewsChannelContract.Presenter presenter) {
mPresenter = Preconditions.checkNotNull(presenter);
}
@Override
public void showError(String msg) {
EventUtil.showToast(mContext, msg);
}
@Override
public boolean isActive() {
return mActive;
}
@Override
public void showContent(BaseResult videoRes) {
}
@Override
public void refreshFaild(String msg) {
}
@OnClick({R.id.indicator_back, R.id.indicator_ok})
public void onClick(View view) {
switch (view.getId()) {
// 返回上次界面
case R.id.indicator_back:
if (mContext instanceof NewsChannelActivity)
// 设置override , 不然会使动画失效
JumpUtil.overiderAnimsition((NewsChannelActivity) mContext);
break;
case R.id.indicator_ok:
break;
}
}
}
| 5,420 | 0.660893 | 0.657429 | 171 | 29.385965 | 23.565577 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.54386 | false | false | 9 |
2a1362f9f008b4bd068e217212beefddb0b4e15a | 1,065,151,916,694 | 0242be49dc361cdb6ce056c6bb498ce0ade4d627 | /src/main/java/com/mytaxi/security/JWTAuthenticationFilter.java | 3f96ec3bde7e8f7f6607582a674e3b371244d941 | [] | no_license | GursheenUbeja/mytaxi | https://github.com/GursheenUbeja/mytaxi | 814e7c0b01699be6262b5eeb6ba7f2fe3045af2b | 382c8f9964a419445fb452399d423ea0fd34a1d6 | refs/heads/master | 2020-03-27T07:01:29.083000 | 2018-09-02T15:57:47 | 2018-09-02T15:57:47 | 146,156,895 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.mytaxi.security;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.token.TokenService;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.GenericFilterBean;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.Principal;
@Component
public class JWTAuthenticationFilter extends GenericFilterBean {
boolean swag = true;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
throws IOException, ServletException {
if (request instanceof ServletRequest) {
HttpServletRequest http = (HttpServletRequest) request;
if (swag) {
Principal userPrincipal = http.getUserPrincipal();
System.out.println(userPrincipal.getName());
TokenAuthenticationService.addAuthentication((HttpServletResponse) response,
userPrincipal.getName().toString());
swag = false;
}
}
if (true) {
Authentication authentication = TokenAuthenticationService.getAuthentication((HttpServletRequest) request);
SecurityContextHolder.getContext().setAuthentication(authentication);
filterChain.doFilter(request, response);
}
}
}
| UTF-8 | Java | 1,856 | java | JWTAuthenticationFilter.java | Java | [] | null | [] | package com.mytaxi.security;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.token.TokenService;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.GenericFilterBean;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.Authentication;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.Principal;
@Component
public class JWTAuthenticationFilter extends GenericFilterBean {
boolean swag = true;
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
throws IOException, ServletException {
if (request instanceof ServletRequest) {
HttpServletRequest http = (HttpServletRequest) request;
if (swag) {
Principal userPrincipal = http.getUserPrincipal();
System.out.println(userPrincipal.getName());
TokenAuthenticationService.addAuthentication((HttpServletResponse) response,
userPrincipal.getName().toString());
swag = false;
}
}
if (true) {
Authentication authentication = TokenAuthenticationService.getAuthentication((HttpServletRequest) request);
SecurityContextHolder.getContext().setAuthentication(authentication);
filterChain.doFilter(request, response);
}
}
}
| 1,856 | 0.820043 | 0.820043 | 58 | 31 | 29.603704 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.551724 | false | false | 9 |
b5c890ae86a52e7e34c5518dcc657e4f4c92556e | 20,143,396,654,620 | 6d9e76af900661df904a752376f51fa7a38c426e | /03-01B-java-DwarfsandDwarves/src/Main.java | 824fe97a7585f2d35c090e3a1598b64245d6a9fd | [] | no_license | Neil23/Neueda-SpringBoot | https://github.com/Neil23/Neueda-SpringBoot | 3c14a1bc18a548d114a40b056c0490e50a846fcc | 350a746a4cbd75689f62f3cf40eca62a4b77df56 | refs/heads/master | 2021-08-31T06:37:15.963000 | 2017-12-20T15:33:54 | 2017-12-20T15:33:54 | 112,199,397 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<Dwarf> dwarf = new ArrayList<Dwarf>();
Dwarf sleepy= new Dwarf ();
sleepy.setName("Sleepy");
sleepy.setAuthor("Disney");
sleepy.setName("Sleepy.png");
Dwarf happy= new Dwarf ();
happy.setName("Happy");
happy.setAuthor("Disney");
happy.setName("Happy.png");
Dwarf grumpy= new Dwarf ();
grumpy.setName("Grumpy");
grumpy.setAuthor("Disney");
grumpy.setName("Grumpy.png");
dwarf.add(sleepy);
dwarf.add(happy);
dwarf.add(grumpy);
}
}
| UTF-8 | Java | 617 | java | Main.java | Java | [
{
"context": "\t\r\n\tsleepy.setName(\"Sleepy\");\r\n\tsleepy.setAuthor(\"Disney\");\r\n\tsleepy.setName(\"Sleepy.png\");\r\n\t\r\nDwarf happ",
"end": 244,
"score": 0.999768853187561,
"start": 238,
"tag": "NAME",
"value": "Disney"
},
{
"context": ";\r\n\t\r\n\thappy.setName(\"Happy\"... | null | [] | import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<Dwarf> dwarf = new ArrayList<Dwarf>();
Dwarf sleepy= new Dwarf ();
sleepy.setName("Sleepy");
sleepy.setAuthor("Disney");
sleepy.setName("Sleepy.png");
Dwarf happy= new Dwarf ();
happy.setName("Happy");
happy.setAuthor("Disney");
happy.setName("Happy.png");
Dwarf grumpy= new Dwarf ();
grumpy.setName("Grumpy");
grumpy.setAuthor("Disney");
grumpy.setName("Grumpy.png");
dwarf.add(sleepy);
dwarf.add(happy);
dwarf.add(grumpy);
}
}
| 617 | 0.619125 | 0.619125 | 39 | 13.820513 | 14.219654 | 50 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.25641 | false | false | 9 |
671fa5d851eb6fd140e405a7cfc266b9d6a146c0 | 2,662,879,728,603 | 0d30be34fc1b2812342e312c9e13a864710da85f | /app/src/main/java/com/shen/client/adapter/StudentAdapter.java | abcd4177d4ffd5c7e0d213fcf32bd27df6e0157e | [] | no_license | haihuishen/MyTestClient_Server | https://github.com/haihuishen/MyTestClient_Server | cd86f830ab744d79fd936f91c1a84a6f5912cff3 | 3aceba2e023f2926552885889b7b50048f499bf5 | refs/heads/master | 2021-01-12T08:27:10.767000 | 2016-12-15T18:22:31 | 2016-12-15T18:22:31 | 76,584,656 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.shen.client.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.shen.client.R;
import com.shen.client.entity.Student;
import java.util.List;
public class StudentAdapter extends ArrayAdapter<Student>{
private LayoutInflater mInflater;
private int mResource;
/**
*
* @param context 上下文
* @param resource student_item(item布局)
* @param objects List<Student>
*/
public StudentAdapter(Context context, int resource, List<Student> objects) {
super(context, resource, objects);
this.mInflater = LayoutInflater.from(context);
this.mResource = resource;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LinearLayout view = null;
if(convertView == null) {
view = (LinearLayout)mInflater.inflate(mResource, null); // 布局填充成View
} else {
view = (LinearLayout)convertView;
}
// 获得数据绑定到一个Item上的对象
Student student = getItem(position); // 在构造函数中,super(context, resource, objects);已经赋值了
/**
* 获得Item中的TextView控件
*/
TextView txtId = (TextView)view.findViewById(R.id.txt_id);
TextView txtName = (TextView)view.findViewById(R.id.txt_name);
TextView txtAge = (TextView)view.findViewById(R.id.txt_age);
/**
* 设置值
*/
txtId.setText(student.getId().toString());
txtName.setText(student.getName());
txtAge.setText(String.valueOf(student.getAge()));
return view;
}
}
| UTF-8 | Java | 1,683 | java | StudentAdapter.java | Java | [] | null | [] | package com.shen.client.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.shen.client.R;
import com.shen.client.entity.Student;
import java.util.List;
public class StudentAdapter extends ArrayAdapter<Student>{
private LayoutInflater mInflater;
private int mResource;
/**
*
* @param context 上下文
* @param resource student_item(item布局)
* @param objects List<Student>
*/
public StudentAdapter(Context context, int resource, List<Student> objects) {
super(context, resource, objects);
this.mInflater = LayoutInflater.from(context);
this.mResource = resource;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LinearLayout view = null;
if(convertView == null) {
view = (LinearLayout)mInflater.inflate(mResource, null); // 布局填充成View
} else {
view = (LinearLayout)convertView;
}
// 获得数据绑定到一个Item上的对象
Student student = getItem(position); // 在构造函数中,super(context, resource, objects);已经赋值了
/**
* 获得Item中的TextView控件
*/
TextView txtId = (TextView)view.findViewById(R.id.txt_id);
TextView txtName = (TextView)view.findViewById(R.id.txt_name);
TextView txtAge = (TextView)view.findViewById(R.id.txt_age);
/**
* 设置值
*/
txtId.setText(student.getId().toString());
txtName.setText(student.getName());
txtAge.setText(String.valueOf(student.getAge()));
return view;
}
}
| 1,683 | 0.72163 | 0.72163 | 66 | 23.166666 | 23.191288 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.727273 | false | false | 9 |
2bc2bffd53bd43b7932a3c588d87a91666f53877 | 12,893,491,880,757 | 0f26b54a304edded0a160d84da2a83673a4658f6 | /src/Camera/Camera.java | 1548470ecc1a143ad7e6c7457fd0a5f70b1a5b3c | [] | no_license | Tomkowski/Malponoga | https://github.com/Tomkowski/Malponoga | 049ec3374897720964d6fd6bade33d762d73f346 | 4851acf20602001cc6b294b12dbdb4cf08612f2b | refs/heads/master | 2021-09-17T04:45:08.859000 | 2018-06-28T00:10:59 | 2018-06-28T00:10:59 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package Camera;
import Entities.GameObject;
import Entities.Player;
import Entities.StaticFields;
import org.newdawn.slick.Game;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
public class Camera {
public int offsetMaxX;
public int offsetMaxY;
public int offsetMinX;
public int offsetMinY;
public float camX;
public float camY;
private GameObject gameObject;
public Camera() {
//Setting offset max's and minimums
offsetMaxX = 0;
offsetMaxY = 0;
offsetMinX = 0;
offsetMinY = 0;
}
public void focusOnEntity(GameObject gameObject){
this.gameObject = gameObject;
}
public void focusOnPoint(float x, float y) throws SlickException {
this.gameObject = new Player(x,y,"middle", null,true);
}
public GameObject getFocusObject(){
return gameObject;
}
public void update(GameContainer gc) {
camX = (int)gameObject.getX() - (gc.getWidth() / (StaticFields.cameraZoom * 2)); // scale * 2
if(camX < 0) camX = 0;
if(camX > gc.getWidth() * ( (1 - ( 1.0f / StaticFields.cameraZoom)))) camX = gc.getWidth() * ( (1 - ( 1.0f / StaticFields.cameraZoom))); //weird formula I came up with to solve this problem
camY = (int)gameObject.getY() - (gc.getHeight() / (StaticFields.cameraZoom * 2));
if(camY < 0) camY = 0;
if(camY > gc.getHeight() * ( (1 - ( 1.0f / StaticFields.cameraZoom)))) camY = gc.getHeight() * ( (1 - ( 1.0f / StaticFields.cameraZoom))); //weird formula I came up with to solve this problem
}
} | UTF-8 | Java | 1,634 | java | Camera.java | Java | [] | null | [] | package Camera;
import Entities.GameObject;
import Entities.Player;
import Entities.StaticFields;
import org.newdawn.slick.Game;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
public class Camera {
public int offsetMaxX;
public int offsetMaxY;
public int offsetMinX;
public int offsetMinY;
public float camX;
public float camY;
private GameObject gameObject;
public Camera() {
//Setting offset max's and minimums
offsetMaxX = 0;
offsetMaxY = 0;
offsetMinX = 0;
offsetMinY = 0;
}
public void focusOnEntity(GameObject gameObject){
this.gameObject = gameObject;
}
public void focusOnPoint(float x, float y) throws SlickException {
this.gameObject = new Player(x,y,"middle", null,true);
}
public GameObject getFocusObject(){
return gameObject;
}
public void update(GameContainer gc) {
camX = (int)gameObject.getX() - (gc.getWidth() / (StaticFields.cameraZoom * 2)); // scale * 2
if(camX < 0) camX = 0;
if(camX > gc.getWidth() * ( (1 - ( 1.0f / StaticFields.cameraZoom)))) camX = gc.getWidth() * ( (1 - ( 1.0f / StaticFields.cameraZoom))); //weird formula I came up with to solve this problem
camY = (int)gameObject.getY() - (gc.getHeight() / (StaticFields.cameraZoom * 2));
if(camY < 0) camY = 0;
if(camY > gc.getHeight() * ( (1 - ( 1.0f / StaticFields.cameraZoom)))) camY = gc.getHeight() * ( (1 - ( 1.0f / StaticFields.cameraZoom))); //weird formula I came up with to solve this problem
}
} | 1,634 | 0.633415 | 0.619339 | 63 | 24.952381 | 39.099964 | 204 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.507937 | false | false | 9 |
1de43ea35d1225300fa849bac8cf16c314a11225 | 22,909,355,602,737 | d4b0085432dbb1ffce4352e449cb306e2ef3ef20 | /app/src/main/java/com/fhate/securestorage/ui/base/BaseActivity.java | 407e4fdeee4019008922a2d1bab7b8eaca769730 | [] | no_license | fHate95/DataStorage | https://github.com/fHate95/DataStorage | 615a34d8b809a582b88081c4ac7ef158b7c37d3d | a1f00f795d214563323697742eae299c6bbf7a04 | refs/heads/master | 2020-05-13T17:49:27.659000 | 2019-04-27T13:27:44 | 2019-04-27T13:27:44 | 181,645,797 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.fhate.securestorage.ui.base;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import com.fhate.securestorage.App;
import com.fhate.securestorage.injection.AppComponent;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.disposables.Disposable;
/* Базовый класс активити, провайдит получение компонента приложения */
@SuppressLint("Registered")
public class BaseActivity extends AppCompatActivity {
private List<Disposable> disposables = new ArrayList<>();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
public void addDisposable(Disposable disposable) {
disposables.add(disposable);
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onStop() {
super.onStop();
}
@Override
public void onDestroy() {
super.onDestroy();
/* Отменим все не успевшие выполниться disposables */
if (!disposables.isEmpty()) {
for (Disposable d : disposables) {
if (!d.isDisposed()) {
d.dispose();
}
}
}
}
public static AppComponent getAppComponent(Context context) {
if (context instanceof App) {
return ((App)context).getAppComponent();
} else {
return getAppComponent(context.getApplicationContext());
}
}
}
| UTF-8 | Java | 1,792 | java | BaseActivity.java | Java | [] | null | [] | package com.fhate.securestorage.ui.base;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import com.fhate.securestorage.App;
import com.fhate.securestorage.injection.AppComponent;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.disposables.Disposable;
/* Базовый класс активити, провайдит получение компонента приложения */
@SuppressLint("Registered")
public class BaseActivity extends AppCompatActivity {
private List<Disposable> disposables = new ArrayList<>();
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
public void addDisposable(Disposable disposable) {
disposables.add(disposable);
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onResume() {
super.onResume();
}
@Override
protected void onStop() {
super.onStop();
}
@Override
public void onDestroy() {
super.onDestroy();
/* Отменим все не успевшие выполниться disposables */
if (!disposables.isEmpty()) {
for (Disposable d : disposables) {
if (!d.isDisposed()) {
d.dispose();
}
}
}
}
public static AppComponent getAppComponent(Context context) {
if (context instanceof App) {
return ((App)context).getAppComponent();
} else {
return getAppComponent(context.getApplicationContext());
}
}
}
| 1,792 | 0.652965 | 0.652378 | 67 | 24.41791 | 20.902866 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.328358 | false | false | 9 |
b5eb9ef99bee6f8b44f871e227ec7ab7ac7af267 | 10,264,971,883,896 | 24a70805eb674a61a328e8b655363b0f296d17be | /BeneathTheSurface/src/com/clearlyspam23/game/Weapon.java | cd6325995ebdbe514ca6dfab39e71599d72873ae | [] | no_license | clearlyspam23/LD29 | https://github.com/clearlyspam23/LD29 | a5bb6d508b2e52e3579799c1428233c101e7dd5d | cc1c2298c7483e0e8ace43b03561453410c9b5e9 | refs/heads/master | 2021-01-01T19:51:29.015000 | 2014-04-28T18:26:41 | 2014-04-28T18:26:41 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.clearlyspam23.game;
import java.util.List;
public abstract class Weapon {
private PlayerEntity entity;
private String pickUpText;
public PlayerEntity getEntity() {
return entity;
}
public void setEntity(PlayerEntity p)
{
entity = p;
onPickUp();
}
public abstract void onPickUp();
public abstract void update(float delta);
public abstract List<ProjectileEntity> tryShoot();
public String getPickUpText() {
return pickUpText;
}
public Weapon setPickUpText(String pickUpText) {
this.pickUpText = pickUpText;
return this;
}
}
| UTF-8 | Java | 579 | java | Weapon.java | Java | [
{
"context": "package com.clearlyspam23.game;\n\nimport java.util.List;\n\npublic abstract c",
"end": 24,
"score": 0.6347611546516418,
"start": 19,
"tag": "USERNAME",
"value": "spam2"
}
] | null | [] | package com.clearlyspam23.game;
import java.util.List;
public abstract class Weapon {
private PlayerEntity entity;
private String pickUpText;
public PlayerEntity getEntity() {
return entity;
}
public void setEntity(PlayerEntity p)
{
entity = p;
onPickUp();
}
public abstract void onPickUp();
public abstract void update(float delta);
public abstract List<ProjectileEntity> tryShoot();
public String getPickUpText() {
return pickUpText;
}
public Weapon setPickUpText(String pickUpText) {
this.pickUpText = pickUpText;
return this;
}
}
| 579 | 0.728843 | 0.725389 | 36 | 15.083333 | 16.1441 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.277778 | false | false | 9 |
0a26f58d022dab2660f17772253a37de34a60b40 | 26,860,725,486,513 | 1cadd6b2e6b6cb108559062f63e5df925a184224 | /flobii_v1.1.0/src/co/cc/flobii/ui/server/GreetingServiceImpl.java | b5ecced87a3e71ace3f1ea232564485c26fb3ab6 | [
"Apache-2.0"
] | permissive | flobii-cc/Flobii | https://github.com/flobii-cc/Flobii | f0de41a071062605e02e213f5dd271833df7cead | b902273ef5c8ebe9020f7811469556572ee33ac2 | refs/heads/master | 2021-01-15T18:03:46.584000 | 2011-03-31T07:30:53 | 2011-03-31T07:30:53 | 1,549,662 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package co.cc.flobii.ui.server;
import java.util.ArrayList;
import co.cc.flobii.ui.client.GreetingService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyService;
/**
* The server side implementation of the RPC service.
*/
@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements
GreetingService {
private String register(String username, String pwd){
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(AccountInfo.class);
ObjectifyService.register(LinkInfo.class);
AccountInfo nac = new AccountInfo();
LinkInfo ls = new LinkInfo();
String ret = "null,null";
if(ofy.find(AccountInfo.class,username) == null){
nac.username = username;
nac.password = pwd;
ls.username = username;
ls.linklist = new ArrayList<String>();
ls.linklist.add(0, "");
ls.linklist.add(1, "##http://youtube.com/##http://vimeo.com/##http://soundcloud.com/##http://spectrum.ieee.org/");
ls.foldername = new ArrayList<String>();
ls.foldername.add(0,"");
ls.foldername.add(1,"Favourites");
ls.title = new ArrayList<String>();
ls.title.add(0,"");
ls.title.add(1,"##Youtube##Vimeo##SoundCloud##Spectrum IEEE");
ls.foldercount =ls.linklist.size()-1;
ls.rating = new ArrayList<String>();
ls.rating.add(0,"");
ls.rating.add(1,"##5##5##5##5");
ofy.put(nac);
ofy.put(ls);
ret = "true,You were successfully registered !";
}else{
ret ="false,User already exist !";
}
return ret;
}
@Override
public String registerUser(String username, String password)
throws IllegalArgumentException {
return register(username, password);
}
@Override
public Boolean greetServer() throws IllegalArgumentException {
return true;
}
@Override
public String loginUser(String username, String password) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(AccountInfo.class);
if(ofy.find(AccountInfo.class,username) != null){
if(ofy.find(AccountInfo.class,username).password.equals(password)){
return"true, User logged in!";
}else{
return "false, False password!";
}
}else{
return "false,User doesn't exist !";
}
}
@Override
public String getList(String uid,int index) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
String result ="fail";
if(ofy.find(LinkInfo.class,uid) != null){
if(!ofy.get(LinkInfo.class,uid).linklist.get(index).equals("")){
result = "xxx"+ofy.get(LinkInfo.class,uid).linklist.get(index)+"xxx"+ofy.get(LinkInfo.class,uid).rating.get(index)+"xxx"+ofy.get(LinkInfo.class,uid).title.get(index);
}else{
result= "xxx:xxx:xxx:";
}
}
return result;
}
@Override
public String changeLinklist(String uid, int index, String title,
String url, String rating) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
LinkInfo li =ofy.get(LinkInfo.class,uid);
li.linklist.remove(index);
li.linklist.add(index, url);
li.title.remove(index);
li.title.add(index,title);
li.rating.remove(index);
li.rating.add(index,rating);
ofy.put(li);
if(!ofy.get(LinkInfo.class,uid).linklist.get(index).equals("")){
return "xxx"+ofy.get(LinkInfo.class,uid).linklist.get(index)+"xxx"+ofy.get(LinkInfo.class,uid).rating.get(index)+"xxx"+ofy.get(LinkInfo.class,uid).title.get(index);
}else{
return "xxx:xxx:xxx:";
}
}
@Override
public String[] getFolders(String uid) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
LinkInfo li =ofy.get(LinkInfo.class,uid);
String[] sfolder = new String[li.foldercount+1];
for(int i=0;i<sfolder.length;i++){
sfolder[i] = ofy.get(LinkInfo.class,uid).foldername.get(i);
}
return sfolder;
}
@Override
public String[] createFolder(String uid, String folder) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
LinkInfo li =ofy.get(LinkInfo.class,uid);
li.foldercount = li.foldercount+1;
li.foldername.add(li.foldercount,folder);
li.linklist.add(li.foldercount,"");
li.title.add(li.foldercount,"");
li.rating.add(li.foldercount,"");
li.foldercount = li.foldername.size()-1;
ofy.put(li);
String[] sfolder = new String[li.foldercount+1];
for(int i=0;i<sfolder.length;i++){
sfolder[i] = ofy.get(LinkInfo.class,uid).foldername.get(i);
}
return sfolder;
}
public String[] deleteFolder(String uid,int index){
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
LinkInfo li =ofy.get(LinkInfo.class,uid);
li.foldername.remove(index);
li.title.remove(index);
li.rating.remove(index);
li.linklist.remove(index);
li.foldercount= li.linklist.size()-1;
ofy.put(li);
String[] sfolder = new String[li.foldercount+1];
for(int i=0;i<sfolder.length;i++){
sfolder[i] = ofy.get(LinkInfo.class,uid).foldername.get(i);
}
return sfolder;
}
}
| UTF-8 | Java | 5,441 | java | GreetingServiceImpl.java | Java | [
{
"context": ".class,username) == null){\n \tnac.username = username;\n \tnac.password = pwd;\n ls.user",
"end": 860,
"score": 0.9991796016693115,
"start": 852,
"tag": "USERNAME",
"value": "username"
},
{
"context": " \tnac.username = username;\n \tnac... | null | [] | package co.cc.flobii.ui.server;
import java.util.ArrayList;
import co.cc.flobii.ui.client.GreetingService;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.googlecode.objectify.Objectify;
import com.googlecode.objectify.ObjectifyService;
/**
* The server side implementation of the RPC service.
*/
@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements
GreetingService {
private String register(String username, String pwd){
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(AccountInfo.class);
ObjectifyService.register(LinkInfo.class);
AccountInfo nac = new AccountInfo();
LinkInfo ls = new LinkInfo();
String ret = "null,null";
if(ofy.find(AccountInfo.class,username) == null){
nac.username = username;
nac.password = pwd;
ls.username = username;
ls.linklist = new ArrayList<String>();
ls.linklist.add(0, "");
ls.linklist.add(1, "##http://youtube.com/##http://vimeo.com/##http://soundcloud.com/##http://spectrum.ieee.org/");
ls.foldername = new ArrayList<String>();
ls.foldername.add(0,"");
ls.foldername.add(1,"Favourites");
ls.title = new ArrayList<String>();
ls.title.add(0,"");
ls.title.add(1,"##Youtube##Vimeo##SoundCloud##Spectrum IEEE");
ls.foldercount =ls.linklist.size()-1;
ls.rating = new ArrayList<String>();
ls.rating.add(0,"");
ls.rating.add(1,"##5##5##5##5");
ofy.put(nac);
ofy.put(ls);
ret = "true,You were successfully registered !";
}else{
ret ="false,User already exist !";
}
return ret;
}
@Override
public String registerUser(String username, String password)
throws IllegalArgumentException {
return register(username, password);
}
@Override
public Boolean greetServer() throws IllegalArgumentException {
return true;
}
@Override
public String loginUser(String username, String password) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(AccountInfo.class);
if(ofy.find(AccountInfo.class,username) != null){
if(ofy.find(AccountInfo.class,username).password.equals(password)){
return"true, User logged in!";
}else{
return "false, False password!";
}
}else{
return "false,User doesn't exist !";
}
}
@Override
public String getList(String uid,int index) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
String result ="fail";
if(ofy.find(LinkInfo.class,uid) != null){
if(!ofy.get(LinkInfo.class,uid).linklist.get(index).equals("")){
result = "xxx"+ofy.get(LinkInfo.class,uid).linklist.get(index)+"xxx"+ofy.get(LinkInfo.class,uid).rating.get(index)+"xxx"+ofy.get(LinkInfo.class,uid).title.get(index);
}else{
result= "xxx:xxx:xxx:";
}
}
return result;
}
@Override
public String changeLinklist(String uid, int index, String title,
String url, String rating) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
LinkInfo li =ofy.get(LinkInfo.class,uid);
li.linklist.remove(index);
li.linklist.add(index, url);
li.title.remove(index);
li.title.add(index,title);
li.rating.remove(index);
li.rating.add(index,rating);
ofy.put(li);
if(!ofy.get(LinkInfo.class,uid).linklist.get(index).equals("")){
return "xxx"+ofy.get(LinkInfo.class,uid).linklist.get(index)+"xxx"+ofy.get(LinkInfo.class,uid).rating.get(index)+"xxx"+ofy.get(LinkInfo.class,uid).title.get(index);
}else{
return "xxx:xxx:xxx:";
}
}
@Override
public String[] getFolders(String uid) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
LinkInfo li =ofy.get(LinkInfo.class,uid);
String[] sfolder = new String[li.foldercount+1];
for(int i=0;i<sfolder.length;i++){
sfolder[i] = ofy.get(LinkInfo.class,uid).foldername.get(i);
}
return sfolder;
}
@Override
public String[] createFolder(String uid, String folder) {
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
LinkInfo li =ofy.get(LinkInfo.class,uid);
li.foldercount = li.foldercount+1;
li.foldername.add(li.foldercount,folder);
li.linklist.add(li.foldercount,"");
li.title.add(li.foldercount,"");
li.rating.add(li.foldercount,"");
li.foldercount = li.foldername.size()-1;
ofy.put(li);
String[] sfolder = new String[li.foldercount+1];
for(int i=0;i<sfolder.length;i++){
sfolder[i] = ofy.get(LinkInfo.class,uid).foldername.get(i);
}
return sfolder;
}
public String[] deleteFolder(String uid,int index){
Objectify ofy = ObjectifyService.begin();
ObjectifyService.register(LinkInfo.class);
LinkInfo li =ofy.get(LinkInfo.class,uid);
li.foldername.remove(index);
li.title.remove(index);
li.rating.remove(index);
li.linklist.remove(index);
li.foldercount= li.linklist.size()-1;
ofy.put(li);
String[] sfolder = new String[li.foldercount+1];
for(int i=0;i<sfolder.length;i++){
sfolder[i] = ofy.get(LinkInfo.class,uid).foldername.get(i);
}
return sfolder;
}
}
| 5,441 | 0.65227 | 0.648226 | 164 | 32.17683 | 26.884109 | 173 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.841463 | false | false | 9 |
3b740f24ad4c63c1cd41720286b4152e9d321482 | 19,061,064,884,879 | 8dd2137f40411864176132dd7b879c20447468ee | /src/main/java/com/procurement/orchestrator/delegate/context/SaveFirstOperation.java | a14f5ff5e3f937776ec2d05e69333d9f483d2c4d | [] | no_license | EBRD-Digital-Transformation-MTenderCode/orchestrator | https://github.com/EBRD-Digital-Transformation-MTenderCode/orchestrator | fc0ef6f1959f297424e0f36c590577b0522d1f2d | 604a43b5def45b79a87acda0c08f47add2ef34a2 | refs/heads/master | 2023-07-04T09:31:59.703000 | 2021-08-09T12:52:05 | 2021-08-09T12:52:05 | 282,177,133 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.procurement.orchestrator.delegate.context;
import com.procurement.orchestrator.domain.entity.RequestEntity;
import com.procurement.orchestrator.service.OperationService;
import com.procurement.orchestrator.service.ProcessService;
import com.procurement.orchestrator.service.RequestService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class SaveFirstOperation implements JavaDelegate {
private static final Logger LOG = LoggerFactory.getLogger(SaveFirstOperation.class);
private final OperationService operationService;
private final ProcessService processService;
private final RequestService requestService;
public SaveFirstOperation(final RequestService requestService,
final OperationService operationService,
final ProcessService processService) {
this.requestService = requestService;
this.operationService = operationService;
this.processService = processService;
}
@Override
public void execute(final DelegateExecution execution) {
LOG.info(execution.getCurrentActivityId());
final String requestId = (String) execution.getVariable("requestId");
final String operationId = execution.getProcessBusinessKey();
final String processId = execution.getProcessInstanceId();
final RequestEntity request = requestService.getRequestById(requestId, processId);
if (!operationService.saveIfNotExist(operationId, processId)) {
processService.terminateProcess(processId, "operationId: " + operationId + " already exist.");
}
operationService.saveFirstOperationStep(execution, request);
}
}
| UTF-8 | Java | 1,891 | java | SaveFirstOperation.java | Java | [] | null | [] | package com.procurement.orchestrator.delegate.context;
import com.procurement.orchestrator.domain.entity.RequestEntity;
import com.procurement.orchestrator.service.OperationService;
import com.procurement.orchestrator.service.ProcessService;
import com.procurement.orchestrator.service.RequestService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class SaveFirstOperation implements JavaDelegate {
private static final Logger LOG = LoggerFactory.getLogger(SaveFirstOperation.class);
private final OperationService operationService;
private final ProcessService processService;
private final RequestService requestService;
public SaveFirstOperation(final RequestService requestService,
final OperationService operationService,
final ProcessService processService) {
this.requestService = requestService;
this.operationService = operationService;
this.processService = processService;
}
@Override
public void execute(final DelegateExecution execution) {
LOG.info(execution.getCurrentActivityId());
final String requestId = (String) execution.getVariable("requestId");
final String operationId = execution.getProcessBusinessKey();
final String processId = execution.getProcessInstanceId();
final RequestEntity request = requestService.getRequestById(requestId, processId);
if (!operationService.saveIfNotExist(operationId, processId)) {
processService.terminateProcess(processId, "operationId: " + operationId + " already exist.");
}
operationService.saveFirstOperationStep(execution, request);
}
}
| 1,891 | 0.757271 | 0.756214 | 45 | 41.022221 | 30.201904 | 106 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 9 |
160289613dcdb8e910b6ea4853b2afd4bc4136c1 | 23,725,399,365,241 | 08e1f6b74144db9eb2ad5eb03c4127df245ee3f2 | /src/main/java/br/com/stefanini/midia/utils/FilmeConversor.java | d1bb43c737ab1c4de92fad56c0fb23574d49a44f | [] | no_license | Tiago-israel/midia-server | https://github.com/Tiago-israel/midia-server | 193f371cad6e6543298d0b8da1c9310425f93ce3 | 14c70e8910f6c7835126ced42f71e1f0d19517e6 | refs/heads/master | 2021-09-07T01:44:16.234000 | 2018-02-15T10:55:42 | 2018-02-15T10:55:42 | 115,548,371 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.com.stefanini.midia.utils;
import java.util.ArrayList;
import java.util.List;
import br.com.stefanini.midia.dto.FilmeDto;
import br.com.stefanini.midia.model.Filme;
public class FilmeConversor {
public static FilmeDto filmeModelParaDto(Filme filme) {
return new FilmeDto(filme);
}
public static List<FilmeDto> filmeModelParaDto(Iterable<Filme> filmes) {
List<FilmeDto> filmesDto = new ArrayList<FilmeDto>();
filmes.forEach(filme -> {
filmesDto.add(filmeModelParaDto(filme));
});
return filmesDto;
}
public static Filme filmeDtoParaModel(FilmeDto filmeDto) {
return new Filme(filmeDto);
}
public static List<Filme> filmeDtoParaModel(List<FilmeDto> filmesDto) {
List<Filme> filmes = new ArrayList<>();
filmesDto.forEach(filme -> {
filmes.add(filmeDtoParaModel(filme));
});
return filmes;
}
}
| UTF-8 | Java | 846 | java | FilmeConversor.java | Java | [] | null | [] | package br.com.stefanini.midia.utils;
import java.util.ArrayList;
import java.util.List;
import br.com.stefanini.midia.dto.FilmeDto;
import br.com.stefanini.midia.model.Filme;
public class FilmeConversor {
public static FilmeDto filmeModelParaDto(Filme filme) {
return new FilmeDto(filme);
}
public static List<FilmeDto> filmeModelParaDto(Iterable<Filme> filmes) {
List<FilmeDto> filmesDto = new ArrayList<FilmeDto>();
filmes.forEach(filme -> {
filmesDto.add(filmeModelParaDto(filme));
});
return filmesDto;
}
public static Filme filmeDtoParaModel(FilmeDto filmeDto) {
return new Filme(filmeDto);
}
public static List<Filme> filmeDtoParaModel(List<FilmeDto> filmesDto) {
List<Filme> filmes = new ArrayList<>();
filmesDto.forEach(filme -> {
filmes.add(filmeDtoParaModel(filme));
});
return filmes;
}
}
| 846 | 0.741135 | 0.741135 | 36 | 22.5 | 22.418371 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.416667 | false | false | 9 |
eef7d33135c0a36e010a304a9743921d8509cc0a | 858,993,495,029 | e45ab65399705ea1b57cf15a723b50c93e936055 | /CovidNotifier/app/src/main/java/com/example/covidnotifier/recycleAdapter.java | 0a953f3788ae7fe8ec9cc4f7c6491bbf0291e4d0 | [] | no_license | superdude415/CovidNotifier | https://github.com/superdude415/CovidNotifier | ef247f296fdab0e4a7cecc34cde5a2e7dc00463c | fd5d1b302401e6811702cbff6dcae64da0b251ec | refs/heads/master | 2023-03-06T00:25:52.030000 | 2021-02-13T20:28:24 | 2021-02-13T20:28:24 | 338,500,252 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.covidnotifier;
import android.content.Context;
import android.text.Layout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class recycleAdapter extends RecyclerView.Adapter<recycleAdapter.recycleViewHolder>{
String data1[], data2[];
Context context;
public recycleAdapter(Context ct, String sl[], String s2[]){
data1 = sl;
data2 = s2;
context = ct;
}
@NonNull
@Override
public recycleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(R.layout.rows, parent,false);
return new recycleViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull recycleViewHolder holder, int position) {
holder.text1.setText(data1[position]);
holder.text2.setText(data2[position]);
}
@Override
public int getItemCount() {
return data1.length;
}
public class recycleViewHolder extends RecyclerView.ViewHolder{
TextView text1, text2;
public recycleViewHolder(@NonNull View itemView){
super(itemView);
text1 = itemView.findViewById(R.id.text);
text2 = itemView.findViewById(R.id.text2);}
}
}
| UTF-8 | Java | 1,475 | java | recycleAdapter.java | Java | [] | null | [] | package com.example.covidnotifier;
import android.content.Context;
import android.text.Layout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class recycleAdapter extends RecyclerView.Adapter<recycleAdapter.recycleViewHolder>{
String data1[], data2[];
Context context;
public recycleAdapter(Context ct, String sl[], String s2[]){
data1 = sl;
data2 = s2;
context = ct;
}
@NonNull
@Override
public recycleViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(context);
View view = inflater.inflate(R.layout.rows, parent,false);
return new recycleViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull recycleViewHolder holder, int position) {
holder.text1.setText(data1[position]);
holder.text2.setText(data2[position]);
}
@Override
public int getItemCount() {
return data1.length;
}
public class recycleViewHolder extends RecyclerView.ViewHolder{
TextView text1, text2;
public recycleViewHolder(@NonNull View itemView){
super(itemView);
text1 = itemView.findViewById(R.id.text);
text2 = itemView.findViewById(R.id.text2);}
}
}
| 1,475 | 0.697627 | 0.68678 | 53 | 26.830189 | 25.301008 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.603774 | false | false | 9 |
ae700e2beaa27d9d56e5a08a4b1dd9e597708a02 | 5,102,421,164,051 | 5397a63cb66964d9b61256049e1e42df9d4b511e | /app/src/main/java/com/example/android/registration/WorkshopAdaptor.java | 651e927c6ea3e687051640020741a13048abeb95 | [] | no_license | goel-naman/WorkshopRegistrationApp | https://github.com/goel-naman/WorkshopRegistrationApp | 3bad7772c21fa606ffad085f3dcab30dc421ccc3 | a55caf2889e3cf90cc30cd8622de3068361842b1 | refs/heads/master | 2020-03-29T09:21:51.740000 | 2018-10-05T04:39:45 | 2018-10-05T04:39:45 | 149,754,278 | 0 | 1 | null | false | 2018-10-05T04:39:46 | 2018-09-21T11:29:16 | 2018-09-26T16:19:17 | 2018-10-05T04:39:45 | 165 | 0 | 1 | 0 | Java | false | null | package com.example.android.registration;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
public class WorkshopAdaptor extends RecyclerView.Adapter<WorkshopAdaptor.WorkshopViewHolder> {
private ArrayList<WorkshopItem> items;
WorkshopAdaptor(ArrayList<WorkshopItem> items){
this.items=items;
}
@NonNull
@Override
public WorkshopViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.workshop_cardview,parent,false);
return new WorkshopViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull WorkshopViewHolder holder, int position) {
WorkshopItem data=items.get(position);
holder.title.setText(data.getTitle());
holder.description.setText(data.getDescription());
}
@Override
public int getItemCount() {
return items!=null? items.size():0;
}
// view holder for the data
class WorkshopViewHolder extends RecyclerView.ViewHolder {
TextView title;
TextView description;
WorkshopViewHolder(View itemView) {
super(itemView);
title = itemView.findViewById(R.id.title);
description = itemView.findViewById(R.id.description);
//itemView.setOnClickListener();
}
}
}
| UTF-8 | Java | 1,559 | java | WorkshopAdaptor.java | Java | [] | null | [] | package com.example.android.registration;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
public class WorkshopAdaptor extends RecyclerView.Adapter<WorkshopAdaptor.WorkshopViewHolder> {
private ArrayList<WorkshopItem> items;
WorkshopAdaptor(ArrayList<WorkshopItem> items){
this.items=items;
}
@NonNull
@Override
public WorkshopViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.workshop_cardview,parent,false);
return new WorkshopViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull WorkshopViewHolder holder, int position) {
WorkshopItem data=items.get(position);
holder.title.setText(data.getTitle());
holder.description.setText(data.getDescription());
}
@Override
public int getItemCount() {
return items!=null? items.size():0;
}
// view holder for the data
class WorkshopViewHolder extends RecyclerView.ViewHolder {
TextView title;
TextView description;
WorkshopViewHolder(View itemView) {
super(itemView);
title = itemView.findViewById(R.id.title);
description = itemView.findViewById(R.id.description);
//itemView.setOnClickListener();
}
}
}
| 1,559 | 0.707505 | 0.706222 | 50 | 30.18 | 27.249727 | 110 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52 | false | false | 9 |
c31e0b607a99a18360a70423a236fefdd1085eff | 21,045,339,815,953 | 71556353260eb70fc5e49f204b2d99175292d061 | /src/datacitegenerator/FieldTypes/RightsField.java | ef53ac2d23e1edf89dee1058e5e7196763710c15 | [
"Apache-2.0"
] | permissive | subhh/simpleDataCiteGenerator | https://github.com/subhh/simpleDataCiteGenerator | b4d9cbcb903441b998110e4872fc13a997313069 | c196160544600824cf6f62073249f8c909b5981f | refs/heads/master | 2021-04-06T20:13:53.142000 | 2018-03-26T16:28:17 | 2018-03-26T16:28:17 | 125,397,228 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package datacitegenerator.FieldTypes;
import java.net.URI;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
*
* @author jfmaas
*/
public class RightsField extends DataciteField {
private URI rightsURI;
public RightsField() {
this.name = "rights";
this.rightsURI = null;
}
public void setRightsURI (URI s) { this.rightsURI = s; }
private URI getRightsURI () { return this.rightsURI; }
@Override
public Element createXML(Document doc){
Element field = doc.createElement(this.getName());
if(this.getValue() != null) {
field.appendChild(doc.createTextNode(this.getValue()));
}
// field rightsURI (0..1)
if (this.rightsURI != null) {
Attr attr = doc.createAttribute("rightsURI");
attr.setValue(rightsURI.toString());
field.setAttributeNode(attr);
}
return field;
}
}
| UTF-8 | Java | 1,211 | java | RightsField.java | Java | [
{
"context": "nt;\nimport org.w3c.dom.Element;\n\n/**\n *\n * @author jfmaas\n */\npublic class RightsField extends DataciteFiel",
"end": 352,
"score": 0.9996436834335327,
"start": 346,
"tag": "USERNAME",
"value": "jfmaas"
}
] | null | [] | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package datacitegenerator.FieldTypes;
import java.net.URI;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
*
* @author jfmaas
*/
public class RightsField extends DataciteField {
private URI rightsURI;
public RightsField() {
this.name = "rights";
this.rightsURI = null;
}
public void setRightsURI (URI s) { this.rightsURI = s; }
private URI getRightsURI () { return this.rightsURI; }
@Override
public Element createXML(Document doc){
Element field = doc.createElement(this.getName());
if(this.getValue() != null) {
field.appendChild(doc.createTextNode(this.getValue()));
}
// field rightsURI (0..1)
if (this.rightsURI != null) {
Attr attr = doc.createAttribute("rightsURI");
attr.setValue(rightsURI.toString());
field.setAttributeNode(attr);
}
return field;
}
}
| 1,211 | 0.603633 | 0.599505 | 49 | 23.714285 | 21.181433 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.387755 | false | false | 9 |
094e2fd3302e8ddc5cc5f44f80a77d55bb381f17 | 6,949,257,141,408 | 79b0039a8c49ed8e8855b1ca6e0604805ec8a9ed | /20170325/demo/src/main/java/com/example/app/Argument.java | 33b4d3216c368bd654d907d50222f36d649e156f | [] | no_license | kickkick/SpringBoot | https://github.com/kickkick/SpringBoot | 1c7ba384563c67de5069aa0a91c7974c67e6b458 | d69c10493db282528a446e7dbcb8df97724e0250 | refs/heads/master | 2018-01-03T03:58:32.016000 | 2017-03-30T16:40:01 | 2017-03-30T16:40:01 | 69,981,251 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.app;
import lombok.Data;
/**
* Created by Shogo on 2017/03/25.
*/
@Data
public class Argument {
private final int a;
private final int b;
}
| UTF-8 | Java | 168 | java | Argument.java | Java | [
{
"context": "ample.app;\n\nimport lombok.Data;\n\n/**\n * Created by Shogo on 2017/03/25.\n */\n@Data\npublic class Argument {\n",
"end": 70,
"score": 0.9991543292999268,
"start": 65,
"tag": "USERNAME",
"value": "Shogo"
}
] | null | [] | package com.example.app;
import lombok.Data;
/**
* Created by Shogo on 2017/03/25.
*/
@Data
public class Argument {
private final int a;
private final int b;
}
| 168 | 0.684524 | 0.636905 | 12 | 13 | 11.568636 | 34 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 9 |
528024fc29db09bbd24d3031ef232e9106095e03 | 13,305,808,698,669 | 353145c911ab3cd7d9bcf67e5c3c560bc06d2ca4 | /app/src/main/java/com/example/movieapp/ui/nearbytheatre/NearByTheatreActivity.java | b0ad4cd513a46872dea9384c87dcb8f1513faf34 | [] | no_license | jass1995/Movie-Buddy | https://github.com/jass1995/Movie-Buddy | a1b848e17449e2665e4c28ff4800b918131c6ce8 | ff68f1286ff2f59ca4dcf4217b4e5c38f3d78966 | refs/heads/master | 2020-09-23T15:17:21.354000 | 2019-12-03T04:32:52 | 2019-12-03T04:32:52 | 225,416,353 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.movieapp.ui.nearbytheatre;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.movieapp.R;
import com.example.movieapp.utils.CommonUtils;
import com.example.movieapp.utils.DividerItemDecoration;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
public class NearByTheatreActivity extends AppCompatActivity implements MovieAdapter.Callback {
@BindView(R.id.mRecyclerView)
RecyclerView mRecyclerView;
MovieAdapter mSportAdapter;
@BindView(R.id.backBtn)
RelativeLayout backBtn;
LinearLayoutManager mLayoutManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_near_by_theatre);
ButterKnife.bind(this);
setUp();
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
private void setUp() {
mLayoutManager = new LinearLayoutManager(this);
mLayoutManager.setOrientation(RecyclerView.VERTICAL);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
Drawable dividerDrawable = ContextCompat.getDrawable(this, R.drawable.divider_drawable);
mRecyclerView.addItemDecoration(new DividerItemDecoration(dividerDrawable));
mSportAdapter = new MovieAdapter(new ArrayList<>());
prepareDemoContent();
}
private void prepareDemoContent() {
CommonUtils.showLoading(NearByTheatreActivity.this);
new Handler().postDelayed(() -> {
//prepare data and show loading
CommonUtils.hideLoading();
ArrayList<TheatreList> mSports = new ArrayList<>();
String[] sportsList = getResources().getStringArray(R.array.theatre_list);
String[] sportsInfo = getResources().getStringArray(R.array.theatre_info);
String[] sportsImage = getResources().getStringArray(R.array.theatre_images);
for (int i = 0; i < sportsList.length; i++) {
mSports.add(new TheatreList(sportsImage[i], sportsInfo[i], "Theatre", sportsList[i]));
}
mSportAdapter.addItems(mSports);
mRecyclerView.setAdapter(mSportAdapter);
}, 2000);
}
@Override
public void onEmptyViewRetryClick() {
prepareDemoContent();
}
}
| UTF-8 | Java | 2,895 | java | NearByTheatreActivity.java | Java | [] | null | [] | package com.example.movieapp.ui.nearbytheatre;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.movieapp.R;
import com.example.movieapp.utils.CommonUtils;
import com.example.movieapp.utils.DividerItemDecoration;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
public class NearByTheatreActivity extends AppCompatActivity implements MovieAdapter.Callback {
@BindView(R.id.mRecyclerView)
RecyclerView mRecyclerView;
MovieAdapter mSportAdapter;
@BindView(R.id.backBtn)
RelativeLayout backBtn;
LinearLayoutManager mLayoutManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_near_by_theatre);
ButterKnife.bind(this);
setUp();
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
}
private void setUp() {
mLayoutManager = new LinearLayoutManager(this);
mLayoutManager.setOrientation(RecyclerView.VERTICAL);
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
Drawable dividerDrawable = ContextCompat.getDrawable(this, R.drawable.divider_drawable);
mRecyclerView.addItemDecoration(new DividerItemDecoration(dividerDrawable));
mSportAdapter = new MovieAdapter(new ArrayList<>());
prepareDemoContent();
}
private void prepareDemoContent() {
CommonUtils.showLoading(NearByTheatreActivity.this);
new Handler().postDelayed(() -> {
//prepare data and show loading
CommonUtils.hideLoading();
ArrayList<TheatreList> mSports = new ArrayList<>();
String[] sportsList = getResources().getStringArray(R.array.theatre_list);
String[] sportsInfo = getResources().getStringArray(R.array.theatre_info);
String[] sportsImage = getResources().getStringArray(R.array.theatre_images);
for (int i = 0; i < sportsList.length; i++) {
mSports.add(new TheatreList(sportsImage[i], sportsInfo[i], "Theatre", sportsList[i]));
}
mSportAdapter.addItems(mSports);
mRecyclerView.setAdapter(mSportAdapter);
}, 2000);
}
@Override
public void onEmptyViewRetryClick() {
prepareDemoContent();
}
}
| 2,895 | 0.703972 | 0.702245 | 82 | 34.304878 | 26.5595 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.646341 | false | false | 9 |
41e9ec9712c762da11bfea615e0e818238638c9c | 2,877,628,135,918 | 8ac45a1b238d3e7d5918a2402e778424ae2af355 | /Traffic/src/Traffic.java | 70070989bc286927f5c0117a21839dd544ffc63c | [] | no_license | hahn2014/Java_Projects | https://github.com/hahn2014/Java_Projects | 8b90829a15f23aa96b602c42b49e291a1673f670 | 90d7c696720529dd550bb52b33ad673e157cb38b | refs/heads/master | 2021-01-10T22:11:43.437000 | 2015-04-23T01:52:44 | 2015-04-23T01:52:44 | 34,426,542 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.*;
public class Traffic implements ActionListener, Runnable{
JFrame frame = new JFrame("Traffic Simu - Bryce Hahn");
Road road = new Road();
JButton start = new JButton("Start");
JButton stop = new JButton("Stop");
Container south = new Container();
JButton semi = new JButton("Add Semi");
JButton suv = new JButton("Add SUV");
JButton sports = new JButton("Add Ferari");
JButton truck = new JButton("Add Moster Truck");
JTextField put = new JTextField("ThroughPut = " + "0");
Container west = new Container();
public static boolean running = false;
public static long starttime;
public static long time = 0;
public static long timerun = 0;
public static String throughPut = "";
public Traffic() { //made by Bryce Hahn. This game might be low but hey, it's "fuuuuunnnnnnn"!
frame.setSize(1100, 500);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
//add the road
frame.add(road, BorderLayout.CENTER);
//add the south buttons
south.setLayout(new GridLayout(1, 2));
south.add(start);
start.addActionListener(this);
south.add(stop);
stop.addActionListener(this);
stop.setEnabled(false);
south.add(put);
frame.add(south, BorderLayout.SOUTH);
//add the west buttons
west.setLayout(new GridLayout(4, 1));
west.add(semi);
semi.addActionListener(this);
west.add(suv);
suv.addActionListener(this);
west.add(sports);
sports.addActionListener(this);
west.add(truck);
truck.addActionListener(this);
frame.add(west, BorderLayout.WEST);
frame.repaint();
frame.setVisible(true);
}
public static void main(String[] args) {
new Traffic();
}
public void run() {
while (running) {
road.step();
frame.repaint();
put.setText(throughPut);
try {
Thread.sleep(50);
}catch (Exception ex) {
ex.printStackTrace();
}
}
}
public void actionPerformed(ActionEvent event) {
if (event.getSource().equals(stop)) {
if (running) {
running = false;
start.setEnabled(true);
stop.setEnabled(false);
}
}
if (event.getSource().equals(start)) {
if (!running) {
running = true;
Thread t = new Thread(this);
t.start();
starttime = System.currentTimeMillis();
start.setEnabled(false);
stop.setEnabled(true);
}
}
if (event.getSource().equals(semi)) {
addVehicle(new Semi(0, 0, 0));
frame.repaint();
}
if (event.getSource().equals(suv)) {
addVehicle(new SUV(0, 0, 0));
frame.repaint();
}
if (event.getSource().equals(sports)) {
addVehicle(new SportsCar(0, 0, 0));
frame.repaint();
}
if (event.getSource().equals(truck)) {
addVehicle(new Truck(0, 0, 0));
frame.repaint();
}
}
public void addVehicle(Vehicle v) {
for (int x = 0; x < road.getWidth(); x+=20) {
for (int y = 10; y <= 430; y+=110) {
v.setX(x);
v.setY(y);
v.setLane((y-10) / 100);
if (road.collision(v) == false) {
road.addCar(v);
return;
}
}
}
}
} | UTF-8 | Java | 3,198 | java | Traffic.java | Java | [
{
"context": "nnable{\n\tJFrame frame = new JFrame(\"Traffic Simu - Bryce Hahn\");\n\tRoad road = new Road();\n\tJButton start = new ",
"end": 319,
"score": 0.9998685717582703,
"start": 309,
"tag": "NAME",
"value": "Bryce Hahn"
},
{
"context": "ing throughPut = \"\";\n\tpublic Traffi... | null | [] | import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.*;
public class Traffic implements ActionListener, Runnable{
JFrame frame = new JFrame("Traffic Simu - <NAME>");
Road road = new Road();
JButton start = new JButton("Start");
JButton stop = new JButton("Stop");
Container south = new Container();
JButton semi = new JButton("Add Semi");
JButton suv = new JButton("Add SUV");
JButton sports = new JButton("Add Ferari");
JButton truck = new JButton("Add Moster Truck");
JTextField put = new JTextField("ThroughPut = " + "0");
Container west = new Container();
public static boolean running = false;
public static long starttime;
public static long time = 0;
public static long timerun = 0;
public static String throughPut = "";
public Traffic() { //made by <NAME>. This game might be low but hey, it's "fuuuuunnnnnnn"!
frame.setSize(1100, 500);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
//add the road
frame.add(road, BorderLayout.CENTER);
//add the south buttons
south.setLayout(new GridLayout(1, 2));
south.add(start);
start.addActionListener(this);
south.add(stop);
stop.addActionListener(this);
stop.setEnabled(false);
south.add(put);
frame.add(south, BorderLayout.SOUTH);
//add the west buttons
west.setLayout(new GridLayout(4, 1));
west.add(semi);
semi.addActionListener(this);
west.add(suv);
suv.addActionListener(this);
west.add(sports);
sports.addActionListener(this);
west.add(truck);
truck.addActionListener(this);
frame.add(west, BorderLayout.WEST);
frame.repaint();
frame.setVisible(true);
}
public static void main(String[] args) {
new Traffic();
}
public void run() {
while (running) {
road.step();
frame.repaint();
put.setText(throughPut);
try {
Thread.sleep(50);
}catch (Exception ex) {
ex.printStackTrace();
}
}
}
public void actionPerformed(ActionEvent event) {
if (event.getSource().equals(stop)) {
if (running) {
running = false;
start.setEnabled(true);
stop.setEnabled(false);
}
}
if (event.getSource().equals(start)) {
if (!running) {
running = true;
Thread t = new Thread(this);
t.start();
starttime = System.currentTimeMillis();
start.setEnabled(false);
stop.setEnabled(true);
}
}
if (event.getSource().equals(semi)) {
addVehicle(new Semi(0, 0, 0));
frame.repaint();
}
if (event.getSource().equals(suv)) {
addVehicle(new SUV(0, 0, 0));
frame.repaint();
}
if (event.getSource().equals(sports)) {
addVehicle(new SportsCar(0, 0, 0));
frame.repaint();
}
if (event.getSource().equals(truck)) {
addVehicle(new Truck(0, 0, 0));
frame.repaint();
}
}
public void addVehicle(Vehicle v) {
for (int x = 0; x < road.getWidth(); x+=20) {
for (int y = 10; y <= 430; y+=110) {
v.setX(x);
v.setY(y);
v.setLane((y-10) / 100);
if (road.collision(v) == false) {
road.addCar(v);
return;
}
}
}
}
} | 3,190 | 0.665103 | 0.651345 | 120 | 25.658333 | 15.511015 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.908333 | false | false | 9 |
ba70016afe55dd1b960b86d5c90ee2fdc580cbc9 | 14,267,881,408,158 | de200420ce980f391ffb323227c8ec49ad46da56 | /src/net/game/SensorService.java | 77d4f3685bc8a1ec112fff8ed49af70e9fa60159 | [] | no_license | simondzn/BubbleShooterFinal | https://github.com/simondzn/BubbleShooterFinal | 2add2b900fd965b91755de52901783c63792bfba | ac645ba2ea2474986a4116c433d5cc85d52c8913 | refs/heads/master | 2021-01-10T20:33:14.698000 | 2015-07-30T18:01:54 | 2015-07-30T18:01:54 | 39,964,160 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package net.game;
import android.annotation.TargetApi;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build;
import android.os.Environment;
import android.os.IBinder;
import android.util.Log;
import au.com.bytecode.opencsv.CSVWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
/**
* Created by Simon on 15/07/2015.
*/
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
public class SensorService extends Service implements SensorEventListener{
SensorManager sensorManager;
private ArrayList sensorData;
private ArrayList rotationData, gyroData, magnoData;
private ArrayList linAccelData;
String Id = BubbleShooterActivity.Id;
private static final String TAG = BubbleShooterActivity.class.getSimpleName();
Thread thread;
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
sensorData = new ArrayList();
linAccelData = new ArrayList();
rotationData = new ArrayList();
gyroData = new ArrayList();
magnoData = new ArrayList();
Sensor accel = sensorManager
.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
sensorManager.registerListener(this, accel,
SensorManager.SENSOR_DELAY_FASTEST);
Sensor rotation = sensorManager
.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR);
sensorManager.registerListener(this, rotation,
SensorManager.SENSOR_DELAY_FASTEST);
Sensor linAccel = sensorManager
.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION);
sensorManager.registerListener(this, linAccel,
SensorManager.SENSOR_DELAY_FASTEST);
Sensor gyro = sensorManager
.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
sensorManager.registerListener(this, gyro,
SensorManager.SENSOR_DELAY_FASTEST);
Sensor magno = sensorManager
.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
sensorManager.registerListener(this, magno,
SensorManager.SENSOR_DELAY_FASTEST);
return Service.START_NOT_STICKY;
}
@Override
public void onCreate() {
Runnable runnable = new Runnable() {
public void run() {
Log.d(TAG, "Start the thread..");
try {
midWrite();
} catch (IOException e) {
e.printStackTrace();
}
}
};
thread = new Thread(runnable);
super.onCreate();
}
public void midWrite() throws IOException {
Log.d(TAG,"start write!!");
// Write the Accelerometer data
String csv = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Accel_Bubble.csv";
CSVWriter writer = null;
try {
writer = new CSVWriter(new FileWriter(csv,true));
} catch (IOException e) {
e.printStackTrace();
}
for(int j=0;j<sensorData.size(); j += 1) {
writer.writeNext(new String[]{sensorData.get(j).toString()});
}
try {
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
sensorData.clear();
// Write the rotation data
String csv2 = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Rotation_Bubble.csv";
CSVWriter writer_rotation = null;
try {
writer_rotation = new CSVWriter(new FileWriter(csv2,true));
} catch (IOException e) {
e.printStackTrace();
}
for(int j=0;j<rotationData.size(); j += 1) {
writer_rotation.writeNext(new String[]{rotationData.get(j).toString()});
}
try {
writer_rotation.close();
} catch (IOException e) {
e.printStackTrace();
}
rotationData.clear();
// Write the linear accelerometer
String csv3 = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Accel_lin_Bubble.csv";
CSVWriter writer_lin = null;
try {
writer_lin = new CSVWriter(new FileWriter(csv3,true));
} catch (IOException e) {
e.printStackTrace();
}
for(int j=0;j<linAccelData.size(); j += 1) {
writer_lin.writeNext(new String[]{linAccelData.get(j).toString()});
}
try {
writer_lin.close();
} catch (IOException e) {
e.printStackTrace();
}
linAccelData.clear();
// Write the Gyroscope
String csv4 = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Gyro_Bubble.csv";
CSVWriter writer_gyro = new CSVWriter(new FileWriter(csv4,true));
for(int j=0;j<gyroData.size(); j += 1) {
writer_gyro.writeNext(gyroData.get(j).toString());
}
writer_gyro.close();
gyroData.clear();
// Write the Magnometer
String csv5 = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Magno_Bubble.csv";
CSVWriter writer_magno = new CSVWriter(new FileWriter(csv5,true));
for(int j=0;j<magnoData.size(); j += 1) {
writer_magno.writeNext(magnoData.get(j).toString());
}
writer_magno.close();
magnoData.clear();
Log.d(TAG, "Writing has finished!");
}
@Override
public void onSensorChanged(SensorEvent event) {
long timestamp = System.nanoTime();
if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
sensorData.add(acceVals);
}
else if(event.sensor.getType()== Sensor.TYPE_ROTATION_VECTOR){
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
rotationData.add(acceVals);
}
else if(event.sensor.getType()== Sensor.TYPE_LINEAR_ACCELERATION) {
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
linAccelData.add(acceVals);
}else if(event.sensor.getType()== Sensor.TYPE_GYROSCOPE){
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
gyroData.add(acceVals);
}else if(event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD){
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
magnoData.add(acceVals);
}
if(linAccelData.size()>2000||sensorData.size()>2000||rotationData.size()>2000)
try {
midWrite();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void onDestroy() {
sensorManager.unregisterListener(this);
Log.d(TAG, "onDestroy");
try {
midWrite();
} catch (IOException e) {
e.printStackTrace();
}
super.onDestroy();
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
}
| UTF-8 | Java | 8,306 | java | SensorService.java | Java | [
{
"context": "on;\nimport java.util.ArrayList;\n\n/**\n * Created by Simon on 15/07/2015.\n */\n@TargetApi(Build.VERSION_CODES",
"end": 558,
"score": 0.803110659122467,
"start": 553,
"tag": "NAME",
"value": "Simon"
}
] | null | [] | package net.game;
import android.annotation.TargetApi;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Build;
import android.os.Environment;
import android.os.IBinder;
import android.util.Log;
import au.com.bytecode.opencsv.CSVWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
/**
* Created by Simon on 15/07/2015.
*/
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
public class SensorService extends Service implements SensorEventListener{
SensorManager sensorManager;
private ArrayList sensorData;
private ArrayList rotationData, gyroData, magnoData;
private ArrayList linAccelData;
String Id = BubbleShooterActivity.Id;
private static final String TAG = BubbleShooterActivity.class.getSimpleName();
Thread thread;
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);
sensorData = new ArrayList();
linAccelData = new ArrayList();
rotationData = new ArrayList();
gyroData = new ArrayList();
magnoData = new ArrayList();
Sensor accel = sensorManager
.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
sensorManager.registerListener(this, accel,
SensorManager.SENSOR_DELAY_FASTEST);
Sensor rotation = sensorManager
.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR);
sensorManager.registerListener(this, rotation,
SensorManager.SENSOR_DELAY_FASTEST);
Sensor linAccel = sensorManager
.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION);
sensorManager.registerListener(this, linAccel,
SensorManager.SENSOR_DELAY_FASTEST);
Sensor gyro = sensorManager
.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
sensorManager.registerListener(this, gyro,
SensorManager.SENSOR_DELAY_FASTEST);
Sensor magno = sensorManager
.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
sensorManager.registerListener(this, magno,
SensorManager.SENSOR_DELAY_FASTEST);
return Service.START_NOT_STICKY;
}
@Override
public void onCreate() {
Runnable runnable = new Runnable() {
public void run() {
Log.d(TAG, "Start the thread..");
try {
midWrite();
} catch (IOException e) {
e.printStackTrace();
}
}
};
thread = new Thread(runnable);
super.onCreate();
}
public void midWrite() throws IOException {
Log.d(TAG,"start write!!");
// Write the Accelerometer data
String csv = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Accel_Bubble.csv";
CSVWriter writer = null;
try {
writer = new CSVWriter(new FileWriter(csv,true));
} catch (IOException e) {
e.printStackTrace();
}
for(int j=0;j<sensorData.size(); j += 1) {
writer.writeNext(new String[]{sensorData.get(j).toString()});
}
try {
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
sensorData.clear();
// Write the rotation data
String csv2 = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Rotation_Bubble.csv";
CSVWriter writer_rotation = null;
try {
writer_rotation = new CSVWriter(new FileWriter(csv2,true));
} catch (IOException e) {
e.printStackTrace();
}
for(int j=0;j<rotationData.size(); j += 1) {
writer_rotation.writeNext(new String[]{rotationData.get(j).toString()});
}
try {
writer_rotation.close();
} catch (IOException e) {
e.printStackTrace();
}
rotationData.clear();
// Write the linear accelerometer
String csv3 = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Accel_lin_Bubble.csv";
CSVWriter writer_lin = null;
try {
writer_lin = new CSVWriter(new FileWriter(csv3,true));
} catch (IOException e) {
e.printStackTrace();
}
for(int j=0;j<linAccelData.size(); j += 1) {
writer_lin.writeNext(new String[]{linAccelData.get(j).toString()});
}
try {
writer_lin.close();
} catch (IOException e) {
e.printStackTrace();
}
linAccelData.clear();
// Write the Gyroscope
String csv4 = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Gyro_Bubble.csv";
CSVWriter writer_gyro = new CSVWriter(new FileWriter(csv4,true));
for(int j=0;j<gyroData.size(); j += 1) {
writer_gyro.writeNext(gyroData.get(j).toString());
}
writer_gyro.close();
gyroData.clear();
// Write the Magnometer
String csv5 = android.os.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + "/User-"+ Id + "/Magno_Bubble.csv";
CSVWriter writer_magno = new CSVWriter(new FileWriter(csv5,true));
for(int j=0;j<magnoData.size(); j += 1) {
writer_magno.writeNext(magnoData.get(j).toString());
}
writer_magno.close();
magnoData.clear();
Log.d(TAG, "Writing has finished!");
}
@Override
public void onSensorChanged(SensorEvent event) {
long timestamp = System.nanoTime();
if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER){
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
sensorData.add(acceVals);
}
else if(event.sensor.getType()== Sensor.TYPE_ROTATION_VECTOR){
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
rotationData.add(acceVals);
}
else if(event.sensor.getType()== Sensor.TYPE_LINEAR_ACCELERATION) {
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
linAccelData.add(acceVals);
}else if(event.sensor.getType()== Sensor.TYPE_GYROSCOPE){
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
gyroData.add(acceVals);
}else if(event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD){
double x = event.values[0];
double y = event.values[1];
double z = event.values[2];
AcceVals acceVals = new AcceVals(x, y, z, timestamp);
magnoData.add(acceVals);
}
if(linAccelData.size()>2000||sensorData.size()>2000||rotationData.size()>2000)
try {
midWrite();
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void onDestroy() {
sensorManager.unregisterListener(this);
Log.d(TAG, "onDestroy");
try {
midWrite();
} catch (IOException e) {
e.printStackTrace();
}
super.onDestroy();
}
@Override
public void onAccuracyChanged(Sensor sensor, int accuracy) {
}
}
| 8,306 | 0.601854 | 0.595473 | 230 | 35.113045 | 28.899155 | 171 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.73913 | false | false | 9 |
e287a59796d9f0f3a70e57e31e6c55215809095c | 12,652,973,718,818 | 1d78c9f31868191d665d8e189d4b7ef3d99d39b7 | /src/com/voitenkovsergei/level2/lesson18/task1/PairUtil.java | 215a2f3865b3f78d0d9e3c495475cf9f009c0e57 | [] | no_license | Voitenkov-Sergei/training | https://github.com/Voitenkov-Sergei/training | 632af4d4b43abbf9b36d4757cac857bcc046f9fd | ffb4a6c48f8d56402375ab907661fdf08c8c8004 | refs/heads/master | 2023-02-16T06:38:04.978000 | 2021-01-06T08:38:49 | 2021-01-06T08:38:49 | 320,210,961 | 0 | 0 | null | false | 2021-01-06T08:38:50 | 2020-12-10T08:42:18 | 2020-12-22T17:58:26 | 2021-01-06T08:38:50 | 53 | 0 | 0 | 0 | Java | false | false | package com.voitenkovsergei.level2.lesson18.task1;
public final class PairUtil {
private PairUtil() {
}
public static <X, Y> Pair<Y, X> swap(Pair<X, Y> kvPair) {
return new Pair<>(kvPair.getValue(), kvPair.getKey());
}
} | UTF-8 | Java | 247 | java | PairUtil.java | Java | [] | null | [] | package com.voitenkovsergei.level2.lesson18.task1;
public final class PairUtil {
private PairUtil() {
}
public static <X, Y> Pair<Y, X> swap(Pair<X, Y> kvPair) {
return new Pair<>(kvPair.getValue(), kvPair.getKey());
}
} | 247 | 0.639676 | 0.623482 | 11 | 21.545454 | 24.171221 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.545455 | false | false | 9 |
c50a3df12bbf01a5ca70cd5cf405e0b3edc749b5 | 26,388,279,136,827 | 6b38d683190b385ee75897d09c0a2c4287b7d3cc | /health_app_module_collector/src/cn/com/hzzc/health/pro/model/ImageFloder.java | 6d14e26f698bb61a281ad944109e849149552fc2 | [] | no_license | pangjianhai/HealthApp | https://github.com/pangjianhai/HealthApp | 85f90840ffdd78026741650b610e172e201fb5b1 | a32896b5eab47e5777b3b039c214ddf08c915e76 | refs/heads/master | 2021-01-10T05:22:26.886000 | 2015-10-09T09:27:20 | 2015-10-09T09:27:20 | 36,633,003 | 1 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.com.hzzc.health.pro.model;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author pang
* @todo 手机图片文件夹
*
*/
public class ImageFloder {
/**
* 文件夹路径
*/
private String dir;
/**
* 文件夹名字
*/
private String name;
/**
* 第一章图片的路径
*/
private String firstImagePath;
/**
* 所有图片
*/
public List<ImageItem> images = new ArrayList<ImageItem>();
public String getDir() {
return dir;
}
public void setDir(String dir) {
this.dir = dir;
int lastIndexOf = this.dir.lastIndexOf("/");
this.name = this.dir.substring(lastIndexOf);
}
public String getFirstImagePath() {
return firstImagePath;
}
public void setFirstImagePath(String firstImagePath) {
this.firstImagePath = firstImagePath;
}
public String getName() {
return name;
}
}
| UTF-8 | Java | 852 | java | ImageFloder.java | Java | [
{
"context": "ayList;\nimport java.util.List;\n\n/**\n * \n * @author pang\n * @todo 手机图片文件夹\n *\n */\npublic class ImageFloder ",
"end": 114,
"score": 0.9968099594116211,
"start": 110,
"tag": "USERNAME",
"value": "pang"
}
] | null | [] | package cn.com.hzzc.health.pro.model;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author pang
* @todo 手机图片文件夹
*
*/
public class ImageFloder {
/**
* 文件夹路径
*/
private String dir;
/**
* 文件夹名字
*/
private String name;
/**
* 第一章图片的路径
*/
private String firstImagePath;
/**
* 所有图片
*/
public List<ImageItem> images = new ArrayList<ImageItem>();
public String getDir() {
return dir;
}
public void setDir(String dir) {
this.dir = dir;
int lastIndexOf = this.dir.lastIndexOf("/");
this.name = this.dir.substring(lastIndexOf);
}
public String getFirstImagePath() {
return firstImagePath;
}
public void setFirstImagePath(String firstImagePath) {
this.firstImagePath = firstImagePath;
}
public String getName() {
return name;
}
}
| 852 | 0.664987 | 0.664987 | 53 | 13.981133 | 15.676555 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.018868 | false | false | 9 |
13f2ec26f6e708c04e71fbcfaa0c6a6a24f24faa | 19,258,633,420,251 | 8a72822866a34ba283abe8cf7797ccd065fc0b54 | /Dynamic Programming/MinCostClimbingStairs.java | bd93edd4c8a86900b82dab1802e23ff132bc99e3 | [] | no_license | WenyuZhang1992/LinkCode | https://github.com/WenyuZhang1992/LinkCode | ce35cff484e4e56e09b39a1fbb29600ed7cad4c4 | 8d6d69d3800dac15435273fbdd377e2f180f830f | refs/heads/master | 2020-04-17T05:33:26.567000 | 2018-01-25T14:17:52 | 2018-01-25T14:17:52 | 67,233,458 | 1 | 0 | null | false | 2017-12-24T04:11:31 | 2016-09-02T15:21:20 | 2017-06-27T07:52:05 | 2017-12-24T04:11:31 | 120 | 1 | 0 | 0 | Java | false | null | /**
* 746. Min Cost Climbing Stairs
* https://leetcode.com/problems/min-cost-climbing-stairs/description/
*/
class MinCostClimbingStairs {
/**
* Version 1: Use Dynamic Programming;
* Time: O(n)
* Space: O(n)
*/
public int minCostClimbingStairs(int[] cost) {
if (cost == null || cost.length == 0) {
return Integer.MIN_VALUE;
}
if (cost.length == 1) {
return cost[0];
}
int[] dp = new int[cost.length + 1];
dp[0] = 0;
dp[1] = 0;
for (int i = 2; i < dp.length; ++i) {
dp[i] = Math.min(dp[i - 1] + cost[i - 1], dp[i - 2] + cost[i - 2]);
}
return dp[dp.length - 1];
}
/**
* Version 2: Use Dynamic Programming with constant space;
* Since we can only climb 1 or 2 stairs, we only need to keep track of two dp values;
* Time: O(n)
* Space: O(1)
*/
public int minCostClimbingStairs(int[] cost) {
if (cost == null || cost.length == 0) {
return Integer.MIN_VALUE;
}
if (cost.length == 1) {
return cost[0];
}
int dp1 = 0;
int dp2 = 0;
for (int i = 2; i <= cost.length; ++i) {
int temp = Math.min(dp1 + cost[i - 1], dp2 + cost[i - 2]);
dp2 = dp1;
dp1 = temp;
}
return dp1;
}
} | UTF-8 | Java | 1,402 | java | MinCostClimbingStairs.java | Java | [] | null | [] | /**
* 746. Min Cost Climbing Stairs
* https://leetcode.com/problems/min-cost-climbing-stairs/description/
*/
class MinCostClimbingStairs {
/**
* Version 1: Use Dynamic Programming;
* Time: O(n)
* Space: O(n)
*/
public int minCostClimbingStairs(int[] cost) {
if (cost == null || cost.length == 0) {
return Integer.MIN_VALUE;
}
if (cost.length == 1) {
return cost[0];
}
int[] dp = new int[cost.length + 1];
dp[0] = 0;
dp[1] = 0;
for (int i = 2; i < dp.length; ++i) {
dp[i] = Math.min(dp[i - 1] + cost[i - 1], dp[i - 2] + cost[i - 2]);
}
return dp[dp.length - 1];
}
/**
* Version 2: Use Dynamic Programming with constant space;
* Since we can only climb 1 or 2 stairs, we only need to keep track of two dp values;
* Time: O(n)
* Space: O(1)
*/
public int minCostClimbingStairs(int[] cost) {
if (cost == null || cost.length == 0) {
return Integer.MIN_VALUE;
}
if (cost.length == 1) {
return cost[0];
}
int dp1 = 0;
int dp2 = 0;
for (int i = 2; i <= cost.length; ++i) {
int temp = Math.min(dp1 + cost[i - 1], dp2 + cost[i - 2]);
dp2 = dp1;
dp1 = temp;
}
return dp1;
}
} | 1,402 | 0.470043 | 0.442939 | 55 | 24.50909 | 22.65542 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.672727 | false | false | 9 |
0002cbcebe7200edc812b8bfc9c455e3b2f632d6 | 11,098,195,522,316 | 87c47a458d03ec927cb102adf38f980a7494a883 | /base/src/main/java/cn/lzh/base/net/rx/RetrofitManager.java | c705b16735d74e614b18dd1d15bf69470914da6f | [] | no_license | lzh0877/Sample | https://github.com/lzh0877/Sample | 13c25be0bb9650312fa52da273c8b3ceea03e283 | 9ef25c21e5620e93fd76b89db98ba861c89af8c2 | refs/heads/master | 2020-04-30T20:57:35.393000 | 2019-03-25T03:33:23 | 2019-03-25T03:33:23 | 177,082,914 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package cn.lzh.base.net.rx;
import com.daimajia.numberprogressbar.NumberProgressBar;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.File;
import cn.lzh.base.net.interceptor.CacheInterceptor;
import cn.lzh.base.net.interceptor.DownloadInterceptor;
import cn.lzh.base.net.interceptor.UpLoadInterceptor;
import cn.lzh.base.widget.DownNotification;
import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.Cache;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by Administrator_LZH on 2017/5/22.
*/
public class RetrofitManager {
private Retrofit.Builder retrofitBuilder;
private OkHttpClient.Builder builder;
private Gson mGson;
public RetrofitManager() {
mGson = new GsonBuilder().serializeNulls().create();
retrofitBuilder = RetrofitBuilder.getInstance().getBuilder();
builder = OkHttpClientManager.getInstance().getBuilder();
}
public <T> T getDefaultClient(Class<T> serviceClass) {
OkHttpClient client = builder.build();
return retrofitBuilder
.client(client)
.addConverterFactory(GsonConverterFactory.create(mGson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build().create(serviceClass);
}
public <T> T getNotificationClient(Class<T> serviceClass, DownNotification downNotification, final String completeTitle) {
OkHttpClient client = builder.addInterceptor(new DownloadInterceptor((bytesRead, contentLength, done) -> {
if (done) {
downNotification.getBuilder().setContentTitle(completeTitle);
downNotification.setProgressComplete("下载完成");
} else {
downNotification.setProgress((Long.valueOf(contentLength)).intValue(), (Long.valueOf(bytesRead)).intValue(), false);
}
}))
.build();
return retrofitBuilder.client(client)
.addConverterFactory(GsonConverterFactory.create(mGson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build().create(serviceClass);
}
public <T> T getProgressDialogClient(Class<T> serviceClass, final NumberProgressBar dialog) {
OkHttpClient client = builder.addInterceptor(new UpLoadInterceptor((bytesWritten, contentLength) ->
Observable.create((ObservableOnSubscribe<Integer>) emitter ->
dialog.setProgress((int) ((Long.valueOf(bytesWritten).floatValue() / Long.valueOf(contentLength).floatValue()) * 100)))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe()))
.build();
return retrofitBuilder.client(client)
.addConverterFactory(GsonConverterFactory.create(mGson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build().create(serviceClass);
}
public <T> T getCacheClient(Class<T> serviceClass, File cacheFile) {
OkHttpClient client = builder
.cache(new Cache(cacheFile, 10 * 1024 * 1024))
.addNetworkInterceptor(new CacheInterceptor())
.build();
return retrofitBuilder.client(client)
.addConverterFactory(GsonConverterFactory.create(mGson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build().create(serviceClass);
}
}
| UTF-8 | Java | 3,924 | java | RetrofitManager.java | Java | [
{
"context": "rter.gson.GsonConverterFactory;\n\n/**\n * Created by Administrator_LZH on 2017/5/22.\n */\npublic class RetrofitManager {\n",
"end": 785,
"score": 0.9996887445449829,
"start": 768,
"tag": "USERNAME",
"value": "Administrator_LZH"
}
] | null | [] | package cn.lzh.base.net.rx;
import com.daimajia.numberprogressbar.NumberProgressBar;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.File;
import cn.lzh.base.net.interceptor.CacheInterceptor;
import cn.lzh.base.net.interceptor.DownloadInterceptor;
import cn.lzh.base.net.interceptor.UpLoadInterceptor;
import cn.lzh.base.widget.DownNotification;
import io.reactivex.Observable;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import okhttp3.Cache;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by Administrator_LZH on 2017/5/22.
*/
public class RetrofitManager {
private Retrofit.Builder retrofitBuilder;
private OkHttpClient.Builder builder;
private Gson mGson;
public RetrofitManager() {
mGson = new GsonBuilder().serializeNulls().create();
retrofitBuilder = RetrofitBuilder.getInstance().getBuilder();
builder = OkHttpClientManager.getInstance().getBuilder();
}
public <T> T getDefaultClient(Class<T> serviceClass) {
OkHttpClient client = builder.build();
return retrofitBuilder
.client(client)
.addConverterFactory(GsonConverterFactory.create(mGson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build().create(serviceClass);
}
public <T> T getNotificationClient(Class<T> serviceClass, DownNotification downNotification, final String completeTitle) {
OkHttpClient client = builder.addInterceptor(new DownloadInterceptor((bytesRead, contentLength, done) -> {
if (done) {
downNotification.getBuilder().setContentTitle(completeTitle);
downNotification.setProgressComplete("下载完成");
} else {
downNotification.setProgress((Long.valueOf(contentLength)).intValue(), (Long.valueOf(bytesRead)).intValue(), false);
}
}))
.build();
return retrofitBuilder.client(client)
.addConverterFactory(GsonConverterFactory.create(mGson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build().create(serviceClass);
}
public <T> T getProgressDialogClient(Class<T> serviceClass, final NumberProgressBar dialog) {
OkHttpClient client = builder.addInterceptor(new UpLoadInterceptor((bytesWritten, contentLength) ->
Observable.create((ObservableOnSubscribe<Integer>) emitter ->
dialog.setProgress((int) ((Long.valueOf(bytesWritten).floatValue() / Long.valueOf(contentLength).floatValue()) * 100)))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe()))
.build();
return retrofitBuilder.client(client)
.addConverterFactory(GsonConverterFactory.create(mGson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build().create(serviceClass);
}
public <T> T getCacheClient(Class<T> serviceClass, File cacheFile) {
OkHttpClient client = builder
.cache(new Cache(cacheFile, 10 * 1024 * 1024))
.addNetworkInterceptor(new CacheInterceptor())
.build();
return retrofitBuilder.client(client)
.addConverterFactory(GsonConverterFactory.create(mGson))
.addCallAdapterFactory(RxJava2CallAdapterFactory.createWithScheduler(Schedulers.io()))
.build().create(serviceClass);
}
}
| 3,924 | 0.684627 | 0.676711 | 87 | 44.011494 | 33.908768 | 143 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.517241 | false | false | 9 |
5d420570e0fb86b53872dc8523aa5c6748333e11 | 18,245,021,115,504 | b74acd43f22a286b28c7c718f23484a07278f161 | /jsf-be-dao/src/main/java/org/bidziil/app/services/jpa/dao/DealModelDao.java | c4e9009eabc33a2a6745990282e7bb0060f32f74 | [] | no_license | bidziil/jsf-app | https://github.com/bidziil/jsf-app | d3070dd4e14da4f1b9d6d6e2c2172cc6f667f058 | 46611578ad72ae77d1e7f282e8c27477ec99911b | refs/heads/master | 2016-08-11T21:16:49.294000 | 2016-01-29T10:54:48 | 2016-01-29T10:54:48 | 46,578,009 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.bidziil.app.services.jpa.dao;
import java.util.List;
import javax.interceptor.Interceptors;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import org.apache.log4j.Logger;
import org.bidziil.app.model.DealModel;
import org.bidziil.app.services.jpa.core.Dao;
import org.bidziil.app.services.jpa.core.GenericDao;
import org.bidziil.app.services.jpa.core.GenericDaoInterceptor;
@Dao
@Interceptors({ GenericDaoInterceptor.class })
public class DealModelDao extends GenericDao<DealModel> {
private static final long serialVersionUID = -4025139188204584738L;
private static final String loggerName = DealModelDao.class.getName();
private static final Logger logger = Logger.getLogger(loggerName);
public DealModelDao() {
super(DealModel.class, logger);
}
public DealModelDao(EntityManager entityManager) {
super(DealModel.class, logger);
}
public List<DealModel> findDeal() {
return findAll();
}
public List<DealModel> findDeal(int first, int pageSize) {
CriteriaQuery<DealModel> q = createDealModelQuery()/*.setFirstResult(first).setMaxResults(pageSize)*/;
return list(q);
}
public long countDeal() {
return count();
}
private CriteriaQuery<DealModel> createDealModelQuery() {
CriteriaBuilder cb = createCriteriaBuilder();
CriteriaQuery<DealModel> query = cb.createQuery(getEntityClass());
// Root<DealModel> dealModelsRoot = query.from(getEntityClass());
// Join<DealModel, Channel> dealBaseJoin = dealModelsRoot.join(DealModel_.dealBase);
return query;
}
} | UTF-8 | Java | 1,665 | java | DealModelDao.java | Java | [] | null | [] | package org.bidziil.app.services.jpa.dao;
import java.util.List;
import javax.interceptor.Interceptors;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import org.apache.log4j.Logger;
import org.bidziil.app.model.DealModel;
import org.bidziil.app.services.jpa.core.Dao;
import org.bidziil.app.services.jpa.core.GenericDao;
import org.bidziil.app.services.jpa.core.GenericDaoInterceptor;
@Dao
@Interceptors({ GenericDaoInterceptor.class })
public class DealModelDao extends GenericDao<DealModel> {
private static final long serialVersionUID = -4025139188204584738L;
private static final String loggerName = DealModelDao.class.getName();
private static final Logger logger = Logger.getLogger(loggerName);
public DealModelDao() {
super(DealModel.class, logger);
}
public DealModelDao(EntityManager entityManager) {
super(DealModel.class, logger);
}
public List<DealModel> findDeal() {
return findAll();
}
public List<DealModel> findDeal(int first, int pageSize) {
CriteriaQuery<DealModel> q = createDealModelQuery()/*.setFirstResult(first).setMaxResults(pageSize)*/;
return list(q);
}
public long countDeal() {
return count();
}
private CriteriaQuery<DealModel> createDealModelQuery() {
CriteriaBuilder cb = createCriteriaBuilder();
CriteriaQuery<DealModel> query = cb.createQuery(getEntityClass());
// Root<DealModel> dealModelsRoot = query.from(getEntityClass());
// Join<DealModel, Channel> dealBaseJoin = dealModelsRoot.join(DealModel_.dealBase);
return query;
}
} | 1,665 | 0.754354 | 0.742342 | 53 | 29.452829 | 27.462198 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.528302 | false | false | 9 |
7b971fa648f94172802bbe55762edc812e126c8b | 9,783,935,535,437 | ec7f7ce733f0d57454529d7275ad372f9c6460e1 | /hackerrank.algo.4.plusminus/src/hackerrank/algo/pkg4/plusminus/HackerrankAlgo4Plusminus.java | c1866d14434ebdb318d0fc9c7d72fb230c01dcba | [] | no_license | epishan/hackerrank | https://github.com/epishan/hackerrank | 6e6f93538828e8d8deae847b35fabc0cdbdd5b10 | 3646066c39582eedb9ead1e753546d1952acc984 | refs/heads/master | 2020-03-17T14:08:20.734000 | 2018-05-28T13:35:10 | 2018-05-28T13:35:10 | 133,659,887 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package hackerrank.algo.pkg4.plusminus;
import java.io.*;
import java.util.*;
public class HackerrankAlgo4Plusminus {
// Complete the plusMinus function below.
static void plusMinus(int[] arr) {
int posCount = 0;
int negCount = 0;
int zeroCount = 0;
for (int el: arr) {
if (el > 0) {
posCount++;
} else if (el < 0) {
negCount++;
} else {
zeroCount++;
}
}
double pf = posCount / (double) arr.length;
double nf = negCount / (double) arr.length;
double zf = zeroCount / (double) arr.length;
System.out.println(pf);
System.out.println(nf);
System.out.println(zf);
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] arr = new int[N];
for (int i=0; i<N; i++) {
arr[i] = sc.nextInt();
}
sc.close();
plusMinus(arr);
}
}
| UTF-8 | Java | 1,125 | java | HackerrankAlgo4Plusminus.java | Java | [] | null | [] | package hackerrank.algo.pkg4.plusminus;
import java.io.*;
import java.util.*;
public class HackerrankAlgo4Plusminus {
// Complete the plusMinus function below.
static void plusMinus(int[] arr) {
int posCount = 0;
int negCount = 0;
int zeroCount = 0;
for (int el: arr) {
if (el > 0) {
posCount++;
} else if (el < 0) {
negCount++;
} else {
zeroCount++;
}
}
double pf = posCount / (double) arr.length;
double nf = negCount / (double) arr.length;
double zf = zeroCount / (double) arr.length;
System.out.println(pf);
System.out.println(nf);
System.out.println(zf);
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] arr = new int[N];
for (int i=0; i<N; i++) {
arr[i] = sc.nextInt();
}
sc.close();
plusMinus(arr);
}
}
| 1,125 | 0.460444 | 0.453333 | 48 | 22.4375 | 14.766102 | 52 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.479167 | false | false | 9 |
f2aa0d7e58fa8df0a1f570225fcbfc54f80a219b | 4,956,392,299,677 | e289d08076399625d45d1cea195a6a0396cbc151 | /single-exchange-sample/src/main/java/com/example/demo/domain/order/CancelSellOrder.java | 1ab163d39036b2d7919f53282dab98d5c73fc73f | [] | no_license | KwonSungBong/exchange-sample | https://github.com/KwonSungBong/exchange-sample | d555b5122cb3625cae083ea1bdc1628dc1947b76 | 88ac49f0be0aff573c6602ba39f4563ecac6ff19 | refs/heads/master | 2018-10-16T07:14:48.426000 | 2018-10-08T06:31:06 | 2018-10-08T06:31:06 | 140,643,143 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.demo.domain.order;
public class CancelSellOrder extends Order {
}
| UTF-8 | Java | 87 | java | CancelSellOrder.java | Java | [] | null | [] | package com.example.demo.domain.order;
public class CancelSellOrder extends Order {
}
| 87 | 0.804598 | 0.804598 | 4 | 20.75 | 20.363878 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 9 |
e41534f7458e1de1362850da46f55b55307d8937 | 14,851,996,936,351 | 44a3868a80b0f95c7ca6df318733fcd2e170f717 | /crowd-cloud-member-parent/crowd-cloud-member-project-consumer/src/main/java/com/cloud/member/crowd/handler/ProjectHandler.java | 0708d98d87a4c1ad8e68a1ab440d17fd9d8d34e9 | [] | no_license | xiemolei/CrowdFunding | https://github.com/xiemolei/CrowdFunding | 3b5f3cc675d0f36293bcd38f9657b663a6fdf76c | c48b47083c393657c823d6a6c7861f788529dfd7 | refs/heads/master | 2023-01-05T06:31:37.320000 | 2020-11-04T18:42:01 | 2020-11-04T18:42:01 | 304,080,429 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.cloud.member.crowd.handler;
import com.cloud.member.crowd.api.MySQLRemoteService;
import com.cloud.member.crowd.entity.vo.*;
import com.cloud.member.crowd.config.OSSProperties;
import com.mo.crowd.constant.CrowdConstant;
import com.mo.crowd.util.CrowdUtil;
import com.mo.crowd.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* @author : xiemogaminari
* create at: 2020-10-31 00:09
* @description:
*/
@Controller
public class ProjectHandler {
@Autowired
private OSSProperties ossProperties;
@Autowired
private MySQLRemoteService mySQLRemoteService;
/**
* 上传图片到OSS
* @param picture
* @return 返回OSS图片路径
* @throws IOException
*/
@ResponseBody
@RequestMapping("/create/upload/picture/return")
public ResultEntity<String> uploadPictureReturn(
@RequestParam("picture") MultipartFile picture) throws IOException {
ResultEntity<String> resultEntity = CrowdUtil.uploadFileToOss(
ossProperties.getEndPoint(),
ossProperties.getAccessKeyId(),
ossProperties.getAccessKeySecret(),
picture.getInputStream(),
ossProperties.getBucketName(),
ossProperties.getBucketDomain(),
picture.getOriginalFilename());
return resultEntity;
}
@RequestMapping("/create/project/information")
public String saveProjectInformation(
// 表单信息
ProjectVO projectVO,
// headpicture
MultipartFile headerPicture,
List<MultipartFile> detailPictureList,
// 收集数据存入session
HttpSession session,
// 出错时返回页面
Model model
) throws IOException {
// 头图判断
boolean headPictureIsEmpty = headerPicture.isEmpty();
if(headPictureIsEmpty){
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_HEADER_PIC_EMPTY);
return "project-launch";
}
// 头图上传
ResultEntity<String> uploadHeaderPicResultEntity = CrowdUtil.uploadFileToOss(
ossProperties.getEndPoint(),
ossProperties.getAccessKeyId(),
ossProperties.getAccessKeySecret(),
headerPicture.getInputStream(),
ossProperties.getBucketName(),
ossProperties.getBucketDomain(),
headerPicture.getOriginalFilename());
// 上传结果
if(ResultEntity.SUCCESS.equals(uploadHeaderPicResultEntity.getResult())){
String headerPicPath = uploadHeaderPicResultEntity.getData();
projectVO.setHeaderPicturePath(headerPicPath);
}else{
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_HEADER_PIC_UPLOAD_FAILED);
return "project-launch";
}
// 详情图判断
if(detailPictureList == null || detailPictureList.size() == 0){
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_DETAIL_PIC_EMPTY);
return "project-launch";
}
// 详情图上传
List<String> detailPicPathList = new ArrayList<String>();
for(MultipartFile detailPicture : detailPictureList){
if(detailPicture.isEmpty()){
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_DETAIL_PIC_EMPTY);
return "project-launch";
}
ResultEntity<String> uploadDetailPictureResultEntity = CrowdUtil.uploadFileToOss(
ossProperties.getEndPoint(),
ossProperties.getAccessKeyId(),
ossProperties.getAccessKeySecret(),
detailPicture.getInputStream(),
ossProperties.getBucketName(),
ossProperties.getBucketDomain(),
detailPicture.getOriginalFilename());
if(ResultEntity.SUCCESS.equals(uploadDetailPictureResultEntity.getResult())){
String detailPicPath = uploadHeaderPicResultEntity.getData();
detailPicPathList.add(detailPicPath);
}else{
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_DETAIL_PIC_UPLOAD_FAILED);
return "project-launch";
}
}
// 上传结果
projectVO.setDetailPicturePathList(detailPicPathList);
// 表单信息存储到session
session.setAttribute(CrowdConstant.ATTR_NAME_TEMPLE_PROJECT, projectVO);
// 返回
return "redirect:http://www.xmlcrowd.com:8080/project/return/info/page";
}
@ResponseBody
@RequestMapping("/create/upload/return/picture.json")
public ResultEntity<String> uploadReturnPicture(
@RequestParam("returnPicture") MultipartFile returnPicture
) throws IOException {
// 1.执行文件上传
ResultEntity<String> uploadReturnPicResultEntity = CrowdUtil.uploadFileToOss(
ossProperties.getEndPoint(),
ossProperties.getAccessKeyId(),
ossProperties.getAccessKeySecret(),
returnPicture.getInputStream(),
ossProperties.getBucketName(),
ossProperties.getBucketDomain(),
returnPicture.getOriginalFilename());
// 2.返回上传的结果
return uploadReturnPicResultEntity;
}
@ResponseBody
@RequestMapping("/create/save/return.json")
public ResultEntity<String> saveRetrun(
ReturnVO returnVO,
HttpSession session
){
try {
// 取出session中的Project
ProjectVO projectVo =(ProjectVO) session.getAttribute(CrowdConstant.ATTR_NAME_TEMPLE_PROJECT);
if(projectVo == null){
return ResultEntity.failed(CrowdConstant.MESSAGE_TEMPLE_PROJECT_MISSING);
}
// project中的return对象判空,并初始化
List<ReturnVO> returnVOList = projectVo.getReturnVOList();
if(returnVOList == null || returnVOList.size() == 0){
returnVOList = new ArrayList<ReturnVO>();
projectVo.setReturnVOList(returnVOList);
}
returnVOList.add(returnVO);
// 再存回seeion
session.setAttribute(CrowdConstant.ATTR_NAME_TEMPLE_PROJECT, projectVo);
return ResultEntity.successWithoutData();
} catch (Exception e) {
e.printStackTrace();
return ResultEntity.failed(e.getMessage());
}
}
@RequestMapping("/create/confirm")
public String saveConfirm(
ModelMap modelMap,
HttpSession session,
MemberConfirmInfoVO memberConfirmInfoVO
){
ProjectVO projectVo =(ProjectVO) session.getAttribute(CrowdConstant.ATTR_NAME_TEMPLE_PROJECT);
if(projectVo == null){
throw new RuntimeException(CrowdConstant.MESSAGE_TEMPLE_PROJECT_MISSING);
}
projectVo.setMemberConfirmInfoVO(memberConfirmInfoVO);
MemberLoginVO memberLoginVO = (MemberLoginVO)session.getAttribute(CrowdConstant.ATTR_NAME_LOGIN_MEMBER);
Integer memberId = memberLoginVO.getId();
ResultEntity<String> saveResultEntity = mySQLRemoteService.saveProjectVoRemote(projectVo, memberId);
String result = saveResultEntity.getResult();
if(ResultEntity.FAILED.equals(result)){
modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, saveResultEntity.getMessage());
return "project-confirm";
}
// 8.如果远程保存成功则跳转到最终完成页面
return "redirect:http://www.xmlcrowd.com:8080/project/create/success";
}
@RequestMapping("/get/project/detail/{projectId}")
public String getProjectDetail(
@PathVariable("projectId") Integer projectId,
Model model
){
ResultEntity<DetailProjectVO> resultEntity = mySQLRemoteService.getDetailProjectVORemote(projectId);
if(ResultEntity.SUCCESS.equals(resultEntity.getResult())) {
DetailProjectVO detailProjectVO = resultEntity.getData();
model.addAttribute("detailProjectVO", detailProjectVO);
}
return "project-show-detail";
}
} | UTF-8 | Java | 8,991 | java | ProjectHandler.java | Java | [
{
"context": "rrayList;\nimport java.util.List;\n\n/**\n * @author : xiemogaminari\n * create at: 2020-10-31 00:09\n * @description:",
"end": 950,
"score": 0.999671459197998,
"start": 937,
"tag": "USERNAME",
"value": "xiemogaminari"
}
] | null | [] | package com.cloud.member.crowd.handler;
import com.cloud.member.crowd.api.MySQLRemoteService;
import com.cloud.member.crowd.entity.vo.*;
import com.cloud.member.crowd.config.OSSProperties;
import com.mo.crowd.constant.CrowdConstant;
import com.mo.crowd.util.CrowdUtil;
import com.mo.crowd.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* @author : xiemogaminari
* create at: 2020-10-31 00:09
* @description:
*/
@Controller
public class ProjectHandler {
@Autowired
private OSSProperties ossProperties;
@Autowired
private MySQLRemoteService mySQLRemoteService;
/**
* 上传图片到OSS
* @param picture
* @return 返回OSS图片路径
* @throws IOException
*/
@ResponseBody
@RequestMapping("/create/upload/picture/return")
public ResultEntity<String> uploadPictureReturn(
@RequestParam("picture") MultipartFile picture) throws IOException {
ResultEntity<String> resultEntity = CrowdUtil.uploadFileToOss(
ossProperties.getEndPoint(),
ossProperties.getAccessKeyId(),
ossProperties.getAccessKeySecret(),
picture.getInputStream(),
ossProperties.getBucketName(),
ossProperties.getBucketDomain(),
picture.getOriginalFilename());
return resultEntity;
}
@RequestMapping("/create/project/information")
public String saveProjectInformation(
// 表单信息
ProjectVO projectVO,
// headpicture
MultipartFile headerPicture,
List<MultipartFile> detailPictureList,
// 收集数据存入session
HttpSession session,
// 出错时返回页面
Model model
) throws IOException {
// 头图判断
boolean headPictureIsEmpty = headerPicture.isEmpty();
if(headPictureIsEmpty){
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_HEADER_PIC_EMPTY);
return "project-launch";
}
// 头图上传
ResultEntity<String> uploadHeaderPicResultEntity = CrowdUtil.uploadFileToOss(
ossProperties.getEndPoint(),
ossProperties.getAccessKeyId(),
ossProperties.getAccessKeySecret(),
headerPicture.getInputStream(),
ossProperties.getBucketName(),
ossProperties.getBucketDomain(),
headerPicture.getOriginalFilename());
// 上传结果
if(ResultEntity.SUCCESS.equals(uploadHeaderPicResultEntity.getResult())){
String headerPicPath = uploadHeaderPicResultEntity.getData();
projectVO.setHeaderPicturePath(headerPicPath);
}else{
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_HEADER_PIC_UPLOAD_FAILED);
return "project-launch";
}
// 详情图判断
if(detailPictureList == null || detailPictureList.size() == 0){
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_DETAIL_PIC_EMPTY);
return "project-launch";
}
// 详情图上传
List<String> detailPicPathList = new ArrayList<String>();
for(MultipartFile detailPicture : detailPictureList){
if(detailPicture.isEmpty()){
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_DETAIL_PIC_EMPTY);
return "project-launch";
}
ResultEntity<String> uploadDetailPictureResultEntity = CrowdUtil.uploadFileToOss(
ossProperties.getEndPoint(),
ossProperties.getAccessKeyId(),
ossProperties.getAccessKeySecret(),
detailPicture.getInputStream(),
ossProperties.getBucketName(),
ossProperties.getBucketDomain(),
detailPicture.getOriginalFilename());
if(ResultEntity.SUCCESS.equals(uploadDetailPictureResultEntity.getResult())){
String detailPicPath = uploadHeaderPicResultEntity.getData();
detailPicPathList.add(detailPicPath);
}else{
model.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, CrowdConstant.MESSAGE_DETAIL_PIC_UPLOAD_FAILED);
return "project-launch";
}
}
// 上传结果
projectVO.setDetailPicturePathList(detailPicPathList);
// 表单信息存储到session
session.setAttribute(CrowdConstant.ATTR_NAME_TEMPLE_PROJECT, projectVO);
// 返回
return "redirect:http://www.xmlcrowd.com:8080/project/return/info/page";
}
@ResponseBody
@RequestMapping("/create/upload/return/picture.json")
public ResultEntity<String> uploadReturnPicture(
@RequestParam("returnPicture") MultipartFile returnPicture
) throws IOException {
// 1.执行文件上传
ResultEntity<String> uploadReturnPicResultEntity = CrowdUtil.uploadFileToOss(
ossProperties.getEndPoint(),
ossProperties.getAccessKeyId(),
ossProperties.getAccessKeySecret(),
returnPicture.getInputStream(),
ossProperties.getBucketName(),
ossProperties.getBucketDomain(),
returnPicture.getOriginalFilename());
// 2.返回上传的结果
return uploadReturnPicResultEntity;
}
@ResponseBody
@RequestMapping("/create/save/return.json")
public ResultEntity<String> saveRetrun(
ReturnVO returnVO,
HttpSession session
){
try {
// 取出session中的Project
ProjectVO projectVo =(ProjectVO) session.getAttribute(CrowdConstant.ATTR_NAME_TEMPLE_PROJECT);
if(projectVo == null){
return ResultEntity.failed(CrowdConstant.MESSAGE_TEMPLE_PROJECT_MISSING);
}
// project中的return对象判空,并初始化
List<ReturnVO> returnVOList = projectVo.getReturnVOList();
if(returnVOList == null || returnVOList.size() == 0){
returnVOList = new ArrayList<ReturnVO>();
projectVo.setReturnVOList(returnVOList);
}
returnVOList.add(returnVO);
// 再存回seeion
session.setAttribute(CrowdConstant.ATTR_NAME_TEMPLE_PROJECT, projectVo);
return ResultEntity.successWithoutData();
} catch (Exception e) {
e.printStackTrace();
return ResultEntity.failed(e.getMessage());
}
}
@RequestMapping("/create/confirm")
public String saveConfirm(
ModelMap modelMap,
HttpSession session,
MemberConfirmInfoVO memberConfirmInfoVO
){
ProjectVO projectVo =(ProjectVO) session.getAttribute(CrowdConstant.ATTR_NAME_TEMPLE_PROJECT);
if(projectVo == null){
throw new RuntimeException(CrowdConstant.MESSAGE_TEMPLE_PROJECT_MISSING);
}
projectVo.setMemberConfirmInfoVO(memberConfirmInfoVO);
MemberLoginVO memberLoginVO = (MemberLoginVO)session.getAttribute(CrowdConstant.ATTR_NAME_LOGIN_MEMBER);
Integer memberId = memberLoginVO.getId();
ResultEntity<String> saveResultEntity = mySQLRemoteService.saveProjectVoRemote(projectVo, memberId);
String result = saveResultEntity.getResult();
if(ResultEntity.FAILED.equals(result)){
modelMap.addAttribute(CrowdConstant.ATTR_NAME_MESSAGE, saveResultEntity.getMessage());
return "project-confirm";
}
// 8.如果远程保存成功则跳转到最终完成页面
return "redirect:http://www.xmlcrowd.com:8080/project/create/success";
}
@RequestMapping("/get/project/detail/{projectId}")
public String getProjectDetail(
@PathVariable("projectId") Integer projectId,
Model model
){
ResultEntity<DetailProjectVO> resultEntity = mySQLRemoteService.getDetailProjectVORemote(projectId);
if(ResultEntity.SUCCESS.equals(resultEntity.getResult())) {
DetailProjectVO detailProjectVO = resultEntity.getData();
model.addAttribute("detailProjectVO", detailProjectVO);
}
return "project-show-detail";
}
} | 8,991 | 0.653131 | 0.650279 | 230 | 37.121738 | 28.381147 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.508696 | false | false | 9 |
7a6a79aab8b4c8a9362e4548e3e096d32a8f3524 | 22,780,506,605,129 | a13d9e921736224f10334f5b2e87969f66050a32 | /bPortals/src/uk/codingbadgers/bportals/utils/LocationUtils.java | a3adabedbef3cae9bc417a1d028844980c0ded01 | [] | no_license | devBuzzy/bFundamentals | https://github.com/devBuzzy/bFundamentals | c1328dc6fdfb872fd50ec1e4d847cc8f3f8fc3e9 | 40135725dc4074c8fc370876c09fee02426a75a1 | refs/heads/master | 2021-05-27T05:51:29.345000 | 2014-04-18T07:39:44 | 2014-04-18T07:40:06 | 30,706,089 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* bPortals 1.2-SNAPSHOT
* Copyright (C) 2013 CodingBadgers <plugins@mcbadgercraft.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package uk.codingbadgers.bportals.utils;
import org.bukkit.Location;
import static org.bukkit.util.NumberConversions.*;
import com.sk89q.worldedit.Vector;
public class LocationUtils {
public static Vector convertLocationToVector(Location loc) {
return new Vector(loc.getX(), loc.getY(), loc.getZ());
}
public static Vector convertLocationToFloorVector(Location loc) {
return new Vector(floor(loc.getX()), floor(loc.getY()), floor(loc.getZ()));
}
public static Vector convertLocationToCeilVector(Location loc) {
return new Vector(ceil(loc.getX()), ceil(loc.getY()), ceil(loc.getZ()));
}
}
| UTF-8 | Java | 1,357 | java | LocationUtils.java | Java | [
{
"context": "**\n * bPortals 1.2-SNAPSHOT\n * Copyright (C) 2013 CodingBadgers <plugins@mcbadgercraft.com>\n *\n * This program is",
"end": 65,
"score": 0.9981115460395813,
"start": 52,
"tag": "USERNAME",
"value": "CodingBadgers"
},
{
"context": ".2-SNAPSHOT\n * Copyright (C) 2013 ... | null | [] | /**
* bPortals 1.2-SNAPSHOT
* Copyright (C) 2013 CodingBadgers <<EMAIL>>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package uk.codingbadgers.bportals.utils;
import org.bukkit.Location;
import static org.bukkit.util.NumberConversions.*;
import com.sk89q.worldedit.Vector;
public class LocationUtils {
public static Vector convertLocationToVector(Location loc) {
return new Vector(loc.getX(), loc.getY(), loc.getZ());
}
public static Vector convertLocationToFloorVector(Location loc) {
return new Vector(floor(loc.getX()), floor(loc.getY()), floor(loc.getZ()));
}
public static Vector convertLocationToCeilVector(Location loc) {
return new Vector(ceil(loc.getX()), ceil(loc.getY()), ceil(loc.getZ()));
}
}
| 1,339 | 0.742078 | 0.735446 | 38 | 34.657894 | 29.704046 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.842105 | false | false | 9 |
b25f7661cea57e0022bea90c3063c7a696c93221 | 25,847,113,215,876 | 7ab71faef838d79eee7e79cb94f6b4abd6c540fb | /app/src/main/java/floturner/dev/corp/imovie/adapter/MovieAdapter.java | 160646b730537bd1efe7a082ab0798f57575d36b | [] | no_license | Floturner/imovies-android-app | https://github.com/Floturner/imovies-android-app | 08aa4cacb0f7a3fde255735b234aefc47d7e79f1 | ffd2289995423c87efff8d70140631bc68a524d0 | refs/heads/master | 2023-02-15T21:52:04.536000 | 2021-01-12T11:55:31 | 2021-01-12T11:55:31 | 328,971,751 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package floturner.dev.corp.imovie.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.text.ParseException;
import java.util.List;
import floturner.dev.corp.imovie.R;
import floturner.dev.corp.imovie.callbacks.OnMoviesClickCallback;
import floturner.dev.corp.imovie.models.Movie;
import floturner.dev.corp.imovie.server.APIClient;
import floturner.dev.corp.imovie.utils.Utils;
public class MovieAdapter extends RecyclerView.Adapter<MovieAdapter.MovieViewHolder> {
private final List<Movie> movies;
private final OnMoviesClickCallback onMoviesClickCallback;
public MovieAdapter(List<Movie> movies, OnMoviesClickCallback onMoviesClickCallback) {
this.movies = movies;
this.onMoviesClickCallback = onMoviesClickCallback;
}
@NonNull
@Override
public MovieViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_movie, viewGroup, false);
return new MovieViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull MovieViewHolder movieViewHolder, int i) {
try {
movieViewHolder.bind(movies.get(i));
} catch (ParseException e) {
e.printStackTrace();
}
}
@Override
public int getItemCount() {
return movies.size();
}
public void appendMovies(List<Movie> moviesToAppend) {
movies.addAll(moviesToAppend);
notifyDataSetChanged();
}
public void clearMovies() {
movies.clear();
notifyDataSetChanged();
}
class MovieViewHolder extends RecyclerView.ViewHolder {
Movie movie;
TextView releaseDate, title, rating, overview;
ImageView poster;
MovieViewHolder(View itemView) {
super(itemView);
releaseDate = itemView.findViewById(R.id.item_movie_release_date);
title = itemView.findViewById(R.id.item_movie_title);
rating = itemView.findViewById(R.id.item_movie_rating);
overview = itemView.findViewById(R.id.item_movie_overview);
poster = itemView.findViewById(R.id.item_movie_poster);
itemView.setOnClickListener(v -> onMoviesClickCallback.onClick(movie));
}
void bind(Movie movie) throws ParseException {
this.movie = movie;
releaseDate.setText(itemView.getResources().getString(R.string.release_date_text, Utils.formateDateString(movie.getReleaseDate())));
title.setText(movie.getTitle());
rating.setText(String.valueOf(movie.getRating()));
overview.setText(movie.getOverview());
Glide.with(itemView)
.load(APIClient.IMAGE_BASE_URL + movie.getPosterPath())
.placeholder(R.drawable.ic_placeholder)
.error(R.drawable.ic_error)
.into(poster);
}
}
}
| UTF-8 | Java | 3,181 | java | MovieAdapter.java | Java | [] | null | [] | package floturner.dev.corp.imovie.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import java.text.ParseException;
import java.util.List;
import floturner.dev.corp.imovie.R;
import floturner.dev.corp.imovie.callbacks.OnMoviesClickCallback;
import floturner.dev.corp.imovie.models.Movie;
import floturner.dev.corp.imovie.server.APIClient;
import floturner.dev.corp.imovie.utils.Utils;
public class MovieAdapter extends RecyclerView.Adapter<MovieAdapter.MovieViewHolder> {
private final List<Movie> movies;
private final OnMoviesClickCallback onMoviesClickCallback;
public MovieAdapter(List<Movie> movies, OnMoviesClickCallback onMoviesClickCallback) {
this.movies = movies;
this.onMoviesClickCallback = onMoviesClickCallback;
}
@NonNull
@Override
public MovieViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_movie, viewGroup, false);
return new MovieViewHolder(v);
}
@Override
public void onBindViewHolder(@NonNull MovieViewHolder movieViewHolder, int i) {
try {
movieViewHolder.bind(movies.get(i));
} catch (ParseException e) {
e.printStackTrace();
}
}
@Override
public int getItemCount() {
return movies.size();
}
public void appendMovies(List<Movie> moviesToAppend) {
movies.addAll(moviesToAppend);
notifyDataSetChanged();
}
public void clearMovies() {
movies.clear();
notifyDataSetChanged();
}
class MovieViewHolder extends RecyclerView.ViewHolder {
Movie movie;
TextView releaseDate, title, rating, overview;
ImageView poster;
MovieViewHolder(View itemView) {
super(itemView);
releaseDate = itemView.findViewById(R.id.item_movie_release_date);
title = itemView.findViewById(R.id.item_movie_title);
rating = itemView.findViewById(R.id.item_movie_rating);
overview = itemView.findViewById(R.id.item_movie_overview);
poster = itemView.findViewById(R.id.item_movie_poster);
itemView.setOnClickListener(v -> onMoviesClickCallback.onClick(movie));
}
void bind(Movie movie) throws ParseException {
this.movie = movie;
releaseDate.setText(itemView.getResources().getString(R.string.release_date_text, Utils.formateDateString(movie.getReleaseDate())));
title.setText(movie.getTitle());
rating.setText(String.valueOf(movie.getRating()));
overview.setText(movie.getOverview());
Glide.with(itemView)
.load(APIClient.IMAGE_BASE_URL + movie.getPosterPath())
.placeholder(R.drawable.ic_placeholder)
.error(R.drawable.ic_error)
.into(poster);
}
}
}
| 3,181 | 0.67966 | 0.67966 | 95 | 32.484211 | 28.997591 | 144 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.568421 | false | false | 9 |
719a5d9dcbe5790e3ae32998cdf76d78cdc9b3b8 | 12,326,556,183,308 | 4097b11c6c7ea9743888a7478a5b6632779e44ec | /app/src/main/java/devgam/vansit/favourite.java | 3148581b259dce55ab6321d8410931a66877c8da | [] | no_license | FlavaSava7/Vansit | https://github.com/FlavaSava7/Vansit | ba2bc67f3de235369d412c633ec01e0382e9edd2 | 5b24c01822ebe34ec59c064abb575619e6276cf0 | refs/heads/master | 2022-12-23T02:17:13.017000 | 2017-06-15T04:40:40 | 2017-06-15T04:40:40 | 82,573,379 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package devgam.vansit;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;
import devgam.vansit.JSON_Classes.Favourite;
import devgam.vansit.JSON_Classes.Offers;
import devgam.vansit.JSON_Classes.Users;
import static devgam.vansit.Util.makeToast;
public class favourite extends Fragment {
private ListView myFavouriteList;
private ArrayAdapter myFavouriteAdapter;
private ArrayList<Offers> myFavouritsOffers;
private ArrayList<Favourite> myFavourits;//hold our favourites keys
ProgressDialog progressDialog;
FragmentManager fragmentManager;// this is used for the ChangeFrag method
TextView noFav;
public favourite() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_favourite, container, false);
}
@Override
public void onResume() {
super.onResume();
Util.ChangePageTitle(getActivity(),R.string.menu_fav_text);
noFav = (TextView) getActivity().findViewById(R.id.favorite_nofav);
myFavouriteList = (ListView) getActivity().findViewById(R.id.favorite_listview);
DatabaseReference mRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_USERS);
fragmentManager = getActivity().getSupportFragmentManager();
myFavouriteAdapter = new itemsAdapter(getContext(),mRef);
progressDialog = new ProgressDialog(getContext(),ProgressDialog.STYLE_SPINNER);
if(myFavouritsOffers ==null || myFavourits ==null)
{
Util.ProgDialogStarter(progressDialog,getResources().getString(R.string.loading));
myFavouritsOffers = new ArrayList<>();
myFavourits = new ArrayList<>();
SetUpMyFavourites();
}
else
{
myFavouriteList.setAdapter(myFavouriteAdapter);
}
}
/**
* Set Up User Favourites and call setAdapterAndUpdateUserFavourites
*/
private void SetUpMyFavourites()
{
if(!Util.IS_USER_CONNECTED)
{
makeToast(getContext(), String.valueOf(R.string.noInternetMsg));
return;
}
// used later to update User fav
final ArrayList<Favourite> favsToKeep = new ArrayList<>();
final DatabaseReference mRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_FAVOURITE
+"/"+ FirebaseAuth.getInstance().getCurrentUser().getUid());
ValueEventListener QVEL= new ValueEventListener()
{
@Override
public void onDataChange(DataSnapshot dataSnapshot)
{
if(!dataSnapshot.exists())//User does not have any favourites
{
noFav.setVisibility(View.VISIBLE);
Util.ProgDialogDelay(progressDialog,100L);
}else
{
for(DataSnapshot favObj : dataSnapshot.getChildren())
{
Favourite fav = favObj.getValue(Favourite.class);
myFavourits.add(fav);
favsToKeep.add(fav);
}
DatabaseReference mRef2;//just an inner reference
for(int i = 0;i<myFavourits.size();i++)
{
mRef2 = FirebaseDatabase.getInstance().getReference().child(Util.RDB_OFFERS+"/"+
myFavourits.get(i).getOfferKey());
final int finalI = i;//temp reference to use inside the QVEL2
ValueEventListener QVEL2= new ValueEventListener()
{
@Override
public void onDataChange(DataSnapshot dataSnapshot)
{
//this offer is deleted by the Driver,
// So store it inside favsToKeep to update User's fav list.
if(!dataSnapshot.exists())// offer does not exist
{
int indexToDelete=0;// to store the index which we will delete from favsToKeep
for(int innerIndex =0 ;innerIndex<favsToKeep.size();innerIndex++)
{
if(myFavourits.get(finalI).getOfferKey().equals(favsToKeep.get(innerIndex).getOfferKey()))
{
indexToDelete = innerIndex;
break;
}
}
favsToKeep.remove(indexToDelete);
}else// offer exists
{
Offers offer = dataSnapshot.getValue(Offers.class);
offer.setOfferKey(dataSnapshot.getKey());
myFavouritsOffers.add(offer);
}
if((finalI+1)==myFavourits.size())
{
// last iteration: set adapter and update fav list in database
new Handler().postDelayed(new Runnable()
{
@Override
public void run()
{
setAdapterAndUpdateUserFavourites(favsToKeep);
}
},500L);
}
}
@Override
public void onCancelled(DatabaseError databaseError)
{
}
};
mRef2.addListenerForSingleValueEvent(QVEL2);
}
}
}
@Override
public void onCancelled(DatabaseError databaseError)
{
}
};
mRef.addListenerForSingleValueEvent(QVEL);
}
/**
* Set the ListView Adapter and update the User favourites list in the database.
* It's called after we are done fetching all favourites and the favourites that still points to offers.
* @param favsToKeep : the favourites that still points on offers in the database
*/
private void setAdapterAndUpdateUserFavourites(ArrayList<Favourite> favsToKeep)
{
if(!myFavouritsOffers.isEmpty())
myFavouriteList.setAdapter(myFavouriteAdapter);
else // all of this User favs were deleted, delete his list
{
DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_FAVOURITE+"/"+
FirebaseAuth.getInstance().getCurrentUser().getUid());
myRef.removeValue();
}
if(!favsToKeep.isEmpty())
{
DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_FAVOURITE+"/"+
FirebaseAuth.getInstance().getCurrentUser().getUid());
myRef.setValue(favsToKeep);
// so if user want to delete a favourite we can use myFavourites to set the new values in the database
// cuz favsToKeep is local value
myFavourits = favsToKeep;
}
Util.ProgDialogDelay(progressDialog,100L);
}
private class itemsAdapter extends ArrayAdapter<Offers>
{
Context context;
DatabaseReference databaseReference;
itemsAdapter(Context c,DatabaseReference databaseReference) {
super(c, R.layout.fragment_favourite_listview_items, myFavouritsOffers);
this.context = c;
this.databaseReference = databaseReference;
}
@Override
public View getView(final int position, View convertView, final ViewGroup parent) {
final ViewHolder holder = new ViewHolder();
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowItem = inflater.inflate(R.layout.fragment_favourite_listview_items, parent, false);
final Offers tempOffer = myFavouritsOffers.get(position);
holder.Title = (TextView) rowItem.findViewById(R.id.favorite_items_TitleData);
holder.Title.setText(tempOffer.getTitle());
holder.City = (TextView) rowItem.findViewById(R.id.favorite_items_cityData);
holder.City.setText(tempOffer.getCity());
holder.typeIcon = (ImageView) rowItem.findViewById(R.id.favorite_items_typeIcon);
holder.typeIcon.setImageDrawable(Util.getDrawableResource(getActivity(), Util.changeIcon(tempOffer.getType())));
holder.profileText = (Button) rowItem.findViewById(R.id.favorite_items_profile_text);
holder.callText = (Button) rowItem.findViewById(R.id.favorite_items_call_text);
holder.deleteText = (Button) rowItem.findViewById(R.id.favorite_items_delete_text);
Query query = databaseReference.child(tempOffer.getUserID());
ValueEventListener VEL = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot)
{
if(dataSnapshot.getValue(Users.class)!=null)
{
final Users tempUser = dataSnapshot.getValue(Users.class);
tempUser.setUserID(dataSnapshot.getKey());
final String phoneNumber = tempUser.getPhone();
holder.callText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" +phoneNumber));
startActivity(intent);
}
});
final userInformation userIn = new userInformation(getActivity(),tempUser, fragmentManager);
holder.profileText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
userIn.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
userIn.show();
}
});
}
else {
//Log.v("Main:","==null");
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
};
query.addListenerForSingleValueEvent(VEL);
holder.deleteText.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
int indexToDelete =0;
for(int i = 0;i<myFavourits.size();i++)
{
if (myFavourits.get(i).getOfferKey().equals(tempOffer.getOfferKey()))
{
indexToDelete = i;
break;
}
}
myFavourits.remove(indexToDelete);
DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_FAVOURITE+"/"+
FirebaseAuth.getInstance().getCurrentUser().getUid());
myRef.setValue(myFavourits);
myFavouritsOffers.remove(tempOffer);
myFavouriteAdapter.notifyDataSetChanged();
}
});
return rowItem;
}
@Override
public int getCount() {
return myFavouritsOffers.size();
}
@Override
public Offers getItem(int position) {
return myFavouritsOffers.get(position);
}
}
private static class ViewHolder {
// this class is called in getView and assigned it all "items" layouts Views,for smooth scrolling
TextView Title, City;
ImageView typeIcon;
Button profileText, callText, deleteText;
}
}
| UTF-8 | Java | 13,913 | java | favourite.java | Java | [] | null | [] | package devgam.vansit;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;
import java.util.ArrayList;
import java.util.List;
import devgam.vansit.JSON_Classes.Favourite;
import devgam.vansit.JSON_Classes.Offers;
import devgam.vansit.JSON_Classes.Users;
import static devgam.vansit.Util.makeToast;
public class favourite extends Fragment {
private ListView myFavouriteList;
private ArrayAdapter myFavouriteAdapter;
private ArrayList<Offers> myFavouritsOffers;
private ArrayList<Favourite> myFavourits;//hold our favourites keys
ProgressDialog progressDialog;
FragmentManager fragmentManager;// this is used for the ChangeFrag method
TextView noFav;
public favourite() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_favourite, container, false);
}
@Override
public void onResume() {
super.onResume();
Util.ChangePageTitle(getActivity(),R.string.menu_fav_text);
noFav = (TextView) getActivity().findViewById(R.id.favorite_nofav);
myFavouriteList = (ListView) getActivity().findViewById(R.id.favorite_listview);
DatabaseReference mRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_USERS);
fragmentManager = getActivity().getSupportFragmentManager();
myFavouriteAdapter = new itemsAdapter(getContext(),mRef);
progressDialog = new ProgressDialog(getContext(),ProgressDialog.STYLE_SPINNER);
if(myFavouritsOffers ==null || myFavourits ==null)
{
Util.ProgDialogStarter(progressDialog,getResources().getString(R.string.loading));
myFavouritsOffers = new ArrayList<>();
myFavourits = new ArrayList<>();
SetUpMyFavourites();
}
else
{
myFavouriteList.setAdapter(myFavouriteAdapter);
}
}
/**
* Set Up User Favourites and call setAdapterAndUpdateUserFavourites
*/
private void SetUpMyFavourites()
{
if(!Util.IS_USER_CONNECTED)
{
makeToast(getContext(), String.valueOf(R.string.noInternetMsg));
return;
}
// used later to update User fav
final ArrayList<Favourite> favsToKeep = new ArrayList<>();
final DatabaseReference mRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_FAVOURITE
+"/"+ FirebaseAuth.getInstance().getCurrentUser().getUid());
ValueEventListener QVEL= new ValueEventListener()
{
@Override
public void onDataChange(DataSnapshot dataSnapshot)
{
if(!dataSnapshot.exists())//User does not have any favourites
{
noFav.setVisibility(View.VISIBLE);
Util.ProgDialogDelay(progressDialog,100L);
}else
{
for(DataSnapshot favObj : dataSnapshot.getChildren())
{
Favourite fav = favObj.getValue(Favourite.class);
myFavourits.add(fav);
favsToKeep.add(fav);
}
DatabaseReference mRef2;//just an inner reference
for(int i = 0;i<myFavourits.size();i++)
{
mRef2 = FirebaseDatabase.getInstance().getReference().child(Util.RDB_OFFERS+"/"+
myFavourits.get(i).getOfferKey());
final int finalI = i;//temp reference to use inside the QVEL2
ValueEventListener QVEL2= new ValueEventListener()
{
@Override
public void onDataChange(DataSnapshot dataSnapshot)
{
//this offer is deleted by the Driver,
// So store it inside favsToKeep to update User's fav list.
if(!dataSnapshot.exists())// offer does not exist
{
int indexToDelete=0;// to store the index which we will delete from favsToKeep
for(int innerIndex =0 ;innerIndex<favsToKeep.size();innerIndex++)
{
if(myFavourits.get(finalI).getOfferKey().equals(favsToKeep.get(innerIndex).getOfferKey()))
{
indexToDelete = innerIndex;
break;
}
}
favsToKeep.remove(indexToDelete);
}else// offer exists
{
Offers offer = dataSnapshot.getValue(Offers.class);
offer.setOfferKey(dataSnapshot.getKey());
myFavouritsOffers.add(offer);
}
if((finalI+1)==myFavourits.size())
{
// last iteration: set adapter and update fav list in database
new Handler().postDelayed(new Runnable()
{
@Override
public void run()
{
setAdapterAndUpdateUserFavourites(favsToKeep);
}
},500L);
}
}
@Override
public void onCancelled(DatabaseError databaseError)
{
}
};
mRef2.addListenerForSingleValueEvent(QVEL2);
}
}
}
@Override
public void onCancelled(DatabaseError databaseError)
{
}
};
mRef.addListenerForSingleValueEvent(QVEL);
}
/**
* Set the ListView Adapter and update the User favourites list in the database.
* It's called after we are done fetching all favourites and the favourites that still points to offers.
* @param favsToKeep : the favourites that still points on offers in the database
*/
private void setAdapterAndUpdateUserFavourites(ArrayList<Favourite> favsToKeep)
{
if(!myFavouritsOffers.isEmpty())
myFavouriteList.setAdapter(myFavouriteAdapter);
else // all of this User favs were deleted, delete his list
{
DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_FAVOURITE+"/"+
FirebaseAuth.getInstance().getCurrentUser().getUid());
myRef.removeValue();
}
if(!favsToKeep.isEmpty())
{
DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_FAVOURITE+"/"+
FirebaseAuth.getInstance().getCurrentUser().getUid());
myRef.setValue(favsToKeep);
// so if user want to delete a favourite we can use myFavourites to set the new values in the database
// cuz favsToKeep is local value
myFavourits = favsToKeep;
}
Util.ProgDialogDelay(progressDialog,100L);
}
private class itemsAdapter extends ArrayAdapter<Offers>
{
Context context;
DatabaseReference databaseReference;
itemsAdapter(Context c,DatabaseReference databaseReference) {
super(c, R.layout.fragment_favourite_listview_items, myFavouritsOffers);
this.context = c;
this.databaseReference = databaseReference;
}
@Override
public View getView(final int position, View convertView, final ViewGroup parent) {
final ViewHolder holder = new ViewHolder();
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View rowItem = inflater.inflate(R.layout.fragment_favourite_listview_items, parent, false);
final Offers tempOffer = myFavouritsOffers.get(position);
holder.Title = (TextView) rowItem.findViewById(R.id.favorite_items_TitleData);
holder.Title.setText(tempOffer.getTitle());
holder.City = (TextView) rowItem.findViewById(R.id.favorite_items_cityData);
holder.City.setText(tempOffer.getCity());
holder.typeIcon = (ImageView) rowItem.findViewById(R.id.favorite_items_typeIcon);
holder.typeIcon.setImageDrawable(Util.getDrawableResource(getActivity(), Util.changeIcon(tempOffer.getType())));
holder.profileText = (Button) rowItem.findViewById(R.id.favorite_items_profile_text);
holder.callText = (Button) rowItem.findViewById(R.id.favorite_items_call_text);
holder.deleteText = (Button) rowItem.findViewById(R.id.favorite_items_delete_text);
Query query = databaseReference.child(tempOffer.getUserID());
ValueEventListener VEL = new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot)
{
if(dataSnapshot.getValue(Users.class)!=null)
{
final Users tempUser = dataSnapshot.getValue(Users.class);
tempUser.setUserID(dataSnapshot.getKey());
final String phoneNumber = tempUser.getPhone();
holder.callText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" +phoneNumber));
startActivity(intent);
}
});
final userInformation userIn = new userInformation(getActivity(),tempUser, fragmentManager);
holder.profileText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
userIn.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
userIn.show();
}
});
}
else {
//Log.v("Main:","==null");
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
};
query.addListenerForSingleValueEvent(VEL);
holder.deleteText.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
int indexToDelete =0;
for(int i = 0;i<myFavourits.size();i++)
{
if (myFavourits.get(i).getOfferKey().equals(tempOffer.getOfferKey()))
{
indexToDelete = i;
break;
}
}
myFavourits.remove(indexToDelete);
DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child(Util.RDB_FAVOURITE+"/"+
FirebaseAuth.getInstance().getCurrentUser().getUid());
myRef.setValue(myFavourits);
myFavouritsOffers.remove(tempOffer);
myFavouriteAdapter.notifyDataSetChanged();
}
});
return rowItem;
}
@Override
public int getCount() {
return myFavouritsOffers.size();
}
@Override
public Offers getItem(int position) {
return myFavouritsOffers.get(position);
}
}
private static class ViewHolder {
// this class is called in getView and assigned it all "items" layouts Views,for smooth scrolling
TextView Title, City;
ImageView typeIcon;
Button profileText, callText, deleteText;
}
}
| 13,913 | 0.549055 | 0.547402 | 339 | 40.041298 | 31.977289 | 130 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.501475 | false | false | 9 |
3700679b0016207c48dab04d006f5f37fad4c700 | 1,185,411,035,395 | cf267adb6bcdc78f13e0526760c7e05ef87d9286 | /src/main/java/com/colasoft/tip/network/recon/utils/HttpPostUtil.java | 33521e75a536c87e8af7f91ef9579af6c9a538c6 | [] | no_license | 18121861183/network_recon_system | https://github.com/18121861183/network_recon_system | 7d8f32af4ff921ea05449ae5e1ae5db6606db73d | 4fd48a0cc118c565f7fcb406c4e80c1ada0a668f | refs/heads/master | 2022-12-06T21:56:23.509000 | 2020-08-28T08:11:12 | 2020-08-28T08:11:12 | 290,987,512 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.colasoft.tip.network.recon.utils;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.zip.GZIPInputStream;
public class HttpPostUtil {
private int timeout;
private URL url;
private HttpURLConnection conn;
private String boundary = "--------" + StringUtils.getUUID32();
private HashMap<String, String> textParams = new HashMap<>();
private HashMap<String, File> fileparams = new HashMap<>();
private DataOutputStream outputStream;
private String method = "POST";
private boolean isFormData = true;
public HttpPostUtil(String url) throws Exception {
this(url,"POST",30*1000);
}
public HttpPostUtil(String url, int timeout) throws Exception {
this(url,"POST",timeout);
}
public HttpPostUtil(String url,String method, int timeout) {
this(url,method,"post".equalsIgnoreCase(method),timeout, null);
}
public HttpPostUtil(String url,String method,boolean isFormData, int timeout,Map<String,String> headerMap) {
try {
this.isFormData = isFormData;
this.url = new URL(url);
this.timeout = timeout;
this.method = method;
initConnection(headerMap);
conn.connect();
if("GET".equals(method)){
return ;
}
outputStream = new DataOutputStream(conn.getOutputStream());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 重新设置要请求的服务器地址,即上传文件的地址。
*
* @param url
* @throws Exception
*/
public void setUrl(String url) throws Exception {
this.url = new URL(url);
}
/**
* 增加一个普通字符串数据到form表单数据中
*
* @param name
* @param value
*/
public void addParameter(String name, String value) {
textParams.put(name, value);
}
/**
* 增加一个文件到form表单数据中
*
* @param name
* @param value
*/
public void addParameter(String name, File value) {
fileparams.put(name, value);
}
/**
* 增加一个文件到form表单数据中
*
* @param fieldName
* @param value
* @throws Exception
*/
public void addParameter(String fieldName, byte[] value, String filename) throws Exception {
outputStream.writeBytes("--" + boundary + "\r\n");
outputStream.write(("Content-Disposition: form-data; name=\"" + fieldName + "\"; filename=\"" + filename + "\"\r\n").getBytes("utf-8"));
outputStream.writeBytes("Content-Type: " + "application/octet-stream" + "\r\n");
outputStream.writeBytes("\r\n");
outputStream.write(value);
outputStream.writeBytes("\r\n");
}
/**
* 发送数据到服务器,返回一个字节包含服务器的返回结果的数组
*
* @return
* @throws Exception
*/
/**
* 发送数据到服务器,返回一个字节包含服务器的返回结果的数组
*
* @return
* @throws Exception
*/
public String send() {
int code = 0;
InputStream in = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
String response = "";
try{
in = sendRcStream();
code = conn.getResponseCode();
if (code > 300 || code < 200) {
response = "responseCode: " + code + "\r\n; responseInfo: ";
}
byte[] buf = new byte[1024 * 8];
int len;
while ((len = in.read(buf)) != -1) {
out.write(buf, 0, len);
}
response += new String(out.toByteArray(), "UTF-8");
response = URLDecoder.decode(response, "UTF-8");
}catch (Exception e){
e.printStackTrace();
}finally {
conn.disconnect();
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return response;
}
/**
* 发送数据到服务器,返回一个字节包含服务器的返回结果的数组
*
* @return
* @throws Exception
*/
public InputStream sendRcStream() throws Exception {
writeFileParams();
writeStringParams();
paramsEnd();
InputStream in = null;
String contentEncoding = getHeader("Content-Encoding");
boolean isZip = "gzip".equals(contentEncoding);
try {
if(isZip){
in = new GZIPInputStream(conn.getInputStream());
}else{
in = conn.getInputStream();
}
} catch (Exception e) {
if(isZip){
in = new GZIPInputStream(conn.getErrorStream());
}else{
in = conn.getErrorStream();
}
}
return in;
}
public String getHeader(String key){
return conn.getHeaderField(key);
}
public Map<String,List<String>> getHeaderMap(){
return conn.getHeaderFields();
}
public int getResponseCode(){
try {
return conn.getResponseCode();
} catch (IOException e) {
e.printStackTrace();
}
return -1;
}
/**
* 文件上传的connection的一些必须设置
*
* @throws Exception
*/
private void initConnection(Map<String,String> headerMap) throws Exception {
trustAllHttpsCertificates();
HostnameVerifier hv = (urlHostName, session) -> true;
HttpsURLConnection.setDefaultHostnameVerifier(hv);
conn = (HttpURLConnection) this.url.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setConnectTimeout(timeout); // 连接超时为10秒
conn.setRequestProperty("Charsert", "UTF-8");
if("POST".equalsIgnoreCase(method)){
conn.setRequestMethod("POST");
if(isFormData){
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
}else{
conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
}
}else{
conn.setRequestMethod(method);
}
if(headerMap != null && !headerMap.isEmpty()){
for(String key : headerMap.keySet()){
if(headerMap.get(key) == null){
continue;
}
conn.setRequestProperty(key, headerMap.get(key));
}
}
}
private static void trustAllHttpsCertificates() throws Exception {
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1];
javax.net.ssl.TrustManager tm = new miTM();
trustAllCerts[0] = tm;
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, null);
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
}
/**
* 普通字符串数据
*
* @throws Exception
*/
private void writeStringParams() throws Exception {
if("GET".equals(method)){
return ;
}
Set<String> keySet = textParams.keySet();
if(isFormData){
for (Iterator<String> it = keySet.iterator(); it.hasNext(); ) {
String name = it.next();
String value = textParams.get(name);
outputStream.writeBytes("--" + boundary + "\r\n");
outputStream.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"\r\n");
outputStream.writeBytes("\r\n");
outputStream.write(value.getBytes(StandardCharsets.UTF_8));
outputStream.writeBytes("\r\n");
}
}else {
StringBuilder sb = new StringBuilder();
for (String key : textParams.keySet()) {
sb.append(key).append("=").append(URLEncoder.encode(textParams.get(key), "UTF-8")).append("&");
}
if(sb.length() > 0){
sb.deleteCharAt(sb.length()-1);
}
outputStream.writeBytes(sb.toString());
}
}
/**
* 文件数据
*
* @throws Exception
*/
private void writeFileParams() throws Exception {
if("GET".equals(method)){
return ;
}
Set<String> keySet = fileparams.keySet();
for (Iterator<String> it = keySet.iterator(); it.hasNext(); ) {
String name = it.next();
File value = fileparams.get(name);
outputStream.writeBytes("--" + boundary + "\r\n");
outputStream.write(("Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + value.getName() + "\"\r\n").getBytes("UTF-8"));
outputStream.writeBytes("Content-Type: " + getContentType(value) + "\r\n");
outputStream.writeBytes("\r\n");
outputStream.write(getBytes(value));
outputStream.writeBytes("\r\n");
}
}
/**
* 获取文件的上传类型,图片格式为image/png,image/jpeg等。非图片为application /octet-stream
*
* @param f
* @return
* @throws Exception
*/
private String getContentType(File f) throws Exception {
return "application/octet-stream";
}
/**
* 把文件转换成字节数组
*
* @param f
* @return
* @throws Exception
*/
private byte[] getBytes(File f) throws Exception {
FileInputStream in = new FileInputStream(f);
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] b = new byte[1024];
int n;
while ((n = in.read(b)) != -1) {
out.write(b, 0, n);
}
in.close();
return out.toByteArray();
}
/**
* 添加结尾数据
*
* @throws Exception
*/
private void paramsEnd() throws Exception {
if("GET".equals(method)){
return ;
}
if(isFormData){
outputStream.writeBytes("--" + boundary + "--" + "\r\n");
outputStream.writeBytes("\r\n");
outputStream.flush();
}
}
/**
* 对包含中文的字符串进行转码,此为UTF-8。服务器那边要进行一次解码
*
* @param value
* @return
* @throws Exception
*/
private String encode(String value) throws Exception {
return URLEncoder.encode(value, "UTF-8");
}
static class miTM implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public boolean isServerTrusted(java.security.cert.X509Certificate[] certs) {
return true;
}
public boolean isClientTrusted(java.security.cert.X509Certificate[] certs) {
return true;
}
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType)
throws java.security.cert.CertificateException {
return;
}
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType)
throws java.security.cert.CertificateException {
return;
}
}
} | UTF-8 | Java | 12,096 | java | HttpPostUtil.java | Java | [] | null | [] | package com.colasoft.tip.network.recon.utils;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.zip.GZIPInputStream;
public class HttpPostUtil {
private int timeout;
private URL url;
private HttpURLConnection conn;
private String boundary = "--------" + StringUtils.getUUID32();
private HashMap<String, String> textParams = new HashMap<>();
private HashMap<String, File> fileparams = new HashMap<>();
private DataOutputStream outputStream;
private String method = "POST";
private boolean isFormData = true;
public HttpPostUtil(String url) throws Exception {
this(url,"POST",30*1000);
}
public HttpPostUtil(String url, int timeout) throws Exception {
this(url,"POST",timeout);
}
public HttpPostUtil(String url,String method, int timeout) {
this(url,method,"post".equalsIgnoreCase(method),timeout, null);
}
public HttpPostUtil(String url,String method,boolean isFormData, int timeout,Map<String,String> headerMap) {
try {
this.isFormData = isFormData;
this.url = new URL(url);
this.timeout = timeout;
this.method = method;
initConnection(headerMap);
conn.connect();
if("GET".equals(method)){
return ;
}
outputStream = new DataOutputStream(conn.getOutputStream());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 重新设置要请求的服务器地址,即上传文件的地址。
*
* @param url
* @throws Exception
*/
public void setUrl(String url) throws Exception {
this.url = new URL(url);
}
/**
* 增加一个普通字符串数据到form表单数据中
*
* @param name
* @param value
*/
public void addParameter(String name, String value) {
textParams.put(name, value);
}
/**
* 增加一个文件到form表单数据中
*
* @param name
* @param value
*/
public void addParameter(String name, File value) {
fileparams.put(name, value);
}
/**
* 增加一个文件到form表单数据中
*
* @param fieldName
* @param value
* @throws Exception
*/
public void addParameter(String fieldName, byte[] value, String filename) throws Exception {
outputStream.writeBytes("--" + boundary + "\r\n");
outputStream.write(("Content-Disposition: form-data; name=\"" + fieldName + "\"; filename=\"" + filename + "\"\r\n").getBytes("utf-8"));
outputStream.writeBytes("Content-Type: " + "application/octet-stream" + "\r\n");
outputStream.writeBytes("\r\n");
outputStream.write(value);
outputStream.writeBytes("\r\n");
}
/**
* 发送数据到服务器,返回一个字节包含服务器的返回结果的数组
*
* @return
* @throws Exception
*/
/**
* 发送数据到服务器,返回一个字节包含服务器的返回结果的数组
*
* @return
* @throws Exception
*/
public String send() {
int code = 0;
InputStream in = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
String response = "";
try{
in = sendRcStream();
code = conn.getResponseCode();
if (code > 300 || code < 200) {
response = "responseCode: " + code + "\r\n; responseInfo: ";
}
byte[] buf = new byte[1024 * 8];
int len;
while ((len = in.read(buf)) != -1) {
out.write(buf, 0, len);
}
response += new String(out.toByteArray(), "UTF-8");
response = URLDecoder.decode(response, "UTF-8");
}catch (Exception e){
e.printStackTrace();
}finally {
conn.disconnect();
try {
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return response;
}
/**
* 发送数据到服务器,返回一个字节包含服务器的返回结果的数组
*
* @return
* @throws Exception
*/
public InputStream sendRcStream() throws Exception {
writeFileParams();
writeStringParams();
paramsEnd();
InputStream in = null;
String contentEncoding = getHeader("Content-Encoding");
boolean isZip = "gzip".equals(contentEncoding);
try {
if(isZip){
in = new GZIPInputStream(conn.getInputStream());
}else{
in = conn.getInputStream();
}
} catch (Exception e) {
if(isZip){
in = new GZIPInputStream(conn.getErrorStream());
}else{
in = conn.getErrorStream();
}
}
return in;
}
public String getHeader(String key){
return conn.getHeaderField(key);
}
public Map<String,List<String>> getHeaderMap(){
return conn.getHeaderFields();
}
public int getResponseCode(){
try {
return conn.getResponseCode();
} catch (IOException e) {
e.printStackTrace();
}
return -1;
}
/**
* 文件上传的connection的一些必须设置
*
* @throws Exception
*/
private void initConnection(Map<String,String> headerMap) throws Exception {
trustAllHttpsCertificates();
HostnameVerifier hv = (urlHostName, session) -> true;
HttpsURLConnection.setDefaultHostnameVerifier(hv);
conn = (HttpURLConnection) this.url.openConnection();
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setConnectTimeout(timeout); // 连接超时为10秒
conn.setRequestProperty("Charsert", "UTF-8");
if("POST".equalsIgnoreCase(method)){
conn.setRequestMethod("POST");
if(isFormData){
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
}else{
conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
}
}else{
conn.setRequestMethod(method);
}
if(headerMap != null && !headerMap.isEmpty()){
for(String key : headerMap.keySet()){
if(headerMap.get(key) == null){
continue;
}
conn.setRequestProperty(key, headerMap.get(key));
}
}
}
private static void trustAllHttpsCertificates() throws Exception {
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[1];
javax.net.ssl.TrustManager tm = new miTM();
trustAllCerts[0] = tm;
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, null);
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
}
/**
* 普通字符串数据
*
* @throws Exception
*/
private void writeStringParams() throws Exception {
if("GET".equals(method)){
return ;
}
Set<String> keySet = textParams.keySet();
if(isFormData){
for (Iterator<String> it = keySet.iterator(); it.hasNext(); ) {
String name = it.next();
String value = textParams.get(name);
outputStream.writeBytes("--" + boundary + "\r\n");
outputStream.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"\r\n");
outputStream.writeBytes("\r\n");
outputStream.write(value.getBytes(StandardCharsets.UTF_8));
outputStream.writeBytes("\r\n");
}
}else {
StringBuilder sb = new StringBuilder();
for (String key : textParams.keySet()) {
sb.append(key).append("=").append(URLEncoder.encode(textParams.get(key), "UTF-8")).append("&");
}
if(sb.length() > 0){
sb.deleteCharAt(sb.length()-1);
}
outputStream.writeBytes(sb.toString());
}
}
/**
* 文件数据
*
* @throws Exception
*/
private void writeFileParams() throws Exception {
if("GET".equals(method)){
return ;
}
Set<String> keySet = fileparams.keySet();
for (Iterator<String> it = keySet.iterator(); it.hasNext(); ) {
String name = it.next();
File value = fileparams.get(name);
outputStream.writeBytes("--" + boundary + "\r\n");
outputStream.write(("Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + value.getName() + "\"\r\n").getBytes("UTF-8"));
outputStream.writeBytes("Content-Type: " + getContentType(value) + "\r\n");
outputStream.writeBytes("\r\n");
outputStream.write(getBytes(value));
outputStream.writeBytes("\r\n");
}
}
/**
* 获取文件的上传类型,图片格式为image/png,image/jpeg等。非图片为application /octet-stream
*
* @param f
* @return
* @throws Exception
*/
private String getContentType(File f) throws Exception {
return "application/octet-stream";
}
/**
* 把文件转换成字节数组
*
* @param f
* @return
* @throws Exception
*/
private byte[] getBytes(File f) throws Exception {
FileInputStream in = new FileInputStream(f);
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] b = new byte[1024];
int n;
while ((n = in.read(b)) != -1) {
out.write(b, 0, n);
}
in.close();
return out.toByteArray();
}
/**
* 添加结尾数据
*
* @throws Exception
*/
private void paramsEnd() throws Exception {
if("GET".equals(method)){
return ;
}
if(isFormData){
outputStream.writeBytes("--" + boundary + "--" + "\r\n");
outputStream.writeBytes("\r\n");
outputStream.flush();
}
}
/**
* 对包含中文的字符串进行转码,此为UTF-8。服务器那边要进行一次解码
*
* @param value
* @return
* @throws Exception
*/
private String encode(String value) throws Exception {
return URLEncoder.encode(value, "UTF-8");
}
static class miTM implements javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public boolean isServerTrusted(java.security.cert.X509Certificate[] certs) {
return true;
}
public boolean isClientTrusted(java.security.cert.X509Certificate[] certs) {
return true;
}
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType)
throws java.security.cert.CertificateException {
return;
}
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType)
throws java.security.cert.CertificateException {
return;
}
}
} | 12,096 | 0.539276 | 0.533936 | 376 | 28.882978 | 25.73757 | 150 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.515957 | false | false | 9 |
9d1c444d1cb6aade066a3b42bf2c6d533f6fe18b | 17,128,329,579,241 | 75d85ca84d985abe0f64cc9189a406d761f6ca74 | /src/com/morehuan/morehuan/dao/NewsSDDao.java | 0a5ade05734b4010301cc61ffb72a9a5a8d90b97 | [] | no_license | sunwuhan/morehuan | https://github.com/sunwuhan/morehuan | 9703aa52a37d35f2c1836b34e30929572d9b8bb5 | 14c24e0c771a81ebdc9053c8c2e50338af9f3255 | refs/heads/master | 2018-01-07T03:25:04.555000 | 2015-06-16T02:13:44 | 2015-06-16T02:13:44 | 33,589,397 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.morehuan.morehuan.dao;
import android.content.Context;
import android.database.sqlite.SQLiteOpenHelper;
import com.ab.db.orm.dao.AbDBDaoImpl;
import com.morehuan.morehuan.bean.News;
import com.morehuan.morehuan.bean.Thing;
import com.morehuan.morehuan.db.DBSDHelper;
public class NewsSDDao extends AbDBDaoImpl<News> {
public NewsSDDao(Context context) {
super(new DBSDHelper(context),News.class);
}
}
| UTF-8 | Java | 453 | java | NewsSDDao.java | Java | [] | null | [] | package com.morehuan.morehuan.dao;
import android.content.Context;
import android.database.sqlite.SQLiteOpenHelper;
import com.ab.db.orm.dao.AbDBDaoImpl;
import com.morehuan.morehuan.bean.News;
import com.morehuan.morehuan.bean.Thing;
import com.morehuan.morehuan.db.DBSDHelper;
public class NewsSDDao extends AbDBDaoImpl<News> {
public NewsSDDao(Context context) {
super(new DBSDHelper(context),News.class);
}
}
| 453 | 0.746137 | 0.746137 | 24 | 16.875 | 20.065128 | 50 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.541667 | false | false | 9 |
3b040d465803b7b63810837050ca0471431a002d | 8,589,972,210 | 1ae8eac38deb2e0e2e3a8e592843503d6a3a59ff | /src/main/java/com/vetus/robotic/rover/services/RoverService.java | 3743a99db48565a873569fccb550be736ca3f38d | [] | no_license | vetusbs/Robot-rover | https://github.com/vetusbs/Robot-rover | 673c6fff18e3f76ed676fd7517429886d36a5b9b | fd7c7fbf3e76da031105d9829f9a58c8b791f710 | refs/heads/master | 2021-04-28T15:53:23.098000 | 2018-02-19T23:10:58 | 2018-02-19T23:12:03 | 122,000,845 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.vetus.robotic.rover.services;
import com.vetus.robotic.rover.scenario.Command;
import com.vetus.robotic.rover.scenario.RoverRobot;
import java.util.List;
public class RoverService {
private final RoverRobot robot;
public RoverService(RoverRobot robot) {
this.robot = robot;
}
public RoverRobot getRobot() {
return robot;
}
public void execute(List<Command> commands) {
commands.forEach(command -> {
command.execute(robot);
});
}
}
| UTF-8 | Java | 521 | java | RoverService.java | Java | [] | null | [] | package com.vetus.robotic.rover.services;
import com.vetus.robotic.rover.scenario.Command;
import com.vetus.robotic.rover.scenario.RoverRobot;
import java.util.List;
public class RoverService {
private final RoverRobot robot;
public RoverService(RoverRobot robot) {
this.robot = robot;
}
public RoverRobot getRobot() {
return robot;
}
public void execute(List<Command> commands) {
commands.forEach(command -> {
command.execute(robot);
});
}
}
| 521 | 0.666027 | 0.666027 | 24 | 20.708334 | 18.369991 | 51 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | false | false | 9 |
17c1b58822644b294b39f09864c536aeb47eb53e | 283,467,880,370 | d1e86ed1635ed0aa24a11603fc0aea5f7453c28f | /MusicCrawler/src/nbeans/Record.java | a9d5e342c57979f99dedf99e293e36785515dc65 | [] | no_license | k08eYLx/intern | https://github.com/k08eYLx/intern | a52c51c6e28ce44036339769847e2531741bd2cd | 7516f64ccf358bf67b6b0af310fadd47a312c3cd | refs/heads/master | 2023-04-13T07:43:54.794000 | 2013-04-02T09:43:27 | 2013-04-02T09:43:27 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package nbeans;
import java.sql.ResultSet;
import utils.db.ConnectionPool;
import utils.db.SqlUtils;
import utils.file.PropertyUtils;
import app.Constants;
public abstract class Record {
private static final String MYSQL = "MySQL";
public static final int ILLEGAL_ID = -1;
// H2 as default
private static String db = "H2"; // db
protected static boolean useMySQL = false;
private static String script = null;
protected static String insertSql = null;
protected static final String SELECT_SQL = "SELECT %s FROM %s WHERE %s=%d";
static {
config();
}
protected int id = ILLEGAL_ID; // -1 is illegal
protected String name = "";
protected long fCnCharId = 0;
protected long sCnCharId = 0;
protected long tCnCharId = 0;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public long getfCnCharId() {
return fCnCharId;
}
public void setfCnCharId(long fCnCharId) {
this.fCnCharId = fCnCharId;
}
public long getsCnCharId() {
return sCnCharId;
}
public void setsCnCharId(long sCnCharId) {
this.sCnCharId = sCnCharId;
}
public long gettCnCharId() {
return tCnCharId;
}
public void settCnCharId(long tCnCharId) {
this.tCnCharId = tCnCharId;
}
public static void config() {
PropertyUtils pus = new PropertyUtils(Constants.DB_CONFIG);
db = pus.restoreStringField("db", db);
useMySQL = db.equalsIgnoreCase(MYSQL);
ConnectionPool.config(useMySQL);
if (useMySQL) {
script = Constants.MYSQL_SCRIPT;
// Insert on duplicate key update
insertSql = "INSERT INTO %s VALUES (%s) ON DUPLICATE KEY UPDATE %s";
}
else {
script = Constants.H2_SCRIPT;
insertSql = "MERGE INTO %s VALUES (%s)"; // MERGE
}
SqlUtils.runScript(script);
}
public abstract String toString();
public abstract boolean needUpdate();
public abstract void saveToDB();
public abstract void saveToExt();
public abstract void fromRset(ResultSet rSet);
/**
* 对输入字符串中的特殊字符进行转义
*
* @param value
* @return
*/
protected String escape(String value) {
// 移除字符串末尾的孤转义字符'\'
if (value.contains("\\") && value.lastIndexOf('\\') == (value.length() - 1)) {
if (value.length() < 2 || value.length() >= 2 && value.charAt(value.length() - 2) != '\\') {
value = value.substring(0, value.length() - 1);
}
}
// 为SQL语句,escape single quotes
value = value.replaceAll("'", "''");
// 对将转义字符'\'本身进行转义
return value.replaceAll("\\\\", "\\\\");
}
/**
* DATE字段如果为空应该使用不带引号的null,
* 不为空时使用字符串形式可以自动转换为DATE
*
* 将不合法的日期格式转化为合法的,
* 例如:"2005-00-00" 到 "2005-01-01"
*
* @param date
* @return
*/
public static String assureDate(String date) {
// "2005-00-00" 对于H2来说是不合法的日期格式,但是MySQL不会报错
// 将“-00”替换成“-01”,以便对于H2来说成为合法格式
if (date != null) date = date.replaceAll("-0{2}", "-01");
return (date == null || date.isEmpty()) ? "NULL" : ("'" + date + "'");
}
/**
* 判断记录是否合法
*
* @return
*/
public boolean isLegal() {
return (!(id == ILLEGAL_ID || name.isEmpty()));
}
}
| UTF-8 | Java | 3,592 | java | Record.java | Java | [] | null | [] | package nbeans;
import java.sql.ResultSet;
import utils.db.ConnectionPool;
import utils.db.SqlUtils;
import utils.file.PropertyUtils;
import app.Constants;
public abstract class Record {
private static final String MYSQL = "MySQL";
public static final int ILLEGAL_ID = -1;
// H2 as default
private static String db = "H2"; // db
protected static boolean useMySQL = false;
private static String script = null;
protected static String insertSql = null;
protected static final String SELECT_SQL = "SELECT %s FROM %s WHERE %s=%d";
static {
config();
}
protected int id = ILLEGAL_ID; // -1 is illegal
protected String name = "";
protected long fCnCharId = 0;
protected long sCnCharId = 0;
protected long tCnCharId = 0;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public long getfCnCharId() {
return fCnCharId;
}
public void setfCnCharId(long fCnCharId) {
this.fCnCharId = fCnCharId;
}
public long getsCnCharId() {
return sCnCharId;
}
public void setsCnCharId(long sCnCharId) {
this.sCnCharId = sCnCharId;
}
public long gettCnCharId() {
return tCnCharId;
}
public void settCnCharId(long tCnCharId) {
this.tCnCharId = tCnCharId;
}
public static void config() {
PropertyUtils pus = new PropertyUtils(Constants.DB_CONFIG);
db = pus.restoreStringField("db", db);
useMySQL = db.equalsIgnoreCase(MYSQL);
ConnectionPool.config(useMySQL);
if (useMySQL) {
script = Constants.MYSQL_SCRIPT;
// Insert on duplicate key update
insertSql = "INSERT INTO %s VALUES (%s) ON DUPLICATE KEY UPDATE %s";
}
else {
script = Constants.H2_SCRIPT;
insertSql = "MERGE INTO %s VALUES (%s)"; // MERGE
}
SqlUtils.runScript(script);
}
public abstract String toString();
public abstract boolean needUpdate();
public abstract void saveToDB();
public abstract void saveToExt();
public abstract void fromRset(ResultSet rSet);
/**
* 对输入字符串中的特殊字符进行转义
*
* @param value
* @return
*/
protected String escape(String value) {
// 移除字符串末尾的孤转义字符'\'
if (value.contains("\\") && value.lastIndexOf('\\') == (value.length() - 1)) {
if (value.length() < 2 || value.length() >= 2 && value.charAt(value.length() - 2) != '\\') {
value = value.substring(0, value.length() - 1);
}
}
// 为SQL语句,escape single quotes
value = value.replaceAll("'", "''");
// 对将转义字符'\'本身进行转义
return value.replaceAll("\\\\", "\\\\");
}
/**
* DATE字段如果为空应该使用不带引号的null,
* 不为空时使用字符串形式可以自动转换为DATE
*
* 将不合法的日期格式转化为合法的,
* 例如:"2005-00-00" 到 "2005-01-01"
*
* @param date
* @return
*/
public static String assureDate(String date) {
// "2005-00-00" 对于H2来说是不合法的日期格式,但是MySQL不会报错
// 将“-00”替换成“-01”,以便对于H2来说成为合法格式
if (date != null) date = date.replaceAll("-0{2}", "-01");
return (date == null || date.isEmpty()) ? "NULL" : ("'" + date + "'");
}
/**
* 判断记录是否合法
*
* @return
*/
public boolean isLegal() {
return (!(id == ILLEGAL_ID || name.isEmpty()));
}
}
| 3,592 | 0.616201 | 0.601638 | 144 | 20.888889 | 20.176689 | 95 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.666667 | false | false | 9 |
db2ed8bc5f90c6428b89b6b78b3b741197cdfdbf | 14,156,212,222,588 | 9c4c1c5bebd24a4085e4da83224e2795b17e7ab5 | /crmd-cas-order/crmd-cas-order-service/src/main/java/com/ffcs/crmd/cas/order/service/impl/IntfPreOrderAttachServiceImpl.java | 0f7f0f06c6af675d04b5e5ca093243c5f8ea314e | [] | no_license | myloveyuvip/cas | https://github.com/myloveyuvip/cas | 465ab0e5dde150e33c833a5bff8fad7250692460 | 3899eae2953111f5c4de396f3940cec9b92ba53a | refs/heads/master | 2020-12-26T03:55:49.280000 | 2016-06-21T03:13:12 | 2016-06-21T03:13:12 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.ffcs.crmd.cas.order.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ffcs.crmd.cas.core.ddd.service.impl.AbsCrmdGenericServiceImpl;
import com.ffcs.crmd.cas.order.entity.IntfPreOrderAttach;
import com.ffcs.crmd.cas.order.repository.IIntfPreOrderAttachRepository;
import com.ffcs.crmd.cas.order.service.IIntfPreOrderAttachService;
@Service("intfPreOrderAttachService")
public class IntfPreOrderAttachServiceImpl extends AbsCrmdGenericServiceImpl<IntfPreOrderAttach, Long>
implements IIntfPreOrderAttachService {
@Autowired
IIntfPreOrderAttachRepository intfPreOrderAttachRepository;
}
| UTF-8 | Java | 695 | java | IntfPreOrderAttachServiceImpl.java | Java | [] | null | [] | package com.ffcs.crmd.cas.order.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ffcs.crmd.cas.core.ddd.service.impl.AbsCrmdGenericServiceImpl;
import com.ffcs.crmd.cas.order.entity.IntfPreOrderAttach;
import com.ffcs.crmd.cas.order.repository.IIntfPreOrderAttachRepository;
import com.ffcs.crmd.cas.order.service.IIntfPreOrderAttachService;
@Service("intfPreOrderAttachService")
public class IntfPreOrderAttachServiceImpl extends AbsCrmdGenericServiceImpl<IntfPreOrderAttach, Long>
implements IIntfPreOrderAttachService {
@Autowired
IIntfPreOrderAttachRepository intfPreOrderAttachRepository;
}
| 695 | 0.856115 | 0.856115 | 17 | 39.882355 | 31.137045 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.647059 | false | false | 9 |
5d28c73a397f496b4919d90f2c032b6a246e4c08 | 26,164,940,779,995 | 1d99188185232f8ad8093accb1c6cb4aef4404ed | /src/test1/메소드2.java | 16de6299031a825977a3a2ae8baa3b45ba68255b | [] | no_license | errorfixie/java_tutorial | https://github.com/errorfixie/java_tutorial | fc0d03ec94eb1986fd9b0b4f2dde758aab02d16b | 8c4c3bdcb9e4633eb10da8fce64d2181ef536f5c | refs/heads/master | 2022-12-22T10:47:42.806000 | 2020-09-24T08:57:50 | 2020-09-24T08:57:50 | 297,557,466 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package test1;
public class 메소드2 {
public static int one() {
return 1;
// return 2;
}
public static void main(String[] args) {
System.out.println(one());
one();
}
}
// 컴파일자체가 안댐
| UHC | Java | 217 | java | 메소드2.java | Java | [] | null | [] | package test1;
public class 메소드2 {
public static int one() {
return 1;
// return 2;
}
public static void main(String[] args) {
System.out.println(one());
one();
}
}
// 컴파일자체가 안댐
| 217 | 0.610256 | 0.589744 | 18 | 9.833333 | 11.701139 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.944444 | false | false | 9 |
0367f70841134772d39d182ea8c129674df9f290 | 22,093,311,771,821 | 731fb2a9994c3c9ad785bf030d507f6d2c86ec77 | /src/modifiers/ModifierFinal.java | 9c0d7666eceb2fb62864c0fbb8b56dbcf168ccca | [] | no_license | IvanKurtovic2000/JavaBasicsTutorial | https://github.com/IvanKurtovic2000/JavaBasicsTutorial | e87de67e267864b26694f2c8cead76563289d7e9 | 8fcd94eacf8b2564fbee22b10834722b2cdd8491 | refs/heads/master | 2020-04-09T08:56:51.281000 | 2018-12-06T08:52:18 | 2018-12-06T08:52:18 | 160,214,747 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package modifiers;
public class ModifierFinal {
final int x = 10;
final double PI = 3.14;
public static void main(String[] args) {
ModifierFinal obj = new ModifierFinal();
//obj.x = 10; // will generate an error: cannot assign a value to a final variable
System.out.println(obj.x);
}
}
| UTF-8 | Java | 303 | java | ModifierFinal.java | Java | [] | null | [] | package modifiers;
public class ModifierFinal {
final int x = 10;
final double PI = 3.14;
public static void main(String[] args) {
ModifierFinal obj = new ModifierFinal();
//obj.x = 10; // will generate an error: cannot assign a value to a final variable
System.out.println(obj.x);
}
}
| 303 | 0.686469 | 0.663366 | 17 | 16.82353 | 22.342876 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.941176 | false | false | 9 |
1ebe6c41c67e7d1e11f1a8246392b033536faf50 | 28,509,992,950,791 | 217ca27ca247496e1ea3817ab417db8bc33b64b3 | /src/CueListRenderer.java | 06758b4da648802009afd39acc6b0bb9debfd21d | [] | no_license | awpollon/Holiday_Lights_Editor | https://github.com/awpollon/Holiday_Lights_Editor | 93dba42f480d298a3deb4e1efcf3db774d9a7659 | a8fe1b6db3cc93a957949820a5983e65033d29a1 | refs/heads/master | 2023-04-11T05:41:10.888000 | 2022-10-19T06:19:23 | 2022-10-19T06:19:23 | 27,806,786 | 1 | 0 | null | false | 2023-03-31T15:15:43 | 2014-12-10T07:04:03 | 2022-10-19T06:19:29 | 2023-03-31T15:15:43 | 127,493 | 1 | 0 | 26 | Java | false | false | import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
public class CueListRenderer extends JLabel implements ListCellRenderer {
/**
*
*/
private static final long serialVersionUID = 1476704357098753251L;
public CueListRenderer() {
setOpaque(true);
}
@Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
Cue cue = (Cue) value;
setText(cue.getRuntTimeInSecs() + "");
if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
else if(cue.isActive()) {
setBackground(Color.yellow);
setForeground(Color.black);
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
return this;
}
}
| UTF-8 | Java | 903 | java | CueListRenderer.java | Java | [] | null | [] | import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;
public class CueListRenderer extends JLabel implements ListCellRenderer {
/**
*
*/
private static final long serialVersionUID = 1476704357098753251L;
public CueListRenderer() {
setOpaque(true);
}
@Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
Cue cue = (Cue) value;
setText(cue.getRuntTimeInSecs() + "");
if (isSelected) {
setBackground(list.getSelectionBackground());
setForeground(list.getSelectionForeground());
}
else if(cue.isActive()) {
setBackground(Color.yellow);
setForeground(Color.black);
}
else {
setBackground(list.getBackground());
setForeground(list.getForeground());
}
return this;
}
}
| 903 | 0.726467 | 0.705426 | 45 | 19.066668 | 21.049572 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.666667 | false | false | 9 |
bac08bddb4941809be1d68b3a7eb262a23d4bf29 | 7,902,739,860,455 | 43b90d0bff1c45a873dfa00a41dda0734c7536d3 | /简单设计模式-举例/shejimoshi/src/main/java/com/pw/singleton/ehanshi/SingleTon.java | 298d6ae84de50df24eacae218a4c786abf7f744b | [] | no_license | MNSmile/java | https://github.com/MNSmile/java | 9f4eb86dc4d95ab524f200df6739f6d11571ccb5 | 577bcabbc2c8640761f102937b2c89b68215c63c | refs/heads/master | 2022-06-22T00:34:37.593000 | 2020-03-01T14:04:58 | 2020-03-01T14:04:58 | 149,729,417 | 0 | 0 | null | false | 2022-06-21T02:52:52 | 2018-09-21T07:51:53 | 2020-03-01T14:07:33 | 2022-06-21T02:52:51 | 18,937 | 0 | 0 | 7 | JavaScript | false | false | package com.pw.singleton.ehanshi;
/**
* 饿汉式单例模式
* 线程安全,类加载时就已经实例化了
*/
public class SingleTon {
private static SingleTon singleTon = new SingleTon();
private SingleTon(){
System.out.println("SingleTon");
}
public static SingleTon getInstance(){
return singleTon;
}
}
| UTF-8 | Java | 355 | java | SingleTon.java | Java | [] | null | [] | package com.pw.singleton.ehanshi;
/**
* 饿汉式单例模式
* 线程安全,类加载时就已经实例化了
*/
public class SingleTon {
private static SingleTon singleTon = new SingleTon();
private SingleTon(){
System.out.println("SingleTon");
}
public static SingleTon getInstance(){
return singleTon;
}
}
| 355 | 0.650485 | 0.650485 | 16 | 18.3125 | 17.181818 | 57 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false | 9 |
3f80fb4e6534c1654493a677e968dcf6a23190fd | 15,977,278,408,016 | b83e9ebc37a3424d31e1fec4315d4734e5bb6bf1 | /float_image_text/src/main/java/com/home/libs/out/networks/OnNetworkStatusChangeListener.java | e026cbc84d8cc44ebe6c7a0dc8933267429c6275 | [] | no_license | wwy2178/android_util | https://github.com/wwy2178/android_util | db4078e8b55adb217f47e8815ed1e679114f5ff3 | 6f16ede176f2ee132656be94ad54915b6fd209f4 | refs/heads/main | 2023-04-17T10:06:50.755000 | 2021-04-28T07:01:18 | 2021-04-28T07:01:18 | 360,858,024 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.home.libs.out.networks;
import android.content.Context;
public interface OnNetworkStatusChangeListener {
void onNetworkStatusChange(Context context, NetworkState stats);
}
| UTF-8 | Java | 197 | java | OnNetworkStatusChangeListener.java | Java | [] | null | [] | package com.home.libs.out.networks;
import android.content.Context;
public interface OnNetworkStatusChangeListener {
void onNetworkStatusChange(Context context, NetworkState stats);
}
| 197 | 0.791878 | 0.791878 | 7 | 26.142857 | 24.873558 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.571429 | false | false | 9 |
6e3e0573af61b24015c99dfb07be3db88a9ef30a | 7,662,221,722,974 | 57620c9e186f7e23e8475fdf8d3f0d3e0ea3cebf | /firstData.java | 9e10901e2ccfbd849ec2e7bf24212872348e1880 | [] | no_license | ramita123/datafinaly | https://github.com/ramita123/datafinaly | fb1a73465fc9cc4099076fa8a246f4bcd7a18f97 | ceb03467ee495d387398c57ba18c8c4dc22514a1 | refs/heads/master | 2020-04-10T23:14:53.673000 | 2018-12-11T14:33:19 | 2018-12-11T14:33:19 | 161,346,204 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | ufff y duniaa
package dataProviderDemo;
import java.util.Arrays;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class firstData {
public WebDriver driver;
@BeforeClass
public void browser()
{
String driverpath= System.getProperty("user.dir")+"\\src\\Browser2\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver" ,driverpath);
driver=new ChromeDriver();
//get Url
driver.get("https://www.facebook.com/");
}
@DataProvider
public Object[][] readData()
{
String sheetPath=System.getProperty("user.dir")+"\\src\\TestDataProvider\\sheetData.xlsx";
//file file=new file();
Xls_Reader xlr=new Xls_Reader(sheetPath );
//count total number of rows
int rowcount=xlr.getRowCount("Sheet1");
System.out.println(rowcount);
//count no. of columns
int colCount=xlr.getColumnCount("Sheet1");
System.out.println(colCount);
Object[][] testArray=new String[rowcount-1][colCount];
int ai=0;
for(int i=2;i<=rowcount;i++,ai++)
{ int aj=0;
for(int j=0;j<colCount;j++,aj++)
{
//to read the data from the column
testArray[ai][aj]=xlr.getCellData("Sheet1", j, i);
System.out.println(testArray[ai][aj]);
}
}
//System.out.println(Arrays.toString(testArray[ai][aj]));
return testArray;
}
@Test(dataProvider="readData")
public void login(String username,String password)
{driver.findElement(By.id("email")).sendKeys(username);
driver.findElement(By.id("pass")).sendKeys(password);
driver.findElement(By.id("loginbutton")).click();
}
@AfterClass
public void logout()
{
driver.quit();
}
}
| UTF-8 | Java | 1,868 | java | firstData.java | Java | [
{
"context": "rd)\n\t{driver.findElement(By.id(\"email\")).sendKeys(username);\n\tdriver.findElement(By.id(\"pass\")).sendKeys(pas",
"end": 1680,
"score": 0.9747347235679626,
"start": 1672,
"tag": "USERNAME",
"value": "username"
},
{
"context": "ame);\n\tdriver.findElement(By.id(\"pa... | null | [] | ufff y duniaa
package dataProviderDemo;
import java.util.Arrays;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
public class firstData {
public WebDriver driver;
@BeforeClass
public void browser()
{
String driverpath= System.getProperty("user.dir")+"\\src\\Browser2\\chromedriver.exe";
System.setProperty("webdriver.chrome.driver" ,driverpath);
driver=new ChromeDriver();
//get Url
driver.get("https://www.facebook.com/");
}
@DataProvider
public Object[][] readData()
{
String sheetPath=System.getProperty("user.dir")+"\\src\\TestDataProvider\\sheetData.xlsx";
//file file=new file();
Xls_Reader xlr=new Xls_Reader(sheetPath );
//count total number of rows
int rowcount=xlr.getRowCount("Sheet1");
System.out.println(rowcount);
//count no. of columns
int colCount=xlr.getColumnCount("Sheet1");
System.out.println(colCount);
Object[][] testArray=new String[rowcount-1][colCount];
int ai=0;
for(int i=2;i<=rowcount;i++,ai++)
{ int aj=0;
for(int j=0;j<colCount;j++,aj++)
{
//to read the data from the column
testArray[ai][aj]=xlr.getCellData("Sheet1", j, i);
System.out.println(testArray[ai][aj]);
}
}
//System.out.println(Arrays.toString(testArray[ai][aj]));
return testArray;
}
@Test(dataProvider="readData")
public void login(String username,String password)
{driver.findElement(By.id("email")).sendKeys(username);
driver.findElement(By.id("pass")).sendKeys(<PASSWORD>);
driver.findElement(By.id("loginbutton")).click();
}
@AfterClass
public void logout()
{
driver.quit();
}
}
| 1,870 | 0.714668 | 0.70985 | 68 | 26.411764 | 21.418268 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.014706 | false | false | 9 |
aa108e6c7d8ed2bdb531d2d657515175858d5c1c | 15,118,284,926,935 | 73f3a3281a15587cede023cf2f749979f1ed8d33 | /src/main/java/com/prode/service/impl/MessengerServiceImpl.java | 2e6687f0046af37bb48548e254bd83cea6d4502c | [] | no_license | MaximilianoCaba/prodeRusia2018 | https://github.com/MaximilianoCaba/prodeRusia2018 | 4ed90895dc05c128729b61559d4a8c163c769018 | 6c8611e7aac495e21a53ef032d45443748861abb | refs/heads/master | 2023-04-13T13:26:32.051000 | 2018-06-28T02:03:55 | 2018-06-28T02:03:55 | 134,216,598 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.prode.service.impl;
import com.prode.service.MessengerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
@Service
public class MessengerServiceImpl implements MessengerService {
@Autowired
@Qualifier("mailSender")
private JavaMailSender javaMailSender;
@Value("${workplace.api}")
private String apiWorkplace;
@Value("${workplace.idgroup}")
private String idGroupWorkplace;
@Value("${workplace.token}")
private String tokenWorkplace;
@Value("${mail.get.notification}")
private String notificationEmail;
@Value("${url.app}")
private String urlApp;
@Override
public void sendNotificationWorkplace(String message)throws Exception {
String url = apiWorkplace + idGroupWorkplace + "/feed" + tokenWorkplace;
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
String urlParameters = "message=" + message+ "&" + "link=" + urlApp;
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
}
@Override
public void sendNotificationMail(String title, String message) {
javaMailSender.send(buildEmail(title, message));
}
private SimpleMailMessage buildEmail(String title, String message) {
SimpleMailMessage simpleMailMessage = new SimpleMailMessage();
simpleMailMessage.setTo(notificationEmail);
simpleMailMessage.setSubject(title);
simpleMailMessage.setText(message);
return simpleMailMessage;
}
}
| UTF-8 | Java | 2,434 | java | MessengerServiceImpl.java | Java | [] | null | [] | package com.prode.service.impl;
import com.prode.service.MessengerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
@Service
public class MessengerServiceImpl implements MessengerService {
@Autowired
@Qualifier("mailSender")
private JavaMailSender javaMailSender;
@Value("${workplace.api}")
private String apiWorkplace;
@Value("${workplace.idgroup}")
private String idGroupWorkplace;
@Value("${workplace.token}")
private String tokenWorkplace;
@Value("${mail.get.notification}")
private String notificationEmail;
@Value("${url.app}")
private String urlApp;
@Override
public void sendNotificationWorkplace(String message)throws Exception {
String url = apiWorkplace + idGroupWorkplace + "/feed" + tokenWorkplace;
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
String urlParameters = "message=" + message+ "&" + "link=" + urlApp;
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
}
@Override
public void sendNotificationMail(String title, String message) {
javaMailSender.send(buildEmail(title, message));
}
private SimpleMailMessage buildEmail(String title, String message) {
SimpleMailMessage simpleMailMessage = new SimpleMailMessage();
simpleMailMessage.setTo(notificationEmail);
simpleMailMessage.setSubject(title);
simpleMailMessage.setText(message);
return simpleMailMessage;
}
}
| 2,434 | 0.710764 | 0.710764 | 77 | 30.597403 | 24.978567 | 92 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.558442 | false | false | 9 |
97ddd9cd5f643f0081e0906d184fb3c6ea382f24 | 21,586,505,674,730 | fcdbc529fd4f952762f4dabd609f9268ed63d8f4 | /src/learn/IntvThreadSync.java | 290cffda5e195d4b8da4842ee5c847e14c052bbe | [] | no_license | 404mj/testLearn | https://github.com/404mj/testLearn | db81ca559b341d7ceddbe9dd0bf20f2d1b0020c8 | a658f3262cdec31181c74f605b8c898ca94f585f | refs/heads/master | 2016-09-14T05:11:58.156000 | 2016-05-08T14:32:05 | 2016-05-08T14:32:05 | 58,315,491 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /* */ package learn;
/* */
/* */ import java.io.PrintStream;
/* */
/* */ public class IntvThreadSync
/* */ implements Runnable
/* */ {
/* 7 */ int b = 100;
/* */
/* */ public synchronized void fun1() throws Exception {
/* 10 */ this.b = 1000;
/* 11 */ Thread.sleep(5000L);
/* 12 */ System.out.println("fun1(): b= " + this.b);
/* */ }
/* */
/* */ public void fun2()
/* */ throws Exception
/* */ {
/* 18 */ Thread.sleep(2500L);
/* 19 */ this.b = 2000;
/* */ }
/* */
/* */ public void run()
/* */ {
/* */ try {
/* 25 */ fun1();
/* */ } catch (Exception e) {
/* 27 */ e.printStackTrace();
/* */ }
/* */ }
/* */
/* */ public static void main(String[] args) throws Exception {
/* 32 */ IntvThreadSync its = new IntvThreadSync();
/* 33 */ Thread t = new Thread(its);
/* 34 */ t.start();
/* */
/* 36 */ Thread.sleep(1000L);
/* */
/* 40 */ its.fun2();
/* */
/* 42 */ System.out.println("main end b=" + its.b);
/* */ }
/* */ }
/* Location: /home/zsx/workspace_kepler/testLearn/WEB-INF/classes/
* Qualified Name: learn.IntvThreadSync
* JD-Core Version: 0.6.2
*/ | UTF-8 | Java | 1,264 | java | IntvThreadSync.java | Java | [] | null | [] | /* */ package learn;
/* */
/* */ import java.io.PrintStream;
/* */
/* */ public class IntvThreadSync
/* */ implements Runnable
/* */ {
/* 7 */ int b = 100;
/* */
/* */ public synchronized void fun1() throws Exception {
/* 10 */ this.b = 1000;
/* 11 */ Thread.sleep(5000L);
/* 12 */ System.out.println("fun1(): b= " + this.b);
/* */ }
/* */
/* */ public void fun2()
/* */ throws Exception
/* */ {
/* 18 */ Thread.sleep(2500L);
/* 19 */ this.b = 2000;
/* */ }
/* */
/* */ public void run()
/* */ {
/* */ try {
/* 25 */ fun1();
/* */ } catch (Exception e) {
/* 27 */ e.printStackTrace();
/* */ }
/* */ }
/* */
/* */ public static void main(String[] args) throws Exception {
/* 32 */ IntvThreadSync its = new IntvThreadSync();
/* 33 */ Thread t = new Thread(its);
/* 34 */ t.start();
/* */
/* 36 */ Thread.sleep(1000L);
/* */
/* 40 */ its.fun2();
/* */
/* 42 */ System.out.println("main end b=" + its.b);
/* */ }
/* */ }
/* Location: /home/zsx/workspace_kepler/testLearn/WEB-INF/classes/
* Qualified Name: learn.IntvThreadSync
* JD-Core Version: 0.6.2
*/ | 1,264 | 0.446203 | 0.400316 | 48 | 25.354166 | 17.593191 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false | 9 |
425fa9c7e172897fb00f6aa077e5c65904a3feb4 | 15,882,789,068,709 | f622c9e86d94d3d5b2389f7c2039e622e779907e | /app/src/main/java/com/inc/playground/playgroundApp/EditEvent.java | 29702729e50d48eec1e6ab74ccb1ccb372fced54 | [] | no_license | wattad169/Playground | https://github.com/wattad169/Playground | da7ac21238e63eeb5bf5814c4fbf6b27200389b6 | b9a3077af3cbd875b19ea55eb617837d35eadd0c | refs/heads/master | 2021-01-17T13:08:42.870000 | 2016-07-24T13:25:40 | 2016-07-24T13:25:40 | 57,955,214 | 1 | 0 | null | false | 2016-05-14T12:19:28 | 2016-05-03T08:53:15 | 2016-05-03T08:54:17 | 2016-05-14T12:19:27 | 17,173 | 0 | 0 | 0 | Java | null | null | package com.inc.playground.playgroundApp;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Application;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.Toast;
import com.inc.playground.playgroundApp.utils.Constants;
import com.inc.playground.playgroundApp.utils.DownloadImageBitmapTask;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import static com.inc.playground.playgroundApp.utils.NetworkUtilities.eventListToArrayList;
public class EditEvent extends Activity {
private static int RESULT_LOAD_IMAGE = 1;
private Uri imageUri;
WebView web_addstore;
ProgressDialog progressBar;
public static GlobalVariables globalVariables;
private ValueCallback<Uri> mUploadMessage;
private final static int FILECHOOSER_RESULTCODE = 1;
public static final String TAG = "EditEventActivity";
Map<String,String> headers = new HashMap<String,String>();
EventsObject currentEvent;
public class JavaScriptInterface {
Context mContext;
Application currentApplication;
/** Instantiate the interface and set the context */
JavaScriptInterface(Context c,Application inputApplication) {
mContext = c;
currentApplication = inputApplication;
}
/** Show a toast from the web page */
@JavascriptInterface //not used
public void showToast(String toast) {
JSONObject responseJSON = null;
JSONArray eventsFromServerJSON = null;
globalVariables = ((GlobalVariables) this.currentApplication);
try {
responseJSON = new JSONObject(toast);
eventsFromServerJSON = responseJSON.getJSONArray(Constants.RESPONSE_MESSAGE);
Intent iv = new Intent(EditEvent.this,EventInfo.class);
EventsObject newEvent = eventListToArrayList(eventsFromServerJSON, globalVariables.GetCurrentLocation()).get(0);
ArrayList<EventsObject> newHomeEvents = globalVariables.GetHomeEvents();
newHomeEvents.add(newEvent);
globalVariables.SetHomeEvents(newHomeEvents);
iv.putExtra("eventObject",newEvent);
startActivity(iv);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_event);
// setPlayGroundActionBar();
Intent intent = getIntent();
SharedPreferences prefs = getSharedPreferences("Login", MODE_PRIVATE);
String usertoken = prefs.getString("userid", null);
currentEvent = (EventsObject) intent.getSerializableExtra("eventObject");
String urlInWebApp = "https://playground-1290.appspot.com/addevent.php?uname="+usertoken +"&update_event=1&event_id="+currentEvent.GetId();
try{
double latitude = 0, longitude = 0;
HashMap<String, String> location = this.currentEvent.GetLocation();
latitude = Double.parseDouble(location.get("lat"));
longitude = Double.parseDouble(location.get("lon"));
urlInWebApp += "&lat="+latitude +"&long="+longitude;
}
catch (Exception e){
// TODO: 12/07/2016 message that we cannot update to the user
}
try{
urlInWebApp += "&event_name="+currentEvent.GetName();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&event_category="+currentEvent.GetType();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
final String NEW_FORMAT = "dd-mm-yyyy";
final String OLD_FORMAT = "yyyy-mm-dd";
try {
SimpleDateFormat sdf = new SimpleDateFormat(OLD_FORMAT);
Date d = sdf.parse(currentEvent.GetDate());
sdf.applyPattern(NEW_FORMAT);
urlInWebApp += "&event_date="+sdf.format(d);
}
catch(Exception e) {
Log.d(TAG,e.toString());
urlInWebApp += "&event_date=" + currentEvent.GetDate();
}
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&from_time="+currentEvent.GetStartTime();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&end_time="+currentEvent.GetEndTime();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&minatt="+currentEvent.GetSize();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&maxatt="+currentEvent.getMaxSize();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&formatted_loc="+currentEvent.GetFormattedLocation();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&description="+currentEvent.GetDescription();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&is_public="+currentEvent.getIsPublic();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
Log.d(TAG,urlInWebApp);
web_addstore = (WebView) findViewById(R.id.web_edit_event);
web_addstore.addJavascriptInterface(new JavaScriptInterface(this,getApplication()), "Android");
web_addstore.getSettings().setJavaScriptEnabled(true);
// web_addstore.addJavascriptInterface(this, "android");
web_addstore.getSettings().getUserAgentString();
web_addstore.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
final AlertDialog alertDialog = new AlertDialog.Builder(this).create();
progressBar = ProgressDialog.show(EditEvent.this, "Playground", "Loading...");
web_addstore.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i("12", "Processing webview url click..." + url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
Log.i("12", "Finished loading URL: " + url);
if (progressBar.isShowing()) {
progressBar.dismiss();
}
}
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Log.e("12", "Error: " + description);
Toast.makeText(EditEvent.this, "Oh no! " + description, Toast.LENGTH_SHORT).show();
alertDialog.setTitle("Error");
alertDialog.setMessage(description);
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
return;
}
});
alertDialog.show();
}
});
web_addstore.setWebChromeClient(new WebChromeClient() {
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
EditEvent.this.showAttachmentDialog(uploadMsg);
}
// For Android > 3.x
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
EditEvent.this.showAttachmentDialog(uploadMsg);
}
// For Android > 4.1
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
EditEvent.this.showAttachmentDialog(uploadMsg);
}
});
headers.put("uname",usertoken);
web_addstore.loadUrl(urlInWebApp);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == FILECHOOSER_RESULTCODE) {
if (null == mUploadMessage)
return;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
}
}
public class myWebClient extends WebViewClient {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
super.onPageFinished(view, url);
}
}
// flipscreen not loading again
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
private void showAttachmentDialog(ValueCallback<Uri> uploadMsg) {
this.mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
this.startActivityForResult(Intent.createChooser(i, "Choose type of attachment"), FILECHOOSER_RESULTCODE);
}
public void setPlayGroundActionBar(){
String userLoginId,userFullName,userEmail,userPhoto;
Bitmap imageBitmap =null;
GlobalVariables globalVariables;
final ActionBar actionBar = getActionBar();
final String MY_PREFS_NAME = "Login";
SharedPreferences prefs = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE);
globalVariables = ((GlobalVariables) this.getApplication());
if (prefs.getString("userid", null) != null){
userLoginId = prefs.getString("userid", null);
userFullName = prefs.getString("fullname", null);
userEmail = prefs.getString("emilid", null);
userPhoto = prefs.getString("picture", null);
actionBar.setCustomView(R.layout.actionbar_custom_view_home);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
ImageView img_profile = (ImageView) findViewById(R.id.img_profile_action_bar);
imageBitmap = globalVariables.GetUserPictureBitMap();
if(imageBitmap==null){
Log.i(TAG,"downloading");
try {
imageBitmap = new DownloadImageBitmapTask().execute(userPhoto).get();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
else {
Log.i(TAG,"Image found");
}
img_profile.setImageBitmap(imageBitmap);
globalVariables.SetUserPictureBitMap(imageBitmap); // Make the imageBitMap global to all activities to avoid downloading twice
}
}
}
| UTF-8 | Java | 10,663 | java | EditEvent.java | Java | [] | null | [] | package com.inc.playground.playgroundApp;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Application;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.Toast;
import com.inc.playground.playgroundApp.utils.Constants;
import com.inc.playground.playgroundApp.utils.DownloadImageBitmapTask;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import static com.inc.playground.playgroundApp.utils.NetworkUtilities.eventListToArrayList;
public class EditEvent extends Activity {
private static int RESULT_LOAD_IMAGE = 1;
private Uri imageUri;
WebView web_addstore;
ProgressDialog progressBar;
public static GlobalVariables globalVariables;
private ValueCallback<Uri> mUploadMessage;
private final static int FILECHOOSER_RESULTCODE = 1;
public static final String TAG = "EditEventActivity";
Map<String,String> headers = new HashMap<String,String>();
EventsObject currentEvent;
public class JavaScriptInterface {
Context mContext;
Application currentApplication;
/** Instantiate the interface and set the context */
JavaScriptInterface(Context c,Application inputApplication) {
mContext = c;
currentApplication = inputApplication;
}
/** Show a toast from the web page */
@JavascriptInterface //not used
public void showToast(String toast) {
JSONObject responseJSON = null;
JSONArray eventsFromServerJSON = null;
globalVariables = ((GlobalVariables) this.currentApplication);
try {
responseJSON = new JSONObject(toast);
eventsFromServerJSON = responseJSON.getJSONArray(Constants.RESPONSE_MESSAGE);
Intent iv = new Intent(EditEvent.this,EventInfo.class);
EventsObject newEvent = eventListToArrayList(eventsFromServerJSON, globalVariables.GetCurrentLocation()).get(0);
ArrayList<EventsObject> newHomeEvents = globalVariables.GetHomeEvents();
newHomeEvents.add(newEvent);
globalVariables.SetHomeEvents(newHomeEvents);
iv.putExtra("eventObject",newEvent);
startActivity(iv);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_event);
// setPlayGroundActionBar();
Intent intent = getIntent();
SharedPreferences prefs = getSharedPreferences("Login", MODE_PRIVATE);
String usertoken = prefs.getString("userid", null);
currentEvent = (EventsObject) intent.getSerializableExtra("eventObject");
String urlInWebApp = "https://playground-1290.appspot.com/addevent.php?uname="+usertoken +"&update_event=1&event_id="+currentEvent.GetId();
try{
double latitude = 0, longitude = 0;
HashMap<String, String> location = this.currentEvent.GetLocation();
latitude = Double.parseDouble(location.get("lat"));
longitude = Double.parseDouble(location.get("lon"));
urlInWebApp += "&lat="+latitude +"&long="+longitude;
}
catch (Exception e){
// TODO: 12/07/2016 message that we cannot update to the user
}
try{
urlInWebApp += "&event_name="+currentEvent.GetName();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&event_category="+currentEvent.GetType();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
final String NEW_FORMAT = "dd-mm-yyyy";
final String OLD_FORMAT = "yyyy-mm-dd";
try {
SimpleDateFormat sdf = new SimpleDateFormat(OLD_FORMAT);
Date d = sdf.parse(currentEvent.GetDate());
sdf.applyPattern(NEW_FORMAT);
urlInWebApp += "&event_date="+sdf.format(d);
}
catch(Exception e) {
Log.d(TAG,e.toString());
urlInWebApp += "&event_date=" + currentEvent.GetDate();
}
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&from_time="+currentEvent.GetStartTime();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&end_time="+currentEvent.GetEndTime();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&minatt="+currentEvent.GetSize();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&maxatt="+currentEvent.getMaxSize();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&formatted_loc="+currentEvent.GetFormattedLocation();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&description="+currentEvent.GetDescription();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
try{
urlInWebApp += "&is_public="+currentEvent.getIsPublic();
}
catch (Exception e){
// Don't crash, this value will not be filled
}
Log.d(TAG,urlInWebApp);
web_addstore = (WebView) findViewById(R.id.web_edit_event);
web_addstore.addJavascriptInterface(new JavaScriptInterface(this,getApplication()), "Android");
web_addstore.getSettings().setJavaScriptEnabled(true);
// web_addstore.addJavascriptInterface(this, "android");
web_addstore.getSettings().getUserAgentString();
web_addstore.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
final AlertDialog alertDialog = new AlertDialog.Builder(this).create();
progressBar = ProgressDialog.show(EditEvent.this, "Playground", "Loading...");
web_addstore.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i("12", "Processing webview url click..." + url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
Log.i("12", "Finished loading URL: " + url);
if (progressBar.isShowing()) {
progressBar.dismiss();
}
}
@Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Log.e("12", "Error: " + description);
Toast.makeText(EditEvent.this, "Oh no! " + description, Toast.LENGTH_SHORT).show();
alertDialog.setTitle("Error");
alertDialog.setMessage(description);
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
return;
}
});
alertDialog.show();
}
});
web_addstore.setWebChromeClient(new WebChromeClient() {
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
EditEvent.this.showAttachmentDialog(uploadMsg);
}
// For Android > 3.x
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
EditEvent.this.showAttachmentDialog(uploadMsg);
}
// For Android > 4.1
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
EditEvent.this.showAttachmentDialog(uploadMsg);
}
});
headers.put("uname",usertoken);
web_addstore.loadUrl(urlInWebApp);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == FILECHOOSER_RESULTCODE) {
if (null == mUploadMessage)
return;
Uri result = intent == null || resultCode != RESULT_OK ? null : intent.getData();
mUploadMessage.onReceiveValue(result);
mUploadMessage = null;
}
}
public class myWebClient extends WebViewClient {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
view.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
super.onPageFinished(view, url);
}
}
// flipscreen not loading again
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
private void showAttachmentDialog(ValueCallback<Uri> uploadMsg) {
this.mUploadMessage = uploadMsg;
Intent i = new Intent(Intent.ACTION_GET_CONTENT);
i.addCategory(Intent.CATEGORY_OPENABLE);
i.setType("image/*");
this.startActivityForResult(Intent.createChooser(i, "Choose type of attachment"), FILECHOOSER_RESULTCODE);
}
public void setPlayGroundActionBar(){
String userLoginId,userFullName,userEmail,userPhoto;
Bitmap imageBitmap =null;
GlobalVariables globalVariables;
final ActionBar actionBar = getActionBar();
final String MY_PREFS_NAME = "Login";
SharedPreferences prefs = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE);
globalVariables = ((GlobalVariables) this.getApplication());
if (prefs.getString("userid", null) != null){
userLoginId = prefs.getString("userid", null);
userFullName = prefs.getString("fullname", null);
userEmail = prefs.getString("emilid", null);
userPhoto = prefs.getString("picture", null);
actionBar.setCustomView(R.layout.actionbar_custom_view_home);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayShowCustomEnabled(true);
actionBar.setDisplayUseLogoEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
ImageView img_profile = (ImageView) findViewById(R.id.img_profile_action_bar);
imageBitmap = globalVariables.GetUserPictureBitMap();
if(imageBitmap==null){
Log.i(TAG,"downloading");
try {
imageBitmap = new DownloadImageBitmapTask().execute(userPhoto).get();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}
else {
Log.i(TAG,"Image found");
}
img_profile.setImageBitmap(imageBitmap);
globalVariables.SetUserPictureBitMap(imageBitmap); // Make the imageBitMap global to all activities to avoid downloading twice
}
}
}
| 10,663 | 0.729907 | 0.727375 | 334 | 30.92515 | 26.331211 | 143 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.730539 | false | false | 9 |
9b63c34aeb185fe9774423bc34c5d3f78af047de | 111,669,198,160 | 8989369296df8eea35b972ef99eed54b2ceb7478 | /src/main/java/io/github/imsejin/wnliext/file/model/Platform.java | fecc0d789dec15ac8dd669c0f36c3e743acbc6b2 | [
"MIT"
] | permissive | ImSejin/webtoon-list-extractor | https://github.com/ImSejin/webtoon-list-extractor | 59aa2e79ba00079fb051ba646721890d4e7af1c2 | 5b0ec16f40068161e251116839caef9c990f9686 | refs/heads/master | 2023-01-13T02:46:30.876000 | 2022-12-29T13:51:47 | 2022-12-29T13:51:47 | 204,304,173 | 4 | 3 | MIT | false | 2022-11-10T22:11:23 | 2019-08-25T14:17:51 | 2022-09-12T14:03:46 | 2022-10-30T02:43:33 | 20,995 | 2 | 3 | 2 | Java | false | false | package io.github.imsejin.wnliext.file.model;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import java.net.URL;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Map;
import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toMap;
/**
* Platform for webtoon.
*
* <p> Website that serves webtoon for subscribers
*/
@Getter
@RequiredArgsConstructor
public enum Platform {
COMICA("CA", "Comica", "http://www.comica.com"),
COMICO("CO", "Comico", "http://comico.kr/webtoon/week"),
DAUM("D", "Daum", "http://webtoon.daum.net"),
HANKYOREH("H", "Hankyoreh", "http://nuri.hani.co.kr/hanisite/dev/board/list.html?h_gcode=board&h_code=100"),
ILYO_MEDIA("I", "IlyoMedia", "http://ilyo.co.kr/?ac=list&cate_id=118"),
KAKAO("K", "Kakao", "https://page.kakao.com/main"),
LEZHIN("L", "Lezhin", "https://www.lezhin.com/ko"),
NAVER("N", "Naver", "https://comic.naver.com/index.nhn"),
NATE("NT", "Nate", "http://comics.nate.com/main"),
OLLEH("O", "Ktoon", "https://www.myktoon.com/web/homescreen/main.kt"),
ONE_STORE("OS", "OneStore", "https://m.onestore.co.kr/mobilepoc/books/main.omp"),
PARAN("P", "Paran", "http://www.paran.com"),
SPORTS_DONGA("SD", "SportsDonga", "http://sports.donga.com/Cartoon?cid=0100000201"),
SPORTS_TODAY("ST", "SportsToday", "http://stoo.asiae.co.kr/cartoon"),
TOPTOON("T", "Toptoon", "https://toptoon.com"),
TOOMICS("TM", "Toomics", "http://www.toomics.com"),
T_STORE("TS", "Tstore", "https://www.tstore.co.kr");
private static final Map<String, Platform> $CODE_LOOKUP = EnumSet.allOf(Platform.class).stream()
.collect(collectingAndThen(toMap(it -> it.code, it -> it), Collections::unmodifiableMap));
private static final Map<String, Platform> $CODE_NAME_LOOKUP = EnumSet.allOf(Platform.class).stream()
.collect(collectingAndThen(toMap(it -> it.codeName, it -> it), Collections::unmodifiableMap));
private final String code;
/**
* Non-reduced name of platform.
*/
private final String codeName;
/**
* Website URL.
*/
private final URL url;
@SneakyThrows
Platform(String code, String codeName, String url) {
this.code = code;
this.codeName = codeName;
this.url = new URL(url);
}
public static Platform fromCode(String code) {
if ($CODE_LOOKUP.containsKey(code)) return $CODE_LOOKUP.get(code);
throw new IllegalArgumentException("Enumeration 'Platform' has no code: " + code);
}
/**
* @see Webtoon#getPlatform()
*/
public static Platform fromCodeName(String codeName) {
if ($CODE_NAME_LOOKUP.containsKey(codeName)) return $CODE_NAME_LOOKUP.get(codeName);
throw new IllegalArgumentException("Enumeration 'Platform' has no code name: " + codeName);
}
}
| UTF-8 | Java | 2,927 | java | Platform.java | Java | [
{
"context": "package io.github.imsejin.wnliext.file.model;\n\nimport lombok.Getter;\nimport",
"end": 25,
"score": 0.9989845752716064,
"start": 18,
"tag": "USERNAME",
"value": "imsejin"
}
] | null | [] | package io.github.imsejin.wnliext.file.model;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import java.net.URL;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Map;
import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toMap;
/**
* Platform for webtoon.
*
* <p> Website that serves webtoon for subscribers
*/
@Getter
@RequiredArgsConstructor
public enum Platform {
COMICA("CA", "Comica", "http://www.comica.com"),
COMICO("CO", "Comico", "http://comico.kr/webtoon/week"),
DAUM("D", "Daum", "http://webtoon.daum.net"),
HANKYOREH("H", "Hankyoreh", "http://nuri.hani.co.kr/hanisite/dev/board/list.html?h_gcode=board&h_code=100"),
ILYO_MEDIA("I", "IlyoMedia", "http://ilyo.co.kr/?ac=list&cate_id=118"),
KAKAO("K", "Kakao", "https://page.kakao.com/main"),
LEZHIN("L", "Lezhin", "https://www.lezhin.com/ko"),
NAVER("N", "Naver", "https://comic.naver.com/index.nhn"),
NATE("NT", "Nate", "http://comics.nate.com/main"),
OLLEH("O", "Ktoon", "https://www.myktoon.com/web/homescreen/main.kt"),
ONE_STORE("OS", "OneStore", "https://m.onestore.co.kr/mobilepoc/books/main.omp"),
PARAN("P", "Paran", "http://www.paran.com"),
SPORTS_DONGA("SD", "SportsDonga", "http://sports.donga.com/Cartoon?cid=0100000201"),
SPORTS_TODAY("ST", "SportsToday", "http://stoo.asiae.co.kr/cartoon"),
TOPTOON("T", "Toptoon", "https://toptoon.com"),
TOOMICS("TM", "Toomics", "http://www.toomics.com"),
T_STORE("TS", "Tstore", "https://www.tstore.co.kr");
private static final Map<String, Platform> $CODE_LOOKUP = EnumSet.allOf(Platform.class).stream()
.collect(collectingAndThen(toMap(it -> it.code, it -> it), Collections::unmodifiableMap));
private static final Map<String, Platform> $CODE_NAME_LOOKUP = EnumSet.allOf(Platform.class).stream()
.collect(collectingAndThen(toMap(it -> it.codeName, it -> it), Collections::unmodifiableMap));
private final String code;
/**
* Non-reduced name of platform.
*/
private final String codeName;
/**
* Website URL.
*/
private final URL url;
@SneakyThrows
Platform(String code, String codeName, String url) {
this.code = code;
this.codeName = codeName;
this.url = new URL(url);
}
public static Platform fromCode(String code) {
if ($CODE_LOOKUP.containsKey(code)) return $CODE_LOOKUP.get(code);
throw new IllegalArgumentException("Enumeration 'Platform' has no code: " + code);
}
/**
* @see Webtoon#getPlatform()
*/
public static Platform fromCodeName(String codeName) {
if ($CODE_NAME_LOOKUP.containsKey(codeName)) return $CODE_NAME_LOOKUP.get(codeName);
throw new IllegalArgumentException("Enumeration 'Platform' has no code name: " + codeName);
}
}
| 2,927 | 0.659378 | 0.653912 | 80 | 35.587502 | 32.504112 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.0125 | false | false | 9 |
aafc6525c028777e706c90d226e58b5397f7525d | 5,368,709,179,547 | 018ba721f77b62aedf9ce6b0e62a63e24b1ffb3a | /P6A_Yuchen/Randon3x4.java | 43974c9a5ddfee0b8d8079569dc411fd291b683a | [] | no_license | YvchenY/APJava | https://github.com/YvchenY/APJava | caefcbf5a93344bb6bf4508e9db9772ee9e781e3 | 2c0ab4ad072c3e4c4921b85ddbca00bf20850759 | refs/heads/master | 2020-09-04T19:43:19.177000 | 2019-11-15T23:54:24 | 2019-11-15T23:54:24 | 219,871,578 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class Randon3x4
{ public static void main (String[] args)
{
int[][] num=new int[3][4];
for(int i=0;i<num.length;i++)
{
for(int j=0;j<num[0].length;j++)
{
num[i][j]=(int)(Math.random()*10);
System.out.print(num[i][j]+"\t");
}
System.out.println();
}
for(int i=0;i<num.length;i++)
{
for(int j=0;j<num[0].length;j++)
{
if(num[i][j]==5)
System.out.println("found 5 at row "+i+" colum "+j);
}
}
}
}
| UTF-8 | Java | 642 | java | Randon3x4.java | Java | [] | null | [] |
public class Randon3x4
{ public static void main (String[] args)
{
int[][] num=new int[3][4];
for(int i=0;i<num.length;i++)
{
for(int j=0;j<num[0].length;j++)
{
num[i][j]=(int)(Math.random()*10);
System.out.print(num[i][j]+"\t");
}
System.out.println();
}
for(int i=0;i<num.length;i++)
{
for(int j=0;j<num[0].length;j++)
{
if(num[i][j]==5)
System.out.println("found 5 at row "+i+" colum "+j);
}
}
}
}
| 642 | 0.373832 | 0.352025 | 26 | 23.653847 | 17.993465 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 9 |
343284bdc8b9616bd92d2a06b29fea08f2d69294 | 5,368,709,177,285 | 90f562982930fc6bf68302284b7281521a58df73 | /src/Excel/InformesCajas.java | 5c9ab81eb0ab226355526c7060cb2f48434ee0b9 | [] | no_license | maurodim/basicoFerreteria | https://github.com/maurodim/basicoFerreteria | c656a09c352bfb19345718e956c1f8822340ccc2 | a4df61c489e07412769b5ef3f3c5f3ebcdd951fb | refs/heads/master | 2021-01-22T20:19:16.253000 | 2019-07-29T12:19:48 | 2019-07-29T12:19:48 | 85,313,446 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Excel;
import Conversores.Numeros;
import interfaceGraficas.Inicio;
import interfaces.Transaccionable;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.MessagingException;
import javax.swing.JOptionPane;
import objetos.ConeccionLocal;
import objetos.Conecciones;
import objetos.Mail;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.DataFormat;
import org.apache.poi.ss.usermodel.IndexedColors;
/**
*
* @author mauro
*/
public class InformesCajas {
public void GenerarInformeDeArticulos(String desde,String hasta) throws SQLException{
HSSFWorkbook libro=new HSSFWorkbook();
HSSFSheet hoja=libro.createSheet("Articulos");
/*
* GENERAR LAS SIGUIENTES HOJAS
* 1- DETALLE DE MOVIMIENTOS DE CAJA - LEE EN MOVIMIENTOS CAJA INDENTIFICANDO EL TIPO DE MOVIMIENTO, USUARIOS Y
* NUMERO DE CAJA
* 2- DETALLE DE ARTICULOS VENDIDOS: LISTADO DE MOVIEMIENTOS DE ARTICULOS, CON USUARIOS Y CAJA
* 3- DETALLE DE GASTOS : MOVIMIENTOS DE CAJA DETALLANDO LOS GASTOS
*
*/
HSSFSheet hoja1=libro.createSheet("Movimientos");
HSSFSheet hoja2=libro.createSheet("Movimientos Caja");
String ttx="celda numero :";
HSSFRow fila=null;
HSSFCell celda;
HSSFCell celda1;
HSSFCell celda2;
HSSFCell celda3;
HSSFCell celda4;
HSSFCell celda5;
HSSFCell celda6;
HSSFCell celda7;
HSSFCell celda8;
HSSFCell celda9;
HSSFCell celda10;
HSSFFont fuente=libro.createFont();
//fuente.setFontHeight((short)21);
fuente.setFontName(fuente.FONT_ARIAL);
fuente.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
String form=null;
String porcentajeG=JOptionPane.showInputDialog("Ingrese porcentaje de ganancia estimada");
Double porcentaje=Numeros.ConvertirStringADouble(porcentajeG);
Double resultado;
Double totalisados;
porcentaje=porcentaje / 100;
//String sql="select id,nombre,(select sum(movimientosarticulos.cantidad) from movimientosarticulos where movimientosarticulos.idarticulo=articulos.id and movimientosarticulos.fecha between '"+desde+"' and '"+hasta+"')as stock,(select sum(movimientosarticulos.cantidad) from movimientosarticulos where movimientosarticulos.fecha between '"+desde+"' and '"+hasta+"' and movimientosarticulos.idarticulo=articulos.id)as cantidadVendida from articulos";
String sql="select *,sum(cantidad)as cantidadT,sum(precioDeCosto * cantidad)as costoT,sum(precioDeVenta)as ventaT,(select articulos.NOMBRE from articulos where articulos.ID=movimientosarticulos.idArticulo)as descripcion from movimientosarticulos where fecha between '"+desde+"' and '"+hasta+"' group by idArticulo order by cantidadT";
System.out.println(sql);
Transaccionable tra=new ConeccionLocal();
ResultSet rs=tra.leerConjuntoDeRegistros(sql);
HSSFCellStyle titulo=libro.createCellStyle();
HSSFCellStyle celdaSt=null;
DataFormat format=libro.createDataFormat();
titulo.setFont(fuente);
//titulo.setFillBackgroundColor((short)22);
titulo.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
titulo.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
celdaSt=libro.createCellStyle();
celdaSt.setDataFormat(format.getFormat("$ #,##0.00"));
//for(int a=0;a < 100;a++){
int col=0;
int a=0;
if(a==0){
fila=hoja.createRow(a);
celda=fila.createCell(0);
celda.setCellStyle(titulo);
celda.setCellValue("id");
celda1=fila.createCell(1);
celda1.setCellStyle(titulo);
celda1.setCellValue("nombre");
celda2=fila.createCell(2);
celda2.setCellStyle(titulo);
celda2.setCellValue("Unidades Vendidas");
celda3=fila.createCell(3);
celda3.setCellStyle(titulo);
celda3.setCellValue("Precio de Costo");
celda4=fila.createCell(4);
celda4.setCellStyle(titulo);
celda4.setCellValue("Precio de Venta");
celda5=fila.createCell(5);
celda5.setCellStyle(titulo);
celda5.setCellValue("Fecha");
celda6=fila.createCell(6);
celda6.setCellStyle(titulo);
celda6.setCellValue("Ganancia Estimada");
celda7=fila.createCell(7);
celda7.setCellStyle(titulo);
celda7.setCellValue("Ganancia del "+porcentajeG+" %");
}
while(rs.next()){
a++;
//col=rs.getInt("tipoMovimiento");
switch(col){
case 1:
break;
default:
break;
}
fila=hoja.createRow(a);
resultado=0.00;
celda=fila.createCell(0);
ttx=ttx;
Double anterior=0.00;
Double actual=0.00;
Double vendido=0.00;
celda.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda.setCellValue(rs.getInt("idArticulo"));
celda1=fila.createCell(1);
ttx=ttx;
celda1.setCellType(HSSFCell.CELL_TYPE_STRING);
celda1.setCellValue(rs.getString("descripcion"));
celda2=fila.createCell(2);
vendido=(rs.getDouble("cantidadT")) * -1;
//actual=rs.getDouble("stock");
celda2.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda2.setCellValue(vendido);
celda3=fila.createCell(3);
//vendido=(rs.getDouble("cantidadT")) * -1;
//actual=rs.getDouble("stock");
celda3.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda3.setCellValue(rs.getDouble("costoT") * (-1));
celda3.setCellStyle(celdaSt);
celda4=fila.createCell(4);
//vendido=(rs.getDouble("cantidadT")) * -1;
//actual=rs.getDouble("stock");
celda4.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda4.setCellValue(rs.getDouble("ventaT"));
celda4.setCellStyle(celdaSt);
celda5=fila.createCell(5);
//vendido=(rs.getDouble("cantidadVendida")) * -1;
celda5.setCellType(HSSFCell.CELL_TYPE_STRING);
celda5.setCellValue(rs.getString("fecha"));
celda6=fila.createCell(6);
celda6.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
if(rs.getDouble("costoT")==0.00){
totalisados=rs.getDouble("ventaT");
resultado=totalisados * porcentaje;
}else{
resultado=rs.getDouble("ventaT");
totalisados=rs.getDouble("costoT") * (-1);
resultado=resultado - totalisados;
}
celda6.setCellValue(resultado);
celda6.setCellStyle(celdaSt);
celda7=fila.createCell(7);
celda7.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
totalisados=rs.getDouble("ventaT");
resultado=totalisados * porcentaje;
celda7.setCellStyle(celdaSt);
celda7.setCellValue(resultado);
}
/*
CIERRE DE HOJA
*/
hoja.autoSizeColumn((short)0);
hoja.autoSizeColumn((short)1);
hoja.autoSizeColumn((short)2);
hoja.autoSizeColumn((short)3);
hoja.autoSizeColumn((short)4);
hoja.autoSizeColumn((short)5);
hoja.autoSizeColumn((short)6);
hoja.autoSizeColumn((short)7);
//rs.close();
// hoja 2
form=null;
sql="SELECT id,cantidad,preciodecosto,preciodeventa,precioservicio,fecha,numerocomprobante,(select listcli.RAZON_SOCI from listcli where listcli.codMmd=movimientosarticulos.numeroCliente limit 0,1)as nombreC,(select articulos.NOMBRE from articulos where articulos.ID=movimientosarticulos.idArticulo limit 0,1)as descA,(select usuarios.nombre from usuarios where usuarios.numero=movimientosarticulos.numeroUsuario limit 0,1) as nombreU FROM movimientosarticulos where tipoMovimiento =1 and fecha between '"+desde+"' and '"+hasta+"'";
//System.out.println(sql);
//tra=new Conecciones();
rs=tra.leerConjuntoDeRegistros(sql);
//HSSFCellStyle titulo=libro.createCellStyle();
titulo.setFont(fuente);
//titulo.setFillBackgroundColor((short)22);
titulo.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
titulo.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
//for(int a=0;a < 100;a++){
col=0;
a=0;
if(a==0){
fila=hoja1.createRow(a);
celda=fila.createCell(0);
celda.setCellStyle(titulo);
celda.setCellValue("Cajero");
celda1=fila.createCell(1);
celda1.setCellStyle(titulo);
celda1.setCellValue("Descripcion Articulo");
celda2=fila.createCell(2);
celda2.setCellStyle(titulo);
celda2.setCellValue("Cantidad");
celda3=fila.createCell(3);
celda3.setCellStyle(titulo);
celda3.setCellValue("Precio de Costo");
celda4=fila.createCell(4);
celda4.setCellStyle(titulo);
celda4.setCellValue("Precio de Venta");
celda5=fila.createCell(5);
celda5.setCellStyle(titulo);
celda5.setCellValue("Fecha");
celda6=fila.createCell(6);
celda6.setCellStyle(titulo);
celda6.setCellValue("Precio de Servicio");
celda7=fila.createCell(7);
celda7.setCellStyle(titulo);
celda7.setCellValue("comprobante");
celda8=fila.createCell(8);
celda8.setCellStyle(titulo);
celda8.setCellValue("Cliente");
celda9=fila.createCell(9);
celda9.setCellStyle(titulo);
celda9.setCellValue("Total");
celda10=fila.createCell(10);
celda10.setCellStyle(titulo);
celda10.setCellValue("idMovimiento");
}
while(rs.next()){
a++;
//col=rs.getInt("tipoMovimiento");
switch(col){
case 1:
break;
default:
break;
}
fila=hoja1.createRow(a);
celda=fila.createCell(0);
ttx=ttx;
celda.setCellType(HSSFCell.CELL_TYPE_STRING);
celda.setCellValue(rs.getString("nombreU"));
celda1=fila.createCell(1);
ttx=ttx;
celda1.setCellType(HSSFCell.CELL_TYPE_STRING);
celda1.setCellValue(rs.getString("descA"));
celda2=fila.createCell(2);
celda2.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda2.setCellValue(rs.getDouble("cantidad"));
celda3=fila.createCell(3);
celda3.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda3.setCellValue(rs.getDouble("precioDeCosto"));
celda4=fila.createCell(4);
celda4.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda4.setCellValue(rs.getDouble("precioDeVenta"));
celda5=fila.createCell(5);
//celda5.setCellFormula(rs.getString("observaciones"));
celda5.setCellType(HSSFCell.CELL_TYPE_STRING);
celda5.setCellValue(" "+rs.getDate("fecha"));
//celda5.setCellValue(rs.getDate("fecha"));
celda6=fila.createCell(6);
celda6.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda6.setCellValue(rs.getDouble("precioServicio"));
celda7=fila.createCell(7);
celda7.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda7.setCellValue(rs.getInt("numeroComprobante"));
celda8=fila.createCell(8);
celda8.setCellType(HSSFCell.CELL_TYPE_STRING);
celda8.setCellValue(rs.getString("nombreC"));
celda9=fila.createCell(9);
celda9.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
Double tto=0.00;
tto=rs.getDouble("precioServicio")+ rs.getDouble("precioDeVenta");
celda9.setCellValue(tto);
celda10=fila.createCell(10);
celda10.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda10.setCellValue(rs.getInt("id"));
}
form=null;
sql="SELECT *,(select usuarios.nombre from usuarios where usuarios.numero=movimientoscaja.numeroUsuario)as nombreUsuario,(select listcli.RAZON_SOCI from listcli where listcli.id=movimientoscaja.idCliente)as nombreCliente,(select tipocomprobantes.descripcion from tipocomprobantes where tipocomprobantes.numero=movimientoscaja.tipoComprobante)as nombreComprobante,(select tipomovimientos.DESCRIPCION from tipomovimientos where tipomovimientos.ID=movimientoscaja.tipoMovimiento)as nombreMov FROM movimientoscaja where fecha between '"+desde+"' and '"+hasta+"' order by id";
//System.out.println(sql);
//tra=new Conecciones();
rs=tra.leerConjuntoDeRegistros(sql);
//HSSFCellStyle titulo=libro.createCellStyle();
titulo.setFont(fuente);
//titulo.setFillBackgroundColor((short)22);
titulo.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
titulo.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
//for(int a=0;a < 100;a++){
col=0;
a=0;
if(a==0){
fila=hoja2.createRow(a);
celda=fila.createCell(0);
celda.setCellStyle(titulo);
celda.setCellValue("Cajero");
celda1=fila.createCell(1);
celda1.setCellStyle(titulo);
celda1.setCellValue("Cliente");
celda2=fila.createCell(2);
celda2.setCellStyle(titulo);
celda2.setCellValue("Comprobante Numero");
celda3=fila.createCell(3);
celda3.setCellStyle(titulo);
celda3.setCellValue("Tipo Comprobante");
celda4=fila.createCell(4);
celda4.setCellStyle(titulo);
celda4.setCellValue("Monto");
celda5=fila.createCell(5);
celda5.setCellStyle(titulo);
celda5.setCellValue("Fecha");
celda6=fila.createCell(6);
celda6.setCellStyle(titulo);
celda6.setCellValue("Tipo de Movimiento");
celda7=fila.createCell(7);
celda7.setCellStyle(titulo);
celda7.setCellValue("Condicion");
celda8=fila.createCell(8);
celda8.setCellStyle(titulo);
celda8.setCellValue("idMovimiento");
}
while(rs.next()){
a++;
//col=rs.getInt("tipoMovimiento");
switch(col){
case 1:
break;
default:
break;
}
fila=hoja2.createRow(a);
celda=fila.createCell(0);
ttx=ttx;
celda.setCellType(HSSFCell.CELL_TYPE_STRING);
celda.setCellValue(rs.getString("nombreUsuario"));
celda1=fila.createCell(1);
ttx=ttx;
celda1.setCellType(HSSFCell.CELL_TYPE_STRING);
celda1.setCellValue(rs.getString("nombreCliente"));
celda2=fila.createCell(2);
celda2.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda2.setCellValue(rs.getInt("numeroComprobante"));
celda3=fila.createCell(3);
celda3.setCellType(HSSFCell.CELL_TYPE_STRING);
celda3.setCellValue(rs.getString("nombreComprobante"));
celda4=fila.createCell(4);
celda4.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda4.setCellValue(rs.getDouble("monto"));
celda5=fila.createCell(5);
//celda5.setCellFormula(rs.getString("observaciones"));
celda5.setCellType(HSSFCell.CELL_TYPE_STRING);
celda5.setCellValue(" "+rs.getDate("fecha"));
//celda5.setCellValue(rs.getDate("fecha"));
celda6=fila.createCell(6);
celda6.setCellType(HSSFCell.CELL_TYPE_STRING);
celda6.setCellValue(rs.getString("nombreMov"));
celda7=fila.createCell(7);
String pagado="PAGADO";
if(rs.getInt("pagado")==0 && rs.getInt("tipoMovimiento")==1)pagado="CTA CTE";
celda7.setCellType(HSSFCell.CELL_TYPE_STRING);
celda7.setCellValue(pagado);
celda8=fila.createCell(8);
celda8.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda8.setCellValue(rs.getInt("id"));
celda8=fila.createCell(9);
celda8.setCellType(HSSFCell.CELL_TYPE_STRING);
celda8.setCellValue(rs.getString("observaciones"));
}
rs.close();
//texto+="\r\n";
String ruta=Inicio.fechaDia+"_"+Inicio.usuario.getNombre()+" - informeMensual.xls";
String nombree=Inicio.fechaDia+"_"+Inicio.usuario.getNombre()+" - informeMenusual.xls";
try {
FileOutputStream elFichero=new FileOutputStream(ruta);
try {
libro.write(elFichero);
elFichero.close();
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+ruta);
/*
Mail mail=new Mail();
mail.setDetalleListado(nombree);
mail.setDireccionFile(ruta);
mail.setAsunto("Informe mensual "+Inicio.fechaDia+" Sucursal: PocoPrecio 1 ");
mail.enviarMailRepartoCargaCompleta();
*/
} catch (IOException ex) {
Logger.getLogger(InformeMensual.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (FileNotFoundException ex) {
Logger.getLogger(InformeMensual.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| UTF-8 | Java | 19,399 | java | InformesCajas.java | Java | [
{
"context": "ss.usermodel.IndexedColors;\r\n\r\n/**\r\n *\r\n * @author mauro\r\n */\r\npublic class InformesCajas {\r\n public void G",
"end": 1027,
"score": 0.9211833477020264,
"start": 1022,
"tag": "USERNAME",
"value": "mauro"
}
] | null | [] | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Excel;
import Conversores.Numeros;
import interfaceGraficas.Inicio;
import interfaces.Transaccionable;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.MessagingException;
import javax.swing.JOptionPane;
import objetos.ConeccionLocal;
import objetos.Conecciones;
import objetos.Mail;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.DataFormat;
import org.apache.poi.ss.usermodel.IndexedColors;
/**
*
* @author mauro
*/
public class InformesCajas {
public void GenerarInformeDeArticulos(String desde,String hasta) throws SQLException{
HSSFWorkbook libro=new HSSFWorkbook();
HSSFSheet hoja=libro.createSheet("Articulos");
/*
* GENERAR LAS SIGUIENTES HOJAS
* 1- DETALLE DE MOVIMIENTOS DE CAJA - LEE EN MOVIMIENTOS CAJA INDENTIFICANDO EL TIPO DE MOVIMIENTO, USUARIOS Y
* NUMERO DE CAJA
* 2- DETALLE DE ARTICULOS VENDIDOS: LISTADO DE MOVIEMIENTOS DE ARTICULOS, CON USUARIOS Y CAJA
* 3- DETALLE DE GASTOS : MOVIMIENTOS DE CAJA DETALLANDO LOS GASTOS
*
*/
HSSFSheet hoja1=libro.createSheet("Movimientos");
HSSFSheet hoja2=libro.createSheet("Movimientos Caja");
String ttx="celda numero :";
HSSFRow fila=null;
HSSFCell celda;
HSSFCell celda1;
HSSFCell celda2;
HSSFCell celda3;
HSSFCell celda4;
HSSFCell celda5;
HSSFCell celda6;
HSSFCell celda7;
HSSFCell celda8;
HSSFCell celda9;
HSSFCell celda10;
HSSFFont fuente=libro.createFont();
//fuente.setFontHeight((short)21);
fuente.setFontName(fuente.FONT_ARIAL);
fuente.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
String form=null;
String porcentajeG=JOptionPane.showInputDialog("Ingrese porcentaje de ganancia estimada");
Double porcentaje=Numeros.ConvertirStringADouble(porcentajeG);
Double resultado;
Double totalisados;
porcentaje=porcentaje / 100;
//String sql="select id,nombre,(select sum(movimientosarticulos.cantidad) from movimientosarticulos where movimientosarticulos.idarticulo=articulos.id and movimientosarticulos.fecha between '"+desde+"' and '"+hasta+"')as stock,(select sum(movimientosarticulos.cantidad) from movimientosarticulos where movimientosarticulos.fecha between '"+desde+"' and '"+hasta+"' and movimientosarticulos.idarticulo=articulos.id)as cantidadVendida from articulos";
String sql="select *,sum(cantidad)as cantidadT,sum(precioDeCosto * cantidad)as costoT,sum(precioDeVenta)as ventaT,(select articulos.NOMBRE from articulos where articulos.ID=movimientosarticulos.idArticulo)as descripcion from movimientosarticulos where fecha between '"+desde+"' and '"+hasta+"' group by idArticulo order by cantidadT";
System.out.println(sql);
Transaccionable tra=new ConeccionLocal();
ResultSet rs=tra.leerConjuntoDeRegistros(sql);
HSSFCellStyle titulo=libro.createCellStyle();
HSSFCellStyle celdaSt=null;
DataFormat format=libro.createDataFormat();
titulo.setFont(fuente);
//titulo.setFillBackgroundColor((short)22);
titulo.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
titulo.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
celdaSt=libro.createCellStyle();
celdaSt.setDataFormat(format.getFormat("$ #,##0.00"));
//for(int a=0;a < 100;a++){
int col=0;
int a=0;
if(a==0){
fila=hoja.createRow(a);
celda=fila.createCell(0);
celda.setCellStyle(titulo);
celda.setCellValue("id");
celda1=fila.createCell(1);
celda1.setCellStyle(titulo);
celda1.setCellValue("nombre");
celda2=fila.createCell(2);
celda2.setCellStyle(titulo);
celda2.setCellValue("Unidades Vendidas");
celda3=fila.createCell(3);
celda3.setCellStyle(titulo);
celda3.setCellValue("Precio de Costo");
celda4=fila.createCell(4);
celda4.setCellStyle(titulo);
celda4.setCellValue("Precio de Venta");
celda5=fila.createCell(5);
celda5.setCellStyle(titulo);
celda5.setCellValue("Fecha");
celda6=fila.createCell(6);
celda6.setCellStyle(titulo);
celda6.setCellValue("Ganancia Estimada");
celda7=fila.createCell(7);
celda7.setCellStyle(titulo);
celda7.setCellValue("Ganancia del "+porcentajeG+" %");
}
while(rs.next()){
a++;
//col=rs.getInt("tipoMovimiento");
switch(col){
case 1:
break;
default:
break;
}
fila=hoja.createRow(a);
resultado=0.00;
celda=fila.createCell(0);
ttx=ttx;
Double anterior=0.00;
Double actual=0.00;
Double vendido=0.00;
celda.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda.setCellValue(rs.getInt("idArticulo"));
celda1=fila.createCell(1);
ttx=ttx;
celda1.setCellType(HSSFCell.CELL_TYPE_STRING);
celda1.setCellValue(rs.getString("descripcion"));
celda2=fila.createCell(2);
vendido=(rs.getDouble("cantidadT")) * -1;
//actual=rs.getDouble("stock");
celda2.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda2.setCellValue(vendido);
celda3=fila.createCell(3);
//vendido=(rs.getDouble("cantidadT")) * -1;
//actual=rs.getDouble("stock");
celda3.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda3.setCellValue(rs.getDouble("costoT") * (-1));
celda3.setCellStyle(celdaSt);
celda4=fila.createCell(4);
//vendido=(rs.getDouble("cantidadT")) * -1;
//actual=rs.getDouble("stock");
celda4.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda4.setCellValue(rs.getDouble("ventaT"));
celda4.setCellStyle(celdaSt);
celda5=fila.createCell(5);
//vendido=(rs.getDouble("cantidadVendida")) * -1;
celda5.setCellType(HSSFCell.CELL_TYPE_STRING);
celda5.setCellValue(rs.getString("fecha"));
celda6=fila.createCell(6);
celda6.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
if(rs.getDouble("costoT")==0.00){
totalisados=rs.getDouble("ventaT");
resultado=totalisados * porcentaje;
}else{
resultado=rs.getDouble("ventaT");
totalisados=rs.getDouble("costoT") * (-1);
resultado=resultado - totalisados;
}
celda6.setCellValue(resultado);
celda6.setCellStyle(celdaSt);
celda7=fila.createCell(7);
celda7.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
totalisados=rs.getDouble("ventaT");
resultado=totalisados * porcentaje;
celda7.setCellStyle(celdaSt);
celda7.setCellValue(resultado);
}
/*
CIERRE DE HOJA
*/
hoja.autoSizeColumn((short)0);
hoja.autoSizeColumn((short)1);
hoja.autoSizeColumn((short)2);
hoja.autoSizeColumn((short)3);
hoja.autoSizeColumn((short)4);
hoja.autoSizeColumn((short)5);
hoja.autoSizeColumn((short)6);
hoja.autoSizeColumn((short)7);
//rs.close();
// hoja 2
form=null;
sql="SELECT id,cantidad,preciodecosto,preciodeventa,precioservicio,fecha,numerocomprobante,(select listcli.RAZON_SOCI from listcli where listcli.codMmd=movimientosarticulos.numeroCliente limit 0,1)as nombreC,(select articulos.NOMBRE from articulos where articulos.ID=movimientosarticulos.idArticulo limit 0,1)as descA,(select usuarios.nombre from usuarios where usuarios.numero=movimientosarticulos.numeroUsuario limit 0,1) as nombreU FROM movimientosarticulos where tipoMovimiento =1 and fecha between '"+desde+"' and '"+hasta+"'";
//System.out.println(sql);
//tra=new Conecciones();
rs=tra.leerConjuntoDeRegistros(sql);
//HSSFCellStyle titulo=libro.createCellStyle();
titulo.setFont(fuente);
//titulo.setFillBackgroundColor((short)22);
titulo.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
titulo.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
//for(int a=0;a < 100;a++){
col=0;
a=0;
if(a==0){
fila=hoja1.createRow(a);
celda=fila.createCell(0);
celda.setCellStyle(titulo);
celda.setCellValue("Cajero");
celda1=fila.createCell(1);
celda1.setCellStyle(titulo);
celda1.setCellValue("Descripcion Articulo");
celda2=fila.createCell(2);
celda2.setCellStyle(titulo);
celda2.setCellValue("Cantidad");
celda3=fila.createCell(3);
celda3.setCellStyle(titulo);
celda3.setCellValue("Precio de Costo");
celda4=fila.createCell(4);
celda4.setCellStyle(titulo);
celda4.setCellValue("Precio de Venta");
celda5=fila.createCell(5);
celda5.setCellStyle(titulo);
celda5.setCellValue("Fecha");
celda6=fila.createCell(6);
celda6.setCellStyle(titulo);
celda6.setCellValue("Precio de Servicio");
celda7=fila.createCell(7);
celda7.setCellStyle(titulo);
celda7.setCellValue("comprobante");
celda8=fila.createCell(8);
celda8.setCellStyle(titulo);
celda8.setCellValue("Cliente");
celda9=fila.createCell(9);
celda9.setCellStyle(titulo);
celda9.setCellValue("Total");
celda10=fila.createCell(10);
celda10.setCellStyle(titulo);
celda10.setCellValue("idMovimiento");
}
while(rs.next()){
a++;
//col=rs.getInt("tipoMovimiento");
switch(col){
case 1:
break;
default:
break;
}
fila=hoja1.createRow(a);
celda=fila.createCell(0);
ttx=ttx;
celda.setCellType(HSSFCell.CELL_TYPE_STRING);
celda.setCellValue(rs.getString("nombreU"));
celda1=fila.createCell(1);
ttx=ttx;
celda1.setCellType(HSSFCell.CELL_TYPE_STRING);
celda1.setCellValue(rs.getString("descA"));
celda2=fila.createCell(2);
celda2.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda2.setCellValue(rs.getDouble("cantidad"));
celda3=fila.createCell(3);
celda3.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda3.setCellValue(rs.getDouble("precioDeCosto"));
celda4=fila.createCell(4);
celda4.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda4.setCellValue(rs.getDouble("precioDeVenta"));
celda5=fila.createCell(5);
//celda5.setCellFormula(rs.getString("observaciones"));
celda5.setCellType(HSSFCell.CELL_TYPE_STRING);
celda5.setCellValue(" "+rs.getDate("fecha"));
//celda5.setCellValue(rs.getDate("fecha"));
celda6=fila.createCell(6);
celda6.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda6.setCellValue(rs.getDouble("precioServicio"));
celda7=fila.createCell(7);
celda7.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda7.setCellValue(rs.getInt("numeroComprobante"));
celda8=fila.createCell(8);
celda8.setCellType(HSSFCell.CELL_TYPE_STRING);
celda8.setCellValue(rs.getString("nombreC"));
celda9=fila.createCell(9);
celda9.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
Double tto=0.00;
tto=rs.getDouble("precioServicio")+ rs.getDouble("precioDeVenta");
celda9.setCellValue(tto);
celda10=fila.createCell(10);
celda10.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda10.setCellValue(rs.getInt("id"));
}
form=null;
sql="SELECT *,(select usuarios.nombre from usuarios where usuarios.numero=movimientoscaja.numeroUsuario)as nombreUsuario,(select listcli.RAZON_SOCI from listcli where listcli.id=movimientoscaja.idCliente)as nombreCliente,(select tipocomprobantes.descripcion from tipocomprobantes where tipocomprobantes.numero=movimientoscaja.tipoComprobante)as nombreComprobante,(select tipomovimientos.DESCRIPCION from tipomovimientos where tipomovimientos.ID=movimientoscaja.tipoMovimiento)as nombreMov FROM movimientoscaja where fecha between '"+desde+"' and '"+hasta+"' order by id";
//System.out.println(sql);
//tra=new Conecciones();
rs=tra.leerConjuntoDeRegistros(sql);
//HSSFCellStyle titulo=libro.createCellStyle();
titulo.setFont(fuente);
//titulo.setFillBackgroundColor((short)22);
titulo.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
titulo.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
//for(int a=0;a < 100;a++){
col=0;
a=0;
if(a==0){
fila=hoja2.createRow(a);
celda=fila.createCell(0);
celda.setCellStyle(titulo);
celda.setCellValue("Cajero");
celda1=fila.createCell(1);
celda1.setCellStyle(titulo);
celda1.setCellValue("Cliente");
celda2=fila.createCell(2);
celda2.setCellStyle(titulo);
celda2.setCellValue("Comprobante Numero");
celda3=fila.createCell(3);
celda3.setCellStyle(titulo);
celda3.setCellValue("Tipo Comprobante");
celda4=fila.createCell(4);
celda4.setCellStyle(titulo);
celda4.setCellValue("Monto");
celda5=fila.createCell(5);
celda5.setCellStyle(titulo);
celda5.setCellValue("Fecha");
celda6=fila.createCell(6);
celda6.setCellStyle(titulo);
celda6.setCellValue("Tipo de Movimiento");
celda7=fila.createCell(7);
celda7.setCellStyle(titulo);
celda7.setCellValue("Condicion");
celda8=fila.createCell(8);
celda8.setCellStyle(titulo);
celda8.setCellValue("idMovimiento");
}
while(rs.next()){
a++;
//col=rs.getInt("tipoMovimiento");
switch(col){
case 1:
break;
default:
break;
}
fila=hoja2.createRow(a);
celda=fila.createCell(0);
ttx=ttx;
celda.setCellType(HSSFCell.CELL_TYPE_STRING);
celda.setCellValue(rs.getString("nombreUsuario"));
celda1=fila.createCell(1);
ttx=ttx;
celda1.setCellType(HSSFCell.CELL_TYPE_STRING);
celda1.setCellValue(rs.getString("nombreCliente"));
celda2=fila.createCell(2);
celda2.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda2.setCellValue(rs.getInt("numeroComprobante"));
celda3=fila.createCell(3);
celda3.setCellType(HSSFCell.CELL_TYPE_STRING);
celda3.setCellValue(rs.getString("nombreComprobante"));
celda4=fila.createCell(4);
celda4.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda4.setCellValue(rs.getDouble("monto"));
celda5=fila.createCell(5);
//celda5.setCellFormula(rs.getString("observaciones"));
celda5.setCellType(HSSFCell.CELL_TYPE_STRING);
celda5.setCellValue(" "+rs.getDate("fecha"));
//celda5.setCellValue(rs.getDate("fecha"));
celda6=fila.createCell(6);
celda6.setCellType(HSSFCell.CELL_TYPE_STRING);
celda6.setCellValue(rs.getString("nombreMov"));
celda7=fila.createCell(7);
String pagado="PAGADO";
if(rs.getInt("pagado")==0 && rs.getInt("tipoMovimiento")==1)pagado="CTA CTE";
celda7.setCellType(HSSFCell.CELL_TYPE_STRING);
celda7.setCellValue(pagado);
celda8=fila.createCell(8);
celda8.setCellType(HSSFCell.CELL_TYPE_NUMERIC);
celda8.setCellValue(rs.getInt("id"));
celda8=fila.createCell(9);
celda8.setCellType(HSSFCell.CELL_TYPE_STRING);
celda8.setCellValue(rs.getString("observaciones"));
}
rs.close();
//texto+="\r\n";
String ruta=Inicio.fechaDia+"_"+Inicio.usuario.getNombre()+" - informeMensual.xls";
String nombree=Inicio.fechaDia+"_"+Inicio.usuario.getNombre()+" - informeMenusual.xls";
try {
FileOutputStream elFichero=new FileOutputStream(ruta);
try {
libro.write(elFichero);
elFichero.close();
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler "+ruta);
/*
Mail mail=new Mail();
mail.setDetalleListado(nombree);
mail.setDireccionFile(ruta);
mail.setAsunto("Informe mensual "+Inicio.fechaDia+" Sucursal: PocoPrecio 1 ");
mail.enviarMailRepartoCargaCompleta();
*/
} catch (IOException ex) {
Logger.getLogger(InformeMensual.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (FileNotFoundException ex) {
Logger.getLogger(InformeMensual.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
| 19,399 | 0.583948 | 0.566988 | 439 | 42.189068 | 46.727615 | 579 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.865604 | false | false | 9 |
9c093605e9a8427a64a89b19b01da4c5ed9bb7c4 | 30,674,656,431,338 | 216f719e7a53e41aacc4a52341c6df282a5bfeb1 | /aula3/src/main/java/br/edu/utfpr/pb/aula3/service/impl/GeneroServiceImpl.java | 6a15ff174f18b599ec060ff628461f91308d19f1 | [] | no_license | viniciuspegorini/pw25s-2020-1 | https://github.com/viniciuspegorini/pw25s-2020-1 | 5919bb93648c28a16d10ef1711fffb480407bca4 | 64636be4b960a32b32c5cd5e04dce2d63ef6b3fe | refs/heads/master | 2021-02-14T10:42:57.905000 | 2020-03-24T23:48:24 | 2020-03-24T23:48:24 | 244,797,939 | 3 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package br.edu.utfpr.pb.aula3.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import br.edu.utfpr.pb.aula3.model.Genero;
import br.edu.utfpr.pb.aula3.repository.GeneroRepository;
import br.edu.utfpr.pb.aula3.service.GeneroService;
@Service
public class GeneroServiceImpl extends CrudServiceImpl<Genero, Long>
implements GeneroService{
@Autowired
private GeneroRepository generoRepository;
@Override
protected JpaRepository<Genero, Long> getRepository() {
return generoRepository;
}
@Override
@Transactional(readOnly = true)
public List<Genero> findByNomeLike(String nome) {
return generoRepository.findByNomeLike(nome);
}
}
| UTF-8 | Java | 874 | java | GeneroServiceImpl.java | Java | [] | null | [] | package br.edu.utfpr.pb.aula3.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import br.edu.utfpr.pb.aula3.model.Genero;
import br.edu.utfpr.pb.aula3.repository.GeneroRepository;
import br.edu.utfpr.pb.aula3.service.GeneroService;
@Service
public class GeneroServiceImpl extends CrudServiceImpl<Genero, Long>
implements GeneroService{
@Autowired
private GeneroRepository generoRepository;
@Override
protected JpaRepository<Genero, Long> getRepository() {
return generoRepository;
}
@Override
@Transactional(readOnly = true)
public List<Genero> findByNomeLike(String nome) {
return generoRepository.findByNomeLike(nome);
}
}
| 874 | 0.815789 | 0.811213 | 32 | 26.3125 | 24.235096 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.90625 | false | false | 9 |
fcf41362803d2efef7e42c48f2920f5c39e73540 | 1,486,058,703,322 | 118f16aff64fd08b534d6be7b3aca3e2f396dbca | /src/main/java/com/api/pizza/model/Variety.java | 506c7b836ac0e3c6af88d708216da9386ae93b31 | [] | no_license | mmukeshkumar/pizza-api | https://github.com/mmukeshkumar/pizza-api | dbbaded95c94b9cb17e8929cadadee492b83aef8 | 7524473f63cc8115e7fbd886a8382925ca4a5817 | refs/heads/master | 2020-04-15T06:21:31.695000 | 2019-02-10T19:37:15 | 2019-02-10T19:37:15 | 164,457,924 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.api.pizza.model;
public enum Variety {
MARGARITA_PIZZA, REGULAR_CHEESE_PIZZA, PEPPERONI;
}
| UTF-8 | Java | 111 | java | Variety.java | Java | [] | null | [] | package com.api.pizza.model;
public enum Variety {
MARGARITA_PIZZA, REGULAR_CHEESE_PIZZA, PEPPERONI;
}
| 111 | 0.72973 | 0.72973 | 8 | 12.875 | 18.401342 | 53 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false | 9 |
6891c0c0a408e43c3206b1183a4e7eb011bf3b14 | 14,637,248,546,047 | 74136e101914c44bce00e3d14f97d610804747d8 | /大作业/PRO/src/model/Activity.java | b182cd4032ad0b571692a545e6ed6a357027e355 | [] | no_license | sin7777/Course-Java | https://github.com/sin7777/Course-Java | 82ff6c9f7ff4133130852a4c5f6f3126186f8ba3 | d1734e494339fd0fd504294ff8fa8c2bcb19e096 | refs/heads/master | 2020-06-29T00:48:03.994000 | 2019-08-08T07:35:37 | 2019-08-08T07:35:37 | 200,389,190 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package model;
import java.awt.List;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import com.csvreader.CsvReader;
public class Activity {
private int order;
private String name;
private String[] time;
private String location;
private String clubs;
private String slogan;
private String reference;
public int getOrder()
{
return order;
}
private void setOrder(int row)
{
order=row;
}
public String getName()
{
return name;
}
public long getEstablishTime()
{
return Long.parseLong(time[0])*365*24*3600*1000+Long.parseLong(time[1])*30*24*3600*1000+Long.parseLong(time[2])*24*3600*1000;
}
public String toString()
{
String times=time[0];
times+=".";
times+=time[1];
times+=".";
times+=time[2];
return "<html>" + name + "<br>" + times + "<br>" + location + "<br>" + clubs + "<br>" + slogan + "<br>" + reference + "</html>";
}
public static ArrayList<Activity> createActivities()
{
ArrayList<Activity> activities=null;
try{
ArrayList<String[]> csvList=new ArrayList<String[]>();
CsvReader reader=new CsvReader("活动表.csv",',',Charset.forName("gbk"));
reader.readHeaders();
while(reader.readRecord())
{
csvList.add(reader.getValues());
}
reader.close();
activities=new ArrayList<Activity>(csvList.size()-1);
for(int row=1;row<csvList.size();row++)
{
activities.add(new Activity());
activities.get(row-1).setOrder(row);
activities.get(row-1).name=csvList.get(row)[0];
activities.get(row-1).time=csvList.get(row)[1].split("[.]");
activities.get(row-1).location=csvList.get(row)[2];
activities.get(row-1).clubs=csvList.get(row)[3];
activities.get(row-1).slogan=csvList.get(row)[4];
activities.get(row-1).reference=csvList.get(row)[5];
}
}catch(IOException e){
e.printStackTrace();
}
return activities;
}
public static void main(String[] args)
{
ArrayList<Activity> list=createActivities();
for(Activity a : list)
System.out.println(a.getEstablishTime());
}
}
| UTF-8 | Java | 2,061 | java | Activity.java | Java | [] | null | [] | package model;
import java.awt.List;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import com.csvreader.CsvReader;
public class Activity {
private int order;
private String name;
private String[] time;
private String location;
private String clubs;
private String slogan;
private String reference;
public int getOrder()
{
return order;
}
private void setOrder(int row)
{
order=row;
}
public String getName()
{
return name;
}
public long getEstablishTime()
{
return Long.parseLong(time[0])*365*24*3600*1000+Long.parseLong(time[1])*30*24*3600*1000+Long.parseLong(time[2])*24*3600*1000;
}
public String toString()
{
String times=time[0];
times+=".";
times+=time[1];
times+=".";
times+=time[2];
return "<html>" + name + "<br>" + times + "<br>" + location + "<br>" + clubs + "<br>" + slogan + "<br>" + reference + "</html>";
}
public static ArrayList<Activity> createActivities()
{
ArrayList<Activity> activities=null;
try{
ArrayList<String[]> csvList=new ArrayList<String[]>();
CsvReader reader=new CsvReader("活动表.csv",',',Charset.forName("gbk"));
reader.readHeaders();
while(reader.readRecord())
{
csvList.add(reader.getValues());
}
reader.close();
activities=new ArrayList<Activity>(csvList.size()-1);
for(int row=1;row<csvList.size();row++)
{
activities.add(new Activity());
activities.get(row-1).setOrder(row);
activities.get(row-1).name=csvList.get(row)[0];
activities.get(row-1).time=csvList.get(row)[1].split("[.]");
activities.get(row-1).location=csvList.get(row)[2];
activities.get(row-1).clubs=csvList.get(row)[3];
activities.get(row-1).slogan=csvList.get(row)[4];
activities.get(row-1).reference=csvList.get(row)[5];
}
}catch(IOException e){
e.printStackTrace();
}
return activities;
}
public static void main(String[] args)
{
ArrayList<Activity> list=createActivities();
for(Activity a : list)
System.out.println(a.getEstablishTime());
}
}
| 2,061 | 0.667153 | 0.639903 | 87 | 22.620689 | 24.459791 | 130 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.287356 | false | false | 9 |
6952a3b9aae309757126ae16d9cc712a1b81a979 | 18,683,107,801,764 | 4cfda4f1b4d7703e1b460359012082c158103476 | /miliconvert/xsmt/trunk/plugins/org.miliconvert.xsmt.mpgt/src/mpia/schema/TypeCompositionDotationTheoriqueEnType.java | 66480c285474876f4e71d6d92aa028dc8dab9e60 | [] | no_license | opensourcejavadeveloper/military_xml_project_miliconvert | https://github.com/opensourcejavadeveloper/military_xml_project_miliconvert | e62dee54499fdb8abaa76a9d44ed97ace19dc887 | bb0276970c243ec3acc07fd4b255673d6d7dd080 | refs/heads/master | 2022-01-10T18:11:39.021000 | 2018-08-20T12:45:02 | 2018-08-20T12:45:02 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* <copyright>
* </copyright>
*
* $Id$
*/
package mpia.schema;
import mpia.meta.TypeAssociation;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Type Composition Dotation Theorique En Type</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#isPartieMajeure <em>Partie Majeure</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getQuantite <em>Quantite</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getCTE <em>CTE</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getCE <em>CE</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getEstComposantDotationTheorique <em>Est Composant Dotation Theorique</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getAPourReferenceType <em>APour Reference Type</em>}</li>
* </ul>
* </p>
*
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType()
* @model annotation="urn:MPIA-schemaInfo entity_Type='INSTANCIABLE_ENTITY'"
* extendedMetaData="name='type_CompositionDotationTheoriqueEnType' kind='elementOnly'"
* @generated
*/
public interface TypeCompositionDotationTheoriqueEnType extends EObject {
/**
* Returns the value of the '<em><b>Partie Majeure</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Partie Majeure</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Partie Majeure</em>' attribute.
* @see #isSetPartieMajeure()
* @see #unsetPartieMajeure()
* @see #setPartieMajeure(boolean)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_PartieMajeure()
* @model unsettable="true" dataType="mpia.meta.TypeBoolean"
* extendedMetaData="kind='element' name='PartieMajeure'"
* @generated
*/
boolean isPartieMajeure();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#isPartieMajeure <em>Partie Majeure</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Partie Majeure</em>' attribute.
* @see #isSetPartieMajeure()
* @see #unsetPartieMajeure()
* @see #isPartieMajeure()
* @generated
*/
void setPartieMajeure(boolean value);
/**
* Unsets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#isPartieMajeure <em>Partie Majeure</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetPartieMajeure()
* @see #isPartieMajeure()
* @see #setPartieMajeure(boolean)
* @generated
*/
void unsetPartieMajeure();
/**
* Returns whether the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#isPartieMajeure <em>Partie Majeure</em>}' attribute is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Partie Majeure</em>' attribute is set.
* @see #unsetPartieMajeure()
* @see #isPartieMajeure()
* @see #setPartieMajeure(boolean)
* @generated
*/
boolean isSetPartieMajeure();
/**
* Returns the value of the '<em><b>Quantite</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Quantite</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Quantite</em>' attribute.
* @see #isSetQuantite()
* @see #unsetQuantite()
* @see #setQuantite(long)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_Quantite()
* @model unsettable="true" dataType="mpia.meta.TypeDataTypeEntier9" required="true"
* extendedMetaData="kind='element' name='Quantite'"
* @generated
*/
long getQuantite();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getQuantite <em>Quantite</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Quantite</em>' attribute.
* @see #isSetQuantite()
* @see #unsetQuantite()
* @see #getQuantite()
* @generated
*/
void setQuantite(long value);
/**
* Unsets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getQuantite <em>Quantite</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetQuantite()
* @see #getQuantite()
* @see #setQuantite(long)
* @generated
*/
void unsetQuantite();
/**
* Returns whether the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getQuantite <em>Quantite</em>}' attribute is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Quantite</em>' attribute is set.
* @see #unsetQuantite()
* @see #getQuantite()
* @see #setQuantite(long)
* @generated
*/
boolean isSetQuantite();
/**
* Returns the value of the '<em><b>CTE</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>CTE</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>CTE</em>' attribute.
* @see #setCTE(String)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_CTE()
* @model dataType="mpia.meta.TypeDataTypeChaine030" required="true"
* extendedMetaData="kind='element' name='CTE'"
* @generated
*/
String getCTE();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getCTE <em>CTE</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>CTE</em>' attribute.
* @see #getCTE()
* @generated
*/
void setCTE(String value);
/**
* Returns the value of the '<em><b>CE</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>CE</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>CE</em>' attribute.
* @see #setCE(String)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_CE()
* @model dataType="mpia.meta.TypeDataTypeChaine0100"
* extendedMetaData="kind='element' name='CE'"
* @generated
*/
String getCE();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getCE <em>CE</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>CE</em>' attribute.
* @see #getCE()
* @generated
*/
void setCE(String value);
/**
* Returns the value of the '<em><b>Est Composant Dotation Theorique</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Est Composant Dotation Theorique</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Est Composant Dotation Theorique</em>' containment reference.
* @see #setEstComposantDotationTheorique(TypeAssociation)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_EstComposantDotationTheorique()
* @model containment="true" required="true"
* annotation="urn:MPIA-schemaInfo relation_type='ASSOCIATION' reverse_association='EstSpecifieAuTravers_CompositionDotationTheoriqueEnType' target_entity='type_DotationTheorique'"
* extendedMetaData="kind='element' name='EstComposant_DotationTheorique'"
* @generated
*/
TypeAssociation getEstComposantDotationTheorique();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getEstComposantDotationTheorique <em>Est Composant Dotation Theorique</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Est Composant Dotation Theorique</em>' containment reference.
* @see #getEstComposantDotationTheorique()
* @generated
*/
void setEstComposantDotationTheorique(TypeAssociation value);
/**
* Returns the value of the '<em><b>APour Reference Type</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>APour Reference Type</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>APour Reference Type</em>' containment reference.
* @see #setAPourReferenceType(TypeAssociation)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_APourReferenceType()
* @model containment="true" required="true"
* annotation="urn:MPIA-schemaInfo relation_type='ASSOCIATION' reverse_association='EstSpecifieCommePart_CompositionDotationTheoriqueEnType' target_entity='type_Type'"
* extendedMetaData="kind='element' name='APourReference_Type'"
* @generated
*/
TypeAssociation getAPourReferenceType();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getAPourReferenceType <em>APour Reference Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>APour Reference Type</em>' containment reference.
* @see #getAPourReferenceType()
* @generated
*/
void setAPourReferenceType(TypeAssociation value);
} // TypeCompositionDotationTheoriqueEnType
| UTF-8 | Java | 9,719 | java | TypeCompositionDotationTheoriqueEnType.java | Java | [] | null | [] | /**
* <copyright>
* </copyright>
*
* $Id$
*/
package mpia.schema;
import mpia.meta.TypeAssociation;
import org.eclipse.emf.ecore.EObject;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Type Composition Dotation Theorique En Type</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#isPartieMajeure <em>Partie Majeure</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getQuantite <em>Quantite</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getCTE <em>CTE</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getCE <em>CE</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getEstComposantDotationTheorique <em>Est Composant Dotation Theorique</em>}</li>
* <li>{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getAPourReferenceType <em>APour Reference Type</em>}</li>
* </ul>
* </p>
*
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType()
* @model annotation="urn:MPIA-schemaInfo entity_Type='INSTANCIABLE_ENTITY'"
* extendedMetaData="name='type_CompositionDotationTheoriqueEnType' kind='elementOnly'"
* @generated
*/
public interface TypeCompositionDotationTheoriqueEnType extends EObject {
/**
* Returns the value of the '<em><b>Partie Majeure</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Partie Majeure</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Partie Majeure</em>' attribute.
* @see #isSetPartieMajeure()
* @see #unsetPartieMajeure()
* @see #setPartieMajeure(boolean)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_PartieMajeure()
* @model unsettable="true" dataType="mpia.meta.TypeBoolean"
* extendedMetaData="kind='element' name='PartieMajeure'"
* @generated
*/
boolean isPartieMajeure();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#isPartieMajeure <em>Partie Majeure</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Partie Majeure</em>' attribute.
* @see #isSetPartieMajeure()
* @see #unsetPartieMajeure()
* @see #isPartieMajeure()
* @generated
*/
void setPartieMajeure(boolean value);
/**
* Unsets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#isPartieMajeure <em>Partie Majeure</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetPartieMajeure()
* @see #isPartieMajeure()
* @see #setPartieMajeure(boolean)
* @generated
*/
void unsetPartieMajeure();
/**
* Returns whether the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#isPartieMajeure <em>Partie Majeure</em>}' attribute is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Partie Majeure</em>' attribute is set.
* @see #unsetPartieMajeure()
* @see #isPartieMajeure()
* @see #setPartieMajeure(boolean)
* @generated
*/
boolean isSetPartieMajeure();
/**
* Returns the value of the '<em><b>Quantite</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Quantite</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Quantite</em>' attribute.
* @see #isSetQuantite()
* @see #unsetQuantite()
* @see #setQuantite(long)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_Quantite()
* @model unsettable="true" dataType="mpia.meta.TypeDataTypeEntier9" required="true"
* extendedMetaData="kind='element' name='Quantite'"
* @generated
*/
long getQuantite();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getQuantite <em>Quantite</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Quantite</em>' attribute.
* @see #isSetQuantite()
* @see #unsetQuantite()
* @see #getQuantite()
* @generated
*/
void setQuantite(long value);
/**
* Unsets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getQuantite <em>Quantite</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetQuantite()
* @see #getQuantite()
* @see #setQuantite(long)
* @generated
*/
void unsetQuantite();
/**
* Returns whether the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getQuantite <em>Quantite</em>}' attribute is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Quantite</em>' attribute is set.
* @see #unsetQuantite()
* @see #getQuantite()
* @see #setQuantite(long)
* @generated
*/
boolean isSetQuantite();
/**
* Returns the value of the '<em><b>CTE</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>CTE</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>CTE</em>' attribute.
* @see #setCTE(String)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_CTE()
* @model dataType="mpia.meta.TypeDataTypeChaine030" required="true"
* extendedMetaData="kind='element' name='CTE'"
* @generated
*/
String getCTE();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getCTE <em>CTE</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>CTE</em>' attribute.
* @see #getCTE()
* @generated
*/
void setCTE(String value);
/**
* Returns the value of the '<em><b>CE</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>CE</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>CE</em>' attribute.
* @see #setCE(String)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_CE()
* @model dataType="mpia.meta.TypeDataTypeChaine0100"
* extendedMetaData="kind='element' name='CE'"
* @generated
*/
String getCE();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getCE <em>CE</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>CE</em>' attribute.
* @see #getCE()
* @generated
*/
void setCE(String value);
/**
* Returns the value of the '<em><b>Est Composant Dotation Theorique</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Est Composant Dotation Theorique</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Est Composant Dotation Theorique</em>' containment reference.
* @see #setEstComposantDotationTheorique(TypeAssociation)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_EstComposantDotationTheorique()
* @model containment="true" required="true"
* annotation="urn:MPIA-schemaInfo relation_type='ASSOCIATION' reverse_association='EstSpecifieAuTravers_CompositionDotationTheoriqueEnType' target_entity='type_DotationTheorique'"
* extendedMetaData="kind='element' name='EstComposant_DotationTheorique'"
* @generated
*/
TypeAssociation getEstComposantDotationTheorique();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getEstComposantDotationTheorique <em>Est Composant Dotation Theorique</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Est Composant Dotation Theorique</em>' containment reference.
* @see #getEstComposantDotationTheorique()
* @generated
*/
void setEstComposantDotationTheorique(TypeAssociation value);
/**
* Returns the value of the '<em><b>APour Reference Type</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>APour Reference Type</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>APour Reference Type</em>' containment reference.
* @see #setAPourReferenceType(TypeAssociation)
* @see mpia.schema.SchemaPackage#getTypeCompositionDotationTheoriqueEnType_APourReferenceType()
* @model containment="true" required="true"
* annotation="urn:MPIA-schemaInfo relation_type='ASSOCIATION' reverse_association='EstSpecifieCommePart_CompositionDotationTheoriqueEnType' target_entity='type_Type'"
* extendedMetaData="kind='element' name='APourReference_Type'"
* @generated
*/
TypeAssociation getAPourReferenceType();
/**
* Sets the value of the '{@link mpia.schema.TypeCompositionDotationTheoriqueEnType#getAPourReferenceType <em>APour Reference Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>APour Reference Type</em>' containment reference.
* @see #getAPourReferenceType()
* @generated
*/
void setAPourReferenceType(TypeAssociation value);
} // TypeCompositionDotationTheoriqueEnType
| 9,719 | 0.688137 | 0.687313 | 254 | 37.263779 | 38.666824 | 188 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.893701 | false | false | 9 |
7b1505a8ec957f2ea5b7de6114c83d2d28b8255b | 25,202,868,153,184 | a3599ea244a54a80e02903ed67a45c1d293dd35d | /mausetod_keinarray/Maus.java | 4d94f825ff3a58675b01014672b0d112c7b5852f | [
"Beerware",
"MIT"
] | permissive | WinPlay02/Schule | https://github.com/WinPlay02/Schule | 74bb329c3750cd9b4fc3cbd71cc77296f2dcbb29 | daddd6b821b04e8df41123387de2c8e2bb4bc228 | refs/heads/master | 2021-04-26T22:57:50.969000 | 2020-01-15T12:10:51 | 2020-01-15T12:10:51 | 123,903,659 | 2 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package mausetod;
public class Maus {
int xPos;
int yPos;
boolean tot;
public boolean getroffen() {
return tot;
}
public Maus(int pX, int pY) {
setzeMausPos(pX, pY);
}
public int getMausPosX() {
return xPos;
}
public int getMausPosY() {
return yPos;
}
public void setzeMausTodesZustand(boolean pZustand) {
tot = pZustand;
}
public void setzeMausPos(int pX, int pY) {
xPos = pX;
yPos = pY;
}
}
| UTF-8 | Java | 429 | java | Maus.java | Java | [] | null | [] | package mausetod;
public class Maus {
int xPos;
int yPos;
boolean tot;
public boolean getroffen() {
return tot;
}
public Maus(int pX, int pY) {
setzeMausPos(pX, pY);
}
public int getMausPosX() {
return xPos;
}
public int getMausPosY() {
return yPos;
}
public void setzeMausTodesZustand(boolean pZustand) {
tot = pZustand;
}
public void setzeMausPos(int pX, int pY) {
xPos = pX;
yPos = pY;
}
}
| 429 | 0.657343 | 0.657343 | 32 | 12.40625 | 13.404428 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.34375 | false | false | 9 |
9fbb3d694ed10aab0c12ba89b5db8927113995f1 | 23,811,298,728,529 | f310f852e75f64756d4a491e03c3c3b61b535427 | /src/com/huangtao/programmerreader/dao/ArticleDbHelper.java | acc89cf9cd633878a9bef19ad1aafaf9e5b553e4 | [] | no_license | thuang136/ProgrammerReader | https://github.com/thuang136/ProgrammerReader | 35b07f090ad230c8fa7aaa21446dbd04b031fb17 | 6390745ad40873a2e53d3222d1fca3c76515e4f9 | refs/heads/master | 2016-08-06T01:08:10.683000 | 2015-08-10T13:45:00 | 2015-08-10T13:45:00 | 39,897,024 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.huangtao.programmerreader.dao;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class ArticleDbHelper extends SQLiteOpenHelper{
private static final String name = "article.db";
private static final int version = 1;
private static final String TAG = ArticleDbHelper.class.getSimpleName();
public ArticleDbHelper(Context context) {
super(context, name, null, version);
// TODO Auto-generated constructor stub
}
@Override
public void onCreate(SQLiteDatabase db) {
Log.i(TAG, "onCreate start");
// TODO Auto-generated method stub
String createSql = " create table if not exists articleInfo (articleId integer primary key autoincrement,title varchar(256),host varchar(128),iconUrl varchar(256))";
db.execSQL(createSql);
Log.i(TAG,"onCreate end");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub
}
} | UTF-8 | Java | 1,134 | java | ArticleDbHelper.java | Java | [] | null | [] | package com.huangtao.programmerreader.dao;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class ArticleDbHelper extends SQLiteOpenHelper{
private static final String name = "article.db";
private static final int version = 1;
private static final String TAG = ArticleDbHelper.class.getSimpleName();
public ArticleDbHelper(Context context) {
super(context, name, null, version);
// TODO Auto-generated constructor stub
}
@Override
public void onCreate(SQLiteDatabase db) {
Log.i(TAG, "onCreate start");
// TODO Auto-generated method stub
String createSql = " create table if not exists articleInfo (articleId integer primary key autoincrement,title varchar(256),host varchar(128),iconUrl varchar(256))";
db.execSQL(createSql);
Log.i(TAG,"onCreate end");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
// TODO Auto-generated method stub
}
} | 1,134 | 0.697531 | 0.688713 | 37 | 29.675676 | 33.001274 | 174 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.621622 | false | false | 9 |
d8ccbd41e7090c8c9a81cd6f3e4af9ce5fabf740 | 5,531,917,938,724 | ee012845c8a1cc61e99fdc1e970552a974b03e49 | /app/src/test/java/com/rajeshbatth/android_testing/core/auth/SignInPresenterTest.java | 704d4ff78f37a4be37dd2a8d9400823b483b4bac | [] | no_license | vinayjayaram/Android-Testing | https://github.com/vinayjayaram/Android-Testing | 14fe51f43cd64a2b5c4cb2df8202bee792aa2c5b | ba5b371c192b06bc74f4e719b4ce47849930e92c | refs/heads/master | 2021-01-21T23:29:51.392000 | 2015-07-03T20:18:55 | 2015-07-03T20:18:55 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.rajeshbatth.android_testing.core.auth;
import com.rajeshbatth.android_testing.account.AccountsManager;
import com.rajeshbatth.android_testing.api.AccountsApi;
import com.rajeshbatth.android_testing.model.http.AuthResponse;
import com.rajeshbatth.android_testing.model.http.UserRequestParams;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import retrofit.Callback;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* Created by user on 6/28/2015.
*/
public class SignInPresenterTest {
private static final String VALID_EMAIL = "rajesh@gmail.com";
private AccountsManager accountsManagerMock;
private AccountsApi accountsApiMock;
private SignInPresenter signInPresenter;
private SignInPresenter.SignInCallbacks callbacks;
@Before
public void setUp() throws Exception {
accountsApiMock = Mockito.mock(AccountsApi.class);
accountsManagerMock = Mockito.mock(AccountsManager.class);
callbacks = Mockito.mock(SignInPresenter.SignInCallbacks.class);
signInPresenter = new SignInPresenter(accountsManagerMock, accountsApiMock, callbacks);
}
@Test
public void testValidate() throws Exception {
when(callbacks.getEmail()).thenReturn("");
signInPresenter.validate();
verify(callbacks).hideErrors();
verify(callbacks).showEmptyEmailError();
when(callbacks.getEmail()).thenReturn("rajesh");
signInPresenter.validate();
verify(callbacks).showInvalidEmailError();
when(callbacks.getEmail()).thenReturn(VALID_EMAIL);
when(callbacks.getPassword()).thenReturn("");
signInPresenter.validate();
verify(callbacks).showEmptyPasswordError();
when(callbacks.getEmail()).thenReturn(VALID_EMAIL);
when(callbacks.getPassword()).thenReturn("12345");
signInPresenter.validate();
verify(callbacks).showPasswordMinError();
when(callbacks.getEmail()).thenReturn(VALID_EMAIL);
when(callbacks.getPassword()).thenReturn("123456");
boolean isValid = signInPresenter.validate();
assertTrue(isValid);
}
@Test
public void testSubmit() throws Exception {
when(callbacks.getEmail()).thenReturn(VALID_EMAIL);
when(callbacks.getPassword()).thenReturn("123456");
signInPresenter.submit();
ArgumentCaptor<UserRequestParams> arg1 = ArgumentCaptor.forClass(UserRequestParams.class);
Class<Callback<AuthResponse>> respClass =
(Class<Callback<AuthResponse>>) (Class) Callback.class;
ArgumentCaptor<Callback<AuthResponse>> argument2 = ArgumentCaptor.forClass(respClass);
verify(accountsApiMock).login(arg1.capture(), argument2.capture());
UserRequestParams reqParam = arg1.getValue();
assertEquals(reqParam.getEmail(), VALID_EMAIL);
Callback<AuthResponse> respCallback = argument2.getValue();
respCallback.failure(null);
verify(callbacks).launchHome();
respCallback.success(null, null);
verify(callbacks, atLeastOnce()).launchHome();
}
} | UTF-8 | Java | 3,148 | java | SignInPresenterTest.java | Java | [
{
"context": "t {\n\n private static final String VALID_EMAIL = \"rajesh@gmail.com\";\n\n private AccountsManager accountsManagerMock;",
"end": 811,
"score": 0.9999212622642517,
"start": 795,
"tag": "EMAIL",
"value": "rajesh@gmail.com"
},
{
"context": "L);\n when(callbacks.getPa... | null | [] | package com.rajeshbatth.android_testing.core.auth;
import com.rajeshbatth.android_testing.account.AccountsManager;
import com.rajeshbatth.android_testing.api.AccountsApi;
import com.rajeshbatth.android_testing.model.http.AuthResponse;
import com.rajeshbatth.android_testing.model.http.UserRequestParams;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import retrofit.Callback;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* Created by user on 6/28/2015.
*/
public class SignInPresenterTest {
private static final String VALID_EMAIL = "<EMAIL>";
private AccountsManager accountsManagerMock;
private AccountsApi accountsApiMock;
private SignInPresenter signInPresenter;
private SignInPresenter.SignInCallbacks callbacks;
@Before
public void setUp() throws Exception {
accountsApiMock = Mockito.mock(AccountsApi.class);
accountsManagerMock = Mockito.mock(AccountsManager.class);
callbacks = Mockito.mock(SignInPresenter.SignInCallbacks.class);
signInPresenter = new SignInPresenter(accountsManagerMock, accountsApiMock, callbacks);
}
@Test
public void testValidate() throws Exception {
when(callbacks.getEmail()).thenReturn("");
signInPresenter.validate();
verify(callbacks).hideErrors();
verify(callbacks).showEmptyEmailError();
when(callbacks.getEmail()).thenReturn("rajesh");
signInPresenter.validate();
verify(callbacks).showInvalidEmailError();
when(callbacks.getEmail()).thenReturn(VALID_EMAIL);
when(callbacks.getPassword()).thenReturn("");
signInPresenter.validate();
verify(callbacks).showEmptyPasswordError();
when(callbacks.getEmail()).thenReturn(VALID_EMAIL);
when(callbacks.getPassword()).thenReturn("<PASSWORD>");
signInPresenter.validate();
verify(callbacks).showPasswordMinError();
when(callbacks.getEmail()).thenReturn(VALID_EMAIL);
when(callbacks.getPassword()).thenReturn("<PASSWORD>");
boolean isValid = signInPresenter.validate();
assertTrue(isValid);
}
@Test
public void testSubmit() throws Exception {
when(callbacks.getEmail()).thenReturn(VALID_EMAIL);
when(callbacks.getPassword()).thenReturn("<PASSWORD>");
signInPresenter.submit();
ArgumentCaptor<UserRequestParams> arg1 = ArgumentCaptor.forClass(UserRequestParams.class);
Class<Callback<AuthResponse>> respClass =
(Class<Callback<AuthResponse>>) (Class) Callback.class;
ArgumentCaptor<Callback<AuthResponse>> argument2 = ArgumentCaptor.forClass(respClass);
verify(accountsApiMock).login(arg1.capture(), argument2.capture());
UserRequestParams reqParam = arg1.getValue();
assertEquals(reqParam.getEmail(), VALID_EMAIL);
Callback<AuthResponse> respCallback = argument2.getValue();
respCallback.failure(null);
verify(callbacks).launchHome();
respCallback.success(null, null);
verify(callbacks, atLeastOnce()).launchHome();
}
} | 3,152 | 0.763024 | 0.753494 | 88 | 34.784092 | 24.694242 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.715909 | false | false | 9 |
80ffbd5e7cfccb7b356b5aa43d48838f69f71c79 | 15,676,630,632,763 | 532bf3ce9c2c9f8bfb85e6e717fd1d5427f8c4c3 | /src/test/java/com/hpe/calEStore/dao/impl/test/LoginDAOImplTest.java | 08d2cb29dd241400a538e6a91772589238f14e3b | [] | no_license | CDTDigital/cal-eStore | https://github.com/CDTDigital/cal-eStore | 595e03eb264b839455cc030e1da69983e8a898bb | 8d1a1371b87a287a86cd53a4a0ca398950212d11 | refs/heads/master | 2021-01-18T04:04:52.314000 | 2017-03-22T19:30:03 | 2017-03-22T19:30:03 | 85,766,586 | 1 | 0 | null | true | 2017-03-22T00:14:45 | 2017-03-22T00:14:45 | 2017-03-03T16:08:53 | 2017-03-03T14:38:20 | 71,011 | 0 | 0 | 0 | null | null | null | package com.hpe.calEStore.dao.impl.test;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
/**
* @author mishrani
*
*/
@ContextConfiguration("file:src/main/webapp/WEB-INF/dispatcher-servlet.xml")
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional
public class LoginDAOImplTest {
@Autowired
private UserDetailsService userDetailsService;
/**
* @throws
*/
@Test
public void tesLoadByUsername() {
System.out.println("***********" + userDetailsService);
UserDetails user = userDetailsService.loadUserByUsername("dude@d");
}
/**
* @param user
* @return
*/
private List<GrantedAuthority> getGrantedAuthorities() {
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
System.out.print("authorities :" + authorities);
return authorities;
}
}
| UTF-8 | Java | 1,315 | java | LoginDAOImplTest.java | Java | [
{
"context": "nsaction.annotation.Transactional;\n\n/**\n * @author mishrani\n *\n */\n@ContextConfiguration(\"file:src/main/webap",
"end": 634,
"score": 0.9995800852775574,
"start": 626,
"tag": "USERNAME",
"value": "mishrani"
},
{
"context": "ils user = userDetailsService.loadUserBy... | null | [] | package com.hpe.calEStore.dao.impl.test;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
/**
* @author mishrani
*
*/
@ContextConfiguration("file:src/main/webapp/WEB-INF/dispatcher-servlet.xml")
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional
public class LoginDAOImplTest {
@Autowired
private UserDetailsService userDetailsService;
/**
* @throws
*/
@Test
public void tesLoadByUsername() {
System.out.println("***********" + userDetailsService);
UserDetails user = userDetailsService.loadUserByUsername("dude@d");
}
/**
* @param user
* @return
*/
private List<GrantedAuthority> getGrantedAuthorities() {
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
System.out.print("authorities :" + authorities);
return authorities;
}
}
| 1,315 | 0.784791 | 0.78251 | 49 | 25.836735 | 26.152884 | 76 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.857143 | false | false | 9 |
91234fb8299053d7f05e66826bd12a46e83a6890 | 31,851,477,495,130 | ba8f0d93335048de1ebffdf49987e41e96145d8c | /Halaman 17.java | 66f9e5af47caaacc2d2319f2b50abedff9869be1 | [] | no_license | qurrotulainun/Assignment_A19_S3 | https://github.com/qurrotulainun/Assignment_A19_S3 | 2e0f39906e7f44783b8af586bc8cfd1d28eaf9cf | d737edb88b83baf045b0b3a36cd804fff1c5418e | refs/heads/main | 2022-12-25T23:33:28.024000 | 2020-10-07T06:31:13 | 2020-10-07T06:31:13 | 301,946,278 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package praktikum3pbo;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int angka;
Scanner pembaca = new Scanner(System.in);
System.out.print("Masukkan sebuah angka: ");
angka = pembaca.nextInt();
// jika benar (lbh besar dari nol)
if (angka > 0) {
System.out.println("Ok, masukan adalah positif");
// selain itu, (tdk lbh besar dari nol),
} else {
// cetak bukan positif
System.out.println("Maaf, masukan bukan positif");
}
}
}
| UTF-8 | Java | 605 | java | Halaman 17.java | Java | [] | null | [] | package praktikum3pbo;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int angka;
Scanner pembaca = new Scanner(System.in);
System.out.print("Masukkan sebuah angka: ");
angka = pembaca.nextInt();
// jika benar (lbh besar dari nol)
if (angka > 0) {
System.out.println("Ok, masukan adalah positif");
// selain itu, (tdk lbh besar dari nol),
} else {
// cetak bukan positif
System.out.println("Maaf, masukan bukan positif");
}
}
}
| 605 | 0.553719 | 0.550413 | 18 | 31.611111 | 18.457575 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.666667 | false | false | 9 |
87a1868d33b022b40570c2900da057d0b7885e71 | 24,644,522,414,107 | cb06e7cb2efdf5768b0b484afc86aef4ff471396 | /sap_JCo3_demo/src/jco3/demo2/DestinationFile.java | c4ba7376c2adac73c02d1bffe14dfd17aa4432c7 | [] | no_license | NanCarp/sap_java_connector_demo | https://github.com/NanCarp/sap_java_connector_demo | e022fdf7cc95569c5413bceef9eac8be5ce3ef44 | b200cdbbf0b7deb87d1194c7ba138ca429c8514d | refs/heads/master | 2021-01-20T08:03:04.059000 | 2017-05-05T05:12:57 | 2017-05-05T05:12:57 | 90,091,285 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package jco3.demo2;
import com.sap.conn.jco.ext.DestinationDataProvider;
import org.junit.Test;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
/**
* Created by NanCarp on 2017/5/3.
*/
public class DestinationFile {
private Properties setProperties() {
// logon parameters and other properties
Properties connProps = new Properties();
connProps.setProperty(DestinationDataProvider.JCO_ASHOST, "192.168.65.100");
connProps.setProperty(DestinationDataProvider.JCO_SYSNR, "00");
connProps.setProperty(DestinationDataProvider.JCO_USER, "STONE");
connProps.setProperty(DestinationDataProvider.JCO_PASSWD, "xxxxxx");
connProps.setProperty(DestinationDataProvider.JCO_CLIENT, "001");
connProps.setProperty(DestinationDataProvider.JCO_LANG, "EN");
return connProps;
}
private void doCreateFile(String fName, String suffix, Properties props) throws IOException {
/**
* Write contents of properties into a text file
* which was named [fName+suffix.jcodestination]
*/
File cfg = new File(fName + "." + suffix);
if (!cfg.exists()) {// file not exists
// Create file output stream, not using append mode
FileOutputStream fos = new FileOutputStream(cfg, false);
// store the properties in file output stream
// and also add comments
props.store(fos, "SAP logon parameters:");
fos.close();
} else {
throw new RuntimeException("File already existes.");
}
}
@Test
public void createConfigFile() throws IOException {
Properties props = this.setProperties();
String fileName = "SAP_AS";// sap application server
// jcodestination suffix is required by JCoDestinationManager
this.doCreateFile(fileName, "jcodestination", props);
}
}
| UTF-8 | Java | 1,971 | java | DestinationFile.java | Java | [
{
"context": "n;\nimport java.util.Properties;\n\n/**\n * Created by NanCarp on 2017/5/3.\n */\npublic class DestinationFile {\n ",
"end": 235,
"score": 0.9988486170768738,
"start": 228,
"tag": "USERNAME",
"value": "NanCarp"
},
{
"context": ".setProperty(DestinationDataProvider.JCO_A... | null | [] | package jco3.demo2;
import com.sap.conn.jco.ext.DestinationDataProvider;
import org.junit.Test;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
/**
* Created by NanCarp on 2017/5/3.
*/
public class DestinationFile {
private Properties setProperties() {
// logon parameters and other properties
Properties connProps = new Properties();
connProps.setProperty(DestinationDataProvider.JCO_ASHOST, "192.168.65.100");
connProps.setProperty(DestinationDataProvider.JCO_SYSNR, "00");
connProps.setProperty(DestinationDataProvider.JCO_USER, "STONE");
connProps.setProperty(DestinationDataProvider.JCO_PASSWD, "<PASSWORD>");
connProps.setProperty(DestinationDataProvider.JCO_CLIENT, "001");
connProps.setProperty(DestinationDataProvider.JCO_LANG, "EN");
return connProps;
}
private void doCreateFile(String fName, String suffix, Properties props) throws IOException {
/**
* Write contents of properties into a text file
* which was named [fName+suffix.jcodestination]
*/
File cfg = new File(fName + "." + suffix);
if (!cfg.exists()) {// file not exists
// Create file output stream, not using append mode
FileOutputStream fos = new FileOutputStream(cfg, false);
// store the properties in file output stream
// and also add comments
props.store(fos, "SAP logon parameters:");
fos.close();
} else {
throw new RuntimeException("File already existes.");
}
}
@Test
public void createConfigFile() throws IOException {
Properties props = this.setProperties();
String fileName = "SAP_AS";// sap application server
// jcodestination suffix is required by JCoDestinationManager
this.doCreateFile(fileName, "jcodestination", props);
}
}
| 1,975 | 0.663622 | 0.651446 | 57 | 33.578949 | 27.696316 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.631579 | false | false | 9 |
2c27d40f258ede33f6f3f9dc14fa3f352e477550 | 24,644,522,412,479 | 4236dbde72cf260e0b311857988f8bc621b2b57a | /src/teste/TestePatterns.java | 3c705405708377251480783e2f30a070f9c8821f | [] | no_license | SousaPedro11/PadroesProjeto | https://github.com/SousaPedro11/PadroesProjeto | b2f030fe3441bee882bde13d412964e2cea9c30f | 433079406ae40d2de433dbf1c295b0bcf8c80446 | refs/heads/master | 2020-04-07T21:26:25.303000 | 2020-03-28T07:53:18 | 2020-03-28T07:53:18 | 158,727,220 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package teste;
import org.testng.annotations.Test;
import facade.FormaFacade;
import model.Hexagono;
import model.Quadrilatero;
import visitor.Visitor;
public class TestePatterns {
@Test
public void testarFacade() {
final FormaFacade criandoForma = new FormaFacade();
System.out.println("\nTESTE FACADE");
criandoForma.criarHexagono();
criandoForma.criarQuadrilatero();
}
@Test
public void testarVisitor() {
final Hexagono hexagono = new Hexagono();
final Quadrilatero quadrilatero = new Quadrilatero();
final Visitor visitor = new Visitor();
System.out.println("\nTESTE VISITOR");
hexagono.accept(visitor);
quadrilatero.accept(visitor);
}
}
| UTF-8 | Java | 756 | java | TestePatterns.java | Java | [] | null | [] | package teste;
import org.testng.annotations.Test;
import facade.FormaFacade;
import model.Hexagono;
import model.Quadrilatero;
import visitor.Visitor;
public class TestePatterns {
@Test
public void testarFacade() {
final FormaFacade criandoForma = new FormaFacade();
System.out.println("\nTESTE FACADE");
criandoForma.criarHexagono();
criandoForma.criarQuadrilatero();
}
@Test
public void testarVisitor() {
final Hexagono hexagono = new Hexagono();
final Quadrilatero quadrilatero = new Quadrilatero();
final Visitor visitor = new Visitor();
System.out.println("\nTESTE VISITOR");
hexagono.accept(visitor);
quadrilatero.accept(visitor);
}
}
| 756 | 0.671958 | 0.671958 | 34 | 21.235294 | 19.502728 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.470588 | false | false | 9 |
fa0578408395d30557a18be152513f101af2181e | 18,545,668,846,120 | cdfa043ab7f05852ee415521a8fd6d3c8b31e125 | /src/com/slamd/message/ServerShutdownMessage.java | 19020be433680bcf0d0d6b10c477069f8b234c1c | [] | no_license | jcruzcruz/SLAMD | https://github.com/jcruzcruz/SLAMD | ea8b0a1523fe0cf0f010125c1da788ce69ef44b0 | 2c410a56ccf9914b9ad8d91d4f72cd90478a4066 | refs/heads/master | 2021-01-23T01:46:32.817000 | 2011-02-19T01:17:51 | 2011-02-19T01:17:51 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /*
* Sun Public License
*
* The contents of this file are subject to the Sun Public License Version
* 1.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is available at http://www.sun.com/
*
* The Original Code is the SLAMD Distributed Load Generation Engine.
* The Initial Developer of the Original Code is Neil A. Wilson.
* Portions created by Neil A. Wilson are Copyright (C) 2004-2010.
* Some preexisting portions Copyright (C) 2002-2006 Sun Microsystems, Inc.
* All Rights Reserved.
*
* Contributor(s): Neil A. Wilson
*/
package com.slamd.message;
import com.slamd.asn1.ASN1Element;
import com.slamd.asn1.ASN1Exception;
import com.slamd.asn1.ASN1Integer;
import com.slamd.asn1.ASN1Null;
import com.slamd.asn1.ASN1Sequence;
import com.slamd.common.Constants;
import com.slamd.common.SLAMDException;
/**
* This class defines a message type that the server uses to indicate that it
* is shutting down and that the connection to the client will be terminated.
*
*
* @author Neil A. Wilson
*/
public class ServerShutdownMessage
extends Message
{
/**
* Creates a new message type that the server uses to indicate that it is
* shutting down.
*
* @param messageID The message ID for this message.
*/
public ServerShutdownMessage(int messageID)
{
super(messageID, Constants.MESSAGE_TYPE_SERVER_SHUTDOWN);
}
/**
* Retrieves a string representation of this message.
*
* @return A string representation of this message.
*/
@Override()
public String toString()
{
String eol = System.getProperty("line.separator");
return "Server Shutdown Message" + eol +
" Message ID: " + messageID + eol;
}
/**
* Decodes the provided ASN.1 element as a server shutdown message.
*
* @param messageID The message ID to use for this message.
* @param element The ASN.1 server shutdown element.
*
* @return The server shutdown message decoded from the ASN.1 element.
*
* @throws SLAMDException If the provided ASN.1 element cannot be decoded
* as a server shutdown message.
*/
public static ServerShutdownMessage decodeShutdown(int messageID,
ASN1Element element)
throws SLAMDException
{
try
{
ASN1Null nullElement = element.decodeAsNull();
}
catch (ASN1Exception ae)
{
throw new SLAMDException("The server shutdown element cannot be " +
"decoded as a null", ae);
}
return new ServerShutdownMessage(messageID);
}
/**
* Encodes this message into an ASN.1 element. A server shutdown message has
* the following syntax:
* <BR><BR>
* <CODE>ServerShutdown ::= [APPLICATION 10] NULL</CODE>
* <BR>
*
* @return An ASN.1 encoded representation of this message.
*/
@Override()
public ASN1Element encode()
{
ASN1Integer messageIDElement = new ASN1Integer(messageID);
ASN1Null serverShutdownNull = new ASN1Null(ASN1_TYPE_SERVER_SHUTDOWN);
ASN1Element[] messageElements = new ASN1Element[]
{
messageIDElement,
serverShutdownNull
};
return new ASN1Sequence(messageElements);
}
}
| UTF-8 | Java | 3,334 | java | ServerShutdownMessage.java | Java | [
{
"context": ".\n * The Initial Developer of the Original Code is Neil A. Wilson.\n * Portions created by Neil A. Wilson are Copyri",
"end": 419,
"score": 0.9998886585235596,
"start": 405,
"tag": "NAME",
"value": "Neil A. Wilson"
},
{
"context": "nal Code is Neil A. Wilson.\n * Porti... | null | [] | /*
* Sun Public License
*
* The contents of this file are subject to the Sun Public License Version
* 1.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is available at http://www.sun.com/
*
* The Original Code is the SLAMD Distributed Load Generation Engine.
* The Initial Developer of the Original Code is <NAME>.
* Portions created by <NAME> are Copyright (C) 2004-2010.
* Some preexisting portions Copyright (C) 2002-2006 Sun Microsystems, Inc.
* All Rights Reserved.
*
* Contributor(s): <NAME>
*/
package com.slamd.message;
import com.slamd.asn1.ASN1Element;
import com.slamd.asn1.ASN1Exception;
import com.slamd.asn1.ASN1Integer;
import com.slamd.asn1.ASN1Null;
import com.slamd.asn1.ASN1Sequence;
import com.slamd.common.Constants;
import com.slamd.common.SLAMDException;
/**
* This class defines a message type that the server uses to indicate that it
* is shutting down and that the connection to the client will be terminated.
*
*
* @author <NAME>
*/
public class ServerShutdownMessage
extends Message
{
/**
* Creates a new message type that the server uses to indicate that it is
* shutting down.
*
* @param messageID The message ID for this message.
*/
public ServerShutdownMessage(int messageID)
{
super(messageID, Constants.MESSAGE_TYPE_SERVER_SHUTDOWN);
}
/**
* Retrieves a string representation of this message.
*
* @return A string representation of this message.
*/
@Override()
public String toString()
{
String eol = System.getProperty("line.separator");
return "Server Shutdown Message" + eol +
" Message ID: " + messageID + eol;
}
/**
* Decodes the provided ASN.1 element as a server shutdown message.
*
* @param messageID The message ID to use for this message.
* @param element The ASN.1 server shutdown element.
*
* @return The server shutdown message decoded from the ASN.1 element.
*
* @throws SLAMDException If the provided ASN.1 element cannot be decoded
* as a server shutdown message.
*/
public static ServerShutdownMessage decodeShutdown(int messageID,
ASN1Element element)
throws SLAMDException
{
try
{
ASN1Null nullElement = element.decodeAsNull();
}
catch (ASN1Exception ae)
{
throw new SLAMDException("The server shutdown element cannot be " +
"decoded as a null", ae);
}
return new ServerShutdownMessage(messageID);
}
/**
* Encodes this message into an ASN.1 element. A server shutdown message has
* the following syntax:
* <BR><BR>
* <CODE>ServerShutdown ::= [APPLICATION 10] NULL</CODE>
* <BR>
*
* @return An ASN.1 encoded representation of this message.
*/
@Override()
public ASN1Element encode()
{
ASN1Integer messageIDElement = new ASN1Integer(messageID);
ASN1Null serverShutdownNull = new ASN1Null(ASN1_TYPE_SERVER_SHUTDOWN);
ASN1Element[] messageElements = new ASN1Element[]
{
messageIDElement,
serverShutdownNull
};
return new ASN1Sequence(messageElements);
}
}
| 3,302 | 0.662567 | 0.64817 | 124 | 25.879032 | 27.317308 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.185484 | false | false | 9 |
074e6ad4db0b757cbc3e7509055f57a9dbd49773 | 27,693,949,167,722 | c40d0a94fc770355e226fcdac4d39bab7df38ee3 | /src/jumpingalien/model/Slime.java | 07aab244fc7ce1cb8249692c875a6ccc4df8c510 | [] | no_license | jonahbellemans/MazubProject | https://github.com/jonahbellemans/MazubProject | d1a96ddb0691af8b05af9b0feb70ea7a8a4805f6 | 9c9e07b712b650ad5dfec0adf2b7c87899a85b8d | refs/heads/master | 2021-05-01T01:31:55.865000 | 2015-05-22T12:59:05 | 2015-05-22T12:59:05 | 30,970,662 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package jumpingalien.model;
import java.util.Random;
import jumpingalien.enums.*;
import jumpingalien.util.*;
/**
* Class describes the character Slime in the game "Jumping Alien".
*
* @invar Slimes always have a constant horizontal acceleration when moving.
* | X_ACCELERATION == 0.7
*
* @invar Slimes always have a constant vertical acceleration when falling in air.
* | Y_ACCELERATION == -10.0
*
* @author Jonah Bellemans and Mathias Spanhove
*
* @version 2.0
*/
public class Slime extends Entity {
/**
* Constructor for the slime entity.
*
* @param xpos
* | X-coordinate of the starting position of the slime
* @param ypos
* | Y-coordinate of the starting position of the slime
* @param sprites
* | Array of sprites for the entity
* @param school
* | School that the slime has to be added to
*/
public Slime(int xpos, int ypos, Sprite[] sprites, School school) {
super(xpos, ypos, 100, EntityType.SLIME);
Init(sprites, school);
}
/**
* Constructor for a slime with a program.
* @effect Slime(xpos, ypos, sprites)
* @post Sets the program of the slime to the given program
* | new.program == program
* @param program
*/
public Slime(int xpos, int ypos, Sprite[] sprites, School school, Program program) {
super(xpos, ypos, 100, EntityType.SLIME, program);
Init(sprites, school);
}
/**
* Initializes the values of the slime to their defaults and sets the sprites and schools to the given parameters.
*
* @param sprites
* @param school
*/
public void Init(Sprite[] sprites, School school) {
this.school = school;
this.currSprite = sprites[0];
this.sprites = sprites;
this.entityType = EntityType.SLIME;
school.addSlime(this);
Random rand = new Random();
this.actionInterval = rand.nextInt(4) - 2;
this.currAction = 0;
this.getPosition().setDirection(Orientation.WALKLEFT);
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////VARIABLES///////////////////////////////
//////////////////////////////////////////////////////////////////////
private int actionInterval;
private int currAction;
private School school;
//////////////////////////////////////////////////////////////////////
///////////////////////////////SCHOOL/////////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Getter for the slime's school
*
* @return this.school
*/
public School getSchool() {
return this.school;
}
/**
* Setter for the slime's school
* @param newSchool
* | the new school of the current slime.
*/
public void setSchool(School newSchool) {
this.school = newSchool;
}
/**
* Knocks one HP from every slime in the slimes school.
* @effect
* | for (int i = 0; i < this.getSchool().getSlimes().size() - 1; i++)
* this.getSchool().getSlimes().get(i).setHealth(this.getSchool().getSlimes().get(i).getHealth() - 1);
*
*/
public void shareDamageWithSchool() {
for (int i = 0; i < this.getSchool().getSlimes().size() - 1; i++) {
this.getSchool().getSlimes().get(i).setHealth(this.getSchool().getSlimes().get(i).getHealth() - 1);
}
}
/**
* Transfers the object to the school of the given parameter slime.
*
* @effect
* | for (int i = 0; i < this.getSchool().getSlimes().size() - 1; i++)
* | this.getSchool().getSlimes().get(i).setHealth(this.getSchool().getSlimes().get(i).getHealth() + 1);
* @effect
* | for (int i = 0; i < slime.getSchool().getSlimes().size() - 1; i++) {
* | slime.getSchool().getSlimes().get(i).setHealth(slime.getSchool().getSlimes().get(i).getHealth() - 1);
* @effect
* | this.setHealth(getHealth() - this.getSchool().getSlimes().size());
* @effect
* | this.setHealth(getHealth() - this.getSchool().getSlimes().size());
* @post
* | new.getSchool() == slime.getSchool()
* @param slime
*/
public void joinSchoolOf(Slime slime) {
for (int i = 0; i < this.getSchool().getSlimes().size() - 1; i++) {
this.getSchool().getSlimes().get(i).setHealth(this.getSchool().getSlimes().get(i).getHealth() + 1);
}
this.setHealth(getHealth() - this.getSchool().getSlimes().size());
for (int i = 0; i < slime.getSchool().getSlimes().size() - 1; i++) {
slime.getSchool().getSlimes().get(i).setHealth(slime.getSchool().getSlimes().get(i).getHealth() - 1);
}
this.setHealth(getHealth() + slime.getSchool().getSlimes().size());
this.getSchool().removeSlime(this);
this.setSchool(slime.getSchool());
this.getSchool().addSlime(this);
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////ACTIONS/////////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Sets the duration of the current action to the given time.
*
* @param time
* | Time in seconds that the current action has to be executed.
*/
public void setActionInterval(int time) {
this.actionInterval = time;
}
/**
* Returns the duration of the current action.
*
* @return
* | this.actionInterval
*/
public int getActionInterval() {
return this.actionInterval;
}
/**
* Sets the current action to the given parameter.
*
* @param action
* | Code of the corresponding action for the shark.
*/
public void setCurrAction(int action) {
this.currAction = action;
}
/**
* Returns the code for the corresponding action of the shark.
*
* @return
* | this.currAction
*/
public int getCurrAction() {
return this.currAction;
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////SPRITES/////////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Returns the sprite that the slime should have at the time of function call.
* @return
* | if (this.getPosition().getDirection() == Orientation.WALKRIGHT)
* | return this.sprites[0]
* | else
* | return this.sprites[1]
*/
@Override
protected Sprite updateCurrentSprite() {
if (this.getPosition().getDirection() == Orientation.WALKLEFT)
return this.sprites[0];
else
return this.sprites[1];
}
//////////////////////////////////////////////////////////////////////
////////////////////////////ADVANCETIME///////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Advances the time with the given time interval and decides the next action the slime will take.
*
* @effect this.getPosition().setHorvelocity(this.getPosition().calculateHorVelocity(time))
* @effect this.getPosition().setVerVelocity(this.getPosition().calculateVerVelocity(time))
* @effect
* | if (this.getHealth() < 0)
* | this.terminate()
* @effect this.setCurrentSprite(updateCurrentSprite())
*/
@Override
protected void advanceTime(double time) {
if (this.getDeath()) {
this.getPosition().stopMoving();
} else if (this.getProgram() != null) {
this.getProgram().setTime(time);
this.getProgram().execute();
} else {
Random randGen = new Random();
if (this.getTickTock() >= this.getActionInterval()) {
this.setActionInterval(randGen.nextInt(5) + 2);
this.setCurrAction(randGen.nextInt(2));
this.resetTime();
switch (this.getCurrAction()) {
case 0: this.startMove("left");
break;
case 1: this.startMove("right");
break;
}
}
}
this.updateTime(time);
this.updateObjImmuneTime(time);
this.updateGeoImmuneTime(time);
this.updateDeathTime(time);
this.setCurrentSprite(updateCurrentSprite());
}
} | UTF-8 | Java | 7,718 | java | Slime.java | Java | [
{
"context": "ir.\n * \t\t\t| Y_ACCELERATION == -10.0\n * \n * @author Jonah Bellemans and Mathias Spanhove\n * \n * @version 2.0\n */\npubl",
"end": 444,
"score": 0.9998856782913208,
"start": 429,
"tag": "NAME",
"value": "Jonah Bellemans"
},
{
"context": "RATION == -10.0\n * \n * @a... | null | [] | package jumpingalien.model;
import java.util.Random;
import jumpingalien.enums.*;
import jumpingalien.util.*;
/**
* Class describes the character Slime in the game "Jumping Alien".
*
* @invar Slimes always have a constant horizontal acceleration when moving.
* | X_ACCELERATION == 0.7
*
* @invar Slimes always have a constant vertical acceleration when falling in air.
* | Y_ACCELERATION == -10.0
*
* @author <NAME> and <NAME>
*
* @version 2.0
*/
public class Slime extends Entity {
/**
* Constructor for the slime entity.
*
* @param xpos
* | X-coordinate of the starting position of the slime
* @param ypos
* | Y-coordinate of the starting position of the slime
* @param sprites
* | Array of sprites for the entity
* @param school
* | School that the slime has to be added to
*/
public Slime(int xpos, int ypos, Sprite[] sprites, School school) {
super(xpos, ypos, 100, EntityType.SLIME);
Init(sprites, school);
}
/**
* Constructor for a slime with a program.
* @effect Slime(xpos, ypos, sprites)
* @post Sets the program of the slime to the given program
* | new.program == program
* @param program
*/
public Slime(int xpos, int ypos, Sprite[] sprites, School school, Program program) {
super(xpos, ypos, 100, EntityType.SLIME, program);
Init(sprites, school);
}
/**
* Initializes the values of the slime to their defaults and sets the sprites and schools to the given parameters.
*
* @param sprites
* @param school
*/
public void Init(Sprite[] sprites, School school) {
this.school = school;
this.currSprite = sprites[0];
this.sprites = sprites;
this.entityType = EntityType.SLIME;
school.addSlime(this);
Random rand = new Random();
this.actionInterval = rand.nextInt(4) - 2;
this.currAction = 0;
this.getPosition().setDirection(Orientation.WALKLEFT);
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////VARIABLES///////////////////////////////
//////////////////////////////////////////////////////////////////////
private int actionInterval;
private int currAction;
private School school;
//////////////////////////////////////////////////////////////////////
///////////////////////////////SCHOOL/////////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Getter for the slime's school
*
* @return this.school
*/
public School getSchool() {
return this.school;
}
/**
* Setter for the slime's school
* @param newSchool
* | the new school of the current slime.
*/
public void setSchool(School newSchool) {
this.school = newSchool;
}
/**
* Knocks one HP from every slime in the slimes school.
* @effect
* | for (int i = 0; i < this.getSchool().getSlimes().size() - 1; i++)
* this.getSchool().getSlimes().get(i).setHealth(this.getSchool().getSlimes().get(i).getHealth() - 1);
*
*/
public void shareDamageWithSchool() {
for (int i = 0; i < this.getSchool().getSlimes().size() - 1; i++) {
this.getSchool().getSlimes().get(i).setHealth(this.getSchool().getSlimes().get(i).getHealth() - 1);
}
}
/**
* Transfers the object to the school of the given parameter slime.
*
* @effect
* | for (int i = 0; i < this.getSchool().getSlimes().size() - 1; i++)
* | this.getSchool().getSlimes().get(i).setHealth(this.getSchool().getSlimes().get(i).getHealth() + 1);
* @effect
* | for (int i = 0; i < slime.getSchool().getSlimes().size() - 1; i++) {
* | slime.getSchool().getSlimes().get(i).setHealth(slime.getSchool().getSlimes().get(i).getHealth() - 1);
* @effect
* | this.setHealth(getHealth() - this.getSchool().getSlimes().size());
* @effect
* | this.setHealth(getHealth() - this.getSchool().getSlimes().size());
* @post
* | new.getSchool() == slime.getSchool()
* @param slime
*/
public void joinSchoolOf(Slime slime) {
for (int i = 0; i < this.getSchool().getSlimes().size() - 1; i++) {
this.getSchool().getSlimes().get(i).setHealth(this.getSchool().getSlimes().get(i).getHealth() + 1);
}
this.setHealth(getHealth() - this.getSchool().getSlimes().size());
for (int i = 0; i < slime.getSchool().getSlimes().size() - 1; i++) {
slime.getSchool().getSlimes().get(i).setHealth(slime.getSchool().getSlimes().get(i).getHealth() - 1);
}
this.setHealth(getHealth() + slime.getSchool().getSlimes().size());
this.getSchool().removeSlime(this);
this.setSchool(slime.getSchool());
this.getSchool().addSlime(this);
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////ACTIONS/////////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Sets the duration of the current action to the given time.
*
* @param time
* | Time in seconds that the current action has to be executed.
*/
public void setActionInterval(int time) {
this.actionInterval = time;
}
/**
* Returns the duration of the current action.
*
* @return
* | this.actionInterval
*/
public int getActionInterval() {
return this.actionInterval;
}
/**
* Sets the current action to the given parameter.
*
* @param action
* | Code of the corresponding action for the shark.
*/
public void setCurrAction(int action) {
this.currAction = action;
}
/**
* Returns the code for the corresponding action of the shark.
*
* @return
* | this.currAction
*/
public int getCurrAction() {
return this.currAction;
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////SPRITES/////////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Returns the sprite that the slime should have at the time of function call.
* @return
* | if (this.getPosition().getDirection() == Orientation.WALKRIGHT)
* | return this.sprites[0]
* | else
* | return this.sprites[1]
*/
@Override
protected Sprite updateCurrentSprite() {
if (this.getPosition().getDirection() == Orientation.WALKLEFT)
return this.sprites[0];
else
return this.sprites[1];
}
//////////////////////////////////////////////////////////////////////
////////////////////////////ADVANCETIME///////////////////////////////
//////////////////////////////////////////////////////////////////////
/**
* Advances the time with the given time interval and decides the next action the slime will take.
*
* @effect this.getPosition().setHorvelocity(this.getPosition().calculateHorVelocity(time))
* @effect this.getPosition().setVerVelocity(this.getPosition().calculateVerVelocity(time))
* @effect
* | if (this.getHealth() < 0)
* | this.terminate()
* @effect this.setCurrentSprite(updateCurrentSprite())
*/
@Override
protected void advanceTime(double time) {
if (this.getDeath()) {
this.getPosition().stopMoving();
} else if (this.getProgram() != null) {
this.getProgram().setTime(time);
this.getProgram().execute();
} else {
Random randGen = new Random();
if (this.getTickTock() >= this.getActionInterval()) {
this.setActionInterval(randGen.nextInt(5) + 2);
this.setCurrAction(randGen.nextInt(2));
this.resetTime();
switch (this.getCurrAction()) {
case 0: this.startMove("left");
break;
case 1: this.startMove("right");
break;
}
}
}
this.updateTime(time);
this.updateObjImmuneTime(time);
this.updateGeoImmuneTime(time);
this.updateDeathTime(time);
this.setCurrentSprite(updateCurrentSprite());
}
} | 7,699 | 0.567764 | 0.561933 | 251 | 29.752989 | 28.432676 | 115 | false | false | 0 | 0 | 0 | 0 | 71 | 0.137989 | 2.12749 | false | false | 9 |
a94386cd4b8c2ebe690cf38612a558dfa9ae5738 | 29,961,691,889,668 | b93bd32bacbe4974d54fd6340c2ff371f145c007 | /MainActivity.java | 10b76f67cd7da47c3024382499229af7f4db1835 | [] | no_license | spaghetti555/MathGame | https://github.com/spaghetti555/MathGame | 397a87b96f884c32dc3c775013ecf2f650ebfa51 | 7686c43f98c98e8bd7ad1325ceeab8be61df2d1c | refs/heads/master | 2020-04-04T19:54:48.134000 | 2018-11-05T14:34:46 | 2018-11-05T14:34:46 | 156,225,712 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.home.mathgamev1;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.util.Random;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button startButton = (Button) findViewById(R.id.startButton);
if (getIntent().hasExtra("winState"))
{ TextView score = (TextView) findViewById(R.id.scoreTextView);
TextView txt1 = (TextView) findViewById(R.id.textView);
String txt = getIntent().getExtras().getString("winState");
int gameScore = getIntent().getExtras().getInt("Score");
score.setText("Score: "+ gameScore);
txt1.setText(txt);
}
if (getIntent().hasExtra("newGame"))
{
String txt = getIntent().getExtras().getString("newGame");
startButton.setText(txt);
}
startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent startIntent = new Intent(getApplicationContext(), GameActivity.class);
startActivity(startIntent);
}
});
}
}
| UTF-8 | Java | 1,455 | java | MainActivity.java | Java | [] | null | [] | package com.example.home.mathgamev1;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.util.Random;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button startButton = (Button) findViewById(R.id.startButton);
if (getIntent().hasExtra("winState"))
{ TextView score = (TextView) findViewById(R.id.scoreTextView);
TextView txt1 = (TextView) findViewById(R.id.textView);
String txt = getIntent().getExtras().getString("winState");
int gameScore = getIntent().getExtras().getInt("Score");
score.setText("Score: "+ gameScore);
txt1.setText(txt);
}
if (getIntent().hasExtra("newGame"))
{
String txt = getIntent().getExtras().getString("newGame");
startButton.setText(txt);
}
startButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent startIntent = new Intent(getApplicationContext(), GameActivity.class);
startActivity(startIntent);
}
});
}
}
| 1,455 | 0.638488 | 0.635739 | 51 | 27.529411 | 26.19486 | 93 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.45098 | false | false | 9 |
16b5f152ee69ad4aa5ae8b4fc8576da868ffbbf7 | 31,610,959,299,050 | 17ae8bdb2349dcdaf41be8e85daba98c6519be7d | /src/main/java/com/shjeong/admin/web/dto/HelloResponseDto.java | d7b78a66ac9fe3428449c2e650948d014d4d7d8a | [] | no_license | zuiop13/springboot-webservice | https://github.com/zuiop13/springboot-webservice | 49bdeab54af46417c304f5e3b4afa0a7b1009496 | 4f1d43bd01845a38c796df3ce531f8123c933dda | refs/heads/master | 2020-12-07T02:46:32.661000 | 2020-05-02T04:34:07 | 2020-05-02T04:34:07 | 232,594,257 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.shjeong.admin.web.dto;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
//겟터 자동생성
@Getter
//해당 클래스의 생성자를 자동 생성
@RequiredArgsConstructor
public class HelloResponseDto {
private final String name;
private final int amount;
}
| UTF-8 | Java | 297 | java | HelloResponseDto.java | Java | [] | null | [] | package com.shjeong.admin.web.dto;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
//겟터 자동생성
@Getter
//해당 클래스의 생성자를 자동 생성
@RequiredArgsConstructor
public class HelloResponseDto {
private final String name;
private final int amount;
}
| 297 | 0.77821 | 0.77821 | 13 | 18.76923 | 13.215107 | 38 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.384615 | false | false | 9 |
ade5753fdf9654c6243b21ccc7249db6698c10b0 | 33,646,773,798,253 | e02467fe5785938e9e6930808204bec60ff69ac5 | /springboot-redis-pipeline/src/main/java/com/yuanfenge/redis/service/RedisPipelineService.java | 598513d1e3e3579b037513a6de117385e4287b90 | [] | no_license | tiankonglanlande/springboot | https://github.com/tiankonglanlande/springboot | ce4043b37061d62702c9932edc53db9525e1888f | a216df22f6827c15db382a5bf16855c2e39f8c7f | refs/heads/master | 2023-07-10T08:07:57.068000 | 2023-07-03T08:36:52 | 2023-07-03T08:36:52 | 145,263,494 | 42 | 31 | null | false | 2023-09-14T02:14:02 | 2018-08-19T01:11:34 | 2023-07-27T03:51:37 | 2023-09-14T02:14:02 | 531 | 31 | 28 | 5 | Java | false | false | package com.yuanfenge.redis.service;
import com.google.common.collect.Lists;
import com.yuanfenge.redis.utils.BatchEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.StringRedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.SessionCallback;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* @author 猿份哥
* @description
* @createTime 2019/8/01 21:00
*/
@Service
public class RedisPipelineService extends AbsRedisBatch{
public RedisPipelineService(StringRedisTemplate stringRedisTemplate) {
super(stringRedisTemplate);
}
@Override
public void batchSet(List<Map<String, String>> mapList) {
add(mapList, BatchEnum.DEFAULT_SIZE.getCode(), TimeUnit.MINUTES, 15);
}
@Override
public List<String> batchGet(List<String> keys) {
return get(keys);
}
@Override
public Set<String> batchGet(String pattern) {
throw new UnsupportedOperationException("未实现,暂时不支持");
}
private void add(List<Map<String, String>> saveList, int bachSize, TimeUnit unit, int timeout) {
List<List<Map<String, String>>> partition = Lists.partition(saveList, bachSize);
partition.stream().forEach(l -> {
doAdd(l, unit, timeout);
});
}
private void doAdd(List<Map<String, String>> saveList, TimeUnit unit, int timeout) {
/* 插入多条数据 */
redisTemplate.executePipelined(new SessionCallback<Object>() {
@Override
public <K, V> Object execute(RedisOperations<K, V> redisOperations) throws DataAccessException {
for (Map<String, String> needSave : saveList) {
redisTemplate.opsForValue().set(needSave.get("key"), needSave.get("value"), timeout, unit);
}
return null;
}
});
}
private List<String> get(List<String> keyList) {
List<String> results = new ArrayList<>();
List<List<String>> partition = Lists.partition(keyList, BatchEnum.DEFAULT_SIZE.getCode());
partition.stream().forEach(l -> {
List<String> strings = doGet(l);
results.addAll(strings);
});
return results;
}
private List<String> doGet(List<String> keyList) {
/* 批量获取多条数据 */
List<Object> objects = redisTemplate.executePipelined((RedisCallback<Object>) redisConnection -> {
StringRedisConnection stringRedisConnection = (StringRedisConnection) redisConnection;
for (String key : keyList) {
stringRedisConnection.get(key);
}
return null;
});
List<String> collect = objects.stream().map(val -> String.valueOf(val)).collect(Collectors.toList());
return collect;
}
}
| UTF-8 | Java | 3,383 | java | RedisPipelineService.java | Java | [
{
"context": "port java.util.stream.Collectors;\n\n/**\n * @author 猿份哥\n * @description\n * @createTime 2019/8/01 21:00\n *",
"end": 902,
"score": 0.8922168612480164,
"start": 899,
"tag": "NAME",
"value": "猿份哥"
}
] | null | [] | package com.yuanfenge.redis.service;
import com.google.common.collect.Lists;
import com.yuanfenge.redis.utils.BatchEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.StringRedisConnection;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisOperations;
import org.springframework.data.redis.core.SessionCallback;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* @author 猿份哥
* @description
* @createTime 2019/8/01 21:00
*/
@Service
public class RedisPipelineService extends AbsRedisBatch{
public RedisPipelineService(StringRedisTemplate stringRedisTemplate) {
super(stringRedisTemplate);
}
@Override
public void batchSet(List<Map<String, String>> mapList) {
add(mapList, BatchEnum.DEFAULT_SIZE.getCode(), TimeUnit.MINUTES, 15);
}
@Override
public List<String> batchGet(List<String> keys) {
return get(keys);
}
@Override
public Set<String> batchGet(String pattern) {
throw new UnsupportedOperationException("未实现,暂时不支持");
}
private void add(List<Map<String, String>> saveList, int bachSize, TimeUnit unit, int timeout) {
List<List<Map<String, String>>> partition = Lists.partition(saveList, bachSize);
partition.stream().forEach(l -> {
doAdd(l, unit, timeout);
});
}
private void doAdd(List<Map<String, String>> saveList, TimeUnit unit, int timeout) {
/* 插入多条数据 */
redisTemplate.executePipelined(new SessionCallback<Object>() {
@Override
public <K, V> Object execute(RedisOperations<K, V> redisOperations) throws DataAccessException {
for (Map<String, String> needSave : saveList) {
redisTemplate.opsForValue().set(needSave.get("key"), needSave.get("value"), timeout, unit);
}
return null;
}
});
}
private List<String> get(List<String> keyList) {
List<String> results = new ArrayList<>();
List<List<String>> partition = Lists.partition(keyList, BatchEnum.DEFAULT_SIZE.getCode());
partition.stream().forEach(l -> {
List<String> strings = doGet(l);
results.addAll(strings);
});
return results;
}
private List<String> doGet(List<String> keyList) {
/* 批量获取多条数据 */
List<Object> objects = redisTemplate.executePipelined((RedisCallback<Object>) redisConnection -> {
StringRedisConnection stringRedisConnection = (StringRedisConnection) redisConnection;
for (String key : keyList) {
stringRedisConnection.get(key);
}
return null;
});
List<String> collect = objects.stream().map(val -> String.valueOf(val)).collect(Collectors.toList());
return collect;
}
}
| 3,383 | 0.678175 | 0.674272 | 97 | 33.340206 | 30.857466 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.649485 | false | false | 9 |
f497e71d2100718ad688ccd44a0ad765db969949 | 10,892,037,109,191 | fafd7389c43d065ba8d60b807c1d941e5f5c2b40 | /src/main/java/com/xm/commerce/system/model/dto/FileUploadDto.java | 812c90e70569db8a23e4f1ec2717f9b1223f641c | [] | no_license | Isshiki1224/test2 | https://github.com/Isshiki1224/test2 | baf4a5867f374e00770abb700492fa28db8ad7fc | c1f329ac21e59c9f3f8902a2a24b223e3db7e6ff | refs/heads/master | 2022-12-16T13:28:21.694000 | 2020-09-14T08:43:39 | 2020-09-14T08:43:39 | 290,131,883 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.xm.commerce.system.model.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class FileUploadDto {
private String url;
private long size;
}
| UTF-8 | Java | 289 | java | FileUploadDto.java | Java | [] | null | [] | package com.xm.commerce.system.model.dto;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class FileUploadDto {
private String url;
private long size;
}
| 289 | 0.799308 | 0.799308 | 16 | 17.0625 | 12.744944 | 41 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.4375 | false | false | 9 |
8ad55d98673ca646ab341841a0b93fed2cc1f69b | 33,028,298,543,529 | 8494db611986e7e10182fa541a6ade1242081388 | /src/nsbmhms2/pkg0/Menu.java | 053cb8277edd27bdbf3ff918df27173e41ef27bc | [] | no_license | Madhumal-Thushan/hospital-management-system- | https://github.com/Madhumal-Thushan/hospital-management-system- | db095e4a763c6c84fcc97e77d5d38e89b431b959 | bc05d17ca5344077d4eff8cc567ce9535d25e26b | refs/heads/main | 2023-07-27T09:25:01.878000 | 2021-09-13T11:35:22 | 2021-09-13T11:35:22 | 379,258,288 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package nsbmhms2.pkg0;
import java.awt.CardLayout;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.table.TableColumnModel;
import net.proteanit.sql.DbUtils;
/**
*
* @author Group 33
*/
public class Menu extends javax.swing.JFrame {
/**
* Creates new form Start
*/
CardLayout cardLayout;
public Menu() {
initComponents();
PopulateCombo();
cardLayout = (CardLayout)(Cards_panel.getLayout());
}
//PopulateCombox
private void PopulateCombo(){
try {
Connection conn = Db.openConnection();
String sql = ("select name from doctor");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
while(rs.next()){
String name = rs.getString("name");
jComboBox5.addItem(name);
jComboBox6.addItem(name);
jComboBox9.addItem(name);
}
} catch (SQLException e) {
}
}
//end
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
bg = new javax.swing.JPanel();
sp = new javax.swing.JPanel();
btn_addr = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
btn_pf = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
btn_pr = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
btn_ap = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
btn_stocks = new javax.swing.JPanel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jPanel6 = new javax.swing.JPanel();
btn_records1 = new javax.swing.JPanel();
jLabel47 = new javax.swing.JLabel();
jLabel48 = new javax.swing.JLabel();
btn_records4 = new javax.swing.JPanel();
jLabel63 = new javax.swing.JLabel();
jLabel64 = new javax.swing.JLabel();
btn_records5 = new javax.swing.JPanel();
jLabel68 = new javax.swing.JLabel();
jLabel69 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
Cards_panel = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jTextField13 = new javax.swing.JTextField();
jTextField14 = new javax.swing.JTextField();
jTextField15 = new javax.swing.JTextField();
jComboBox7 = new javax.swing.JComboBox<>();
jDateChooser3 = new com.toedter.calendar.JDateChooser();
jTextField16 = new javax.swing.JTextField();
jComboBox8 = new javax.swing.JComboBox<>();
jTextField17 = new javax.swing.JTextField();
jTextField18 = new javax.swing.JTextField();
jScrollPane6 = new javax.swing.JScrollPane();
jTextArea4 = new javax.swing.JTextArea();
jLabel37 = new javax.swing.JLabel();
jLabel38 = new javax.swing.JLabel();
jLabel39 = new javax.swing.JLabel();
jLabel40 = new javax.swing.JLabel();
jLabel41 = new javax.swing.JLabel();
jLabel42 = new javax.swing.JLabel();
jLabel43 = new javax.swing.JLabel();
jLabel44 = new javax.swing.JLabel();
jLabel45 = new javax.swing.JLabel();
jLabel46 = new javax.swing.JLabel();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jScrollPane7 = new javax.swing.JScrollPane();
jTable3 = new javax.swing.JTable();
jButton8 = new javax.swing.JButton();
jTextField24 = new javax.swing.JTextField();
jPanel7 = new javax.swing.JPanel();
jLabel59 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jTextField1 = new javax.swing.JTextField();
jLabel12 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel15 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jLabel18 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox<>();
jLabel19 = new javax.swing.JLabel();
jTextField5 = new javax.swing.JTextField();
jLabel20 = new javax.swing.JLabel();
jTextField6 = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jLabel21 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
jComboBox3 = new javax.swing.JComboBox<>();
jButton2 = new javax.swing.JButton();
jDateChooser1 = new com.toedter.calendar.JDateChooser();
jPanel4 = new javax.swing.JPanel();
jLabel31 = new javax.swing.JLabel();
jLabel32 = new javax.swing.JLabel();
jLabel33 = new javax.swing.JLabel();
jTextField11 = new javax.swing.JTextField();
jComboBox6 = new javax.swing.JComboBox<>();
jLabel34 = new javax.swing.JLabel();
jTextField12 = new javax.swing.JTextField();
jButton4 = new javax.swing.JButton();
jDateChooser2 = new com.toedter.calendar.JDateChooser();
timePicker1 = new com.github.lgooddatepicker.components.TimePicker();
jButton5 = new javax.swing.JButton();
jScrollPane10 = new javax.swing.JScrollPane();
jTable4 = new javax.swing.JTable();
jButton11 = new javax.swing.JButton();
jButton12 = new javax.swing.JButton();
jTextField25 = new javax.swing.JTextField();
jPanel8 = new javax.swing.JPanel();
jLabel60 = new javax.swing.JLabel();
jPanel5 = new javax.swing.JPanel();
jLabel71 = new javax.swing.JLabel();
jLabel72 = new javax.swing.JLabel();
jLabel73 = new javax.swing.JLabel();
jTextField29 = new javax.swing.JTextField();
jTextField30 = new javax.swing.JTextField();
jTextField31 = new javax.swing.JTextField();
jScrollPane14 = new javax.swing.JScrollPane();
jTable8 = new javax.swing.JTable();
jButton18 = new javax.swing.JButton();
jButton19 = new javax.swing.JButton();
jButton20 = new javax.swing.JButton();
jButton21 = new javax.swing.JButton();
jLabel74 = new javax.swing.JLabel();
jTextField32 = new javax.swing.JTextField();
kGradientPanel1 = new keeptoo.KGradientPanel();
jLabel35 = new javax.swing.JLabel();
jLabel36 = new javax.swing.JLabel();
kGradientPanel2 = new keeptoo.KGradientPanel();
jScrollPane4 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton3 = new javax.swing.JButton();
jScrollPane8 = new javax.swing.JScrollPane();
jTextArea5 = new javax.swing.JTextArea();
jLabel49 = new javax.swing.JLabel();
jScrollPane9 = new javax.swing.JScrollPane();
jTextArea6 = new javax.swing.JTextArea();
jLabel50 = new javax.swing.JLabel();
jComboBox9 = new javax.swing.JComboBox<>();
jLabel51 = new javax.swing.JLabel();
jComboBox10 = new javax.swing.JComboBox<>();
jLabel52 = new javax.swing.JLabel();
jTextField19 = new javax.swing.JTextField();
jLabel53 = new javax.swing.JLabel();
jTextField20 = new javax.swing.JTextField();
jLabel54 = new javax.swing.JLabel();
jLabel55 = new javax.swing.JLabel();
jTextField21 = new javax.swing.JTextField();
jTextField22 = new javax.swing.JTextField();
jLabel56 = new javax.swing.JLabel();
jLabel57 = new javax.swing.JLabel();
jDateChooser4 = new com.toedter.calendar.JDateChooser();
jButton9 = new javax.swing.JButton();
jButton10 = new javax.swing.JButton();
jPanel9 = new javax.swing.JPanel();
jTextField26 = new javax.swing.JTextField();
jLabel61 = new javax.swing.JLabel();
kGradientPanel3 = new keeptoo.KGradientPanel();
jTextField23 = new javax.swing.JTextField();
jButton13 = new javax.swing.JButton();
jScrollPane5 = new javax.swing.JScrollPane();
jTable2 = new javax.swing.JTable();
jScrollPane11 = new javax.swing.JScrollPane();
jTable5 = new javax.swing.JTable();
jScrollPane12 = new javax.swing.JScrollPane();
jTable6 = new javax.swing.JTable();
jLabel65 = new javax.swing.JLabel();
jLabel66 = new javax.swing.JLabel();
jLabel67 = new javax.swing.JLabel();
kGradientPanel4 = new keeptoo.KGradientPanel();
jButton14 = new javax.swing.JButton();
jButton15 = new javax.swing.JButton();
jButton16 = new javax.swing.JButton();
jButton17 = new javax.swing.JButton();
jScrollPane13 = new javax.swing.JScrollPane();
jTable7 = new javax.swing.JTable();
jLabel62 = new javax.swing.JLabel();
jLabel70 = new javax.swing.JLabel();
jTextField27 = new javax.swing.JTextField();
jTextField28 = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jLabel23 = new javax.swing.JLabel();
jTextField7 = new javax.swing.JTextField();
jLabel24 = new javax.swing.JLabel();
jTextField8 = new javax.swing.JTextField();
jLabel25 = new javax.swing.JLabel();
jTextField9 = new javax.swing.JTextField();
jLabel26 = new javax.swing.JLabel();
jTextField10 = new javax.swing.JTextField();
jLabel27 = new javax.swing.JLabel();
jComboBox4 = new javax.swing.JComboBox<>();
jLabel28 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
jTextArea2 = new javax.swing.JTextArea();
jLabel29 = new javax.swing.JLabel();
jScrollPane3 = new javax.swing.JScrollPane();
jTextArea3 = new javax.swing.JTextArea();
jLabel30 = new javax.swing.JLabel();
jComboBox5 = new javax.swing.JComboBox<>();
jButton1 = new javax.swing.JButton();
jLabel58 = new javax.swing.JLabel();
jDateChooser5 = new com.toedter.calendar.JDateChooser();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
sp.setBackground(new java.awt.Color(42, 8, 69));
btn_addr.setBackground(new java.awt.Color(54, 33, 89));
btn_addr.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_addr.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_addrMouseClicked(evt);
}
});
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_plus_45px.png"))); // NOI18N
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Add a Record");
jLabel2.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel2.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_addrLayout = new javax.swing.GroupLayout(btn_addr);
btn_addr.setLayout(btn_addrLayout);
btn_addrLayout.setHorizontalGroup(
btn_addrLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_addrLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jLabel2)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_addrLayout.setVerticalGroup(
btn_addrLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_addrLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel2)
.addContainerGap(24, Short.MAX_VALUE))
);
jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_fiber_45px.png"))); // NOI18N
btn_pf.setBackground(new java.awt.Color(54, 33, 89));
btn_pf.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_pf.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_pfMouseClicked(evt);
}
});
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_vomited_45px.png"))); // NOI18N
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel4.setText("Patient Profiles");
jLabel4.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel4.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_pfLayout = new javax.swing.GroupLayout(btn_pf);
btn_pf.setLayout(btn_pfLayout);
btn_pfLayout.setHorizontalGroup(
btn_pfLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_pfLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addComponent(jLabel4)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_pfLayout.setVerticalGroup(
btn_pfLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_pfLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel4)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_pr.setBackground(new java.awt.Color(54, 33, 89));
btn_pr.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_pr.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_prMouseClicked(evt);
}
});
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_add_user_group_woman_man_45px.png"))); // NOI18N
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel6.setText("Patient Registration");
jLabel6.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel6.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_prLayout = new javax.swing.GroupLayout(btn_pr);
btn_pr.setLayout(btn_prLayout);
btn_prLayout.setHorizontalGroup(
btn_prLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_prLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel5)
.addGap(18, 18, 18)
.addComponent(jLabel6)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_prLayout.setVerticalGroup(
btn_prLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_prLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel6)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_ap.setBackground(new java.awt.Color(54, 33, 89));
btn_ap.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_ap.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_apMouseClicked(evt);
}
});
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_planner_45px.png"))); // NOI18N
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel8.setText("Appointments");
jLabel8.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel8.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_apLayout = new javax.swing.GroupLayout(btn_ap);
btn_ap.setLayout(btn_apLayout);
btn_apLayout.setHorizontalGroup(
btn_apLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_apLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel7)
.addGap(18, 18, 18)
.addComponent(jLabel8)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_apLayout.setVerticalGroup(
btn_apLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_apLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel8)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_stocks.setBackground(new java.awt.Color(54, 33, 89));
btn_stocks.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_stocks.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_stocksMouseClicked(evt);
}
});
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_scan_stock_45px.png"))); // NOI18N
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel10.setText("Stocks");
jLabel10.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel10.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_stocksLayout = new javax.swing.GroupLayout(btn_stocks);
btn_stocks.setLayout(btn_stocksLayout);
btn_stocksLayout.setHorizontalGroup(
btn_stocksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_stocksLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel9)
.addGap(18, 18, 18)
.addComponent(jLabel10)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_stocksLayout.setVerticalGroup(
btn_stocksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_stocksLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel10)
.addContainerGap(24, Short.MAX_VALUE))
);
jPanel6.setBackground(new java.awt.Color(42, 8, 69));
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 58, Short.MAX_VALUE)
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 78, Short.MAX_VALUE)
);
btn_records1.setBackground(new java.awt.Color(54, 33, 89));
btn_records1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_records1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_records1MouseClicked(evt);
}
});
jLabel47.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel47.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_health_book_45px_1.png"))); // NOI18N
jLabel48.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel48.setText("Records");
jLabel48.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel48.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_records1Layout = new javax.swing.GroupLayout(btn_records1);
btn_records1.setLayout(btn_records1Layout);
btn_records1Layout.setHorizontalGroup(
btn_records1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_records1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel47)
.addGap(18, 18, 18)
.addComponent(jLabel48)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_records1Layout.setVerticalGroup(
btn_records1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel47, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_records1Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel48)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_records4.setBackground(new java.awt.Color(54, 33, 89));
btn_records4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_records4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_records4MouseClicked(evt);
}
});
jLabel63.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel63.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_advanced_search_45px.png"))); // NOI18N
jLabel64.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel64.setText("Advanced Overview");
jLabel64.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel64.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_records4Layout = new javax.swing.GroupLayout(btn_records4);
btn_records4.setLayout(btn_records4Layout);
btn_records4Layout.setHorizontalGroup(
btn_records4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_records4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel63)
.addGap(18, 18, 18)
.addComponent(jLabel64)
.addGap(0, 253, Short.MAX_VALUE))
);
btn_records4Layout.setVerticalGroup(
btn_records4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel63, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_records4Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel64)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_records5.setBackground(new java.awt.Color(54, 33, 89));
btn_records5.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_records5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_records5MouseClicked(evt);
}
public void mouseReleased(java.awt.event.MouseEvent evt) {
btn_records5MouseReleased(evt);
}
});
jLabel68.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel68.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_doctor_male_45px.png"))); // NOI18N
jLabel69.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel69.setText("Doctors");
jLabel69.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel69.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_records5Layout = new javax.swing.GroupLayout(btn_records5);
btn_records5.setLayout(btn_records5Layout);
btn_records5Layout.setHorizontalGroup(
btn_records5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_records5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel68)
.addGap(18, 18, 18)
.addComponent(jLabel69)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_records5Layout.setVerticalGroup(
btn_records5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel68, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_records5Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel69)
.addContainerGap(24, Short.MAX_VALUE))
);
jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_info_25px.png"))); // NOI18N
jLabel11.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel11MouseClicked(evt);
}
});
javax.swing.GroupLayout spLayout = new javax.swing.GroupLayout(sp);
sp.setLayout(spLayout);
spLayout.setHorizontalGroup(
spLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btn_addr, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_pf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_pr, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_ap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_stocks, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(spLayout.createSequentialGroup()
.addGroup(spLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(btn_records1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_records4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_records5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(spLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel11)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
spLayout.setVerticalGroup(
spLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(spLayout.createSequentialGroup()
.addComponent(jLabel13)
.addGap(41, 41, 41)
.addComponent(btn_addr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_pf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_pr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_ap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_stocks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_records1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_records4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_records5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(191, 191, 191)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
Cards_panel.setLayout(new java.awt.CardLayout());
jPanel2.setBackground(java.awt.Color.gray);
jPanel2.setPreferredSize(new java.awt.Dimension(1000, 969));
jTextField13.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField13ActionPerformed(evt);
}
});
jTextField14.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField15.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField15ActionPerformed(evt);
}
});
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Male", "Female" }));
jComboBox7.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jDateChooser3.setDateFormatString("yyyy-MM-dd");
jDateChooser3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField16.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Student", "Academic Staff", "Non-ac Staff" }));
jComboBox8.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox8ActionPerformed(evt);
}
});
jTextField17.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField18.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea4.setColumns(20);
jTextArea4.setRows(5);
jTextArea4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane6.setViewportView(jTextArea4);
jLabel37.setText("Description");
jLabel37.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel38.setText("Degree");
jLabel38.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel39.setText("Batch");
jLabel39.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel40.setText("Occupation");
jLabel40.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel41.setText("Guardians Tel");
jLabel41.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel42.setText("D.O.B");
jLabel42.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel43.setText("Gender");
jLabel43.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel44.setText("Index Number");
jLabel44.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel45.setText("Last Name");
jLabel45.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel46.setText("First Name");
jLabel46.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton6.setText("Update");
jButton6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jButton7.setText("Delete");
jButton7.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
jScrollPane7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jTable3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable3MouseClicked(evt);
}
});
jScrollPane7.setViewportView(jTable3);
jButton8.setText("Refresh");
jButton8.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton8ActionPerformed(evt);
}
});
jTextField24.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jPanel7.setBackground(java.awt.Color.gray);
jPanel7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jPanel7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel7MouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 24, Short.MAX_VALUE)
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 24, Short.MAX_VALUE)
);
jLabel59.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_search_24px.png"))); // NOI18N
jLabel59.setBackground(new java.awt.Color(255, 102, 102));
jLabel59.setIconTextGap(0);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(455, 455, 455)
.addComponent(jButton6))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(263, 263, 263)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel46)
.addComponent(jLabel45)
.addComponent(jLabel44)
.addComponent(jLabel41, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel40)
.addComponent(jLabel39)
.addComponent(jLabel38)
.addComponent(jLabel37)
.addComponent(jLabel43)
.addComponent(jLabel42))
.addGap(2, 2, 2)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField14)
.addComponent(jTextField15)
.addComponent(jComboBox7, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField17)
.addComponent(jTextField18)
.addComponent(jScrollPane6)
.addComponent(jTextField16)
.addComponent(jComboBox8, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jDateChooser3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField13))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel59)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 136, Short.MAX_VALUE)
.addComponent(jButton7)
.addGap(18, 18, 18)
.addComponent(jButton8)
.addGap(528, 528, 528))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(jScrollPane7)
.addContainerGap())))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel59)))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton7)
.addComponent(jButton8))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel46)
.addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(20, 20, 20)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel45)
.addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel44)
.addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(11, 11, 11)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel43)
.addComponent(jComboBox7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(13, 13, 13)
.addComponent(jLabel42)
.addGap(24, 24, 24))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDateChooser3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel41)
.addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel40)
.addComponent(jComboBox8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel39))
.addGap(21, 21, 21)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel38)
.addComponent(jTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel37)
.addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jButton6)
.addGap(220, 220, 220))
);
Cards_panel.add(jPanel2, "card3");
jPanel3.setBackground(java.awt.Color.gray);
jTextField1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
jLabel12.setText("First Name");
jLabel12.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel14.setText("Last Name");
jLabel14.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel15.setText("Index Number");
jLabel15.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField3ActionPerformed(evt);
}
});
jLabel16.setText("D.O.B");
jLabel16.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel17.setText("Guardians Tel");
jLabel17.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel18.setText("Occupation");
jLabel18.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Student", "Academic Staff", "Non-ac Staff" }));
jComboBox2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox2ActionPerformed(evt);
}
});
jLabel19.setText("Batch");
jLabel19.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel20.setText("Degree");
jLabel20.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jTextArea1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane1.setViewportView(jTextArea1);
jLabel21.setText("Description");
jLabel21.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel22.setText("Gender");
jLabel22.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox3.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Male", "Female" }));
jComboBox3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton2.setText("Save");
jButton2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jDateChooser1.setDateFormatString("yyyy-MM-dd");
jDateChooser1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(163, 163, 163)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel15)
.addComponent(jLabel12)
.addComponent(jLabel22)
.addComponent(jLabel16)
.addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14)
.addComponent(jLabel18)
.addComponent(jLabel19)
.addComponent(jLabel20)
.addComponent(jLabel21))
.addGap(37, 37, 37)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField6, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField5, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jComboBox2, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField4, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDateChooser1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBox3, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField3, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING)))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(402, 402, 402)
.addComponent(jButton2)))
.addContainerGap(464, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(42, 42, 42)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(23, 23, 23)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel15)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel22)
.addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel16))
.addGap(36, 36, 36)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel17)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(47, 47, 47)
.addComponent(jLabel18))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(33, 33, 33)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel19))
.addGap(43, 43, 43)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel20))
.addGap(38, 38, 38)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel21))
.addGap(48, 48, 48)
.addComponent(jButton2)
.addContainerGap(154, Short.MAX_VALUE))
);
Cards_panel.add(jPanel3, "card4");
jPanel4.setBackground(java.awt.Color.gray);
jLabel31.setText("Date & Time");
jLabel31.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel32.setText("Index Number");
jLabel32.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel33.setText("Doctor");
jLabel33.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField11.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox6.setEditable(true);
jComboBox6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel34.setText("Condition");
jLabel34.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField12.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton4.setText("Add Appointment");
jButton4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jDateChooser2.setDateFormatString("yyyy-MM-dd");
jDateChooser2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
timePicker1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton5.setText("Refresh");
jButton5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jTable4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable4MouseClicked(evt);
}
});
jScrollPane10.setViewportView(jTable4);
jButton11.setText("Update");
jButton11.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton11ActionPerformed(evt);
}
});
jButton12.setText("Delete");
jButton12.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton12.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton12ActionPerformed(evt);
}
});
jTextField25.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jPanel8.setBackground(java.awt.Color.gray);
jPanel8.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jPanel8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel8MouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 36, Short.MAX_VALUE)
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 40, Short.MAX_VALUE)
);
jLabel60.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_search_24px.png"))); // NOI18N
jLabel60.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane10))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(192, 192, 192)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel31)
.addComponent(jLabel32)
.addComponent(jLabel33)
.addComponent(jLabel34))
.addGap(123, 123, 123)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(timePicker1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(122, 122, 122)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(113, 113, 113)
.addComponent(jButton11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 170, Short.MAX_VALUE)
.addComponent(jButton12)
.addGap(243, 243, 243))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(55, 55, 55)
.addComponent(jLabel60)
.addGap(108, 108, 108)
.addComponent(jButton5)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(99, 99, 99)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel32)
.addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(52, 52, 52)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(timePicker1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel31)
.addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(37, 37, 37)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel33)
.addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(52, 52, 52)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel34)
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(49, 49, 49)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton4)
.addComponent(jButton12)
.addComponent(jButton11))
.addGap(32, 32, 32))
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(55, 55, 55)
.addComponent(jLabel60))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(55, 55, 55)
.addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(37, 37, 37))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton5)
.addGap(39, 39, 39)))
.addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(90, Short.MAX_VALUE))
);
Cards_panel.add(jPanel4, "card5");
jPanel5.setBackground(java.awt.Color.gray);
jLabel71.setText("Item Name");
jLabel71.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel72.setText("Price");
jLabel72.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel73.setText("Quantity");
jLabel73.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTable8.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTable8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable8MouseClicked(evt);
}
});
jScrollPane14.setViewportView(jTable8);
jButton18.setText("Add an Item");
jButton18.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton18.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton18ActionPerformed(evt);
}
});
jButton19.setText("Refresh");
jButton19.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton19.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton19ActionPerformed(evt);
}
});
jButton20.setText("Update");
jButton20.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton20.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton20ActionPerformed(evt);
}
});
jButton21.setText("Remove");
jButton21.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton21.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton21ActionPerformed(evt);
}
});
jLabel74.setText("Item Code");
jLabel74.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField32.setEditable(false);
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(331, 331, 331)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel71)
.addComponent(jLabel74)
.addComponent(jLabel72)
.addComponent(jLabel73)))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(164, 164, 164)
.addComponent(jButton18)
.addGap(79, 79, 79)
.addComponent(jButton19)))
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(7, 7, 7)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField29, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField32, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField30, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField31, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(92, 92, 92)
.addComponent(jButton20)
.addGap(105, 105, 105)
.addComponent(jButton21)))
.addGap(0, 209, Short.MAX_VALUE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane14)))
.addContainerGap())
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(103, 103, 103)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel74)
.addComponent(jTextField32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(31, 31, 31)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel71)
.addComponent(jTextField29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(34, 34, 34)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel72)
.addComponent(jTextField30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(31, 31, 31)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel73)
.addComponent(jTextField31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(71, 71, 71)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton18)
.addComponent(jButton19)
.addComponent(jButton20)
.addComponent(jButton21))
.addGap(59, 59, 59)
.addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(259, Short.MAX_VALUE))
);
Cards_panel.add(jPanel5, "card6");
kGradientPanel1.setkEndColor(new java.awt.Color(219, 214, 92));
kGradientPanel1.setkStartColor(new java.awt.Color(86, 20, 176));
jLabel35.setText("Developed by 19.2 PLY SE 2nd yr Java Group 33");
jLabel35.setFont(new java.awt.Font("Microsoft JhengHei", 3, 18)); // NOI18N
jLabel36.setText("2020");
jLabel36.setFont(new java.awt.Font("Microsoft JhengHei", 3, 18)); // NOI18N
javax.swing.GroupLayout kGradientPanel1Layout = new javax.swing.GroupLayout(kGradientPanel1);
kGradientPanel1.setLayout(kGradientPanel1Layout);
kGradientPanel1Layout.setHorizontalGroup(
kGradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel1Layout.createSequentialGroup()
.addGroup(kGradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel1Layout.createSequentialGroup()
.addGap(216, 216, 216)
.addComponent(jLabel35))
.addGroup(kGradientPanel1Layout.createSequentialGroup()
.addGap(405, 405, 405)
.addComponent(jLabel36)))
.addContainerGap(396, Short.MAX_VALUE))
);
kGradientPanel1Layout.setVerticalGroup(
kGradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel1Layout.createSequentialGroup()
.addGap(181, 181, 181)
.addComponent(jLabel35)
.addGap(18, 18, 18)
.addComponent(jLabel36)
.addContainerGap(667, Short.MAX_VALUE))
);
Cards_panel.add(kGradientPanel1, "card7");
kGradientPanel2.setkEndColor(java.awt.Color.gray);
kGradientPanel2.setkStartColor(java.awt.Color.gray);
jTable1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable1MouseClicked(evt);
}
});
jScrollPane4.setViewportView(jTable1);
jButton3.setText("Refresh");
jButton3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jTextArea5.setColumns(20);
jTextArea5.setRows(5);
jTextArea5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane8.setViewportView(jTextArea5);
jLabel49.setText("Description");
jLabel49.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea6.setColumns(20);
jTextArea6.setRows(5);
jTextArea6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane9.setViewportView(jTextArea6);
jLabel50.setText("Issued Medications");
jLabel50.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox9.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel51.setText("Diagnosed Doctor");
jLabel51.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox10.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Pending", "Treated and Released" }));
jComboBox10.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel52.setText("Disposition");
jLabel52.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField19.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel53.setText("Condition");
jLabel53.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField20.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel54.setText("Primary Diagnosis");
jLabel54.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel55.setText("Symptoms");
jLabel55.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField21.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField22.setEditable(false);
jTextField22.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField22.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField22ActionPerformed(evt);
}
});
jLabel56.setText("Index Number");
jLabel56.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel57.setText("Date");
jLabel57.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jDateChooser4.setDateFormatString("yyyy-MM-dd");
jDateChooser4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton9.setText("Update");
jButton9.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton9ActionPerformed(evt);
}
});
jButton10.setText("Delete");
jButton10.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
}
});
jPanel9.setBackground(java.awt.Color.gray);
jPanel9.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jPanel9.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel9MouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 36, Short.MAX_VALUE)
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 40, Short.MAX_VALUE)
);
jTextField26.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel61.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_search_24px.png"))); // NOI18N
jLabel61.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
javax.swing.GroupLayout kGradientPanel2Layout = new javax.swing.GroupLayout(kGradientPanel2);
kGradientPanel2.setLayout(kGradientPanel2Layout);
kGradientPanel2Layout.setHorizontalGroup(
kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(jTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel61))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 989, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(30, Short.MAX_VALUE))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(175, 175, 175)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel54, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel56)
.addComponent(jLabel55)
.addComponent(jLabel53)
.addComponent(jLabel52)
.addComponent(jLabel49)
.addComponent(jLabel50))
.addComponent(jLabel51)
.addComponent(jLabel57))
.addGap(37, 37, 37)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBox9, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBox10, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField19)
.addComponent(jTextField20)
.addComponent(jTextField21)
.addComponent(jTextField22)
.addComponent(jScrollPane9)
.addComponent(jScrollPane8)
.addComponent(jDateChooser4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3)
.addGap(152, 152, 152))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(83, 83, 83)
.addComponent(jButton9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton10)
.addGap(47, 47, 47))))
);
kGradientPanel2Layout.setVerticalGroup(
kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(40, 40, 40)
.addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel61)
.addComponent(jTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(63, 63, 63)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel56)
.addComponent(jTextField22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(174, 174, 174)
.addComponent(jButton3)))
.addGap(21, 21, 21)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel55)
.addComponent(jTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel54)
.addComponent(jTextField20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel53)
.addComponent(jTextField19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel52)
.addComponent(jComboBox10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel51)
.addComponent(jComboBox9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(29, 29, 29)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel50)
.addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(64, 64, 64)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton9)
.addComponent(jButton10))))
.addGap(23, 23, 23)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel49))
.addGap(34, 34, 34)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel57)
.addComponent(jDateChooser4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(74, Short.MAX_VALUE))
);
Cards_panel.add(kGradientPanel2, "card8");
kGradientPanel3.setkEndColor(java.awt.Color.gray);
kGradientPanel3.setkStartColor(java.awt.Color.gray);
jTextField23.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton13.setText("Search");
jButton13.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton13ActionPerformed(evt);
}
});
jTable2.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane5.setViewportView(jTable2);
jTable5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane11.setViewportView(jTable5);
jTable6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane12.setViewportView(jTable6);
jLabel65.setText("Profile");
jLabel65.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel66.setText("Medical Records");
jLabel66.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel67.setText("Appointments");
jLabel67.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
javax.swing.GroupLayout kGradientPanel3Layout = new javax.swing.GroupLayout(kGradientPanel3);
kGradientPanel3.setLayout(kGradientPanel3Layout);
kGradientPanel3Layout.setHorizontalGroup(
kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGroup(kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGap(63, 63, 63)
.addComponent(jLabel67))
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGap(58, 58, 58)
.addComponent(jLabel66))
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGap(58, 58, 58)
.addComponent(jLabel65)))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGroup(kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, kGradientPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 998, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, kGradientPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane12))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, kGradientPanel3Layout.createSequentialGroup()
.addGap(69, 69, 69)
.addComponent(jTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(50, 50, 50)
.addComponent(jButton13))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, kGradientPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane11)))
.addContainerGap(21, Short.MAX_VALUE))
);
kGradientPanel3Layout.setVerticalGroup(
kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addGroup(kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton13))
.addGap(23, 23, 23)
.addComponent(jLabel65)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(73, 73, 73)
.addComponent(jLabel66)
.addGap(26, 26, 26)
.addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(60, 60, 60)
.addComponent(jLabel67)
.addGap(28, 28, 28)
.addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(125, Short.MAX_VALUE))
);
Cards_panel.add(kGradientPanel3, "card9");
kGradientPanel4.setkEndColor(java.awt.Color.gray);
kGradientPanel4.setkStartColor(java.awt.Color.gray);
jButton14.setText("Add a Doctor");
jButton14.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton14.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton14ActionPerformed(evt);
}
});
jButton15.setText("Refresh");
jButton15.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton15ActionPerformed(evt);
}
});
jButton16.setText("Update");
jButton16.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton16.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton16ActionPerformed(evt);
}
});
jButton17.setText("Delete");
jButton17.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton17.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton17ActionPerformed(evt);
}
});
jTable7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable7MouseClicked(evt);
}
});
jScrollPane13.setViewportView(jTable7);
jLabel62.setText("Name");
jLabel62.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel70.setText("Telephone No.");
jLabel70.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField27.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField28.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
javax.swing.GroupLayout kGradientPanel4Layout = new javax.swing.GroupLayout(kGradientPanel4);
kGradientPanel4.setLayout(kGradientPanel4Layout);
kGradientPanel4Layout.setHorizontalGroup(
kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addGap(248, 248, 248)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel70)
.addComponent(jLabel62))
.addGap(77, 77, 77)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jTextField28, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField27, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane13)))
.addContainerGap())
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addGap(169, 169, 169)
.addComponent(jButton14)
.addGap(91, 91, 91)
.addComponent(jButton15)
.addGap(108, 108, 108)
.addComponent(jButton16)
.addGap(105, 105, 105)
.addComponent(jButton17)
.addContainerGap(190, Short.MAX_VALUE))
);
kGradientPanel4Layout.setVerticalGroup(
kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addGap(128, 128, 128)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel62)
.addComponent(jTextField27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(71, 71, 71)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel70))
.addGap(101, 101, 101)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton14)
.addComponent(jButton15)
.addComponent(jButton16)
.addComponent(jButton17))
.addGap(74, 74, 74)
.addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(204, Short.MAX_VALUE))
);
Cards_panel.add(kGradientPanel4, "card10");
jPanel1.setBackground(java.awt.Color.gray);
jLabel23.setText("Index Number");
jLabel23.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField7.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField7ActionPerformed(evt);
}
});
jLabel24.setText("Primary Diagnosis");
jLabel24.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField8.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel25.setText("Symptoms");
jLabel25.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField9.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel26.setText("Condition");
jLabel26.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField10.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel27.setText("Disposition");
jLabel27.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox4.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Pending", "Treated and Released" }));
jComboBox4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel28.setText("Issued Medications");
jLabel28.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea2.setColumns(20);
jTextArea2.setRows(5);
jTextArea2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane2.setViewportView(jTextArea2);
jLabel29.setText("Description");
jLabel29.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea3.setColumns(20);
jTextArea3.setRows(5);
jTextArea3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane3.setViewportView(jTextArea3);
jLabel30.setText("Diagnosed Doctor");
jLabel30.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton1.setText("Add the Record");
jButton1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 18)); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel58.setText("Date");
jLabel58.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jDateChooser5.setDateFormatString("yyyy-MM-dd");
jDateChooser5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(74, 74, 74)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel23)
.addComponent(jLabel25)
.addComponent(jLabel26)
.addComponent(jLabel27)
.addComponent(jLabel29)
.addComponent(jLabel28))
.addComponent(jLabel30)
.addComponent(jLabel58))
.addGap(37, 37, 37)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBox5, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBox4, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField10)
.addComponent(jTextField8)
.addComponent(jTextField9)
.addComponent(jTextField7)
.addComponent(jScrollPane2)
.addComponent(jScrollPane3)
.addComponent(jDateChooser5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(277, 277, 277)
.addComponent(jButton1)))
.addContainerGap(522, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel23)
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(21, 21, 21)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel25)
.addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel24)
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel26)
.addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel27)
.addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel30)
.addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel28)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(23, 23, 23)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel29))
.addGap(37, 37, 37)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel58)
.addComponent(jDateChooser5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(33, 33, 33)
.addComponent(jButton1)
.addContainerGap(255, Short.MAX_VALUE))
);
Cards_panel.add(jPanel1, "card2");
javax.swing.GroupLayout bgLayout = new javax.swing.GroupLayout(bg);
bg.setLayout(bgLayout);
bgLayout.setHorizontalGroup(
bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(bgLayout.createSequentialGroup()
.addComponent(sp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Cards_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
bgLayout.setVerticalGroup(
bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bgLayout.createSequentialGroup()
.addGroup(bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(Cards_panel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(sp, javax.swing.GroupLayout.PREFERRED_SIZE, 916, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(bg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(bg, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 916, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btn_addrMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_addrMouseClicked
// Card Order and visibility upon click:
cardLayout.show(Cards_panel, "card2");
}//GEN-LAST:event_btn_addrMouseClicked
private void btn_pfMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_pfMouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card3");
}//GEN-LAST:event_btn_pfMouseClicked
private void btn_prMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_prMouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card4");
}//GEN-LAST:event_btn_prMouseClicked
private void btn_apMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_apMouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card5");
}//GEN-LAST:event_btn_apMouseClicked
private void btn_stocksMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_stocksMouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card6");
}//GEN-LAST:event_btn_stocksMouseClicked
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField1ActionPerformed
private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField3ActionPerformed
private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField7ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField7ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into records (indexn, symptoms, pdiagnosis, conditions, disposition, doctor, imedications, des, ddate) VALUES (?,?,?,?,?,?,?,?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, Integer.parseInt(jTextField7.getText()));
pstmt.setString(2, jTextField9.getText());
pstmt.setString(3, jTextField8.getText());
pstmt.setString(4, jTextField10.getText());
pstmt.setString(5, jComboBox4.getSelectedItem().toString());
pstmt.setString(6, jComboBox5.getSelectedItem().toString());
pstmt.setString(7, jTextArea2.getText());
pstmt.setString(8, jTextArea3.getText());
pstmt.setString (9, ((JTextField) jDateChooser5.getDateEditor().getUiComponent()).getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Insertion Completed");
}
catch( SQLException e)
{
JOptionPane.showMessageDialog(null, "No Profile Found Under "+Integer.parseInt(jTextField7.getText())+" Index, Please Register First");
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into profiles (fname, lname, indexn, gender, dob, gnumber, occu, batch, degree, des) VALUES (?,?,?,?,?,?,?,?,?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField1.getText());
pstmt.setString(2, jTextField2.getText());
pstmt.setInt(3, Integer.parseInt(jTextField3.getText()));
pstmt.setString(4, jComboBox3.getSelectedItem().toString());
pstmt.setString (5, ((JTextField) jDateChooser1.getDateEditor().getUiComponent()).getText());
pstmt.setInt(6, Integer.parseInt(jTextField4.getText()));
pstmt.setString(7, jComboBox2.getSelectedItem().toString());
if ( jTextField5 != null && !jTextField5.getText().isEmpty()) {
pstmt.setDouble(8, Double.parseDouble(jTextField5.getText()));
}
else {
pstmt.setNull(8, Types.DOUBLE);
}
if ( jTextField6 != null && !jTextField6.getText().isEmpty()) {
pstmt.setString(9, jTextField6.getText());
}
else {
pstmt.setNull(9, Types.VARCHAR);
}
pstmt.setString(10, jTextArea1.getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Insertion Completed");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jLabel11MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel11MouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card7");
}//GEN-LAST:event_jLabel11MouseClicked
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into appointments (indexn, date, time, doctor, conditions) VALUES (?,?,?,?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, Integer.parseInt(jTextField11.getText()));
pstmt.setString (2, ((JTextField) jDateChooser2.getDateEditor().getUiComponent()).getText());
//System.setProperty("user.timezone", "GMT");
pstmt.setString(3, timePicker1.getTimeStringOrEmptyString());
pstmt.setString(4, jComboBox6.getSelectedItem().toString());
pstmt.setString(5, jTextField12.getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Appointment Added");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, "No Profile Found Under "+Integer.parseInt(jTextField11.getText())+" Index, Please Register First");
}
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
// Shows up all appointments
try {
Connection conn = Db.openConnection();
String sql = ("select * from appointments");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable4.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable4.getColumnModel();
tcm.getColumn(0).setHeaderValue("ID");
tcm.getColumn(1).setHeaderValue("Index");
tcm.getColumn(2).setHeaderValue("Date");
tcm.getColumn(3).setHeaderValue("Time");
tcm.getColumn(4).setHeaderValue("Doctor");
tcm.getColumn(5).setHeaderValue("Conditions");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton5ActionPerformed
private void jTextField13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField13ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField13ActionPerformed
private void jTextField15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField15ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField15ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
// Updating Profiles :
try {
Connection conn = Db.openConnection();
int row = jTable3.getSelectedRow();
String Table_click = (jTable3.getModel().getValueAt(row, 2).toString());
String sql = ("update profiles SET fname=?, lname=?, indexn=?, gender=?, dob=?, gnumber=?, occu=?, batch=?, degree=?, des=? where indexn = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField13.getText());
pstmt.setString(2, jTextField14.getText());
pstmt.setInt(3, Integer.parseInt(jTextField15.getText()));
pstmt.setString(4, jComboBox7.getSelectedItem().toString());
pstmt.setString (5, ((JTextField) jDateChooser3.getDateEditor().getUiComponent()).getText());
pstmt.setInt(6, Integer.parseInt(jTextField16.getText()));
pstmt.setString(7, jComboBox8.getSelectedItem().toString());
if ( jTextField17 != null && !jTextField17.getText().isEmpty()) {
pstmt.setDouble(8, Double.parseDouble(jTextField17.getText()));
}
else {
pstmt.setNull(8, Types.DOUBLE);
}
if ( jTextField18 != null && !jTextField18.getText().isEmpty()) {
pstmt.setString(9, jTextField18.getText());
}
else {
pstmt.setNull(9, Types.VARCHAR);
}
pstmt.setString(10, jTextArea4.getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Profile Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton6ActionPerformed
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
// Delete Profiles :
try {
Connection conn = Db.openConnection();
int row = jTable3.getSelectedRow();
String Table_click = (jTable3.getModel().getValueAt(row, 2).toString());
String sql = ("delete from profiles where indexn = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Profile Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton7ActionPerformed
private void jTable3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable3MouseClicked
try {
Connection conn = Db.openConnection();
int row = jTable3.getSelectedRow();
String Table_click = (jTable3.getModel().getValueAt(row, 2).toString());
String sql = "select * from profiles where indexn = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String fname = rs.getString("fname");
jTextField13.setText(fname);
String lname = rs.getString("lname");
jTextField14.setText(lname);
String indexn = String.valueOf(rs.getInt("indexn"));
jTextField15.setText(indexn);
String gender = rs.getString("gender");
jComboBox7.setSelectedItem(gender);
String dob = String.valueOf(rs.getDate("dob"));
java.util.Date date = new SimpleDateFormat("yyyy-MM-dd").parse(dob);
jDateChooser3.setDate(date);
String gnum = String.valueOf(rs.getInt("gnumber"));
jTextField16.setText(gnum);
String occu = rs.getString("occu");
jComboBox8.setSelectedItem(occu);
String batch = String.valueOf(rs.getDouble("batch"));
jTextField17.setText(batch);
String degree = rs.getString("degree");
jTextField18.setText(degree);
String des = rs.getString("des");
jTextArea4.setText(des);
}
}catch( SQLException | ParseException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable3MouseClicked
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
try {
Connection conn = Db.openConnection();
String sql = ("select * from profiles");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable3.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable3.getColumnModel();
tcm.getColumn(0).setHeaderValue("First Name");
tcm.getColumn(1).setHeaderValue("Last Name");
tcm.getColumn(2).setHeaderValue("Index");
tcm.getColumn(3).setHeaderValue("Gender");
tcm.getColumn(4).setHeaderValue("DOB");
tcm.getColumn(5).setHeaderValue("Guardians Number");
tcm.getColumn(6).setHeaderValue("Occupation");
tcm.getColumn(7).setHeaderValue("Batch");
tcm.getColumn(8).setHeaderValue("Degree");
tcm.getColumn(9).setHeaderValue("Description");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton8ActionPerformed
private void btn_records1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_records1MouseClicked
cardLayout.show(Cards_panel, "card8");
}//GEN-LAST:event_btn_records1MouseClicked
private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox2ActionPerformed
boolean enabled = jComboBox2.getSelectedItem().equals("Student");
jTextField5.setEnabled(enabled);
jLabel19.setEnabled(enabled);
jTextField6.setEnabled(enabled);
jLabel20.setEnabled(enabled);
}//GEN-LAST:event_jComboBox2ActionPerformed
private void jComboBox8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox8ActionPerformed
boolean enabled = jComboBox8.getSelectedItem().equals("Student");
jTextField17.setEnabled(enabled);
jLabel39.setEnabled(enabled);
jTextField18.setEnabled(enabled);
jLabel38.setEnabled(enabled);
}//GEN-LAST:event_jComboBox8ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// shows all the records that r made :
try {
Connection conn = Db.openConnection();
String sql = ("select * from records");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable1.getColumnModel();
tcm.getColumn(0).setHeaderValue("ID");
tcm.getColumn(1).setHeaderValue("Index");
tcm.getColumn(2).setHeaderValue("Symptoms");
tcm.getColumn(3).setHeaderValue("Primary Diagnosis");
tcm.getColumn(4).setHeaderValue("Conditions");
tcm.getColumn(5).setHeaderValue("Disposition");
tcm.getColumn(6).setHeaderValue("Medications");
tcm.getColumn(7).setHeaderValue("Description");
tcm.getColumn(8).setHeaderValue("Diagnosed Date");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton3ActionPerformed
private void jTextField22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField22ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField22ActionPerformed
private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked
// allow to select a single record and do crud
try {
Connection conn = Db.openConnection();
int row = jTable1.getSelectedRow();
String Table_click = (jTable1.getModel().getValueAt(row, 1).toString());
String sql = "select * from records where indexn = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String indexn = String.valueOf(rs.getInt("indexn"));
jTextField22.setText(indexn);
String symptoms = rs.getString("symptoms");
jTextField21.setText(symptoms);
String diagnosis = rs.getString("pdiagnosis");
jTextField20.setText(diagnosis);
String conditions = rs.getString("conditions");
jTextField19.setText(conditions);
String disposition = rs.getString("disposition");
jComboBox10.setSelectedItem(disposition);
String doctor = rs.getString("doctor");
jComboBox9.setSelectedItem(doctor);
String imed = rs.getString("imedications");
jTextArea6.setText(imed);
String des = rs.getString("des");
jTextArea5.setText(des);
String ddate = String.valueOf(rs.getDate("ddate"));
java.util.Date date = new SimpleDateFormat("yyyy-MM-dd").parse(ddate);
jDateChooser4.setDate(date);
}
}catch( SQLException | ParseException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable1MouseClicked
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
// Update records:
try {
Connection conn = Db.openConnection();
int row = jTable1.getSelectedRow();
String Table_click = (jTable1.getModel().getValueAt(row, 0).toString());
String sql = ("update records set symptoms=?, pdiagnosis=?, conditions=?, disposition=?, doctor=?, imedications=?, des=?, ddate=? where id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField21.getText());
pstmt.setString(2, jTextField20.getText());
pstmt.setString(3, jTextField19.getText());
pstmt.setString(4, jComboBox10.getSelectedItem().toString());
pstmt.setString(5, jComboBox9.getSelectedItem().toString());
pstmt.setString(6, jTextArea6.getText());
pstmt.setString(7, jTextArea5.getText());
pstmt.setString (8, ((JTextField) jDateChooser4.getDateEditor().getUiComponent()).getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Record Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton9ActionPerformed
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
// Delete Records:
try {
Connection conn = Db.openConnection();
int row = jTable1.getSelectedRow();
String Table_click = (jTable1.getModel().getValueAt(row, 0).toString());
String sql = ("delete from records where id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Record Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton10ActionPerformed
private void jTable4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable4MouseClicked
// select a single appointment
try {
Connection conn = Db.openConnection();
int row = jTable4.getSelectedRow();
String Table_click = (jTable4.getModel().getValueAt(row, 0).toString());
String sql = "select * from appointments where id = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String indexn = String.valueOf(rs.getInt("indexn"));
jTextField11.setText(indexn);
jTextField11.setEditable(false);
String adate = String.valueOf(rs.getDate("date"));
java.util.Date date = new SimpleDateFormat("yyyy-MM-dd").parse(adate);
jDateChooser2.setDate(date);
String atime = String.valueOf(rs.getTime("time"));
timePicker1.setText(atime);
// String atime = String.valueOf(rs.getTime("time"));
// SimpleDateFormat sdf = new SimpleDateFormat("hh:mm a",Locale.US);
// String stime = sdf.format(atime);
// timePicker1.setText(stime);
String disposition = rs.getString("doctor");
jComboBox6.setSelectedItem(disposition);
String symptoms = rs.getString("conditions");
jTextField12.setText(symptoms);
}
}catch( SQLException | ParseException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable4MouseClicked
private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
// Update Appointments:
try {
Connection conn = Db.openConnection();
int row = jTable4.getSelectedRow();
String Table_click = (jTable4.getModel().getValueAt(row, 0).toString());
String sql = ("update appointments SET date=?, time=?, doctor=?, conditions=? where id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString (1, ((JTextField) jDateChooser2.getDateEditor().getUiComponent()).getText());
pstmt.setString (2, timePicker1.getTimeStringOrEmptyString());
pstmt.setString(3, jComboBox6.getSelectedItem().toString());
pstmt.setString(4, jTextField12.getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Appointment Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton11ActionPerformed
private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
// Delete Appointments:
try {
Connection conn = Db.openConnection();
int row = jTable4.getSelectedRow();
String Table_click = (jTable4.getModel().getValueAt(row, 0).toString());
String sql = ("delete from appointments where id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Appointment Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton12ActionPerformed
private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
// Filter:
try {
Connection conn = Db.openConnection();
int index_nu = Integer.parseInt(jTextField23.getText());
String sql = ("select * from profiles where indexn='"+index_nu+"' ");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable2.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable2.getColumnModel();
tcm.getColumn(0).setHeaderValue("First Name");
tcm.getColumn(1).setHeaderValue("Last Name");
tcm.getColumn(2).setHeaderValue("Index");
tcm.getColumn(3).setHeaderValue("Gender");
tcm.getColumn(4).setHeaderValue("DOB");
tcm.getColumn(5).setHeaderValue("Guardians Number");
tcm.getColumn(6).setHeaderValue("Occupation");
tcm.getColumn(7).setHeaderValue("Batch");
tcm.getColumn(8).setHeaderValue("Degree");
tcm.getColumn(9).setHeaderValue("Description");
String sql2 = ("select * from records where indexn='"+index_nu+"' ");
PreparedStatement pstmt2 = conn.prepareStatement(sql2);
ResultSet rs2 = pstmt2.executeQuery();
jTable5.setModel(DbUtils.resultSetToTableModel(rs2));
TableColumnModel tcm2 = jTable5.getColumnModel();
tcm2.getColumn(0).setHeaderValue("ID");
tcm2.getColumn(1).setHeaderValue("Index");
tcm2.getColumn(2).setHeaderValue("Symptoms");
tcm2.getColumn(3).setHeaderValue("Primary Diagnosis");
tcm2.getColumn(4).setHeaderValue("Conditions");
tcm2.getColumn(5).setHeaderValue("Disposition");
tcm2.getColumn(6).setHeaderValue("Medications");
tcm2.getColumn(7).setHeaderValue("Description");
tcm2.getColumn(8).setHeaderValue("Diagnosed Date");
String sql3 = ("select * from appointments where indexn='"+index_nu+"' ");
PreparedStatement pstmt3 = conn.prepareStatement(sql3);
ResultSet rs3 = pstmt3.executeQuery();
jTable6.setModel(DbUtils.resultSetToTableModel(rs3));
TableColumnModel tcm3 = jTable6.getColumnModel();
tcm3.getColumn(0).setHeaderValue("ID");
tcm3.getColumn(1).setHeaderValue("Index");
tcm3.getColumn(2).setHeaderValue("Date");
tcm3.getColumn(3).setHeaderValue("Time");
tcm3.getColumn(4).setHeaderValue("Doctor");
tcm3.getColumn(5).setHeaderValue("Conditions");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton13ActionPerformed
private void btn_records4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_records4MouseClicked
cardLayout.show(Cards_panel, "card9");
}//GEN-LAST:event_btn_records4MouseClicked
private void jPanel7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel7MouseClicked
// Filter:
try {
Connection conn = Db.openConnection();
int index_nu = Integer.parseInt(jTextField24.getText());
String sql = ("select * from profiles where indexn='"+index_nu+"' ");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable3.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable3.getColumnModel();
tcm.getColumn(0).setHeaderValue("First Name");
tcm.getColumn(1).setHeaderValue("Last Name");
tcm.getColumn(2).setHeaderValue("Index");
tcm.getColumn(3).setHeaderValue("Gender");
tcm.getColumn(4).setHeaderValue("DOB");
tcm.getColumn(5).setHeaderValue("Guardians Number");
tcm.getColumn(6).setHeaderValue("Occupation");
tcm.getColumn(7).setHeaderValue("Batch");
tcm.getColumn(8).setHeaderValue("Degree");
tcm.getColumn(9).setHeaderValue("Description");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jPanel7MouseClicked
private void jPanel8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel8MouseClicked
// TODO add your handling code here:
// Filter:
try {
Connection conn = Db.openConnection();
int index_nu = Integer.parseInt(jTextField25.getText());
String sql = ("select * from appointments where indexn='"+index_nu+"' ");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable4.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable4.getColumnModel();
tcm.getColumn(0).setHeaderValue("ID");
tcm.getColumn(1).setHeaderValue("Index");
tcm.getColumn(2).setHeaderValue("Date");
tcm.getColumn(3).setHeaderValue("Time");
tcm.getColumn(4).setHeaderValue("Doctor");
tcm.getColumn(5).setHeaderValue("Conditions");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jPanel8MouseClicked
private void jPanel9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel9MouseClicked
try {
Connection conn = Db.openConnection();
int index_nu = Integer.parseInt(jTextField26.getText());
String sql = ("select * from records where indexn='"+index_nu+"' ");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable1.getColumnModel();
tcm.getColumn(0).setHeaderValue("ID");
tcm.getColumn(1).setHeaderValue("Index");
tcm.getColumn(2).setHeaderValue("Symptoms");
tcm.getColumn(3).setHeaderValue("Primary Diagnosis");
tcm.getColumn(4).setHeaderValue("Conditions");
tcm.getColumn(5).setHeaderValue("Disposition");
tcm.getColumn(6).setHeaderValue("Medications");
tcm.getColumn(7).setHeaderValue("Description");
tcm.getColumn(8).setHeaderValue("Diagnosed Date");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jPanel9MouseClicked
private void btn_records5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_records5MouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_btn_records5MouseClicked
private void btn_records5MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_records5MouseReleased
cardLayout.show(Cards_panel, "card10");
}//GEN-LAST:event_btn_records5MouseReleased
private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
// Adding a doctor:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into doctor (name, Tel_no) VALUES (?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField27.getText());
pstmt.setInt(2, Integer.parseInt(jTextField28.getText()));
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Doctor Added");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton14ActionPerformed
private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
// listing doctors:
try {
Connection conn = Db.openConnection();
String sql = ("select * from doctor");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable7.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable7.getColumnModel();
tcm.getColumn(0).setHeaderValue("Doctor ID");
tcm.getColumn(1).setHeaderValue("Name");
tcm.getColumn(2).setHeaderValue("Tel. No");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton15ActionPerformed
private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton16ActionPerformed
// Updating Doctors:
try {
Connection conn = Db.openConnection();
int row = jTable7.getSelectedRow();
String Table_click = (jTable7.getModel().getValueAt(row, 0).toString());
String sql = ("update doctor SET name=?, Tel_no=? where D_id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField27.getText());
pstmt.setInt(2, Integer.parseInt(jTextField28.getText()));
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Doctor Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton16ActionPerformed
private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed
// removing doctors:
try {
Connection conn = Db.openConnection();
int row = jTable7.getSelectedRow();
String Table_click = (jTable7.getModel().getValueAt(row, 0).toString());
String sql = ("delete from doctor where D_id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Doctor Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton17ActionPerformed
private void jTable7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable7MouseClicked
// selecting a doctor to do CRUD:
try {
Connection conn = Db.openConnection();
int row = jTable7.getSelectedRow();
String Table_click = (jTable7.getModel().getValueAt(row, 0).toString());
String sql = "select * from doctor where D_id = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String doc_id = rs.getString("name");
jTextField27.setText(doc_id);
String tel = String.valueOf(rs.getInt("Tel_no"));
jTextField28.setText(tel);
}
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable7MouseClicked
private void jTable8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable8MouseClicked
// Stock Item Selector:
try {
Connection conn = Db.openConnection();
int row = jTable8.getSelectedRow();
String Table_click = (jTable8.getModel().getValueAt(row, 0).toString());
String sql = "select * from stock where ItemCode = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String item_code = String.valueOf(rs.getInt("ItemCode"));
jTextField32.setText(item_code);
jTextField32.setEditable(false);
String item_name = rs.getString("Name");
jTextField29.setText(item_name);
String item_price = String.valueOf(rs.getDouble("Price"));
jTextField30.setText(item_price);
String item_quantity = String.valueOf(rs.getInt("quantity"));
jTextField31.setText(item_quantity);
}
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable8MouseClicked
private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
// Adding Stocks:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into stock (Name, Price, quantity) VALUES (?,?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField29.getText());
pstmt.setDouble(2, Double.parseDouble(jTextField30.getText()));
pstmt.setInt(3, Integer.parseInt(jTextField31.getText()));
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Item Added");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton18ActionPerformed
private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton19ActionPerformed
// Refreshing the list:
try {
Connection conn = Db.openConnection();
String sql = ("select * from stock");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable8.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable8.getColumnModel();
tcm.getColumn(0).setHeaderValue("Item Code");
tcm.getColumn(1).setHeaderValue("Name");
tcm.getColumn(2).setHeaderValue("Price");
tcm.getColumn(3).setHeaderValue("Quantity");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton19ActionPerformed
private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton20ActionPerformed
// Updating Stock:
try {
Connection conn = Db.openConnection();
int row = jTable8.getSelectedRow();
String Table_click = (jTable8.getModel().getValueAt(row, 0).toString());
String sql = ("update stock SET Name=?, Price=?, quantity=? where ItemCode = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField29.getText());
pstmt.setDouble(2, Double.parseDouble(jTextField30.getText()));
pstmt.setInt(3, Integer.parseInt(jTextField31.getText()));
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Item Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton20ActionPerformed
private void jButton21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton21ActionPerformed
// Removing Stock:
try {
Connection conn = Db.openConnection();
int row = jTable8.getSelectedRow();
String Table_click = (jTable8.getModel().getValueAt(row, 0).toString());
String sql = ("delete from stock where ItemCode = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Item Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton21ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Menu().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel Cards_panel;
private javax.swing.JPanel bg;
private javax.swing.JPanel btn_addr;
private javax.swing.JPanel btn_ap;
private javax.swing.JPanel btn_pf;
private javax.swing.JPanel btn_pr;
private javax.swing.JPanel btn_records1;
private javax.swing.JPanel btn_records4;
private javax.swing.JPanel btn_records5;
private javax.swing.JPanel btn_stocks;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton10;
private javax.swing.JButton jButton11;
private javax.swing.JButton jButton12;
private javax.swing.JButton jButton13;
private javax.swing.JButton jButton14;
private javax.swing.JButton jButton15;
private javax.swing.JButton jButton16;
private javax.swing.JButton jButton17;
private javax.swing.JButton jButton18;
private javax.swing.JButton jButton19;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton20;
private javax.swing.JButton jButton21;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JButton jButton9;
private javax.swing.JComboBox<String> jComboBox10;
private javax.swing.JComboBox<String> jComboBox2;
private javax.swing.JComboBox<String> jComboBox3;
private javax.swing.JComboBox<String> jComboBox4;
private javax.swing.JComboBox<String> jComboBox5;
private javax.swing.JComboBox<String> jComboBox6;
private javax.swing.JComboBox<String> jComboBox7;
private javax.swing.JComboBox<String> jComboBox8;
private javax.swing.JComboBox<String> jComboBox9;
private com.toedter.calendar.JDateChooser jDateChooser1;
private com.toedter.calendar.JDateChooser jDateChooser2;
private com.toedter.calendar.JDateChooser jDateChooser3;
private com.toedter.calendar.JDateChooser jDateChooser4;
private com.toedter.calendar.JDateChooser jDateChooser5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel27;
private javax.swing.JLabel jLabel28;
private javax.swing.JLabel jLabel29;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel30;
private javax.swing.JLabel jLabel31;
private javax.swing.JLabel jLabel32;
private javax.swing.JLabel jLabel33;
private javax.swing.JLabel jLabel34;
private javax.swing.JLabel jLabel35;
private javax.swing.JLabel jLabel36;
private javax.swing.JLabel jLabel37;
private javax.swing.JLabel jLabel38;
private javax.swing.JLabel jLabel39;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel40;
private javax.swing.JLabel jLabel41;
private javax.swing.JLabel jLabel42;
private javax.swing.JLabel jLabel43;
private javax.swing.JLabel jLabel44;
private javax.swing.JLabel jLabel45;
private javax.swing.JLabel jLabel46;
private javax.swing.JLabel jLabel47;
private javax.swing.JLabel jLabel48;
private javax.swing.JLabel jLabel49;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel50;
private javax.swing.JLabel jLabel51;
private javax.swing.JLabel jLabel52;
private javax.swing.JLabel jLabel53;
private javax.swing.JLabel jLabel54;
private javax.swing.JLabel jLabel55;
private javax.swing.JLabel jLabel56;
private javax.swing.JLabel jLabel57;
private javax.swing.JLabel jLabel58;
private javax.swing.JLabel jLabel59;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel60;
private javax.swing.JLabel jLabel61;
private javax.swing.JLabel jLabel62;
private javax.swing.JLabel jLabel63;
private javax.swing.JLabel jLabel64;
private javax.swing.JLabel jLabel65;
private javax.swing.JLabel jLabel66;
private javax.swing.JLabel jLabel67;
private javax.swing.JLabel jLabel68;
private javax.swing.JLabel jLabel69;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel70;
private javax.swing.JLabel jLabel71;
private javax.swing.JLabel jLabel72;
private javax.swing.JLabel jLabel73;
private javax.swing.JLabel jLabel74;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane10;
private javax.swing.JScrollPane jScrollPane11;
private javax.swing.JScrollPane jScrollPane12;
private javax.swing.JScrollPane jScrollPane13;
private javax.swing.JScrollPane jScrollPane14;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JScrollPane jScrollPane6;
private javax.swing.JScrollPane jScrollPane7;
private javax.swing.JScrollPane jScrollPane8;
private javax.swing.JScrollPane jScrollPane9;
private javax.swing.JTable jTable1;
private javax.swing.JTable jTable2;
private javax.swing.JTable jTable3;
private javax.swing.JTable jTable4;
private javax.swing.JTable jTable5;
private javax.swing.JTable jTable6;
private javax.swing.JTable jTable7;
private javax.swing.JTable jTable8;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextArea jTextArea2;
private javax.swing.JTextArea jTextArea3;
private javax.swing.JTextArea jTextArea4;
private javax.swing.JTextArea jTextArea5;
private javax.swing.JTextArea jTextArea6;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField10;
private javax.swing.JTextField jTextField11;
private javax.swing.JTextField jTextField12;
private javax.swing.JTextField jTextField13;
private javax.swing.JTextField jTextField14;
private javax.swing.JTextField jTextField15;
private javax.swing.JTextField jTextField16;
private javax.swing.JTextField jTextField17;
private javax.swing.JTextField jTextField18;
private javax.swing.JTextField jTextField19;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField20;
private javax.swing.JTextField jTextField21;
private javax.swing.JTextField jTextField22;
private javax.swing.JTextField jTextField23;
private javax.swing.JTextField jTextField24;
private javax.swing.JTextField jTextField25;
private javax.swing.JTextField jTextField26;
private javax.swing.JTextField jTextField27;
private javax.swing.JTextField jTextField28;
private javax.swing.JTextField jTextField29;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField30;
private javax.swing.JTextField jTextField31;
private javax.swing.JTextField jTextField32;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField6;
private javax.swing.JTextField jTextField7;
private javax.swing.JTextField jTextField8;
private javax.swing.JTextField jTextField9;
private keeptoo.KGradientPanel kGradientPanel1;
private keeptoo.KGradientPanel kGradientPanel2;
private keeptoo.KGradientPanel kGradientPanel3;
private keeptoo.KGradientPanel kGradientPanel4;
private javax.swing.JPanel sp;
private com.github.lgooddatepicker.components.TimePicker timePicker1;
// End of variables declaration//GEN-END:variables
}
| UTF-8 | Java | 169,263 | java | Menu.java | Java | [
{
"context": "i\", 1, 14)); // NOI18N\n\n jLabel41.setText(\"Guardians Tel\");\n jLabel41.setFont(new java.awt.Font(\"Mi",
"end": 34789,
"score": 0.989966094493866,
"start": 34776,
"tag": "NAME",
"value": "Guardians Tel"
},
{
"context": "i\", 1, 14)); // NOI18N\n\n ... | null | [] | package nsbmhms2.pkg0;
import java.awt.CardLayout;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.table.TableColumnModel;
import net.proteanit.sql.DbUtils;
/**
*
* @author Group 33
*/
public class Menu extends javax.swing.JFrame {
/**
* Creates new form Start
*/
CardLayout cardLayout;
public Menu() {
initComponents();
PopulateCombo();
cardLayout = (CardLayout)(Cards_panel.getLayout());
}
//PopulateCombox
private void PopulateCombo(){
try {
Connection conn = Db.openConnection();
String sql = ("select name from doctor");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
while(rs.next()){
String name = rs.getString("name");
jComboBox5.addItem(name);
jComboBox6.addItem(name);
jComboBox9.addItem(name);
}
} catch (SQLException e) {
}
}
//end
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
bg = new javax.swing.JPanel();
sp = new javax.swing.JPanel();
btn_addr = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
btn_pf = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
btn_pr = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
btn_ap = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
btn_stocks = new javax.swing.JPanel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jPanel6 = new javax.swing.JPanel();
btn_records1 = new javax.swing.JPanel();
jLabel47 = new javax.swing.JLabel();
jLabel48 = new javax.swing.JLabel();
btn_records4 = new javax.swing.JPanel();
jLabel63 = new javax.swing.JLabel();
jLabel64 = new javax.swing.JLabel();
btn_records5 = new javax.swing.JPanel();
jLabel68 = new javax.swing.JLabel();
jLabel69 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
Cards_panel = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jTextField13 = new javax.swing.JTextField();
jTextField14 = new javax.swing.JTextField();
jTextField15 = new javax.swing.JTextField();
jComboBox7 = new javax.swing.JComboBox<>();
jDateChooser3 = new com.toedter.calendar.JDateChooser();
jTextField16 = new javax.swing.JTextField();
jComboBox8 = new javax.swing.JComboBox<>();
jTextField17 = new javax.swing.JTextField();
jTextField18 = new javax.swing.JTextField();
jScrollPane6 = new javax.swing.JScrollPane();
jTextArea4 = new javax.swing.JTextArea();
jLabel37 = new javax.swing.JLabel();
jLabel38 = new javax.swing.JLabel();
jLabel39 = new javax.swing.JLabel();
jLabel40 = new javax.swing.JLabel();
jLabel41 = new javax.swing.JLabel();
jLabel42 = new javax.swing.JLabel();
jLabel43 = new javax.swing.JLabel();
jLabel44 = new javax.swing.JLabel();
jLabel45 = new javax.swing.JLabel();
jLabel46 = new javax.swing.JLabel();
jButton6 = new javax.swing.JButton();
jButton7 = new javax.swing.JButton();
jScrollPane7 = new javax.swing.JScrollPane();
jTable3 = new javax.swing.JTable();
jButton8 = new javax.swing.JButton();
jTextField24 = new javax.swing.JTextField();
jPanel7 = new javax.swing.JPanel();
jLabel59 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jTextField1 = new javax.swing.JTextField();
jLabel12 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel15 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jLabel18 = new javax.swing.JLabel();
jComboBox2 = new javax.swing.JComboBox<>();
jLabel19 = new javax.swing.JLabel();
jTextField5 = new javax.swing.JTextField();
jLabel20 = new javax.swing.JLabel();
jTextField6 = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jLabel21 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
jComboBox3 = new javax.swing.JComboBox<>();
jButton2 = new javax.swing.JButton();
jDateChooser1 = new com.toedter.calendar.JDateChooser();
jPanel4 = new javax.swing.JPanel();
jLabel31 = new javax.swing.JLabel();
jLabel32 = new javax.swing.JLabel();
jLabel33 = new javax.swing.JLabel();
jTextField11 = new javax.swing.JTextField();
jComboBox6 = new javax.swing.JComboBox<>();
jLabel34 = new javax.swing.JLabel();
jTextField12 = new javax.swing.JTextField();
jButton4 = new javax.swing.JButton();
jDateChooser2 = new com.toedter.calendar.JDateChooser();
timePicker1 = new com.github.lgooddatepicker.components.TimePicker();
jButton5 = new javax.swing.JButton();
jScrollPane10 = new javax.swing.JScrollPane();
jTable4 = new javax.swing.JTable();
jButton11 = new javax.swing.JButton();
jButton12 = new javax.swing.JButton();
jTextField25 = new javax.swing.JTextField();
jPanel8 = new javax.swing.JPanel();
jLabel60 = new javax.swing.JLabel();
jPanel5 = new javax.swing.JPanel();
jLabel71 = new javax.swing.JLabel();
jLabel72 = new javax.swing.JLabel();
jLabel73 = new javax.swing.JLabel();
jTextField29 = new javax.swing.JTextField();
jTextField30 = new javax.swing.JTextField();
jTextField31 = new javax.swing.JTextField();
jScrollPane14 = new javax.swing.JScrollPane();
jTable8 = new javax.swing.JTable();
jButton18 = new javax.swing.JButton();
jButton19 = new javax.swing.JButton();
jButton20 = new javax.swing.JButton();
jButton21 = new javax.swing.JButton();
jLabel74 = new javax.swing.JLabel();
jTextField32 = new javax.swing.JTextField();
kGradientPanel1 = new keeptoo.KGradientPanel();
jLabel35 = new javax.swing.JLabel();
jLabel36 = new javax.swing.JLabel();
kGradientPanel2 = new keeptoo.KGradientPanel();
jScrollPane4 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton3 = new javax.swing.JButton();
jScrollPane8 = new javax.swing.JScrollPane();
jTextArea5 = new javax.swing.JTextArea();
jLabel49 = new javax.swing.JLabel();
jScrollPane9 = new javax.swing.JScrollPane();
jTextArea6 = new javax.swing.JTextArea();
jLabel50 = new javax.swing.JLabel();
jComboBox9 = new javax.swing.JComboBox<>();
jLabel51 = new javax.swing.JLabel();
jComboBox10 = new javax.swing.JComboBox<>();
jLabel52 = new javax.swing.JLabel();
jTextField19 = new javax.swing.JTextField();
jLabel53 = new javax.swing.JLabel();
jTextField20 = new javax.swing.JTextField();
jLabel54 = new javax.swing.JLabel();
jLabel55 = new javax.swing.JLabel();
jTextField21 = new javax.swing.JTextField();
jTextField22 = new javax.swing.JTextField();
jLabel56 = new javax.swing.JLabel();
jLabel57 = new javax.swing.JLabel();
jDateChooser4 = new com.toedter.calendar.JDateChooser();
jButton9 = new javax.swing.JButton();
jButton10 = new javax.swing.JButton();
jPanel9 = new javax.swing.JPanel();
jTextField26 = new javax.swing.JTextField();
jLabel61 = new javax.swing.JLabel();
kGradientPanel3 = new keeptoo.KGradientPanel();
jTextField23 = new javax.swing.JTextField();
jButton13 = new javax.swing.JButton();
jScrollPane5 = new javax.swing.JScrollPane();
jTable2 = new javax.swing.JTable();
jScrollPane11 = new javax.swing.JScrollPane();
jTable5 = new javax.swing.JTable();
jScrollPane12 = new javax.swing.JScrollPane();
jTable6 = new javax.swing.JTable();
jLabel65 = new javax.swing.JLabel();
jLabel66 = new javax.swing.JLabel();
jLabel67 = new javax.swing.JLabel();
kGradientPanel4 = new keeptoo.KGradientPanel();
jButton14 = new javax.swing.JButton();
jButton15 = new javax.swing.JButton();
jButton16 = new javax.swing.JButton();
jButton17 = new javax.swing.JButton();
jScrollPane13 = new javax.swing.JScrollPane();
jTable7 = new javax.swing.JTable();
jLabel62 = new javax.swing.JLabel();
jLabel70 = new javax.swing.JLabel();
jTextField27 = new javax.swing.JTextField();
jTextField28 = new javax.swing.JTextField();
jPanel1 = new javax.swing.JPanel();
jLabel23 = new javax.swing.JLabel();
jTextField7 = new javax.swing.JTextField();
jLabel24 = new javax.swing.JLabel();
jTextField8 = new javax.swing.JTextField();
jLabel25 = new javax.swing.JLabel();
jTextField9 = new javax.swing.JTextField();
jLabel26 = new javax.swing.JLabel();
jTextField10 = new javax.swing.JTextField();
jLabel27 = new javax.swing.JLabel();
jComboBox4 = new javax.swing.JComboBox<>();
jLabel28 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
jTextArea2 = new javax.swing.JTextArea();
jLabel29 = new javax.swing.JLabel();
jScrollPane3 = new javax.swing.JScrollPane();
jTextArea3 = new javax.swing.JTextArea();
jLabel30 = new javax.swing.JLabel();
jComboBox5 = new javax.swing.JComboBox<>();
jButton1 = new javax.swing.JButton();
jLabel58 = new javax.swing.JLabel();
jDateChooser5 = new com.toedter.calendar.JDateChooser();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
sp.setBackground(new java.awt.Color(42, 8, 69));
btn_addr.setBackground(new java.awt.Color(54, 33, 89));
btn_addr.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_addr.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_addrMouseClicked(evt);
}
});
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_plus_45px.png"))); // NOI18N
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Add a Record");
jLabel2.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel2.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_addrLayout = new javax.swing.GroupLayout(btn_addr);
btn_addr.setLayout(btn_addrLayout);
btn_addrLayout.setHorizontalGroup(
btn_addrLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_addrLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jLabel2)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_addrLayout.setVerticalGroup(
btn_addrLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_addrLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel2)
.addContainerGap(24, Short.MAX_VALUE))
);
jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_fiber_45px.png"))); // NOI18N
btn_pf.setBackground(new java.awt.Color(54, 33, 89));
btn_pf.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_pf.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_pfMouseClicked(evt);
}
});
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_vomited_45px.png"))); // NOI18N
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel4.setText("Patient Profiles");
jLabel4.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel4.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_pfLayout = new javax.swing.GroupLayout(btn_pf);
btn_pf.setLayout(btn_pfLayout);
btn_pfLayout.setHorizontalGroup(
btn_pfLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_pfLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addComponent(jLabel4)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_pfLayout.setVerticalGroup(
btn_pfLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_pfLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel4)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_pr.setBackground(new java.awt.Color(54, 33, 89));
btn_pr.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_pr.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_prMouseClicked(evt);
}
});
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_add_user_group_woman_man_45px.png"))); // NOI18N
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel6.setText("Patient Registration");
jLabel6.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel6.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_prLayout = new javax.swing.GroupLayout(btn_pr);
btn_pr.setLayout(btn_prLayout);
btn_prLayout.setHorizontalGroup(
btn_prLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_prLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel5)
.addGap(18, 18, 18)
.addComponent(jLabel6)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_prLayout.setVerticalGroup(
btn_prLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_prLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel6)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_ap.setBackground(new java.awt.Color(54, 33, 89));
btn_ap.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_ap.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_apMouseClicked(evt);
}
});
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_planner_45px.png"))); // NOI18N
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel8.setText("Appointments");
jLabel8.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel8.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_apLayout = new javax.swing.GroupLayout(btn_ap);
btn_ap.setLayout(btn_apLayout);
btn_apLayout.setHorizontalGroup(
btn_apLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_apLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel7)
.addGap(18, 18, 18)
.addComponent(jLabel8)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_apLayout.setVerticalGroup(
btn_apLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_apLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel8)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_stocks.setBackground(new java.awt.Color(54, 33, 89));
btn_stocks.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_stocks.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_stocksMouseClicked(evt);
}
});
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_scan_stock_45px.png"))); // NOI18N
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel10.setText("Stocks");
jLabel10.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel10.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_stocksLayout = new javax.swing.GroupLayout(btn_stocks);
btn_stocks.setLayout(btn_stocksLayout);
btn_stocksLayout.setHorizontalGroup(
btn_stocksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_stocksLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel9)
.addGap(18, 18, 18)
.addComponent(jLabel10)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_stocksLayout.setVerticalGroup(
btn_stocksLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel9, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_stocksLayout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel10)
.addContainerGap(24, Short.MAX_VALUE))
);
jPanel6.setBackground(new java.awt.Color(42, 8, 69));
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 58, Short.MAX_VALUE)
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 78, Short.MAX_VALUE)
);
btn_records1.setBackground(new java.awt.Color(54, 33, 89));
btn_records1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_records1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_records1MouseClicked(evt);
}
});
jLabel47.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel47.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_health_book_45px_1.png"))); // NOI18N
jLabel48.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel48.setText("Records");
jLabel48.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel48.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_records1Layout = new javax.swing.GroupLayout(btn_records1);
btn_records1.setLayout(btn_records1Layout);
btn_records1Layout.setHorizontalGroup(
btn_records1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_records1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel47)
.addGap(18, 18, 18)
.addComponent(jLabel48)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_records1Layout.setVerticalGroup(
btn_records1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel47, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_records1Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel48)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_records4.setBackground(new java.awt.Color(54, 33, 89));
btn_records4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_records4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_records4MouseClicked(evt);
}
});
jLabel63.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel63.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_advanced_search_45px.png"))); // NOI18N
jLabel64.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel64.setText("Advanced Overview");
jLabel64.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel64.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_records4Layout = new javax.swing.GroupLayout(btn_records4);
btn_records4.setLayout(btn_records4Layout);
btn_records4Layout.setHorizontalGroup(
btn_records4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_records4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel63)
.addGap(18, 18, 18)
.addComponent(jLabel64)
.addGap(0, 253, Short.MAX_VALUE))
);
btn_records4Layout.setVerticalGroup(
btn_records4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel63, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_records4Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel64)
.addContainerGap(24, Short.MAX_VALUE))
);
btn_records5.setBackground(new java.awt.Color(54, 33, 89));
btn_records5.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btn_records5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
btn_records5MouseClicked(evt);
}
public void mouseReleased(java.awt.event.MouseEvent evt) {
btn_records5MouseReleased(evt);
}
});
jLabel68.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel68.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_doctor_male_45px.png"))); // NOI18N
jLabel69.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel69.setText("Doctors");
jLabel69.setFont(new java.awt.Font("Calibri", 1, 18)); // NOI18N
jLabel69.setForeground(new java.awt.Color(255, 255, 255));
javax.swing.GroupLayout btn_records5Layout = new javax.swing.GroupLayout(btn_records5);
btn_records5.setLayout(btn_records5Layout);
btn_records5Layout.setHorizontalGroup(
btn_records5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(btn_records5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel68)
.addGap(18, 18, 18)
.addComponent(jLabel69)
.addGap(0, 0, Short.MAX_VALUE))
);
btn_records5Layout.setVerticalGroup(
btn_records5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel68, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(btn_records5Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addComponent(jLabel69)
.addContainerGap(24, Short.MAX_VALUE))
);
jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_info_25px.png"))); // NOI18N
jLabel11.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jLabel11MouseClicked(evt);
}
});
javax.swing.GroupLayout spLayout = new javax.swing.GroupLayout(sp);
sp.setLayout(spLayout);
spLayout.setHorizontalGroup(
spLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btn_addr, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_pf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_pr, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_ap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_stocks, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(spLayout.createSequentialGroup()
.addGroup(spLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(btn_records1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_records4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btn_records5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(spLayout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel11)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
spLayout.setVerticalGroup(
spLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(spLayout.createSequentialGroup()
.addComponent(jLabel13)
.addGap(41, 41, 41)
.addComponent(btn_addr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_pf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_pr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_ap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_stocks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_records1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_records4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btn_records5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(191, 191, 191)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
Cards_panel.setLayout(new java.awt.CardLayout());
jPanel2.setBackground(java.awt.Color.gray);
jPanel2.setPreferredSize(new java.awt.Dimension(1000, 969));
jTextField13.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField13ActionPerformed(evt);
}
});
jTextField14.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField15.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField15ActionPerformed(evt);
}
});
jComboBox7.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Male", "Female" }));
jComboBox7.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jDateChooser3.setDateFormatString("yyyy-MM-dd");
jDateChooser3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField16.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox8.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Student", "Academic Staff", "Non-ac Staff" }));
jComboBox8.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox8ActionPerformed(evt);
}
});
jTextField17.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField18.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea4.setColumns(20);
jTextArea4.setRows(5);
jTextArea4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane6.setViewportView(jTextArea4);
jLabel37.setText("Description");
jLabel37.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel38.setText("Degree");
jLabel38.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel39.setText("Batch");
jLabel39.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel40.setText("Occupation");
jLabel40.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel41.setText("<NAME>");
jLabel41.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel42.setText("D.O.B");
jLabel42.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel43.setText("Gender");
jLabel43.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel44.setText("Index Number");
jLabel44.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel45.setText("Last Name");
jLabel45.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel46.setText("First Name");
jLabel46.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton6.setText("Update");
jButton6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
}
});
jButton7.setText("Delete");
jButton7.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});
jScrollPane7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jTable3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable3MouseClicked(evt);
}
});
jScrollPane7.setViewportView(jTable3);
jButton8.setText("Refresh");
jButton8.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton8ActionPerformed(evt);
}
});
jTextField24.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jPanel7.setBackground(java.awt.Color.gray);
jPanel7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jPanel7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel7MouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 24, Short.MAX_VALUE)
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 24, Short.MAX_VALUE)
);
jLabel59.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_search_24px.png"))); // NOI18N
jLabel59.setBackground(new java.awt.Color(255, 102, 102));
jLabel59.setIconTextGap(0);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(455, 455, 455)
.addComponent(jButton6))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(263, 263, 263)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel46)
.addComponent(jLabel45)
.addComponent(jLabel44)
.addComponent(jLabel41, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel40)
.addComponent(jLabel39)
.addComponent(jLabel38)
.addComponent(jLabel37)
.addComponent(jLabel43)
.addComponent(jLabel42))
.addGap(2, 2, 2)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField14)
.addComponent(jTextField15)
.addComponent(jComboBox7, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField17)
.addComponent(jTextField18)
.addComponent(jScrollPane6)
.addComponent(jTextField16)
.addComponent(jComboBox8, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jDateChooser3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField13))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jLabel59)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 136, Short.MAX_VALUE)
.addComponent(jButton7)
.addGap(18, 18, 18)
.addComponent(jButton8)
.addGap(528, 528, 528))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(jScrollPane7)
.addContainerGap())))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel59)))
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton7)
.addComponent(jButton8))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel46)
.addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(20, 20, 20)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel45)
.addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel44)
.addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(11, 11, 11)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel43)
.addComponent(jComboBox7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(13, 13, 13)
.addComponent(jLabel42)
.addGap(24, 24, 24))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jDateChooser3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel41)
.addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel40)
.addComponent(jComboBox8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel39))
.addGap(21, 21, 21)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel38)
.addComponent(jTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel37)
.addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jButton6)
.addGap(220, 220, 220))
);
Cards_panel.add(jPanel2, "card3");
jPanel3.setBackground(java.awt.Color.gray);
jTextField1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});
jLabel12.setText("<NAME>");
jLabel12.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel14.setText("<NAME>");
jLabel14.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel15.setText("Index Number");
jLabel15.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField3ActionPerformed(evt);
}
});
jLabel16.setText("D.O.B");
jLabel16.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel17.setText("<NAME>");
jLabel17.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel18.setText("Occupation");
jLabel18.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Student", "Academic Staff", "Non-ac Staff" }));
jComboBox2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox2ActionPerformed(evt);
}
});
jLabel19.setText("Batch");
jLabel19.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel20.setText("Degree");
jLabel20.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jTextArea1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane1.setViewportView(jTextArea1);
jLabel21.setText("Description");
jLabel21.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel22.setText("Gender");
jLabel22.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox3.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Male", "Female" }));
jComboBox3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton2.setText("Save");
jButton2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jDateChooser1.setDateFormatString("yyyy-MM-dd");
jDateChooser1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(163, 163, 163)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel15)
.addComponent(jLabel12)
.addComponent(jLabel22)
.addComponent(jLabel16)
.addComponent(jLabel17, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel14)
.addComponent(jLabel18)
.addComponent(jLabel19)
.addComponent(jLabel20)
.addComponent(jLabel21))
.addGap(37, 37, 37)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField6, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField5, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jComboBox2, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField4, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jDateChooser1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBox3, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField3, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING)))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(402, 402, 402)
.addComponent(jButton2)))
.addContainerGap(464, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(42, 42, 42)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel12)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel14)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(23, 23, 23)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel15)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel22)
.addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel16))
.addGap(36, 36, 36)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel17)
.addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(47, 47, 47)
.addComponent(jLabel18))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(33, 33, 33)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel19))
.addGap(43, 43, 43)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel20))
.addGap(38, 38, 38)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel21))
.addGap(48, 48, 48)
.addComponent(jButton2)
.addContainerGap(154, Short.MAX_VALUE))
);
Cards_panel.add(jPanel3, "card4");
jPanel4.setBackground(java.awt.Color.gray);
jLabel31.setText("Date & Time");
jLabel31.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel32.setText("Index Number");
jLabel32.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel33.setText("Doctor");
jLabel33.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField11.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox6.setEditable(true);
jComboBox6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel34.setText("Condition");
jLabel34.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField12.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton4.setText("Add Appointment");
jButton4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
jDateChooser2.setDateFormatString("yyyy-MM-dd");
jDateChooser2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
timePicker1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton5.setText("Refresh");
jButton5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
}
});
jTable4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable4MouseClicked(evt);
}
});
jScrollPane10.setViewportView(jTable4);
jButton11.setText("Update");
jButton11.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton11ActionPerformed(evt);
}
});
jButton12.setText("Delete");
jButton12.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton12.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton12ActionPerformed(evt);
}
});
jTextField25.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jPanel8.setBackground(java.awt.Color.gray);
jPanel8.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jPanel8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel8MouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 36, Short.MAX_VALUE)
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 40, Short.MAX_VALUE)
);
jLabel60.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_search_24px.png"))); // NOI18N
jLabel60.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane10))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(192, 192, 192)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel31)
.addComponent(jLabel32)
.addComponent(jLabel33)
.addComponent(jLabel34))
.addGap(123, 123, 123)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(timePicker1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(122, 122, 122)
.addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(113, 113, 113)
.addComponent(jButton11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 170, Short.MAX_VALUE)
.addComponent(jButton12)
.addGap(243, 243, 243))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(55, 55, 55)
.addComponent(jLabel60)
.addGap(108, 108, 108)
.addComponent(jButton5)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(99, 99, 99)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel32)
.addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(52, 52, 52)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(timePicker1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel31)
.addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(37, 37, 37)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel33)
.addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(52, 52, 52)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel34)
.addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(49, 49, 49)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton4)
.addComponent(jButton12)
.addComponent(jButton11))
.addGap(32, 32, 32))
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(55, 55, 55)
.addComponent(jLabel60))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(55, 55, 55)
.addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(37, 37, 37))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton5)
.addGap(39, 39, 39)))
.addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(90, Short.MAX_VALUE))
);
Cards_panel.add(jPanel4, "card5");
jPanel5.setBackground(java.awt.Color.gray);
jLabel71.setText("Item Name");
jLabel71.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel72.setText("Price");
jLabel72.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel73.setText("Quantity");
jLabel73.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTable8.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTable8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable8MouseClicked(evt);
}
});
jScrollPane14.setViewportView(jTable8);
jButton18.setText("Add an Item");
jButton18.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton18.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton18ActionPerformed(evt);
}
});
jButton19.setText("Refresh");
jButton19.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton19.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton19ActionPerformed(evt);
}
});
jButton20.setText("Update");
jButton20.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton20.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton20ActionPerformed(evt);
}
});
jButton21.setText("Remove");
jButton21.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton21.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton21ActionPerformed(evt);
}
});
jLabel74.setText("Item Code");
jLabel74.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField32.setEditable(false);
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(331, 331, 331)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel71)
.addComponent(jLabel74)
.addComponent(jLabel72)
.addComponent(jLabel73)))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(164, 164, 164)
.addComponent(jButton18)
.addGap(79, 79, 79)
.addComponent(jButton19)))
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(7, 7, 7)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField29, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField32, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField30, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField31, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(92, 92, 92)
.addComponent(jButton20)
.addGap(105, 105, 105)
.addComponent(jButton21)))
.addGap(0, 209, Short.MAX_VALUE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane14)))
.addContainerGap())
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(103, 103, 103)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel74)
.addComponent(jTextField32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(31, 31, 31)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jLabel71)
.addComponent(jTextField29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(34, 34, 34)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel72)
.addComponent(jTextField30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(31, 31, 31)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel73)
.addComponent(jTextField31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(71, 71, 71)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton18)
.addComponent(jButton19)
.addComponent(jButton20)
.addComponent(jButton21))
.addGap(59, 59, 59)
.addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(259, Short.MAX_VALUE))
);
Cards_panel.add(jPanel5, "card6");
kGradientPanel1.setkEndColor(new java.awt.Color(219, 214, 92));
kGradientPanel1.setkStartColor(new java.awt.Color(86, 20, 176));
jLabel35.setText("Developed by 19.2 PLY SE 2nd yr Java Group 33");
jLabel35.setFont(new java.awt.Font("Microsoft JhengHei", 3, 18)); // NOI18N
jLabel36.setText("2020");
jLabel36.setFont(new java.awt.Font("Microsoft JhengHei", 3, 18)); // NOI18N
javax.swing.GroupLayout kGradientPanel1Layout = new javax.swing.GroupLayout(kGradientPanel1);
kGradientPanel1.setLayout(kGradientPanel1Layout);
kGradientPanel1Layout.setHorizontalGroup(
kGradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel1Layout.createSequentialGroup()
.addGroup(kGradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel1Layout.createSequentialGroup()
.addGap(216, 216, 216)
.addComponent(jLabel35))
.addGroup(kGradientPanel1Layout.createSequentialGroup()
.addGap(405, 405, 405)
.addComponent(jLabel36)))
.addContainerGap(396, Short.MAX_VALUE))
);
kGradientPanel1Layout.setVerticalGroup(
kGradientPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel1Layout.createSequentialGroup()
.addGap(181, 181, 181)
.addComponent(jLabel35)
.addGap(18, 18, 18)
.addComponent(jLabel36)
.addContainerGap(667, Short.MAX_VALUE))
);
Cards_panel.add(kGradientPanel1, "card7");
kGradientPanel2.setkEndColor(java.awt.Color.gray);
kGradientPanel2.setkStartColor(java.awt.Color.gray);
jTable1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable1MouseClicked(evt);
}
});
jScrollPane4.setViewportView(jTable1);
jButton3.setText("Refresh");
jButton3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
jTextArea5.setColumns(20);
jTextArea5.setRows(5);
jTextArea5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane8.setViewportView(jTextArea5);
jLabel49.setText("Description");
jLabel49.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea6.setColumns(20);
jTextArea6.setRows(5);
jTextArea6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane9.setViewportView(jTextArea6);
jLabel50.setText("Issued Medications");
jLabel50.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox9.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel51.setText("Diagnosed Doctor");
jLabel51.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox10.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Pending", "Treated and Released" }));
jComboBox10.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel52.setText("Disposition");
jLabel52.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField19.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel53.setText("Condition");
jLabel53.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField20.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel54.setText("Primary Diagnosis");
jLabel54.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel55.setText("Symptoms");
jLabel55.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField21.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField22.setEditable(false);
jTextField22.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField22.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField22ActionPerformed(evt);
}
});
jLabel56.setText("Index Number");
jLabel56.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel57.setText("Date");
jLabel57.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jDateChooser4.setDateFormatString("yyyy-MM-dd");
jDateChooser4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton9.setText("Update");
jButton9.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton9ActionPerformed(evt);
}
});
jButton10.setText("Delete");
jButton10.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton10ActionPerformed(evt);
}
});
jPanel9.setBackground(java.awt.Color.gray);
jPanel9.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
jPanel9.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jPanel9MouseClicked(evt);
}
});
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 36, Short.MAX_VALUE)
);
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 40, Short.MAX_VALUE)
);
jTextField26.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel61.setIcon(new javax.swing.ImageIcon(getClass().getResource("/nsbmhms2/pkg0/img/icons8_search_24px.png"))); // NOI18N
jLabel61.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
javax.swing.GroupLayout kGradientPanel2Layout = new javax.swing.GroupLayout(kGradientPanel2);
kGradientPanel2.setLayout(kGradientPanel2Layout);
kGradientPanel2Layout.setHorizontalGroup(
kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(jTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel61))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 989, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(30, Short.MAX_VALUE))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(175, 175, 175)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel54, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel56)
.addComponent(jLabel55)
.addComponent(jLabel53)
.addComponent(jLabel52)
.addComponent(jLabel49)
.addComponent(jLabel50))
.addComponent(jLabel51)
.addComponent(jLabel57))
.addGap(37, 37, 37)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBox9, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBox10, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField19)
.addComponent(jTextField20)
.addComponent(jTextField21)
.addComponent(jTextField22)
.addComponent(jScrollPane9)
.addComponent(jScrollPane8)
.addComponent(jDateChooser4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton3)
.addGap(152, 152, 152))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(83, 83, 83)
.addComponent(jButton9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton10)
.addGap(47, 47, 47))))
);
kGradientPanel2Layout.setVerticalGroup(
kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(40, 40, 40)
.addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(21, 21, 21)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel61)
.addComponent(jTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(63, 63, 63)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel56)
.addComponent(jTextField22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(174, 174, 174)
.addComponent(jButton3)))
.addGap(21, 21, 21)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel55)
.addComponent(jTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel54)
.addComponent(jTextField20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel53)
.addComponent(jTextField19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel52)
.addComponent(jComboBox10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel51)
.addComponent(jComboBox9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(29, 29, 29)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel50)
.addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(kGradientPanel2Layout.createSequentialGroup()
.addGap(64, 64, 64)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton9)
.addComponent(jButton10))))
.addGap(23, 23, 23)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel49))
.addGap(34, 34, 34)
.addGroup(kGradientPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel57)
.addComponent(jDateChooser4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(74, Short.MAX_VALUE))
);
Cards_panel.add(kGradientPanel2, "card8");
kGradientPanel3.setkEndColor(java.awt.Color.gray);
kGradientPanel3.setkStartColor(java.awt.Color.gray);
jTextField23.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton13.setText("Search");
jButton13.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton13ActionPerformed(evt);
}
});
jTable2.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
},
new String [] {
}
));
jTable2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane5.setViewportView(jTable2);
jTable5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane11.setViewportView(jTable5);
jTable6.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane12.setViewportView(jTable6);
jLabel65.setText("Profile");
jLabel65.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel66.setText("Medical Records");
jLabel66.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel67.setText("Appointments");
jLabel67.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
javax.swing.GroupLayout kGradientPanel3Layout = new javax.swing.GroupLayout(kGradientPanel3);
kGradientPanel3.setLayout(kGradientPanel3Layout);
kGradientPanel3Layout.setHorizontalGroup(
kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGroup(kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGap(63, 63, 63)
.addComponent(jLabel67))
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGap(58, 58, 58)
.addComponent(jLabel66))
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGap(58, 58, 58)
.addComponent(jLabel65)))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGroup(kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, kGradientPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 998, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, kGradientPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane12))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, kGradientPanel3Layout.createSequentialGroup()
.addGap(69, 69, 69)
.addComponent(jTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(50, 50, 50)
.addComponent(jButton13))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, kGradientPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane11)))
.addContainerGap(21, Short.MAX_VALUE))
);
kGradientPanel3Layout.setVerticalGroup(
kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel3Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addGroup(kGradientPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton13))
.addGap(23, 23, 23)
.addComponent(jLabel65)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(73, 73, 73)
.addComponent(jLabel66)
.addGap(26, 26, 26)
.addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(60, 60, 60)
.addComponent(jLabel67)
.addGap(28, 28, 28)
.addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(125, Short.MAX_VALUE))
);
Cards_panel.add(kGradientPanel3, "card9");
kGradientPanel4.setkEndColor(java.awt.Color.gray);
kGradientPanel4.setkStartColor(java.awt.Color.gray);
jButton14.setText("Add a Doctor");
jButton14.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton14.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton14ActionPerformed(evt);
}
});
jButton15.setText("Refresh");
jButton15.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton15ActionPerformed(evt);
}
});
jButton16.setText("Update");
jButton16.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton16.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton16ActionPerformed(evt);
}
});
jButton17.setText("Delete");
jButton17.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton17.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton17ActionPerformed(evt);
}
});
jTable7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jTable7MouseClicked(evt);
}
});
jScrollPane13.setViewportView(jTable7);
jLabel62.setText("Name");
jLabel62.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel70.setText("Telephone No.");
jLabel70.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField27.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField28.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
javax.swing.GroupLayout kGradientPanel4Layout = new javax.swing.GroupLayout(kGradientPanel4);
kGradientPanel4.setLayout(kGradientPanel4Layout);
kGradientPanel4Layout.setHorizontalGroup(
kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addGap(248, 248, 248)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel70)
.addComponent(jLabel62))
.addGap(77, 77, 77)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jTextField28, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField27, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane13)))
.addContainerGap())
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addGap(169, 169, 169)
.addComponent(jButton14)
.addGap(91, 91, 91)
.addComponent(jButton15)
.addGap(108, 108, 108)
.addComponent(jButton16)
.addGap(105, 105, 105)
.addComponent(jButton17)
.addContainerGap(190, Short.MAX_VALUE))
);
kGradientPanel4Layout.setVerticalGroup(
kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(kGradientPanel4Layout.createSequentialGroup()
.addGap(128, 128, 128)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel62)
.addComponent(jTextField27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(71, 71, 71)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jTextField28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel70))
.addGap(101, 101, 101)
.addGroup(kGradientPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton14)
.addComponent(jButton15)
.addComponent(jButton16)
.addComponent(jButton17))
.addGap(74, 74, 74)
.addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(204, Short.MAX_VALUE))
);
Cards_panel.add(kGradientPanel4, "card10");
jPanel1.setBackground(java.awt.Color.gray);
jLabel23.setText("Index Number");
jLabel23.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField7.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField7ActionPerformed(evt);
}
});
jLabel24.setText("Primary Diagnosis");
jLabel24.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField8.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel25.setText("Symptoms");
jLabel25.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField9.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel26.setText("Condition");
jLabel26.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextField10.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel27.setText("Disposition");
jLabel27.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox4.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Pending", "Treated and Released" }));
jComboBox4.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jLabel28.setText("Issued Medications");
jLabel28.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea2.setColumns(20);
jTextArea2.setRows(5);
jTextArea2.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane2.setViewportView(jTextArea2);
jLabel29.setText("Description");
jLabel29.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jTextArea3.setColumns(20);
jTextArea3.setRows(5);
jTextArea3.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jScrollPane3.setViewportView(jTextArea3);
jLabel30.setText("Diagnosed Doctor");
jLabel30.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jComboBox5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jButton1.setText("Add the Record");
jButton1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 18)); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel58.setText("Date");
jLabel58.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
jDateChooser5.setDateFormatString("yyyy-MM-dd");
jDateChooser5.setFont(new java.awt.Font("Microsoft JhengHei", 1, 14)); // NOI18N
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(74, 74, 74)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel23)
.addComponent(jLabel25)
.addComponent(jLabel26)
.addComponent(jLabel27)
.addComponent(jLabel29)
.addComponent(jLabel28))
.addComponent(jLabel30)
.addComponent(jLabel58))
.addGap(37, 37, 37)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jComboBox5, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBox4, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField10)
.addComponent(jTextField8)
.addComponent(jTextField9)
.addComponent(jTextField7)
.addComponent(jScrollPane2)
.addComponent(jScrollPane3)
.addComponent(jDateChooser5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(277, 277, 277)
.addComponent(jButton1)))
.addContainerGap(522, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(28, 28, 28)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel23)
.addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(21, 21, 21)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel25)
.addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel24)
.addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel26)
.addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel27)
.addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel30)
.addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel28)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(23, 23, 23)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel29))
.addGap(37, 37, 37)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel58)
.addComponent(jDateChooser5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(33, 33, 33)
.addComponent(jButton1)
.addContainerGap(255, Short.MAX_VALUE))
);
Cards_panel.add(jPanel1, "card2");
javax.swing.GroupLayout bgLayout = new javax.swing.GroupLayout(bg);
bg.setLayout(bgLayout);
bgLayout.setHorizontalGroup(
bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(bgLayout.createSequentialGroup()
.addComponent(sp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Cards_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
bgLayout.setVerticalGroup(
bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, bgLayout.createSequentialGroup()
.addGroup(bgLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(Cards_panel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addComponent(sp, javax.swing.GroupLayout.PREFERRED_SIZE, 916, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(bg, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(bg, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 916, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void btn_addrMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_addrMouseClicked
// Card Order and visibility upon click:
cardLayout.show(Cards_panel, "card2");
}//GEN-LAST:event_btn_addrMouseClicked
private void btn_pfMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_pfMouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card3");
}//GEN-LAST:event_btn_pfMouseClicked
private void btn_prMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_prMouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card4");
}//GEN-LAST:event_btn_prMouseClicked
private void btn_apMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_apMouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card5");
}//GEN-LAST:event_btn_apMouseClicked
private void btn_stocksMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_stocksMouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card6");
}//GEN-LAST:event_btn_stocksMouseClicked
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField1ActionPerformed
private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField3ActionPerformed
private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField7ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField7ActionPerformed
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into records (indexn, symptoms, pdiagnosis, conditions, disposition, doctor, imedications, des, ddate) VALUES (?,?,?,?,?,?,?,?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, Integer.parseInt(jTextField7.getText()));
pstmt.setString(2, jTextField9.getText());
pstmt.setString(3, jTextField8.getText());
pstmt.setString(4, jTextField10.getText());
pstmt.setString(5, jComboBox4.getSelectedItem().toString());
pstmt.setString(6, jComboBox5.getSelectedItem().toString());
pstmt.setString(7, jTextArea2.getText());
pstmt.setString(8, jTextArea3.getText());
pstmt.setString (9, ((JTextField) jDateChooser5.getDateEditor().getUiComponent()).getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Insertion Completed");
}
catch( SQLException e)
{
JOptionPane.showMessageDialog(null, "No Profile Found Under "+Integer.parseInt(jTextField7.getText())+" Index, Please Register First");
}
}//GEN-LAST:event_jButton1ActionPerformed
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
// TODO add your handling code here:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into profiles (fname, lname, indexn, gender, dob, gnumber, occu, batch, degree, des) VALUES (?,?,?,?,?,?,?,?,?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField1.getText());
pstmt.setString(2, jTextField2.getText());
pstmt.setInt(3, Integer.parseInt(jTextField3.getText()));
pstmt.setString(4, jComboBox3.getSelectedItem().toString());
pstmt.setString (5, ((JTextField) jDateChooser1.getDateEditor().getUiComponent()).getText());
pstmt.setInt(6, Integer.parseInt(jTextField4.getText()));
pstmt.setString(7, jComboBox2.getSelectedItem().toString());
if ( jTextField5 != null && !jTextField5.getText().isEmpty()) {
pstmt.setDouble(8, Double.parseDouble(jTextField5.getText()));
}
else {
pstmt.setNull(8, Types.DOUBLE);
}
if ( jTextField6 != null && !jTextField6.getText().isEmpty()) {
pstmt.setString(9, jTextField6.getText());
}
else {
pstmt.setNull(9, Types.VARCHAR);
}
pstmt.setString(10, jTextArea1.getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Insertion Completed");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton2ActionPerformed
private void jLabel11MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel11MouseClicked
// TODO add your handling code here:
cardLayout.show(Cards_panel, "card7");
}//GEN-LAST:event_jLabel11MouseClicked
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
// TODO add your handling code here:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into appointments (indexn, date, time, doctor, conditions) VALUES (?,?,?,?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setInt(1, Integer.parseInt(jTextField11.getText()));
pstmt.setString (2, ((JTextField) jDateChooser2.getDateEditor().getUiComponent()).getText());
//System.setProperty("user.timezone", "GMT");
pstmt.setString(3, timePicker1.getTimeStringOrEmptyString());
pstmt.setString(4, jComboBox6.getSelectedItem().toString());
pstmt.setString(5, jTextField12.getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Appointment Added");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, "No Profile Found Under "+Integer.parseInt(jTextField11.getText())+" Index, Please Register First");
}
}//GEN-LAST:event_jButton4ActionPerformed
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
// Shows up all appointments
try {
Connection conn = Db.openConnection();
String sql = ("select * from appointments");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable4.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable4.getColumnModel();
tcm.getColumn(0).setHeaderValue("ID");
tcm.getColumn(1).setHeaderValue("Index");
tcm.getColumn(2).setHeaderValue("Date");
tcm.getColumn(3).setHeaderValue("Time");
tcm.getColumn(4).setHeaderValue("Doctor");
tcm.getColumn(5).setHeaderValue("Conditions");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton5ActionPerformed
private void jTextField13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField13ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField13ActionPerformed
private void jTextField15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField15ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField15ActionPerformed
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
// Updating Profiles :
try {
Connection conn = Db.openConnection();
int row = jTable3.getSelectedRow();
String Table_click = (jTable3.getModel().getValueAt(row, 2).toString());
String sql = ("update profiles SET fname=?, lname=?, indexn=?, gender=?, dob=?, gnumber=?, occu=?, batch=?, degree=?, des=? where indexn = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField13.getText());
pstmt.setString(2, jTextField14.getText());
pstmt.setInt(3, Integer.parseInt(jTextField15.getText()));
pstmt.setString(4, jComboBox7.getSelectedItem().toString());
pstmt.setString (5, ((JTextField) jDateChooser3.getDateEditor().getUiComponent()).getText());
pstmt.setInt(6, Integer.parseInt(jTextField16.getText()));
pstmt.setString(7, jComboBox8.getSelectedItem().toString());
if ( jTextField17 != null && !jTextField17.getText().isEmpty()) {
pstmt.setDouble(8, Double.parseDouble(jTextField17.getText()));
}
else {
pstmt.setNull(8, Types.DOUBLE);
}
if ( jTextField18 != null && !jTextField18.getText().isEmpty()) {
pstmt.setString(9, jTextField18.getText());
}
else {
pstmt.setNull(9, Types.VARCHAR);
}
pstmt.setString(10, jTextArea4.getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Profile Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton6ActionPerformed
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
// Delete Profiles :
try {
Connection conn = Db.openConnection();
int row = jTable3.getSelectedRow();
String Table_click = (jTable3.getModel().getValueAt(row, 2).toString());
String sql = ("delete from profiles where indexn = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Profile Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton7ActionPerformed
private void jTable3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable3MouseClicked
try {
Connection conn = Db.openConnection();
int row = jTable3.getSelectedRow();
String Table_click = (jTable3.getModel().getValueAt(row, 2).toString());
String sql = "select * from profiles where indexn = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String fname = rs.getString("fname");
jTextField13.setText(fname);
String lname = rs.getString("lname");
jTextField14.setText(lname);
String indexn = String.valueOf(rs.getInt("indexn"));
jTextField15.setText(indexn);
String gender = rs.getString("gender");
jComboBox7.setSelectedItem(gender);
String dob = String.valueOf(rs.getDate("dob"));
java.util.Date date = new SimpleDateFormat("yyyy-MM-dd").parse(dob);
jDateChooser3.setDate(date);
String gnum = String.valueOf(rs.getInt("gnumber"));
jTextField16.setText(gnum);
String occu = rs.getString("occu");
jComboBox8.setSelectedItem(occu);
String batch = String.valueOf(rs.getDouble("batch"));
jTextField17.setText(batch);
String degree = rs.getString("degree");
jTextField18.setText(degree);
String des = rs.getString("des");
jTextArea4.setText(des);
}
}catch( SQLException | ParseException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable3MouseClicked
private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
try {
Connection conn = Db.openConnection();
String sql = ("select * from profiles");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable3.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable3.getColumnModel();
tcm.getColumn(0).setHeaderValue("First Name");
tcm.getColumn(1).setHeaderValue("Last Name");
tcm.getColumn(2).setHeaderValue("Index");
tcm.getColumn(3).setHeaderValue("Gender");
tcm.getColumn(4).setHeaderValue("DOB");
tcm.getColumn(5).setHeaderValue("Guardians Number");
tcm.getColumn(6).setHeaderValue("Occupation");
tcm.getColumn(7).setHeaderValue("Batch");
tcm.getColumn(8).setHeaderValue("Degree");
tcm.getColumn(9).setHeaderValue("Description");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton8ActionPerformed
private void btn_records1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_records1MouseClicked
cardLayout.show(Cards_panel, "card8");
}//GEN-LAST:event_btn_records1MouseClicked
private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox2ActionPerformed
boolean enabled = jComboBox2.getSelectedItem().equals("Student");
jTextField5.setEnabled(enabled);
jLabel19.setEnabled(enabled);
jTextField6.setEnabled(enabled);
jLabel20.setEnabled(enabled);
}//GEN-LAST:event_jComboBox2ActionPerformed
private void jComboBox8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox8ActionPerformed
boolean enabled = jComboBox8.getSelectedItem().equals("Student");
jTextField17.setEnabled(enabled);
jLabel39.setEnabled(enabled);
jTextField18.setEnabled(enabled);
jLabel38.setEnabled(enabled);
}//GEN-LAST:event_jComboBox8ActionPerformed
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
// shows all the records that r made :
try {
Connection conn = Db.openConnection();
String sql = ("select * from records");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable1.getColumnModel();
tcm.getColumn(0).setHeaderValue("ID");
tcm.getColumn(1).setHeaderValue("Index");
tcm.getColumn(2).setHeaderValue("Symptoms");
tcm.getColumn(3).setHeaderValue("Primary Diagnosis");
tcm.getColumn(4).setHeaderValue("Conditions");
tcm.getColumn(5).setHeaderValue("Disposition");
tcm.getColumn(6).setHeaderValue("Medications");
tcm.getColumn(7).setHeaderValue("Description");
tcm.getColumn(8).setHeaderValue("Diagnosed Date");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton3ActionPerformed
private void jTextField22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField22ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField22ActionPerformed
private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked
// allow to select a single record and do crud
try {
Connection conn = Db.openConnection();
int row = jTable1.getSelectedRow();
String Table_click = (jTable1.getModel().getValueAt(row, 1).toString());
String sql = "select * from records where indexn = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String indexn = String.valueOf(rs.getInt("indexn"));
jTextField22.setText(indexn);
String symptoms = rs.getString("symptoms");
jTextField21.setText(symptoms);
String diagnosis = rs.getString("pdiagnosis");
jTextField20.setText(diagnosis);
String conditions = rs.getString("conditions");
jTextField19.setText(conditions);
String disposition = rs.getString("disposition");
jComboBox10.setSelectedItem(disposition);
String doctor = rs.getString("doctor");
jComboBox9.setSelectedItem(doctor);
String imed = rs.getString("imedications");
jTextArea6.setText(imed);
String des = rs.getString("des");
jTextArea5.setText(des);
String ddate = String.valueOf(rs.getDate("ddate"));
java.util.Date date = new SimpleDateFormat("yyyy-MM-dd").parse(ddate);
jDateChooser4.setDate(date);
}
}catch( SQLException | ParseException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable1MouseClicked
private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
// Update records:
try {
Connection conn = Db.openConnection();
int row = jTable1.getSelectedRow();
String Table_click = (jTable1.getModel().getValueAt(row, 0).toString());
String sql = ("update records set symptoms=?, pdiagnosis=?, conditions=?, disposition=?, doctor=?, imedications=?, des=?, ddate=? where id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField21.getText());
pstmt.setString(2, jTextField20.getText());
pstmt.setString(3, jTextField19.getText());
pstmt.setString(4, jComboBox10.getSelectedItem().toString());
pstmt.setString(5, jComboBox9.getSelectedItem().toString());
pstmt.setString(6, jTextArea6.getText());
pstmt.setString(7, jTextArea5.getText());
pstmt.setString (8, ((JTextField) jDateChooser4.getDateEditor().getUiComponent()).getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Record Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton9ActionPerformed
private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
// Delete Records:
try {
Connection conn = Db.openConnection();
int row = jTable1.getSelectedRow();
String Table_click = (jTable1.getModel().getValueAt(row, 0).toString());
String sql = ("delete from records where id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Record Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton10ActionPerformed
private void jTable4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable4MouseClicked
// select a single appointment
try {
Connection conn = Db.openConnection();
int row = jTable4.getSelectedRow();
String Table_click = (jTable4.getModel().getValueAt(row, 0).toString());
String sql = "select * from appointments where id = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String indexn = String.valueOf(rs.getInt("indexn"));
jTextField11.setText(indexn);
jTextField11.setEditable(false);
String adate = String.valueOf(rs.getDate("date"));
java.util.Date date = new SimpleDateFormat("yyyy-MM-dd").parse(adate);
jDateChooser2.setDate(date);
String atime = String.valueOf(rs.getTime("time"));
timePicker1.setText(atime);
// String atime = String.valueOf(rs.getTime("time"));
// SimpleDateFormat sdf = new SimpleDateFormat("hh:mm a",Locale.US);
// String stime = sdf.format(atime);
// timePicker1.setText(stime);
String disposition = rs.getString("doctor");
jComboBox6.setSelectedItem(disposition);
String symptoms = rs.getString("conditions");
jTextField12.setText(symptoms);
}
}catch( SQLException | ParseException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable4MouseClicked
private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
// Update Appointments:
try {
Connection conn = Db.openConnection();
int row = jTable4.getSelectedRow();
String Table_click = (jTable4.getModel().getValueAt(row, 0).toString());
String sql = ("update appointments SET date=?, time=?, doctor=?, conditions=? where id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString (1, ((JTextField) jDateChooser2.getDateEditor().getUiComponent()).getText());
pstmt.setString (2, timePicker1.getTimeStringOrEmptyString());
pstmt.setString(3, jComboBox6.getSelectedItem().toString());
pstmt.setString(4, jTextField12.getText());
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Appointment Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton11ActionPerformed
private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
// Delete Appointments:
try {
Connection conn = Db.openConnection();
int row = jTable4.getSelectedRow();
String Table_click = (jTable4.getModel().getValueAt(row, 0).toString());
String sql = ("delete from appointments where id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Appointment Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton12ActionPerformed
private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
// Filter:
try {
Connection conn = Db.openConnection();
int index_nu = Integer.parseInt(jTextField23.getText());
String sql = ("select * from profiles where indexn='"+index_nu+"' ");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable2.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable2.getColumnModel();
tcm.getColumn(0).setHeaderValue("First Name");
tcm.getColumn(1).setHeaderValue("Last Name");
tcm.getColumn(2).setHeaderValue("Index");
tcm.getColumn(3).setHeaderValue("Gender");
tcm.getColumn(4).setHeaderValue("DOB");
tcm.getColumn(5).setHeaderValue("Guardians Number");
tcm.getColumn(6).setHeaderValue("Occupation");
tcm.getColumn(7).setHeaderValue("Batch");
tcm.getColumn(8).setHeaderValue("Degree");
tcm.getColumn(9).setHeaderValue("Description");
String sql2 = ("select * from records where indexn='"+index_nu+"' ");
PreparedStatement pstmt2 = conn.prepareStatement(sql2);
ResultSet rs2 = pstmt2.executeQuery();
jTable5.setModel(DbUtils.resultSetToTableModel(rs2));
TableColumnModel tcm2 = jTable5.getColumnModel();
tcm2.getColumn(0).setHeaderValue("ID");
tcm2.getColumn(1).setHeaderValue("Index");
tcm2.getColumn(2).setHeaderValue("Symptoms");
tcm2.getColumn(3).setHeaderValue("Primary Diagnosis");
tcm2.getColumn(4).setHeaderValue("Conditions");
tcm2.getColumn(5).setHeaderValue("Disposition");
tcm2.getColumn(6).setHeaderValue("Medications");
tcm2.getColumn(7).setHeaderValue("Description");
tcm2.getColumn(8).setHeaderValue("Diagnosed Date");
String sql3 = ("select * from appointments where indexn='"+index_nu+"' ");
PreparedStatement pstmt3 = conn.prepareStatement(sql3);
ResultSet rs3 = pstmt3.executeQuery();
jTable6.setModel(DbUtils.resultSetToTableModel(rs3));
TableColumnModel tcm3 = jTable6.getColumnModel();
tcm3.getColumn(0).setHeaderValue("ID");
tcm3.getColumn(1).setHeaderValue("Index");
tcm3.getColumn(2).setHeaderValue("Date");
tcm3.getColumn(3).setHeaderValue("Time");
tcm3.getColumn(4).setHeaderValue("Doctor");
tcm3.getColumn(5).setHeaderValue("Conditions");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton13ActionPerformed
private void btn_records4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_records4MouseClicked
cardLayout.show(Cards_panel, "card9");
}//GEN-LAST:event_btn_records4MouseClicked
private void jPanel7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel7MouseClicked
// Filter:
try {
Connection conn = Db.openConnection();
int index_nu = Integer.parseInt(jTextField24.getText());
String sql = ("select * from profiles where indexn='"+index_nu+"' ");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable3.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable3.getColumnModel();
tcm.getColumn(0).setHeaderValue("First Name");
tcm.getColumn(1).setHeaderValue("Last Name");
tcm.getColumn(2).setHeaderValue("Index");
tcm.getColumn(3).setHeaderValue("Gender");
tcm.getColumn(4).setHeaderValue("DOB");
tcm.getColumn(5).setHeaderValue("Guardians Number");
tcm.getColumn(6).setHeaderValue("Occupation");
tcm.getColumn(7).setHeaderValue("Batch");
tcm.getColumn(8).setHeaderValue("Degree");
tcm.getColumn(9).setHeaderValue("Description");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jPanel7MouseClicked
private void jPanel8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel8MouseClicked
// TODO add your handling code here:
// Filter:
try {
Connection conn = Db.openConnection();
int index_nu = Integer.parseInt(jTextField25.getText());
String sql = ("select * from appointments where indexn='"+index_nu+"' ");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable4.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable4.getColumnModel();
tcm.getColumn(0).setHeaderValue("ID");
tcm.getColumn(1).setHeaderValue("Index");
tcm.getColumn(2).setHeaderValue("Date");
tcm.getColumn(3).setHeaderValue("Time");
tcm.getColumn(4).setHeaderValue("Doctor");
tcm.getColumn(5).setHeaderValue("Conditions");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jPanel8MouseClicked
private void jPanel9MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel9MouseClicked
try {
Connection conn = Db.openConnection();
int index_nu = Integer.parseInt(jTextField26.getText());
String sql = ("select * from records where indexn='"+index_nu+"' ");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable1.getColumnModel();
tcm.getColumn(0).setHeaderValue("ID");
tcm.getColumn(1).setHeaderValue("Index");
tcm.getColumn(2).setHeaderValue("Symptoms");
tcm.getColumn(3).setHeaderValue("Primary Diagnosis");
tcm.getColumn(4).setHeaderValue("Conditions");
tcm.getColumn(5).setHeaderValue("Disposition");
tcm.getColumn(6).setHeaderValue("Medications");
tcm.getColumn(7).setHeaderValue("Description");
tcm.getColumn(8).setHeaderValue("Diagnosed Date");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jPanel9MouseClicked
private void btn_records5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_records5MouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_btn_records5MouseClicked
private void btn_records5MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_records5MouseReleased
cardLayout.show(Cards_panel, "card10");
}//GEN-LAST:event_btn_records5MouseReleased
private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
// Adding a doctor:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into doctor (name, Tel_no) VALUES (?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField27.getText());
pstmt.setInt(2, Integer.parseInt(jTextField28.getText()));
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Doctor Added");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton14ActionPerformed
private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
// listing doctors:
try {
Connection conn = Db.openConnection();
String sql = ("select * from doctor");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable7.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable7.getColumnModel();
tcm.getColumn(0).setHeaderValue("Doctor ID");
tcm.getColumn(1).setHeaderValue("Name");
tcm.getColumn(2).setHeaderValue("Tel. No");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton15ActionPerformed
private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton16ActionPerformed
// Updating Doctors:
try {
Connection conn = Db.openConnection();
int row = jTable7.getSelectedRow();
String Table_click = (jTable7.getModel().getValueAt(row, 0).toString());
String sql = ("update doctor SET name=?, Tel_no=? where D_id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField27.getText());
pstmt.setInt(2, Integer.parseInt(jTextField28.getText()));
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Doctor Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton16ActionPerformed
private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed
// removing doctors:
try {
Connection conn = Db.openConnection();
int row = jTable7.getSelectedRow();
String Table_click = (jTable7.getModel().getValueAt(row, 0).toString());
String sql = ("delete from doctor where D_id = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Doctor Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton17ActionPerformed
private void jTable7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable7MouseClicked
// selecting a doctor to do CRUD:
try {
Connection conn = Db.openConnection();
int row = jTable7.getSelectedRow();
String Table_click = (jTable7.getModel().getValueAt(row, 0).toString());
String sql = "select * from doctor where D_id = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String doc_id = rs.getString("name");
jTextField27.setText(doc_id);
String tel = String.valueOf(rs.getInt("Tel_no"));
jTextField28.setText(tel);
}
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable7MouseClicked
private void jTable8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable8MouseClicked
// Stock Item Selector:
try {
Connection conn = Db.openConnection();
int row = jTable8.getSelectedRow();
String Table_click = (jTable8.getModel().getValueAt(row, 0).toString());
String sql = "select * from stock where ItemCode = '"+Table_click+"' ";
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery(sql);
if(rs.next()){
String item_code = String.valueOf(rs.getInt("ItemCode"));
jTextField32.setText(item_code);
jTextField32.setEditable(false);
String item_name = rs.getString("Name");
jTextField29.setText(item_name);
String item_price = String.valueOf(rs.getDouble("Price"));
jTextField30.setText(item_price);
String item_quantity = String.valueOf(rs.getInt("quantity"));
jTextField31.setText(item_quantity);
}
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jTable8MouseClicked
private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
// Adding Stocks:
try {
Connection conn = Db.openConnection();
String sql = ("INSERT into stock (Name, Price, quantity) VALUES (?,?,?)");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField29.getText());
pstmt.setDouble(2, Double.parseDouble(jTextField30.getText()));
pstmt.setInt(3, Integer.parseInt(jTextField31.getText()));
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Item Added");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton18ActionPerformed
private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton19ActionPerformed
// Refreshing the list:
try {
Connection conn = Db.openConnection();
String sql = ("select * from stock");
PreparedStatement pstmt = conn.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
jTable8.setModel(DbUtils.resultSetToTableModel(rs));
TableColumnModel tcm = jTable8.getColumnModel();
tcm.getColumn(0).setHeaderValue("Item Code");
tcm.getColumn(1).setHeaderValue("Name");
tcm.getColumn(2).setHeaderValue("Price");
tcm.getColumn(3).setHeaderValue("Quantity");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton19ActionPerformed
private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton20ActionPerformed
// Updating Stock:
try {
Connection conn = Db.openConnection();
int row = jTable8.getSelectedRow();
String Table_click = (jTable8.getModel().getValueAt(row, 0).toString());
String sql = ("update stock SET Name=?, Price=?, quantity=? where ItemCode = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, jTextField29.getText());
pstmt.setDouble(2, Double.parseDouble(jTextField30.getText()));
pstmt.setInt(3, Integer.parseInt(jTextField31.getText()));
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Item Updated");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton20ActionPerformed
private void jButton21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton21ActionPerformed
// Removing Stock:
try {
Connection conn = Db.openConnection();
int row = jTable8.getSelectedRow();
String Table_click = (jTable8.getModel().getValueAt(row, 0).toString());
String sql = ("delete from stock where ItemCode = '"+Table_click+"'");
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.executeUpdate();
JOptionPane.showMessageDialog(null, "Item Deleted");
}catch( SQLException e)
{
JOptionPane.showMessageDialog(null, e);
}
}//GEN-LAST:event_jButton21ActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Menu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Menu().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JPanel Cards_panel;
private javax.swing.JPanel bg;
private javax.swing.JPanel btn_addr;
private javax.swing.JPanel btn_ap;
private javax.swing.JPanel btn_pf;
private javax.swing.JPanel btn_pr;
private javax.swing.JPanel btn_records1;
private javax.swing.JPanel btn_records4;
private javax.swing.JPanel btn_records5;
private javax.swing.JPanel btn_stocks;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton10;
private javax.swing.JButton jButton11;
private javax.swing.JButton jButton12;
private javax.swing.JButton jButton13;
private javax.swing.JButton jButton14;
private javax.swing.JButton jButton15;
private javax.swing.JButton jButton16;
private javax.swing.JButton jButton17;
private javax.swing.JButton jButton18;
private javax.swing.JButton jButton19;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton20;
private javax.swing.JButton jButton21;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JButton jButton6;
private javax.swing.JButton jButton7;
private javax.swing.JButton jButton8;
private javax.swing.JButton jButton9;
private javax.swing.JComboBox<String> jComboBox10;
private javax.swing.JComboBox<String> jComboBox2;
private javax.swing.JComboBox<String> jComboBox3;
private javax.swing.JComboBox<String> jComboBox4;
private javax.swing.JComboBox<String> jComboBox5;
private javax.swing.JComboBox<String> jComboBox6;
private javax.swing.JComboBox<String> jComboBox7;
private javax.swing.JComboBox<String> jComboBox8;
private javax.swing.JComboBox<String> jComboBox9;
private com.toedter.calendar.JDateChooser jDateChooser1;
private com.toedter.calendar.JDateChooser jDateChooser2;
private com.toedter.calendar.JDateChooser jDateChooser3;
private com.toedter.calendar.JDateChooser jDateChooser4;
private com.toedter.calendar.JDateChooser jDateChooser5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel27;
private javax.swing.JLabel jLabel28;
private javax.swing.JLabel jLabel29;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel30;
private javax.swing.JLabel jLabel31;
private javax.swing.JLabel jLabel32;
private javax.swing.JLabel jLabel33;
private javax.swing.JLabel jLabel34;
private javax.swing.JLabel jLabel35;
private javax.swing.JLabel jLabel36;
private javax.swing.JLabel jLabel37;
private javax.swing.JLabel jLabel38;
private javax.swing.JLabel jLabel39;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel40;
private javax.swing.JLabel jLabel41;
private javax.swing.JLabel jLabel42;
private javax.swing.JLabel jLabel43;
private javax.swing.JLabel jLabel44;
private javax.swing.JLabel jLabel45;
private javax.swing.JLabel jLabel46;
private javax.swing.JLabel jLabel47;
private javax.swing.JLabel jLabel48;
private javax.swing.JLabel jLabel49;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel50;
private javax.swing.JLabel jLabel51;
private javax.swing.JLabel jLabel52;
private javax.swing.JLabel jLabel53;
private javax.swing.JLabel jLabel54;
private javax.swing.JLabel jLabel55;
private javax.swing.JLabel jLabel56;
private javax.swing.JLabel jLabel57;
private javax.swing.JLabel jLabel58;
private javax.swing.JLabel jLabel59;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel60;
private javax.swing.JLabel jLabel61;
private javax.swing.JLabel jLabel62;
private javax.swing.JLabel jLabel63;
private javax.swing.JLabel jLabel64;
private javax.swing.JLabel jLabel65;
private javax.swing.JLabel jLabel66;
private javax.swing.JLabel jLabel67;
private javax.swing.JLabel jLabel68;
private javax.swing.JLabel jLabel69;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel70;
private javax.swing.JLabel jLabel71;
private javax.swing.JLabel jLabel72;
private javax.swing.JLabel jLabel73;
private javax.swing.JLabel jLabel74;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane10;
private javax.swing.JScrollPane jScrollPane11;
private javax.swing.JScrollPane jScrollPane12;
private javax.swing.JScrollPane jScrollPane13;
private javax.swing.JScrollPane jScrollPane14;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JScrollPane jScrollPane5;
private javax.swing.JScrollPane jScrollPane6;
private javax.swing.JScrollPane jScrollPane7;
private javax.swing.JScrollPane jScrollPane8;
private javax.swing.JScrollPane jScrollPane9;
private javax.swing.JTable jTable1;
private javax.swing.JTable jTable2;
private javax.swing.JTable jTable3;
private javax.swing.JTable jTable4;
private javax.swing.JTable jTable5;
private javax.swing.JTable jTable6;
private javax.swing.JTable jTable7;
private javax.swing.JTable jTable8;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTextArea jTextArea2;
private javax.swing.JTextArea jTextArea3;
private javax.swing.JTextArea jTextArea4;
private javax.swing.JTextArea jTextArea5;
private javax.swing.JTextArea jTextArea6;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField10;
private javax.swing.JTextField jTextField11;
private javax.swing.JTextField jTextField12;
private javax.swing.JTextField jTextField13;
private javax.swing.JTextField jTextField14;
private javax.swing.JTextField jTextField15;
private javax.swing.JTextField jTextField16;
private javax.swing.JTextField jTextField17;
private javax.swing.JTextField jTextField18;
private javax.swing.JTextField jTextField19;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField20;
private javax.swing.JTextField jTextField21;
private javax.swing.JTextField jTextField22;
private javax.swing.JTextField jTextField23;
private javax.swing.JTextField jTextField24;
private javax.swing.JTextField jTextField25;
private javax.swing.JTextField jTextField26;
private javax.swing.JTextField jTextField27;
private javax.swing.JTextField jTextField28;
private javax.swing.JTextField jTextField29;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField30;
private javax.swing.JTextField jTextField31;
private javax.swing.JTextField jTextField32;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField6;
private javax.swing.JTextField jTextField7;
private javax.swing.JTextField jTextField8;
private javax.swing.JTextField jTextField9;
private keeptoo.KGradientPanel kGradientPanel1;
private keeptoo.KGradientPanel kGradientPanel2;
private keeptoo.KGradientPanel kGradientPanel3;
private keeptoo.KGradientPanel kGradientPanel4;
private javax.swing.JPanel sp;
private com.github.lgooddatepicker.components.TimePicker timePicker1;
// End of variables declaration//GEN-END:variables
}
| 169,242 | 0.625045 | 0.596864 | 3,372 | 49.196621 | 36.871723 | 192 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.817912 | false | false | 9 |
1ba83880f2d132152da8690250551fc36dbc6491 | 25,555,055,473,810 | a7c04b6964c1973693a996a417c881fabe7d0fa9 | /Server/FoodBack/src/main/java/com/lpro/fbrest/resources/EstablishmentsResource.java | 7d4ab24369c528ee09cf51ec37fdc952ba7e6972 | [] | no_license | danielgranhao/FoodBack | https://github.com/danielgranhao/FoodBack | 768534d3d954aa0cf5095f934b4a6e624df0cf7f | 783e7f445e1ab632ef602033952b64b0478ce2d1 | refs/heads/master | 2021-03-24T10:13:35.816000 | 2018-01-21T22:58:47 | 2018-01-21T22:58:47 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.lpro.fbrest.resources;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.lpro.fbrest.api.Establishment;
import com.lpro.fbrest.auth.Client;
import com.lpro.fbrest.service.EstablishmentService;
import io.dropwizard.auth.Auth;
/**
* @author Beatriz
*
*/
@Path("/establishments")
public class EstablishmentsResource {
/**
* Service for the class Establishment
*/
private EstablishmentService establishmentService;
/**
* @param establishmentService Service for the class Establishment
*/
public EstablishmentsResource(EstablishmentService establishmentService) {
this.establishmentService = establishmentService;
}
/**
* @param establishment new establishment to be inserted in the database
* @return Response object with http status
*/
@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response newEstablishment(@NotNull @Valid Establishment establishment) {
establishmentService.newEstablishment(establishment);
return Response.ok().build();
}
/**
* @return All establishments
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
public List<Establishment> getAllEstablishments() {
return establishmentService.getAllEstablishments();
}
/**
* @param name of the wanted establishment
* @return Establishment with the name specified
*/
@GET
@Path("/{name}") //MUDAR O PARAM NAME PARA UMA QUERY (por causa dos espaços)
@Produces(MediaType.APPLICATION_JSON)
public Establishment getEstablishment(@PathParam("name") String name) {
return establishmentService.getEstablishmentByName(name);
}
/**
* @param client Client that owns the establishment to be edited
* @param newestablishment The establishment the be edited
* @return Response object with http status
*/
@PUT
@RolesAllowed("ESTABLISHMENT" )
@Consumes(MediaType.APPLICATION_JSON)
public Response changeEstablishment(@Auth Client client, @NotNull Establishment newestablishment) {
establishmentService.editEstablishment(client.getEstablishment_id(), newestablishment);
return Response.ok().build();
}
}
| UTF-8 | Java | 2,501 | java | EstablishmentsResource.java | Java | [
{
"context": "mport io.dropwizard.auth.Auth;\n\n\n\n\t/**\n\t * @author Beatriz \n\t *\n\t */\n\t@Path(\"/establishments\")\n\tpublic class",
"end": 630,
"score": 0.9995707869529724,
"start": 623,
"tag": "NAME",
"value": "Beatriz"
}
] | null | [] | package com.lpro.fbrest.resources;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import com.lpro.fbrest.api.Establishment;
import com.lpro.fbrest.auth.Client;
import com.lpro.fbrest.service.EstablishmentService;
import io.dropwizard.auth.Auth;
/**
* @author Beatriz
*
*/
@Path("/establishments")
public class EstablishmentsResource {
/**
* Service for the class Establishment
*/
private EstablishmentService establishmentService;
/**
* @param establishmentService Service for the class Establishment
*/
public EstablishmentsResource(EstablishmentService establishmentService) {
this.establishmentService = establishmentService;
}
/**
* @param establishment new establishment to be inserted in the database
* @return Response object with http status
*/
@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response newEstablishment(@NotNull @Valid Establishment establishment) {
establishmentService.newEstablishment(establishment);
return Response.ok().build();
}
/**
* @return All establishments
*/
@GET
@Produces(MediaType.APPLICATION_JSON)
public List<Establishment> getAllEstablishments() {
return establishmentService.getAllEstablishments();
}
/**
* @param name of the wanted establishment
* @return Establishment with the name specified
*/
@GET
@Path("/{name}") //MUDAR O PARAM NAME PARA UMA QUERY (por causa dos espaços)
@Produces(MediaType.APPLICATION_JSON)
public Establishment getEstablishment(@PathParam("name") String name) {
return establishmentService.getEstablishmentByName(name);
}
/**
* @param client Client that owns the establishment to be edited
* @param newestablishment The establishment the be edited
* @return Response object with http status
*/
@PUT
@RolesAllowed("ESTABLISHMENT" )
@Consumes(MediaType.APPLICATION_JSON)
public Response changeEstablishment(@Auth Client client, @NotNull Establishment newestablishment) {
establishmentService.editEstablishment(client.getEstablishment_id(), newestablishment);
return Response.ok().build();
}
}
| 2,501 | 0.7432 | 0.7432 | 94 | 25.595745 | 25.391119 | 101 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.755319 | false | false | 9 |
7d43546abcd8bfde1b1de07bdf419f12c5ddf57c | 29,652,454,267,037 | cb0256850f2279e5e08fcfd7ae8477eeef2630b7 | /src/main/java/com/fallenjusticestudios/bardwalk/Exception/DocumentSaveException.java | 292fb881d43cbdfdba137265014352f61aa4464e | [] | no_license | richterk/Bardwalk | https://github.com/richterk/Bardwalk | 53a65e323914f0ff7c173de1232115dc393c910c | 86bd474974f9578c878fc2a68b0db30225549e45 | refs/heads/master | 2018-12-27T00:33:49.346000 | 2012-07-11T18:33:54 | 2012-07-11T18:33:54 | 3,498,132 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.fallenjusticestudios.bardwalk.Exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value=HttpStatus.METHOD_FAILURE,reason="Failed to save the Document.")
public class DocumentSaveException extends Exception {
/**
*
*/
private static final long serialVersionUID = 602544422927679741L;
public DocumentSaveException(String msg) {
super(msg);
}
}
| UTF-8 | Java | 465 | java | DocumentSaveException.java | Java | [] | null | [] | package com.fallenjusticestudios.bardwalk.Exception;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value=HttpStatus.METHOD_FAILURE,reason="Failed to save the Document.")
public class DocumentSaveException extends Exception {
/**
*
*/
private static final long serialVersionUID = 602544422927679741L;
public DocumentSaveException(String msg) {
super(msg);
}
}
| 465 | 0.774194 | 0.735484 | 18 | 24.833334 | 28.398455 | 86 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.611111 | false | false | 9 |
b18abca960ccc8d7972b63b39e9f9331bfc387f2 | 13,511,967,173,543 | 571e8156903e21999325b47d7fd43f444ed004f5 | /Project/GUI/src/com/horvat/gui/dialogs/receptionist/ReceptionistMenuDialog.java | 78195f801819af7454c88c12ae44948fce919a35 | [] | no_license | jhalgebra/OutpatientManagement | https://github.com/jhalgebra/OutpatientManagement | 6c8984c4a8f48df0207bbf2482320e623172c395 | cbffb9b1bc474a286d72b22bd866fa5e0b22049b | refs/heads/master | 2020-03-18T17:42:06.431000 | 2018-06-14T10:28:58 | 2018-06-14T10:28:58 | 135,045,344 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.horvat.gui.dialogs.receptionist;
import com.horvat.bll.viewmodels.FillAppointmentViewModel;
import com.horvat.bll.viewmodels.receptionist.InsertPatientViewModel;
import com.horvat.bll.viewmodels.receptionist.IssueBillViewModel;
import com.horvat.bll.viewmodels.receptionist.ReceptionistMenuViewModel;
import com.horvat.dl.entities.Appointment;
import com.horvat.dl.entities.Bill;
import com.horvat.dl.entities.Doctor;
import com.horvat.dl.entities.Patient;
import com.horvat.gui.app.Utils;
import com.horvat.gui.dialogs.FillAppointmentDialog;
import com.horvat.gui.dialogs.base.VMDialog;
import com.horvat.gui.dialogs.option.ChooseDoctorDialog;
import com.horvat.gui.dialogs.option.ChoosePatientDialog;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ReceptionistMenuDialog extends VMDialog<ReceptionistMenuViewModel> {
private JPanel contentPane;
private JButton btnInsertPatient;
private JButton btnMakeAppointment;
private JButton btnIssueBill;
private JCheckBox cbBasicRegistration;
public ReceptionistMenuDialog(Window owner, String title, int width, int height, ReceptionistMenuViewModel viewModel) {
super(owner, title, width, height, viewModel);
setContentPane(contentPane);
initListeners();
}
private void initListeners() {
// call onCancel() when cross is clicked
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
onCancel();
}
});
// call onCancel() on ESCAPE
contentPane.registerKeyboardAction(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onCancel();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
btnInsertPatient.addActionListener(e -> {
boolean basic = cbBasicRegistration.isSelected();
InsertPatientDialog insertPatientDialog = new InsertPatientDialog(
this, (basic ? "Basic" : "Full") + " registration",
900, 500, new InsertPatientViewModel(basic)
);
Patient patient = insertPatientDialog.showDialog();
if (patient != null)
viewModel.getPatients().add(patient);
});
btnMakeAppointment.addActionListener(e -> {
ChooseDoctorDialog chooseDoctorDialog = new ChooseDoctorDialog(
this, "Choose doctor", viewModel.getDoctors()
);
Doctor doctor = chooseDoctorDialog.showDialog();
if (doctor != null) {
Patient patient = selectPatient();
if (patient != null) {
FillAppointmentDialog fillAppointmentDialog = new FillAppointmentDialog(
this, "Make an appointment", 400, 400,
new FillAppointmentViewModel(doctor, patient)
);
Appointment appointment = fillAppointmentDialog.showDialog();
if (appointment != null)
patient.getAppointments().add(appointment);
}
}
});
btnIssueBill.addActionListener(e -> {
Patient patient = selectPatient();
if (patient != null) {
IssueBillDialog issueBillDialog = new IssueBillDialog(
this, "Issue bill to " + patient.getBasicDetails().getName(),
400, 200, new IssueBillViewModel(patient)
);
Bill bill = issueBillDialog.showDialog();
if (bill != null)
patient.getBills().add(bill);
}
});
}
private Patient selectPatient() {
ChoosePatientDialog choosePatientDialog = new ChoosePatientDialog(
this, "Choose patient", viewModel.getPatients()
);
return choosePatientDialog.showDialog();
}
private void onOK() {
close();
}
private void onCancel() {
close();
}
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
$$$setupUI$$$();
}
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
btnInsertPatient = new JButton();
btnInsertPatient.setText("Insert new patient");
panel1.add(btnInsertPatient, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
btnMakeAppointment = new JButton();
btnMakeAppointment.setText("Make an appointment");
panel1.add(btnMakeAppointment, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
btnIssueBill = new JButton();
btnIssueBill.setText("Issue bill");
panel1.add(btnIssueBill, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
cbBasicRegistration = new JCheckBox();
cbBasicRegistration.setText("Basic registration");
panel1.add(cbBasicRegistration, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPane;
}
}
| UTF-8 | Java | 7,706 | java | ReceptionistMenuDialog.java | Java | [] | null | [] | package com.horvat.gui.dialogs.receptionist;
import com.horvat.bll.viewmodels.FillAppointmentViewModel;
import com.horvat.bll.viewmodels.receptionist.InsertPatientViewModel;
import com.horvat.bll.viewmodels.receptionist.IssueBillViewModel;
import com.horvat.bll.viewmodels.receptionist.ReceptionistMenuViewModel;
import com.horvat.dl.entities.Appointment;
import com.horvat.dl.entities.Bill;
import com.horvat.dl.entities.Doctor;
import com.horvat.dl.entities.Patient;
import com.horvat.gui.app.Utils;
import com.horvat.gui.dialogs.FillAppointmentDialog;
import com.horvat.gui.dialogs.base.VMDialog;
import com.horvat.gui.dialogs.option.ChooseDoctorDialog;
import com.horvat.gui.dialogs.option.ChoosePatientDialog;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ReceptionistMenuDialog extends VMDialog<ReceptionistMenuViewModel> {
private JPanel contentPane;
private JButton btnInsertPatient;
private JButton btnMakeAppointment;
private JButton btnIssueBill;
private JCheckBox cbBasicRegistration;
public ReceptionistMenuDialog(Window owner, String title, int width, int height, ReceptionistMenuViewModel viewModel) {
super(owner, title, width, height, viewModel);
setContentPane(contentPane);
initListeners();
}
private void initListeners() {
// call onCancel() when cross is clicked
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
onCancel();
}
});
// call onCancel() on ESCAPE
contentPane.registerKeyboardAction(new ActionListener() {
public void actionPerformed(ActionEvent e) {
onCancel();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
btnInsertPatient.addActionListener(e -> {
boolean basic = cbBasicRegistration.isSelected();
InsertPatientDialog insertPatientDialog = new InsertPatientDialog(
this, (basic ? "Basic" : "Full") + " registration",
900, 500, new InsertPatientViewModel(basic)
);
Patient patient = insertPatientDialog.showDialog();
if (patient != null)
viewModel.getPatients().add(patient);
});
btnMakeAppointment.addActionListener(e -> {
ChooseDoctorDialog chooseDoctorDialog = new ChooseDoctorDialog(
this, "Choose doctor", viewModel.getDoctors()
);
Doctor doctor = chooseDoctorDialog.showDialog();
if (doctor != null) {
Patient patient = selectPatient();
if (patient != null) {
FillAppointmentDialog fillAppointmentDialog = new FillAppointmentDialog(
this, "Make an appointment", 400, 400,
new FillAppointmentViewModel(doctor, patient)
);
Appointment appointment = fillAppointmentDialog.showDialog();
if (appointment != null)
patient.getAppointments().add(appointment);
}
}
});
btnIssueBill.addActionListener(e -> {
Patient patient = selectPatient();
if (patient != null) {
IssueBillDialog issueBillDialog = new IssueBillDialog(
this, "Issue bill to " + patient.getBasicDetails().getName(),
400, 200, new IssueBillViewModel(patient)
);
Bill bill = issueBillDialog.showDialog();
if (bill != null)
patient.getBills().add(bill);
}
});
}
private Patient selectPatient() {
ChoosePatientDialog choosePatientDialog = new ChoosePatientDialog(
this, "Choose patient", viewModel.getPatients()
);
return choosePatientDialog.showDialog();
}
private void onOK() {
close();
}
private void onCancel() {
close();
}
{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
$$$setupUI$$$();
}
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
btnInsertPatient = new JButton();
btnInsertPatient.setText("Insert new patient");
panel1.add(btnInsertPatient, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
btnMakeAppointment = new JButton();
btnMakeAppointment.setText("Make an appointment");
panel1.add(btnMakeAppointment, new com.intellij.uiDesigner.core.GridConstraints(1, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
btnIssueBill = new JButton();
btnIssueBill.setText("Issue bill");
panel1.add(btnIssueBill, new com.intellij.uiDesigner.core.GridConstraints(2, 0, 1, 2, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
cbBasicRegistration = new JCheckBox();
cbBasicRegistration.setText("Basic registration");
panel1.add(cbBasicRegistration, new com.intellij.uiDesigner.core.GridConstraints(0, 1, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_WEST, com.intellij.uiDesigner.core.GridConstraints.FILL_NONE, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPane;
}
}
| 7,706 | 0.678043 | 0.66883 | 161 | 46.863354 | 78.09124 | 508 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.136646 | false | false | 9 |
4badfa47c9028b525693a18ec2c2a427b67eba26 | 1,056,562,014,399 | 96b37c249da1aba79208c27af58eff763c3d999f | /src/main/java/update/FtrlUpdater.java | 0d050d37570b66187d7e70d2bda8d0983682dd81 | [] | no_license | Bilwang129/ps | https://github.com/Bilwang129/ps | 6d0ef93308f99784c34343be7a21739cc2194dfb | 1a6c5fece2e1ef2a2ca00fcd81688a106f5dc68a | refs/heads/master | 2020-03-23T14:04:30.712000 | 2018-07-18T03:01:36 | 2018-07-18T03:01:36 | 141,654,506 | 1 | 0 | null | true | 2018-07-20T02:40:37 | 2018-07-20T02:40:37 | 2018-07-20T02:40:32 | 2018-07-18T03:02:42 | 17,062 | 0 | 0 | 0 | null | false | null | package update;
import com.google.common.collect.Maps;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
import org.jblas.FloatMatrix;
import org.jblas.MatrixFunctions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import util.MatrixUtil;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
/**
* Ftrl: a Method for Stochastic Optimization.
*
* https://github.com/fmfn/FTRLp/blob/master/FTRLp.py
* https://www.cnblogs.com/EE-NovRain/p/3810737.html
*/
@Data
public class FtrlUpdater implements Updater {
private static Logger logger = LoggerFactory.getLogger(FtrlUpdater.class);
private float alfa;
private float beta;
private float l1;
private float l2;
private Map<String, FloatMatrix> Z = Maps.newConcurrentMap();
private Map<String, FloatMatrix> N = Maps.newConcurrentMap();
public FtrlUpdater() {}
public FtrlUpdater(float alfa, float beta, float l1, float l2) {
this.alfa = alfa;
this.beta = beta;
this.l1 = l1;
this.l2 = l2;
}
public FtrlUpdater(String str) {
this.alfa = Float.parseFloat(StringUtils.substringBetween(str, "alfa:", "@"));
this.beta = Float.parseFloat(StringUtils.substringBetween(str, "beta:", "@"));
this.l1 = Float.parseFloat(StringUtils.substringBetween(str, "l1:", "@"));
this.l2 = Float.parseFloat(StringUtils.substringBetween(str, "l2:", "@"));
}
public FloatMatrix update(String key, FloatMatrix w, FloatMatrix dw) {
if (dw.get(0) == 0) {
return w;
}
if (!N.containsKey(key)) {
N.put(key, FloatMatrix.zeros(w.length));
}
if (!Z.containsKey(key)) {
Z.put(key, FloatMatrix.zeros(w.length));
}
FloatMatrix zi = Z.get(key);
FloatMatrix ni = N.get(key);
// update each param
for (int i=0; i<w.data.length; i++) {
if (Math.abs(zi.data[i]) <= l1) {
w.data[i] = 0;
} else {
float sign = zi.data[i] >= 0 ? 1 : -1;
w.data[i] = -(zi.data[i] - sign * l1) / ((l2 + (beta + (float)Math.sqrt(ni.data[i]))) / alfa);
}
}
FloatMatrix s = MatrixFunctions.sqrt(N.get(key).add(MatrixFunctions.pow(dw, 2))).subi(MatrixFunctions.sqrt(N.get(key).div(this.alfa)));
Z.put(key, Z.get(key).addi(dw.sub(s.mul(w))));
N.put(key, N.get(key).addi(MatrixFunctions.pow(dw, 2)));
return w;
}
public String getName() {
return "adam@alfa:"+alfa+"@beta:"+beta+"@l1:"+l1+"@l2:"+l2+"@";
}
}
| UTF-8 | Java | 2,364 | java | FtrlUpdater.java | Java | [
{
"context": "Stochastic Optimization.\n *\n * https://github.com/fmfn/FTRLp/blob/master/FTRLp.py\n * https://www.cnblogs",
"end": 442,
"score": 0.999611496925354,
"start": 438,
"tag": "USERNAME",
"value": "fmfn"
},
{
"context": "p/blob/master/FTRLp.py\n * https://www.cnblogs.com/EE-... | null | [] | package update;
import com.google.common.collect.Maps;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
import org.jblas.FloatMatrix;
import org.jblas.MatrixFunctions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import util.MatrixUtil;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
/**
* Ftrl: a Method for Stochastic Optimization.
*
* https://github.com/fmfn/FTRLp/blob/master/FTRLp.py
* https://www.cnblogs.com/EE-NovRain/p/3810737.html
*/
@Data
public class FtrlUpdater implements Updater {
private static Logger logger = LoggerFactory.getLogger(FtrlUpdater.class);
private float alfa;
private float beta;
private float l1;
private float l2;
private Map<String, FloatMatrix> Z = Maps.newConcurrentMap();
private Map<String, FloatMatrix> N = Maps.newConcurrentMap();
public FtrlUpdater() {}
public FtrlUpdater(float alfa, float beta, float l1, float l2) {
this.alfa = alfa;
this.beta = beta;
this.l1 = l1;
this.l2 = l2;
}
public FtrlUpdater(String str) {
this.alfa = Float.parseFloat(StringUtils.substringBetween(str, "alfa:", "@"));
this.beta = Float.parseFloat(StringUtils.substringBetween(str, "beta:", "@"));
this.l1 = Float.parseFloat(StringUtils.substringBetween(str, "l1:", "@"));
this.l2 = Float.parseFloat(StringUtils.substringBetween(str, "l2:", "@"));
}
public FloatMatrix update(String key, FloatMatrix w, FloatMatrix dw) {
if (dw.get(0) == 0) {
return w;
}
if (!N.containsKey(key)) {
N.put(key, FloatMatrix.zeros(w.length));
}
if (!Z.containsKey(key)) {
Z.put(key, FloatMatrix.zeros(w.length));
}
FloatMatrix zi = Z.get(key);
FloatMatrix ni = N.get(key);
// update each param
for (int i=0; i<w.data.length; i++) {
if (Math.abs(zi.data[i]) <= l1) {
w.data[i] = 0;
} else {
float sign = zi.data[i] >= 0 ? 1 : -1;
w.data[i] = -(zi.data[i] - sign * l1) / ((l2 + (beta + (float)Math.sqrt(ni.data[i]))) / alfa);
}
}
FloatMatrix s = MatrixFunctions.sqrt(N.get(key).add(MatrixFunctions.pow(dw, 2))).subi(MatrixFunctions.sqrt(N.get(key).div(this.alfa)));
Z.put(key, Z.get(key).addi(dw.sub(s.mul(w))));
N.put(key, N.get(key).addi(MatrixFunctions.pow(dw, 2)));
return w;
}
public String getName() {
return "adam@alfa:"+alfa+"@beta:"+beta+"@l1:"+l1+"@l2:"+l2+"@";
}
}
| 2,364 | 0.67555 | 0.659898 | 81 | 28.185184 | 27.313503 | 137 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.91358 | false | false | 9 |
3d83845aff894f6b4901397d0d086938711c2467 | 6,751,688,652,273 | 7861fd84667308008ee5e22c57f52c6c392edef8 | /javacs-lab05/src/com/flatironschool/javacs/WikiPhilosophy.java | 301b175e9abe5936991f8147a7acb9397a890a4f | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | ZainabAq/cs-wikipedia-philosophy-lab-codeU | https://github.com/ZainabAq/cs-wikipedia-philosophy-lab-codeU | 4e85473a0e58df5eec07d4e87309ae3fb5a2480b | f96e805e1862c6b1e177a1b2a96603ab3e02253b | refs/heads/master | 2021-01-18T15:22:19.029000 | 2016-05-24T15:47:23 | 2016-05-24T15:47:23 | 59,120,291 | 1 | 0 | null | true | 2016-05-18T13:55:50 | 2016-05-18T13:55:50 | 2016-05-11T20:55:39 | 2016-05-17T16:59:21 | 623 | 0 | 0 | 0 | null | null | null | package com.flatironschool.javacs;
import java.io.IOException;
import java.util.ArrayList;
import java.io.IOException;
import java.util.List;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.jsoup.nodes.Node;
import org.jsoup.nodes.TextNode;
import org.jsoup.select.Elements;
public class WikiPhilosophy {
final static WikiFetcher wf = new WikiFetcher();
static Boolean counter = false;
static List<String> urlList = new ArrayList<String>();
public static Boolean isValid(String tag, String url) {
if (tag.equals(url) || urlList.contains(tag)) {
return false;
}
else {
return true;
}
}
public static void printList() {
for (String link : urlList) {
System.out.println(link);
}
}
/**
* Tests a conjecture about Wikipedia and Philosophy.
*
* https://en.wikipedia.org/wiki/Wikipedia:Getting_to_Philosophy
*
* 1. Clicking on the first non-parenthesized, non-italicized link
* 2. Ignoring external links, links to the current page, or red links
* 3. Stopping when reaching "Philosophy", a page with no links or a page
* that does not exist, or when a loop occurs
*
* @param args
* @throws IOException
*/
public static void recursiveLinkChecker(String url) throws IOException{
Connection conn = Jsoup.connect(url);
Document doc = conn.get();
Element content = doc.getElementById("mw-content-text");
Elements paras = content.select("p");
//exclude italics here
for (Element item : paras.children()) {
//how do I exclude items?
}
Elements links = paras.select("a[href]");
for (Element link : links){
String urlLink = link.attr("abs:href").toString();
if (isValid(urlLink, url)) {
counter = true;
if (urlLink.equals("https://en.wikipedia.org/wiki/Philosophy")) {
System.out.println("Success!");
printList();
return;
}
else {
urlList.add(urlLink);
recursiveLinkChecker(urlLink);
}
}
}
if (counter == false) {
System.out.println("The program has failed.");
printList();
return;
}
}
public static void main(String[] args) throws IOException {
// some example code to get you started
String url = "https://en.wikipedia.org/wiki/Java_(programming_language)";
recursiveLinkChecker(url);
}
}
| UTF-8 | Java | 2,413 | java | WikiPhilosophy.java | Java | [] | null | [] | package com.flatironschool.javacs;
import java.io.IOException;
import java.util.ArrayList;
import java.io.IOException;
import java.util.List;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.jsoup.nodes.Node;
import org.jsoup.nodes.TextNode;
import org.jsoup.select.Elements;
public class WikiPhilosophy {
final static WikiFetcher wf = new WikiFetcher();
static Boolean counter = false;
static List<String> urlList = new ArrayList<String>();
public static Boolean isValid(String tag, String url) {
if (tag.equals(url) || urlList.contains(tag)) {
return false;
}
else {
return true;
}
}
public static void printList() {
for (String link : urlList) {
System.out.println(link);
}
}
/**
* Tests a conjecture about Wikipedia and Philosophy.
*
* https://en.wikipedia.org/wiki/Wikipedia:Getting_to_Philosophy
*
* 1. Clicking on the first non-parenthesized, non-italicized link
* 2. Ignoring external links, links to the current page, or red links
* 3. Stopping when reaching "Philosophy", a page with no links or a page
* that does not exist, or when a loop occurs
*
* @param args
* @throws IOException
*/
public static void recursiveLinkChecker(String url) throws IOException{
Connection conn = Jsoup.connect(url);
Document doc = conn.get();
Element content = doc.getElementById("mw-content-text");
Elements paras = content.select("p");
//exclude italics here
for (Element item : paras.children()) {
//how do I exclude items?
}
Elements links = paras.select("a[href]");
for (Element link : links){
String urlLink = link.attr("abs:href").toString();
if (isValid(urlLink, url)) {
counter = true;
if (urlLink.equals("https://en.wikipedia.org/wiki/Philosophy")) {
System.out.println("Success!");
printList();
return;
}
else {
urlList.add(urlLink);
recursiveLinkChecker(urlLink);
}
}
}
if (counter == false) {
System.out.println("The program has failed.");
printList();
return;
}
}
public static void main(String[] args) throws IOException {
// some example code to get you started
String url = "https://en.wikipedia.org/wiki/Java_(programming_language)";
recursiveLinkChecker(url);
}
}
| 2,413 | 0.677994 | 0.676751 | 96 | 24.135416 | 22.050425 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.9375 | false | false | 9 |
9a483d14bd376dd29adddf7da80bbd7cf0b17913 | 19,232,863,611,749 | fdf715c582558d52efd8db6b368dd6d3923e826f | /alchemy-db-mongo/src/main/java/io/rtr/alchemy/db/mongo/models/TreatmentEntity.java | 8d23d4722584fef3726af32e884c52ddda874e27 | [
"MIT"
] | permissive | RentTheRunway/alchemy | https://github.com/RentTheRunway/alchemy | 8ecf96e8850218b6f9762261a611ecfba1caca71 | 51a5f91fa65d32d09913c474dd2a59fce0a55427 | refs/heads/master | 2023-09-05T02:29:27.022000 | 2023-06-09T17:44:28 | 2023-06-09T17:44:28 | 18,146,125 | 16 | 5 | MIT | false | 2023-06-09T17:42:18 | 2014-03-26T17:02:29 | 2022-03-07T18:03:31 | 2023-06-09T17:42:17 | 923 | 32 | 7 | 0 | Java | false | false | package io.rtr.alchemy.db.mongo.models;
import io.rtr.alchemy.models.Treatment;
import org.mongodb.morphia.annotations.Embedded;
/**
* An entity that mirrors Treatment
* @see io.rtr.alchemy.models.Treatment
*/
@Embedded
public class TreatmentEntity {
public String name;
public String description;
public static TreatmentEntity from(Treatment treatment) {
return new TreatmentEntity(treatment);
}
// Required by Morphia
private TreatmentEntity() { }
private TreatmentEntity(Treatment treatment) {
name = treatment.getName();
description = treatment.getDescription();
}
} | UTF-8 | Java | 634 | java | TreatmentEntity.java | Java | [] | null | [] | package io.rtr.alchemy.db.mongo.models;
import io.rtr.alchemy.models.Treatment;
import org.mongodb.morphia.annotations.Embedded;
/**
* An entity that mirrors Treatment
* @see io.rtr.alchemy.models.Treatment
*/
@Embedded
public class TreatmentEntity {
public String name;
public String description;
public static TreatmentEntity from(Treatment treatment) {
return new TreatmentEntity(treatment);
}
// Required by Morphia
private TreatmentEntity() { }
private TreatmentEntity(Treatment treatment) {
name = treatment.getName();
description = treatment.getDescription();
}
} | 634 | 0.714511 | 0.714511 | 26 | 23.423077 | 19.645264 | 61 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.307692 | false | false | 9 |
7b9104351b87b5f4d1c45cd8515c6f15db894117 | 22,694,607,254,499 | c26619ed774e22ee43bca92e08431375bb96b274 | /android/src/main/java/com/kolohelios/reactnative/localapi/LocalApiModule.java | 87581ce04cc8004a427e6e7d21addb51643bcdb6 | [
"MIT"
] | permissive | kolohelios/react-native-local-api | https://github.com/kolohelios/react-native-local-api | 6ba8a5e351f4e8363926c9599cf457ffd75d0796 | efd1be9c9a5d7ea1aaf4a176c4545f069e98c7a4 | refs/heads/master | 2023-01-11T11:12:08.697000 | 2020-08-19T01:37:35 | 2020-08-19T01:37:35 | 207,007,133 | 0 | 1 | MIT | false | 2023-01-04T09:18:20 | 2019-09-07T18:05:49 | 2020-08-19T01:37:45 | 2023-01-04T09:18:20 | 496 | 0 | 1 | 14 | Java | false | false | package com.kolohelios.reactnative.localapi;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableArray;
import org.json.JSONException;
import java.io.IOException;
import java.lang.Exception;
public class LocalApiModule extends ReactContextBaseJavaModule {
private final ReactApplicationContext reactContext;
public LocalApiModule(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}
@Override
public String getName() {
return "LocalApi";
}
@ReactMethod
public void apiRequest(final String url, final String method, final ReadableMap body, final Boolean setCookie, final Promise promise) {
try {
ApiInterface apiInterface = new ApiInterface();
// TODO implement better method handling
String response = "";
switch (method) {
case "GET":
response = apiInterface.get(url);
break;
case "POST":
String jsonBody = ReadablesToJSON.convertMapToJson(body).toString();
response = apiInterface.post(url, jsonBody);
}
promise.resolve(response);
} catch (JSONException e) {
promise.reject(e);
} catch (IOException e) {
promise.reject(e);
} catch (Exception e) {
promise.reject(e);
}
}
@ReactMethod
public void clearCookies() {
// TODO implement this
}
@ReactMethod
public void pinCertificate(final String hostname, final ReadableArray publicKeys, final String verificationURL, final Promise promise) {
try {
OkHttpProvider.setPin(hostname, publicKeys, verificationURL, promise);
} catch (Exception e) {
System.out.print(e.toString());
}
}
}
| UTF-8 | Java | 1,821 | java | LocalApiModule.java | Java | [] | null | [] | package com.kolohelios.reactnative.localapi;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableArray;
import org.json.JSONException;
import java.io.IOException;
import java.lang.Exception;
public class LocalApiModule extends ReactContextBaseJavaModule {
private final ReactApplicationContext reactContext;
public LocalApiModule(ReactApplicationContext reactContext) {
super(reactContext);
this.reactContext = reactContext;
}
@Override
public String getName() {
return "LocalApi";
}
@ReactMethod
public void apiRequest(final String url, final String method, final ReadableMap body, final Boolean setCookie, final Promise promise) {
try {
ApiInterface apiInterface = new ApiInterface();
// TODO implement better method handling
String response = "";
switch (method) {
case "GET":
response = apiInterface.get(url);
break;
case "POST":
String jsonBody = ReadablesToJSON.convertMapToJson(body).toString();
response = apiInterface.post(url, jsonBody);
}
promise.resolve(response);
} catch (JSONException e) {
promise.reject(e);
} catch (IOException e) {
promise.reject(e);
} catch (Exception e) {
promise.reject(e);
}
}
@ReactMethod
public void clearCookies() {
// TODO implement this
}
@ReactMethod
public void pinCertificate(final String hostname, final ReadableArray publicKeys, final String verificationURL, final Promise promise) {
try {
OkHttpProvider.setPin(hostname, publicKeys, verificationURL, promise);
} catch (Exception e) {
System.out.print(e.toString());
}
}
}
| 1,821 | 0.752334 | 0.752334 | 63 | 27.904762 | 28.021372 | 137 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.174603 | false | false | 9 |
dd1202ced1c6e33f9e0adbb352e16e84c3c1659c | 29,119,878,280,961 | 5835c4a79f075e7afb1b27d11ebff5ec80d62454 | /Plantilla/app/src/main/java/com/example/nieves/plantilla/VistaConcreta.java | 4ff42dbc37fc37c048fb22cf1435b3b8b078b3cf | [] | no_license | NievesBorrero/HLC-Android | https://github.com/NievesBorrero/HLC-Android | a0c9fae1905803e83b82789378be6618678bc014 | 8a372e4f970d04769879e339c6b7cf3c01b6d02b | refs/heads/master | 2021-09-08T23:08:13.505000 | 2018-03-12T19:20:38 | 2018-03-12T19:20:38 | 108,998,003 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.example.nieves.plantilla;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;
/**
* Created by nieves on 11/03/18.
*/
public class VistaConcreta extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vistaconcreta);
TextView tnombre = (TextView) findViewById(R.id.nombrecito);
TextView tCiudad = (TextView) findViewById(R.id.ciudadela);
// Extraemos datos del bundle
Bundle bundle = this.getIntent().getExtras();
tnombre.setText(bundle.getString("NOMBRE1"));
tCiudad.setText(bundle.getString("CIUDAD1"));
}
}
| UTF-8 | Java | 804 | java | VistaConcreta.java | Java | [
{
"context": "package com.example.nieves.plantilla;\n\nimport android.app.Activity;\nimport a",
"end": 26,
"score": 0.6298983097076416,
"start": 20,
"tag": "USERNAME",
"value": "nieves"
},
{
"context": "import android.widget.TextView;\n\n/**\n * Created by nieves on 11/03/18.\n */\n\... | null | [] | package com.example.nieves.plantilla;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;
/**
* Created by nieves on 11/03/18.
*/
public class VistaConcreta extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.vistaconcreta);
TextView tnombre = (TextView) findViewById(R.id.nombrecito);
TextView tCiudad = (TextView) findViewById(R.id.ciudadela);
// Extraemos datos del bundle
Bundle bundle = this.getIntent().getExtras();
tnombre.setText(bundle.getString("NOMBRE1"));
tCiudad.setText(bundle.getString("CIUDAD1"));
}
}
| 804 | 0.715174 | 0.705224 | 25 | 31.16 | 22.440464 | 68 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52 | false | false | 9 |
2b78323341b42ff7f9681e1215270c1cb0c5f121 | 29,119,878,277,702 | bf7db0882ce1a40f65a0c851348503bdc58775c1 | /src/main/java/com/fc/test/model/auto/TSysRoleUser.java | a22136406206a080a64a9cd716943ef49ad97da5 | [
"Apache-2.0"
] | permissive | lh124/SpringBoot_v2 | https://github.com/lh124/SpringBoot_v2 | 9014f237e961074bead8b983de0f24580694da2e | 8e8f40c021aba6cff2e22786aea2bcedd4898b45 | refs/heads/master | 2020-05-24T05:42:14.414000 | 2019-05-18T06:34:51 | 2019-05-18T06:34:51 | 187,121,913 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.fc.test.model.auto;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Setter
@Getter
public class TSysRoleUser implements Serializable {
private String id;
private String sysUserId;
private String sysRoleId;
private static final long serialVersionUID = 1L;
public TSysRoleUser() {
super();
}
public TSysRoleUser(String id, String sysUserId, String sysRoleId) {
super();
this.id = id;
this.sysUserId = sysUserId;
this.sysRoleId = sysRoleId;
}
} | UTF-8 | Java | 526 | java | TSysRoleUser.java | Java | [] | null | [] | package com.fc.test.model.auto;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
@Setter
@Getter
public class TSysRoleUser implements Serializable {
private String id;
private String sysUserId;
private String sysRoleId;
private static final long serialVersionUID = 1L;
public TSysRoleUser() {
super();
}
public TSysRoleUser(String id, String sysUserId, String sysRoleId) {
super();
this.id = id;
this.sysUserId = sysUserId;
this.sysRoleId = sysRoleId;
}
} | 526 | 0.71673 | 0.714829 | 30 | 16.566668 | 17.745766 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.966667 | false | false | 9 |
4d51a2b8c982fbd6c143432b69a20f7b412245a8 | 19,370,302,561,989 | 144b51bd6874749666b164ebc11b4c1859439c05 | /unimall-data/src/main/java/com/iotechn/unimall/data/domain/AnyattrDO.java | 6cfd74f02171b2abffbc88a81adda8c875d735cf | [
"Apache-2.0"
] | permissive | logep/uniapp-examples | https://github.com/logep/uniapp-examples | 8af43be96f0937799ad8ebda6e466be5d7cba76a | abad005efe15914a984d685b68eb745582504c62 | refs/heads/master | 2022-04-29T09:58:48.044000 | 2020-11-22T14:15:23 | 2020-11-22T14:15:23 | 226,048,785 | 0 | 0 | Apache-2.0 | false | 2020-07-02T01:37:42 | 2019-12-05T08:07:12 | 2019-12-26T09:39:52 | 2020-07-02T01:37:40 | 4,982 | 0 | 0 | 3 | Java | false | false | package com.iotechn.unimall.data.domain;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;
/**
* Created by rize on 2019/7/1.
*/
@TableName("unimall_attr")
@Data
public class AnyattrDO extends SuperDO {
private String type;
private Long id;
private String aid;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
private String attr9;
private String attr10;
private String attr11;
private String attr12;
private String attr13;
private String attr14;
private String attr15;
private String attr16;
}
| UTF-8 | Java | 731 | java | AnyattrDO.java | Java | [
{
"context": ".TableName;\nimport lombok.Data;\n\n/**\n * Created by rize on 2019/7/1.\n */\n@TableName(\"unimall_attr\")\n@Data",
"end": 140,
"score": 0.9996665716171265,
"start": 136,
"tag": "USERNAME",
"value": "rize"
}
] | null | [] | package com.iotechn.unimall.data.domain;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;
/**
* Created by rize on 2019/7/1.
*/
@TableName("unimall_attr")
@Data
public class AnyattrDO extends SuperDO {
private String type;
private Long id;
private String aid;
private String attr1;
private String attr2;
private String attr3;
private String attr4;
private String attr5;
private String attr6;
private String attr7;
private String attr8;
private String attr9;
private String attr10;
private String attr11;
private String attr12;
private String attr13;
private String attr14;
private String attr15;
private String attr16;
}
| 731 | 0.708618 | 0.668947 | 35 | 19.885714 | 13.287527 | 54 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.628571 | false | false | 9 |
1083ebb6eab396b8dff4a76480255a4a00a3c4c3 | 9,010,841,452,004 | 88d550951f1ff6145d148df4b88a59c8b56c0f6d | /hellokk/src/hellokk/thread/Park.java | 8366708e30151f526fca56bf124865c3522d4790 | [] | no_license | Aline1994/hellokk | https://github.com/Aline1994/hellokk | b9247eecc085d5950c1dd1b7c42067ddbc081b70 | 7053bd3d6b89f132f56ee1935b4f2426c71e6d58 | refs/heads/master | 2021-05-14T09:52:09.641000 | 2018-05-02T03:23:07 | 2018-05-02T03:23:07 | 116,334,347 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package hellokk.thread;
/**
* 三个车位,多个车位停车入库,开车离开
* @author iwpoo
* 一辆车进来,首先判断时候有停车位
*/
public class Park {
public static void main(String[] args) {
}
}
class Car{
private String name;
private String number;
public Car(String name,String number){
this.name = name;
this.number=number;
}
}
class threads implements Runnable{
public Car car;
@Override
public void run() {
boolean [] parkpot = {false,false,false};
synchronized(car){
//首先判断还有没有车位
for(int i=0;i<parkpot.length;i++){
if(parkpot[i]==false&&parkpot[i+1]==false&&parkpot[i+2]==false){
System.out.println("停车位已满");
}else{
if(parkpot[i]==true){
System.out.println(i+"停车位是空的,可以停车");
}
}
}
}
}
} | UTF-8 | Java | 864 | java | Park.java | Java | [
{
"context": "llokk.thread;\n/**\n * 三个车位,多个车位停车入库,开车离开\n * @author iwpoo\n *\t一辆车进来,首先判断时候有停车位\n */\n\npublic class Park {\n\tpub",
"end": 66,
"score": 0.9997426867485046,
"start": 61,
"tag": "USERNAME",
"value": "iwpoo"
}
] | null | [] | package hellokk.thread;
/**
* 三个车位,多个车位停车入库,开车离开
* @author iwpoo
* 一辆车进来,首先判断时候有停车位
*/
public class Park {
public static void main(String[] args) {
}
}
class Car{
private String name;
private String number;
public Car(String name,String number){
this.name = name;
this.number=number;
}
}
class threads implements Runnable{
public Car car;
@Override
public void run() {
boolean [] parkpot = {false,false,false};
synchronized(car){
//首先判断还有没有车位
for(int i=0;i<parkpot.length;i++){
if(parkpot[i]==false&&parkpot[i+1]==false&&parkpot[i+2]==false){
System.out.println("停车位已满");
}else{
if(parkpot[i]==true){
System.out.println(i+"停车位是空的,可以停车");
}
}
}
}
}
} | 864 | 0.616935 | 0.612903 | 44 | 15.931818 | 15.489583 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.25 | false | false | 9 |
9f516f2375e327d177919210e383858906533d23 | 1,340,029,841,995 | 63571aa83035891ace50a64fe198638efadab71d | /Dubles_sem_Testes/2-substituto/sistema/Relogio.java | eb455addf0b340c58b00309812b08a68a3f94c9d | [] | no_license | macartur/TecnicasDeProgramacao | https://github.com/macartur/TecnicasDeProgramacao | a0c71cb7d568553e77a4037d3f90322df91bdc49 | 2165e182fee6b5cfc7daa6fa139b66e89bf40170 | refs/heads/master | 2016-09-06T07:58:18.594000 | 2013-07-04T01:48:01 | 2013-07-04T01:48:01 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package sistema;
import java.util.Calendar;
public interface Relogio {
public Calendar agora();
}
| UTF-8 | Java | 101 | java | Relogio.java | Java | [] | null | [] | package sistema;
import java.util.Calendar;
public interface Relogio {
public Calendar agora();
}
| 101 | 0.762376 | 0.762376 | 7 | 13.428572 | 11.782034 | 26 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.571429 | false | false | 9 |
c76a76e0d854a2be943b70f711e9e5b9ee7da3ea | 6,141,803,289,382 | 79e9d0a37b057a745f16f73adf7b701d6f60c80e | /src/com/qianjiang/framework/authentication/BaseActionProcessor.java | 7ac08b4d93b7aad9e981c03c1fa5fe10192adcb2 | [] | no_license | 280017423/Framework | https://github.com/280017423/Framework | 99a73332a4e3279c8645e7b60c70c746db71a426 | 0eabcb64f29e02c721b2b6d607eba51c8449ae08 | refs/heads/master | 2016-09-06T17:10:03.474000 | 2015-01-12T07:03:00 | 2015-01-12T07:03:00 | 27,141,809 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.qianjiang.framework.authentication;
import android.app.Activity;
import android.content.Intent;
import com.qianjiang.framework.authentication.BaseLoginProcessor.LOGIN_TYPE;
import com.qianjiang.framework.model.ActionModel;
/***
*
* 此类用户封装请求逻辑基类,请求总入口
*
* @author xiaoxing
* @version 2013-3-11 下午1:28:52 xiaoxing
* @param <T>网络请求结果
* @param <T2>网络请求接口回调
*/
@SuppressWarnings("rawtypes")
public abstract class BaseActionProcessor<T extends BaseActionResult, T2 extends IBaseActionListener> {
/**
* 构造函数
*/
public BaseActionProcessor() {
}
/**
* jumpActivity 跳转界面
*
* @param action
* 动作类
*/
protected abstract void jumpActivity(ActionModel action);
/**
*
* 执行动作
*
* @param activity
* 当前上下文
*
* @param isOnUiThreadCallBack
* 是否主线程执行回调
* @param returnToMain
* 取消登录后,是否返回首页
* @param listener
* 回调函数
*/
public abstract void startAction(Activity activity, boolean isOnUiThreadCallBack, boolean returnToMain,
final T2 listener);
/**
* 跳转到登录界面
*
* @param activity
* Activity
* @param intent
* Intent
* @param loginType
* 登录类型
*/
public abstract void jumpToLoginActivity(Activity activity, Intent intent, LOGIN_TYPE loginType);
/**
* 获取进入登录界面Intent (ActivityGroup等跳转中使用,需要传递其它参数时使用)
*
* @param activity
* Activity
* @param loginType
* 登录类型
* @return Intent
*/
public abstract Intent getLoginIntent(Activity activity, LOGIN_TYPE loginType);
/**
* 登录验证页面跳转
*
* @param activity
* 当前下下文
* @param intent
* 跳转目的
* @param returnToMain
* 取消登录后,是否返回首页
*/
public void startActivity(Activity activity, final Intent intent, boolean returnToMain) {
// 登录类型(跳转界面)
LOGIN_TYPE loginType = LOGIN_TYPE.From_Jump_Activity_Type;
if (returnToMain) {
loginType = LOGIN_TYPE.From_Jump_Activity_Type_And_Cancel_ReturnMain_Type;
}
ActionModel action = new ActionModel<IBaseActionListener>(activity, null, intent, false);
action.setLoginType(loginType);
jumpActivity(action);
}
/**
* 登录验证页面跳转
*
* @param activity
* 当前下下文
* @param intent
* 跳转目的
* @param loginType
* 登录类型
*/
public void startActivity(Activity activity, final Intent intent, LOGIN_TYPE loginType) {
ActionModel action = new ActionModel<IBaseActionListener>(activity, null, intent, false);
action.setLoginType(loginType);
jumpActivity(action);
}
/**
* 登录验证页面跳转
*
* @param activity
* 当前下下文
* @param intent
* 跳转目的
*/
public void startActivity(Activity activity, final Intent intent) {
startActivity(activity, intent, false);
}
/**
* 执行动作
*
* @param activity
* 上下文
* @param listener
* 回调对象
*/
public void startAction(Activity activity, final T2 listener) {
startAction(activity, false, false, listener);
}
/**
* 执行动作
*
* @param activity
* 上下文
* @param returnToMain
* 是否返回首页
* @param listener
* 回调对象
*/
public void startAction(Activity activity, boolean returnToMain, T2 listener) {
startAction(activity, false, returnToMain, listener);
}
/**
* 执行动作,UI线程回调函数
*
* @param activity
* 上下文
* @param listener
* 回调对象
*/
public void startActionOnUiCallBack(Activity activity, final T2 listener) {
startAction(activity, true, false, listener);
}
}
| UTF-8 | Java | 4,000 | java | BaseActionProcessor.java | Java | [
{
"context": "el;\n\n/***\n * \n * 此类用户封装请求逻辑基类,请求总入口\n * \n * @author xiaoxing\n * @version 2013-3-11 下午1:28:52 xiaoxing\n * @para",
"end": 292,
"score": 0.982063889503479,
"start": 284,
"tag": "USERNAME",
"value": "xiaoxing"
}
] | null | [] | package com.qianjiang.framework.authentication;
import android.app.Activity;
import android.content.Intent;
import com.qianjiang.framework.authentication.BaseLoginProcessor.LOGIN_TYPE;
import com.qianjiang.framework.model.ActionModel;
/***
*
* 此类用户封装请求逻辑基类,请求总入口
*
* @author xiaoxing
* @version 2013-3-11 下午1:28:52 xiaoxing
* @param <T>网络请求结果
* @param <T2>网络请求接口回调
*/
@SuppressWarnings("rawtypes")
public abstract class BaseActionProcessor<T extends BaseActionResult, T2 extends IBaseActionListener> {
/**
* 构造函数
*/
public BaseActionProcessor() {
}
/**
* jumpActivity 跳转界面
*
* @param action
* 动作类
*/
protected abstract void jumpActivity(ActionModel action);
/**
*
* 执行动作
*
* @param activity
* 当前上下文
*
* @param isOnUiThreadCallBack
* 是否主线程执行回调
* @param returnToMain
* 取消登录后,是否返回首页
* @param listener
* 回调函数
*/
public abstract void startAction(Activity activity, boolean isOnUiThreadCallBack, boolean returnToMain,
final T2 listener);
/**
* 跳转到登录界面
*
* @param activity
* Activity
* @param intent
* Intent
* @param loginType
* 登录类型
*/
public abstract void jumpToLoginActivity(Activity activity, Intent intent, LOGIN_TYPE loginType);
/**
* 获取进入登录界面Intent (ActivityGroup等跳转中使用,需要传递其它参数时使用)
*
* @param activity
* Activity
* @param loginType
* 登录类型
* @return Intent
*/
public abstract Intent getLoginIntent(Activity activity, LOGIN_TYPE loginType);
/**
* 登录验证页面跳转
*
* @param activity
* 当前下下文
* @param intent
* 跳转目的
* @param returnToMain
* 取消登录后,是否返回首页
*/
public void startActivity(Activity activity, final Intent intent, boolean returnToMain) {
// 登录类型(跳转界面)
LOGIN_TYPE loginType = LOGIN_TYPE.From_Jump_Activity_Type;
if (returnToMain) {
loginType = LOGIN_TYPE.From_Jump_Activity_Type_And_Cancel_ReturnMain_Type;
}
ActionModel action = new ActionModel<IBaseActionListener>(activity, null, intent, false);
action.setLoginType(loginType);
jumpActivity(action);
}
/**
* 登录验证页面跳转
*
* @param activity
* 当前下下文
* @param intent
* 跳转目的
* @param loginType
* 登录类型
*/
public void startActivity(Activity activity, final Intent intent, LOGIN_TYPE loginType) {
ActionModel action = new ActionModel<IBaseActionListener>(activity, null, intent, false);
action.setLoginType(loginType);
jumpActivity(action);
}
/**
* 登录验证页面跳转
*
* @param activity
* 当前下下文
* @param intent
* 跳转目的
*/
public void startActivity(Activity activity, final Intent intent) {
startActivity(activity, intent, false);
}
/**
* 执行动作
*
* @param activity
* 上下文
* @param listener
* 回调对象
*/
public void startAction(Activity activity, final T2 listener) {
startAction(activity, false, false, listener);
}
/**
* 执行动作
*
* @param activity
* 上下文
* @param returnToMain
* 是否返回首页
* @param listener
* 回调对象
*/
public void startAction(Activity activity, boolean returnToMain, T2 listener) {
startAction(activity, false, returnToMain, listener);
}
/**
* 执行动作,UI线程回调函数
*
* @param activity
* 上下文
* @param listener
* 回调对象
*/
public void startActionOnUiCallBack(Activity activity, final T2 listener) {
startAction(activity, true, false, listener);
}
}
| 4,000 | 0.636932 | 0.631818 | 164 | 20.463415 | 23.631674 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.25 | false | false | 9 |
8c5f32b886d7d88befb8f0a55b8dac6a9b86e504 | 19,387,482,437,932 | 68871cfeaf37c12fd2e3608180d6ebd1689e9fec | /src/com/numhero/client/model/datacargo/user/UserListResponse.java | 9efd195233b77b94682710bff5bb0a69d78bdca5 | [] | no_license | uberto/netnumero | https://github.com/uberto/netnumero | 5e0170ed14d3f343f5eba651b73a6c82f8ec5d0e | 18c462fed7a046281f88edcf3b47fcc61dedcbf6 | refs/heads/master | 2021-04-06T19:29:13.461000 | 2017-03-10T10:03:07 | 2017-03-10T10:03:07 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.numhero.client.model.datacargo.user;
import com.numhero.client.model.pojoc.User;
import com.numhero.shared.datacargo.ListCommandResponse;
public class UserListResponse extends ListCommandResponse<User> {
}
| UTF-8 | Java | 220 | java | UserListResponse.java | Java | [] | null | [] | package com.numhero.client.model.datacargo.user;
import com.numhero.client.model.pojoc.User;
import com.numhero.shared.datacargo.ListCommandResponse;
public class UserListResponse extends ListCommandResponse<User> {
}
| 220 | 0.836364 | 0.836364 | 7 | 30.428572 | 26.816078 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false | 9 |
9e7f9a27c5dc381730f819130380504fb84dfd04 | 9,783,935,507,815 | d8fb4c252bedb72b2c8502360fd35a0fe497bbbe | /qiding-sentinel/src/main/java/com/qiding/sentinel/config/SentinelConfig.java | 7f968543c23e7e10cddcede25458f6619ad5607d | [] | no_license | cckmit/qiding-middle-ware | https://github.com/cckmit/qiding-middle-ware | f7acc4527b960698167f99f61b9046a1cfe7bb72 | fb978f01e138d8fa7bd758c462d6de329521e0b2 | refs/heads/master | 2023-03-17T16:07:07.417000 | 2020-10-24T03:03:22 | 2020-10-24T03:03:22 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.qiding.sentinel.config;
import java.util.List;
import lombok.Data;
/**
* @author <qiding@kuaishou.com>
* Created on 2020-10-10
*/
@Data
public class SentinelConfig {
List<RuleConfig> rule;
}
| UTF-8 | Java | 217 | java | SentinelConfig.java | Java | [
{
"context": ".util.List;\n\nimport lombok.Data;\n\n/**\n * @author <qiding@kuaishou.com>\n * Created on 2020-10-10\n */\n@Data\npublic class ",
"end": 117,
"score": 0.9999310374259949,
"start": 98,
"tag": "EMAIL",
"value": "qiding@kuaishou.com"
}
] | null | [] | package com.qiding.sentinel.config;
import java.util.List;
import lombok.Data;
/**
* @author <<EMAIL>>
* Created on 2020-10-10
*/
@Data
public class SentinelConfig {
List<RuleConfig> rule;
}
| 205 | 0.695853 | 0.658986 | 14 | 14.5 | 13.393762 | 35 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | false | false | 9 |
013c6d9790255942ceaa8520c1bc3825550e0694 | 17,961,553,293,487 | 0106f71e37ea31acdce038c6313612d601000036 | /conversion/src/main/java/com/codeshare/springboot/microservice/example/conversion/restservice/ICCRestServiceImpl.java | 60613dd3cd21029bfe9c449813281e4991200ad1 | [] | no_license | ayciceksamet/currency-and-exchange-microservices | https://github.com/ayciceksamet/currency-and-exchange-microservices | db2de001edff6a5ac8cddae1d0014cb3bb8bc343 | 0d23270c79fc5edec05968eff26030dbf7807066 | refs/heads/master | 2021-07-07T14:04:55.810000 | 2019-12-20T08:21:51 | 2019-12-20T08:21:51 | 228,928,510 | 0 | 0 | null | false | 2021-03-31T21:41:25 | 2019-12-18T21:59:50 | 2020-01-08T18:44:00 | 2021-03-31T21:41:23 | 28,546 | 0 | 0 | 1 | JavaScript | false | false | package com.codeshare.springboot.microservice.example.conversion.restservice;
import java.math.BigDecimal;
import java.net.URI;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriBuilder;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
import com.codeshare.springboot.microservice.example.conversion.model.CCConvertionAmountResponseModel;
import com.codeshare.springboot.microservice.example.conversion.model.CCDataObjectTransaction;
import com.codeshare.springboot.microservice.example.conversion.model.CCErrorModel;
import com.codeshare.springboot.microservice.example.conversion.model.CCModel;
import com.codeshare.springboot.microservice.example.conversion.repository.CCRepository;
@Service
public class ICCRestServiceImpl implements ICCRestService {
@Autowired
private Environment env;
@Autowired
CCRepository repository;
@Override
public CCConvertionAmountResponseModel getCCAmount(BigDecimal amount, String from, String to) {
CCConvertionAmountResponseModel response = new CCConvertionAmountResponseModel();
String pairValue = from.concat(to);
RestTemplate restTemplate = new RestTemplate();
Map<String, String> uriVariables = new HashMap<>();
uriVariables.put("currencypair", pairValue);
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponents builder = UriComponentsBuilder
.fromHttpUrl(env.getProperty("exchange.service.uri"))
.buildAndExpand(uriVariables);
HttpEntity<?> entity = new HttpEntity<>(headers);
ResponseEntity<CCModel> responseEnt = restTemplate.exchange(
builder.toUriString(),
HttpMethod.GET,
entity,
CCModel.class);
CCModel amountResponse = responseEnt.getBody();
HttpHeaders headersResponse = responseEnt.getHeaders();
if(responseEnt!=null && !responseEnt.getStatusCode().is2xxSuccessful()) {
CCErrorModel errormodel = new CCErrorModel();
errormodel.setCode("404");
errormodel.setType("Bad Request");
errormodel.setInfo("No transaction process is done !");
response.setError(errormodel);
return response;
}
if("".equalsIgnoreCase(response.getTransactionID())) {
CCErrorModel errormodel = new CCErrorModel();
errormodel.setCode("400");
errormodel.setType("Bad Request");
errormodel.setInfo("No transaction process is done !");
response.setError(errormodel);
return response;
}
response.setAmountValue(amountResponse.getrateValue().multiply(amount));
response.setError(amountResponse.getError());
response.setTransactionID(headersResponse.getFirst("Transaction-ID"));
CCDataObjectTransaction transaction = new CCDataObjectTransaction();
transaction.setAmountValue(response.getAmountValue());
transaction.setTransactionID(response.getTransactionID());
transaction.setDate(headersResponse.getDate());
transaction.setId(new Random().nextLong());
repository.insert(transaction);
System.out.println(repository.findByTransactionID(transaction.getTransactionID()).getTransactionID());
return response;
}
}
| UTF-8 | Java | 4,030 | java | ICCRestServiceImpl.java | Java | [] | null | [] | package com.codeshare.springboot.microservice.example.conversion.restservice;
import java.math.BigDecimal;
import java.net.URI;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriBuilder;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
import com.codeshare.springboot.microservice.example.conversion.model.CCConvertionAmountResponseModel;
import com.codeshare.springboot.microservice.example.conversion.model.CCDataObjectTransaction;
import com.codeshare.springboot.microservice.example.conversion.model.CCErrorModel;
import com.codeshare.springboot.microservice.example.conversion.model.CCModel;
import com.codeshare.springboot.microservice.example.conversion.repository.CCRepository;
@Service
public class ICCRestServiceImpl implements ICCRestService {
@Autowired
private Environment env;
@Autowired
CCRepository repository;
@Override
public CCConvertionAmountResponseModel getCCAmount(BigDecimal amount, String from, String to) {
CCConvertionAmountResponseModel response = new CCConvertionAmountResponseModel();
String pairValue = from.concat(to);
RestTemplate restTemplate = new RestTemplate();
Map<String, String> uriVariables = new HashMap<>();
uriVariables.put("currencypair", pairValue);
HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponents builder = UriComponentsBuilder
.fromHttpUrl(env.getProperty("exchange.service.uri"))
.buildAndExpand(uriVariables);
HttpEntity<?> entity = new HttpEntity<>(headers);
ResponseEntity<CCModel> responseEnt = restTemplate.exchange(
builder.toUriString(),
HttpMethod.GET,
entity,
CCModel.class);
CCModel amountResponse = responseEnt.getBody();
HttpHeaders headersResponse = responseEnt.getHeaders();
if(responseEnt!=null && !responseEnt.getStatusCode().is2xxSuccessful()) {
CCErrorModel errormodel = new CCErrorModel();
errormodel.setCode("404");
errormodel.setType("Bad Request");
errormodel.setInfo("No transaction process is done !");
response.setError(errormodel);
return response;
}
if("".equalsIgnoreCase(response.getTransactionID())) {
CCErrorModel errormodel = new CCErrorModel();
errormodel.setCode("400");
errormodel.setType("Bad Request");
errormodel.setInfo("No transaction process is done !");
response.setError(errormodel);
return response;
}
response.setAmountValue(amountResponse.getrateValue().multiply(amount));
response.setError(amountResponse.getError());
response.setTransactionID(headersResponse.getFirst("Transaction-ID"));
CCDataObjectTransaction transaction = new CCDataObjectTransaction();
transaction.setAmountValue(response.getAmountValue());
transaction.setTransactionID(response.getTransactionID());
transaction.setDate(headersResponse.getDate());
transaction.setId(new Random().nextLong());
repository.insert(transaction);
System.out.println(repository.findByTransactionID(transaction.getTransactionID()).getTransactionID());
return response;
}
}
| 4,030 | 0.74938 | 0.747643 | 116 | 33.741379 | 27.909681 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.189655 | false | false | 9 |
354f5014af711fd893b17944c536d8184cd88cb5 | 23,192,823,428,163 | 66d61326bdda61b2455986b878815c3130404b55 | /Chapter 8/PizzaChoice.java | 11d25dca02343fbb7abd6b0b70f281f8fbb40ff3 | [] | no_license | HamzaMohammadKhan/Java-Joyce-Farrell | https://github.com/HamzaMohammadKhan/Java-Joyce-Farrell | cd1fb032a2bf955fb5a6f90894775b69f2833850 | 884e128c674d81c53810bcb368d4075730e672d0 | refs/heads/main | 2023-07-20T14:50:18.492000 | 2023-03-26T12:40:10 | 2023-03-26T12:40:10 | 365,601,951 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | import javax.swing.*;
import java.util.Scanner;
public class PizzaChoice {
public static void main(String[] args){
final int NUMBER_OF_CHOICES = 5;
String[] pizzaSize = {"N","S","M","L","X"};
double[] pizzaPrice = {0.0,6.99,8.99,12.50,15.00};
double Prices = 0.0;
boolean validChoice = false;
String sizeChosen;
Scanner sc = new Scanner(System.in);
System.out.println("Enter choice : ");
sizeChosen = sc.nextLine();
for(int x = 0; x < NUMBER_OF_CHOICES;x++)
if(sizeChosen.equals(pizzaSize[x])) {
validChoice = true;
Prices = pizzaPrice[x];
}
if(validChoice){
JOptionPane.showMessageDialog(null," The price of " + sizeChosen + " pizza is " + Prices);
}else{
JOptionPane.showMessageDialog(null, " Wrong Entry ");
}
}
}
| UTF-8 | Java | 898 | java | PizzaChoice.java | Java | [] | null | [] | import javax.swing.*;
import java.util.Scanner;
public class PizzaChoice {
public static void main(String[] args){
final int NUMBER_OF_CHOICES = 5;
String[] pizzaSize = {"N","S","M","L","X"};
double[] pizzaPrice = {0.0,6.99,8.99,12.50,15.00};
double Prices = 0.0;
boolean validChoice = false;
String sizeChosen;
Scanner sc = new Scanner(System.in);
System.out.println("Enter choice : ");
sizeChosen = sc.nextLine();
for(int x = 0; x < NUMBER_OF_CHOICES;x++)
if(sizeChosen.equals(pizzaSize[x])) {
validChoice = true;
Prices = pizzaPrice[x];
}
if(validChoice){
JOptionPane.showMessageDialog(null," The price of " + sizeChosen + " pizza is " + Prices);
}else{
JOptionPane.showMessageDialog(null, " Wrong Entry ");
}
}
}
| 898 | 0.557906 | 0.535635 | 30 | 28.933332 | 23.29225 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.9 | false | false | 9 |
27a7826733da0b44617cd15741b7b5b507966fd3 | 11,209,864,707,774 | cc87e80e9f252c75917c07ab2f4aa75b9eb4cd8c | /ch11/src/sec04/StringReplaceExample.java | a7e40da0ee615e8997aa0a66ee50206fa3d214af | [] | no_license | BAEKJungHo/EZEN_Java-Lecture | https://github.com/BAEKJungHo/EZEN_Java-Lecture | 7cfe34478e0bbcef376481114d2ca62b2f18c90f | 94646db093c34f1ea96b2c49db221e60e3028011 | refs/heads/master | 2020-04-28T19:51:10.737000 | 2019-05-28T03:42:29 | 2019-05-28T03:42:29 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package sec04;
public class StringReplaceExample {
public static void main(String[] args) {
String str1 = "자바 배우기";
String str2 = str1.replace("자바", "Java");
System.out.println(str1 + ", " + str2);
}
}
| UTF-8 | Java | 237 | java | StringReplaceExample.java | Java | [] | null | [] | package sec04;
public class StringReplaceExample {
public static void main(String[] args) {
String str1 = "자바 배우기";
String str2 = str1.replace("자바", "Java");
System.out.println(str1 + ", " + str2);
}
}
| 237 | 0.623318 | 0.591928 | 11 | 19.272728 | 18.19136 | 45 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.454545 | false | false | 9 |
e4fc4aaac5a25ff393f9f066b754f562a9f15961 | 11,072,425,724,182 | 8d0aedb77282cc2251010668f9ea6a05e0ee01b1 | /src/main/java/org/jukeboxmc/item/ItemSculkCatalyst.java | 3351ef6946abdccaea436d96ab28cca658f08637 | [] | no_license | TobiasGrether/JukeboxMC | https://github.com/TobiasGrether/JukeboxMC | ae1b6da46cb9dd388df86bda32d773f9e050046a | e25256acf4a3c73a32ee4f8629576b2617220fb6 | refs/heads/master | 2023-08-14T07:03:13.427000 | 2021-10-13T16:17:02 | 2021-10-13T16:17:02 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.jukeboxmc.item;
import org.jukeboxmc.block.BlockSculkCatalyst;
/**
* @author LucGamesYT
* @version 1.0
*/
public class ItemSculkCatalyst extends Item {
//NOTE: Only in item and block palette but the item/block is not in the game yet
public ItemSculkCatalyst() {
super( "minecraft:sculk_catalyst" );
}
@Override
public BlockSculkCatalyst getBlock() {
return new BlockSculkCatalyst();
}
}
| UTF-8 | Java | 446 | java | ItemSculkCatalyst.java | Java | [
{
"context": "ukeboxmc.block.BlockSculkCatalyst;\n\n/**\n * @author LucGamesYT\n * @version 1.0\n */\npublic class ItemSculkCatalys",
"end": 102,
"score": 0.9992528557777405,
"start": 92,
"tag": "USERNAME",
"value": "LucGamesYT"
}
] | null | [] | package org.jukeboxmc.item;
import org.jukeboxmc.block.BlockSculkCatalyst;
/**
* @author LucGamesYT
* @version 1.0
*/
public class ItemSculkCatalyst extends Item {
//NOTE: Only in item and block palette but the item/block is not in the game yet
public ItemSculkCatalyst() {
super( "minecraft:sculk_catalyst" );
}
@Override
public BlockSculkCatalyst getBlock() {
return new BlockSculkCatalyst();
}
}
| 446 | 0.686099 | 0.681614 | 20 | 21.299999 | 22.450167 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | false | false | 9 |
a44d530cbccb80f4e6cf80427a97d99a459e84e7 | 2,774,548,897,961 | 3850ff5fe53e811d0b07c8316373c051f6d8c7b6 | /src/main/java/com/winchannel/crm/secdraw/util/RandomLuckyDraw.java | 74d144420eb6fd016b3040ebfc641bc4cc6c63fa | [] | no_license | newSue/Mobilemdm | https://github.com/newSue/Mobilemdm | 7c1e816d814957a3d8b9a28ac1180fd009a3aa70 | f66c594fb05f0b8c96522015fe59e7f259166c10 | refs/heads/master | 2018-05-19T13:48:53.442000 | 2017-05-31T09:32:25 | 2017-05-31T09:32:25 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.winchannel.crm.secdraw.util;
import java.util.Map;
import org.apache.commons.lang.math.RandomUtils;
/*
* 随机抽奖类
* 利用随机数方式产生抽奖结果
*/
public class RandomLuckyDraw extends AbstractLuckyDraw{
public RandomLuckyDraw(){
super();
}
public RandomLuckyDraw(Map<String,AbstractSecDrawAward> inventories) {
super(inventories);
}
/*
* 随机抽奖
*
*/
@Override
protected AbstractSecDrawAward draw() {
Integer range=this.inventories.size();
Integer randomIdx=RandomUtils.nextInt(range);
return this.inventories.get(randomIdx);
}
}
| UTF-8 | Java | 631 | java | RandomLuckyDraw.java | Java | [] | null | [] | package com.winchannel.crm.secdraw.util;
import java.util.Map;
import org.apache.commons.lang.math.RandomUtils;
/*
* 随机抽奖类
* 利用随机数方式产生抽奖结果
*/
public class RandomLuckyDraw extends AbstractLuckyDraw{
public RandomLuckyDraw(){
super();
}
public RandomLuckyDraw(Map<String,AbstractSecDrawAward> inventories) {
super(inventories);
}
/*
* 随机抽奖
*
*/
@Override
protected AbstractSecDrawAward draw() {
Integer range=this.inventories.size();
Integer randomIdx=RandomUtils.nextInt(range);
return this.inventories.get(randomIdx);
}
}
| 631 | 0.70017 | 0.70017 | 31 | 16.935484 | 19.982145 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.967742 | false | false | 9 |
1a106dbe10a20d20c65d2ada77ab1f911a28dadb | 9,199,819,962,179 | a2102ef40a251496aeb5186669a467543b42fa87 | /src/application/editCont.java | 59ae2952a6e0c6ebe0be32ef930e1ccb93747591 | [] | no_license | vasudedakiya/JavaFX_Login | https://github.com/vasudedakiya/JavaFX_Login | 68e56cb290565177e0310ec88fc4c406d69dd436 | fda187bda2bf92a1061b87c055cc4ea0541c5cbe | refs/heads/master | 2023-05-13T21:33:34.280000 | 2021-06-10T05:24:32 | 2021-06-10T05:24:32 | 375,580,498 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package application;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
public class editCont {
@FXML
private TextField edit_username;
@FXML
private RadioButton edit_male;
@FXML
private ToggleGroup genderGroup;
@FXML
private RadioButton edit_female;
@FXML
private DatePicker edit_dob;
@FXML
private Button submitchanges;
@FXML
private Label isExist;
@FXML
private TextField serUsername;
@FXML
private Button search;
String[] up;
@FXML
void searchUser(ActionEvent event) {
try {
BufferedReader br = new BufferedReader(new FileReader("src/application/user.txt"));
String temp;
Boolean flag = false;
while((temp = br.readLine())!=null) {
up = temp.split("##");
if((serUsername.getText().equals(up[0])) ){
flag = true;
edit_username.setText(up[0]);
break;
}
}
if(flag == false) {
isExist.setText("User Dose not exist");
}
br.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@FXML
void selectGender(ActionEvent event) {
RadioButton selectedRadioButton = (RadioButton) genderGroup.getSelectedToggle();
String toogleGroupValue = selectedRadioButton.getText();
}
@FXML
void submitChange(ActionEvent event) {
try {
new Index().start(Edit.primaryStage);
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
// @FXML
// void selectGender(ActionEvent event) {
// RadioButton selectedRadioButton = (RadioButton) genderGroup.getSelectedToggle();
// String toogleGroupValue = selectedRadioButton.getText();
// System.out.println(toogleGroupValue);
//
// }
// @FXML
// void submitChange(ActionEvent event) {
//
// try {
// new Index().start(Edit.primaryStage);
// }
// catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
| UTF-8 | Java | 2,496 | java | editCont.java | Java | [] | null | [] |
package application;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
public class editCont {
@FXML
private TextField edit_username;
@FXML
private RadioButton edit_male;
@FXML
private ToggleGroup genderGroup;
@FXML
private RadioButton edit_female;
@FXML
private DatePicker edit_dob;
@FXML
private Button submitchanges;
@FXML
private Label isExist;
@FXML
private TextField serUsername;
@FXML
private Button search;
String[] up;
@FXML
void searchUser(ActionEvent event) {
try {
BufferedReader br = new BufferedReader(new FileReader("src/application/user.txt"));
String temp;
Boolean flag = false;
while((temp = br.readLine())!=null) {
up = temp.split("##");
if((serUsername.getText().equals(up[0])) ){
flag = true;
edit_username.setText(up[0]);
break;
}
}
if(flag == false) {
isExist.setText("User Dose not exist");
}
br.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@FXML
void selectGender(ActionEvent event) {
RadioButton selectedRadioButton = (RadioButton) genderGroup.getSelectedToggle();
String toogleGroupValue = selectedRadioButton.getText();
}
@FXML
void submitChange(ActionEvent event) {
try {
new Index().start(Edit.primaryStage);
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
// @FXML
// void selectGender(ActionEvent event) {
// RadioButton selectedRadioButton = (RadioButton) genderGroup.getSelectedToggle();
// String toogleGroupValue = selectedRadioButton.getText();
// System.out.println(toogleGroupValue);
//
// }
// @FXML
// void submitChange(ActionEvent event) {
//
// try {
// new Index().start(Edit.primaryStage);
// }
// catch (IOException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
| 2,496 | 0.620994 | 0.620192 | 128 | 18.484375 | 19.04681 | 89 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.28125 | false | false | 9 |
7b544afa9c5ca4f6f6b8d632f468c8f9e8a2dd43 | 3,582,002,731,687 | 6ef70ed460bd23f294c9193689533416d6098154 | /hilos/src/org/aguzman/hilos/ejemplosync/Panaderia.java | c5074b72a56bd12a6b1f320ca07711b5436c9f89 | [] | no_license | eraldovicente/Curso-Java | https://github.com/eraldovicente/Curso-Java | 11689a5c04e886d1c5f6da0bfce44bb765a8edbe | b72ff68939653fa30017966edf6529c9dc0664c0 | refs/heads/main | 2023-08-15T10:59:08.932000 | 2021-10-14T19:16:20 | 2021-10-14T19:16:20 | 401,105,985 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null | package org.aguzman.hilos.ejemplosync;
public class Panaderia {
private String pan;
private boolean disponible;
public synchronized void hornear(String masa) {
while (disponible) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
this.pan = masa;
System.out.println("Panadero hornea: " + this.pan);
this.disponible = true;
notify();
}
public synchronized String consumir() {
while (!disponible) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("Cliente consumo: " + this.pan);
this.disponible = false;
notify();
return pan;
}
}
| UTF-8 | Java | 858 | java | Panaderia.java | Java | [] | null | [] | package org.aguzman.hilos.ejemplosync;
public class Panaderia {
private String pan;
private boolean disponible;
public synchronized void hornear(String masa) {
while (disponible) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
this.pan = masa;
System.out.println("Panadero hornea: " + this.pan);
this.disponible = true;
notify();
}
public synchronized String consumir() {
while (!disponible) {
try {
wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("Cliente consumo: " + this.pan);
this.disponible = false;
notify();
return pan;
}
}
| 858 | 0.506993 | 0.506993 | 34 | 24.235294 | 16.349237 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.441176 | false | false | 9 |
48df5b36bfa0e6a470c4a899f1e1c86c7c14d7ca | 515,396,136,142 | dfefda22ea8da21643158935f68eb5dd070cbef0 | /java/eclipse/netTest2Server/src/com/test1/MyServer2.java | cd927439328fe6043e96897c98353f9f2fa01a80 | [] | no_license | freefreesea/tonic | https://github.com/freefreesea/tonic | 12c99f90a7c5cfda321512693a6ccd5f4ba00319 | 5cba1fa326e0ac1f3c91b3244a2c31cdd0becc3f | refs/heads/master | 2020-04-10T17:32:44.145000 | 2018-12-11T09:21:43 | 2018-12-11T09:21:43 | 161,177,039 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | /**
* 功能:是一个服务器端,9999端口监听
* 可以通过控制台收
*/
package com.test1;
import java.net.*;
import java.io.*;
public class MyServer2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
MyServer2 ms2 = new MyServer2();
}
public MyServer2()
{
try {
System.out.println("服务器在9999监听");
ServerSocket ss = new ServerSocket(9999);
Socket s= ss.accept();
//先接受客户端发来的信息
InputStreamReader isr = new InputStreamReader(s.getInputStream());
BufferedReader br = new BufferedReader(isr);
PrintWriter pw = new PrintWriter(s.getOutputStream(),true);
//接受从控制台输入的信息
InputStreamReader isr2= new InputStreamReader(System.in);
BufferedReader br2=new BufferedReader(isr2);
while(true)
{
String infoFromClient=br.readLine();
System.out.println("客户端发来"+infoFromClient);
if(infoFromClient.equals("bye"))
{
System.out.println("对话结束!");
s.close();
break;
}
//接受从控制台输入的信息
System.out.println("输入你希望对客户端说的话:");
String res=br2.readLine();
//把从控制台接受的信息,回送给客户端
pw.println(res);
}
} catch (Exception e) {
e.printStackTrace();
// TODO: handle exception
}
}
}
| GB18030 | Java | 1,374 | java | MyServer2.java | Java | [] | null | [] | /**
* 功能:是一个服务器端,9999端口监听
* 可以通过控制台收
*/
package com.test1;
import java.net.*;
import java.io.*;
public class MyServer2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
MyServer2 ms2 = new MyServer2();
}
public MyServer2()
{
try {
System.out.println("服务器在9999监听");
ServerSocket ss = new ServerSocket(9999);
Socket s= ss.accept();
//先接受客户端发来的信息
InputStreamReader isr = new InputStreamReader(s.getInputStream());
BufferedReader br = new BufferedReader(isr);
PrintWriter pw = new PrintWriter(s.getOutputStream(),true);
//接受从控制台输入的信息
InputStreamReader isr2= new InputStreamReader(System.in);
BufferedReader br2=new BufferedReader(isr2);
while(true)
{
String infoFromClient=br.readLine();
System.out.println("客户端发来"+infoFromClient);
if(infoFromClient.equals("bye"))
{
System.out.println("对话结束!");
s.close();
break;
}
//接受从控制台输入的信息
System.out.println("输入你希望对客户端说的话:");
String res=br2.readLine();
//把从控制台接受的信息,回送给客户端
pw.println(res);
}
} catch (Exception e) {
e.printStackTrace();
// TODO: handle exception
}
}
}
| 1,374 | 0.654237 | 0.635593 | 57 | 19.701754 | 17.820711 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.754386 | false | false | 9 |
a49945e7d554824cc2b4fb2641dc1899192f2909 | 26,053,271,681,137 | fc3bb216f472638185f8269bb3683b59be6d0804 | /mobileTourGuideprovince/src/main/java/com/jiagu/mobile/tourguide/activities/ExerciseActivity.java | aa78c5373b159688f00601648a179de20d619882 | [] | no_license | wupengwp/MobileTourGuide-province | https://github.com/wupengwp/MobileTourGuide-province | 4343ec6b13bec9fce02b47eb88ad4dfe63afe87e | 209688e0eb7b0d58f0c6a4f005be4f9af561ccca | refs/heads/master | 2020-03-19T04:17:17.327000 | 2018-06-02T12:04:45 | 2018-06-02T12:05:43 | 135,813,540 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null | package com.jiagu.mobile.tourguide.activities;
import java.util.ArrayList;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Toast;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnLastItemVisibleListener;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.jiagu.mobile.tourguide.R;
import com.jiagu.mobile.tourguide.activities.bases.TitleDrawerActivity;
import com.jiagu.mobile.tourguide.adapter.ExerciseAdapter;
import com.jiagu.mobile.tourguide.bean.Exercise;
import com.jiagu.mobile.tourguide.utils.FileTools;
import com.jiagu.mobile.tourguide.utils.HttpUtil;
import com.jiagu.mobile.tourguide.utils.Path;
import com.jiagu.mobile.tourguide.utils.UesrInfo;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
//近期活动
public class ExerciseActivity extends TitleDrawerActivity implements OnClickListener, OnItemClickListener, OnRefreshListener<ListView>,OnLastItemVisibleListener {
private ArrayList<Exercise> data;
private PullToRefreshListView mListView;
private String path = Path.SERVER_ADRESS + "scenicPlanning/scenicPlanningList.htm";
private int a = 2;
private ExerciseAdapter adapter;
private static int count = 0;
private boolean is = true;
@Override
@SuppressLint("InflateParams")
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_exercise);
ImageView image = (ImageView) findViewById(R.id.activity_exercise_image_return);
mListView = (PullToRefreshListView) findViewById(R.id.list_indent_activity);
image.setOnClickListener(this);
getData();
mListView.setOnItemClickListener(this);
mListView.setOnRefreshListener(this);
mListView.setOnLastItemVisibleListener(this);
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
// setAppName(UesrInfo.area);
appName.setText(UesrInfo.area + "手机导游");
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.activity_exercise_image_return:
onBackPressed();
break;
}
}
// 下载数据
private void getData() {
showProgress();
RequestParams params = new RequestParams();
params.put("pages", "" + 1);
if (UesrInfo.areaType.equals("2")) {
params.put("area", UesrInfo.area);
} else {
params.put("area", UesrInfo.sceneId);
}
params.put("areaType", UesrInfo.areaType);
HttpUtil.post(path, params, new AsyncHttpResponseHandler() {
@Override
public void onFailure(Throwable arg0, String arg1) {
super.onFailure(arg0, arg1);
hideProgress();
count++;
if (count < 3) {
FileTools.writeLog("exercise.txt", "活动列表第1页错误----count:"
+ count + "---Throwable:" + arg0 + "------" + arg1);
getData();
} else {
count = 0;
Toast.makeText(getApplicationContext(), "请检查您的网络",
Toast.LENGTH_LONG).show();
}
}
@Override
public void onSuccess(String response) {
super.onSuccess(response);
if (response == null || response.equals("")) {
Toast.makeText(ExerciseActivity.this, "服务器在打盹",
Toast.LENGTH_SHORT).show();
} else {
JSONObject object = JSONObject.parseObject(response);
JSONArray top = object.getJSONArray("records");
String result = object.getString("result");
if (top == null || top.equals("") || result.equals("4")) {
Toast.makeText(ExerciseActivity.this, "服务器在打盹", Toast.LENGTH_SHORT).show();
} else if (result.equals("0")) {
data = (ArrayList<Exercise>) JSONArray.parseArray(
top.toJSONString(), Exercise.class);
adapter = new ExerciseAdapter(ExerciseActivity.this,
data);
mListView.setAdapter(adapter);
mListView.onRefreshComplete();
a = 2;
} else if (result.equals("30")) {
Toast.makeText(ExerciseActivity.this, "该景区暂无活动信息",
Toast.LENGTH_SHORT).show();
}
}
hideProgress();
}
});
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
Intent i = new Intent();
i.putExtra("id", data.get(arg2 - 1).getId());
i.putExtra("photoId", data.get(arg2 - 1).getPhotoid());
i.setClass(ExerciseActivity.this, ExerciseDetailActivity.class);
startActivity(i);
}
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
getData();
}
@Override
public void onLastItemVisible() {
showProgress();
mListView.setSelected(true);
RequestParams params = new RequestParams(); // 绑定参数
params.put("pages", "" + a);
if (UesrInfo.areaType.equals("2")) {
params.put("area", UesrInfo.area);
} else {
params.put("area", UesrInfo.sceneId);
}
params.put("areaType", UesrInfo.areaType);
if (is) {
is = false;
HttpUtil.post(path, params, new AsyncHttpResponseHandler() {
@Override
public void onFailure(Throwable arg0, String arg1) {
super.onFailure(arg0, arg1);
hideProgress();
Toast.makeText(getApplicationContext(), "请检查您的网络",
Toast.LENGTH_LONG).show();
is = true;
FileTools.writeLog("exercise.txt", "活动列表第" + a
+ "页错误-------Throwable:" + arg0 + "------" + arg1);
}
@Override
public void onSuccess(String response) {
super.onSuccess(response);
if (response == null || response.equals("")) {
Toast.makeText(ExerciseActivity.this, "服务器在打盹",
Toast.LENGTH_LONG).show();
} else {
JSONObject object = JSONObject.parseObject(response);
String result = object.getString("result");
JSONArray top = object.getJSONArray("records");
if (top == null || top.equals("") || result.equals("4")) {
Toast.makeText(ExerciseActivity.this, "服务器在打盹",
Toast.LENGTH_LONG).show();
} else if (result.equals("30")) {
Toast.makeText(ExerciseActivity.this, "已是最后一页",
Toast.LENGTH_LONG).show();
} else {
ArrayList<Exercise> list = new ArrayList<Exercise>();
list = (ArrayList<Exercise>) JSONArray.parseArray(
top.toJSONString(), Exercise.class);
for (Exercise exercise : list) {
data.add(exercise);
}
adapter.setData(data);
adapter.notifyDataSetChanged();
a++;
}
}
hideProgress();
is = true;
}
});
}
}
}
| UTF-8 | Java | 6,966 | java | ExerciseActivity.java | Java | [] | null | [] | package com.jiagu.mobile.tourguide.activities;
import java.util.ArrayList;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Toast;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnLastItemVisibleListener;
import com.handmark.pulltorefresh.library.PullToRefreshBase.OnRefreshListener;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.jiagu.mobile.tourguide.R;
import com.jiagu.mobile.tourguide.activities.bases.TitleDrawerActivity;
import com.jiagu.mobile.tourguide.adapter.ExerciseAdapter;
import com.jiagu.mobile.tourguide.bean.Exercise;
import com.jiagu.mobile.tourguide.utils.FileTools;
import com.jiagu.mobile.tourguide.utils.HttpUtil;
import com.jiagu.mobile.tourguide.utils.Path;
import com.jiagu.mobile.tourguide.utils.UesrInfo;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
//近期活动
public class ExerciseActivity extends TitleDrawerActivity implements OnClickListener, OnItemClickListener, OnRefreshListener<ListView>,OnLastItemVisibleListener {
private ArrayList<Exercise> data;
private PullToRefreshListView mListView;
private String path = Path.SERVER_ADRESS + "scenicPlanning/scenicPlanningList.htm";
private int a = 2;
private ExerciseAdapter adapter;
private static int count = 0;
private boolean is = true;
@Override
@SuppressLint("InflateParams")
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_exercise);
ImageView image = (ImageView) findViewById(R.id.activity_exercise_image_return);
mListView = (PullToRefreshListView) findViewById(R.id.list_indent_activity);
image.setOnClickListener(this);
getData();
mListView.setOnItemClickListener(this);
mListView.setOnRefreshListener(this);
mListView.setOnLastItemVisibleListener(this);
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
// setAppName(UesrInfo.area);
appName.setText(UesrInfo.area + "手机导游");
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.activity_exercise_image_return:
onBackPressed();
break;
}
}
// 下载数据
private void getData() {
showProgress();
RequestParams params = new RequestParams();
params.put("pages", "" + 1);
if (UesrInfo.areaType.equals("2")) {
params.put("area", UesrInfo.area);
} else {
params.put("area", UesrInfo.sceneId);
}
params.put("areaType", UesrInfo.areaType);
HttpUtil.post(path, params, new AsyncHttpResponseHandler() {
@Override
public void onFailure(Throwable arg0, String arg1) {
super.onFailure(arg0, arg1);
hideProgress();
count++;
if (count < 3) {
FileTools.writeLog("exercise.txt", "活动列表第1页错误----count:"
+ count + "---Throwable:" + arg0 + "------" + arg1);
getData();
} else {
count = 0;
Toast.makeText(getApplicationContext(), "请检查您的网络",
Toast.LENGTH_LONG).show();
}
}
@Override
public void onSuccess(String response) {
super.onSuccess(response);
if (response == null || response.equals("")) {
Toast.makeText(ExerciseActivity.this, "服务器在打盹",
Toast.LENGTH_SHORT).show();
} else {
JSONObject object = JSONObject.parseObject(response);
JSONArray top = object.getJSONArray("records");
String result = object.getString("result");
if (top == null || top.equals("") || result.equals("4")) {
Toast.makeText(ExerciseActivity.this, "服务器在打盹", Toast.LENGTH_SHORT).show();
} else if (result.equals("0")) {
data = (ArrayList<Exercise>) JSONArray.parseArray(
top.toJSONString(), Exercise.class);
adapter = new ExerciseAdapter(ExerciseActivity.this,
data);
mListView.setAdapter(adapter);
mListView.onRefreshComplete();
a = 2;
} else if (result.equals("30")) {
Toast.makeText(ExerciseActivity.this, "该景区暂无活动信息",
Toast.LENGTH_SHORT).show();
}
}
hideProgress();
}
});
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
Intent i = new Intent();
i.putExtra("id", data.get(arg2 - 1).getId());
i.putExtra("photoId", data.get(arg2 - 1).getPhotoid());
i.setClass(ExerciseActivity.this, ExerciseDetailActivity.class);
startActivity(i);
}
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
getData();
}
@Override
public void onLastItemVisible() {
showProgress();
mListView.setSelected(true);
RequestParams params = new RequestParams(); // 绑定参数
params.put("pages", "" + a);
if (UesrInfo.areaType.equals("2")) {
params.put("area", UesrInfo.area);
} else {
params.put("area", UesrInfo.sceneId);
}
params.put("areaType", UesrInfo.areaType);
if (is) {
is = false;
HttpUtil.post(path, params, new AsyncHttpResponseHandler() {
@Override
public void onFailure(Throwable arg0, String arg1) {
super.onFailure(arg0, arg1);
hideProgress();
Toast.makeText(getApplicationContext(), "请检查您的网络",
Toast.LENGTH_LONG).show();
is = true;
FileTools.writeLog("exercise.txt", "活动列表第" + a
+ "页错误-------Throwable:" + arg0 + "------" + arg1);
}
@Override
public void onSuccess(String response) {
super.onSuccess(response);
if (response == null || response.equals("")) {
Toast.makeText(ExerciseActivity.this, "服务器在打盹",
Toast.LENGTH_LONG).show();
} else {
JSONObject object = JSONObject.parseObject(response);
String result = object.getString("result");
JSONArray top = object.getJSONArray("records");
if (top == null || top.equals("") || result.equals("4")) {
Toast.makeText(ExerciseActivity.this, "服务器在打盹",
Toast.LENGTH_LONG).show();
} else if (result.equals("30")) {
Toast.makeText(ExerciseActivity.this, "已是最后一页",
Toast.LENGTH_LONG).show();
} else {
ArrayList<Exercise> list = new ArrayList<Exercise>();
list = (ArrayList<Exercise>) JSONArray.parseArray(
top.toJSONString(), Exercise.class);
for (Exercise exercise : list) {
data.add(exercise);
}
adapter.setData(data);
adapter.notifyDataSetChanged();
a++;
}
}
hideProgress();
is = true;
}
});
}
}
}
| 6,966 | 0.695115 | 0.689818 | 211 | 31.20853 | 23.394497 | 162 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.663507 | false | false | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.