edu.uci.ics.jung.graph.Graph.getEdgeType()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中edu.uci.ics.jung.graph.Graph.getEdgeType()方法的一些代码示例,展示了Graph.getEdgeType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getEdgeType()方法的具体详情如下:
包路径:edu.uci.ics.jung.graph.Graph
类名称:Graph
方法名:getEdgeType

Graph.getEdgeType介绍

暂无

代码示例

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getEdgeType(java.lang.Object)
 */
@Override
public EdgeType getEdgeType(E edge) {
  return delegate.getEdgeType(edge);
}

代码示例来源:origin: net.sf.jung/jung-visualization

/**
 * 
 */
public Shape apply(Context<Graph<V,E>,E> context)
{
  if (context.graph.getEdgeType(context.element) == EdgeType.DIRECTED)
    return directed_arrow;
  else 
    return undirected_arrow;
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getEdgeType(java.lang.Object)
 */
public synchronized EdgeType getEdgeType(E edge) {
  return delegate.getEdgeType(edge);
}

代码示例来源:origin: net.sf.jung/jung-visualization

public EdgeType getEdgeType(E edge) {
  return graph.getEdgeType(edge);
}
public Pair<V> getEndpoints(E edge) {

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getEdgeType(java.lang.Object)
 */
@Override
public synchronized EdgeType getEdgeType(E edge) {
  return delegate.getEdgeType(edge);
}

代码示例来源:origin: geogebra/geogebra

/**
 * @see edu.uci.ics.jung.graph.Graph#getEdgeType(java.lang.Object)
 */
@Override
public EdgeType getEdgeType(E edge) {
  return delegate.getEdgeType(edge);
}

代码示例来源:origin: net.sf.jung/jung-visualization

public Number apply(Context<Graph<V,E>,E> context) {
  Graph<V,E> graph = context.graph;
  E e = context.element;
  if (graph.getEdgeType(e) == EdgeType.DIRECTED)
    return directed_value;
  else 
    return undirected_value;
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getEdgeType(java.lang.Object)
 */
public EdgeType getEdgeType(E edge) {
  return delegate.getEdgeType(edge);
}

代码示例来源:origin: net.sf.jung/jung-api

/**
 * @see edu.uci.ics.jung.graph.Graph#getEdgeType(java.lang.Object)
 */
public EdgeType getEdgeType(E edge) {
  return delegate.getEdgeType(edge);
}

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

/**
 * Returns the edge type of en edge.
 * @param edge The edge.
 * @return The edge type.
 */
public EdgeType getEdgeType(Object edge)
{
  return delegate.getEdgeType(edge);
}

代码示例来源:origin: net.sf.jung/jung-visualization

public boolean apply(Context<Graph<V,E>,E> c) {
  return c.graph.getEdgeType(c.element) == EdgeType.DIRECTED;
}

代码示例来源:origin: net.sf.jung/jung-samples

public boolean apply(Context<Graph<V,E>,E> context)
  {
    Graph<V,E> graph = context.graph;
    E e = context.element;
    if (graph.getEdgeType(e) == EdgeType.DIRECTED && show_d) {
      return true;
    }
    if (graph.getEdgeType(e) == EdgeType.UNDIRECTED && show_u) {
      return true;
    }
    return false;
  }
}

代码示例来源:origin: net.sf.jung/jung-visualization

public boolean apply(Context<Graph<V,E>,E> c) {
  return c.graph.getEdgeType(c.element) == EdgeType.UNDIRECTED;
}

代码示例来源:origin: net.sourceforge.jadex/jadex-tools-comanalyzer

/**
   * Use the specified parameter to perform a test that returns true or
   * false. Returns <code>true</code> if the arrow ought to be shown,
   * else <code>false</code>.
   */
  public boolean evaluate(Object context)
  {
    Graph graph = (Graph)((Context)context).graph;
    MessageGroup e = (MessageGroup)((Context)context).element;
    if(graph.getEdgeType(e) == EdgeType.DIRECTED && show_d)
    {
      return true;
    }
    if(graph.getEdgeType(e) == EdgeType.UNDIRECTED && show_u)
    {
      return true;
    }
    return false;
  }
}

代码示例来源:origin: net.sf.jung/jung-algorithms

public Double apply(VEPair<V,E> ve_pair)
  {
    V v = ve_pair.getV();
    E e = ve_pair.getE();
    if (graph.getEdgeType(e) != EdgeType.DIRECTED)
      throw new IllegalArgumentException("This Function only" +
          " operates on directed edges");
    return 1.0 / (graph.isSource(v, e) ? 
        graph.outDegree(v) : 
        graph.inDegree(v));
  }
}

