Package org.eclipse.zest.core.widgets

Examples of org.eclipse.zest.core.widgets.GraphNode


    private void highlightBundles(BundleGraph graph, ISigilBundle selected,
        Set<ISigilBundle> connected)
    {
        for (ISigilBundle bundle : graph.getBundles())
        {
            GraphNode node = (GraphNode) findGraphItem(bundle);
            if (node != null)
            {
                node.unhighlight();

                if (bundle == selected)
                {
                    node.setHighlightColor(ColorConstants.yellow);
                    node.highlight();
                }
                else if (view.isDisplayed(BundleResolverView.DEPENDENTS))
                {
                    if (connected.contains(bundle))
                    {
                        node.setHighlightColor(ColorConstants.lightBlue);
                        node.highlight();
                    }
                }
            }
        }
    }
View Full Code Here


        Iterator nodes = viewer.getGraphControl().getNodes().iterator();
        Graph graph = viewer.getGraphControl();
        Dimension centre = new Dimension(graph.getBounds().width / 2, graph.getBounds().height / 2);
        while (nodes.hasNext()) {
            GraphNode graphNode = (GraphNode) nodes.next();
            if (graphNode.getLocation().x <= 1 && graphNode.getLocation().y <= 1) {
                graphNode.setLocation(centre.width, centre.height);
            }
        }

        currentRoot = focus;
View Full Code Here

   * @return has this node selected childen?
   */
  protected boolean hasSelectedSourceNodes(GraphNode node) {
    boolean result = false;
    for (Object connection : node.getTargetConnections()) {
      GraphNode source = ((GraphConnection) connection).getSource();
      if (getCheckboxFigure(source).isChecked()) {
        result = true;
        break;
      }

View Full Code Here

          .getElement();
      entry.getValue().addCheckListener(new ICheckListener() {

        @Override
        public void unchecked() {
          GraphNode node = getNodeForElement(element);
          for (Object connection : node.getSourceConnections()) {
            GraphNode destination = ((GraphConnection) connection)
                .getDestination();
            if (((GSSElementGraphNode) destination).getElement() instanceof Principle) {
              if (!hasSelectedSourceNodes(destination))
                getCheckboxFigure(destination).setIsUnchecked();
View Full Code Here

          .getElement();
      entry.getValue().addCheckListener(new ICheckListener() {

        @Override
        public void unchecked() {
          GraphNode node = getNodeForElement(element);
          for (Object connection : node.getSourceConnections()) {
            GraphNode destination = ((GraphConnection) connection)
                .getDestination();
            if (((GSSElementGraphNode) destination).getElement() instanceof Goal) {
              if (!hasSelectedSourceNodes(destination))
                getCheckboxFigure(destination).setIsUnchecked();
View Full Code Here

  public void deselectDecomposition(Decomposition decomposition){
    cacheManager.markSelectedGoalDecompositionAsToRemove(decomposition);
   
    Element source = cacheManager.getSourceOfRelation(decomposition);
   
    GraphNode sourceNode = getNodeForElement(source);
   
    deselectTargets(sourceNode);
   
  }
View Full Code Here

   
  for (Object outgoingConnection : sourceNode.getSourceConnections()){
   
   

    GraphNode destinationNode = ((GraphConnection)outgoingConnection).getDestination();
   
    Element destinationElement = getElementForNode((GSSElementGraphNode) destinationNode);
   
    Decomposition decomposition = cacheManager.getDecompositionBetween(sourceElement, destinationElement);
    cacheManager.markSelectedGoalDecompositionAsToRemove(decomposition);
View Full Code Here

   *            a Relation between Elements
   */
  protected GraphConnection createConnection(final Relation relation) {
    Element target = cacheManager.getTargetOfRelation(relation);
    Element source = cacheManager.getSourceOfRelation(relation);
    GraphNode targetNode = getNodeForElement(target);
   
    if (targetNode == null)
      new Exception(relation + " has no vaild traget").printStackTrace();
 
   
    GraphNode sourceNode = getNodeForElement(source);
   
    if (sourceNode == null)
      new Exception(relation + " has no vaild source").printStackTrace();
   
    String weight = cacheManager.getRelationWeightString(relation);
View Full Code Here

      return result;
    }
   
    public void setCaptionsForLayers(String layerCaption, int layerIndex){
      layerCaptions.put(layerIndex,layerCaption );
      GraphNode node = layerLabelGraphNodeList.get(layerIndex);
      String formatedCaption = formatCaption(layerCaption, node.getSize().height);
      node.setText(formatedCaption);
    }
View Full Code Here

      node.setText(formatedCaption);
    }
   
    public void setToolTipsForLayers(IFigure tooltip, int layerIndex){

      GraphNode node = layerLabelGraphNodeList.get(layerIndex);

      node.setTooltip(tooltip);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.zest.core.widgets.GraphNode

Copyright © 2018 www.massapicom. 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.