當前位置: 首頁>>代碼示例>>Java>>正文


Java VPathwayElement.highlight方法代碼示例

本文整理匯總了Java中org.pathvisio.core.view.VPathwayElement.highlight方法的典型用法代碼示例。如果您正苦於以下問題:Java VPathwayElement.highlight方法的具體用法?Java VPathwayElement.highlight怎麽用?Java VPathwayElement.highlight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.pathvisio.core.view.VPathwayElement的用法示例。


在下文中一共展示了VPathwayElement.highlight方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: insert

import org.pathvisio.core.view.VPathwayElement; //導入方法依賴的package包/類
public void insert(PathwayElement newElt)
{
	VPathwayElement velt = findElt (newElt, vpwy[PWY_NEW]);
		//assert (velt != null || newElt.getObjectType () == ObjectType.INFOBOX);
	if (velt == null)
	{
		Logger.log.warn (Utils.summary(newElt) + " doesn't have a corresponding view element");
	}
	else
	{
		velt.highlight (Color.GREEN);

		Map <String, String> hint = new HashMap<String, String>();
		hint.put ("element", "Element added");

		Rectangle2D r = velt.getVBounds();
		ModData mod = new ModData (
				0,
				0,
				(int)vpwy[PWY_NEW].mFromV(r.getX() + r.getWidth() / 2),
				(int)vpwy[PWY_NEW].mFromV(r.getY() + r.getHeight() / 2),
					hint, ModData.ModType.ADDED);
			modifications.add (mod);
			modsByElt.put (velt, mod);
	}
}
 
開發者ID:PathVisio,項目名稱:pathvisio,代碼行數:27,代碼來源:PanelOutputter.java

示例2: delete

import org.pathvisio.core.view.VPathwayElement; //導入方法依賴的package包/類
public void delete(PathwayElement oldElt)
{
	VPathwayElement velt = findElt (oldElt, vpwy[PWY_OLD]);
		//assert (velt != null || oldElt.getObjectType () == ObjectType.INFOBOX);
	if (velt == null)
	{
		Logger.log.warn (Utils.summary(oldElt) + " doesn't have a corresponding view element");
	}
	else
	{
		velt.highlight (Color.RED);

		Map <String, String> hint = new HashMap<String, String>();
		hint.put ("element", "Element removed");

		Rectangle2D r = velt.getVBounds();
		ModData mod = new ModData (
				(int)vpwy[PWY_NEW].mFromV(r.getX() + r.getWidth() / 2),
				(int)vpwy[PWY_NEW].mFromV(r.getY() + r.getHeight() / 2),
				0,
				0,
				hint, ModData.ModType.REMOVED);
		modifications.add (mod);
		modsByElt.put (velt, mod);
	}
}
 
開發者ID:PathVisio,項目名稱:pathvisio,代碼行數:27,代碼來源:PanelOutputter.java

示例3: modifyEnd

import org.pathvisio.core.view.VPathwayElement; //導入方法依賴的package包/類
public void modifyEnd ()
{
	VPathwayElement veltOld = findElt (curOldElt, vpwy[PWY_OLD]);
	assert (veltOld != null);
	veltOld.highlight (Color.YELLOW);
	Rectangle2D r1 = veltOld.getVBounds();

	VPathwayElement veltNew = findElt (curNewElt, vpwy[PWY_NEW]);
	assert (veltNew != null);
	veltNew.highlight (Color.YELLOW);
	Rectangle2D r2 = veltNew.getVBounds();

	ModData mod = new ModData (
		(int)vpwy[PWY_OLD].mFromV(r1.getX() + r1.getWidth() / 2),
		(int)vpwy[PWY_OLD].mFromV(r1.getY() + r1.getHeight() / 2),
		(int)vpwy[PWY_NEW].mFromV(r2.getX() + r2.getWidth() / 2),
		(int)vpwy[PWY_NEW].mFromV(r2.getY() + r2.getHeight() / 2),
			curHint, ModData.ModType.CHANGED);

	modifications.add (mod);
	modsByElt.put (veltOld, mod);
	modsByElt.put (veltNew, mod);

	curOldElt = null;
	curNewElt = null;
}
 
開發者ID:PathVisio,項目名稱:pathvisio,代碼行數:27,代碼來源:PanelOutputter.java

示例4: doHighlight

import org.pathvisio.core.view.VPathwayElement; //導入方法依賴的package包/類
/**
 * Highlight all object but DataNodes and Groups. Only the first color
 * from the hashmap will be used.
 */
private void doHighlight() {
	for(VPathwayElement vpe : vPathway.getDrawingObjects()) {
		if(vpe instanceof Graphics) {
			PathwayElement pwe = ((Graphics)vpe).getPathwayElement();
			List<Color> elmColors = colors.get(pwe);
			if(elmColors != null && elmColors.size() > 0) {
				ObjectType ot = pwe.getObjectType();
				if(ot != ObjectType.DATANODE && ot != ObjectType.GROUP) {
					vpe.highlight(elmColors.get(0));
				}
			}
		}
	}
}
 
開發者ID:PathVisio,項目名稱:pathvisio,代碼行數:19,代碼來源:ColorExporter.java


注:本文中的org.pathvisio.core.view.VPathwayElement.highlight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。