当前位置: 首页>>代码示例>>Java>>正文


Java DefaultGraphCell.addPort方法代码示例

本文整理汇总了Java中org.jgraph.graph.DefaultGraphCell.addPort方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultGraphCell.addPort方法的具体用法?Java DefaultGraphCell.addPort怎么用?Java DefaultGraphCell.addPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jgraph.graph.DefaultGraphCell的用法示例。


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

示例1: createCell

import org.jgraph.graph.DefaultGraphCell; //导入方法依赖的package包/类
/**
 * Creates a new JGraph cell with the specified rendering information.
 *
 * @param name String that is the cell name.
 * @param x Double that is the X coordinate.
 * @param y Double that is the Y coordinate.
 * @param scale Double that is the scale information.
 * @param color Color of the future graph cell.
 * @return DMGraph cell generated with the specified rendering information.
 * @throws Exception
 */
public static DefaultGraphCell createCell(String name, double x, double y,
        double scale, Color color) throws Exception {
    DefaultGraphCell cell = new DefaultGraphCell(name);
    GraphConstants.setBounds(cell.getAttributes(),
            new Rectangle2D.Double(x, y, scale, scale));
    GraphConstants.setBorder(cell.getAttributes(),
            BorderFactory.createRaisedBevelBorder());
    GraphConstants.setOpaque(cell.getAttributes(), true);
    cell.addPort(new Point2D.Double(0, 0));
    if (color != null) {
        GraphConstants.setGradientColor(cell.getAttributes(), color);
    } else {
        GraphConstants.setGradientColor(cell.getAttributes(), Color.BLUE);
    }
    return cell;
}
 
开发者ID:datapoet,项目名称:hubminer,代码行数:28,代码来源:JGraphConverter.java

示例2: createVertex

import org.jgraph.graph.DefaultGraphCell; //导入方法依赖的package包/类
public DefaultGraphCell createVertex(String name, double x,
		double y, double w, double h, Color bg, boolean raised) {

	// Create vertex with the given name
	DefaultGraphCell cell = new DefaultGraphCell(name);
/*	ob.x = x; 
	ob.y = y;*/
//	System.out.println("adding node:"+ob.toString()+" to cell "+cellCount +"at ("+x+","+y+")");
	// Set bounds
	GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(
			x, y, w, h));

	// Set fill color
	if (bg != null) {
		GraphConstants.setGradientColor(cell.getAttributes(), bg);
		GraphConstants.setOpaque(cell.getAttributes(), true);
	}

	// Set raised border
	if (raised)
		GraphConstants.setBorder(cell.getAttributes(), BorderFactory
				.createRaisedBevelBorder());
	else
		// Set black border
		GraphConstants.setBorderColor(cell.getAttributes(), Color.black);

	// Add a Floating Port
	cell.addPort();

	return cell;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:32,代码来源:BinomialTradingApplication.java

示例3: createEdge

import org.jgraph.graph.DefaultGraphCell; //导入方法依赖的package包/类
/**
 * Creates a new edge in JGraph.
 *
 * @param source DefaultGraphCell that is the source for the edge.
 * @param target DefaultGraphCell that is the target for the edge.
 * @return DefaultGraphCell that was generated to connect the source with
 * the target.
 * @throws Exception
 */
public static DefaultGraphCell createEdge(DefaultGraphCell source,
        DefaultGraphCell target) throws Exception {
    DefaultEdge edge = new DefaultEdge();
    source.addPort();
    edge.setSource(source.getChildAt(source.getChildCount() - 1));
    target.addPort();
    edge.setTarget(target.getChildAt(target.getChildCount() - 1));
    return edge;
}
 
开发者ID:datapoet,项目名称:hubminer,代码行数:19,代码来源:JGraphConverter.java

示例4: adjustLayout

import org.jgraph.graph.DefaultGraphCell; //导入方法依赖的package包/类
private static void adjustLayout(FeatureDefinitionEntry feature, @Nullable Color bg) {
	DefaultGraphCell cell = _featureGraphModelAdapter.getVertexCell(feature);
	GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(25, 25, 200, 20));
	GraphConstants.setAutoSize(cell.getAttributes(), true);

	if (bg != null) {
		GraphConstants.setBackground(cell.getAttributes(), bg);
		GraphConstants.setOpaque(cell.getAttributes(), true);
	}

	GraphConstants.setBorderColor(cell.getAttributes(), Color.black);
	cell.addPort();
}
 
开发者ID:FRosner,项目名称:DataGenerator,代码行数:14,代码来源:FeatureDefinitionGraphVisualizationManager.java

示例5: createCell

import org.jgraph.graph.DefaultGraphCell; //导入方法依赖的package包/类
private DefaultGraphCell createCell(String name, boolean raised) {
	DefaultGraphCell cell = new DefaultGraphCell(name);
	cell.addPort();
	GraphConstants.setBorder(cell.getAttributes(), BorderFactory.createRaisedBevelBorder());
	return cell;
}
 
开发者ID:e-Contract,项目名称:eid-applet,代码行数:7,代码来源:JGraphTest.java

示例6: createWeightedEdge

import org.jgraph.graph.DefaultGraphCell; //导入方法依赖的package包/类
/**
 * Creates a new weighted edge in JGraph.
 *
 * @param source DefaultGraphCell that is the source for the edge.
 * @param target DefaultGraphCell that is the target for the edge.
 * @param weight Double that is the weight of the edge.
 * @return DefaultGraphCell that was generated to connect the source with
 * the target, with the specified weight.
 * @throws Exception
 */
public static DefaultGraphCell createWeightedEdge(DefaultGraphCell source,
        DefaultGraphCell target, double weight) throws Exception {
    DefaultEdge edge = new DefaultEdge((new Double(weight)).toString());
    source.addPort();
    edge.setSource(source.getChildAt(source.getChildCount() - 1));
    target.addPort();
    edge.setTarget(target.getChildAt(target.getChildCount() - 1));
    return edge;
}
 
开发者ID:datapoet,项目名称:hubminer,代码行数:20,代码来源:JGraphConverter.java


注:本文中的org.jgraph.graph.DefaultGraphCell.addPort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。