Commit 9058d7ea authored by dkasliwal's avatar dkasliwal

Card view Display in horizontal and vertical format


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101797 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1a8adeea
...@@ -9,10 +9,10 @@ import com.google.gwt.user.client.Window; ...@@ -9,10 +9,10 @@ import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment; import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant;
public class CardBuilder public class CardBuilder
{ {
...@@ -20,8 +20,9 @@ public class CardBuilder ...@@ -20,8 +20,9 @@ public class CardBuilder
/*Add ParameterList and filterList in buildCard method By Dhanendra on Date 01-04-2016*/ /*Add ParameterList and filterList in buildCard method By Dhanendra on Date 01-04-2016*/
public SimplePanel buildCard(ArrayList<ArrayList<String>> graphDtlList, JSONObject jsonObjGraph, String dataSource,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList) public SimplePanel buildCard(ArrayList<ArrayList<String>> graphDtlList, JSONObject jsonObjGraph, String dataSource,ArrayList<String> parameterList,ArrayList<FilterInfo> filterList)
{ {
/*Comment Code by Dhanendra on date 07-06-2016*/
//JSONObject jsonObjFrGraph = (JSONObject) jsonObjGraph.get(dataSource);
JSONObject jsonObjFrGraph = (JSONObject) jsonObjGraph.get(dataSource);
ArrayList<String> heightList = new ArrayList<String>(); ArrayList<String> heightList = new ArrayList<String>();
ArrayList<String> widthList = new ArrayList<String>(); ArrayList<String> widthList = new ArrayList<String>();
ArrayList<String> layoutList = new ArrayList<String>(); ArrayList<String> layoutList = new ArrayList<String>();
...@@ -38,35 +39,48 @@ public class CardBuilder ...@@ -38,35 +39,48 @@ public class CardBuilder
String layOutStr = ""; String layOutStr = "";
JSONObject fetchRowWiseVal = null; JSONObject fetchRowWiseVal = null;
ArrayList<ArrayList<String>> allCardList = new ArrayList<ArrayList<String>>(); ArrayList<ArrayList<String>> allCardList = new ArrayList<ArrayList<String>>();
HorizontalPanel hOuterPnl = new HorizontalPanel(); final VerticalPanel verticalPnl = new VerticalPanel();
//final ScrollPanel verticalPnl=new ScrollPanel();
int firstOcurence = 0; int firstOcurence = 0;
String cardString = ""; String cardString = "";
String layoutHtmlStr = ""; String layoutHtmlStr = "";
VerticalPanel vInnerPnl = null; HorizontalPanel horizontalPnl = null;
HTML html = null; HTML html = null;
VerticalPanel verticalPnl= new VerticalPanel();
HorizontalPanel horizontalPnl= new HorizontalPanel();
cardScrlPnl.setStyleName("cardScrlPnl"); cardScrlPnl.setStyleName("cardScrlPnl");
/* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */ /* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
VerticalPanel hOuterPnlFinal = new VerticalPanel(); VerticalPanel hOuterPnlFinal = new VerticalPanel();
HorizontalPanel hOuterPnl = new HorizontalPanel();
hOuterPnl.setStyleName("cardVPnl");
hOuterPnl.getElement().setAttribute("cellpadding", "2");
hOuterPnl.getElement().setAttribute("cellspacing", "1");
hOuterPnlFinal.getElement().setId("hOuterPnlFinal");
VerticalPanel vInnerPnl = null;
hOuterPnlFinal.setStyleName("cardVPnl"); hOuterPnlFinal.setStyleName("cardVPnl");
hOuterPnlFinal.getElement().setAttribute("cellpadding", "2"); hOuterPnlFinal.getElement().setAttribute("cellpadding", "2");
hOuterPnlFinal.getElement().setAttribute("cellspacing", "1"); hOuterPnlFinal.getElement().setAttribute("cellspacing", "1");
/* Ended by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */ /* Ended by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
hOuterPnl.setStyleName("cardVPnl"); verticalPnl.setStyleName("cardVPnl");
hOuterPnl.getElement().setAttribute("cellpadding", "2"); verticalPnl.getElement().setAttribute("cellpadding", "2");
hOuterPnl.getElement().setAttribute("cellspacing", "1"); verticalPnl.getElement().setAttribute("cellspacing", "1");
String id = ""; String id = "";
String dataString = ""; String dataString = "";
String componentIcon = ""; String componentIcon = "";
//String oldDataStr = ""; //String oldDataStr = "";
String linkMetadataName = "";
int anchorTagPresent = 0; int anchorTagPresent = 0;
int count=0; int count=0;
String propertyStr = ""; String propertyStr = "";
/*Add Verible by Dhanendra and swati*/
String linkMetadataName = "";
String panelView = null; String panelView = null;
/*End Verible by Dhanendra and swati*/
for (int i = 0; i < graphDtlList.size(); i++) for (int i = 0; i < graphDtlList.size(); i++)
{ {
...@@ -116,6 +130,11 @@ public class CardBuilder ...@@ -116,6 +130,11 @@ public class CardBuilder
} }
/*End By swati for Panel View on Date 16-05-2016*/ /*End By swati for Panel View on Date 16-05-2016*/
} }
/*Add if condition for no data display by Dhanendra on date 07-06-2016*/
if(jsonObjGraph!=null)
{
JSONObject jsonObjFrGraph = (JSONObject) jsonObjGraph.get(dataSource);
if (layoutList.get(0) != null) if (layoutList.get(0) != null)
{ {
layOutStr = layoutList.get(0); layOutStr = layoutList.get(0);
...@@ -139,6 +158,7 @@ public class CardBuilder ...@@ -139,6 +158,7 @@ public class CardBuilder
allCardList.add(dataList); allCardList.add(dataList);
} }
/*Add Add parameters to url for hyper link data By Dhanendra on Date 01-04-2016*/ /*Add Add parameters to url for hyper link data By Dhanendra on Date 01-04-2016*/
for (FilterInfo filterInfo : filterList) for (FilterInfo filterInfo : filterList)
{ {
if(count==0) if(count==0)
...@@ -152,6 +172,7 @@ public class CardBuilder ...@@ -152,6 +172,7 @@ public class CardBuilder
count++; count++;
} }
/*End parameters to url for hyper link data By Dhanendra on Date 01-04-2016*/ /*End parameters to url for hyper link data By Dhanendra on Date 01-04-2016*/
if(panelView.equalsIgnoreCase("vertical")) if(panelView.equalsIgnoreCase("vertical"))
{ {
int ctr = 0; int ctr = 0;
...@@ -160,8 +181,10 @@ public class CardBuilder ...@@ -160,8 +181,10 @@ public class CardBuilder
/* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */ /* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
if(ctr!=0 && ctr%3==0) if(ctr!=0 && ctr%3==0)
{ {
Window.alert("ctr :"+ctr);
hOuterPnlFinal.add(hOuterPnl); hOuterPnlFinal.add(hOuterPnl);
hOuterPnl = new HorizontalPanel(); hOuterPnl = new HorizontalPanel();
hOuterPnl.getElement().setId("hOuterPnl");
hOuterPnl.setStyleName("cardVPnl"); hOuterPnl.setStyleName("cardVPnl");
hOuterPnl.getElement().setAttribute("cellpadding", "2"); hOuterPnl.getElement().setAttribute("cellpadding", "2");
hOuterPnl.getElement().setAttribute("cellspacing", "1"); hOuterPnl.getElement().setAttribute("cellspacing", "1");
...@@ -193,7 +216,7 @@ public class CardBuilder ...@@ -193,7 +216,7 @@ public class CardBuilder
/*Add Add parameters to url for hyper link data By Swati on Date 05-05-2016*/ /*Add Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
if(linkMetadataName.length() > 0) if(linkMetadataName.length() > 0)
{ {
// setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr); //setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr);
} }
/*End Add parameters to url for hyper link data By Swati on Date 05-05-2016*/ /*End Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
hOuterPnl.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); hOuterPnl.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
...@@ -221,7 +244,7 @@ public class CardBuilder ...@@ -221,7 +244,7 @@ public class CardBuilder
{ {
id = idList.get(i); id = idList.get(i);
dataString = cardDataList.get(i); dataString = cardDataList.get(i);
dataString = dataString.replace('"', ' ').trim(); dataString = dataString.replace('"', ' ');
layoutHtmlStr = layoutHtmlStr.replaceAll(id, dataString); layoutHtmlStr = layoutHtmlStr.replaceAll(id, dataString);
} }
layoutHtmlStr = layoutHtmlStr.replace("{", "").replace("}", ""); layoutHtmlStr = layoutHtmlStr.replace("{", "").replace("}", "");
...@@ -243,12 +266,20 @@ public class CardBuilder ...@@ -243,12 +266,20 @@ public class CardBuilder
//setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr); //setOnClick(linkMetadataName, html,"/ibase/dwh/GwtDashboardPage.html?metadataname="+linkMetadataName+propertyStr);
} }
/*End Add parameters to url for hyper link data By Swati on Date 05-05-2016*/ /*End Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
verticalPnl.add(horizontalPnl); verticalPnl.add(horizontalPnl);
} }
cardScrlPnl.add(verticalPnl); cardScrlPnl.add(verticalPnl);
} }
}
else
{
Label label = new Label("No Data Found");
label.setStyleName("cardNoDataLbl");
cardScrlPnl.add(label);
}
/*End if condition for no data display by Dhanendra on date 07-06-2016*/
/*Add Height for cardScrlPnl from metadataxml height tag and comment height from simplePnl by Dhanendra 01-04-2016*/ /*Add Height for cardScrlPnl from metadataxml height tag and comment height from simplePnl by Dhanendra 01-04-2016*/
cardScrlPnl.setHeight(heightList.get(0)); cardScrlPnl.setHeight(heightList.get(0));
//simplePnl.setHeight(heightList.get(0)); //simplePnl.setHeight(heightList.get(0));
...@@ -259,7 +290,6 @@ public class CardBuilder ...@@ -259,7 +290,6 @@ public class CardBuilder
//simplePnl.add(verticalPnl); //simplePnl.add(verticalPnl);
return simplePnl; return simplePnl;
} }
/*Added by Dhanendra for Linked Chart on 06-March-16 Start */ /*Added by Dhanendra for Linked Chart on 06-March-16 Start */
public void setOnClick(final String linkMetadata, HTML html, final String url) public void setOnClick(final String linkMetadata, HTML html, final String url)
{ {
...@@ -270,6 +300,5 @@ public class CardBuilder ...@@ -270,6 +300,5 @@ public class CardBuilder
} }
}); });
} }
/*Added by Dhanendra for Linked Chart on 06-March-16 End */ /*Added by Dhanendra for Linked Chart on 06-March-16 End */
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment