Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 224116
Collapse All | Expand All

(-)src/org/eclipse/zest/core/widgets/GraphNode.java (-7 / +9 lines)
Lines 21-42 Link Here
21
import org.eclipse.draw2d.geometry.Point;
21
import org.eclipse.draw2d.geometry.Point;
22
import org.eclipse.draw2d.geometry.PrecisionPoint;
22
import org.eclipse.draw2d.geometry.PrecisionPoint;
23
import org.eclipse.draw2d.geometry.Rectangle;
23
import org.eclipse.draw2d.geometry.Rectangle;
24
import org.eclipse.zest.core.widgets.internal.GraphLabel;
25
import org.eclipse.zest.layouts.LayoutEntity;
26
import org.eclipse.zest.layouts.constraints.LayoutConstraint;
27
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.SWT;
28
import org.eclipse.swt.graphics.Color;
25
import org.eclipse.swt.graphics.Color;
29
import org.eclipse.swt.graphics.Font;
26
import org.eclipse.swt.graphics.Font;
30
import org.eclipse.swt.graphics.FontData;
27
import org.eclipse.swt.graphics.FontData;
31
import org.eclipse.swt.graphics.Image;
28
import org.eclipse.swt.graphics.Image;
32
import org.eclipse.swt.widgets.Display;
29
import org.eclipse.swt.widgets.Display;
30
import org.eclipse.zest.core.widgets.internal.GraphLabel;
31
import org.eclipse.zest.layouts.LayoutEntity;
32
import org.eclipse.zest.layouts.constraints.LayoutConstraint;
33
33
34
/**
34
/*
35
 * Simple node class which has the following properties: color, size, location,
35
 * Simple node class which has the following properties: color, size, location,
36
 * and a label. It also has a list of connections and anchors.
36
 * and a label. It also has a list of connections and anchors.
37
 * 
37
 * 
38
 * @author Chris Callendar
38
 * @author Chris Callendar
39
 * 
39
 * @author Del Myers
40
 * @author Del Myers
41
 * 
40
 * @author Ian Bull
42
 * @author Ian Bull
41
 */
43
 */
42
public class GraphNode extends GraphItem {
44
public class GraphNode extends GraphItem {
Lines 421-427 Link Here
421
		if (highlighted == HIGHLIGHT_ON) {
423
		if (highlighted == HIGHLIGHT_ON) {
422
			return;
424
			return;
423
		}
425
		}
424
		highlighted = HIGHLIGHT_ON;
425
		// @tag ADJACENT : Removed highlight adjacent
426
		// @tag ADJACENT : Removed highlight adjacent
426
		/*
427
		/*
427
		if (ZestStyles.checkStyle(getNodeStyle(), ZestStyles.NODES_HIGHLIGHT_ADJACENT)) {
428
		if (ZestStyles.checkStyle(getNodeStyle(), ZestStyles.NODES_HIGHLIGHT_ADJACENT)) {
Lines 437-448 Link Here
437
			}
438
			}
438
		}
439
		}
439
		*/
440
		*/
440
		updateFigureForModel(getNodeFigure());
441
		if (parent.getItemType() == GraphItem.CONTAINER) {
441
		if (parent.getItemType() == GraphItem.CONTAINER) {
442
			((GraphContainer) parent).highlightNode(this);
442
			((GraphContainer) parent).highlightNode(this);
443
		} else {
443
		} else {
444
			((Graph) parent).highlightNode(this);
444
			((Graph) parent).highlightNode(this);
445
		}
445
		}
446
		highlighted = HIGHLIGHT_ON;
447
		updateFigureForModel(getNodeFigure());
446
	}
448
	}
447
449
448
	/**
450
	/**
Lines 455-461 Link Here
455
		if (highlighted == HIGHLIGHT_NONE) {
457
		if (highlighted == HIGHLIGHT_NONE) {
456
			return;
458
			return;
457
		}
459
		}
458
		highlighted = HIGHLIGHT_NONE;
459
		// @tag ADJACENT : Removed highlight adjacent
460
		// @tag ADJACENT : Removed highlight adjacent
460
		/*
461
		/*
461
		if (!highlightedAdjacently) {
462
		if (!highlightedAdjacently) {
Lines 485-490 Link Here
485
		} else {
486
		} else {
486
			((Graph) parent).unhighlightNode(this);
487
			((Graph) parent).unhighlightNode(this);
487
		}
488
		}
489
		highlighted = HIGHLIGHT_NONE;
488
		updateFigureForModel(nodeFigure);
490
		updateFigureForModel(nodeFigure);
489
491
490
	}
492
	}
(-)src/org/eclipse/zest/core/widgets/Graph.java (-16 / +17 lines)
Lines 32-46 Link Here
32
import org.eclipse.draw2d.geometry.Dimension;
32
import org.eclipse.draw2d.geometry.Dimension;
33
import org.eclipse.draw2d.geometry.Point;
33
import org.eclipse.draw2d.geometry.Point;
34
import org.eclipse.draw2d.geometry.Rectangle;
34
import org.eclipse.draw2d.geometry.Rectangle;
35
import org.eclipse.zest.core.widgets.internal.RevealListener;
36
import org.eclipse.zest.core.widgets.internal.ZestRootLayer;
37
import org.eclipse.zest.layouts.InvalidLayoutConfiguration;
38
import org.eclipse.zest.layouts.LayoutAlgorithm;
39
import org.eclipse.zest.layouts.LayoutEntity;
40
import org.eclipse.zest.layouts.LayoutRelationship;
41
import org.eclipse.zest.layouts.LayoutStyles;
42
import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
43
import org.eclipse.zest.layouts.constraints.LayoutConstraint;
44
import org.eclipse.swt.SWT;
35
import org.eclipse.swt.SWT;
45
import org.eclipse.swt.events.PaintEvent;
36
import org.eclipse.swt.events.PaintEvent;
46
import org.eclipse.swt.events.PaintListener;
37
import org.eclipse.swt.events.PaintListener;
Lines 53-63 Link Here
53
import org.eclipse.swt.widgets.Display;
44
import org.eclipse.swt.widgets.Display;
54
import org.eclipse.swt.widgets.Event;
45
import org.eclipse.swt.widgets.Event;
55
import org.eclipse.swt.widgets.Item;
46
import org.eclipse.swt.widgets.Item;
47
import org.eclipse.zest.core.widgets.internal.RevealListener;
48
import org.eclipse.zest.core.widgets.internal.ZestRootLayer;
49
import org.eclipse.zest.layouts.InvalidLayoutConfiguration;
50
import org.eclipse.zest.layouts.LayoutAlgorithm;
51
import org.eclipse.zest.layouts.LayoutEntity;
52
import org.eclipse.zest.layouts.LayoutRelationship;
53
import org.eclipse.zest.layouts.LayoutStyles;
54
import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm;
55
import org.eclipse.zest.layouts.constraints.LayoutConstraint;
56
56
57
/**
57
/*
58
 * Holds the nodes and connections for the graph.
58
 * Holds the nodes and connections for the graph.
59
 * 
59
 * 
60
 * @author Chris Callendar
60
 * @author Chris Callendar
61
 * 
61
 * @author Ian Bull
62
 * @author Ian Bull
62
 */
63
 */
