• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ShapeNodeRealizer类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中y.view.ShapeNodeRealizer的典型用法代码示例。如果您正苦于以下问题:Java ShapeNodeRealizer类的具体用法?Java ShapeNodeRealizer怎么用?Java ShapeNodeRealizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ShapeNodeRealizer类属于y.view包,在下文中一共展示了ShapeNodeRealizer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setCentralityLayoutDefaults

点赞 3

import y.view.ShapeNodeRealizer; //导入依赖的package包/类
/**
 * Sets the layout attributes of a graph for visualizing a CentralityMap.
 * @param graph The graph of the CentralityMap that is visualized
 */
private void setCentralityLayoutDefaults(CustomGraph graph) {
	NodeCursor nodes = graph.nodes();
	while(nodes.ok()) {
		Node node = nodes.node();
		ShapeNodeRealizer nRealizer = new ShapeNodeRealizer(graph.getRealizer(node));
		graph.setRealizer(node, nRealizer);
		nRealizer.setShapeType(ShapeNodeRealizer.ELLIPSE);
		nodes.next();
	}
	if(graph.isOfType(GraphType.DIRECTED)) {
		EdgeCursor edges = graph.edges();
		while(edges.ok()) {
			Edge edge = edges.edge();
			EdgeRealizer eRealizer = graph.getRealizer(edge);
			eRealizer.setArrow(Arrow.STANDARD);
			edges.next();
		}
	}
}
 

开发者ID:rwth-acis,
项目名称:REST-OCD-Services,
代码行数:24,
代码来源:LayoutHandler.java

示例2: setLayoutDefaults

点赞 2

import y.view.ShapeNodeRealizer; //导入依赖的package包/类
/**
 * Sets the default layout attributes for a graph, such as node and edge shapes and node sizes.
 * @param graph
 */
private void setLayoutDefaults(CustomGraph graph, double minNodeSize, double maxNodeSize) {
	NodeCursor nodes = graph.nodes();
	Node node;
	/*
	 * Node size scaling factor
	 */
	double minDegree = graph.getMinWeightedInDegree();
	double maxDegree = graph.getMaxWeightedInDegree();
	double scalingFactor = (maxNodeSize - minNodeSize) / (maxDegree - minDegree);
	while(nodes.ok()) {
		node = nodes.node();
		ShapeNodeRealizer nRealizer = new ShapeNodeRealizer(graph.getRealizer(node));
		graph.setRealizer(node, nRealizer);
		nRealizer.setShapeType(ShapeNodeRealizer.ELLIPSE);
		double curNodeSize = minNodeSize + (graph.getWeightedInDegree(node) - minDegree) * scalingFactor;
		nRealizer.setSize(curNodeSize, curNodeSize);
		nodes.next();
	}
	EdgeCursor edges = graph.edges();
	Edge edge;
	while(edges.ok()) {
		edge = edges.edge();
		EdgeRealizer eRealizer = graph.getRealizer(edge);
		if(graph.isOfType(GraphType.DIRECTED)) {
			eRealizer.setArrow(Arrow.STANDARD);
		}
		edges.next();
	}
}
 

开发者ID:rwth-acis,
项目名称:REST-OCD-Services,
代码行数:34,
代码来源:LayoutHandler.java

示例3: ZyProximityNodeRealizer

点赞 2

import y.view.ShapeNodeRealizer; //导入依赖的package包/类
/**
 * Creates a new node realizer.
 * 
 * @param content Content of the realizer.
 */

public ZyProximityNodeRealizer(final ZyLabelContent content) {
  Preconditions.checkNotNull(content, "Error: Node content can't be null.");

  m_content = content;

  setShapeType(ShapeNodeRealizer.ELLIPSE);

  setLineType(LineType.LINE_2);

  setDropShadowOffsetX((byte) 0);
  setDropShadowOffsetY((byte) 0);

  setFillColor(m_backGroundColor);
  setSloppySelectionColor(m_backGroundColor);

  final Rectangle2D bounds = getNodeContent().getBounds();

  final double diameter = Math.max(bounds.getWidth(), bounds.getHeight());

  setSize(diameter, diameter);
}
 

开发者ID:google,
项目名称:binnavi,
代码行数:28,
代码来源:ZyProximityNodeRealizer.java

示例4: ZyNormalNodeRealizer

点赞 2

import y.view.ShapeNodeRealizer; //导入依赖的package包/类
/**
 * Creates a new node realizer.
 *
 * @param content Content of the realizer.
 */
public ZyNormalNodeRealizer(final ZyLabelContent content) {
  Preconditions.checkNotNull(content, "Error: Node content can't be null.");

  m_content = content;

  setShapeType(ShapeNodeRealizer.ROUND_RECT);

  setLineType(LineType.LINE_2);

  setDropShadowOffsetX(SHADOW_SIZE);
  setDropShadowOffsetY(SHADOW_SIZE);

  setDropShadowColor(SHADOW_COLOR);

  final Rectangle2D bounds = getNodeContent().getBounds();

  setSize(bounds.getWidth(), bounds.getHeight());
}
 

开发者ID:google,
项目名称:binnavi,
代码行数:24,
代码来源:ZyNormalNodeRealizer.java

示例5: ZyGroupNodeRealizer

点赞 2

import y.view.ShapeNodeRealizer; //导入依赖的package包/类
public ZyGroupNodeRealizer(final ZyLabelContent content, final boolean collapsed) {
  setShapeType(ShapeNodeRealizer.ROUND_RECT);

  setLineType(LineType.LINE_2);

  setDropShadowOffsetX(SHADOW_SIZE);
  setDropShadowOffsetY(SHADOW_SIZE);

  setDropShadowColor(SHADOW_COLOR);

  m_content = content;

  final Rectangle2D bounds = getNodeContent().getBounds();

  setSize(bounds.getWidth(), bounds.getHeight());

  setGroupClosed(collapsed);
}
 

开发者ID:google,
项目名称:binnavi,
代码行数:19,
代码来源:ZyGroupNodeRealizer.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)