本文整理汇总了Java中com.sun.hotspot.igv.data.Properties.get方法的典型用法代码示例。如果您正苦于以下问题:Java Properties.get方法的具体用法?Java Properties.get怎么用?Java Properties.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.hotspot.igv.data.Properties
的用法示例。
在下文中一共展示了Properties.get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import com.sun.hotspot.igv.data.Properties; //导入方法依赖的package包/类
@Override
public void apply(Diagram d) {
List<Figure> figures = d.getFigures();
for (Figure f : figures) {
Properties p = f.getProperties();
int predCount;
String predCountString = p.get("predecessorCount");
if (predCountString != null) {
predCount = Integer.parseInt(predCountString);
} else if (Boolean.parseBoolean(p.get("hasPredecessor"))) {
predCount = 1;
} else {
predCount = 0;
}
for (InputSlot is : f.getInputSlots()) {
Color color;
ConnectionStyle style = ConnectionStyle.NORMAL;
if (is.getPosition() < predCount) {
color = successorColor;
style = ConnectionStyle.BOLD;
} else {
color = usageColor;
}
is.setColor(color);
for (Connection c : is.getConnections()) {
if (c.getLabel() == null || !c.getLabel().endsWith("#NDF")) {
c.setColor(color);
if (c.getStyle() != ConnectionStyle.DASHED) {
c.setStyle(style);
}
} else if ("EndNode".equals(c.getOutputSlot().getFigure().getProperties().get("class"))
|| "EndNode".equals(c.getOutputSlot().getProperties().get("class"))) {
c.setColor(successorColor);
c.setStyle(ConnectionStyle.BOLD);
}
}
}
}
}
示例2: resolveString
import com.sun.hotspot.igv.data.Properties; //导入方法依赖的package包/类
public static final String resolveString(String string, Properties properties) {
StringBuilder sb = new StringBuilder();
boolean inBrackets = false;
StringBuilder curIdent = new StringBuilder();
for (int i = 0; i < string.length(); i++) {
char c = string.charAt(i);
if (inBrackets) {
if (c == ']') {
String value = properties.get(curIdent.toString());
if (value == null) {
value = "";
}
sb.append(value);
inBrackets = false;
} else {
curIdent.append(c);
}
} else {
if (c == '[') {
inBrackets = true;
curIdent = new StringBuilder();
} else {
sb.append(c);
}
}
}
return sb.toString();
}
示例3: apply
import com.sun.hotspot.igv.data.Properties; //导入方法依赖的package包/类
@Override
public void apply(Diagram d) {
List<Figure> figures = d.getFigures();
for (Figure f : figures) {
Properties p = f.getProperties();
int predCount;
if (p.get("predecessorCount") != null) {
predCount = Integer.parseInt(p.get("predecessorCount"));
} else {
predCount = 0;
}
for (InputSlot is : f.getInputSlots()) {
Color color;
ConnectionStyle style = ConnectionStyle.NORMAL;
if (is.getPosition() < predCount) {
color = successorColor;
style = ConnectionStyle.BOLD;
} else {
color = usageColor;
}
is.setColor(color);
for (Connection c : is.getConnections()) {
if (c.getLabel() == null || !c.getLabel().endsWith("#NDF")) {
c.setColor(color);
if (c.getStyle() != ConnectionStyle.DASHED) {
c.setStyle(style);
}
} else if ("EndNode".equals(c.getOutputSlot().getFigure().getProperties().get("class"))
|| "EndNode".equals(c.getOutputSlot().getProperties().get("class"))) {
c.setColor(successorColor);
c.setStyle(ConnectionStyle.BOLD);
}
}
}
}
}
示例4: parseBlocks
import com.sun.hotspot.igv.data.Properties; //导入方法依赖的package包/类
private void parseBlocks(InputGraph graph) throws IOException {
int blockCount = readInt();
List<Edge> edges = new LinkedList<>();
for (int i = 0; i < blockCount; i++) {
int id = readInt();
String name = id >= 0 ? Integer.toString(id) : NO_BLOCK;
InputBlock block = graph.addBlock(name);
int nodeCount = readInt();
for (int j = 0; j < nodeCount; j++) {
int nodeId = readInt();
if (nodeId < 0) {
continue;
}
final Properties properties = graph.getNode(nodeId).getProperties();
final String oldBlock = properties.get("block");
if(oldBlock != null) {
properties.setProperty("block", oldBlock + ", " + name);
} else {
block.addNode(nodeId);
properties.setProperty("block", name);
}
}
int edgeCount = readInt();
for (int j = 0; j < edgeCount; j++) {
int to = readInt();
edges.add(new Edge(id, to));
}
}
for (Edge e : edges) {
String fromName = e.from >= 0 ? Integer.toString(e.from) : NO_BLOCK;
String toName = e.to >= 0 ? Integer.toString(e.to) : NO_BLOCK;
graph.addBlockEdge(graph.getBlock(fromName), graph.getBlock(toName));
}
}