src/main/java/org/fit/layout/cssbox/BoxNode.java
public boolean visuallyEncloses1(BoxNode childNode)
    {
        int cx1 = childNode.getVisualBounds().getX1();
        int cy1 = childNode.getVisualBounds().getY1();
        int cx2 = childNode.getVisualBounds().getX2();
        int cy2 = childNode.getVisualBounds().getY2();
        int px1 = getVisualBounds().getX1();
        int py1 = getVisualBounds().getY1();
        int px2 = getVisualBounds().getX2();
        int py2 = getVisualBounds().getY2();
        
        //check how many corners of the child are inside the parent exactly
        int xcnt = 0;
        if (cx1 >= px1 && cx1 <= px2 &&
            cy1 >= py1 && cy1 <= py2) xcnt++; //top left
        if (cx2 >= px1 && cx2 <= px2 &&
            cy1 >= py1 && cy1 <= py2) xcnt++; //top right
        if (cx1 >= px1 && cx1 <= px2 &&
            cy2 >= py1 && cy2 <= py2) xcnt++; //bottom left
        if (cx2 >= px1 && cx2 <= px2 &&
            cy2 >= py1 && cy2 <= py2) xcnt++; //bottom right
        
        /*if (childNode.toString().contains("globalWrapper") && this.toString().contains("mediawiki"))
            System.out.println("jo!");*/
        
        if ((cx1 == px1 && cy1 == py1 && cx2 == px2 && cy2 == py2)) //exact overlap
           return this.getOrder() < childNode.getOrder();
        else
            return xcnt == 4;
    }
public boolean visuallyEncloses1(BoxNode childNode)
    {
        int cx1 = childNode.getVisualBounds().getX1();
        int cy1 = childNode.getVisualBounds().getY1();
        int cx2 = childNode.getVisualBounds().getX2();
        int cy2 = childNode.getVisualBounds().getY2();
        int px1 = getVisualBounds().getX1();
        int py1 = getVisualBounds().getY1();
        int px2 = getVisualBounds().getX2();
        int py2 = getVisualBounds().getY2();
        
        //check how many corners of the child are inside the parent exactly
        int xcnt = 0;
        if (cx1 >= px1 && cx1 <= px2 &&
            cy1 >= py1 && cy1 <= py2) xcnt++; //top left
        if (cx2 >= px1 && cx2 <= px2 &&
            cy1 >= py1 && cy1 <= py2) xcnt++; //top right
        if (cx1 >= px1 && cx1 <= px2 &&
            cy2 >= py1 && cy2 <= py2) xcnt++; //bottom left
        if (cx2 >= px1 && cx2 <= px2 &&
            cy2 >= py1 && cy2 <= py2) xcnt++; //bottom right
        
        /*if (childNode.toString().contains("globalWrapper") && this.toString().contains("mediawiki"))
            System.out.println("jo!");*/
        
        if ((cx1 == px1 && cy1 == py1 && cx2 == px2 && cy2 == py2)) //exact overlap
           return this.getOrder() < childNode.getOrder();
        else
            return xcnt == 4;
    }
public boolean visuallyEncloses1 ( BoxNode childNode ) { int cx1 = childNode . getVisualBounds ( ) . getX1 ( ) ; int cy1 = childNode . getVisualBounds ( ) . getY1 ( ) ; int cx2 = childNode . getVisualBounds ( ) . getX2 ( ) ; int cy2 = childNode . getVisualBounds ( ) . getY2 ( ) ; int px1 = getVisualBounds ( ) . getX1 ( ) ; int py1 = getVisualBounds ( ) . getY1 ( ) ; int px2 = getVisualBounds ( ) . getX2 ( ) ; int py2 = getVisualBounds ( ) . getY2 ( ) ; //check how many corners of the child are inside the parent exactly int xcnt = 0 ; if ( cx1 >= px1 && cx1 <= px2 && cy1 >= py1 && cy1 <= py2 ) xcnt ++ ; //top left if ( cx2 >= px1 && cx2 <= px2 && cy1 >= py1 && cy1 <= py2 ) xcnt ++ ; //top right if ( cx1 >= px1 && cx1 <= px2 && cy2 >= py1 && cy2 <= py2 ) xcnt ++ ; //bottom left if ( cx2 >= px1 && cx2 <= px2 && cy2 >= py1 && cy2 <= py2 ) xcnt ++ ; //bottom right /*if (childNode.toString().contains("globalWrapper") && this.toString().contains("mediawiki"))
            System.out.println("jo!");*/ if ( ( cx1 == px1 && cy1 == py1 && cx2 == px2 && cy2 == py2 ) ) //exact overlap return this . getOrder ( ) < childNode . getOrder ( ) ; else return xcnt == 4 ; }
Checks if another node is fully located inside the content bounds of this box.
@param childNode the node to check
@return <code>true</code> if the child node is completely inside this node, <code>false</code> otherwise
Checks if another node is fully located inside the content bounds of this box .