|
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 |
} |