Documente Academic
Documente Profesional
Documente Cultură
package veridis.biometric.samples.util;
import
import
import
import
import
java.awt.Component;
java.io.File;
java.io.IOException;
java.io.PrintStream;
java.util.Scanner;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import veridis.biometric.BiometricSDK;
import veridis.biometric.BiometricException.LicenseException;
/**
* Helper class to license the SDK.
* <p>
* If you are using the FREE version of this SDK, there is no need to
worry about licensing.
* Otherwise, licensing would usually take a single line:
* <p>
* {@code BiometricSDK.installLicense("MY LICENSE KEY");}
* <p>
* Unfortunately, the samples don't know whenever you are using the
FREE license or what is you license key, . It's needed to show a
dialog, test if the license entered is OK, try again, etc. That's what
this class does!
*/
public class LicenseHelper {
/**
* Asks the license key to the user, and use it to start the
SDK
* If you plan to use the FREE edition, calling this method is
not required at all.
* Also, this method can be replaced by a single line of code:
BiometricSDK.installLicense("MY LICENSE KEY");
*/
public static void installLicense() {
installLicense(null);
}
/**
* Asks the license key to the user, and use it to start the
SDK.
*
* If you plan to use the FREE edition, calling this method is
not required at all.
* Also, this method can be replaced by a single line of code:
BiometricSDK.installLicense("MY LICENSE KEY");
* @param parent Parent component, which will be blocked by a
modal dialog.
*/
public static void installLicense(Component parent) {
System.out.println(BiometricSDK.getVersion());
File licenseFile = new File("vrlicense");
try {
String licenseText="";
Scanner s = new Scanner(licenseFile);
while (s.hasNextLine())
licenseText += s.nextLine() + "\n";
BiometricSDK.installLicense(licenseText);
return; //SUCESS!
} catch (Exception e) {
//No conseguiu utilizar uma licena salva
anteriormente.
licensing.
while (true) {
dialog.setVisible(true);
if (freeOptionPane.getValue() != OK_OPTION) {
System.out.println("Licensed as " +
BiometricSDK.getLicense().getKey());
return; //Self-licensed as FREE
}
try {
BiometricSDK.installLicense(freeOptionPane.getInputValue().toString())
;
} catch (LicenseException e) {
JOptionPane.showMessageDialog(parent,
"Licensing failed:\n" + e, "Licensing failed",
JOptionPane.ERROR_MESSAGE);
continue;
}
//Licenciado com sucesso
System.out.println("Licensed as " +
BiometricSDK.getLicense().getKey());
//Salva o texto da licena para a prxima
vez...
try {
new
PrintStream(licenseFile).print(BiometricSDK.getLicense().getFullText()
);
} catch (IOException e) { /*Never mind...*/ }
//Sucesso!
return;
}
}
Cdigo 2
package veridis.biometric.samples.applet;
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
import
java.awt.BorderLayout;
java.awt.Dimension;
java.awt.Graphics2D;
java.awt.image.BufferedImage;
java.io.ByteArrayOutputStream;
java.io.CharArrayWriter;
java.io.InputStream;
java.io.PrintWriter;
java.net.URL;
java.net.URLConnection;
java.net.URLStreamHandler;
java.security.AccessController;
java.security.PrivilegedAction;
java.text.SimpleDateFormat;
java.util.ArrayList;
java.util.Calendar;
java.util.List;
import
import
import
import
javax.imageio.ImageIO;
javax.swing.JApplet;
javax.swing.JOptionPane;
javax.swing.SwingUtilities;
import
import
import
import
import
import
import
import
veridis.biometric.BiometricException;
veridis.biometric.BiometricIdentification;
veridis.biometric.BiometricImage;
veridis.biometric.BiometricSDK;
veridis.biometric.BiometricScanner;
veridis.biometric.BiometricTemplate;
veridis.biometric.CaptureEventListener;
veridis.biometric.JBiometricPanel;
/**
* <p>
* Essa classe é usada para fornecer acesso a métodos de
captura
* /extração / verificação.
* </p>
*
*
* Parmetros:
*
* <ul>
* <li><i>Callbacks:</i></li>
* <li><b>onLoaded</b> - Esse callback chamado assim que o applet
totalmente carregado.</li>
* <li><b>onInitialization</b> - Esse callback chamado aps o
carregamento do applet, aps o licenciamento ser feito com
sucesso.</li>
//============================================================
//===================== APPLET LIFECICLE =====================
//============================================================
debug("Failed to install the license \"" + licenseKey + "\":" +
e.toString())
@Override
public void init() {
Thread.setDefaultUncaughtExceptionHandler(new
Thread.UncaughtExceptionHandler() {
public void uncaughtException(Thread t,
Throwable e) {
e.printStackTrace(System.err);
CharArrayWriter exceptionString = new
CharArrayWriter();
PrintWriter printWriter = new
PrintWriter(exceptionString);
e.printStackTrace(printWriter);
JOptionPane.showMessageDialog(getContentPane(),
exceptionString.toString(), "Uncaught Exception",
JOptionPane.ERROR_MESSAGE);
}
});
debug("Applet.init()");
super.init();
setPreferredSize(new Dimension(200, 250));
getContentPane().setLayout(new BorderLayout());
getContentPane().add(fingerprintViewPanel,
BorderLayout.CENTER);
try {
InputStream in =
AppletIdentificationSample.class.getResourceAsStream("veridislogo.png"
);
if (in == null)
debug("Can't find resource
veridislogo.png");
else
logo = ImageIO.read(in);
} catch (Exception e) {
debug("Failed to load veridislogo.png", e);
}
try {
this.getClass().getClassLoader().loadClass("netscape.javascript.JSObje
ct");
} catch (ClassNotFoundException e) {
debug("ClassNotFoundException: " +
e.getMessage());
}
callback("onInit");
}
@Override
public void start() {
debug("Applet.start()");
//Reset the UI
resetTemplateData();
};
stopCapture();
callback("onStop");
super.stop();
@Override
public void destroy() {
debug("Applet.destroy()");
stopCapture();
callback("onDestroy");
super.destroy();
int destWidth
= (int)
destWidth;
width =
if (destWidth!=img.getWidth() ||
fingerprintViewPanel.setImage(logo);
debug("Applet.resetTemplateData()");
}
/**
* Returns a {@link String} containing debug messages.<br/>
* <br/>
* Retorna uma {@link String} contendo mensagens de debug.
*
* @return The debug messages
*/
public String getDebug() {
return this.logBuffer.toString();
}
//==========================================================
//===================== DEBUG MESSAGES =====================
//==========================================================
private StringBuffer logBuffer = new StringBuffer();
private int identificationScore;
private int identificationIndex;
private void debug(String m) {
debug(m, null);
}
private void debug(String m, Throwable t) {
SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy
HH:mm:ss.SSS");
this.logBuffer
.append(f.format(Calendar.getInstance().getTime
()))
.append(" : ")
.append(m)
.append("\n");
System.err.println(m);
if (t != null) {
CharArrayWriter exceptionString = new
CharArrayWriter();
PrintWriter printWriter = new
PrintWriter(exceptionString);
t.printStackTrace(printWriter);
this.logBuffer.append(exceptionString.toString());
t.printStackTrace(System.err);
}
}
callback("onDebug");
===
//=============================================================
}
if (evt == CaptureEventType.REMOVED) {
debug(bioScanner + ": Finger removed");
callback("onRemoved");
}
if (evt == CaptureEventType.IMAGE_CAPTURED) {
debug(bioScanner + ": Image captured");
BiometricTemplate template = new
BiometricTemplate(img);
boolean identifyTemplates
=
Boolean.parseBoolean( getParameter("identifyTemplates"
, "false") );
boolean verifyTemplates
=
Boolean.parseBoolean( getParameter("verifyTemplates"
, "false") );
boolean captureFailed = false;
if (verifyTemplates) {
int
verifyMinThreshold =
Integer.parseInt
( getParameter("verifyMinThreshold", "20") );
for (BiometricTemplate tpt :
allTemplates) {
int score = tpt.match(template);
debug("Verifing templates: score
= " + score + "; min = " + verifyMinThreshold);
if (score < verifyMinThreshold)
captureFailed = true;
}
} else {
if(identifyTemplates){
int
identifyThreshold =
Integer.parseInt
( getParameter("identifyThreshold", "25") );
captureFailed = false;
BiometricIdentification bioId =
new BiometricIdentification(template);
identificationScore = -1;
identificationIndex = -1;
for (int ind = 0;ind <
allTemplates.size();ind++){
BiometricTemplate tpt =
allTemplates.get(ind);
int score =
tpt.match(template);
if (score >=
identifyThreshold){
debug("Identified: score = " + score + "; min = " +
identifyThreshold+";index="+(ind+1));
identificationScore = score;
identificationIndex = ind+1; //primeiro tem
true;
captureFailed =
}
}
}
fingerprintViewPanel.setImage(img);
lastImage = img;
callback("onBadVerify");
}
===
//=============================================================
} catch (Exception e) {
e.printStackTrace();
debug(): If the onDebug event is buggy, it will loop.
}
}
}
return null;
}
});
//Can't use
}
/**
* Returns an Applet parameter. If the parameter is not
defines,
* a default value will be used.
* @param name The parameter name.
* @param def The parameter's default value.
*/
private String getParameter(String name, String def) {
String r = getParameter(name);
return r!=null ? r : def;
}
}
Cdigo 3
import
import
import
import
import
import
import
import
import
java.io.IOException;
java.net.MalformedURLException;
java.net.URL;
java.sql.Connection;
java.sql.DriverManager;
java.sql.ResultSet;
java.sql.SQLException;
java.sql.Statement;
java.util.Scanner;
import javax.sound.sampled.AudioFormat.Encoding;
import
import
import
import
veridis.biometric.BiometricIdentification;
veridis.biometric.BiometricSDK;
veridis.biometric.BiometricTemplate;
veridis.biometric.samples.applet.Base64;
import veridis.biometric.BiometricImage;
import veridis.biometric.BiometricTemplate;
import veridis.biometric.BiometricException.FeatureNotAvailableForFreeException;
import veridis.biometric.BiometricException.FeatureNotLicensedException;
import
veridis.biometric.BiometricException.UnsupportedBiometricModalityException;
import veridis.sample.util.ButtonLayout;
import org.json.*;
public class dbAccess {
private static final BiometricTemplate AddTemplate = null;
protected static Connection con = null;
protected static Statement stm = null;
protected static int minimumThreshold = 40;
public static Object Console;
public static boolean AddTemplate(BiometricTemplate template) throws
SQLException {
String str = "http://192.168.51.199/ponto/index.php/JSON/listaTemplate/";
try {
URL url = new URL(str);
Scanner scan;
try {
scan = new Scanner(url.openStream());
String str2 = new String();
while (scan.hasNext()) {
str2 += scan.nextLine();
}
scan.close();
JSONObject obj = new JSONObject(str2);
JSONArray elenco = obj.getJSONArray("usuarios");
for (int i = 0; i < elenco.length(); i++) {
String[] tmp = elenco.getString(i).split("-");
BiometricTemplate tempBD;
try {
tempBD = new BiometricTemplate((Base64.decode(tmp[1])));
System.out.println(template.getData());
System.out.println(Base64.decode(tmp[1]));
Object bytes = template;
System.out.println("Text [Byte Format] : " + bytes);
if (tempBD.match(tempBD) > minimumThreshold) {
System.out.println("Achou");
return true;
}
} catch (Exception e) {
System.out.println(e.getLocalizedMessage());
return false;
}
//System.out.println(spl[0]);
//usersmodel.addElement(elenco.getString(i));
}
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
/*if(res.next()){
try{
System.out.println(e.getLocalizedMessage());
return -1;
}*/
System.exit(0);
return true;
}
/*Function to get Template from database*/
public static BiometricTemplate getTemplate(BiometricTemplate template, String
id) throws SQLException {
if (con == null) {
connectToDB();
}
if (stm == null) {
stm = con.createStatement();
}
String query = "SELECT * FROM usuarios where id = \"" + id + "\"";
ResultSet res = stm.executeQuery(query);
if (res.next()) {
try {
BiometricTemplate tempBD = new
BiometricTemplate((Base64.decode(res.getString("Template"))));
return tempBD;
} catch (Exception e) {
System.out.println(e.getLocalizedMessage());
return null;
}
}
return null;
}
return 0;
userName = "root";
password = "12rafael34";
url = "jdbc:mysql://192.168.51.199//";
dbName = "survey";
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection(url + dbName, userName, password);
stm = con.createStatement();
stm.executeUpdate("DROP TABLE IF EXISTS template");
Cdigo 4
1.
import com.nitgen.SDK.BSP.NBioBSPJNI;
2.
import com.nitgen.SDK.BSP.NBioBSPJNI.IndexSearch;
3.
import java.util.List;
4.
import modelo.Digital;
5.
/**
6.
7.
* @author Ulisses
8.
*/
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
public LeitorBiometrico() {
21.
22.
23.
if (CheckError()) {
24.
return;
25.
26.
27.
28.
if (CheckError()){
29.
return;
30.
31.
32.
bsp.OpenDevice();
33.
if (CheckError()) {
34.
return;
35.
36.
37.
38.
39.
40.
41.
42.
43.
IndexSearchEngine.dispose();
44.
IndexSearchEngine = null;
45.
46.
47.
48.
if (bsp != null) {
bsp.CloseDevice();
49.
bsp.dispose();
50.
bsp = null;
51.
52.
53.
54.
if (textSavedFIRBD != null) {
55.
textSavedFIRBD = null;
56.
57.
58.
if (textSavedFIRMC != null) {
59.
textSavedFIRMC = null;
60.
61.
62.
if (hFIR != null) {
63.
hFIR.dispose();
64.
hFIR = null;
65.
66.
67.
if (inputFIRBD != null) {
68.
inputFIRBD = null;
69.
70.
71.
if (inputFIRMC != null) {
72.
inputFIRMC = null;
73.
74.
75.
if (sampleInfo != null) {
76.
sampleInfo = null;
77.
78.
79.
80.
81.
82.
if (bsp.IsErrorOccured()) {
83.
84.
return true;
85.
86.
87.
88.
return false;
}
89.
90.
91.
92.
dispose();
}
93.
94.
95.
96.
97.
98.
99.
100.
101.
System.out.println(lista.get(i).getIddigital() +"
"+lista.get(i).getBiometria());
102.
textSavedFIRBD.TextFIR = lista.get(i).getBiometria();
103.
inputFIRBD.SetTextFIR(textSavedFIRBD);
104.
IndexSearchEngine.AddFIR(inputFIRBD,
lista.get(i).getIdfuncionario().getIdfuncionario(), sampleInfo);
105.
106.
107.
108.
109.
110.
111.
textSavedFIRMC.TextFIR = digitalMicro;
112.
113.
inputFIRMC.SetTextFIR(textSavedFIRMC);
114.
115.
NBioBSPJNI.IndexSearch.FP_INFO fpInfo =
IndexSearchEngine.new FP_INFO();
116.
117.
IndexSearchEngine.Identify(inputFIRMC, 5, fpInfo);
118.
119.
120.
return fpInfo.ID;
121.
122.
123.
124.
125.
Cdigo 5
Na parte web... utilizei a prpria interface para cadastramento dos funcionrio que facilitava
muito a vida...
1.
package controle.digital;
2.
3.
4.
import com.nitgen.SDK.BSP.NBioBSPJNI;
5.
/**
6.
7.
* @author Ulisses
8.
*/
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
public LeitorBiometrico() {
19.
20.
21.
if (CheckError()) {
22.
23.
return;
}
24.
25.
26.
if (CheckError()){
27.
28.
return;
}
29.
30.
bsp.OpenDevice();
31.
if (CheckError()) {
32.
33.
34.
return;
}
35.
36.
37.
38.
39.
40.
41.
IndexSearchEngine.dispose();
42.
IndexSearchEngine = null;
43.
44.
45.
if (bsp != null) {
46.
bsp.CloseDevice();
47.
bsp.dispose();
48.
bsp = null;
49.
50.
51.
52.
if (textSavedFIR != null) {
53.
textSavedFIR = null;
54.
55.
56.
if (hFIR != null) {
57.
hFIR.dispose();
58.
hFIR = null;
59.
60.
61.
if (inputFIR != null) {
62.
inputFIR = null;
63.
64.
65.
if (sampleInfo != null) {
66.
sampleInfo = null;
67.
68.
69.
70.
71.
72.
if (bsp.IsErrorOccured()) {
73.
74.
return true;
75.
76.
77.
78.
return false;
}
79.
80.
81.
82.
dispose();
}
83.
84.
85.
86.
87.
//Registrar
88.
89.
bsp.Enroll(hFIR, null);
90.
91.
92.
if (bsp.IsErrorOccured() == false) {
93.
94.
bsp.GetTextFIRFromHandle(hFIR, textSavedFIR);
95.
96.
Closing();
97.
return sDigital;
98.
99.
} else {
Closing();
100.
return null;
101.
102.
103.
104.
105.
106.
107.
108.
textSavedFIR.TextFIR = digital;
109.
110.
inputFIR.SetTextFIR(textSavedFIR);
111.
112.
113.
114.
if (CheckError()) {
115.
Closing();
116.
117.
118.
119.
120.
121.
122.
123.
textSavedFIR.TextFIR = digital;
124.
125.
inputFIR.SetTextFIR(textSavedFIR);
126.
127.
128.
129.
if (CheckError()) {
130.
Closing();
131.
return false;
132.
133.
134.
135.
bsp.Capture(hCapture);
136.
if (CheckError()) {
137.
return false;
138.
139.
NBioBSPJNI.INPUT_FIR inputFIR1;
140.
141.
inputFIR1.SetFIRHandle(hCapture);
142.
NBioBSPJNI.IndexSearch.FP_INFO fpInfo =
IndexSearchEngine.new FP_INFO();
143.
144.
145.
IndexSearchEngine.Identify(inputFIR1, 5, fpInfo);
146.
if (CheckError()) {
147.
Closing();
148.
return false;
149.
} else {
150.
Closing();
151.
return true;
152.
153.
154.
155.
Cdigo 6
Para realizar a comparao eu usava este cdigo na parte do servidor....
1.
package classes;
2.
3.
import java.text.SimpleDateFormat;
4.
import java.util.ArrayList;
5.
import java.util.Calendar;
6.
import java.util.GregorianCalendar;
7.
import java.util.List;
8.
import java.util.logging.Level;
9.
import java.util.logging.Logger;
10.
11.
import javax.swing.table.DefaultTableModel;
12.
13.
14.
15.
16.
char op;
17.
18.
19.
20.
21.
/**
22.
23.
*/
24.
25.
26.
27.
initComponents();
//
atualizarGrade();
}
28.
29.
30.
/**
31.
* This method is called from within the constructor to initialize the for
m.
32.
33.
34.
*/
35.
@SuppressWarnings("unchecked"<img src="http://javafree.uol.com.b
r/forum/images/smiles/icon_wink.gif">
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_
ON_CLOSE);
56.
57.
58.
jpPesquisa.setLayout(new java.awt.BorderLayout());
59.
60.
jlCodigo.setText("Cdigo:"<img src="http://javafree.uol.com.br/for
um/images/smiles/icon_wink.gif">;
61.
62.
jlDescricao.setText("Descrio:"<img src="http://javafree.uol.com.
br/forum/images/smiles/icon_wink.gif">;
63.
64.
btPesquisar.setText("Buscar"<img src="http://javafree.uol.com.br/f
orum/images/smiles/icon_wink.gif">;
65.
btPesquisar.addActionListener(new java.awt.event.ActionListener()
{
66.
67.
68.
69.
btPesquisarActionPerformed(evt);
}
});
70.
71.
72.
jpBusca.setLayout(jpBuscaLayout);
73.
jpBuscaLayout.setHorizontalGroup(
74.
jpBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Ali
gnment.LEADING)
75.
.addGroup(jpBuscaLayout.createSequentialGroup()
76.
.addContainerGap()
77.
.addComponent(jlCodigo)
78.
79.
.addComponent(tfcodigo, javax.swing.GroupLayout.PREFERRE
D_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
80.
81.
.addComponent(jlDescricao)
82.
83.
.addComponent(tfdescricao, javax.swing.GroupLayout.DEFAU
LT_SIZE, 437, Short.MAX_VALUE)
84.
85.
.addComponent(btPesquisar)
86.
.addContainerGap())
87.
);
88.
jpBuscaLayout.setVerticalGroup(
89.
jpBuscaLayout.createParallelGroup(javax.swing.GroupLayout.Ali
gnment.LEADING)
90.
.addGroup(jpBuscaLayout.createSequentialGroup()
91.
92.
.addGroup(jpBuscaLayout.createParallelGroup(javax.swing.Gr
oupLayout.Alignment.BASELINE)
93.
.addComponent(jlCodigo)
94.
.addComponent(tfcodigo, javax.swing.GroupLayout.PREFE
RRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLay
out.PREFERRED_SIZE)
95.
.addComponent(jlDescricao)
96.
.addComponent(tfdescricao, javax.swing.GroupLayout.PRE
FERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupL
ayout.PREFERRED_SIZE)
97.
98.
.addComponent(btPesquisar))
.addContainerGap())
99.
);
100.
101.
jpPesquisa.add(jpBusca, java.awt.BorderLayout.CENTER);
102.
103.
jpBotao.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.R
IGHT));
104.
105.
btSalvar.setText("Salvar"<img src="http://javafree.uol.com.br/foru
m/images/smiles/icon_wink.gif">;
106.
btSalvar.addActionListener(new java.awt.event.ActionListener() {
107.
108.
109.
btSalvarActionPerformed(evt);
}
110.
});
111.
jpBotao.add(btSalvar);
112.
113.
jButton2.setText("Alterar"<img src="http://javafree.uol.com.br/for
um/images/smiles/icon_wink.gif">;
114.
jpBotao.add(jButton2);
115.
116.
jButton3.setText("Excluir"<img src="http://javafree.uol.com.br/for
um/images/smiles/icon_wink.gif">;
117.
jpBotao.add(jButton3);
118.
119.
jButton4.setText("Voltar"<img src="http://javafree.uol.com.br/foru
m/images/smiles/icon_wink.gif">;
120.
jpBotao.add(jButton4);
121.
122.
jpPesquisa.add(jpBotao, java.awt.BorderLayout.PAGE_START);
123.
124.
getContentPane().add(jpPesquisa, java.awt.BorderLayout.PAGE_ST
ART);
125.
126.
jpTabela.setLayout(new java.awt.BorderLayout());
127.
128.
129.
130.
tbHorario.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{"Segunda-feira", "", null, null, null, null, null, null, null, null,
{"Tera-feira", "", null, null, null, null, null, null, null, null, nul
{"Quarta-feira", "", null, null, null, null, null, null, null, null, n
{"Quinta-feira", "", null, null, null, null, null, null, null, null, nu
134.
{"Sexta-feira", "", null, null, null, null, null, null, null, null, nul
{"Sbado", "", null, null, null, null, null, null, null, null, null, n
{null, "", null, null, null, null, null, null, null, null, null, null, nu
ll, null}
137.
},
138.
new String [] {
139.
}
){
Class[] types = new Class [] {
143.
};
145.
146.
147.
148.
149.
150.
tbHorario.getTableHeader().setResizingAllowed(false);
151.
tbHorario.getTableHeader().setReorderingAllowed(false);
152.
jScrollPane3.setViewportView(tbHorario);
153.
tbHorario.getColumnModel().getColumn(0).setResizable(false);
154.
tbHorario.getColumnModel().getColumn(0).setPreferredWidth(250)
;
155.
156.
jpTabela.add(jScrollPane3, java.awt.BorderLayout.CENTER);
157.
158.
getContentPane().add(jpTabela, java.awt.BorderLayout.CENTER);
159.
160.
().getScreenSize();
161.
setBounds((screenSize.width-757)/2, (screenSize.height-292)/2, 7
57, 292);
162.
}// </editor-fold>
163.
164.
vt) {
165.
166.
167.
168.
calen.setVisible(true);
169.
170.
if (calen.getpessoaselecionada() != null) {
171.
tfcodigo.setText(String.valueOf(calen.getpessoaselecionada().ge
tCodigo()));
172.
tfdescricao.setText(String.valueOf(calen.getpessoaselecionada().
getNome()));
173.
174.
try {
175.
atualizarGrade();
176.
177.
Logger.getLogger(JFHorarioProfissional.class.getName()).log(Lev
}
}
180.
181.
{
182.
183.
184.
185.
ada, ou nao;
186.
188.
189.
if (op == 'c') {
190.
try {
191.
192.
193.
194.
rc="http://javafree.uol.com.br/forum/images/smiles/icon_wink.gif"> {
195.
196.
hora.setCodigohorariopadrao(Integer.parseInt(tfcodig
o.getText()));
197.
hora.setDiasemana(i);
198.
hora.setEntrada1(tbHorario.getColumnName(j));
199.
dao.incluir(hora);
200.
201.
202.
}
}
203.
o"<img src="http://javafree.uol.com.br/forum/images/smiles/icon_wink.gif"
>;
204.
205.
this.dispose();
} catch (Exception ex) {
206.
Logger.getLogger(JFHorarioProfissional.class.getName()).log(
208.
} else {
209.
try {
210.
211.
dao.excluir(Integer.parseInt(tfcodigo.getText()));
212.
newLhorario.clear();
213.
214.
215.
rc="http://javafree.uol.com.br/forum/images/smiles/icon_wink.gif"> {
216.
217.
hora.setCodigohorariopadrao(Integer.parseInt(tfcodig
o.getText()));
218.
hora.setDiasemana(i);
219.
hora.setEntrada1(tbHorario.getColumnName(j));
220.
dao.incluir(hora);
221.
222.
223.
224.
o"<img src="http://javafree.uol.com.br/forum/images/smiles/icon_wink.gif"
>;
225.
this.dispose();
226.
227.
Logger.getLogger(JFHorarioProfissional.class.getName()).log(
229.
230.
231.
232.
233.
234.
235.
Horario calendario;
236.
237.
238.
.getText()));
239.
240.
241.
242.
243.
244.
245.
int contador = 0;
246.
247.
gc.setTime(calendario.getEntrada1());
248.
gate.setTime(calendario.getSaida1());
249.
cgc.setTime(calendario.getEntrada2());
250.
cgate.setTime(calendario.getSaida2());
251.
252.
253.
//
254.
cgc.add(Calendar.MINUTE, 15);
255.
contador = i;
256.
257.
258.
261.
262.
if (i == 1) {
263.
vetor<i> = formatar.format(gc.getTime());
264.
gc.add(Calendar.MINUTE, 15);
265.
266.
vetor<i> = formatar.format(gc.getTime());
267.
gc.add(Calendar.MINUTE, 15);
268.
269.
}
}
270.
271.
272.
273.
274.
275.
276.
277.
278.
} else if (i == 2 && j == 0) {
279.
semana<i>[j] = "Tera-Feira";
280.
} else if (i == 3 && j == 0) {
281.
semana<i>[j] = "Quarta-Feira";
282.
} else if (i == 4 && j == 0) {
283.
semana<i>[j] = "Quinta-Feira";
284.
} else if (i == 5 && j == 0) {
285.
semana<i>[j] = "Sexta-Feira";
286.
} else if (i == 6 && j == 0) {
287.
semana<i>[j] = "Sbado";
288.
} else {
289.
semana<i>[j] = "D";
290.
291.
292.
}
}
293.
294.
//atualizar as colunas da
295.
try {
296.
297.
298.
299.
op = 'c';
} else {
for (int i = 0; i < Lhorario.size(); i++) {//preenche os horario
s marcados.
304.
305.
if (formatar.format(Lhorario.get(i).getEntrada1()).equals
(tbHorario.getColumnName(j)) &&
306.
formatar.format(Lhorario.get(i).getSaida1()).equal
s(tbHorario.getColumnName(j)) &&
307.
formatar.format(Lhorario.get(i).getEntrada2()).equ
als(tbHorario.getColumnName(j)) &&
308.
formatar.format(Lhorario.get(i).getSaida2()).equal
s(tbHorario.getColumnName(j))) {
309.
tbHorario.setValueAt(true, Lhorario.get(i).getDiasema
na(), j);
310.
311.
312.
}
}
313.
op = 'a';
314.
315.
} catch (Exception e) {
316.
e.printStackTrace();
317.
AGE);
318.
319.
320.
321.
322.
/**
323.
324.
*/
325.
326.
327.
ng/lookandfeel/plaf.html
330.
*/
331.
try {
332.
UIManager.getInstalledLookAndFeels()) {
333.
if ("Nimbus".equals(info.getName())) {
334.
javax.swing.UIManager.setLookAndFeel(info.getClassName
());
335.
break;
336.
337.
338.
}
} catch (ClassNotFoundException ex) {
339.
java.util.logging.Logger.getLogger(JFHorarioProfissional.class.get
341.
java.util.logging.Logger.getLogger(JFHorarioProfissional.class.get
343.
java.util.logging.Logger.getLogger(JFHorarioProfissional.class.get
345.
java.util.logging.Logger.getLogger(JFHorarioProfissional.class.get
347.
//</editor-fold>
348.
349.
350.
java.awt.EventQueue.invokeLater(new Runnable() {
351.
352.
try {
353.
new JFHorarioProfissional().setVisible(true);
354.
355.
Logger.getLogger(JFHorarioProfissional.class.getName()).lo
357.
358.
});
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
Cdigo 7
Cdigo 8
Cdigo 9
Cdigo 10
Cdigo 11
Cdigo 12
Cdigo 13
Cdigo 14
Cdigo 15
Cdigo 16
Cdigo 17