8290063: IGV: Give the graphs a unique number in the outline
Reviewed-by: thartmann, chagedorn
This commit is contained in:
parent
b807470af4
commit
a1c349f8b3
@ -29,12 +29,11 @@ import com.sun.hotspot.igv.util.PropertiesSheet;
|
||||
import com.sun.hotspot.igv.util.StringUtils;
|
||||
import java.awt.Image;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.openide.nodes.AbstractNode;
|
||||
import org.openide.nodes.Children;
|
||||
import org.openide.nodes.Node;
|
||||
import org.openide.nodes.Sheet;
|
||||
import javax.swing.Action;
|
||||
import org.openide.actions.PropertiesAction;
|
||||
import org.openide.actions.RenameAction;
|
||||
import org.openide.nodes.*;
|
||||
import org.openide.util.ImageUtilities;
|
||||
import org.openide.util.lookup.AbstractLookup;
|
||||
import org.openide.util.lookup.InstanceContent;
|
||||
@ -49,7 +48,7 @@ public class FolderNode extends AbstractNode {
|
||||
private final FolderChildren children;
|
||||
// NetBeans node corresponding to each opened graph. Used to highlight the
|
||||
// focused graph in the Outline window.
|
||||
private static final Map<InputGraph, GraphNode> graphNode = new HashMap<>();
|
||||
private static final Map<InputGraph, GraphNode> graphNodeMap = new HashMap<>();
|
||||
private boolean selected = false;
|
||||
|
||||
private static class FolderChildren extends Children.Keys<FolderElement> implements ChangedListener {
|
||||
@ -66,14 +65,14 @@ public class FolderNode extends AbstractNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Node[] createNodes(FolderElement e) {
|
||||
if (e instanceof InputGraph) {
|
||||
InputGraph g = (InputGraph) e;
|
||||
GraphNode n = new GraphNode(g);
|
||||
graphNode.put(g, n);
|
||||
return new Node[]{n};
|
||||
} else if (e instanceof Folder) {
|
||||
return new Node[]{new FolderNode((Folder) e)};
|
||||
protected Node[] createNodes(FolderElement folderElement) {
|
||||
if (folderElement instanceof InputGraph) {
|
||||
InputGraph inputGraph = (InputGraph) folderElement;
|
||||
GraphNode graphNode = new GraphNode(inputGraph);
|
||||
graphNodeMap.put(inputGraph, graphNode);
|
||||
return new Node[]{graphNode};
|
||||
} else if (folderElement instanceof Group) {
|
||||
return new Node[]{new FolderNode((Group) folderElement)};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -83,19 +82,23 @@ public class FolderNode extends AbstractNode {
|
||||
protected void destroyNodes(Node[] nodes) {
|
||||
for (Node n : nodes) {
|
||||
// Each node is only present once in the graphNode map.
|
||||
graphNode.values().remove(n);
|
||||
graphNodeMap.values().remove(n);
|
||||
}
|
||||
for (Node node : getNodes()) {
|
||||
node.setDisplayName(node.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addNotify() {
|
||||
this.setKeys(folder.getElements());
|
||||
super.addNotify();
|
||||
setKeys(folder.getElements());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changed(Object source) {
|
||||
addNotify();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -128,7 +131,7 @@ public class FolderNode extends AbstractNode {
|
||||
if (folder instanceof FolderElement) {
|
||||
final FolderElement folderElement = (FolderElement) folder;
|
||||
this.setDisplayName(folderElement.getName());
|
||||
content.add((RemoveCookie) () -> {
|
||||
this.content.add((RemoveCookie) () -> {
|
||||
children.destroyNodes(children.getNodes());
|
||||
folderElement.getParent().removeElement(folderElement);
|
||||
});
|
||||
@ -141,6 +144,28 @@ public class FolderNode extends AbstractNode {
|
||||
fireIconChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRename() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
children.getFolder().setName(name);
|
||||
fireDisplayNameChange(null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return children.getFolder().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return children.getFolder().getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHtmlDisplayName() {
|
||||
String htmlDisplayName = StringUtils.escapeHTML(getDisplayName());
|
||||
if (selected) {
|
||||
@ -149,15 +174,6 @@ public class FolderNode extends AbstractNode {
|
||||
return htmlDisplayName;
|
||||
}
|
||||
|
||||
public void init(String name, List<Group> groups) {
|
||||
this.setDisplayName(name);
|
||||
children.addNotify();
|
||||
|
||||
for (Group g : groups) {
|
||||
content.add(g);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isRootNode() {
|
||||
Folder folder = getFolder();
|
||||
return (folder instanceof GraphDocument);
|
||||
@ -168,12 +184,20 @@ public class FolderNode extends AbstractNode {
|
||||
return getIcon(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Action[] getActions(boolean b) {
|
||||
return new Action[]{
|
||||
RenameAction.findObject(RenameAction.class, true),
|
||||
PropertiesAction.findObject(PropertiesAction.class, true),
|
||||
};
|
||||
}
|
||||
|
||||
public static void clearGraphNodeMap() {
|
||||
graphNode.clear();
|
||||
graphNodeMap.clear();
|
||||
}
|
||||
|
||||
public static GraphNode getGraphNode(InputGraph graph) {
|
||||
return graphNode.get(graph);
|
||||
return graphNodeMap.get(graph);
|
||||
}
|
||||
|
||||
public Folder getFolder() {
|
||||
|
@ -32,6 +32,7 @@ import com.sun.hotspot.igv.util.StringUtils;
|
||||
import java.awt.Image;
|
||||
import javax.swing.Action;
|
||||
import org.openide.actions.OpenAction;
|
||||
import org.openide.actions.RenameAction;
|
||||
import org.openide.nodes.*;
|
||||
import org.openide.util.ImageUtilities;
|
||||
import org.openide.util.Lookup;
|
||||
@ -44,7 +45,7 @@ import org.openide.util.lookup.InstanceContent;
|
||||
*/
|
||||
public class GraphNode extends AbstractNode {
|
||||
|
||||
private InputGraph graph;
|
||||
private final InputGraph graph;
|
||||
private boolean selected = false;
|
||||
|
||||
/** Creates a new instance of GraphNode */
|
||||
@ -52,12 +53,29 @@ public class GraphNode extends AbstractNode {
|
||||
this(graph, new InstanceContent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRename() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
graph.setName(name);
|
||||
fireDisplayNameChange(null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return graph.getName();
|
||||
}
|
||||
|
||||
public void setSelected(boolean selected) {
|
||||
this.selected = selected;
|
||||
fireDisplayNameChange(null, null);
|
||||
fireIconChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHtmlDisplayName() {
|
||||
String htmlDisplayName = StringUtils.escapeHTML(getDisplayName());
|
||||
if (selected) {
|
||||
@ -65,6 +83,12 @@ public class GraphNode extends AbstractNode {
|
||||
}
|
||||
return htmlDisplayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return graph.getDisplayName();
|
||||
}
|
||||
|
||||
private GraphNode(InputGraph graph, InstanceContent content) {
|
||||
super(Children.LEAF, new AbstractLookup(content));
|
||||
this.graph = graph;
|
||||
@ -86,13 +110,6 @@ public class GraphNode extends AbstractNode {
|
||||
|
||||
// Action for cloning to the current graph
|
||||
content.add(new GraphCloneCookie(viewer, graph));
|
||||
|
||||
this.addNodeListener(new NodeAdapter() {
|
||||
@Override
|
||||
public void childrenRemoved(NodeMemberEvent ev) {
|
||||
GraphNode.this.graph = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +139,12 @@ public class GraphNode extends AbstractNode {
|
||||
|
||||
@Override
|
||||
public Action[] getActions(boolean b) {
|
||||
return new Action[]{DiffGraphAction.findObject(DiffGraphAction.class, true), CloneGraphAction.findObject(CloneGraphAction.class, true), OpenAction.findObject(OpenAction.class, true)};
|
||||
return new Action[]{
|
||||
RenameAction.findObject(RenameAction.class, true),
|
||||
DiffGraphAction.findObject(DiffGraphAction.class, true),
|
||||
CloneGraphAction.findObject(CloneGraphAction.class, true),
|
||||
OpenAction.findObject(OpenAction.class, true)
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,9 @@
|
||||
<file name="DS-W.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/File/com-sun-hotspot-igv-coordinator-actions-RemoveAllAction.instance"/>
|
||||
</file>
|
||||
<file name="AD-R.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/System/org-openide-actions-RenameAction.instance"/>
|
||||
</file>
|
||||
</folder>
|
||||
<folder name="Actions">
|
||||
<folder name="File">
|
||||
@ -58,27 +61,35 @@
|
||||
</file>
|
||||
<file name="SeparatorSave.instance">
|
||||
<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
|
||||
<attr name="position" intvalue="150"/>
|
||||
<attr name="position" intvalue="200"/>
|
||||
</file>
|
||||
<file name="org-openide-actions-RenameAction.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/System/org-openide-actions-RenameAction.instance"/>
|
||||
<attr name="position" intvalue="300"/>
|
||||
</file>
|
||||
<file name="SeparatorRename.instance">
|
||||
<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
|
||||
<attr name="position" intvalue="400"/>
|
||||
</file>
|
||||
<file name="com-sun-hotspot-igv-coordinator-actions-SaveAsAction.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/File/com-sun-hotspot-igv-coordinator-actions-SaveAsAction.instance"/>
|
||||
<attr name="position" intvalue="200"/>
|
||||
<attr name="position" intvalue="500"/>
|
||||
</file>
|
||||
<file name="com-sun-hotspot-igv-coordinator-actions-SaveAllAction.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/File/com-sun-hotspot-igv-coordinator-actions-SaveAllAction.instance"/>
|
||||
<attr name="position" intvalue="300"/>
|
||||
<attr name="position" intvalue="600"/>
|
||||
</file>
|
||||
<file name="SeparatorRemove.instance">
|
||||
<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
|
||||
<attr name="position" intvalue="350"/>
|
||||
<attr name="position" intvalue="700"/>
|
||||
</file>
|
||||
<file name="com-sun-hotspot-igv-coordinator-actions-RemoveAction.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/File/com-sun-hotspot-igv-coordinator-actions-RemoveAction.instance"/>
|
||||
<attr name="position" intvalue="400"/>
|
||||
<attr name="position" intvalue="800"/>
|
||||
</file>
|
||||
<file name="com-sun-hotspot-igv-coordinator-actions-RemoveAllAction.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/File/com-sun-hotspot-igv-coordinator-actions-RemoveAllAction.instance"/>
|
||||
<attr name="position" intvalue="500"/>
|
||||
<attr name="position" intvalue="900"/>
|
||||
</file>
|
||||
<!-- Hidden menu entries from other modules -->
|
||||
<file name="org-netbeans-modules-editor-ExportHtmlAction.shadow_hidden"/>
|
||||
|
@ -26,6 +26,9 @@ package com.sun.hotspot.igv.data;
|
||||
import java.util.List;
|
||||
|
||||
public interface Folder {
|
||||
void setName(String name);
|
||||
String getName();
|
||||
String getDisplayName();
|
||||
List<? extends FolderElement> getElements();
|
||||
void removeElement(FolderElement element);
|
||||
void addElement(FolderElement group);
|
||||
|
@ -24,8 +24,10 @@
|
||||
package com.sun.hotspot.igv.data;
|
||||
|
||||
public interface FolderElement {
|
||||
|
||||
Folder getParent();
|
||||
ChangedEvent<? extends FolderElement> getDisplayNameChangedEvent();
|
||||
void setName(String name);
|
||||
String getName();
|
||||
String getDisplayName();
|
||||
void setParent(Folder parent);
|
||||
Folder getParent();
|
||||
}
|
||||
|
@ -34,10 +34,12 @@ public class GraphDocument extends Properties.Entity implements ChangedEventProv
|
||||
|
||||
private final List<FolderElement> elements;
|
||||
private final ChangedEvent<GraphDocument> changedEvent;
|
||||
private String name;
|
||||
|
||||
public GraphDocument() {
|
||||
elements = new ArrayList<>();
|
||||
changedEvent = new ChangedEvent<>(this);
|
||||
setName("GraphDocument");
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
@ -61,10 +63,23 @@ public class GraphDocument extends Properties.Entity implements ChangedEventProv
|
||||
getChangedEvent().fire();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("GraphDocument: ").append(getProperties().toString()).append(" \n\n");
|
||||
for (FolderElement g : getElements()) {
|
||||
sb.append(g.toString());
|
||||
@ -84,6 +99,9 @@ public class GraphDocument extends Properties.Entity implements ChangedEventProv
|
||||
if (elements.remove(element)) {
|
||||
getChangedEvent().fire();
|
||||
}
|
||||
for (FolderElement folderElement : elements) {
|
||||
folderElement.getDisplayNameChangedEvent().fire();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -34,6 +34,8 @@ public class Group extends Properties.Entity implements ChangedEventProvider<Gro
|
||||
private final List<InputGraph> graphs;
|
||||
private InputMethod method;
|
||||
private final transient ChangedEvent<Group> changedEvent;
|
||||
private final ChangedEvent<Group> displayNameChangedEvent = new ChangedEvent<>(this);
|
||||
|
||||
private Folder parent;
|
||||
|
||||
public Group(Folder parent) {
|
||||
@ -72,6 +74,10 @@ public class Group extends Properties.Entity implements ChangedEventProvider<Gro
|
||||
if (graphs.remove((InputGraph) element)) {
|
||||
getChangedEvent().fire();
|
||||
}
|
||||
for (InputGraph inputGraph : graphs) {
|
||||
assert inputGraph.getDisplayNameChangedEvent() != null;
|
||||
inputGraph.getDisplayNameChangedEvent().fire();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -102,14 +108,29 @@ public class Group extends Properties.Entity implements ChangedEventProvider<Gro
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChangedEvent<Group> getDisplayNameChangedEvent() {
|
||||
return displayNameChangedEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
getProperties().setProperty("name", name);
|
||||
displayNameChangedEvent.fire();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return getProperties().get("name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return getParent().getElements().indexOf(this)+1 + " - " + getName();
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return getProperties().get("type");
|
||||
|
||||
}
|
||||
|
||||
InputGraph getPrev(InputGraph graph) {
|
||||
|
@ -38,29 +38,35 @@ public class InputGraph extends Properties.Entity implements FolderElement {
|
||||
private final Map<String, InputBlock> blocks;
|
||||
private final List<InputBlockEdge> blockEdges;
|
||||
private final Map<Integer, InputBlock> nodeToBlock;
|
||||
private boolean isDiffGraph;
|
||||
private InputGraph firstGraph;
|
||||
private InputGraph secondGraph;
|
||||
|
||||
private final boolean isDiffGraph;
|
||||
private final InputGraph firstGraph;
|
||||
private final InputGraph secondGraph;
|
||||
private final ChangedEvent<InputGraph> displayNameChangedEvent = new ChangedEvent<>(this);
|
||||
|
||||
public InputGraph(InputGraph firstGraph, InputGraph secondGraph) {
|
||||
this(firstGraph.getName() + " Δ " + secondGraph.getName());
|
||||
this(firstGraph.getName() + " Δ " + secondGraph.getName(), firstGraph, secondGraph);
|
||||
assert !firstGraph.isDiffGraph() && !secondGraph.isDiffGraph();
|
||||
this.firstGraph = firstGraph;
|
||||
this.secondGraph = secondGraph;
|
||||
isDiffGraph = true;
|
||||
|
||||
}
|
||||
|
||||
public InputGraph(String name) {
|
||||
this(name, null, null);
|
||||
}
|
||||
|
||||
private InputGraph(String name, InputGraph firstGraph, InputGraph secondGraph) {
|
||||
setName(name);
|
||||
nodes = new LinkedHashMap<>();
|
||||
edges = new ArrayList<>();
|
||||
blocks = new LinkedHashMap<>();
|
||||
blockEdges = new ArrayList<>();
|
||||
nodeToBlock = new LinkedHashMap<>();
|
||||
firstGraph = null;
|
||||
secondGraph = null;
|
||||
isDiffGraph = false;
|
||||
isDiffGraph = firstGraph != null && secondGraph != null;
|
||||
this.firstGraph = firstGraph;
|
||||
this.secondGraph = secondGraph;
|
||||
if (isDiffGraph) {
|
||||
this.firstGraph.getDisplayNameChangedEvent().addListener(l -> displayNameChangedEvent.fire());
|
||||
this.secondGraph.getDisplayNameChangedEvent().addListener(l -> displayNameChangedEvent.fire());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isDiffGraph() {
|
||||
@ -81,6 +87,9 @@ public class InputGraph extends Properties.Entity implements FolderElement {
|
||||
if (parent instanceof Group) {
|
||||
assert this.parentGroup == null;
|
||||
this.parentGroup = (Group) parent;
|
||||
assert displayNameChangedEvent != null;
|
||||
assert this.parentGroup.getDisplayNameChangedEvent() != null;
|
||||
this.parentGroup.getDisplayNameChangedEvent().addListener(l -> displayNameChangedEvent.fire());
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,8 +229,15 @@ public class InputGraph extends Properties.Entity implements FolderElement {
|
||||
return parentGroup.getPrev(this);
|
||||
}
|
||||
|
||||
private void setName(String name) {
|
||||
this.getProperties().setProperty("name", name);
|
||||
@Override
|
||||
public ChangedEvent<InputGraph> getDisplayNameChangedEvent() {
|
||||
return displayNameChangedEvent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
getProperties().setProperty("name", name);
|
||||
displayNameChangedEvent.fire();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -229,6 +245,19 @@ public class InputGraph extends Properties.Entity implements FolderElement {
|
||||
return getProperties().get("name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
if (isDiffGraph) {
|
||||
return firstGraph.getDisplayName() + " Δ " + secondGraph.getDisplayName();
|
||||
} else {
|
||||
return getIndex()+1 + ". " + getName();
|
||||
}
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return getGroup().getGraphs().indexOf(this);
|
||||
}
|
||||
|
||||
public Collection<InputNode> getNodes() {
|
||||
return Collections.unmodifiableCollection(nodes.values());
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import com.sun.hotspot.igv.settings.Settings;
|
||||
import com.sun.hotspot.igv.util.RangeSliderModel;
|
||||
import java.awt.Color;
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import org.openide.util.Lookup;
|
||||
|
||||
/**
|
||||
@ -45,7 +46,6 @@ import org.openide.util.Lookup;
|
||||
*/
|
||||
public class DiagramViewModel extends RangeSliderModel implements ChangedListener<RangeSliderModel> {
|
||||
|
||||
// Warning: Update setData method if fields are added
|
||||
private final Group group;
|
||||
private ArrayList<InputGraph> graphs;
|
||||
private Set<Integer> hiddenNodes;
|
||||
@ -58,6 +58,7 @@ public class DiagramViewModel extends RangeSliderModel implements ChangedListene
|
||||
private final ChangedEvent<DiagramViewModel> graphChangedEvent;
|
||||
private final ChangedEvent<DiagramViewModel> selectedNodesChangedEvent;
|
||||
private final ChangedEvent<DiagramViewModel> hiddenNodesChangedEvent;
|
||||
private ChangedListener<InputGraph> titleChangedListener = g -> {};
|
||||
private boolean showSea;
|
||||
private boolean showBlocks;
|
||||
private boolean showCFG;
|
||||
@ -390,6 +391,9 @@ public class DiagramViewModel extends RangeSliderModel implements ChangedListene
|
||||
|
||||
@Override
|
||||
public void changed(RangeSliderModel source) {
|
||||
if (cachedInputGraph != null) {
|
||||
cachedInputGraph.getDisplayNameChangedEvent().removeListener(titleChangedListener);
|
||||
}
|
||||
if (getFirstGraph() != getSecondGraph()) {
|
||||
cachedInputGraph = Difference.createDiffGraph(getFirstGraph(), getSecondGraph());
|
||||
} else {
|
||||
@ -397,6 +401,12 @@ public class DiagramViewModel extends RangeSliderModel implements ChangedListene
|
||||
}
|
||||
rebuildDiagram();
|
||||
graphChangedEvent.fire();
|
||||
assert titleChangedListener != null;
|
||||
cachedInputGraph.getDisplayNameChangedEvent().addListener(titleChangedListener);
|
||||
}
|
||||
|
||||
void addTitleCallback(Consumer<InputGraph> titleCallback) {
|
||||
titleChangedListener = titleCallback::accept;
|
||||
}
|
||||
|
||||
void close() {
|
||||
|
@ -135,12 +135,6 @@ public final class EditorTopComponent extends TopComponent {
|
||||
content.add(diagramViewModel);
|
||||
associateLookup(new ProxyLookup(scene.getLookup(), new AbstractLookup(graphContent), new AbstractLookup(content)));
|
||||
|
||||
diagramViewModel.getDiagramChangedEvent().addListener(model -> {
|
||||
setDisplayName(model.getGraph().getName());
|
||||
setToolTipText(model.getGroup().getName());
|
||||
graphContent.set(Collections.singletonList(new EditorInputGraphProvider(this)), null);
|
||||
});
|
||||
|
||||
Group group = diagramViewModel.getGroup();
|
||||
group.getChangedEvent().addListener(g -> closeOnRemovedOrEmptyGroup());
|
||||
if (group.getParent() instanceof GraphDocument) {
|
||||
@ -148,6 +142,17 @@ public final class EditorTopComponent extends TopComponent {
|
||||
doc.getChangedEvent().addListener(d -> closeOnRemovedOrEmptyGroup());
|
||||
}
|
||||
|
||||
diagramViewModel.addTitleCallback(changedGraph -> {
|
||||
setDisplayName(changedGraph.getDisplayName());
|
||||
setToolTipText(diagramViewModel.getGroup().getDisplayName());
|
||||
});
|
||||
|
||||
diagramViewModel.getDiagramChangedEvent().addListener(model -> {
|
||||
setDisplayName(model.getGraph().getDisplayName());
|
||||
setToolTipText(model.getGroup().getDisplayName());
|
||||
graphContent.set(Collections.singletonList(new EditorInputGraphProvider(this)), null);
|
||||
});
|
||||
|
||||
cardLayout = new CardLayout();
|
||||
centerPanel = new JPanel();
|
||||
centerPanel.setLayout(cardLayout);
|
||||
|
@ -23,7 +23,7 @@
|
||||
<folder name="File">
|
||||
<file name="ExportActionSeparator.instance">
|
||||
<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
|
||||
<attr name="position" intvalue="700"/>
|
||||
<attr name="position" intvalue="2000"/>
|
||||
</file>
|
||||
</folder>
|
||||
</folder>
|
||||
|
Loading…
x
Reference in New Issue
Block a user