001    // GraphLab Project: http://graphlab.sharif.edu
002    // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology
003    // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/
004    package graphlab.plugins.main.core.actions.edge;
005    
006    import graphlab.platform.core.AbstractAction;
007    import graphlab.platform.core.BlackBoard;
008    
009    /**
010     * User: Shabn
011     */
012    public class EdgeHighlightAction extends AbstractAction {
013        /**
014         * constructor
015         *
016         * @param bb the blackboard of the action
017         */
018        public EdgeHighlightAction(BlackBoard bb) {
019            super(bb);
020            //deactivated for simplicity reasons (removing highlighted mode from edge)
021    //        listen4Event(EdgeMouseEnteredExitedData.event);
022    //        listen4Event(EdgeNotifyData.event);
023        }
024    //
025    
026        public void performAction(String eventName, Object value) {
027    //        if (name.equals(EdgeMouseEnteredExitedData.name)) {
028    //            EdgeMouseEnteredExitedData e = blackboard.get(EdgeMouseEnteredExitedData.name);
029    //            Edge edge = e.e;
030    //            if (e.isEntered) {
031    //                highLightEdge(edge);
032    //            }
033    //            if (e.isExited) {
034    //                unHighLightEdge(edge);
035    //            }
036    //            e.e.view.repaint();
037    //        } else if (name.equals(EdgeNotifyData.name)) {
038    //            EdgeNotifyData e = blackboard.get(EdgeNotifyData.name);
039    ////            if (e.isNotified == EdgeNotifyData.NOTIFIED ) {
040    ////                highLightEdge(e.e);
041    ////            }
042    ////            if (e.isNotified == EdgeNotifyData.UN_NOTIFIED){
043    ////                unHighLightEdge(e.e);
044    ////            }
045    //            e.e.view.repaint();
046    //        }
047        }
048    //
049    //    public static void unHighLightEdge(Edge edge) {
050    //        edge.model.lc = EdgeModel.LineColor.normal;
051    //    }
052    //
053    //    public static void highLightEdge(Edge edge) {
054    //        edge.model.lc = EdgeModel.LineColor.highlight;
055    //    }
056    //
057    //    public static boolean isEdgeHighlighted(Edge e) {
058    //        return e.model.lc == EdgeModel.LineColor.normal;
059    //    }
060    }