com.sun.hotspot.igv.graph.Diagram Java Examples

The following examples show how to use com.sun.hotspot.igv.graph.Diagram. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SplitFilter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #2
Source File: SplitFilter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #3
Source File: ConnectionFilter.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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());
                        }
                    }
                }
            }
        }
    }
 
Example #4
Source File: ConnectionFilter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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());
                        }
                    }
                }
            }
        }
    }
 
Example #5
Source File: SplitFilter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #6
Source File: SplitFilter.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #7
Source File: ConnectionFilter.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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());
                        }
                    }
                }
            }
        }
    }
 
Example #8
Source File: ConnectionFilter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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());
                        }
                    }
                }
            }
        }
    }
 
Example #9
Source File: RemoveFilter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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);
    }
}
 
Example #10
Source File: GraphViewerImplementation.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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();
}
 
Example #11
Source File: DiagramViewModel.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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;
    }
 
Example #12
Source File: GraalEdgeColorFilter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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);
                    }
                }
            }
        }
    }
}
 
Example #13
Source File: ConnectionFilter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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());
                        }
                    }
                }
            }
        }
    }
 
Example #14
Source File: SplitFilter.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #15
Source File: SplitFilter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #16
Source File: ConnectionFilter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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());
                        }
                    }
                }
            }
        }
    }
 
Example #17
Source File: SplitFilter.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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);
    }
}
 
Example #18
Source File: ConnectionFilter.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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());
                        }
                    }
                }
            }
        }
    }
 
Example #19
Source File: JavaSE6ScriptEngine.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example #20
Source File: JavaSE6ScriptEngine.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example #21
Source File: JavaSE6ScriptEngine.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example #22
Source File: DiagramViewModel.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
 
Example #23
Source File: CustomFilter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@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);
    }
}
 
Example #24
Source File: DiagramViewModel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
 
Example #25
Source File: BlockWidget.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #26
Source File: JavaSE6ScriptEngine.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example #27
Source File: BlockWidget.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #28
Source File: DiagramViewModel.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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;
    }
 
Example #29
Source File: BlockWidget.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #30
Source File: BlockWidget.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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);
}