Java Code Examples for com.sun.hotspot.igv.data.Properties#PropertySelector

The following examples show how to use com.sun.hotspot.igv.data.Properties#PropertySelector . 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: Diagram.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public Figure getRootFigure() {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(figures);
    Figure root = selector.selectSingle("name", "Root");
    if (root == null) {
        root = selector.selectSingle("name", "Start");
    }
    if (root == null) {
        List<Figure> rootFigures = getRootFigures();
        if (rootFigures.size() > 0) {
            root = rootFigures.get(0);
        } else if (figures.size() > 0) {
            root = figures.get(0);
        }
    }

    return root;
}
 
Example 2
Source File: Diagram.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public Figure getRootFigure() {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(figures);
    Figure root = selector.selectSingle("name", "Root");
    if (root == null) {
        root = selector.selectSingle("name", "Start");
    }
    if (root == null) {
        List<Figure> rootFigures = getRootFigures();
        if (rootFigures.size() > 0) {
            root = rootFigures.get(0);
        } else if (figures.size() > 0) {
            root = figures.get(0);
        }
    }

    return root;
}
 
Example 3
Source File: Diagram.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public Figure getRootFigure() {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(figures);
    Figure root = selector.selectSingle("name", "Root");
    if (root == null) {
        root = selector.selectSingle("name", "Start");
    }
    if (root == null) {
        List<Figure> rootFigures = getRootFigures();
        if (rootFigures.size() > 0) {
            root = rootFigures.get(0);
        } else if (figures.size() > 0) {
            root = figures.get(0);
        }
    }

    return root;
}
 
Example 4
Source File: BytecodeNode.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example 5
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 6
Source File: BytecodeNode.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example 7
Source File: BytecodeNode.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example 8
Source File: Diagram.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public Figure getRootFigure() {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(figures);
    Figure root = selector.selectSingle("name", "Root");
    if (root == null) {
        root = selector.selectSingle("name", "Start");
    }
    if (root == null) {
        List<Figure> rootFigures = getRootFigures();
        if (rootFigures.size() > 0) {
            root = rootFigures.get(0);
        } else if (figures.size() > 0) {
            root = figures.get(0);
        }
    }

    return root;
}
 
Example 9
Source File: ConnectionFilter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void apply(Diagram diagram) {

    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<>(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 10
Source File: BytecodeNode.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        this.setDisplayName(bytecode.getBci() + " " + bytecode.getName());

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<InputNode>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new HashSet<InputNode>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            this.setDisplayName(this.getDisplayName() + " (" + nodes.size() + " nodes)");
        }
    }
 
Example 11
Source File: BytecodeNode.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public BytecodeNode(InputBytecode bytecode, InputGraph graph, String bciValue) {

        super(Children.LEAF);
        String displayName = bytecode.getBci() + " " + bytecode.getName() + " " + bytecode.getOperands();

        bciValue = bytecode.getBci() + " " + bciValue;
        bciValue = bciValue.trim();

        Properties.PropertySelector<InputNode> selector = new Properties.PropertySelector<>(graph.getNodes());
        StringPropertyMatcher matcher = new StringPropertyMatcher("bci", bciValue);
        List<InputNode> nodeList = selector.selectMultiple(matcher);
        if (nodeList.size() > 0) {
            nodes = new LinkedHashSet<>();
            for (InputNode n : nodeList) {
                nodes.add(n);
            }
            displayName += " (" + nodes.size() + " nodes)";
        }

        if (bytecode.getComment() != null) {
            displayName += " // " + bytecode.getComment();
        }

        this.setDisplayName(displayName);
    }
 
Example 12
Source File: Diagram.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public Figure getRootFigure() {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<>(figures);
    Figure root = selector.selectSingle(new StringPropertyMatcher("name", "Root"));
    if (root == null) {
        root = selector.selectSingle(new StringPropertyMatcher("name", "Start"));
    }
    if (root == null) {
        List<Figure> rootFigures = getRootFigures();
        if (rootFigures.size() > 0) {
            root = rootFigures.get(0);
        } else if (figures.size() > 0) {
            root = figures.get(0);
        }
    }

    return root;
}
 
Example 13
Source File: EditorTopComponent.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setSelection(PropertyMatcher matcher) {

        Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(scene.getModel().getDiagramToView().getFigures());
        List<Figure> list = selector.selectMultiple(matcher);
        boolean b = scene.getUndoRedoEnabled();
        scene.setUndoRedoEnabled(false);
        scene.gotoFigures(list);
        scene.setUndoRedoEnabled(b);
        scene.setSelection(list);
    }
 
Example 14
Source File: EditorTopComponent.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void setSelection(PropertyMatcher matcher) {

        Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(scene.getModel().getDiagramToView().getFigures());
        List<Figure> list = selector.selectMultiple(matcher);
        boolean b = scene.getUndoRedoEnabled();
        scene.setUndoRedoEnabled(false);
        scene.gotoFigures(list);
        scene.setUndoRedoEnabled(b);
        scene.setSelection(list);
    }
 
Example 15
Source File: EditorTopComponent.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void setSelection(PropertyMatcher matcher) {

        Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(scene.getModel().getDiagramToView().getFigures());
        List<Figure> list = selector.selectMultiple(matcher);
        boolean b = scene.getUndoRedoEnabled();
        scene.setUndoRedoEnabled(false);
        scene.gotoFigures(list);
        scene.setUndoRedoEnabled(b);
        scene.setSelection(list);
    }
 
Example 16
Source File: MatcherSelector.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public List<Figure> selected(Diagram d) {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(d.getFigures());
    List<Figure> list = selector.selectMultiple(matcher);
    return list;
}
 
Example 17
Source File: MatcherSelector.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public List<Figure> selected(Diagram d) {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(d.getFigures());
    List<Figure> list = selector.selectMultiple(matcher);
    return list;
}
 
Example 18
Source File: MatcherSelector.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public List<Figure> selected(Diagram d) {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(d.getFigures());
    List<Figure> list = selector.selectMultiple(matcher);
    return list;
}
 
Example 19
Source File: MatcherSelector.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public List<Figure> selected(Diagram d) {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<>(d.getFigures());
    List<Figure> list = selector.selectMultiple(matcher);
    return list;
}
 
Example 20
Source File: MatcherSelector.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public List<Figure> selected(Diagram d) {
    Properties.PropertySelector<Figure> selector = new Properties.PropertySelector<Figure>(d.getFigures());
    List<Figure> list = selector.selectMultiple(matcher);
    return list;
}