本文整理匯總了Java中org.pathvisio.core.view.VPathwayElement.getVBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java VPathwayElement.getVBounds方法的具體用法?Java VPathwayElement.getVBounds怎麽用?Java VPathwayElement.getVBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pathvisio.core.view.VPathwayElement
的用法示例。
在下文中一共展示了VPathwayElement.getVBounds方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
}
示例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);
}
}
示例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;
}