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


Java GraphConstants.setBorderColor方法代码示例

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


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

示例1: createVertex

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

        // Create vertex with the given name
        DefaultGraphCell cell = new DefaultGraphCell(name);

        GraphConstants.setBorder(cell.getAttributes(), BorderFactory.createEtchedBorder());
        GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(x, y, 10, 10));
        GraphConstants.setResize(cell.getAttributes(), true);
        GraphConstants.setAutoSize(cell.getAttributes(), true);

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

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

        return cell;
    }
 
开发者ID:fabioz,项目名称:Pydev,代码行数:26,代码来源:GraphVisitor.java

示例2: createBounds

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public static Map createBounds(AttributeMap map, double x, double y, Dimension dimension, Color c, boolean moveable)
	{
//		final int ALPHA = 255;
		GraphConstants.setBounds(map, map.createRect(x, y, dimension.getWidth(), dimension.getHeight()));
//		GraphConstants.setBorder(map, BorderFactory.createBevelBorder(BevelBorder.RAISED));
		GraphConstants.setForeground(map, Color.BLACK.darker().darker());//new Color(ALPHA - c.getRed(), ALPHA - c.getGreen(), ALPHA - c.getBlue(), ALPHA));
		GraphConstants.setBackground(map, c.darker());
		// Add a nice looking gradient background
		GraphConstants.setGradientColor(map, c.darker());
		// Make sure the cell is resized on insert
//		GraphConstants.setSize();
//		GraphConstants.setResize(map, true);
		// Add a Border Color Attribute to the Map
		GraphConstants.setBorderColor(map, Color.BLACK.darker().darker());
		GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
		GraphConstants.setMoveable(map, moveable);
		GraphConstants.setOpaque(map, true);
		GraphConstants.setResize(map, false);
		GraphConstants.setAutoSize(map, true);
		return map;
	}
 
开发者ID:NCIP,项目名称:caadapter,代码行数:22,代码来源:UIHelper.java

示例3: createBounds

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public static Map createBounds(AttributeMap map, double x, double y, Dimension dimension, Color c, boolean moveable)
{
	//		final int ALPHA = 255;
	GraphConstants.setBounds(map, map.createRect(x, y, dimension.getWidth(), dimension.getHeight()));
	//		GraphConstants.setBorder(map, BorderFactory.createBevelBorder(BevelBorder.RAISED));
	GraphConstants.setForeground(map, Color.BLACK.darker().darker());//new Color(ALPHA - c.getRed(), ALPHA - c.getGreen(), ALPHA - c.getBlue(), ALPHA));
	GraphConstants.setBackground(map, c.darker());
	// Add a nice looking gradient background
	GraphConstants.setGradientColor(map, c.darker());
	// Make sure the cell is resized on insert
	//		GraphConstants.setSize();
	//		GraphConstants.setResize(map, true);
	// Add a Border Color Attribute to the Map
	GraphConstants.setBorderColor(map, Color.BLACK.darker().darker());
	GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
	GraphConstants.setMoveable(map, moveable);
	GraphConstants.setOpaque(map, true);
	GraphConstants.setResize(map, false);
	GraphConstants.setAutoSize(map, true);
	return map;
}
 
开发者ID:NCIP,项目名称:caadapter,代码行数:22,代码来源:UIHelper.java

示例4: createVertex

import org.jgraph.graph.GraphConstants; //导入方法依赖的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

示例5: AbstractGraphVertex

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
 * Constructor for graph
 * 
 * @param x
 * @param y
 * @param data
 * @param graph
 */
public AbstractGraphVertex(int x, int y, DataItem data,
		MicroarrayGraph graph) {
	super(data);
	this.graph = graph;
	this.setPosition(new Point(x,y));
	
	GraphConstants.setGradientColor(
			this.getAttributes(),
			DEFAULT_VERTEX_COLOR);
	
	GraphConstants.setBorderColor(
			this.getAttributes(), 
			Color.black);
	
	GraphConstants.setOpaque(
			this.getAttributes(), 
			true);
	
	GraphConstants.setVerticalAlignment(
			this.getAttributes(), 
			JLabel.TOP);
	
	Font font = GraphConstants.getFont(this.getAttributes());
	font = font.deriveFont((float)font.getSize() + 3);
	GraphConstants.setFont(this.getAttributes(), font);
}
 
开发者ID:chipster,项目名称:chipster,代码行数:35,代码来源:AbstractGraphVertex.java

示例6: adjustLayout

import org.jgraph.graph.GraphConstants; //导入方法依赖的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

示例7: getDefaultFunctionBoxPortAttributes

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public static final Map getDefaultFunctionBoxPortAttributes(Map map, Dimension portDimension)
{
	GraphConstants.setSize(map, portDimension);
	GraphConstants.setSize(map, portDimension);
	GraphConstants.setSelectable(map, true);
	GraphConstants.setBorderColor(map, Color.RED.darker().darker());
	GraphConstants.setMoveable(map, true);
	return map;
}
 
开发者ID:NCIP,项目名称:caadapter,代码行数:10,代码来源:UIHelper.java


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