Commit 0d41a232 authored by nsawalakhe's avatar nsawalakhe

Added vertical and horizontal view for card.

Request ID:S15ESER003


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@101670 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d002f5a2
......@@ -2,13 +2,17 @@ package ibase.client;
import java.util.ArrayList;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.json.client.JSONObject;
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.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
{
......@@ -34,27 +38,35 @@ public class CardBuilder
String layOutStr = "";
JSONObject fetchRowWiseVal = null;
ArrayList<ArrayList<String>> allCardList = new ArrayList<ArrayList<String>>();
final VerticalPanel verticalPnl = new VerticalPanel();
//final ScrollPanel verticalPnl=new ScrollPanel();
HorizontalPanel hOuterPnl = new HorizontalPanel();
int firstOcurence = 0;
String cardString = "";
String layoutHtmlStr = "";
HorizontalPanel horizontalPnl = null;
VerticalPanel vInnerPnl = null;
HTML html = null;
VerticalPanel verticalPnl= new VerticalPanel();
HorizontalPanel horizontalPnl= new HorizontalPanel();
cardScrlPnl.setStyleName("cardScrlPnl");
verticalPnl.setStyleName("cardVPnl");
verticalPnl.getElement().setAttribute("cellpadding", "2");
verticalPnl.getElement().setAttribute("cellspacing", "1");
/* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
VerticalPanel hOuterPnlFinal = new VerticalPanel();
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");
String id = "";
String dataString = "";
String componentIcon = "";
//String oldDataStr = "";
String linkMetadataName = "";
int anchorTagPresent = 0;
int count=0;
String propertyStr = "";
String panelView = null;
for (int i = 0; i < graphDtlList.size(); i++)
{
......@@ -90,6 +102,19 @@ public class CardBuilder
{
componentIcon = ""+ graphDtlList.get(i);
}
/*Add By swati for linkmetadataName on Date 05-05-2016*/
if (i == 8)
{
linkMetadataName = ""+ graphDtlList.get(i);
}
/*End By swati for linkmetadataName on Date 05-05-2016*/
/*Add By swati for Panel View on Date 16-05-2016*/
if (i == 9)
{
panelView = ""+ graphDtlList.get(i);
}
/*End By swati for Panel View on Date 16-05-2016*/
}
if (layoutList.get(0) != null)
{
......@@ -114,7 +139,6 @@ 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)
......@@ -128,6 +152,66 @@ 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;
for (ArrayList<String> cardDataList : allCardList)
{
/* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
if(ctr!=0 && ctr%3==0)
{
hOuterPnlFinal.add(hOuterPnl);
hOuterPnl = new HorizontalPanel();
hOuterPnl.setStyleName("cardVPnl");
hOuterPnl.getElement().setAttribute("cellpadding", "2");
hOuterPnl.getElement().setAttribute("cellspacing", "1");
}
/* Ended by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
layoutHtmlStr = layOutStr;
vInnerPnl = new VerticalPanel();
html = new HTML();
for (int i = 0; i < idList.size() - 1; i++)
{
id = idList.get(i);
dataString = cardDataList.get(i);
dataString = dataString.replace('"', ' ').trim();
layoutHtmlStr = layoutHtmlStr.replaceAll(id, dataString);
}
layoutHtmlStr = layoutHtmlStr.replace("{", "").replace("}", "");
/*Add Add parameters to url for hyper link data By Dhanendra on Date 01-04-2016*/
anchorTagPresent = layoutHtmlStr.indexOf("PARAMETERLIST");
if(anchorTagPresent > 0)
{
layoutHtmlStr = layoutHtmlStr.replaceAll("PARAMETERLIST", propertyStr);
}
/*End Add parameters to url for hyper link data By Dhanendra on Date 01-04-2016*/
html.setHTML(layoutHtmlStr);
vInnerPnl.add(html);
vInnerPnl.setStyleName("cardhorizontalPnl");
vInnerPnl.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
/*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);
}
/*End Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
hOuterPnl.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
hOuterPnl.add(vInnerPnl);
ctr++;
}
/* Added by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
if(ctr==allCardList.size())
{
hOuterPnlFinal.add(hOuterPnl);
}
/* Ended by Swati for 3 by 3 layout of card view for serdia on dated 09052016 */
cardScrlPnl.add(hOuterPnlFinal);//changed hOuterPnl to hOuterPnlFinal by swati for 3*3 layout
}
if(!panelView.equalsIgnoreCase("vertical") || panelView.equalsIgnoreCase("horizontal"))
{
for (ArrayList<String> cardDataList : allCardList)
{
layoutHtmlStr = layOutStr;
......@@ -137,7 +221,7 @@ public class CardBuilder
{
id = idList.get(i);
dataString = cardDataList.get(i);
dataString = dataString.replace('"', ' ');
dataString = dataString.replace('"', ' ').trim();
layoutHtmlStr = layoutHtmlStr.replaceAll(id, dataString);
}
layoutHtmlStr = layoutHtmlStr.replace("{", "").replace("}", "");
......@@ -153,10 +237,18 @@ public class CardBuilder
html.setHTML(layoutHtmlStr);
horizontalPnl.add(html);
horizontalPnl.setStyleName("cardhorizontalPnl");
verticalPnl.add(horizontalPnl);
/*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);
}
/*End Add parameters to url for hyper link data By Swati on Date 05-05-2016*/
verticalPnl.add(horizontalPnl);
}
cardScrlPnl.add(verticalPnl);
}
/*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));
......@@ -167,4 +259,17 @@ 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)
{
html.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.open(url, linkMetadata, "");
}
});
}
/*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