Ejemplo n.º 1
0
 public LayoutInfo copyOfThisLayoutInfo() {
   LayoutInfo copyI = new LayoutInfo();
   for (NodeLayout nl : nodes) {
     copyI.addNodeLayout(nl.processID, nl.nodeID, nl.cofactor, nl.x, nl.y);
   }
   for (EdgeLayout el : edges) {
     ArrayList<LayoutPoint> copyBends = new ArrayList<LayoutPoint>();
     for (LayoutPoint lp : el.bends) {
       copyBends.add(new LayoutPoint(lp.x, lp.y));
     }
     copyI.addEdgeLayout(
         el.sourcepid,
         el.sourceNode,
         el.scofactor,
         el.targetpid,
         el.targetNode,
         el.tcofactor,
         copyBends);
   }
   return copyI;
 }
Ejemplo n.º 2
0
 public int compare(LayoutInfo i1, LayoutInfo i2) {
   LayoutBox box1 = i1.getExactLayoutBox();
   LayoutBox box2 = i2.getExactLayoutBox();
   return (box1.size() < box2.size() ? -1 : (box1.size() == box2.size() ? 0 : 1));
 }
Ejemplo n.º 3
0
 public static void main(String[] args) {
   LayoutInfo info = new LayoutInfo();
   System.out.println(info.toXMLString());
 }
Ejemplo n.º 4
0
 /**
  * to check if the two layouts' exact box overlapping
  *
  * @see binevi.View.LayoutInfo#overlapLayoutBox(LayoutBox)
  */
 public boolean overlapLayoutBox(LayoutInfo i) {
   LayoutBox b2 = i.getExactLayoutBox();
   return overlapLayoutBox(b2);
 }