Class ZestContentViewer

    • Constructor Detail

      • ZestContentViewer

        public ZestContentViewer​(Module module)
        Constructs a new ZestContentViewer. The given Module is saved so that it can be later used to create an Injector that is later used for the injection of members and the construction of the IDomain.
        Parameters:
        module - The Module from which an Injector is created later.
    • Method Detail

      • createCanvas

        protected javafx.embed.swt.FXCanvas createCanvas​(Composite parent,
                                                         int style)
        Creates an FXCanvas inside of the given parent Composite. The FXCanvas serves acs the container for the JavaFX Scene which renders the contents.
        Parameters:
        parent - The parent Composite.
        style - The SWT style bits to be used for the to be created canvas.
        Returns:
        An FXCanvas inside of the given parent.
      • createEdge

        protected Edge createEdge​(ILabelProvider labelProvider,
                                  java.lang.Object contentSourceNode,
                                  Node sourceNode,
                                  java.lang.Object contentTargetNode,
                                  Node targetNode)
        Constructs and returns a new Edge connecting the given sourceNode and targetNode. If the labelProvider implements IGraphAttributesProvider, then attributes for the edge are determined using the IGraphAttributesProvider.getEdgeAttributes(Object, Object) methods and inserted into the edge.
        Parameters:
        labelProvider - This viewer's ILabelProvider for convenience.
        contentSourceNode - The content element representing the source node of this edge.
        sourceNode - The already created source Node of this edge.
        contentTargetNode - The content element representing the target node of this edge.
        targetNode - The already created target Node of this edge.
        Returns:
        The new Edge.
      • createEmptyGraph

        protected Graph createEmptyGraph()
        Constructs and returns a new Graph and inserts default attributes into it:
        1. layout algorithm
        Returns:
        A new Graph with default attributes.
      • createNestedGraph

        protected Graph createNestedGraph​(java.lang.Object contentNestingNode,
                                          IGraphContentProvider graphContentProvider,
                                          ILabelProvider labelProvider)
        Creates a Graph nested in the node represented by the given contentNestingNode.
        Parameters:
        contentNestingNode - The content Object that represents the nesting node.
        graphContentProvider - This viewer's IGraphContentProvider for convenience.
        labelProvider - This viewer's ILabelProvider for convenience.
        Returns:
        The new Graph.
      • createNodesAndEdges

        protected void createNodesAndEdges​(IGraphContentProvider graphContentProvider,
                                           ILabelProvider labelProvider,
                                           Graph graph,
                                           java.lang.Object[] contentNodes)
        Creates graph nodes and edges from the given array of contentNodes.
        Parameters:
        graphContentProvider - This viewer's IGraphContentProvider for convenience.
        labelProvider - This viewer's ILabelProvider for convenience.
        graph - The Graph for which nodes and edges are created.
        contentNodes - Content elements which represent nodes that are to be created together with the edges between them.
      • getContentNodeMap

        public java.util.Map<java.lang.Object,​Node> getContentNodeMap()
        Returns an unmodifiable view of the content-node-map.
        Returns:
        An unmodifiable view of the content-node-map.
      • getContentViewer

        public IViewer getContentViewer()
        Returns the IViewer that displays the contents.
        Returns:
        The IViewer that displays the contents.
      • getControl

        public javafx.embed.swt.FXCanvas getControl()
        Specified by:
        getControl in class Viewer
      • inputChanged

        protected void inputChanged​(java.lang.Object input,
                                    java.lang.Object oldInput)
        Overrides:
        inputChanged in class Viewer
      • refresh

        public void refresh()
        Specified by:
        refresh in class Viewer
      • setLayoutAlgorithm

        public void setLayoutAlgorithm​(ILayoutAlgorithm layoutAlgorithm)
        Changes the ILayoutAlgorithm that is used for laying out the contents to the given value.
        Parameters:
        layoutAlgorithm - The new ILayoutAlgorithm to use.
      • toCssRgb

        protected java.lang.String toCssRgb​(Color color)
        Converts the given Color into a CSS string: "rgb(red,green,blue)".
        Parameters:
        color - The Color to convert.
        Returns:
        The corresponding CSS string.