From 6beb446925c967aca92f5513adf36c5db77c00d6 Mon Sep 17 00:00:00 2001 From: TATTAVARADA Date: Thu, 27 Apr 2017 07:53:18 -0400 Subject: [PORTAL-7] Rebase This rebasing includes common libraries and common overlays projects abstraction of components Change-Id: Ia1efa4deacdc5701e6205104ac021a6c80ed60ba Signed-off-by: st782s --- .../portalsdk/core/domain/support/Attribute.java | 62 + .../core/domain/support/CollaborateList.java | 56 + .../portalsdk/core/domain/support/Container.java | 331 ++++++ .../portalsdk/core/domain/support/Domain.java | 259 +++++ .../portalsdk/core/domain/support/DomainVo.java | 166 +++ .../portalsdk/core/domain/support/Element.java | 165 +++ .../core/domain/support/ElementDetails.java | 71 ++ .../core/domain/support/FusionCommand.java | 39 + .../portalsdk/core/domain/support/Layout.java | 1209 ++++++++++++++++++++ .../portalsdk/core/domain/support/NameValueId.java | 94 ++ .../portalsdk/core/domain/support/Position.java | 40 + .../portalsdk/core/domain/support/Size.java | 40 + 12 files changed, 2532 insertions(+) create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Attribute.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/CollaborateList.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Container.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Domain.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/DomainVo.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Element.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/ElementDetails.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/FusionCommand.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Layout.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/NameValueId.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Position.java create mode 100644 ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Size.java (limited to 'ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support') diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Attribute.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Attribute.java new file mode 100644 index 00000000..a78d7bfa --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Attribute.java @@ -0,0 +1,62 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +public class Attribute { + public double width; + public double top; + public double left; + public String name; + public double height; + + public double getWidth() { + return width; + } + public void setWidth(double width) { + this.width = width; + } + public double getTop() { + return top; + } + public void setTop(double top) { + this.top = top; + } + public double getLeft() { + return left; + } + public void setLeft(double left) { + this.left = left; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public double getHeight() { + return height; + } + public void setHeight(double height) { + this.height = height; + } + + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/CollaborateList.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/CollaborateList.java new file mode 100644 index 00000000..eaeab84d --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/CollaborateList.java @@ -0,0 +1,56 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import java.io.Serializable; +import java.util.HashSet; + +public class CollaborateList implements Serializable { + + private static final long serialVersionUID = -4104440747626736243L; + private HashSet userNameList = new HashSet(); + private static CollaborateList userListData = new CollaborateList(); + private CollaborateList(){} + + public static CollaborateList getInstance(){ + return userListData; + } + + public HashSet getAllUserName(){ + return userNameList; + } + + public static void addUserName(String name){ + final HashSet allUserName = CollaborateList.getInstance().getAllUserName(); + if(allUserName.contains(name)){ + //System.out.println("cannot add this user"); + }else{ + allUserName.add(name); + } + } + + public static void delUserName(String name){ + final HashSet allUserName = CollaborateList.getInstance().getAllUserName(); + allUserName.remove((String) name); + } + + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Container.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Container.java new file mode 100644 index 00000000..88a9fa71 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Container.java @@ -0,0 +1,331 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import java.util.List; +import java.util.Map; + +public class Container { + + String id; + + public String name; + + Size size; + + Position p; + + public Map containerRowCol; + + public Map elementRowCol; + + int numOfRows; + + int numOfCols; + + double sum = 0; + + double interEleWd; + + double interEleH; + + double interEleToContainerWd; + + double interEleToContainerH; + + double interEleToInnerContainerWd; + + double interEleToInnerContainerH; + + public double top; + + public double left; + + public double height; + + public double width; + + public String visibilityType; + + + + + + public Container(String id, String name, int numOfRows, int numOfCols, double interEleWd, double interEleH, + double interEleToContainerWd, double interEleToContainerH, double interEleToInnerContainerWd, + double interEleToInnerContainerH) { + + this.id = id; + this.name = name; + this.numOfRows = numOfRows; + this.numOfCols = numOfCols; + this.interEleWd = interEleWd; + this.interEleH = interEleH; + this.interEleToContainerWd = interEleToContainerWd; + this.interEleToContainerH = interEleToContainerH; + this.interEleToInnerContainerWd = interEleToInnerContainerWd; + this.interEleToInnerContainerH = interEleToInnerContainerH; + + } + + + public List innerCList; + + public List elementList; + + public Container() { + + } + + + + public Map getContainerRowCol() { + return containerRowCol; + } + + + + + public Map getElementRowCol() { + return elementRowCol; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + public void setInnerContainer(Map innerCon) { + containerRowCol = innerCon; + } + + public void setElements(Map innerE) { + elementRowCol = innerE; + } + + + public Position getP() { + return p; + } + + public void setP(Position p) { + this.p = p; + } + + + public void setTop(double top) { + this.top = top; + } + + + public void setLeft(double left) { + this.left = left; + } + + + public void setHeight(double height) { + this.height = height; + } + + + public void setWidth(double width) { + this.width = width; + } + + + public void setInnerCList(List innerCList) { + this.innerCList = innerCList; + } + + + + public void setElementList(List elementList) { + this.elementList = elementList; + } + + public void setVisibilityType(String visibilityType) { + this.visibilityType = visibilityType; + } + + public Size computeSize() { + Size size = new Size(); + double width = 0; + double height = 0; + // System.out.println("Inside computesize"); + for (int i = 0; i0; chk--) { + if (containerRowCol.containsKey(String.valueOf(k)+ String.valueOf(chk-1))) { + if (containerRowCol.get(String.valueOf(k)+ String.valueOf(chk-1)).computeSize().getWidth() + + containerRowCol.get(String.valueOf(k)+ String.valueOf(chk-1)).getP().getX() > p.x) { + ysum+= containerRowCol.get(String.valueOf(k)+ String.valueOf(chk-1)).computeSize().getHeight(); + break; + } + } + } + } + + } + if (this.getName().equals("Broadworks complex") || this.getName().equals("Application Servers") + || this.getName().equals("Call Session Control") || this.getName().equals("GMLC Provider") || this.getName().equals("Neo") || this.getName().equals("Support")) { + p.y = this.getP().getY()+ysum+i*interEleH+interEleToInnerContainerH+1; + } else { + // System.out.println("element name "+e.getName()+" this.getP().getY() "+this.getP().getY() + // +" ysum " +ysum+" i*interEleH "+i*interEleH+" interEleToContainerH " +interEleToContainerH); + if (e.getName().equals("")) { + p.y = this.getP().getY()+ysum+i*interEleH+(interEleToContainerH); + //System.out.println("test element name "+this.getName()+" Container height "+this.computeSize().getHeight()+" this.getP().getY() "+this.getP().getY() + // +" ysum " +ysum+" i*interEleH "+i*interEleH+" interEleToContainerH-3 " +interEleToContainerH+" p.y "+p.y); + }else + p.y = this.getP().getY()+ysum+i*interEleH+interEleToContainerH; + // System.out.println(e.getName()+"My contain this.getP().getY() "+this.getP().getY() + // +"elements Y "+p.y); + } + xsum+= e.computeSize().getWidth(); + e.setP(p); + //System.out.println("my element name "+e.getName()+" e.getP().getX() "+e.getP().getX()); + //System.out.println(); + } + } + xsum = 0; + } + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Domain.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Domain.java new file mode 100644 index 00000000..a21ff395 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Domain.java @@ -0,0 +1,259 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class Domain { + // Unique identifier of the domain + String id; + // List cList; + + public String name; + Size size; + Position p; + + //Attribute1 at; + + public Position getP() { + return p; + } + + public void setP(Position p) { + this.p = p; + } + + //Horizontal space between a pair of containers + double interContWd = 1.0; + //Vertical space between a pair of containers + double interContH; + double domainToLayoutWd; + double domainToContH; + double domainToLayoutH; + int numOfRowsofContainer; + int numOfColsofContainer; + boolean indexChanged; + Map containerRowCol; + public Domain(String id, String name, double interContWd, double interContH, double domainToLayoutWd, + double domainToLayoutH, double domainToContH, int numOfRowsofContainer, int numOfColsofContainer) { + this.id = id; + this.name = name; + this.interContWd = interContWd; + this.interContH = interContH; + this.domainToLayoutWd = domainToLayoutWd; + this.domainToLayoutH = domainToLayoutH; + this.domainToContH = domainToContH; + this.numOfRowsofContainer = numOfRowsofContainer; + this.numOfColsofContainer = numOfColsofContainer; + // at = new Attribute1(); + } + + + + + public double top; + + public double left; + + public double height; + + public double width; + + public List containerList; + + public double newXafterColl; + + public double YafterColl; + + public void setNewXafterColl(double newXafterColl) { + this.newXafterColl = newXafterColl; + } + + public double getNewXafterColl() { + return newXafterColl; + } + + public double getYafterColl() { + return YafterColl; + } + + public void setYafterColl(double yafterColl) { + YafterColl = yafterColl; + } + + public void setDomainToLayoutWd(double domainToLayoutWd) { + this.domainToLayoutWd = domainToLayoutWd; + } + + public double getDomainToLayoutWd() { + return domainToLayoutWd; + } + + public double getTop() { + return top; + } + + public void setTop(double top) { + this.top = top; + } + + public double getLeft() { + return left; + } + + public void setLeft(double left) { + this.left = left; + } + + public double getHeight() { + return height; + } + + public void setHeight(double height) { + this.height = height; + } + + public double getWidth() { + return width; + } + + public void setWidth(double width) { + this.width = width; + } + + public void setName(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setContainers(Map containerRowCol) { + this.containerRowCol = containerRowCol; + } + + public Map getContainerRowCol() { + return containerRowCol; + } + + + /* public Attribute1 getAt() { + return at; + } + + public void setAt(Attribute1 at) { + this.at = at; + }*/ + + public void setContainerList(List containerList) { + // new ArrayList(); + this.containerList = containerList; + } + + + +/* public boolean isCollapsed() { + return collapsed; + } + + public void setCollapsed(boolean collapsed) { + this.collapsed = collapsed; + }*/ + + public boolean isIndexChanged() { + return indexChanged; + } + + public void setIndexChanged(boolean indexChanged) { + this.indexChanged = indexChanged; + } + + //Compute the size of any domain + public Size computeSize() { + size = new Size(); + size.setHeight(5); + double width = 0; + for (int i = 0; i < numOfRowsofContainer; i++) { + if (containerRowCol!=null && containerRowCol.containsKey(String.valueOf(i)+String.valueOf(numOfColsofContainer-1))) { + for (int j = 0; j < numOfColsofContainer; j++) { + width+=containerRowCol.get(String.valueOf(i)+String.valueOf(j)).computeSize().getWidth(); + } + break; + } + + } + width+=(numOfColsofContainer-1)*interContWd; + if (this.getName().equals("VNI")) + size.setWidth(width-4); + else + size.setWidth(width); + return size; + } + + public void computeConatinerPositions() { + + double xsum = 0; + double ysum = 0; + for (int i=0; i< numOfRowsofContainer; i++){ + for (int j=0; j0 && containerRowCol.containsKey(String.valueOf(k)+ String.valueOf(j-1)) && + !containerRowCol.get(String.valueOf(i)+ String.valueOf(j)).getName().equals("AIC - Alpharetta")) { + ysum+= containerRowCol.get(String.valueOf(k)+ String.valueOf(j-1)).computeSize().getHeight(); + } + } + //System.out.println("C name "+c.getName()+" ysum "+ysum+" domainToLayoutH "+domainToLayoutH+" this.computeSize().getHeight() "+ + // this.computeSize().getHeight()+" domainToContH "+domainToContH+" interContH "+interContH); + p.y = domainToLayoutH+ysum+this.computeSize().getHeight()+ + domainToContH+i*interContH; + + c.setP(p); + xsum+= c.computeSize().getWidth(); + + } + } + xsum = 0; + + } + + } + +} + + diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/DomainVo.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/DomainVo.java new file mode 100644 index 00000000..369cc4cd --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/DomainVo.java @@ -0,0 +1,166 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.Date; +import java.util.Set; + +import org.openecomp.portalsdk.core.domain.FusionVo; + + +/* Super class from which all data objects descend */ +public class DomainVo extends FusionVo implements Serializable, Cloneable, Comparable { + + protected Long id; + protected Date created; + protected Date modified; + protected Long createdId; + protected Long modifiedId; + protected Long rowNum; + + protected Serializable auditUserId; + + Set auditTrail = null; + + public DomainVo() {} + + + public void setId(Long i) { + id = i; + } + + public void setCreated(Date created) { + this.created = created; + } + + public void setModified(Date modified) { + this.modified = modified; + } + + public void setCreatedId(Long createdId) { + this.createdId = createdId; + } + + public void setModifiedId(Long modifiedId) { + this.modifiedId = modifiedId; + } + + public void setAuditUserId(Serializable auditUserId) { + this.auditUserId = auditUserId; + } + + public void setRowNum(Long rowNum) { + this.rowNum = rowNum; + } + + public void setAuditTrail(Set auditTrail) { + this.auditTrail = auditTrail; + } + + public Long getId() { + return id; + } + + public Date getCreated() { + return created; + } + + public Date getModified() { + return modified; + } + + public Long getCreatedId() { + return createdId; + } + + public Long getModifiedId() { + return modifiedId; + } + + public Serializable getAuditUserId() { + return auditUserId; + } + + public Long getRowNum() { + return rowNum; + } + + public Set getAuditTrail() { + return auditTrail; + } + + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + + public Object copy() { + return copy(false); + } + + + public Object copy(boolean isIdNull) { + // let's create a "copy" of the object using serialization + ByteArrayOutputStream baos = null; + ByteArrayInputStream bais = null; + ObjectOutputStream oos = null; + ObjectInputStream ois = null; + + DomainVo newVo = null; + + try { + + baos = new ByteArrayOutputStream(); + oos = new ObjectOutputStream(baos); + oos.writeObject(this); + + bais = new ByteArrayInputStream(baos.toByteArray()); + ois = new ObjectInputStream(bais); + newVo = (DomainVo)ois.readObject(); + + if (isIdNull) { + newVo.setId(null); + } + + } + catch (Exception e) { + e.printStackTrace(); + } + + return newVo; + } + + + + public int compareTo(Object obj){ + Long c1 = getId(); + Long c2 = ((DomainVo)obj).getId(); + + return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2); + } + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Element.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Element.java new file mode 100644 index 00000000..567487de --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Element.java @@ -0,0 +1,165 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class Element { + + public String id; + public String name; + + public double top; + + public double left; + + public double height; + + public String imgFileName; + + public String borderType; + + public String bgColor; + + public ElementDetails details; + + //public List details; + + + public void setBgColor(String bgColor) { + this.bgColor = bgColor; + } + + public void setId(String id) { + this.id = id; + } + + public void setTop(double top) { + this.top = top; + } + + public void setLeft(double left) { + this.left = left; + } + + public void setHeight(double height) { + this.height = height; + } + + public void setWidth(double width) { + this.width = width; + } + + + public double width; + + + public String getId() { + return id; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + Position p; + + public Position getP() { + return p; + } + + public void setP(Position p) { + this.p = p; + } + + + + public Element(String id, String name, String imgPath, String bgColor, String logical_group, String display_longname, + String description, String primary_function, String key_interfaces, String location, String vendor, String vendor_shortname) { + this.id = id; + this.name = name; + this.imgFileName = imgPath; + this.bgColor = bgColor; + + + } + + public Element(String id, String name) { + this.id = id; + this.name = name; + } + + public Element(String id, String name, String imgFilename, String bgColor, String borderType, ElementDetails details) { + this.id = id; + this.name = name; + this.imgFileName = imgFilename; + this.bgColor = bgColor; + this.borderType = borderType; + this.details = details; + + } + + + public void setBorderType(String borderType) { + this.borderType = borderType; + } + + public String getImgFileName() { + return imgFileName; + } + + public void setImgFileName(String imgFileName) { + this.imgFileName = imgFileName; + } + + public String getBorderType() { + return borderType; + } + + + + public ElementDetails getDetails() { + return details; + } + + + + public void setDetails(ElementDetails details) { + this.details = details; + } + + public Size computeSize() { + Size size= new Size(); + size.setWidth(0.5*7.0); + size.setHeight(0.5*3.0); + // size.setWidth(0.5*10.0); + // size.setHeight(0.5*6.0); + return size; + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/ElementDetails.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/ElementDetails.java new file mode 100644 index 00000000..0e22d639 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/ElementDetails.java @@ -0,0 +1,71 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import java.util.HashMap; +import java.util.Map; + +public class ElementDetails { + public String logical_group; + public String display_longname; + public String description; + public String primary_function; + public String network_function; + public String key_interfaces; + public String location; + public String vendor; + public String vendor_shortname; + public String enclosingContainer; + + +// public Map details1; + +// public ElementDetails(Map details) { + + // this.details = new HashMap(); + // this.details1 = details; +// } + + + + + + public ElementDetails(String logical_group, String display_longname, String description, String primary_function, String network_function, + String key_interfaces, String location, String vendor, String vendor_shortname, String enclosingContainer) { + + this.logical_group = logical_group; + this.display_longname = display_longname; + this.description = description; + this.primary_function = primary_function; + this.network_function = network_function; + this.key_interfaces = key_interfaces; + this.location = location; + this.vendor = vendor; + this.vendor_shortname = vendor_shortname; + this.enclosingContainer = enclosingContainer; + } + + public void setLogical_group(String logical_group) { + this.logical_group = logical_group; + } + + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/FusionCommand.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/FusionCommand.java new file mode 100644 index 00000000..6ac85b6f --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/FusionCommand.java @@ -0,0 +1,39 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import org.openecomp.portalsdk.core.FusionObject; + +public class FusionCommand implements FusionObject { + + private String task; + + public FusionCommand() { + } + + public String getTask() { + return task; + } + + public void setTask(String task) { + this.task = task; + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Layout.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Layout.java new file mode 100644 index 00000000..0d78e5dd --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Layout.java @@ -0,0 +1,1209 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +public class Layout { + //width of the screen +// double width; + //height of the screen; +// double height; + // Total number of domains present on the screen and assume that + + public Map domainRowCol; + + Map originalDomainRowCol; + + //Horizontal space between a pair of domains + double interDomainWd; + //Vertical space between a pair of domains + double interDomainH; + //Computing the co-ordinates of any domain + int numberofRowsofDomains; + + int numberofColsofDomains; + + Map collapsedDomains; + + List collapsedDomainsNewList; + + public List getCollapsedDomainsNewList() { + return collapsedDomainsNewList; + } + + public void setCollapsedDomainsNewList(List collapsedDomainsNewList) { + this.collapsedDomainsNewList = collapsedDomainsNewList; + } + + public void setCollapsedDomains(Map collapsedDomains) { + this.collapsedDomains = collapsedDomains; + } + + public Map getCollapsedDomains() { + return collapsedDomains; + } + + public int getNumberofColsofDomains() { + return numberofColsofDomains; + } + + public void setNumberofColsofDomains(int numberofColsofDomains) { + this.numberofColsofDomains = numberofColsofDomains; + } + + public Layout(Map domainRowCol, double interDomainWd, double interDomainH, + int numberofRowsofDomains, int numberofColsofDomains) { + + this.domainRowCol = domainRowCol; + this.interDomainWd = interDomainWd; + this.interDomainH = interDomainH; + this.numberofRowsofDomains = numberofRowsofDomains; + this.numberofColsofDomains = numberofColsofDomains; + this.collapsedDomains = new HashMap(); + this.originalDomainRowCol = new TreeMap(); + //nline + this.collapsedDomainsNewList = new ArrayList(); + } + + public Map getDomainRowCol() { + return domainRowCol; + } + + public void setDomainRowCol(Map domainRowCol) { + this.domainRowCol = domainRowCol; + } + + + public void computeDomainPositions() { + double xsum = 0; + double domainTolayout = 10.6; + for (int i=0; i< numberofRowsofDomains; i++){ + for (int j=0; j 0) + p.x+= accountForPlusSpaceBefore(d); + xsum+=d.computeSize().getWidth(); + double ysum=0; + for (int k=0; k enclosedContainers = d.getContainerRowCol(); + for (Map.Entry entry : enclosedContainers.entrySet()) { + if (entry.getKey().equals("00")) { + double containerX = entry.getValue().getP().getX(); + p.x = containerX; + double ysum=0; + for (int k=0; k updatedRC = new HashMap(); + + for (Map.Entry copyEntry : domainRowCol.entrySet()) { + updatedRC.put(copyEntry.getKey(), copyEntry.getValue()); + // System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + + Map updatedRCSorted = new TreeMap(updatedRC); + + Map collapsedDomainMap = getCollapsedDomains(); + + List collapsedDomainNewL = getCollapsedDomainsNewList(); + + + if (collapsedDomainNewL.size() == 0) { + for (Map.Entry copyEntry : domainRowCol.entrySet()) { + originalDomainRowCol.put(copyEntry.getKey(), copyEntry.getValue()); + // System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + } + + + Map updatedRCSortedTrunc = new TreeMap(); + + int colToDelete = 0; + for (Map.Entry entry : updatedRCSorted.entrySet()) { + if (entry.getValue().getName().equals(domainsToCollapse)) { + if (entry.getValue().isIndexChanged()) { + collapsedDomainMap.put("0"+String.valueOf(Integer.parseInt(entry.getKey())+1), entry.getValue()); + + } + //Domain toRemove = entry.getValue(); + else { + collapsedDomainMap.put(entry.getKey(),entry.getValue()); + } + + collapsedDomainNewL.add(entry.getValue()); + setNumberofColsofDomains(getNumberofColsofDomains()-1); + updatedRC.remove(entry.getKey()); + colToDelete = Character.getNumericValue(entry.getKey().toCharArray()[1]); + break; + } + } + + + for (Map.Entry copyEntry : updatedRCSorted.entrySet()) { + updatedRCSortedTrunc.put(copyEntry.getKey(), copyEntry.getValue()); + //System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + + for (Map.Entry rmv : updatedRCSorted.entrySet()) { + if (Character.getNumericValue(rmv.getKey().toCharArray()[1]) <= colToDelete) { + updatedRCSortedTrunc.remove(rmv.getKey()); + } + } + + + /* for (Map.Entry entry : updatedRCSortedTrunc.entrySet()) { + System.out.println("Sorted key: "+entry.getKey()+" Sorted value: "+entry.getValue().getName()); + }*/ + + for (Map.Entry updateOthers : updatedRCSortedTrunc.entrySet()) { + char update[] = updateOthers.getKey().toCharArray(); + int charToupdate = Character.getNumericValue(update[1]); + --charToupdate; + String resultRowCol = String.valueOf(update[0])+String.valueOf(charToupdate); + updateOthers.getValue().setIndexChanged(true); + updatedRC.put(resultRowCol, updateOthers.getValue()); + updatedRC.remove(updateOthers.getKey()); + + } + setDomainRowCol(updatedRC); + + /* for (Map.Entry entry : updatedRC.entrySet()) { + System.out.println("Sorted key: "+entry.getKey()+" Sorted value: "+entry.getValue().getName()); + }*/ + + double currDistFromLftM = 11.0; + int orgColofCollapsedd = -1; + int orgColofDisplayedd = -1; + for (Map.Entry cd : updatedRC.entrySet()) { + /*for (Domain pl : collapsedDomainNewL) { + for (Map.Entry colCheck : originalDomainRowCol.entrySet()) { + if (colCheck.getValue().getName().equals(pl.getName())) { + orgColofCollapsedd = Character.getNumericValue(colCheck.getKey().toCharArray()[1]); + break; + } + } + + for (Map.Entry colCheckk : originalDomainRowCol.entrySet()) { + if (colCheckk.getValue().getName().equals(cd.getValue().getName())) { + orgColofDisplayedd = Character.getNumericValue(colCheckk.getKey().toCharArray()[1]); + break; + } + } + + if (orgColofCollapsedd < orgColofDisplayedd) { + currDistFromLftM+= 3; + } + }*/ + Domain d = cd.getValue(); + double accountPlus = accountForPlusSpaceBefore(d); + // currDistFromLftM+= accountForPlusSpaceBefore(d); + d.setDomainToLayoutWd(currDistFromLftM+accountPlus); + d.computeConatinerPositions(); + for (Map.Entry entry1 : d.getContainerRowCol().entrySet()) { + Container c = entry1.getValue(); + c.computeSize(); + c.computeElementPositions(); + if (c.getContainerRowCol() != null) { + for (Map.Entry entryInner : c.getContainerRowCol().entrySet()) { + Container inner = entryInner.getValue(); + inner.computeElementPositions(); + } + } + } + currDistFromLftM += d.computeSize().getWidth()+2; + + } + + + + + //nline + // Insert method invocation + updatePlusPosition(collapsedDomainNewL, updatedRC); + + //order changed + setCollapsedDomains(collapsedDomainMap); + setCollapsedDomainsNewList(collapsedDomainNewL); + + + computeDomainPositionsModified(); + return this; + } + + + + public Layout collapseDomainNew(String domainsToCollapse) { + + if(domainsToCollapse == null || domainsToCollapse.isEmpty()) + return null; + + Map updatedRC = new HashMap(); + + for (Map.Entry copyEntry : domainRowCol.entrySet()) { + updatedRC.put(copyEntry.getKey(), copyEntry.getValue()); + //System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + + Map updatedRCSorted = new TreeMap(updatedRC); + + Map collapsedDomainMap = getCollapsedDomains(); + + List collapsedDomainNewL = getCollapsedDomainsNewList(); + + + if (collapsedDomainNewL.size() == 0) { + for (Map.Entry copyEntry : domainRowCol.entrySet()) { + originalDomainRowCol.put(copyEntry.getKey(), copyEntry.getValue()); + // System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + } + + + Map updatedRCSortedTrunc = new TreeMap(); + + int colToDelete = 0; + for (Map.Entry entry : updatedRCSorted.entrySet()) { + if (entry.getValue().getName().equals(domainsToCollapse)) { + if (entry.getValue().isIndexChanged()) { + collapsedDomainMap.put("0"+String.valueOf(Integer.parseInt(entry.getKey())+1), entry.getValue()); + + } + //Domain toRemove = entry.getValue(); + else { + collapsedDomainMap.put(entry.getKey(),entry.getValue()); + } + + collapsedDomainNewL.add(entry.getValue()); + setNumberofColsofDomains(getNumberofColsofDomains()-1); + updatedRC.remove(entry.getKey()); + colToDelete = Character.getNumericValue(entry.getKey().toCharArray()[1]); + break; + } + } + + + for (Map.Entry copyEntry : updatedRCSorted.entrySet()) { + updatedRCSortedTrunc.put(copyEntry.getKey(), copyEntry.getValue()); + //System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + + for (Map.Entry rmv : updatedRCSorted.entrySet()) { + if (Character.getNumericValue(rmv.getKey().toCharArray()[1]) <= colToDelete) { + updatedRCSortedTrunc.remove(rmv.getKey()); + } + } + + + /* for (Map.Entry entry : updatedRCSortedTrunc.entrySet()) { + System.out.println("Sorted key: "+entry.getKey()+" Sorted value: "+entry.getValue().getName()); + }*/ + + for (Map.Entry updateOthers : updatedRCSortedTrunc.entrySet()) { + char update[] = updateOthers.getKey().toCharArray(); + int charToupdate = Character.getNumericValue(update[1]); + --charToupdate; + String resultRowCol = String.valueOf(update[0])+String.valueOf(charToupdate); + updateOthers.getValue().setIndexChanged(true); + updatedRC.put(resultRowCol, updateOthers.getValue()); + updatedRC.remove(updateOthers.getKey()); + + } + setDomainRowCol(updatedRC); + + double currDistFromLftM = 11.0; + + boolean isDisplayed; + for (Map.Entry orgEntry : originalDomainRowCol.entrySet()) { + isDisplayed = false; + for (Map.Entry cd : updatedRC.entrySet()) { + if (cd.getValue().getName().equals(orgEntry.getValue().getName())) { + Domain d = cd.getValue(); + d.setDomainToLayoutWd(currDistFromLftM); + d.computeConatinerPositions(); + for (Map.Entry entry1 : d.getContainerRowCol().entrySet()) { + Container c = entry1.getValue(); + c.computeSize(); + c.computeElementPositions(); + if (c.getContainerRowCol() != null) { + for (Map.Entry entryInner : c.getContainerRowCol().entrySet()) { + Container inner = entryInner.getValue(); + inner.computeElementPositions(); + } + } + } + currDistFromLftM += d.computeSize().getWidth()+1; + isDisplayed = true; + break; + } + } + + if (!isDisplayed) { + Domain myCollapsed = orgEntry.getValue(); + myCollapsed.setNewXafterColl(currDistFromLftM); + myCollapsed.setYafterColl(myCollapsed.getP().getY()); + currDistFromLftM += 4; + } + } + + setCollapsedDomains(collapsedDomainMap); + setCollapsedDomainsNewList(collapsedDomainNewL); + + + computeDomainPositionsModified(); + return this; + + } + + + public Layout collapseDomain(String domainsToCollapse) { + + Map updatedRC = new HashMap(); + + for (Map.Entry copyEntry : domainRowCol.entrySet()) { + updatedRC.put(copyEntry.getKey(), copyEntry.getValue()); + //System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + + Map updatedRCSorted = new TreeMap(updatedRC); + + Map collapsedDomainMap = getCollapsedDomains(); + + if (collapsedDomainMap.size() == 0) { + for (Map.Entry copyEntry : domainRowCol.entrySet()) { + originalDomainRowCol.put(copyEntry.getKey(), copyEntry.getValue()); + // System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + } + + + // List collapsedDomainsList = getCollapsedDomains(); + + /* for (Map.Entry entry : updatedRCSorted.entrySet()) { + System.out.println("Sorted Key: "+entry.getKey()); + }*/ + + double prevDomXCordinate = 0.0; + Map updatedRCSortedTrunc = new TreeMap(); + // for (String dToCollapse : domainsToCollapse) { + int colToDelete = 0; + for (Map.Entry entry : updatedRCSorted.entrySet()) { + if (entry.getValue().getName().equals(domainsToCollapse)) { + if (entry.getValue().isIndexChanged()) + collapsedDomainMap.put("0"+String.valueOf(Integer.parseInt(entry.getKey())+1), entry.getValue()); + //Domain toRemove = entry.getValue(); + else + collapsedDomainMap.put(entry.getKey(),entry.getValue()); + prevDomXCordinate = entry.getValue().getP().getX(); + entry.getValue().getP().setX(prevDomXCordinate-2); + // toRemove.setCollapsed(true); + setNumberofColsofDomains(getNumberofColsofDomains()-1); + updatedRC.remove(entry.getKey()); + colToDelete = Character.getNumericValue(entry.getKey().toCharArray()[1]); + // collapsedDomainList.put(entry.getKey(),entry.getValue()); + break; + } + } + + /* for (Map.Entry entry : updatedRC.entrySet()) { + System.out.println("Sorted key: "+entry.getKey()+" Sorted value: "+entry.getValue().getName()); + }*/ + + setCollapsedDomains(collapsedDomainMap); + + for (Map.Entry copyEntry : updatedRCSorted.entrySet()) { + updatedRCSortedTrunc.put(copyEntry.getKey(), copyEntry.getValue()); + //System.out.println("copyEntry.getKey() "+copyEntry.getKey()+ " copyEntry.getValue() "+copyEntry.getValue()); + } + + for (Map.Entry rmv : updatedRCSorted.entrySet()) { + if (Character.getNumericValue(rmv.getKey().toCharArray()[1]) <= colToDelete) { + updatedRCSortedTrunc.remove(rmv.getKey()); + } + } + + + /* for (Map.Entry entry : updatedRCSortedTrunc.entrySet()) { + System.out.println("Sorted key: "+entry.getKey()+" Sorted value: "+entry.getValue().getName()); + }*/ + + for (Map.Entry updateOthers : updatedRCSortedTrunc.entrySet()) { + // if (!updateOthers.getValue().getName().equals(dToCollapse)) { + // if ((int)updateOthers.getKey().toCharArray()[1] > colToDelete) { + char update[] = updateOthers.getKey().toCharArray(); + int charToupdate = Character.getNumericValue(update[1]); + --charToupdate; + String resultRowCol = String.valueOf(update[0])+String.valueOf(charToupdate); + // update[1] = (char)charToupdate; + // updatedRC.put(String.valueOf(update), updateOthers.getValue()); + updateOthers.getValue().setIndexChanged(true); + updatedRC.put(resultRowCol, updateOthers.getValue()); + updatedRC.remove(updateOthers.getKey()); + // } + // } + } + + // } + setDomainRowCol(updatedRC); + + + + for (Map.Entry entry : updatedRCSortedTrunc.entrySet()) { + Domain d = entry.getValue(); + // if (d.getName().equals("Datacenter with AIC") || d.getName().equals("VNI")) { + // d.setDomainToLayoutWd(d.getDomainToLayoutWd()-33); + if (collapsedDomains.size() == 2 && collapsedDomains.containsKey("00") && collapsedDomains.containsKey("01") && domainsToCollapse.equals("RAN")) { + if (d.getName().equals("USP")) + d.setDomainToLayoutWd(prevDomXCordinate); + else if (d.getName().equals("VNI")) + d.setDomainToLayoutWd(prevDomXCordinate+8); + else + d.setDomainToLayoutWd(prevDomXCordinate+10); + //System.out.println("Inside RAN EPC"); + } + else if (domainsToCollapse.equals("RAN") && !d.getName().equals("EPC") && collapsedDomains.size() < 3) + d.setDomainToLayoutWd(prevDomXCordinate+11); + else if (domainsToCollapse.equals("RAN") && collapsedDomains.size() == 3 && collapsedDomains.containsKey("01") && collapsedDomains.containsKey("04")) { + if (d.getName().equals("USP")) + d.setDomainToLayoutWd(prevDomXCordinate); + else + d.setDomainToLayoutWd(prevDomXCordinate+10); + } + + else if (collapsedDomains.containsKey("00") && collapsedDomains.size() == 3 && collapsedDomains.containsKey("01") && collapsedDomains.containsKey("02")) { + //System.out.println("Inside test"); + if (d.getName().equals("VNI")) + d.setDomainToLayoutWd(prevDomXCordinate+10); + else + d.setDomainToLayoutWd(prevDomXCordinate); + + } + + else if (collapsedDomains.containsKey("00") && collapsedDomains.size() == 3 && collapsedDomains.containsKey("01") && collapsedDomains.containsKey("03")) { + //System.out.println("Inside test"); + if (d.getName().equals("VNI")) + d.setDomainToLayoutWd(prevDomXCordinate+10); + else + d.setDomainToLayoutWd(prevDomXCordinate); + + } + + + + else { + d.setDomainToLayoutWd(prevDomXCordinate); + } + d.computeConatinerPositions(); + prevDomXCordinate = d.getP().getX(); + for (Map.Entry entry1 : d.getContainerRowCol().entrySet()) { + Container c = entry1.getValue(); + c.computeSize(); + c.computeElementPositions(); + if (c.getContainerRowCol() != null) { + for (Map.Entry entryInner : c.getContainerRowCol().entrySet()) { + Container inner = entryInner.getValue(); + inner.computeElementPositions(); + } + } + } + // } + // System.out.println("Sorted key: "+entry.getKey()+" Sorted value: "+entry.getValue().getName()); + } + // setNumberofColsofDomains(getNumberofColsofDomains()-1); + computeDomainPositions(); + return this; + /* CoordinateMain cm = new CoordinateMain(); + try { + cm.convertToYAML(this); + } catch (Exception e) { + + }*/ + + } + + public Layout uncollapseDomainModified(String domainToUnCollapse) { + Map currentDomainsSorted = new TreeMap(domainRowCol); + Map updateDomains = new TreeMap(); + Map collapsedDomainList = getCollapsedDomains(); + Map collapsedDomainListSorted = new TreeMap(collapsedDomainList); + + List domainstoUpd = new ArrayList(); + + int colToUnCollapse = 99; + + Domain domainToInsert = null; + + if (collapsedDomains.size() == 0) { + for (Map.Entry unindexDomain : originalDomainRowCol.entrySet()) { + Domain dm = unindexDomain.getValue(); + dm.setIndexChanged(false); + } + } + + + for (Map.Entry entry : collapsedDomainListSorted.entrySet()) { + if (entry.getValue().getName().equals(domainToUnCollapse)) { + colToUnCollapse = Character.getNumericValue(entry.getKey().toCharArray()[1]); + domainToInsert = entry.getValue(); + collapsedDomainList.remove(entry.getKey()); + break; + } + } + + domainstoUpd.add(domainToInsert); + + //for (Map.Entry e : originalDomainRowCol.entrySet()) + // System.out.println("Original key value"+e.getKey()+":"+e.getValue().getName()); + + int lastKeyCol = -1; + for (Map.Entry entry : originalDomainRowCol.entrySet()) { + int currcol = Character.getNumericValue(entry.getKey().toCharArray()[1]); + if (currcol < colToUnCollapse) { + for (Map.Entry currDomainsEntry : currentDomainsSorted.entrySet()) { + if (currDomainsEntry.getValue().getName().equals(entry.getValue().getName())) { + updateDomains.put(currDomainsEntry.getKey(), currDomainsEntry.getValue()); + lastKeyCol = Character.getNumericValue(currDomainsEntry.getKey().toCharArray()[1]); + break; + } + } + } else { + String newKey = "0"+String.valueOf(lastKeyCol+1); + if (currcol == colToUnCollapse) { + updateDomains.put(newKey, domainToInsert); + ++lastKeyCol; + } else { + for (Map.Entry currDomainsEnt : currentDomainsSorted.entrySet()) { + if (currDomainsEnt.getValue().getName().equals(entry.getValue().getName())) { + updateDomains.put(newKey, currDomainsEnt.getValue()); + domainstoUpd.add(currDomainsEnt.getValue()); + ++lastKeyCol; + // lastKeyCol = Character.getNumericValue(currDomainsEntry.getKey().toCharArray()[1]); + break; + } + } + } + + } + } + + setNumberofColsofDomains(getNumberofColsofDomains()+1); + setDomainRowCol(updateDomains); + setCollapsedDomains(collapsedDomainList); + + //for (Map.Entry e : updateDomains.entrySet()) + // System.out.println("me Updatedomains key value"+e.getKey()+":"+e.getValue().getName()); + + // for (int i = 1; i < domainstoUpd.size(); i++) { + for (int i = 0; i < domainstoUpd.size(); i++) { + Domain d = domainstoUpd.get(i); + double newX = 0.0; + if (i+1 < domainstoUpd.size()) + // newX = domainstoUpd.get(i-1).getP().getX()+domainstoUpd.get(i-1).computeSize().getWidth()+5; + newX = domainstoUpd.get(i+1).getP().getX(); + //d.setDomainToLayoutWd(domainstoUpd.get(i+1).getP().getX()); + else + newX = domainstoUpd.get(i).getP().getX()+32; + // d.setDomainToLayoutWd(domainstoUpd.get(i).getP().getX()+38); + /* if (i > 0) { + if (d.getWidth() < domainstoUpd.get(i-1).getWidth()) + newX+= domainstoUpd.get(i-1).getWidth() - d.getWidth(); + else if (d.getWidth() > domainstoUpd.get(i-1).getWidth()) + newX-= d.getWidth() - domainstoUpd.get(i-1).getWidth() ; + } else { + if (d.getWidth() < domainInserted.getWidth()) + newX+= domainInserted.getWidth() - d.getWidth(); + else if (d.getWidth() > domainInserted.getWidth()) + newX-= d.getWidth() - domainInserted.getWidth() ; + }*/ + if (d.getName().equals("Datacenter with AIC")) + newX+= 2; + d.setDomainToLayoutWd(newX); + /* if (i == 0) + d.setDomainToLayoutWd(domainInserted.getP().getX()+domainInserted.getWidth()); + else + d.setDomainToLayoutWd(domainstoUpd.get(i-1).getP().getX()+domainstoUpd.get(i-1).getWidth());*/ + d.computeConatinerPositions(); + for (Map.Entry entry1 : d.getContainerRowCol().entrySet()) { + Container c = entry1.getValue(); + c.computeSize(); + c.computeElementPositions(); + if (c.getContainerRowCol() != null) { + for (Map.Entry entryInner : c.getContainerRowCol().entrySet()) { + Container inner = entryInner.getValue(); + inner.computeElementPositions(); + } + } + } + // } + // System.out.println("Sorted key: "+entry.getKey()+" Sorted value: "+entry.getValue().getName()); + } + + computeDomainPositions(); + return this; + + } + + + + public Layout uncollapseDomain(String domainToCollapse) { + Map currentDomainsSorted = new TreeMap(domainRowCol); + Map updateDomains = new TreeMap(); + Map collapsedDomainList = getCollapsedDomains(); + Map collapsedDomainListSorted = new TreeMap(collapsedDomainList); + + List domainstoUpd = new ArrayList(); + /* for (Map.Entry entry : collapsedDomainListSorted.entrySet()) { + if (entry.getValue().getName().equals("domainToCollapse")) { + if (currentDomainsSorted != null) { + if (!currentDomainsSorted.containsKey(entry.getKey())) { + updateDomains.put(entry.getKey(), entry.getValue()); + collapsedDomainList.remove(entry.getKey()); + break; + } else { + int colToUnCollapse = Character.getNumericValue(entry.getKey().toCharArray()[1]); + for (Map.Entry curr : currentDomainsSorted.entrySet()) { + if (Character.getNumericValue(curr.getKey().toCharArray()[1]) < colToUnCollapse) { + updateDomains.put(curr.getKey(),curr.getValue()); + } else { + updateDomains.put(curr.getKey()+1,curr.getValue()); + + } + } + updateDomains.put(entry.getKey(), entry.getValue()); + } + } + + + } + }*/ + + Domain domainInserted = null; + for (Map.Entry entry : collapsedDomainListSorted.entrySet()) { + if (entry.getValue().getName().equals(domainToCollapse)) { + domainInserted = entry.getValue(); + if (currentDomainsSorted != null) { + int colToUnCollapse = Character.getNumericValue(entry.getKey().toCharArray()[1]); + for (Map.Entry curr : currentDomainsSorted.entrySet()) { + if (Character.getNumericValue(curr.getKey().toCharArray()[1]) < colToUnCollapse) { + updateDomains.put(curr.getKey(),curr.getValue()); + } else { + updateDomains.put("0"+String.valueOf(Integer.parseInt(curr.getKey())+1),curr.getValue()); + domainstoUpd.add(curr.getValue()); + } + } + } + updateDomains.put(entry.getKey(), entry.getValue()); + collapsedDomainList.remove(entry.getKey()); + break; + + } + } + setNumberofColsofDomains(getNumberofColsofDomains()+1); + setDomainRowCol(updateDomains); + setCollapsedDomains(collapsedDomainList); + + //for (Map.Entry e : updateDomains.entrySet()) + // System.out.println("Updatedomains key value"+e.getKey()+":"+e.getValue().getName()); + + + for (int i = 0; i < domainstoUpd.size(); i++) { + Domain d = domainstoUpd.get(i); + double newX = 0.0; + if (i+1 < domainstoUpd.size()) + newX = domainstoUpd.get(i+1).getP().getX(); + //d.setDomainToLayoutWd(domainstoUpd.get(i+1).getP().getX()); + else + newX = domainstoUpd.get(i).getP().getX()+38; + // d.setDomainToLayoutWd(domainstoUpd.get(i).getP().getX()+38); + /* if (i > 0) { + if (d.getWidth() < domainstoUpd.get(i-1).getWidth()) + newX+= domainstoUpd.get(i-1).getWidth() - d.getWidth(); + else if (d.getWidth() > domainstoUpd.get(i-1).getWidth()) + newX-= d.getWidth() - domainstoUpd.get(i-1).getWidth() ; + } else { + if (d.getWidth() < domainInserted.getWidth()) + newX+= domainInserted.getWidth() - d.getWidth(); + else if (d.getWidth() > domainInserted.getWidth()) + newX-= d.getWidth() - domainInserted.getWidth() ; + }*/ + if (d.getName().equals("Datacenter with AIC")) + newX+= 5; + d.setDomainToLayoutWd(newX); + /* if (i == 0) + d.setDomainToLayoutWd(domainInserted.getP().getX()+domainInserted.getWidth()); + else + d.setDomainToLayoutWd(domainstoUpd.get(i-1).getP().getX()+domainstoUpd.get(i-1).getWidth());*/ + d.computeConatinerPositions(); + for (Map.Entry entry1 : d.getContainerRowCol().entrySet()) { + Container c = entry1.getValue(); + c.computeSize(); + c.computeElementPositions(); + if (c.getContainerRowCol() != null) { + for (Map.Entry entryInner : c.getContainerRowCol().entrySet()) { + Container inner = entryInner.getValue(); + inner.computeElementPositions(); + } + } + } + // } + // System.out.println("Sorted key: "+entry.getKey()+" Sorted value: "+entry.getValue().getName()); + } + + computeDomainPositions(); + return this; + } + + public Layout uncollapseDomainNew(String domainToUnCollapse) { + Map currentDomainsSorted = new TreeMap(domainRowCol); + Map updateDomains = new TreeMap(); + Map collapsedDomainList = getCollapsedDomains(); + Map collapsedDomainListSorted = new TreeMap(collapsedDomainList); + + List domainstoUpd = new ArrayList(); + + //nline + List collapsedDomainNewLL = getCollapsedDomainsNewList(); + + int colToUnCollapse = 99; + + Domain domainToInsert = null; + + //nline + // if (collapsedDomains.size() == 0) { + if (collapsedDomainNewLL.size() == 0) { + for (Map.Entry unindexDomain : originalDomainRowCol.entrySet()) { + Domain dm = unindexDomain.getValue(); + dm.setIndexChanged(false); + } + } + + + for (Map.Entry entry : originalDomainRowCol.entrySet()) { + if (entry.getValue().getName().equals(domainToUnCollapse)) { + colToUnCollapse = Character.getNumericValue(entry.getKey().toCharArray()[1]); + domainToInsert = entry.getValue(); + collapsedDomainList.remove(entry.getKey()); + //nline + collapsedDomainNewLL.remove(entry.getValue()); + break; + } + } + + domainstoUpd.add(domainToInsert); + + // for (Map.Entry e : originalDomainRowCol.entrySet()) + // System.out.println("Original key value"+e.getKey()+":"+e.getValue().getName()); + + int lastKeyCol = -1; + for (Map.Entry entry : originalDomainRowCol.entrySet()) { + int currcol = Character.getNumericValue(entry.getKey().toCharArray()[1]); + if (currcol < colToUnCollapse) { + for (Map.Entry currDomainsEntry : currentDomainsSorted.entrySet()) { + if (currDomainsEntry.getValue().getName().equals(entry.getValue().getName())) { + updateDomains.put(currDomainsEntry.getKey(), currDomainsEntry.getValue()); + lastKeyCol = Character.getNumericValue(currDomainsEntry.getKey().toCharArray()[1]); + break; + } + } + } else { + String newKey = "0"+String.valueOf(lastKeyCol+1); + if (currcol == colToUnCollapse) { + updateDomains.put(newKey, domainToInsert); + ++lastKeyCol; + } else { + for (Map.Entry currDomainsEnt : currentDomainsSorted.entrySet()) { + if (currDomainsEnt.getValue().getName().equals(entry.getValue().getName())) { + updateDomains.put(newKey, currDomainsEnt.getValue()); + domainstoUpd.add(currDomainsEnt.getValue()); + ++lastKeyCol; + // lastKeyCol = Character.getNumericValue(currDomainsEntry.getKey().toCharArray()[1]); + break; + } + } + } + + } + } + + setNumberofColsofDomains(getNumberofColsofDomains()+1); + setDomainRowCol(updateDomains); + + //for (Map.Entry e : updateDomains.entrySet()) + // System.out.println("me Updatedomains key value"+e.getKey()+":"+e.getValue().getName()); + + + + double currDistFromLftMargin = 11.0; + for (Map.Entry cd : updateDomains.entrySet()) { + Domain d = cd.getValue(); + double accountPlus = accountForPlusSpaceBefore(d); + d.setDomainToLayoutWd(currDistFromLftMargin+accountPlus); + d.computeConatinerPositions(); + for (Map.Entry entry1 : d.getContainerRowCol().entrySet()) { + Container c = entry1.getValue(); + c.computeSize(); + c.computeElementPositions(); + if (c.getContainerRowCol() != null) { + for (Map.Entry entryInner : c.getContainerRowCol().entrySet()) { + Container inner = entryInner.getValue(); + inner.computeElementPositions(); + } + } + } + currDistFromLftMargin += d.computeSize().getWidth()+2; + + } + + //nline + updatePlusPosition(collapsedDomainNewLL, updateDomains); + + //order changed + setCollapsedDomains(collapsedDomainList); + + //nline + setCollapsedDomainsNewList(collapsedDomainNewLL); + + + computeDomainPositionsModified(); + return this; + + } + + public Layout uncollapseDomainNew1(String domainToUnCollapse) { + + if(domainToUnCollapse == null || domainToUnCollapse.isEmpty()) + return null; + + Map currentDomainsSorted = new TreeMap(domainRowCol); + Map updateDomains = new TreeMap(); + Map collapsedDomainList = getCollapsedDomains(); + Map collapsedDomainListSorted = new TreeMap(collapsedDomainList); + + List domainstoUpd = new ArrayList(); + + //nline + List collapsedDomainNewLL = getCollapsedDomainsNewList(); + + int colToUnCollapse = 99; + + Domain domainToInsert = null; + + //nline + // if (collapsedDomains.size() == 0) { + if (collapsedDomainNewLL.size() == 0) { + for (Map.Entry unindexDomain : originalDomainRowCol.entrySet()) { + Domain dm = unindexDomain.getValue(); + dm.setIndexChanged(false); + } + } + + + for (Map.Entry entry : originalDomainRowCol.entrySet()) { + if (entry.getValue().getName().equals(domainToUnCollapse)) { + colToUnCollapse = Character.getNumericValue(entry.getKey().toCharArray()[1]); + domainToInsert = entry.getValue(); + collapsedDomainList.remove(entry.getKey()); + //nline + collapsedDomainNewLL.remove(entry.getValue()); + break; + } + } + + domainstoUpd.add(domainToInsert); + + //for (Map.Entry e : originalDomainRowCol.entrySet()) + // System.out.println("Original key value"+e.getKey()+":"+e.getValue().getName()); + + int lastKeyCol = -1; + for (Map.Entry entry : originalDomainRowCol.entrySet()) { + int currcol = Character.getNumericValue(entry.getKey().toCharArray()[1]); + if (currcol < colToUnCollapse) { + for (Map.Entry currDomainsEntry : currentDomainsSorted.entrySet()) { + if (currDomainsEntry.getValue().getName().equals(entry.getValue().getName())) { + updateDomains.put(currDomainsEntry.getKey(), currDomainsEntry.getValue()); + lastKeyCol = Character.getNumericValue(currDomainsEntry.getKey().toCharArray()[1]); + break; + } + } + } else { + String newKey = "0"+String.valueOf(lastKeyCol+1); + if (currcol == colToUnCollapse) { + updateDomains.put(newKey, domainToInsert); + ++lastKeyCol; + } else { + for (Map.Entry currDomainsEnt : currentDomainsSorted.entrySet()) { + if (currDomainsEnt.getValue().getName().equals(entry.getValue().getName())) { + updateDomains.put(newKey, currDomainsEnt.getValue()); + domainstoUpd.add(currDomainsEnt.getValue()); + ++lastKeyCol; + // lastKeyCol = Character.getNumericValue(currDomainsEntry.getKey().toCharArray()[1]); + break; + } + } + } + + } + } + + setNumberofColsofDomains(getNumberofColsofDomains()+1); + setDomainRowCol(updateDomains); + + //for (Map.Entry e : updateDomains.entrySet()) + // System.out.println("me Updatedomains key value"+e.getKey()+":"+e.getValue().getName()); + + + + + double currDistFromLftM = 11.0; + + boolean isDisplayed; + for (Map.Entry orgEntry : originalDomainRowCol.entrySet()) { + isDisplayed = false; + for (Map.Entry cd : updateDomains.entrySet()) { + if (cd.getValue().getName().equals(orgEntry.getValue().getName())) { + Domain d = cd.getValue(); + d.setDomainToLayoutWd(currDistFromLftM); + d.computeConatinerPositions(); + for (Map.Entry entry1 : d.getContainerRowCol().entrySet()) { + Container c = entry1.getValue(); + c.computeSize(); + c.computeElementPositions(); + if (c.getContainerRowCol() != null) { + for (Map.Entry entryInner : c.getContainerRowCol().entrySet()) { + Container inner = entryInner.getValue(); + inner.computeElementPositions(); + } + } + } + currDistFromLftM += d.computeSize().getWidth()+1; + isDisplayed = true; + break; + } + } + + if (!isDisplayed) { + Domain myCollapsed = orgEntry.getValue(); + myCollapsed.setNewXafterColl(currDistFromLftM); + currDistFromLftM += 4; + } + } + + // plus.setNewXafterColl(distOfCollFrmLft+1.5); + + //order changed + setCollapsedDomains(collapsedDomainList); + + //nline + setCollapsedDomainsNewList(collapsedDomainNewLL); + + + computeDomainPositionsModified(); + return this; + + } + + + + + + + + + + + + + + + private void updatePlusPosition(List collapsedDNewL, Map displayedDomainMap) { + List copyCollapseList = new ArrayList(); + + for (Domain copyCollapse : collapsedDNewL) { + copyCollapseList.add(copyCollapse); + } + + //double distOfCollFrmLft = 0.0; + int orgColofCollapsed = -1; + int orgColofDisplayed = -1; + int orgColofDisplayedOtherPlus = -1; + int orgColofInterDomainPlus = -1; + List dsplyList = new ArrayList(); + + for (Domain plus : collapsedDNewL) { + double distOfCollFrmLft = 0.0; + for (Map.Entry colCheck : originalDomainRowCol.entrySet()) { + if (colCheck.getValue().getName().equals(plus.getName())) { + orgColofCollapsed = Character.getNumericValue(colCheck.getKey().toCharArray()[1]); + break; + } + } + for (Map.Entry displayedEntry : displayedDomainMap.entrySet()) { + + for (Map.Entry colCheck1 : originalDomainRowCol.entrySet()) { + if (colCheck1.getValue().getName().equals(displayedEntry.getValue().getName())) { + orgColofDisplayed = Character.getNumericValue(colCheck1.getKey().toCharArray()[1]); + break; + } + } + if (orgColofDisplayed < orgColofCollapsed) { + distOfCollFrmLft+= displayedEntry.getValue().computeSize().getWidth(); + + + /* if (dsplyList.size() > 0) { + Domain lastAdded = dsplyList.get(dsplyList.size()-1); + int orgColofLastAdded = -1; + for (Map.Entry colCh : originalDomainRowCol.entrySet()) { + if (colCh.getValue().getName().equals(lastAdded.getName())) { + orgColofLastAdded = Character.getNumericValue(colCh.getKey().toCharArray()[1]); + break; + } + } + if (Math.abs(orgColofDisplayed - orgColofLastAdded) == 1) { + boolean adjDomainsWithPlus = false; + for (Domain colp : copyCollapseList) { + if (!colp.getName().equals(plus.getName())) { + for (Map.Entry colCk2 : originalDomainRowCol.entrySet()) { + if (colCk2.getValue().getName().equals(colp.getName())) { + orgColofInterDomainPlus = Character.getNumericValue(colCk2.getKey().toCharArray()[1]); + break; + } + } + if (orgColofInterDomainPlus > orgColofLastAdded && orgColofInterDomainPlus < orgColofDisplayed) { + adjDomainsWithPlus = true; + break; + } + } + } + if (!adjDomainsWithPlus) + distOfCollFrmLft+=interDomainWd; + } + } + dsplyList.add(displayedEntry.getValue()); */ + + + + } + + } + + for (Domain collp : copyCollapseList) { + if (!collp.getName().equals(plus.getName())) { + for (Map.Entry colCheck2 : originalDomainRowCol.entrySet()) { + if (colCheck2.getValue().getName().equals(collp.getName())) { + orgColofDisplayedOtherPlus = Character.getNumericValue(colCheck2.getKey().toCharArray()[1]); + break; + } + } + if (orgColofDisplayedOtherPlus < orgColofCollapsed) { + distOfCollFrmLft+=3.0; + } + } + } + + plus.setNewXafterColl(distOfCollFrmLft+1.5); + + + } + } + + + private double accountForPlusSpaceBefore(Domain d) { + + int orgColofCollapsed = 0; + int orgColofDisplayed = 0; + double distFromLftM = 0.0; + + for (Map.Entry colCheckk : originalDomainRowCol.entrySet()) { + if (colCheckk.getValue().getName().equals(d.getName())) { + orgColofDisplayed = Character.getNumericValue(colCheckk.getKey().toCharArray()[1]); + break; + } + } + + for (Domain collapsed : getCollapsedDomainsNewList()) { + for (Map.Entry colCheck : originalDomainRowCol.entrySet()) { + if (colCheck.getValue().getName().equals(collapsed.getName())) { + orgColofCollapsed = Character.getNumericValue(colCheck.getKey().toCharArray()[1]); + break; + } + } + + if (orgColofCollapsed < orgColofDisplayed) { + distFromLftM+= 2; + } + } + return distFromLftM; + + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/NameValueId.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/NameValueId.java new file mode 100644 index 00000000..fcb9f726 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/NameValueId.java @@ -0,0 +1,94 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +import java.io.Serializable; + + +public class NameValueId implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 1L; + private String lab; + private String val; + + public NameValueId() { + } + + public NameValueId(String value, String label) { + setVal(value); + setLab(label); + } + + + public String getLab() { + return lab; + } + + + public String getVal() { + return val; + } + + + public void setLab(String label) { + this.lab = label; + } + + + public void setVal(String value) { + this.val = value; + } + + + public boolean equals(Object o) { + if (this == o) { + return true; + } + + if (o == null) { + return false; + } + + if (!(o instanceof NameValueId)) { + return false; + } + + final NameValueId nameValueId = (NameValueId)o; + + if (!getVal().equals(nameValueId.getVal())) { + return false; + } + + if (!getLab().equals(nameValueId.getLab())) { + return false; + } + + return true; + } + + + public int hashCode() { + return getVal().hashCode(); + } + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Position.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Position.java new file mode 100644 index 00000000..db137c80 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Position.java @@ -0,0 +1,40 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +public class Position { + double x; + double y; + + public double getX() { + return x; + } + public void setX(double x) { + this.x = x; + } + public double getY() { + return y; + } + public void setY(double y) { + this.y = y; + } + + +} diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Size.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Size.java new file mode 100644 index 00000000..4ebfb962 --- /dev/null +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/domain/support/Size.java @@ -0,0 +1,40 @@ +/*- + * ================================================================================ + * eCOMP Portal SDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ================================================================================ + */ +package org.openecomp.portalsdk.core.domain.support; + +public class Size { + private double width; + private double height; + + public double getWidth() { + return width; + } + public void setWidth(double width) { + this.width = width; + } + public double getHeight() { + return height; + } + public void setHeight(double height) { + this.height = height; + } + + +} -- cgit 1.2.3-korg