本文整理汇总了Java中com.sun.hotspot.igv.graph.Diagram类的典型用法代码示例。如果您正苦于以下问题:Java Diagram类的具体用法?Java Diagram怎么用?Java Diagram使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Diagram类属于com.sun.hotspot.igv.graph包,在下文中一共展示了Diagram类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: apply
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
@Override
public void apply(Diagram diagram) {
for (RemoveRule r : rules) {
List<Figure> selected = r.getSelector().selected(diagram);
Set<Figure> toRemove = new HashSet<>(selected);
if (r.getRemoveOrphans()) {
boolean changed;
do {
changed = false;
for (Figure f : diagram.getFigures()) {
if (!toRemove.contains(f)) {
if (toRemove.containsAll(f.getPredecessors()) && toRemove.containsAll(f.getSuccessors())) {
toRemove.add(f);
changed = true;
}
}
}
} while (changed);
}
diagram.removeAllFigures(toRemove);
}
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:25,代码来源:RemoveFilter.java
示例2: view
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
@Override
public void view(InputGraph graph, boolean clone) {
if (!clone) {
WindowManager manager = WindowManager.getDefault();
for (Mode m : manager.getModes()) {
for (TopComponent t : manager.getOpenedTopComponents(m)) {
if (t instanceof EditorTopComponent) {
EditorTopComponent etc = (EditorTopComponent) t;
if (etc.getModel().getGroup().getGraphs().contains(graph)) {
etc.getModel().selectGraph(graph);
t.requestActive();
return;
}
}
}
}
}
Diagram diagram = Diagram.createDiagram(graph, Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT));
EditorTopComponent tc = new EditorTopComponent(diagram);
tc.open();
tc.requestActive();
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:25,代码来源:GraphViewerImplementation.java
示例3: getDiagramToView
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
public Diagram getDiagramToView() {
if (diagram == null) {
diagram = Diagram.createDiagram(getGraphToView(), Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT));
getFilterChain().apply(diagram, getSequenceFilterChain());
if (getFirstPosition() != getSecondPosition()) {
CustomFilter f = new CustomFilter(
"difference", "colorize('state', 'same', white);"
+ "colorize('state', 'changed', orange);"
+ "colorize('state', 'new', green);"
+ "colorize('state', 'deleted', red);");
f.apply(diagram);
}
}
return diagram;
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:18,代码来源:DiagramViewModel.java
示例4: getDiagramToView
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
public Diagram getDiagramToView() {
if (diagram == null) {
diagram = Diagram.createDiagram(getGraphToView(), Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT));
getFilterChain().apply(diagram, getSequenceFilterChain());
if (getFirstGraph() != getSecondGraph()) {
CustomFilter f = new CustomFilter(
"difference", "colorize('state', 'same', white);"
+ "colorize('state', 'changed', orange);"
+ "colorize('state', 'new', green);"
+ "colorize('state', 'deleted', red);");
f.apply(diagram);
}
}
return diagram;
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:18,代码来源:DiagramViewModel.java
示例5: view
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
@Override
public void view(InputGraph graph, boolean clone) {
if (!clone) {
WindowManager manager = WindowManager.getDefault();
for (Mode m : manager.getModes()) {
for (TopComponent t : manager.getOpenedTopComponents(m)) {
if (t instanceof EditorTopComponent) {
EditorTopComponent etc = (EditorTopComponent) t;
if (etc.getModel().getGroup().getGraphs().contains(graph)) {
etc.getModel().selectGraph(graph);
t.requestActive();
return;
}
}
}
}
}
Diagram diagram = Diagram.createDiagram(graph, Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT));
EditorTopComponent tc = new EditorTopComponent(diagram);
tc.open();
tc.requestActive();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:GraphViewerImplementation.java
示例6: apply
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
@Override
public void apply(Diagram d) {
List<Figure> figures = d.getFigures();
for (Figure f : figures) {
for (InputSlot is : f.getInputSlots()) {
for (Connection c : is.getConnections()) {
String type = c.getType();
if (type == "Association" && "EndNode".equals(c.getOutputSlot().getFigure().getProperties().get("class"))) {
type = "Successor";
}
if (type != null) {
Color typeColor = usageColor.get(type);
if (typeColor == null) {
c.setColor(otherUsageColor);
} else {
c.setColor(typeColor);
}
if (c.getStyle() != ConnectionStyle.DASHED && type == "Successor") {
c.setStyle(ConnectionStyle.BOLD);
}
}
}
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:GraalEdgeColorFilter.java
示例7: apply
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
public void apply(Diagram diagram) {
Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(diagram.getFigures());
for (ConnectionStyleRule rule : connectionStyleRules) {
List<Figure> figures = null;
if (rule.getSelector() != null) {
figures = rule.getSelector().selected(diagram);
} else {
figures = diagram.getFigures();
}
for (Figure f : figures) {
for (OutputSlot os : f.getOutputSlots()) {
for (Connection c : os.getConnections()) {
if (figures.contains(c.getInputSlot().getFigure())) {
c.setStyle(rule.getLineStyle());
c.setColor(rule.getLineColor());
}
}
}
}
}
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:24,代码来源:ConnectionFilter.java
示例8: apply
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
public void apply(Diagram d) {
List<Figure> list = selector.selected(d);
for (Figure f : list) {
for (OutputSlot os : f.getOutputSlots()) {
for (Connection c : os.getConnections()) {
InputSlot is = c.getInputSlot();
is.setName(f.getProperties().get("dump_spec"));
String s = f.getProperties().get("short_name");
if (s != null) {
is.setShortName(s);
}
}
}
d.removeFigure(f);
}
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:19,代码来源:SplitFilter.java
示例9: apply
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
@Override
public void apply(Diagram d) {
try {
ScriptEngineManager sem = new ScriptEngineManager();
ScriptEngine e = sem.getEngineByName("ECMAScript");
e.eval(getJsHelperText());
Bindings b = e.getContext().getBindings(ScriptContext.ENGINE_SCOPE);
b.put("graph", d);
b.put("IO", System.out);
e.eval(code, b);
} catch (ScriptException ex) {
Exceptions.printStackTrace(ex);
}
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:15,代码来源:CustomFilter.java
示例10: apply
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的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);
}
}
}
}
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:41,代码来源:GraalEdgeColorFilter.java
示例11: apply
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的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);
}
}
}
}
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:38,代码来源:GraalEdgeColorFilter.java
示例12: BlockWidget
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
public BlockWidget(Scene scene, Diagram d, InputBlock blockNode) {
super(scene);
this.blockNode = blockNode;
this.diagram = d;
this.setBackground(BACKGROUND_COLOR);
this.setOpaque(true);
this.setCheckClipping(true);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:BlockWidget.java
示例13: execute
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
public void execute(Diagram d, String code) {
try {
Bindings b = bindings;
b.put("graph", d);
engine.eval(code, b);
} catch (ScriptException ex) {
Exceptions.printStackTrace(ex);
}
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:10,代码来源:JavaSE6ScriptEngine.java
示例14: getDiagramToView
import com.sun.hotspot.igv.graph.Diagram; //导入依赖的package包/类
public Diagram getDiagramToView() {
if (diagram == null) {
diagram = Diagram.createDiagram(getGraphToView(), Settings.get().get(Settings.NODE_TEXT, Settings.NODE_TEXT_DEFAULT));
getFilterChain().apply(diagram, getSequenceFilterChain());
}
return diagram;
}
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:10,代码来源:DiagramViewModel.java
注:本文中的com.sun.hotspot.igv.graph.Diagram类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论