代码示例来源:origin: org.opendaylight.controller.thirdparty/net.sf.jung2

/**
   * @see org.apache.commons.collections15.Transformer#transform(Object)
   * @throws IllegalArgumentException
   */
  public Double transform(VEPair<V,E> ve_pair)
  {
    V v = ve_pair.getV();
    E e = ve_pair.getE();
    if (graph.getEdgeType(e) != EdgeType.DIRECTED)
      throw new IllegalArgumentException("This transformer only" +
          " operates on directed edges");
    return 1.0 / (graph.isSource(v, e) ? 
        graph.outDegree(v) : 
        graph.inDegree(v));
  }
}

代码示例来源:origin: geogebra/geogebra

/**
   * @see org.apache.commons.collections15.Transformer#transform(Object)
   * @throws IllegalArgumentException
   */
  @Override
  public Double transform(VEPair<V, E> ve_pair) {
    V v = ve_pair.getV();
    E e = ve_pair.getE();
    if (graph.getEdgeType(e) != EdgeType.DIRECTED) {
      throw new IllegalArgumentException(
          "This transformer only" + " operates on directed edges");
    }
    return 1.0 / (graph.isSource(v, e) ? graph.outDegree(v)
        : graph.inDegree(v));
  }
}

代码示例来源:origin: net.sf.jung/jung-visualization

public Graph getClusterGraph(Graph inGraph, Collection picked) {
  Graph clusterGraph;
  try {
    clusterGraph = createGraph();
  } catch (InstantiationException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    return null;
  } catch (IllegalAccessException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    return null;
  }
  for(Object v : picked) {
    clusterGraph.addVertex(v);
    Collection edges = inGraph.getIncidentEdges(v);
    for(Object edge : edges) {
      Pair endpoints = inGraph.getEndpoints(edge);
      Object v1 = endpoints.getFirst();
      Object v2 = endpoints.getSecond();
      if(picked.containsAll(endpoints)) {
        clusterGraph.addEdge(edge, v1, v2, inGraph.getEdgeType(edge));
      }
    }
  }
  return clusterGraph;
}

代码示例来源:origin: net.sf.jung/jung-visualization

public Paint apply(E e)
{
  Layout<V, E> layout = vv.getGraphLayout();
  Pair<V> p = layout.getGraph().getEndpoints(e);
  V b = p.getFirst();
  V f = p.getSecond();
  Point2D pb = transformer.transform(layout.apply(b));
  Point2D pf = transformer.transform(layout.apply(f));
  float xB = (float) pb.getX();
  float yB = (float) pb.getY();
  float xF = (float) pf.getX();
  float yF = (float) pf.getY();
  if ((layout.getGraph().getEdgeType(e)) == EdgeType.UNDIRECTED)  {
    xF = (xF + xB) / 2;
    yF = (yF + yB) / 2;
  } 
  if(selfLoop.apply(Context.<Graph<V,E>,E>getInstance(layout.getGraph(), e))) {
    yF += 50;
    xF += 50;
  }
  return new GradientPaint(xB, yB, getColor1(e), xF, yF, getColor2(e), true);
}

代码示例来源:origin: net.sourceforge.ondex.apps/ovtk2-default

EdgeType type = graph.getEdgeType(edge);
if (type.equals(EdgeType.DIRECTED) && !directed)
  xmlw.writeAttribute("directed", "true");

相关文章