Examples of HbConnectionInfo


Examples of lcmc.crm.ui.resource.HbConnectionInfo

    /** Handles right click on the edge and creates popup menu. */
    @Override
    protected void handlePopupEdge(final Edge edge, final Point2D pos) {
        mHbConnectionReadLock.lock();
        final HbConnectionInfo info;
        try {
            info = edgeToHbconnectionMap.get(edge);
        } finally {
            mHbConnectionReadLock.unlock();
        }
        if (info != null) {
            final JPopupMenu p = info.getPopup();
            info.updateMenus(pos);
            showPopup(p, pos);
        }
    }
View Full Code Here

Examples of lcmc.crm.ui.resource.HbConnectionInfo

            return null;
        }
        final StringBuilder s = new StringBuilder(100);
        s.append(siP);
        mHbConnectionReadLock.lock();
        final HbConnectionInfo hbci;
        try {
            hbci = edgeToHbconnectionMap.get(edge);
        } finally {
            mHbConnectionReadLock.unlock();
        }
        if (edgeIsOrder && hbci != null && !hbci.isOrdScoreNull(null, null)) {
            s.append(" is started before ");
        } else {
            s.append(" and ");
        }
        s.append(si);
        if (!edgeIsOrder) {
            s.append(" are located");
        }
        if (edgeIsColocation) {
            final HbConnectionInfo.ColScoreType colSType = hbci.getColocationScoreType(null, null);
            if (colSType == HbConnectionInfo.ColScoreType.NEGATIVE
                || colSType == HbConnectionInfo.ColScoreType.MINUS_INFINITY) {
                s.append(" not on the same host");
            } else {
                s.append(" on the same host");
View Full Code Here

Examples of lcmc.crm.ui.resource.HbConnectionInfo

        final ServiceInfo s2 = (ServiceInfo) getInfo(p.getFirst());
        if (s2 == null) {
            return "";
        }
        mHbConnectionReadLock.lock();
        final HbConnectionInfo hbci;
        try {
            hbci = edgeToHbconnectionMap.get(e);
        } finally {
            mHbConnectionReadLock.unlock();
        }
        if (hbci == null) {
            return "";
        }
        String leftArrow = "\u2190 "; /* <- */
        String rightArrow = " \u2192"; /* -> */
        final HbConnectionInfo.ColScoreType colSType = hbci.getColocationScoreType(null, null);
        if (edgeIsColocation) {
            if (hbci.isColocationTwoDirections()) {
                leftArrow = "\u21AE "; /* </> */
                rightArrow = "\u21AE "; /* </> */
            } else if (colSType == HbConnectionInfo.ColScoreType.NEGATIVE
                || colSType == HbConnectionInfo.ColScoreType.MINUS_INFINITY) {
            } else if (colSType == HbConnectionInfo.ColScoreType.IS_NULL) {
                leftArrow = "\u21E0 "; /* < - - */
                rightArrow = " \u21E2"; /* - - > */
            } else if (colSType == HbConnectionInfo.ColScoreType.MIXED) {
                leftArrow = "\u219A "; /* </- */
                rightArrow = " \u219B"; /* -/> */
            }
        }
        String colScore = "";
        if (edgeIsColocation
            && colSType == HbConnectionInfo.ColScoreType.IS_NULL) {
            colScore = "0";
        }
        String ordScore = "";
        if (edgeIsOrder && hbci.isOrdScoreNull(null, null)) {
            ordScore = "0";
        }

        String colDesc = null;
        String ordDesc = null;
        String desc = null;
        if (edgeIsOrder && edgeIsColocation) {
            if (colSType == HbConnectionInfo.ColScoreType.NEGATIVE
                || colSType == HbConnectionInfo.ColScoreType.MINUS_INFINITY) {
                colDesc = "repelled";
            } else {
                colDesc = "col";
            }
            ordDesc = "ord";
        } else if (edgeIsOrder) {
            ordDesc = "ordered";
        } else if (edgeIsColocation) {
            if (colSType == HbConnectionInfo.ColScoreType.NEGATIVE
                || colSType == HbConnectionInfo.ColScoreType.MINUS_INFINITY) {
                colDesc = "repelled";
            } else {
                colDesc = "colocated";
            }
        } else if (s1.getService().isNew() || s2.getService().isNew()) {
            desc = Tools.getString("CRMGraph.Unconfigured");
        } else {
            desc = Tools.getString("CRMGraph.Removing");
        }
        if (desc != null) {
            return desc;
        }
        final Vertex v1 = p.getSecond();
        final Vertex v2 = p.getFirst();
        double s1X = 0;
        final Point2D loc1 = getLayout().transform(v1);
        if (loc1 != null) {
            s1X = loc1.getX();
        }
        final Point2D loc2 = getLayout().transform(v2);
        double s2X = 0;
        if (loc2 != null) {
            s2X = loc2.getX();
        }
        final StringBuilder sb = new StringBuilder(15);
        final boolean upsideDown = s1X < s2X;
        final boolean left = hbci.isWithRsc(s2) && !e.isWrongColocation();
        if (edgeIsColocation) {
            if ((left && !upsideDown) || (!left && upsideDown)) {
                sb.append(leftArrow); /* <- */
                sb.append(colScore);
                sb.append(' ');
View Full Code Here

Examples of lcmc.crm.ui.resource.HbConnectionInfo

    /** Returns paint of the edge. */
    @Override
    protected Paint getEdgeDrawPaint(final Edge e) {
        mHbConnectionReadLock.lock();
        final HbConnectionInfo hbci;
        try {
            hbci = edgeToHbconnectionMap.get(e);
        } finally {
            mHbConnectionReadLock.unlock();
        }
        if (hbci != null && hbci.isNew()) {
            return Tools.getDefaultColor("ResourceGraph.EdgeDrawPaintNew");
        } else if (edgeIsOrderList.contains(e) && edgeIsColocationList.contains(e)) {
            return super.getEdgeDrawPaint(e);
        } else if (edgeIsOrderList.contains(e) || edgeIsColocationList.contains(e)) {
            return Tools.getDefaultColor("ResourceGraph.EdgeDrawPaintBrighter");
View Full Code Here

Examples of lcmc.crm.ui.resource.HbConnectionInfo

    /** Returns paint of the picked edge. */
    @Override
    protected Paint getEdgePickedPaint(final Edge e) {
        mHbConnectionReadLock.lock();
        final HbConnectionInfo hbci;
        try {
            hbci = edgeToHbconnectionMap.get(e);
        } finally {
            mHbConnectionReadLock.unlock();
        }
        if (hbci != null && hbci.isNew()) {
            return Tools.getDefaultColor("ResourceGraph.EdgePickedPaintNew");
        } else if (edgeIsOrderList.contains(e) && edgeIsColocationList.contains(e)) {
            return super.getEdgePickedPaint(e);
        } else if (edgeIsOrderList.contains(e) || edgeIsColocationList.contains(e)) {
            return Tools.getDefaultColor("ResourceGraph.EdgePickedPaintBrighter");
View Full Code Here

Examples of lcmc.crm.ui.resource.HbConnectionInfo

                || (s2.getService().isNew() && !s2.getService().isRemoved())) {
                continue;
            }
            if (!keepEdgeIsOrderList.contains(e)) {
                mHbConnectionReadLock.lock();
                final HbConnectionInfo hbci;
                try {
                    hbci = edgeToHbconnectionMap.get(e);
                } finally {
                    mHbConnectionReadLock.unlock();
                }
                if (hbci != null) {
                    hbci.removeOrders();
                }
            }

            if (!keepEdgeIsColocationList.contains(e)) {
                mHbConnectionReadLock.lock();
                final HbConnectionInfo hbci;
                try {
                    hbci = edgeToHbconnectionMap.get(e);
                } finally {
                    mHbConnectionReadLock.unlock();
                }
                if (hbci != null) {
                    hbci.removeColocations();
                }
            }
            if (!keepEdgeIsOrderList.contains(e) && !keepEdgeIsColocationList.contains(e)) {
                removeEdge(e, Application.RunMode.LIVE);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.