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


Java GraphConstants.setIcon方法代码示例

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


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

示例1: rotateComponent

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
 * Method that rotate components
 *
 * author Giuseppe De Cicco & Fabio Granara
 */
public void rotateComponent(Object[] cells) {
	if (cells == null) {
		cells = graph.getSelectionCells();
	}

	for (Object cell : cells) {
		if ((cell instanceof BlockingRegion) || cell instanceof JmtEdge) {
			continue;
		}

		JmtCell current = (JmtCell) cell;
		Map<Object, Map> nested = new Hashtable<Object, Map>();
		Map attributeMap = new Hashtable();
		ImageIcon icon;
		if (current.isLeftInputCell()) {
			icon = JMTImageLoader.loadImage(current.getIcon(), ImageLoader.MODIFIER_MIRROR);
		} else {
			icon = JMTImageLoader.loadImage(current.getIcon());
		}
		GraphConstants.setIcon(attributeMap, icon);

		nested.put(cell, attributeMap);
		current.setLeftInputCell(!current.isLeftInputCell());
		current.updatePortPositions(nested, icon, current.getSize(graph));
		graph.getGraphLayoutCache().edit(nested);
	}
	avoidOverlappingCell(cells);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:34,代码来源:Mediator.java

示例2: rotateComponent

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
 * Method that rotate components
 *
 * author Giuseppe De Cicco & Fabio Granara
 */
public void rotateComponent(Object[] cells) {
	if (cells == null) {
		cells = graph.getSelectionCells();
	}

	for (Object cell : cells) {

		if ((cell instanceof BlockingRegion) || cell instanceof JmtEdge) {
			continue;
		}

		JmtCell current = (JmtCell) cell;

		Map<Object, Map> nested = new Hashtable<Object, Map>();
		Map attributeMap = new Hashtable();
		ImageIcon icon;
		if (current.isLeftInputCell()) {
			icon = JMTImageLoader.loadImage(current.getIcon(), ImageLoader.MODIFIER_MIRROR);
		} else {
			icon = JMTImageLoader.loadImage(current.getIcon());
		}
		GraphConstants.setIcon(attributeMap, icon);

		nested.put(cell, attributeMap);
		current.setLeftInputCell(!current.isLeftInputCell());
		current.updatePortPositions(nested, icon, current.getSize(graph));
		// _____DA INSERIRE QUI L AGGIORNAMENTO DELLA DECORAZIONE DELLA
		// FRECCIA______
		graph.getGraphLayoutCache().edit(nested);
	}
	avoidOverlappingCell(cells);
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:38,代码来源:Mediator.java

示例3: setVisual

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void setVisual() {
	Element graphics = data.getChild("graphics");
	ImageIcon icon = null;
	switch(transitionType){
	case NORMAL_TRANSITION:{
		if(data.getChild("toolspecific").getChild("graphics").getChildText("color").equals("black"))
			icon = new ImageIcon("resources/images/basicTransition_black.png");
		else if(data.getChild("toolspecific").getChild("graphics").getChildText("color").equals("green"))
			icon = new ImageIcon("resources/images/basicTransition_green.png");
	}
	break;
	case IMPORT_TRANSITION:{
		if(data.getChild("toolspecific").getChild("graphics").getChildText("color").equals("black"))
			icon = new ImageIcon("resources/images/importTransition_black.png");
		else if(data.getChild("toolspecific").getChild("graphics").getChildText("color").equals("green"))
			icon = new ImageIcon("resources/images/importTransition_green.png");
	}
	break;
	case EXPORT_TRANSITION:{
		if(data.getChild("toolspecific").getChild("graphics").getChildText("color").equals("black"))
			icon = new ImageIcon("resources/images/exportTransition_back.png");
		else if(data.getChild("toolspecific").getChild("graphics").getChildText("color").equals("green"))
			icon = new ImageIcon("resources/images/exportTransition_green.png");
	}
	break;
	}
			
	GraphConstants.setIcon(getAttributes(), icon);
	
	int x = Integer.parseInt(graphics.getChild("position").getAttributeValue("x"));
	int y = Integer.parseInt(graphics.getChild("position").getAttributeValue("y")) + yOffSet;		
	GraphConstants.setBounds(getAttributes(), new Rectangle2D.Double(x,y,50,50));		
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:34,代码来源:TransitionCell.java

示例4: setVisual

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void setVisual() {
	Element graphics = data.getChild("graphics");
	ImageIcon icon = new ImageIcon("resources/images/" + graphics.getChildText("icon"));
	
			
	GraphConstants.setIcon(getAttributes(), icon);
	
	int x = Integer.parseInt(graphics.getChild("position").getAttributeValue("x"));
	int y = Integer.parseInt(graphics.getChild("position").getAttributeValue("y"));
	int width = Integer.parseInt(graphics.getChild("size").getAttributeValue("width"));
	int height = Integer.parseInt(graphics.getChild("size").getAttributeValue("height"));
	GraphConstants.setBounds(getAttributes(), new Rectangle2D.Double(x,y,width,height));		
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:14,代码来源:InitialStateCell.java

示例5: setVisual

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void setVisual() {
	Element graphics = data.getChild("graphics");			
	ImageIcon icon = new ImageIcon(ItSIMPLE.getIconsPathElement().getText() + graphics.getChildText("icon"));			
	GraphConstants.setIcon(this.getAttributes(), icon);
	
	int x = Integer.parseInt(graphics.getChild("position").getAttributeValue("x"));
	int y = Integer.parseInt(graphics.getChild("position").getAttributeValue("y"));
	int width = Integer.parseInt(graphics.getChild("size").getAttributeValue("width"));
	int height = Integer.parseInt(graphics.getChild("size").getAttributeValue("height"));
	GraphConstants.setBounds(this.getAttributes(), new Rectangle2D.Double(x,y,width,height));		
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:12,代码来源:UseCaseCell.java

示例6: setVisual

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void setVisual() {
	Element graphics = data.getChild("graphics");			
	ImageIcon icon = new ImageIcon(ItSIMPLE.getIconsPathElement().getText() + graphics.getChildText("icon"));		
	GraphConstants.setIcon(this.getAttributes(), icon);
	
	int x = Integer.parseInt(graphics.getChild("position").getAttributeValue("x"));
	int y = Integer.parseInt(graphics.getChild("position").getAttributeValue("y"));
	int width = Integer.parseInt(graphics.getChild("size").getAttributeValue("width"));
	int height = Integer.parseInt(graphics.getChild("size").getAttributeValue("height"));
	GraphConstants.setBounds(this.getAttributes(), new Rectangle2D.Double(x,y,width,height));		
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:12,代码来源:ActorCell.java

示例7: setVisual

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void setVisual() {
	Element graphics = data.getChild("graphics");			
	ImageIcon icon = new ImageIcon(ItSIMPLE.getIconsPathElement().getText() + graphics.getChildText("icon"));			
	GraphConstants.setIcon(this.getAttributes(), icon);
	
	internalState = data.getChildText("condition");
	
	int x = Integer.parseInt(graphics.getChild("position").getAttributeValue("x"));
	int y = Integer.parseInt(graphics.getChild("position").getAttributeValue("y"));
	int width = Integer.parseInt(graphics.getChild("size").getAttributeValue("width"));
	int height = Integer.parseInt(graphics.getChild("size").getAttributeValue("height"));
	GraphConstants.setBounds(this.getAttributes(), new Rectangle2D.Double(x,y,width,height));		
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:14,代码来源:StateCell.java

示例8: setVisual

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void setVisual() {
	Element graphics = data.getChild("graphics");
	ImageIcon icon = new ImageIcon("resources/images/" + graphics.getChildText("icon"));
	
			
	GraphConstants.setIcon(getAttributes(), icon);
	
	int x = Integer.parseInt(graphics.getChild("position").getAttributeValue("x"));
	int y = Integer.parseInt(graphics.getChild("position").getAttributeValue("y"));		
	int width = Integer.parseInt(graphics.getChild("size").getAttributeValue("width"));
	int height = Integer.parseInt(graphics.getChild("size").getAttributeValue("height"));
	GraphConstants.setBounds(getAttributes(), new Rectangle2D.Double(x,y,width,height));		
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:14,代码来源:FinalStateCell.java

示例9: JmtCell

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
 * Creates a graph cell and initializes it with the specified user object.
 *
 * @param userObject an Object provided by the user that constitutes
 *                   the cell's data
 *
 * Conti Andrea  01-09-2003
 * Bertoli Marco 04-giu-2005
 */
public JmtCell(String icon, Object userObject) {
	super(userObject);
	ImageIcon ico = JMTImageLoader.loadImage(icon);
	GraphConstants.setIcon(attributes, ico);
	imageDimension = new Dimension(ico.getIconWidth(), ico.getIconHeight());
	GraphConstants.setSizeable(attributes, false);
	GraphConstants.setSize(attributes, imageDimension);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:18,代码来源:JmtCell.java

示例10: JmtCell

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
 * Creates a graph cell and initializes it with the specified user object.
 *
  * @param userObject an Object provided by the user that constitutes
 *                   the cell's data
 *
 * Conti Andrea  01-09-2003
 * Bertoli Marco 04-giu-2005
 */
public JmtCell(String icon, Object userObject) {
	super(userObject);
	ImageIcon ico = JMTImageLoader.loadImage(icon);
	GraphConstants.setIcon(attributes, ico);
	imageDimension = new Dimension(ico.getIconWidth(), ico.getIconHeight());
	GraphConstants.setSizeable(attributes, false);
	GraphConstants.setSize(attributes, imageDimension);
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:18,代码来源:JmtCell.java

示例11: setVisual

import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public void setVisual() {
	
	Iterator literalsIter = data.getChild("literals").getChildren("literal").iterator();
	
	literals = "";
	
	
	String text = "";
	while(literalsIter.hasNext()){
		Element literal = (Element)literalsIter.next();			

		String eachLiteral = literal.getChildText("name");			
		
		//Final format
		text = (text + "<font size='3' face='Arial'>" + eachLiteral + "</font>");
		
		if (literalsIter.hasNext()){
			text = text+"<br>";
		}
		
	}
	literals = "<html>"+text+"</html>";
	
	
	Element graphics 		= reference.getChild("graphics");
	Element dataGraphics 	= data.getChild("graphics");
	ImageIcon icon = new ImageIcon(ItSIMPLE.getIconsPathElement().getText() + dataGraphics.getChildText("icon"));			
	GraphConstants.setIcon(getAttributes(), icon);
	
	int x = Integer.parseInt(graphics.getChild("position").getAttributeValue("x"));
	int y = Integer.parseInt(graphics.getChild("position").getAttributeValue("y"));
	int width = Integer.parseInt(graphics.getChild("size").getAttributeValue("width"));
	int height = Integer.parseInt(graphics.getChild("size").getAttributeValue("height"));
	GraphConstants.setBounds(getAttributes(), new Rectangle2D.Double(x,y,width,height));		

}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:37,代码来源:EnumerationCell.java


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