Commit 125d6683 authored by sbade's avatar sbade

Added parent axis facility to set the axis of graph and in metadataDtl added...

Added parent axis facility to set the axis of graph and in metadataDtl added parent axis list to store the data for parent axis data.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98468 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 56d04961
...@@ -7,8 +7,6 @@ import java.util.List; ...@@ -7,8 +7,6 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import sun.java2d.loops.RenderLoops;
import com.google.gwt.json.client.JSONObject; import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser; import com.google.gwt.json.client.JSONParser;
...@@ -78,6 +76,11 @@ public class ChartCreator ...@@ -78,6 +76,11 @@ public class ChartCreator
/*Added by Dhanendra */ /*Added by Dhanendra */
String componentIconName = ""; String componentIconName = "";
/*Ended by Dhanendra */ /*Ended by Dhanendra */
/*Added by Swati on 31-07-15*/
List<String> parentAxisList=new ArrayList<String>();
/*Ended by Swati on 31-07-15*/
for (int i = 0; i < graphDtlList.size(); i++) for (int i = 0; i < graphDtlList.size(); i++)
{ {
if (i == 3) if (i == 3)
...@@ -164,6 +167,12 @@ public class ChartCreator ...@@ -164,6 +167,12 @@ public class ChartCreator
componentIconName = ""+graphDtlList.get(i); componentIconName = ""+graphDtlList.get(i);
} }
/*add By Dhanendra for New Matadata Attribute*/ /*add By Dhanendra for New Matadata Attribute*/
/*add By Swati for Parent Axis Attribute*/
if (i == 23)
{
parentAxisList = (ArrayList<String>)graphDtlList.get(i);
}
/*end By Swati for Parent Axis Attribute*/
} }
int cnt=0; int cnt=0;
if (jsonObjGraph != null) if (jsonObjGraph != null)
...@@ -259,12 +268,30 @@ public class ChartCreator ...@@ -259,12 +268,30 @@ public class ChartCreator
if ("column".equals(renderInfoList.get(seriesCnt))) if ("column".equals(renderInfoList.get(seriesCnt)))
{ {
barMap.put(new JSONString("renderas"), new JSONString("Column")); barMap.put(new JSONString("renderas"), new JSONString("Column"));
barMap.put(new JSONString("parentYAxis"), new JSONString("s")); /*Added Code for Parent Axis By Dhanendra */
if(parentAxisList.size()>0)
{
barMap.put(new JSONString("parentYAxis"), new JSONString(parentAxisList.get(seriesCnt)));
}
else
{
barMap.put(new JSONString("parentYAxis"), new JSONString("S"));
}
/*Added Code for Parent Axis By Dhanendra */
} }
if ("line".equals(renderInfoList.get(seriesCnt))) if ("line".equals(renderInfoList.get(seriesCnt)))
{ {
barMap.put(new JSONString("renderas"), new JSONString("Line")); barMap.put(new JSONString("renderas"), new JSONString("Line"));
barMap.put(new JSONString("parentYAxis"), new JSONString("s")); /*Added Code for Parent Axis By Dhanendra */
if(parentAxisList.size()>0)
{
barMap.put(new JSONString("parentYAxis"), new JSONString(parentAxisList.get(seriesCnt)));
}
else
{
barMap.put(new JSONString("parentYAxis"), new JSONString("S"));
}
/*Added Code for Parent Axis By Dhanendra */
barMap.put(new JSONString("valuePosition"), new JSONString("ABOVE")); barMap.put(new JSONString("valuePosition"), new JSONString("ABOVE"));
} }
else else
...@@ -369,13 +396,12 @@ public class ChartCreator ...@@ -369,13 +396,12 @@ public class ChartCreator
} }
if(chartTypeList.get(0).trim().equals("stack")) if(chartTypeList.get(0).trim().equals("stack"))
{ {
int count=0;
//HashMap<String, String> dMap = new HashMap<String, String>(); //HashMap<String, String> dMap = new HashMap<String, String>();
int count = 0;
for (String keyString : valueMapSet) for (String keyString : valueMapSet)
{ {
count++; count++;
mapValuList = allDataMap.get(keyString); mapValuList = allDataMap.get(keyString);
jsnStringKey = new JSONString("label"); jsnStringKey = new JSONString("label");
dataStringKey = new JSONString("value"); dataStringKey = new JSONString("value");
String value = mapValuList.get(1).replace("{", ""); String value = mapValuList.get(1).replace("{", "");
...@@ -383,7 +409,6 @@ public class ChartCreator ...@@ -383,7 +409,6 @@ public class ChartCreator
String[] tempArray = value.split(","); String[] tempArray = value.split(",");
barMap = new LinkedHashMap<JSONValue, JSONValue>(); barMap = new LinkedHashMap<JSONValue, JSONValue>();
barValueList = new ArrayList<LinkedHashMap<JSONValue, JSONValue>>(); barValueList = new ArrayList<LinkedHashMap<JSONValue, JSONValue>>();
for(int i=0;i<tempArray.length;i++) for(int i=0;i<tempArray.length;i++)
{ {
if(! tempArray[i].equals("")) if(! tempArray[i].equals(""))
...@@ -412,11 +437,15 @@ public class ChartCreator ...@@ -412,11 +437,15 @@ public class ChartCreator
} }
} }
barMap.put(new JSONString("seriesname"), new JSONString(mapValuList.get(0))); barMap.put(new JSONString("seriesname"), new JSONString(mapValuList.get(0)));
if(renderInfoList.contains("line")){ if(renderInfoList.contains("line"))
if(count==renderInfoList.size() || count==(renderInfoList.size()-1) ){ {
barMap.put(new JSONString("renderas"), new JSONString("Line")); if(count==renderInfoList.size() || count==(renderInfoList.size()-1) )
} {
} barMap.put(new JSONString("renderas"), new JSONString("Line"));
}
}
barDataVal = JSONParser.parseStrict(barValueList.toString().replace('=', ':')); barDataVal = JSONParser.parseStrict(barValueList.toString().replace('=', ':'));
barMap.put(new JSONString("data"), barDataVal); barMap.put(new JSONString("data"), barDataVal);
allDataList.add(barMap); allDataList.add(barMap);
...@@ -424,7 +453,7 @@ public class ChartCreator ...@@ -424,7 +453,7 @@ public class ChartCreator
} }
categryDataVal = JSONParser.parseStrict(labelList.toString().replace('=', ':')); categryDataVal = JSONParser.parseStrict(labelList.toString().replace('=', ':'));
categryJson.put("category", categryDataVal); categryJson.put("category", categryDataVal);
graphJson.put("categories", categryJson); graphJson.put("categories", categryJson);
} }
/**Start of Linked chart logic by swati dates: 22 December 2014 **/ /**Start of Linked chart logic by swati dates: 22 December 2014 **/
......
...@@ -116,6 +116,10 @@ public class MetaDataDtl ...@@ -116,6 +116,10 @@ public class MetaDataDtl
String linkedMetadataName = ""; String linkedMetadataName = "";
String linkTypeName = ""; String linkTypeName = "";
//end on 20dec2014 by swati for linkedchart //end on 20dec2014 by swati for linkedchart
/*Add Veriable for Parent Axis */
String parentAxisName="";
ArrayList<String> parentAxisList = null;
/*End Veriable for Parent Axis */
//add on dated 9 july 201041 //add on dated 9 july 201041
Node chartPropertyNode = null; Node chartPropertyNode = null;
NodeList chartPropertyNodeList = null; NodeList chartPropertyNodeList = null;
...@@ -447,7 +451,9 @@ public class MetaDataDtl ...@@ -447,7 +451,9 @@ public class MetaDataDtl
linkedMetadataList = new ArrayList<String>(); linkedMetadataList = new ArrayList<String>();
linkTypeList = new ArrayList<String>(); linkTypeList = new ArrayList<String>();
//ended by swati 20dec2014 for linked chart //ended by swati 20dec2014 for linked chart
/*Added By Swati for parent axis */
parentAxisList= new ArrayList<String>();
/*Ended By Swati for parent axis */
/* Add By Dhanedra for metadata change */ /* Add By Dhanedra for metadata change */
groupTypeList = new ArrayList<String>(); groupTypeList = new ArrayList<String>();
componentCssList = new ArrayList<String>(); componentCssList = new ArrayList<String>();
...@@ -456,7 +462,7 @@ public class MetaDataDtl ...@@ -456,7 +462,7 @@ public class MetaDataDtl
groupFltrNameList = new ArrayList<String>(); groupFltrNameList = new ArrayList<String>();
String componentIconName = ""; String componentIconName = "";
/* End By Dhanedra for metadata change */ /* End By Dhanedra for metadata change */
metaDataMap = new LinkedHashMap<JSONString, JSONString>();
toolTextInfoList = new ArrayList<String>(); toolTextInfoList = new ArrayList<String>();
for (int i = 0; i < graphNodeList.getLength(); i++) for (int i = 0; i < graphNodeList.getLength(); i++)
...@@ -467,7 +473,6 @@ public class MetaDataDtl ...@@ -467,7 +473,6 @@ public class MetaDataDtl
if ("column_group".equalsIgnoreCase(childNodeName)) if ("column_group".equalsIgnoreCase(childNodeName))
{ {
attributeName = graphDataNode.getAttributes().getNamedItem("id").getNodeValue(); attributeName = graphDataNode.getAttributes().getNamedItem("id").getNodeValue();
if ("x_axis".equalsIgnoreCase(attributeName)) if ("x_axis".equalsIgnoreCase(attributeName))
{ {
xAxsisNodeList = graphDataNode.getChildNodes(); xAxsisNodeList = graphDataNode.getChildNodes();
...@@ -518,17 +523,12 @@ public class MetaDataDtl ...@@ -518,17 +523,12 @@ public class MetaDataDtl
yAxisColumnName.add(columnNode.getChildNodes().item(0).getNodeValue()); yAxisColumnName.add(columnNode.getChildNodes().item(0).getNodeValue());
renderDtl = columnNode.getAttributes().getNamedItem("render").getNodeValue(); renderDtl = columnNode.getAttributes().getNamedItem("render").getNodeValue();
renderInfoList.add(renderDtl); renderInfoList.add(renderDtl);
showValDtl = columnNode.getAttributes().getNamedItem("showvalue").getNodeValue(); showValDtl = columnNode.getAttributes().getNamedItem("showvalue").getNodeValue();
showValList.add(showValDtl); showValList.add(showValDtl);
colorDtl = columnNode.getAttributes().getNamedItem("color").getNodeValue(); colorDtl = columnNode.getAttributes().getNamedItem("color").getNodeValue();
colorInfoList.add(colorDtl); colorInfoList.add(colorDtl);
/* /*
* add code for * add code for* Tooltext by Dhanendra On 30-06-15
* Tooltext by
* Dhanendra On
* 30-06-15
*/ */
if (columnNode.getAttributes().getNamedItem("tooltext") != null) if (columnNode.getAttributes().getNamedItem("tooltext") != null)
{ {
...@@ -536,10 +536,7 @@ public class MetaDataDtl ...@@ -536,10 +536,7 @@ public class MetaDataDtl
toolTextInfoList.add(tooltextDtl); toolTextInfoList.add(tooltextDtl);
} }
/* /*
* End code for * End code for Tooltext by Dhanendra On 30-06-15
* Tooltext by
* Dhanendra On
* 30-06-15
*/ */
if (columnNode.getAttributes().getNamedItem("linevisibility") != null) if (columnNode.getAttributes().getNamedItem("linevisibility") != null)
{ {
...@@ -564,12 +561,22 @@ public class MetaDataDtl ...@@ -564,12 +561,22 @@ public class MetaDataDtl
linkTypeName = columnNode.getAttributes().getNamedItem("linktype").getNodeValue(); linkTypeName = columnNode.getAttributes().getNamedItem("linktype").getNodeValue();
linkTypeList.add(linkTypeName); linkTypeList.add(linkTypeName);
//added linked chart metadata name to graphdetail list by swati on 24 Dec 2014 //added linked chart metadata name to graphdetail list by swati on 24 Dec 2014
//added parent-axis to render column by swati on 31 July 2015
if (columnNode.getAttributes().getNamedItem("parentaxis") != null)
{
parentAxisName = columnNode.getAttributes().getNamedItem("parentaxis").getNodeValue();
parentAxisList.add(parentAxisName);
}
//ended parent-axis to render column by swati on 31 July 2015
} }
/*if (flag.equals("false")) /*
{ * if (flag.equals("false"))
metaDataMap.put(new JSONString("lineAlpha"), new JSONString("1")); {
metaDataMap.put(new JSONString("anchorBorderThickness"), new JSONString("3")); metaDataMap.put(new JSONString("lineAlpha"), new JSONString("1"));
}*/ metaDataMap.put(new JSONString("anchorBorderThickness"), new JSONString("3"));
}
*/
} }
//Window.alert("metaDataMap: "+metaDataMap); //Window.alert("metaDataMap: "+metaDataMap);
//added by swati "placevaluesinside": "1",rotatevalues //added by swati "placevaluesinside": "1",rotatevalues
...@@ -788,24 +795,14 @@ public class MetaDataDtl ...@@ -788,24 +795,14 @@ public class MetaDataDtl
} }
} }
} }
/* /* End Add new metadata tag for Compliance Report by Dhanendra on 25May2015 */
* End Add new metadata tag for
* Compliance Report by Dhanendra on
* 25May2015
*/
/* /* Add componentIcon tag in metadata by Dhanendra on 01-07-2015 */
* Add componentIcon tag in metadata
* by Dhanendra on 01-07-2015
*/
if ("component_icon".equalsIgnoreCase(childNodeName)) if ("component_icon".equalsIgnoreCase(childNodeName))
{ {
componentIconName = (graphDataNode.getChildNodes().item(0).getNodeValue()); componentIconName = (graphDataNode.getChildNodes().item(0).getNodeValue());
} }
/* /* End componentIcon tag in metadata by Dhanendra on 01-07-2015 */
* End componentIcon tag in metadata
* by Dhanendra on 01-07-2015
*/
} }
metaDataList.add(metaDataMap.toString().replace('=', ':')); metaDataList.add(metaDataMap.toString().replace('=', ':'));
...@@ -825,32 +822,25 @@ public class MetaDataDtl ...@@ -825,32 +822,25 @@ public class MetaDataDtl
graphDtlList.add(linkedProperties); graphDtlList.add(linkedProperties);
graphDtlList.add(linkTypeList); graphDtlList.add(linkTypeList);
//ended linked chart metadata name to graphdetail list by swati on 22 Dec 2014 //ended linked chart metadata name to graphdetail list by swati on 22 Dec 2014
/* /* Add Group to graphdetail list by Dhanendra on 25 May 2015 */
* Add Group to graphdetail list by
* Dhanendra on 25 May 2015
*/
graphDtlList.add(groupTypeList); graphDtlList.add(groupTypeList);
graphDtlList.add(componantTitlList); graphDtlList.add(componantTitlList);
graphDtlList.add(componentCssList); graphDtlList.add(componentCssList);
graphDtlList.add(groupFltrNameList); graphDtlList.add(groupFltrNameList);
/* /* Ended Group to graphdetail list by Dhanendra on 25 May 2015 */
* Ended Group to graphdetail list by
* Dhanendra on 25 May 2015
*/
/* Add For ToolText By Dhanendra */ /* Add For ToolText By Dhanendra */
graphDtlList.add(toolTextInfoList); graphDtlList.add(toolTextInfoList);
/* End For ToolText By Dhanendra */ /* End For ToolText By Dhanendra */
/* /* Add For componentIcon By Dhanendra on 01-07-15*/
* Add For componentIcon By Dhanendra on
* 01-07-15
*/
graphDtlList.add(componentIconName); graphDtlList.add(componentIconName);
/* /*
* End For componentIcon By Dhanendra on * End For componentIcon By Dhanendra on
* 01-07-15 * 01-07-15
*/ */
/*Add for Parent Axis by Swati */
graphDtlList.add(parentAxisList);
/*End for Parent Axis by Swati */
conuter++; conuter++;
gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap); gridNGraphMeataDataMap.put("type" + graphID, typeGraphMap);
graphMeataDataMap.put("graph" + conuter, graphDtlList); graphMeataDataMap.put("graph" + conuter, graphDtlList);
...@@ -975,15 +965,8 @@ public class MetaDataDtl ...@@ -975,15 +965,8 @@ public class MetaDataDtl
metaDataMap.put(jsnStringKey, dataStringValue); metaDataMap.put(jsnStringKey, dataStringValue);
} }
/* /*
* if * if ("legendpadding".equals(chartPropertyNode.getNodeName())) {
* ("legendpadding".equals * dataStringValue = new JSONString (chartPropertyNode.getChildNodes().item(0).getNodeValue
* (chartPropertyNode
* .getNodeName())) {
* dataStringValue = new
* JSONString
* (chartPropertyNode
* .getChildNodes
* ().item(0).getNodeValue
* ()); jsnStringKey = new * ()); jsnStringKey = new
* JSONString * JSONString
* ("legendpadding"); * ("legendpadding");
...@@ -1802,7 +1785,7 @@ public class MetaDataDtl ...@@ -1802,7 +1785,7 @@ public class MetaDataDtl
if ("filters".equals(rootNode.getNodeName())) if ("filters".equals(rootNode.getNodeName()))
{ {
filtrNodeList = rootNode.getChildNodes(); filtrNodeList = rootNode.getChildNodes();
for (int fltrCtr = 0; fltrCtr < filtrNodeList.getLength(); fltrCtr++) for (int fltrCtr = 0; fltrCtr < filtrNodeList.getLength(); fltrCtr++)
{ {
fltrDtlNodeList = filtrNodeList.item(fltrCtr).getChildNodes(); fltrDtlNodeList = filtrNodeList.item(fltrCtr).getChildNodes();
...@@ -1894,6 +1877,7 @@ public class MetaDataDtl ...@@ -1894,6 +1877,7 @@ public class MetaDataDtl
} }
fltrDtlList.add(filterInfo); fltrDtlList.add(filterInfo);
} }
} }
} }
} }
......
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