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;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
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.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant;
public class CardBuilder
{
......@@ -20,8 +20,9 @@ public class CardBuilder
/*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)
{
/*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> widthList = new ArrayList<String>();
ArrayList<String> layoutList = new ArrayList<String>();
......@@ -38,35 +39,48 @@ public class CardBuilder
String layOutStr = "";
JSONObject fetchRowWiseVal = null;
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;
String cardString = "";
String layoutHtmlStr = "";
VerticalPanel vInnerPnl = null;
HorizontalPanel horizontalPnl = null;
HTML html = null;
VerticalPanel verticalPnl= new VerticalPanel();
HorizontalPanel horizontalPnl= new HorizontalPanel();
cardScrlPnl.setStyleName("cardScrlPnl");
/* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
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.getElement().setAttribute("cellpadding", "2");
hOuterPnlFinal.getElement().setAttribute("cellspacing", "1");
/* Ended by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
hOuterPnl.setStyleName("cardVPnl");
hOuterPnl.getElement().setAttribute("cellpadding", "2");
hOuterPnl.getElement().setAttribute("cellspacing", "1");
verticalPnl.setStyleName("cardVPnl");
verticalPnl.getElement().setAttribute("cellpadding", "2");
verticalPnl.getElement().setAttribute("cellspacing", "1");
String id = "";
String dataString = "";
String componentIcon = "";
//String oldDataStr = "";
String linkMetadataName = "";
int anchorTagPresent = 0;
int count=0;
String propertyStr = "";
/*Add Verible by Dhanendra and swati*/
String linkMetadataName = "";
String panelView = null;
/*End Verible by Dhanendra and swati*/
for (int i = 0; i < graphDtlList.size(); i++)
{
......@@ -116,6 +130,11 @@ public class CardBuilder
}
/*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)
{
layOutStr = layoutList.get(0);
......@@ -139,6 +158,7 @@ public class CardBuilder
allCardList.add(dataList);
}
/*Add Add parameters to url for hyper link data By Dhanendra on Date 01-04-2016*/
for (FilterInfo filterInfo : filterList)
{
if(count==0)
......@@ -152,6 +172,7 @@ public class CardBuilder
count++;
}
/*End parameters to url for hyper link data By Dhanendra on Date 01-04-2016*/
if(panelView.equalsIgnoreCase("vertical"))
{
int ctr = 0;
......@@ -160,8 +181,10 @@ public class CardBuilder
/* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
if(ctr!=0 && ctr%3==0)
{
Window.alert("ctr :"+ctr);
hOuterPnlFinal.add(hOuterPnl);
hOuterPnl = new HorizontalPanel();
hOuterPnl.getElement().setId("hOuterPnl");
hOuterPnl.setStyleName("cardVPnl");
hOuterPnl.getElement().setAttribute("cellpadding", "2");
hOuterPnl.getElement().setAttribute("cellspacing", "1");
......@@ -193,7 +216,7 @@ public class CardBuilder
/*Add Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
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*/
hOuterPnl.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
......@@ -221,7 +244,7 @@ public class CardBuilder
{
id = idList.get(i);
dataString = cardDataList.get(i);
dataString = dataString.replace('"', ' ').trim();
dataString = dataString.replace('"', ' ');
layoutHtmlStr = layoutHtmlStr.replaceAll(id, dataString);
}
layoutHtmlStr = layoutHtmlStr.replace("{", "").replace("}", "");
......@@ -243,12 +266,20 @@ public class CardBuilder
//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*/
verticalPnl.add(horizontalPnl);
}
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*/
cardScrlPnl.setHeight(heightList.get(0));
//simplePnl.setHeight(heightList.get(0));
......@@ -259,7 +290,6 @@ public class CardBuilder
//simplePnl.add(verticalPnl);
return simplePnl;
}
/*Added by Dhanendra for Linked Chart on 06-March-16 Start */
public void setOnClick(final String linkMetadata, HTML html, final String url)
{
......@@ -270,6 +300,5 @@ public class CardBuilder
}
});
}
/*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