63
public class Graph extends FigureCanvas implements IContainer {
64
public class Graph extends FigureCanvas implements IContainer {
Lines 726-732 Link Here
726
	 */
727
	 */
727
	void highlightEdge(GraphConnection connection) {
728
	void highlightEdge(GraphConnection connection) {
728
		IFigure figure = connection.getConnectionFigure();
729
		IFigure figure = connection.getConnectionFigure();
729
		if (figure != null) {
730
		if (figure != null && !connection.isHighlighted()) {
730
			zestRootLayer.highlightConnection(figure);
731
			zestRootLayer.highlightConnection(figure);
731
		}
732
		}
732
	}
733
	}
Lines 738-744 Link Here
738
	 */
739
	 */
739
	void unhighlightEdge(GraphConnection connection) {
740
	void unhighlightEdge(GraphConnection connection) {
740
		IFigure figure = connection.getConnectionFigure();
741
		IFigure figure = connection.getConnectionFigure();
741
		if (figure != null) {
742
		if (figure != null && connection.isHighlighted()) {
742
			zestRootLayer.unHighlightConnection(figure);
743
			zestRootLayer.unHighlightConnection(figure);
743
		}
744
		}
744
	}
745
	}
Lines 750-756 Link Here
750
	 */
751
	 */
751
	void highlightNode(GraphNode node) {
752
	void highlightNode(GraphNode node) {
752
		IFigure figure = node.getNodeFigure();
753
		IFigure figure = node.getNodeFigure();
753
		if (figure != null) {
754
		if (figure != null && !node.isHighlighted()) {
754
			zestRootLayer.highlightNode(figure);
755
			zestRootLayer.highlightNode(figure);
755
		}
756
		}
756
	}
757
	}
Lines 762-768 Link Here
762
	 */
763
	 */
763
	void highlightNode(GraphContainer node) {
764
	void highlightNode(GraphContainer node) {
764
		IFigure figure = node.getNodeFigure();
765
		IFigure figure = node.getNodeFigure();
765
		if (figure != null) {
766
		if (figure != null && !node.isHighlighted()) {
766
			zestRootLayer.highlightNode(figure);
767
			zestRootLayer.highlightNode(figure);
767
		}
768
		}
768
	}
769
	}
Lines 774-780 Link Here
774
	 */
775
	 */
775
	void unhighlightNode(GraphContainer node) {
776
	void unhighlightNode(GraphContainer node) {
776
		IFigure figure = node.getNodeFigure();
777
		IFigure figure = node.getNodeFigure();
777
		if (figure != null) {
778
		if (figure != null && node.isHighlighted()) {
778
			zestRootLayer.unHighlightNode(figure);
779
			zestRootLayer.unHighlightNode(figure);
779
		}
780
		}
780
	}
781
	}
Lines 786-792 Link Here
786
	 */
787
	 */
787
	void unhighlightNode(GraphNode node) {
788
	void unhighlightNode(GraphNode node) {
788
		IFigure figure = node.getNodeFigure();
789
		IFigure figure = node.getNodeFigure();
789
		if (figure != null) {
790
		if (figure != null && node.isHighlighted()) {
790
			zestRootLayer.unHighlightNode(figure);
791
			zestRootLayer.unHighlightNode(figure);
791
		}
792
		}
792
	}
793
	}
(-)src/org/eclipse/zest/core/widgets/internal/ZestRootLayer.java (-7 / +4 lines)
Lines 12-26 Link Here
12
import org.eclipse.draw2d.FreeformLayer;
12
import org.eclipse.draw2d.FreeformLayer;
13
import org.eclipse.draw2d.IFigure;
13
import org.eclipse.draw2d.IFigure;
14
14
15
/**
15
/*
16
 * The root figure for Zest.  The figure is broken up into four segments, 
16
 * The root figure for Zest. The figure is broken up into four segments, 1. The
17
 * 1. The Connections
17
 * Connections 2. The Nodes 3. The Highlighted Connections 4. The Highlighted
18
 * 2. The Nodes
18
 * Nodes
19
 * 3. The Highlighted Connections
20
 * 4. The Highlighted Nodes
21
 * 
19
 * 
22
 * @author Ian Bull
20
 * @author Ian Bull
23
 * 
24
 */
21
 */
25
public class ZestRootLayer extends FreeformLayer {
22
public class ZestRootLayer extends FreeformLayer {
26
23
(-)META-INF/MANIFEST.MF (-1 / +3 lines)
Lines 11-17 Link Here
11
Eclipse-LazyStart: false
11
Eclipse-LazyStart: false
12
Export-Package: org.eclipse.zest.core.messages,
12
Export-Package: org.eclipse.zest.core.messages,
13
 org.eclipse.zest.core.viewers,
13
 org.eclipse.zest.core.viewers,
14
 org.eclipse.zest.core.widgets
14
 org.eclipse.zest.core.viewers.internal,
15
 org.eclipse.zest.core.widgets,
16
 org.eclipse.zest.core.widgets.internal
15
Import-Package: com.ibm.icu.text
17
Import-Package: com.ibm.icu.text
16
Bundle-RequiredExecutionEnvironment: J2SE-1.4
18
Bundle-RequiredExecutionEnvironment: J2SE-1.4
17
Bundle-ClassPath: .
19
Bundle-ClassPath: .

Return to bug 224116