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


Java GraphConstants.setFont方法代码示例

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


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

示例1: 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

示例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: 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

示例4: getDefaultUnmovableMappingEdgeStyle

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
private static final AttributeMap getDefaultUnmovableMappingEdgeStyle(Color lineColor)
{
	AttributeMap lineStyle = new AttributeMap();
	GraphConstants.setLineBegin(lineStyle, GraphConstants.ARROW_NONE);
	GraphConstants.setLineColor(lineStyle,lineColor);
	GraphConstants.setBeginSize(lineStyle, 10);
	GraphConstants.setFont(lineStyle, GraphConstants.DEFAULTFONT.deriveFont(10));
	GraphConstants.setBendable(lineStyle, false);
	GraphConstants.setEditable(lineStyle, false);
	GraphConstants.setMoveable(lineStyle, false);
	GraphConstants.setResize(lineStyle, false);
	GraphConstants.setSizeable(lineStyle, false);
	return lineStyle;
}
 
开发者ID:NCIP,项目名称:caadapter,代码行数:15,代码来源:UIHelper.java

示例5: PlaceGraphCell

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public PlaceGraphCell(int id, int posX, int posY) {
    super("P" + id, posX, posY);
    GraphConstants.setBackground(getAttributes(), Color.ORANGE);
    GraphConstants.setFont(getAttributes(), FONT);
}
 
开发者ID:tomaszi1,项目名称:petri-nets-simulator,代码行数:6,代码来源:PlaceGraphCell.java

示例6: TransitionGraphCell

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public TransitionGraphCell(int id, int posX, int posY) {
    super("T" + id, posX, posY);
    GraphConstants.setBackground(getAttributes(), Color.CYAN);
    GraphConstants.setFont(getAttributes(), FONT);
}
 
开发者ID:tomaszi1,项目名称:petri-nets-simulator,代码行数:6,代码来源:TransitionGraphCell.java

示例7: ArcGraphCell

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public ArcGraphCell() {
    GraphConstants.setLineEnd(getAttributes(), GraphConstants.ARROW_TECHNICAL);
    GraphConstants.setLabelPosition(getAttributes(), new Point2D.Double(GraphConstants.PERMILLE / 2, -10));
    GraphConstants.setFont(getAttributes(), FONT);
}
 
开发者ID:tomaszi1,项目名称:petri-nets-simulator,代码行数:6,代码来源:ArcGraphCell.java


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