Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benoît LE BADEZET
alma-gtd
Commits
526e199a
Commit
526e199a
authored
Apr 08, 2010
by
Julien Durillon
Browse files
ça compile, et les tests fonctionnent
parent
382d48c1
Changes
5
Hide whitespace changes
Inline
Side-by-side
GTDClientGil/src/main/java/fr/alma/controleur/Controleur.java
View file @
526e199a
...
...
@@ -8,6 +8,7 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Map
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
...
...
@@ -56,6 +57,7 @@ public class Controleur implements IControleur {
*/
public
static
final
DateFormat
DATEFORMAT
=
new
SimpleDateFormat
(
"dd/MM/yyyy"
,
Locale
.
FRANCE
);
private
static
final
int
MINPASSWORDLEN
=
8
;
/**
* Constructeur.
...
...
@@ -80,7 +82,7 @@ public class Controleur implements IControleur {
// on force le login à ne pas avoir d'espace afin de respecter les
// normes
// et à le contrôler plus aisément
login2
=
login
.
replaceAll
(
" "
,
""
);
String
login2
=
login
.
replaceAll
(
" "
,
""
);
if
(
login2
.
length
()
!=
0
&&
mdp
.
length
!=
0
)
{
// vérifier la bonne connexion signifie regarder ne bd si
// l'utilisateur est enregistré
...
...
@@ -149,6 +151,15 @@ public class Controleur implements IControleur {
// vérification qu les noms de passe correspondent
Boolean
mdp_identiques
=
Boolean
.
TRUE
;
// Vérification de la longueur du mot de passe.
if
(
password
.
length
<
MINPASSWORDLEN
){
ApplicationGTD
.
getInstance
()
.
gererMessage
(
2
,
"Le mot de passe a une longueur inférieure à 8."
);
}
if
(
password
.
length
==
password2
.
length
)
{
for
(
int
i
=
0
;
i
<
password
.
length
;
i
++)
{
mdp_identiques
=
(
password
[
i
]
==
password2
[
i
]);
...
...
@@ -172,7 +183,12 @@ public class Controleur implements IControleur {
.
getInstance
()
.
gererMessage
(
2
,
"La connexion a échoué - Les champs obligatoires ne doivent pas etre vide"
);
}
else
{
}
else
if
(
login2
.
length
()
<
4
){
ApplicationGTD
.
getInstance
()
.
gererMessage
(
2
,
"Le nom d'utilisateur doit au moins être de taille 4."
);
}
else
{
modele
.
creerCompte
(
login2
,
password
,
email
);
ApplicationGTD
.
getInstance
().
gererMessage
(
1
,
"La création du compte est réussie"
);
...
...
@@ -380,7 +396,7 @@ public class Controleur implements IControleur {
* l'action effectuée (ajouter ou editer)
*/
@Override
public
void
ajouterEditerProjet
(
Hash
Map
<
Integer
,
Object
>
valeurs
,
TypeAction
action
)
{
public
void
ajouterEditerProjet
(
Map
<
Integer
,
Object
>
valeurs
,
TypeAction
action
)
{
String
nom
=
null
;
String
notes
=
null
;
...
...
GTDClientGil/src/main/java/fr/alma/ihm/vues/echeancier/JPaneEcheancier.java
View file @
526e199a
...
...
@@ -55,7 +55,7 @@ public class JPaneEcheancier extends JScrollPane {
ArrayList
<
Echeancier
>
l
=
new
ArrayList
<
Echeancier
>();
taches
=
getListeTacheEcheance
();
for
(
Tache
t
:
taches
){
l
.
add
(
new
Echeancier
(
t
.
getNom
(),
t
.
getContexte
(),
Controleur
.
df
.
format
(
t
.
getDateEcheance
())));
l
.
add
(
new
Echeancier
(
t
.
getNom
(),
t
.
getContexte
(),
Controleur
.
DATEFORMAT
.
format
(
t
.
getDateEcheance
())));
}
for
(
int
i
=
0
;
i
<
l
.
size
();
i
++){
GridBagConstraints
gbc1
=
new
GridBagConstraints
();
...
...
@@ -123,11 +123,11 @@ public class JPaneEcheancier extends JScrollPane {
this
.
echeancier
=
echeancier
;
}
public
Array
List
<
Tache
>
getTaches
()
{
public
List
<
Tache
>
getTaches
()
{
return
taches
;
}
public
void
setTaches
(
Array
List
<
Tache
>
taches
)
{
public
void
setTaches
(
List
<
Tache
>
taches
)
{
this
.
taches
=
taches
;
}
}
GTDClientGil/src/main/java/fr/alma/ihm/vues/generale/PanneauTacheProjet.java
View file @
526e199a
...
...
@@ -111,13 +111,13 @@ public class PanneauTacheProjet extends JPanel {
if
(
o
.
getDateDebut
()
==
null
)
{
jLabelValDDebut
=
new
JLabel
(
"(Non renseignée)"
);
}
else
{
jLabelValDDebut
=
new
JLabel
(
Controleur
.
df
.
format
(
o
.
getDateDebut
()));
jLabelValDDebut
=
new
JLabel
(
Controleur
.
DATEFORMAT
.
format
(
o
.
getDateDebut
()));
}
JLabel
jLabelValDEchance
;
if
(
o
.
getDateEcheance
()
==
null
)
{
jLabelValDEchance
=
new
JLabel
(
"(Non renseignée)"
);
}
else
{
jLabelValDEchance
=
new
JLabel
(
Controleur
.
df
.
format
(
o
.
getDateEcheance
()));
jLabelValDEchance
=
new
JLabel
(
Controleur
.
DATEFORMAT
.
format
(
o
.
getDateEcheance
()));
}
p1
.
add
(
jLabelNom
);
...
...
@@ -167,7 +167,7 @@ public class PanneauTacheProjet extends JPanel {
}
jLabelValFrequence
=
new
JLabel
(
o
.
getPeriodicite
().
getFrequence
());
}
else
{
jLabelValDArret
=
new
JLabel
(
Controleur
.
df
.
format
(
o
.
getPeriodicite
().
getDateFinRepetition
()));
jLabelValDArret
=
new
JLabel
(
Controleur
.
DATEFORMAT
.
format
(
o
.
getPeriodicite
().
getDateFinRepetition
()));
if
(
o
.
getPeriodicite
().
getFrequence
().
equals
(
"Pas de fréquence"
))
{
o
.
getPeriodicite
().
setFrequence
(
"Evénement ponctuel"
);
jLabelValFrequence
=
new
JLabel
(
o
.
getPeriodicite
().
getFrequence
());
...
...
GTDClientGil/src/main/java/fr/alma/ihm/vues/generale/popup/CalendarPopup.java
View file @
526e199a
...
...
@@ -94,12 +94,12 @@ public class CalendarPopup extends JDialog {
@Override
public
void
mouseClicked
(
MouseEvent
arg0
)
{
System
.
out
.
println
(
arg0
.
getSource
().
toString
());
dateField
.
setText
(
Controleur
.
df
.
format
(
cal
.
getDate
()));
dateField
.
setText
(
Controleur
.
DATEFORMAT
.
format
(
cal
.
getDate
()));
}
@Override
public
void
mouseEntered
(
MouseEvent
arg0
)
{
dateField
.
setText
(
Controleur
.
df
.
format
(
cal
.
getDate
()));
dateField
.
setText
(
Controleur
.
DATEFORMAT
.
format
(
cal
.
getDate
()));
}
@Override
...
...
@@ -108,7 +108,7 @@ public class CalendarPopup extends JDialog {
@Override
public
void
mousePressed
(
MouseEvent
arg0
)
{
dateField
.
setText
(
Controleur
.
df
.
format
(
cal
.
getDate
()));
dateField
.
setText
(
Controleur
.
DATEFORMAT
.
format
(
cal
.
getDate
()));
}
@Override
...
...
GTDClientGil/src/main/java/fr/alma/ihm/vues/generale/popup/EditerTachePopup.java
View file @
526e199a
...
...
@@ -73,15 +73,15 @@ public class EditerTachePopup extends AbstractAjouterEditerTache {
textFieldNomTache
.
setText
(
tache
.
getNom
());
if
(
tache
.
getDateDebut
()
!=
null
)
{
textFieldDateDebut
.
setText
(
Controleur
.
df
.
format
(
tache
.
getDateDebut
()));
textFieldDateDebut
.
setText
(
Controleur
.
DATEFORMAT
.
format
(
tache
.
getDateDebut
()));
}
if
(
tache
.
getDateEcheance
()
!=
null
)
{
textFieldDateEcheance
.
setText
(
Controleur
.
df
.
format
(
tache
.
getDateEcheance
()));
textFieldDateEcheance
.
setText
(
Controleur
.
DATEFORMAT
.
format
(
tache
.
getDateEcheance
()));
}
if
(
tache
.
getPeriodicite
().
getDateFinRepetition
()
!=
null
)
{
textFieldDateFinRep
.
setText
(
Controleur
.
df
.
format
(
tache
.
getPeriodicite
().
getDateFinRepetition
()));
textFieldDateFinRep
.
setText
(
Controleur
.
DATEFORMAT
.
format
(
tache
.
getPeriodicite
().
getDateFinRepetition
()));
}
comboBoxContexte
.
setSelectedItem
(
tache
.
getContexte
());
...
...
@@ -106,13 +106,13 @@ public class EditerTachePopup extends AbstractAjouterEditerTache {
//comboBoxFrequence.setSelectedItem(tache.getPeriodicite().getFrequence());
comboBoxContexte
.
addItem
(
""
);
for
(
IContexte
c
:
Contexte
.
values
())
{
comboBoxContexte
.
addItem
(
c
.
toString
());
for
(
IContexte
c
ontext
:
Contexte
.
values
())
{
comboBoxContexte
.
addItem
(
c
ontext
.
toString
());
}
comboBoxFrequence
.
addItem
(
""
);
for
(
Frequence
f
:
Frequence
.
values
())
{
comboBoxFrequence
.
addItem
(
f
.
toString
());
for
(
Frequence
f
requence
:
Frequence
.
values
())
{
comboBoxFrequence
.
addItem
(
f
requence
.
toString
());
}
if
(
tache
.
getTauxEffort
()
!=
null
)
{
...
...
@@ -137,6 +137,7 @@ public class EditerTachePopup extends AbstractAjouterEditerTache {
public
void
initActionListeners
()
{
jButtonOK
.
addActionListener
(
this
);
jButtonAnnuler
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
arg0
)
{
EditerTachePopup
.
getInstance
().
dispose
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment