本文整理汇总了Java中org.pathvisio.core.model.GroupStyle类的典型用法代码示例。如果您正苦于以下问题:Java GroupStyle类的具体用法?Java GroupStyle怎么用?Java GroupStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GroupStyle类属于org.pathvisio.core.model包,在下文中一共展示了GroupStyle类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ComplexAction
import org.pathvisio.core.model.GroupStyle; //导入依赖的package包/类
public ComplexAction() {
super(
"Create complex", "Break complex",
"Create a complex from selected elements",
"Break selected complex",
GroupStyle.COMPLEX,
KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P,
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())
);
}
示例2: GroupAction
import org.pathvisio.core.model.GroupStyle; //导入依赖的package包/类
public GroupAction() {
super(
"Group", "Ungroup",
"Group selected elements",
"Ungroup selected group",
GroupStyle.GROUP,
KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G,
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())
);
}
示例3: GroupActionBase
import org.pathvisio.core.model.GroupStyle; //导入依赖的package包/类
public GroupActionBase(String groupLbl, String ungroupLbl,
String groupTt, String ungroupTt,
GroupStyle style, KeyStroke keyStroke) {
super();
this.groupStyle = style;
this.groupLbl = groupLbl;
this.ungroupLbl = ungroupLbl;
this.groupTt = groupTt;
this.ungroupTt = ungroupTt;
vPathway.addSelectionListener(this);
putValue(NAME, groupLbl);
putValue(SHORT_DESCRIPTION, groupTt);
putValue(ACCELERATOR_KEY, keyStroke);
setLabel();
}
示例4: drawGroup
import org.pathvisio.core.model.GroupStyle; //导入依赖的package包/类
public void drawGroup(Graphics2D g, Group group, int flags) {
boolean mouseover = (flags & Group.FLAG_MOUSEOVER) != 0;
boolean anchors = (flags & Group.FLAG_ANCHORSVISIBLE) != 0;
boolean selected = (flags & Group.FLAG_SELECTED) != 0;
// Draw group outline
int sw = 1;
Rectangle2D vRect = group.getVBounds();
float vTop = (float)vRect.getMinY();
float vLeft = (float)vRect.getMinX();
float vBottom = (float)vRect.getMaxY() - sw;
float vRight = (float)vRect.getMaxX() - sw;
float vMargin = (float)Math.min (
Math.min(vRect.getWidth() / 2.5, vRect.getHeight() / 2.5),
group.vFromM (GroupStyle.COMPLEX_M_MARGIN * 1.5));
GeneralPath outline = new GeneralPath();
outline.moveTo(vLeft + vMargin, vTop);
outline.lineTo(vRight - vMargin, vTop);
outline.lineTo(vRight, vTop + vMargin);
outline.lineTo(vRight, vBottom - vMargin);
outline.lineTo(vRight - vMargin, vBottom);
outline.lineTo(vLeft + vMargin, vBottom);
outline.lineTo(vLeft, vBottom - vMargin);
outline.lineTo(vLeft, vTop + vMargin);
outline.closePath();
//fill
g.setColor(new Color(180, 180, 100, TRANSLUCENCY_LEVEL));
g.fill(outline);
//border
g.setColor(Color.GRAY);
g.setStroke(new BasicStroke());
g.draw(outline);
//Group highlight, on mouseover, linkanchors display and selection
if(mouseover || anchors || selected) {
//fill
g.setColor(new Color(255, 0, 0, (int)(255 * .05)));
g.fill(outline);
//border
g.setColor(Color.GRAY);
g.setStroke(new BasicStroke());
g.draw(outline);
}
}
示例5: drawComplexMembers
import org.pathvisio.core.model.GroupStyle; //导入依赖的package包/类
private void drawComplexMembers(ArrayList<String> complexComponentIDString,
String parentComplexId, boolean isComplex) {
GKInstance inst;
try {
// Creating Group Element for grouping complex components
parentComplex = PathwayElement
.createPathwayElement(ObjectType.GROUP);
gpmlpathway.add(parentComplex);
parentComplex.setGeneratedGraphId();
parentComplex.setGroupId(gpmlpathway.getUniqueGroupId());
if (isComplex) {
parentComplex.setGroupStyle(GroupStyle.COMPLEX);
} else {
parentComplex.setGroupStyle(GroupStyle.NONE);
}
for (int count = 0; count < complexComponentIDString.size(); count++) {
String identifier = complexComponentIDString.get(count);
// System.out.println(identifier);
inst = dbAdaptor.fetchInstance(Long.parseLong(identifier));
pwyelement = PathwayElement
.createPathwayElement(ObjectType.DATANODE);
String nodeType = parseIdentifier(inst.getExtendedDisplayName())[0];
// System.out.println("members : " + nodeType);
if (nodeType.equalsIgnoreCase("EntityWithAccessionedSequence")) {
pwyelement.setDataNodeType(DataNodeType.PROTEIN);
} else if (nodeType.equalsIgnoreCase("SimpleEntity")) {
pwyelement.setDataNodeType(DataNodeType.METABOLITE);
pwyelement.setColor(Color.BLUE);
}
parentComplex.setDynamicProperty(COMPLEX_ID, parentComplexId);
gpmlpathway.add(pwyelement);
pwyelement.setGeneratedGraphId();
pwyelement
.setTextLabel(parseLocation(inst.getDisplayName())[0]);
pwyelement.setGroupRef(parentComplex.getGroupId());
/*
* Adding Dynamic properties COMPLEX_ID : for connecting complex
* and components COPIES_NUM : for counting copies of a complex
* component LOCATION : for cellular location
*/
pwyelement.setDynamicProperty(COMPLEX_ID,
parentComplex.getDynamicProperty(COMPLEX_ID));
pwyelement.setDynamicProperty(COPIES_NUM,
String.valueOf(complexComponentIDMap.get(identifier)));
pwyelement.setDynamicProperty(LOCATION,
(parseLocation(inst.getDisplayName())[1]));
addXref(pwyelement, Long.parseLong(identifier), inst);
addComments(inst, pwyelement, false, false);
addLitRef(inst, pwyelement);
pwyEleList.add(pwyelement);
}
} catch (Exception e) {
e.printStackTrace();
}
}