Repository navigation
Expand file tree
/
Copy pathTela_Principal.java
More file actions
347 lines (288 loc) · 15.4 KB
/
Copy pathTela_Principal.java
File metadata and controls
347 lines (288 loc) · 15.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
/*
* 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 view;
import java.text.DateFormat;
import java.util.Date;
import javax.swing.JOptionPane;
/**
*
* @author Dino
*/
public class Tela_Principal extends javax.swing.JFrame {
/**
* Creates new form Tela_Principal
*/
public Tela_Principal() {
initComponents();
}
/**
* 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() {
jDesktopPane1 = new javax.swing.JDesktopPane();
jLabel1 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
lblUsuario = new javax.swing.JLabel();
lblData = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
menuArq = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
menuMod = new javax.swing.JMenu();
smenuResult = new javax.swing.JMenuItem();
smenuDesp = new javax.swing.JMenuItem();
smenuComp = new javax.swing.JMenuItem();
smenuProd = new javax.swing.JMenuItem();
smenuFunc = new javax.swing.JMenuItem();
smenuClient = new javax.swing.JMenuItem();
menuEdit = new javax.swing.JMenu();
jMenuItem8 = new javax.swing.JMenuItem();
jMenuItem10 = new javax.swing.JMenuItem();
jMenu3 = new javax.swing.JMenu();
jMenuItem2 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Plugin Gerencial Solusys (dino)");
setFocusable(false);
setMinimumSize(new java.awt.Dimension(1590, 845));
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowActivated(java.awt.event.WindowEvent evt) {
formWindowActivated(evt);
}
});
jDesktopPane1.setBackground(new java.awt.Color(255, 255, 255));
jDesktopPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/Dino-orange-icon.png"))); // NOI18N
jLabel4.setFont(new java.awt.Font("Magneto", 0, 48)); // NOI18N
jLabel4.setText("Dino");
jDesktopPane1.setLayer(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);
jDesktopPane1.setLayer(jLabel4, javax.swing.JLayeredPane.DEFAULT_LAYER);
javax.swing.GroupLayout jDesktopPane1Layout = new javax.swing.GroupLayout(jDesktopPane1);
jDesktopPane1.setLayout(jDesktopPane1Layout);
jDesktopPane1Layout.setHorizontalGroup(
jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jDesktopPane1Layout.createSequentialGroup()
.addGap(53, 53, 53)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(1135, Short.MAX_VALUE))
);
jDesktopPane1Layout.setVerticalGroup(
jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDesktopPane1Layout.createSequentialGroup()
.addContainerGap(503, Short.MAX_VALUE)
.addGroup(jDesktopPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDesktopPane1Layout.createSequentialGroup()
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(8, 8, 8)))
.addGap(43, 43, 43))
);
lblUsuario.setText("Usuário:");
lblUsuario.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
lblUsuarioPropertyChange(evt);
}
});
lblData.setText("Data");
menuArq.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/page_white.png"))); // NOI18N
menuArq.setText("Arquivo");
jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/view/cancel.png"))); // NOI18N
jMenuItem1.setText("Fechar");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
menuArq.add(jMenuItem1);
jMenuBar1.add(menuArq);
menuMod.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/application_double.png"))); // NOI18N
menuMod.setText("Modulos");
smenuResult.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/money_dollar.png"))); // NOI18N
smenuResult.setText("Resultados");
smenuResult.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
smenuResultActionPerformed(evt);
}
});
menuMod.add(smenuResult);
smenuDesp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/money_delete.png"))); // NOI18N
smenuDesp.setText("Despesas");
smenuDesp.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
smenuDespActionPerformed(evt);
}
});
menuMod.add(smenuDesp);
smenuComp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/basket_put.png"))); // NOI18N
smenuComp.setText("Compras");
menuMod.add(smenuComp);
smenuProd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/box.png"))); // NOI18N
smenuProd.setText("Produtos");
smenuProd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
smenuProdActionPerformed(evt);
}
});
menuMod.add(smenuProd);
smenuFunc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/user.png"))); // NOI18N
smenuFunc.setText("Funcionários");
smenuFunc.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
smenuFuncActionPerformed(evt);
}
});
menuMod.add(smenuFunc);
smenuClient.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/vcard.png"))); // NOI18N
smenuClient.setText("Clientes");
menuMod.add(smenuClient);
jMenuBar1.add(menuMod);
menuEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/cog.png"))); // NOI18N
menuEdit.setText("Editar");
jMenuItem8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/cog_edit.png"))); // NOI18N
jMenuItem8.setText("Configurações");
menuEdit.add(jMenuItem8);
jMenuItem10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/user_delete.png"))); // NOI18N
jMenuItem10.setText("Permissões de usuários");
menuEdit.add(jMenuItem10);
jMenuBar1.add(menuEdit);
jMenu3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/help.png"))); // NOI18N
jMenu3.setText("Sobre");
jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, java.awt.event.InputEvent.CTRL_MASK));
jMenuItem2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/help.png"))); // NOI18N
jMenuItem2.setText("Sobre");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem2);
jMenuBar1.add(jMenu3);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(lblUsuario)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(lblData)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jDesktopPane1, javax.swing.GroupLayout.Alignment.TRAILING)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jDesktopPane1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lblUsuario)
.addComponent(lblData))
.addGap(5, 5, 5))
);
setSize(new java.awt.Dimension(1606, 884));
setLocationRelativeTo(null);
}// </editor-fold>//GEN-END:initComponents
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
if (JOptionPane.showConfirmDialog(null, "Titulo","tem certeza?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION){
System.exit(0);
}
}//GEN-LAST:event_jMenuItem1ActionPerformed
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
new Tela_Info().setVisible(true);
}//GEN-LAST:event_jMenuItem2ActionPerformed
private void smenuResultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_smenuResultActionPerformed
Tela_Resultados telaResultado = new Tela_Resultados();
jDesktopPane1.add(telaResultado);
telaResultado.setVisible(true);
}//GEN-LAST:event_smenuResultActionPerformed
private void smenuFuncActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_smenuFuncActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_smenuFuncActionPerformed
private void smenuProdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_smenuProdActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_smenuProdActionPerformed
private void smenuDespActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_smenuDespActionPerformed
Tela_Despesas telaDespesas = new Tela_Despesas();
jDesktopPane1.add(telaDespesas);
telaDespesas.setVisible(true);
}//GEN-LAST:event_smenuDespActionPerformed
private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
//define e formata a data que aparecerá no canto esquero inferior
Date data = new Date();
DateFormat formatador = DateFormat.getDateInstance(DateFormat.LONG);
lblData.setText(formatador.format(data));
// inorma o usuário no canto esquerdo inferior
lblUsuario.setText("Usuário: " + Tela_Login.txtLogin.getText());
}//GEN-LAST:event_formWindowActivated
private void lblUsuarioPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_lblUsuarioPropertyChange
}//GEN-LAST:event_lblUsuarioPropertyChange
/**
* @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(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Tela_Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//mostra a tela de carregamento
Tela_CarregamentoInicio carregandoServ = new Tela_CarregamentoInicio(10000);
carregandoServ.showSplash();
// cria a tela de login
new Tela_Login().setVisible(true);
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Tela_Principal();
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JDesktopPane jDesktopPane1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel4;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
public static javax.swing.JMenuItem jMenuItem10;
private javax.swing.JMenuItem jMenuItem2;
public static javax.swing.JMenuItem jMenuItem8;
private javax.swing.JLabel lblData;
private javax.swing.JLabel lblUsuario;
private javax.swing.JMenu menuArq;
private javax.swing.JMenu menuEdit;
public static javax.swing.JMenu menuMod;
public static javax.swing.JMenuItem smenuClient;
public static javax.swing.JMenuItem smenuComp;
public static javax.swing.JMenuItem smenuDesp;
public static javax.swing.JMenuItem smenuFunc;
public static javax.swing.JMenuItem smenuProd;
public static javax.swing.JMenuItem smenuResult;
// End of variables declaration//GEN-END:variables
}