本文整理汇总了Java中org.pathvisio.core.model.PathwayElement.getGroupRef方法的典型用法代码示例。如果您正苦于以下问题:Java PathwayElement.getGroupRef方法的具体用法?Java PathwayElement.getGroupRef怎么用?Java PathwayElement.getGroupRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pathvisio.core.model.PathwayElement
的用法示例。
在下文中一共展示了PathwayElement.getGroupRef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getIdRefPairs
import org.pathvisio.core.model.PathwayElement; //导入方法依赖的package包/类
/**
* Generates current id-ref pairs from all current groups
*
* @return HashMap<String, String>
*/
protected Map<String, String> getIdRefPairs()
{
// idRefPairs<id, ref>
Map<String, String> idRefPairs = new HashMap<String, String>();
// Populate hash map of id-ref pairs for all groups
for (VPathwayElement vpe : canvas.getDrawingObjects())
{
if (vpe instanceof Graphics && vpe instanceof Group)
{
PathwayElement pe = ((Graphics) vpe).getPathwayElement();
if (pe.getGroupRef() != null)
{
idRefPairs.put(pe.getGroupId(), pe.getGroupRef());
}
}
}
return idRefPairs;
}
示例2: getGroupGraphics
import org.pathvisio.core.model.PathwayElement; //导入方法依赖的package包/类
/**
* Returns graphics for members of a group, including nested members
*
* @return ArrayList<Graphics>
*/
public List<Graphics> getGroupGraphics()
{
List<Graphics> gg = new ArrayList<Graphics>();
// return true if group object is referenced by selection
for (VPathwayElement vpe : canvas.getDrawingObjects())
{
if (vpe instanceof Graphics && vpe != this)
{
Graphics vpeg = (Graphics) vpe;
PathwayElement pe = vpeg.getPathwayElement();
String ref = pe.getGroupRef();
if (ref != null && ref.equals(getPathwayElement().getGroupId()))
{
gg.add(vpeg);
}
}
}
return gg;
}
示例3: linkPointToObject
import org.pathvisio.core.model.PathwayElement; //导入方法依赖的package包/类
/**
* @arg p2d point where mouse is at
*/
private void linkPointToObject(Point2D p2d, Handle g)
{
if (dragUndoState == DRAG_UNDO_CHANGE_START)
{
dragUndoState = DRAG_UNDO_CHANGED;
}
hideLinkAnchors();
VPoint p = (VPoint) g.getAdjustable();
Line l = p.getLine();
PathwayElement pe = l.getPathwayElement();
List<LinkProvider> objects = getLinkProvidersAt(p2d);
//Fix for preventing grouped line to link to its own group
//Remove the group from the list of linkproviders
//Also remove the line anchors to prevent linking a line
//to it's own anchors
if(g.getAdjustable() instanceof VPoint) {
if(pe.getGroupRef() != null) {
PathwayElement group = getPathwayModel().getGroupById(pe.getGroupRef());
objects.remove(getPathwayElementView(group));
}
for(VAnchor va : l.getVAnchors()) {
objects.remove(va);
}
}
GraphIdContainer idc = null;
for (LinkProvider lp : objects)
{
if (lp instanceof VAnchor && ((VAnchor)lp).getMAnchor().getShape().isDisallowLinks()) {
break;
}
lp.showLinkAnchors();
LinkAnchor la = lp.getLinkAnchorAt(p2d);
if(la != null) {
//Set graphRef
la.link(p.getMPoint());
idc = la.getGraphIdContainer();
if(currentLinkAnchor != null) {
currentLinkAnchor.unhighlight();
}
la.highlight();
currentLinkAnchor = la;
break;
}
}
if(idc == null && p.getMPoint().isLinked()) {
String graphRef = p.getMPoint().getGraphRef();
p.getMPoint().unlink();
if(currentLinkAnchor != null) {
if (pe instanceof MLine && isAnotherLineLinked(graphRef, (MLine)pe)) {
} else if (currentLinkAnchor.getGraphIdContainer() instanceof MAnchor &&
currentLinkAnchor.getGraphIdContainer().getGraphId().equals(graphRef)) {
currentLinkAnchor.getGraphIdContainer().setGraphId(null);
}
currentLinkAnchor.unhighlight();
}
}
}
示例4: replaceIdsAndRefs
import org.pathvisio.core.model.PathwayElement; //导入方法依赖的package包/类
/**
* Updates all id's and references of a single PathwayElement, using
* the provided idMap.
*
* This will
* - replace groupId of elements
* - replace graphId of elements, anchors and points
* - replace graphRefs if it's in the map, otherwise set to null
* - replace groupRegs if it's in the map, otherwise set to null
*/
private void replaceIdsAndRefs(PathwayElement p, Map<String, String> idmap)
{
// set new unique id
if (p.getGraphId() != null)
{
p.setGraphId(idmap.get(p.getGraphId()));
}
for(MPoint mp : p.getMPoints()) {
mp.setGraphId(idmap.get(mp.getGraphId()));
}
for(MAnchor ma : p.getMAnchors()) {
ma.setGraphId(idmap.get(ma.getGraphId()));
}
// set new group id
String gid = p.getGroupId();
if (gid != null)
{
p.setGroupId(idmap.get(gid));
}
// update graphref
String y = p.getStartGraphRef();
if (y != null)
{
if (idmap.containsKey(y))
{
p.setStartGraphRef(idmap.get(y));
} else
{
p.setStartGraphRef(null);
}
}
y = p.getEndGraphRef();
if (y != null)
{
if (idmap.containsKey(y))
{
p.setEndGraphRef(idmap.get(y));
} else
{
p.setEndGraphRef(null);
}
}
y = p.getGraphRef();
if (y != null)
{
if (idmap.containsKey(y))
{
p.setGraphRef(idmap.get(y));
}
// If the ref points to an item outside the selection, keep using original!
}
// update groupref
String groupRef = p.getGroupRef();
if (groupRef != null)
{
if (idmap.containsKey(groupRef))
{
p.setGroupRef(idmap.get(groupRef));
} else
{
p.setGroupRef(null);
}
}
}