Commit 3729f58c authored by Frederic DUMONT's avatar Frederic DUMONT
Browse files

Mise à jour du projet

parent af5bc8bc
File mode changed from 100755 to 100644
......@@ -25,10 +25,14 @@ import com.smartgwt.client.data.Record;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.alma.client.serializables.*;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class AlmaGTD implements EntryPoint {
private static int treeId=0;
private String login;
private AbsolutePanel collectPanel;
......@@ -59,25 +63,23 @@ public class AlmaGTD implements EntryPoint {
public void onModuleLoad() {
// Use RootPanel.get() to get the entire body element
RootPanel rootPanel = RootPanel.get("rootPanel");
final RootPanel rootPanel = RootPanel.get("rootPanel");
Image banner = new Image("img/bannerWhite.png");
final Image banner = new Image("img/bannerWhite.png");
//banner.setSize("800px", "200px");
rootPanel.add(banner ,6, 0);
connectPanel = new AbsolutePanel();
connectPanel.setSize("200px","200px");
connectPanel.setStyleName("connectPanel");
HTML labelLogin = new HTML("<h3>Login</h3>");
final HTML labelLogin = new HTML("<h3>Login</h3>");
tfLogin = new TextBox();
HTML labelPass = new HTML("<h3>Password</h3>");
final HTML labelPass = new HTML("<h3>Password</h3>");
tfPass = new PasswordTextBox();
tfPass.setText("afykappi_298"); ;tfLogin.setText("afykappi_298@yopmail.com");
//tfPass.setText("allserv");tfLogin.setText("allservv@free.fr");
//tfPass.setText("damien"); ;tfLogin.setText("dml_aon@hotmail.com");
//tfPass.setText("renard");tfLogin.setText("renard001@live.fr");
//tfPass.setText("damien");tfLogin.setText("damien.levin@etu.univ-nantes.fr");
Button bConnect = new Button("Connect");
tfPass.setText("afykappi_298");
tfLogin.setText("afykappi_298@yopmail.com");
final Button bConnect = new Button("Connect");
//bConnect.setSize("80px","30px");
bConnect.setStyleName("sendButton");
connectPanel.add(labelLogin,20,30);
......@@ -87,7 +89,7 @@ public class AlmaGTD implements EntryPoint {
connectPanel.add(bConnect,45,150);
rootPanel.add(connectPanel, 300, 300);
bConnect.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
connect();
}
});
......@@ -95,22 +97,22 @@ public class AlmaGTD implements EntryPoint {
connectedPanel = new AbsolutePanel();
connectedPanel.setSize("99%","37px");
Image userConnected = new Image("img/user_32.png");
Image tDoOnline = new Image("img/File-server-32.png");
Image tDoOffline = new Image("img/File-server_off-32.png");
Image gtdOnline = new Image("img/File-server-32.png");
Image gtdOffline = new Image("img/File-server_off-32.png");
final Image userConnected = new Image("img/user_32.png");
final Image tDoOnline = new Image("img/File-server-32.png");
final Image tDoOffline = new Image("img/File-server_off-32.png");
final Image gtdOnline = new Image("img/File-server-32.png");
final Image gtdOffline = new Image("img/File-server_off-32.png");
connectedPanel.add(userConnected,10,3);
htmlLogin = new HTML("<b>"+login+"</b>");
HTML labelContext = new HTML("<b>Context</b>");
final HTML labelContext = new HTML("<b>Context</b>");
connectedPanel.add(labelContext,260,12);
final ListBox cbContext = new ListBox(false);
//cbContext.setWidth("80px");
cbContext.addItem("Paris - Work");cbContext.addItem("Nantes - Work");cbContext.addItem("New York - Work");cbContext.addItem("New York - Home");
connectedPanel.add(cbContext,320,7);
Button btnNewContext = new Button("<img src='img/plus.png' width='14' height='14'/>");
final Button btnNewContext = new Button("<img src='img/plus.png' width='14' height='14'/>");
btnNewContext.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
//newIdeaDialogBox.center();
//newIdeaValidButton.setFocus(true);
}
......@@ -128,23 +130,16 @@ public class AlmaGTD implements EntryPoint {
stepsPanel.setSize("99%","64px");
stepsPanel.setStyleName("stepsPanel");
Image rightArrow = new Image("img/rightArrow.png");
final Image rightArrow = new Image("img/rightArrow.png");
rightArrow.setSize("80px", "65px");
Image rightArrow1 = new Image("img/rightArrow.png");
rightArrow1.setSize("80px", "65px");
Image rightArrow2 = new Image("img/rightArrow.png");
rightArrow2.setSize("80px", "65px");
Image rightArrow3 = new Image("img/rightArrow.png");
rightArrow3.setSize("80px", "65px");
btnCollect = new Button("Collect");
btnCollect.setStyleName("stepButton");
btnCollect.setText("Collect");
stepsPanel.add(btnCollect, 6, 8);
btnCollect.setSize("122px", "53px");
btnCollect.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
show("collect");
}
});
......@@ -156,45 +151,45 @@ public class AlmaGTD implements EntryPoint {
stepsPanel.add(btnProcess, 235, 8);
btnProcess.setSize("122px", "53px");
btnProcess.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
show("process");
}
});
stepsPanel.add(rightArrow1 , 367,3);
stepsPanel.add(rightArrow , 367,3);
btnOrganize = new Button("Organize");
btnOrganize.setStyleName("stepButton");
stepsPanel.add(btnOrganize, 460, 8);
btnOrganize.setSize("122px", "53px");
btnOrganize.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
System.out.println("Organize1");
public void onClick(final ClickEvent event) {
//System.out.println("Organize1");
show("organize");
}
});
stepsPanel.add(rightArrow2 , 591, 3);
stepsPanel.add(rightArrow , 591, 3);
btnView = new Button("View");
btnView.setStyleName("stepButton");
stepsPanel.add(btnView, 683, 8);
btnView.setSize("122px", "53px");
btnView.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
show("view");
}
});
stepsPanel.add(rightArrow3 , 815, 3);
stepsPanel.add(rightArrow , 815, 3);
btnReview = new Button("Review");
btnReview.setStyleName("stepButton");
stepsPanel.add(btnReview, 906, 8);
btnReview.setSize("122px", "53px");
btnReview.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
show("review");
}
});
......@@ -239,11 +234,11 @@ public class AlmaGTD implements EntryPoint {
try {
webserver.connect("tete","terter",this.tfLogin.getText(),tfPass.getText(),new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
public void onFailure(final Throwable caught) {
popup("",caught.getMessage());
}
public void onSuccess(String result) {
public void onSuccess(final String result) {
show("collect");
login=tfLogin.getText();
htmlLogin.setHTML("<b>"+login+"</b>");
......@@ -260,7 +255,7 @@ public class AlmaGTD implements EntryPoint {
* Focus on a panel hiding the others and disabling buttons
* @param type Panel to who (must be collect,process,view,review,connect or organize)
*/
private void show(String type){
private void show(final String type){
if(type.equals("collect")){
this.collectPanel.setVisible(true);
this.organizePanel.setVisible(false);
......@@ -358,7 +353,7 @@ public class AlmaGTD implements EntryPoint {
public void onSuccess(List<Project> result) {
for(Project proj : result){
ListGridRecord rec = new ListGridRecord();
final ListGridRecord rec = new ListGridRecord();
//System.out.println("Project"+proj.getIdentifiant()+":"+proj.getNom());
rec.setAttribute("id", proj.getIdentifiant());
rec.setAttribute("name", proj.getNom());
......@@ -371,8 +366,9 @@ public class AlmaGTD implements EntryPoint {
ListGridRecord[] gridRecords = new ListGridRecord[records.size()];
int curId=0;
for(ListGridRecord rec : records)
for(ListGridRecord rec : records){
gridRecords[curId++]=rec;
}
projectDataSource.setTestData(gridRecords);
//System.out.println("----------------------------------Project Organize init--------------------------------");
......@@ -397,7 +393,7 @@ public class AlmaGTD implements EntryPoint {
public void onSuccess(List<Task> result) {
for(Task task : result){
//System.out.println("Task : "+task.getIdentifiant()+":"+task.getNom());
ListGridRecord rec = new ListGridRecord();
final ListGridRecord rec = new ListGridRecord();
rec.setAttribute("id", task.getIdentifiant());
rec.setAttribute("name", task.getNom());
rec.setAttribute("effortRate", task.getTauxEffort());
......@@ -413,9 +409,9 @@ public class AlmaGTD implements EntryPoint {
ListGridRecord[] gridRecords = new ListGridRecord[records.size()];
int curId=0;
for(ListGridRecord rec : records)
for(ListGridRecord rec : records){
gridRecords[curId++]=rec;
}
taskDataSource.setTestData(gridRecords);
/* System.out.println("----------------------------------Tasks Organize init--------------------------------");
......@@ -452,7 +448,7 @@ public class AlmaGTD implements EntryPoint {
final Button closeButton = new Button("Close");
// We can set the id of a widget by accessing its Element
closeButton.getElement().setId("closeButton");
VerticalPanel dialogVPanel = new VerticalPanel();
final VerticalPanel dialogVPanel = new VerticalPanel();
dialogVPanel.setStyleName("dialogVPanel");
dialogVPanel.add(new HTML("<b>"+msg+"</b>"));
dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
......
......@@ -15,16 +15,16 @@ import com.smartgwt.client.types.DragAppearance;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.util.EventHandler;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.events.*;
public class CollectPanel extends AbsolutePanel{
private DialogBox newIdeaDialogBox;
private Button newIdeaValidButton,newIdeaCancelButton;
private TextBox ideaTitle;
private TextArea ideaContent ;
private Canvas canvas;
private AlmaGTD agtdgui;
private final DialogBox newIdeaDialogBox;
private final Button newIdeaValidButton,newIdeaCancelButton;
private final TextBox ideaTitle;
private final TextArea ideaContent ;
private final Canvas canvas;
private final AlmaGTD agtdgui;
private static int curAdd=50;
public CollectPanel(final AlmaGTD agtdgui){
......@@ -35,7 +35,7 @@ public class CollectPanel extends AbsolutePanel{
final Button btnNew = new Button("<img src='img/plus.png' width='25' height='25'/>");
btnNew.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
newIdeaDialogBox.center();
canvas.setVisible(false);
newIdeaValidButton.setFocus(true);
......@@ -60,20 +60,20 @@ public class CollectPanel extends AbsolutePanel{
trash.setAlign(Alignment.CENTER);
trash.setCanAcceptDrop(true);
trash.addDropOverHandler(new DropOverHandler() {
public void onDropOver(DropOverEvent event) {
public void onDropOver(final DropOverEvent event) {
trash.setBackgroundColor("#FFFF88");
}
});
trash.addDropOutHandler(new DropOutHandler() {
public void onDropOut(DropOutEvent event) {
public void onDropOut(final DropOutEvent event) {
trash.setBackgroundColor("white");
}
});
trash.addDropHandler(new DropHandler() {
public void onDrop(DropEvent event) {
DragLabel target = ((DragLabel)EventHandler.getDragTarget());
public void onDrop(final DropEvent event) {
final DragLabel target = ((DragLabel)EventHandler.getDragTarget());
String title = target.getTitle();
title=title.substring(4, title.indexOf("</h3>"));
......@@ -101,7 +101,7 @@ public class CollectPanel extends AbsolutePanel{
// We can set the id of a widget by accessing its Element
newIdeaValidButton.getElement().setId("closeButton");
newIdeaCancelButton.getElement().setId("closeButton");
VerticalPanel newIdeaBoxVPanel = new VerticalPanel();
final VerticalPanel newIdeaBoxVPanel = new VerticalPanel();
newIdeaBoxVPanel.addStyleName("dialogVPanel");
newIdeaBoxVPanel.add(new HTML("<b>Idea title:</b>"));
ideaTitle = new TextBox();
......@@ -114,7 +114,7 @@ public class CollectPanel extends AbsolutePanel{
newIdeaBoxVPanel.add(ideaContent);
newIdeaBoxVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
//Command buttons
HorizontalPanel cmdPanel = new HorizontalPanel();
final HorizontalPanel cmdPanel = new HorizontalPanel();
cmdPanel.setSpacing(5);
cmdPanel.add(newIdeaValidButton);
cmdPanel.add(newIdeaCancelButton);
......@@ -124,7 +124,7 @@ public class CollectPanel extends AbsolutePanel{
// Add a handler to close the newIdeaDialogBox
newIdeaValidButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
newIdeaDialogBox.hide();
btnNew.setEnabled(true);
btnNew.setFocus(true);
......@@ -136,7 +136,7 @@ public class CollectPanel extends AbsolutePanel{
});
// Add a handler to close the newIdeaDialogBox doing nothing
newIdeaCancelButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
public void onClick(final ClickEvent event) {
newIdeaDialogBox.hide();
btnNew.setEnabled(true);
btnNew.setFocus(true);
......@@ -154,13 +154,13 @@ public class CollectPanel extends AbsolutePanel{
// We can set the id of a widget by accessing its Element
closeButton.getElement().setId("closeButton");
final Label textToServerLabel = new Label();
final HTML serverResponseLabel = new HTML();
VerticalPanel dialogVPanel = new VerticalPanel();
final HTML srvRespLabel = new HTML();
final VerticalPanel dialogVPanel = new VerticalPanel();
dialogVPanel.addStyleName("dialogVPanel");
dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
dialogVPanel.add(textToServerLabel);
dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
dialogVPanel.add(serverResponseLabel);
dialogVPanel.add(srvRespLabel);
dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
dialogVPanel.add(closeButton);
dialogBox.setWidget(dialogVPanel);
......@@ -169,8 +169,44 @@ public class CollectPanel extends AbsolutePanel{
}
public DialogBox getNewIdeaDialogBox() {
return newIdeaDialogBox;
}
public TextBox getIdeaTitle() {
return ideaTitle;
}
public TextArea getIdeaContent() {
return ideaContent;
}
public AlmaGTD getAgtdgui() {
return agtdgui;
}
public static int getCurAdd() {
return curAdd;
}
public static void setCurAdd(final int curAdd) {
CollectPanel.curAdd = curAdd;
}
public Button getNewIdeaValidButton() {
return newIdeaValidButton;
}
public Button getNewIdeaCancelButton() {
return newIdeaCancelButton;
}
public Canvas getCanvas() {
return canvas;
}
@Override
public void setVisible(boolean visible){
public void setVisible(final boolean visible){
super.setVisible(visible);
init();
}
......@@ -178,13 +214,13 @@ public class CollectPanel extends AbsolutePanel{
public void init(){
for(Canvas child : canvas.getChildren()){
System.out.println(child.getTitle());
if(child.getTitle()!=null)
if(child.getTitle().startsWith("<h3>"))
if((child.getTitle()!=null)&&(child.getTitle().startsWith("<h3>"))){
canvas.removeChild(child);
}
}
final DragLabel dragTranslucent = new DragLabel("Translucent", 50);
for(String title : agtdgui.getListIdeas().keySet()){
DragLabel dragTranslucent = new DragLabel("Translucent", 50);
dragTranslucent.setDragAppearance(DragAppearance.OUTLINE);
dragTranslucent.setDragOpacity(60);
dragTranslucent.setContents("<h3>"+title+"</h3>"+"<br><p style='text-align:left;'>"+ agtdgui.getListIdeas().get(title)+"</p>");
......@@ -195,9 +231,9 @@ public class CollectPanel extends AbsolutePanel{
}
}
public void addNote(String title,String note){
public void addNote(final String title, final String note){
DragLabel dragTranslucent = new DragLabel("Translucent", 50);
final DragLabel dragTranslucent = new DragLabel("Translucent", 50);
dragTranslucent.setDragAppearance(DragAppearance.OUTLINE);
dragTranslucent.setDragOpacity(60);
dragTranslucent.setContents("<h3>"+title+"</h3>"+"<br><p style='text-align:left;'>"+note+"</p>");
......@@ -210,8 +246,9 @@ public class CollectPanel extends AbsolutePanel{
}
public static class DragLabel extends Label {
public DragLabel(String contents, int left) {
setTop(50);
public DragLabel(final String contents, final int left) {
super();
setTop(50);
setLeft(curAdd);
setContents(contents);
setAlign(Alignment.CENTER);
......
......@@ -7,7 +7,6 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.alma.client.serializables.Project;
import com.alma.client.serializables.Task;
import com.alma.server.types.ProjetImpl;
/**
* The client side stub for the RPC service.
......
File mode changed from 100755 to 100644
package com.alma.client;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import com.alma.client.serializables.Project;
import com.alma.client.serializables.Task;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.gwtext.client.widgets.tree.MultiSelectionModel;
import com.gwtext.client.widgets.tree.TreeNode;
import com.gwtext.client.widgets.tree.TreePanel;
......@@ -23,48 +17,25 @@ import com.gwtext.client.core.EventObject;
import com.gwtext.client.data.Node;
import com.gwtext.client.data.NodeTraversalCallback;
import com.gwtext.client.data.Tree;
import com.google.gwt.user.client.ui.FormPanel;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.grid.GridPanel;
import com.gwtext.client.widgets.layout.AccordionLayout;
import com.gwtext.client.widgets.layout.FormLayout;
import com.gwtext.client.widgets.form.DateField;
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.NumberField;
import com.gwtext.client.widgets.layout.CardLayout;
import com.gwtext.client.widgets.layout.FitLayout;
import com.gwtext.client.widgets.TabPanel;
import com.google.gwt.user.client.ui.DecoratedStackPanel;
import com.google.gwt.user.client.ui.DeckPanel;
public class LiveOrganizePanel extends AbsolutePanel{
private AlmaGTD agtdgui;
private HashMap<String,Integer> taskKeyToRecid=new HashMap<String,Integer>();
private HashMap<String,Integer> projKeyToRecid=new HashMap<String,Integer>();
private HashMap<Node,DataClass> nodeDt = new HashMap<Node,DataClass>();
private HashMap<String,Project> projectsList = new HashMap<String,Project>();
private HashMap<String,Task> tasksList = new HashMap<String,Task>();
private TreePanel treePanel;
private TreeNode root;
private int projListId=0;
private int taskListId=0;
private FormPanel formPanel;
private TextField textField_6;
private TextField textField_7;
private TextField textField_8;
private TextField textField_9;
private Panel panel;
private FormPanel formPanel_2;
private TextField textField_1;
private NumberField numberField;
private TextField textField_2;
private TextField textField_3;
private TextField textField_4;
private TextField textField_5;
private TextField textField;
private final AlmaGTD agtdgui;
private final HashMap<String,Integer> taskKeyToRecid=new HashMap<String,Integer>();
private final HashMap<String,Integer> projKeyToRecid=new HashMap<String,Integer>();
private final HashMap<Node,DataClass> nodeDt = new HashMap<Node,DataClass>();
private final HashMap<String,Project> projectsList = new HashMap<String,Project>();
private final HashMap<String,Task> tasksList = new HashMap<String,Task>();
private final TreePanel treePanel;
private final TreeNode root;
private static int projListId=0;
private static int taskListId=0;
public LiveOrganizePanel(AlmaGTD agtdgui){
public LiveOrganizePanel(final AlmaGTD agtdgui){
super();
this.agtdgui = agtdgui;
this.addStyleName("panel");
......@@ -86,61 +57,59 @@ public class LiveOrganizePanel extends AbsolutePanel{
treePanel.setHeight("400px");
add(treePanel, 6, 6);
Panel pnlInformations = new Panel("Tasks Informations");
final Panel pnlInformations = new Panel("Tasks Informations");
pnlInformations.setLayout(new FormLayout());
TextField textField_10 = new TextField("ID", "text_field", 100);
final TextField textField_10 = new TextField("ID", "text_field", 100);
textField_10.setReadOnly(true);
pnlInformations.add(textField_10);
textField_10.setWidth("60%");
TextField textField_11 = new TextField("Name", "text_field", 100);
final TextField textField_11 = new TextField("Name", "text_field", 100);
pnlInformations.add(textField_11);
textField_11.setWidth("60%");
TextField textField_12 = new TextField("Start Date", "text_field", 100);
final TextField textField_12 = new TextField("Start Date", "text_field", 100);
pnlInformations.add(textField_12);
textField_12.setWidth("60%");
TextField textField_13 = new TextField("End Date", "text_field", 100);
final TextField textField_13 = new TextField("End Date", "text_field", 100);
pnlInformations.add(textField_13);
textField_13.setWidth("60%");
TextField textField_14 = new TextField("Frequency", "text_field", 100);
final TextField textField_14 = new TextField("Frequency", "text_field", 100);
pnlInformations.add(textField_14);
textField_14.setWidth("60%");
TextField textField_15 = new TextField("Progress", "text_field", 100);
final TextField textField_15 = new TextField("Progress", "text_field", 100);
textField_15.setReadOnly(true);
pnlInformations.add(textField_15);
textField_15.setWidth("60%");
add(pnlInformations, 412, 6);
pnlInformations.setSize("400px", "176px");
Panel pnlProjectsInformations = new Panel("Projects Informations");
pnlProjectsInformations.setLayout(new FormLayout());
final Panel pnlProjectsInfo = new Panel("Projects Informations");
pnlProjectsInfo.setLayout(new FormLayout());
TextField textField_16 = new TextField("ID", "text_field", 100);
pnlProjectsInformations.add(textField_16);
final TextField textField_16 = new TextField("ID", "text_field", 100);
pnlProjectsInfo.add(textField_16);
textField_16.setWidth("60%");
TextField textField_17 = new TextField("Name", "text_field", 100);
final TextField textField_17 = new TextField("Name", "text_field", 100);
textField_17.setSize("60%", "");