Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ee1e99a
IGV: save the state opened graphs to a file
Jan 30, 2024
589ddcb
add USERDIR to igv.sh
Jan 30, 2024
9177863
added igv_no_settings.sh
Jan 30, 2024
6063e0e
STATE_FORMAT_VERSION
Jan 31, 2024
62a116a
loadState() and saveState()
Jan 31, 2024
05af995
don't crash at exception
Jan 31, 2024
1e7fd39
putValue(Action.SMALL_ICON) to Actions
Feb 1, 2024
870eff1
new save as icon
Feb 7, 2024
867d668
Compile again
Feb 7, 2024
456cecf
missing saveas image
Feb 7, 2024
4951334
workspace button
Feb 15, 2024
ba2c650
temp
Feb 15, 2024
6191ea1
saveall.gif
Feb 16, 2024
3b7b182
import description
Feb 16, 2024
681f0a0
setWorkspacePath
Feb 16, 2024
58f2402
clear() in loadWorkspace()
Feb 16, 2024
a3ec6ba
invokeLater and correct getWorkspaceGraphsPath
Feb 16, 2024
cf24cce
USERDIR to WORKSPACE
Feb 16, 2024
6e5e001
Update src/utils/IdealGraphVisualizer/igv.sh
Feb 16, 2024
9339f1a
move loadWorkspace to init
Feb 16, 2024
dfc05f7
userdir
Feb 16, 2024
a3fe22a
Update src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/s…
Feb 26, 2024
094e618
remove unused InputStream in Printer
Mar 27, 2024
9a00b86
Printer.java copyright
Mar 27, 2024
5852921
saveState flag
Mar 27, 2024
eacc051
Printer.exportStates
Mar 27, 2024
e50a509
remove unused
Mar 27, 2024
4aa3601
Save state in XML
Apr 8, 2024
2377ead
revert igv.sh
Apr 8, 2024
1c880ed
Update RemoveAction.java
Apr 8, 2024
17cd1c5
copyright year
Apr 8, 2024
3199ec7
undo some unnecessary changes
Apr 8, 2024
8735e07
remove invokeLater
Apr 8, 2024
90dd36f
improved save()
Apr 8, 2024
2829412
requestProcessor instead of default
Apr 8, 2024
4089718
Update ImportAction.java
Apr 8, 2024
e1f7c5e
added comments
Apr 8, 2024
b13a472
Merge branch 'JDK-8324950' of github.com:tobiasholenstein/jdk into JD…
Apr 8, 2024
ed4cb76
Merge branch 'openjdk:master' into JDK-8324950
Apr 9, 2024
3283c53
fix diffgraph
Apr 9, 2024
9bf13ba
Merge branch 'JDK-8324950' of github.com:tobiasholenstein/jdk into JD…
Apr 9, 2024
1fd52c1
remove ExportAction.java
Apr 10, 2024
d1723a8
make methods in Printer static
Apr 10, 2024
dc316e0
Update src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/s…
Apr 10, 2024
d1389af
Update src/utils/IdealGraphVisualizer/Coordinator/src/main/resources/…
Apr 10, 2024
a6a2c12
visibleNodes instead of hiddenNodes
Apr 10, 2024
43192aa
Fix: highlight nodes from imported tabs
Apr 10, 2024
d2a0ff7
add <visibleNodes all="true">
Apr 11, 2024
5be2c7d
re-add setInvokeLater to Parser.java and remove RequestProcessor from…
Apr 12, 2024
4fd0b3d
Fix2: highlight nodes from imported tabs
Apr 15, 2024
8fb022a
open tabs only after all graphs are loaded into group
Apr 16, 2024
b4fb2de
don't adjust zoom level when opening a tab
Apr 16, 2024
9196f12
support negative difference in XML
Apr 16, 2024
da669a9
close all instances of EditorTopComponent when closing workspace
Apr 17, 2024
b71a5a4
Update src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/s…
Apr 17, 2024
5e055ab
Update src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/s…
Apr 17, 2024
a4b48c4
Update GraphParser.java
Apr 17, 2024
67e0ce0
open tabs in deterministic order (List instead of Set)
Apr 18, 2024
582195e
Update src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/s…
Apr 18, 2024
e2a4ebf
Update with suggestions
Apr 18, 2024
ea8f238
Update src/utils/IdealGraphVisualizer/Data/src/main/java/com/sun/hots…
Apr 18, 2024
75e1af0
remove null check
Apr 18, 2024
339b0ed
Merge branch 'JDK-8324950' of github.com:tobiasholenstein/jdk into JD…
Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/utils/IdealGraphVisualizer/Coordinator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
<artifactId>org-openide-util-lookup</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-modules</artifactId>
<version>${netbeans.version}</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util-ui</artifactId>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,24 +25,10 @@
package com.sun.hotspot.igv.coordinator.actions;

import com.sun.hotspot.igv.coordinator.OutlineTopComponent;
import com.sun.hotspot.igv.data.GraphDocument;
import com.sun.hotspot.igv.data.serialization.GraphParser;
import com.sun.hotspot.igv.data.serialization.ParseMonitor;
import com.sun.hotspot.igv.data.serialization.Parser;
import com.sun.hotspot.igv.settings.Settings;
import java.io.File;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.file.StandardOpenOption;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.Action;
import javax.swing.JFileChooser;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileFilter;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.util.*;
import org.openide.util.HelpCtx;
import org.openide.util.ImageUtilities;
import org.openide.util.NbBundle;
import org.openide.util.actions.CallableSystemAction;

/**
Expand All @@ -51,102 +37,22 @@
*/

public final class ImportAction extends CallableSystemAction {
private static final int WORKUNITS = 10000;

public static FileFilter getFileFilter() {
return new FileFilter() {

@Override
public boolean accept(File f) {
return f.getName().toLowerCase().endsWith(".xml") || f.isDirectory();
}

@Override
public String getDescription() {
return "Graph files (*.xml)";
}
};
public ImportAction() {
putValue(Action.SHORT_DESCRIPTION, "Import from XML...");
putValue(Action.SMALL_ICON, ImageUtilities.loadImageIcon(iconResource(), true));
}

@Override
public void performAction() {
JFileChooser fc = new JFileChooser();
fc.setFileFilter(ImportAction.getFileFilter());
fc.setCurrentDirectory(new File(Settings.get().get(Settings.DIRECTORY, Settings.DIRECTORY_DEFAULT)));
fc.setMultiSelectionEnabled(true);

if (fc.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
for (final File file : fc.getSelectedFiles()) {
File dir = file;
if (!dir.isDirectory()) {
dir = dir.getParentFile();
}

Settings.get().put(Settings.DIRECTORY, dir.getAbsolutePath());
try {
final FileChannel channel = FileChannel.open(file.toPath(), StandardOpenOption.READ);
final ProgressHandle handle = ProgressHandleFactory.createHandle("Opening file " + file.getName());
handle.start(WORKUNITS);
final long startTime = System.currentTimeMillis();
final long start = channel.size();
ParseMonitor monitor = new ParseMonitor() {
@Override
public void updateProgress() {
try {
int prog = (int) (WORKUNITS * (double) channel.position() / (double) start);
handle.progress(prog);
} catch (IOException ignored) {}
}
@Override
public void setState(String state) {
updateProgress();
handle.progress(state);
}
};
final GraphParser parser;
final OutlineTopComponent component = OutlineTopComponent.findInstance();
if (file.getName().endsWith(".xml")) {
parser = new Parser(channel, monitor, null);
} else {
parser = null;
}
RequestProcessor.getDefault().post(new Runnable() {
@Override
public void run() {
try {
final GraphDocument document = parser.parse();
if (document != null) {
SwingUtilities.invokeLater(() -> {
component.requestActive();
component.getDocument().addGraphDocument(document);
});
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
handle.finish();
long stop = System.currentTimeMillis();
Logger.getLogger(getClass().getName()).log(Level.INFO, "Loaded in " + file + " in " + ((stop - startTime) / 1000.0) + " seconds");
}
});
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
}
OutlineTopComponent.findInstance().importFromXML();
}

@Override
public String getName() {
return NbBundle.getMessage(ImportAction.class, "CTL_ImportAction");
}

public ImportAction() {
putValue(Action.SHORT_DESCRIPTION, "Open");
// D is the Control key on most platforms, the Command (meta) key on Macintosh
putValue(Action.ACCELERATOR_KEY, Utilities.stringToKey("D-O"));
}

@Override
public HelpCtx getHelpCtx() {
return HelpCtx.DEFAULT_HELP;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/

package com.sun.hotspot.igv.coordinator.actions;

import com.sun.hotspot.igv.coordinator.OutlineTopComponent;
import javax.swing.Action;
import org.openide.util.HelpCtx;
import org.openide.util.ImageUtilities;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.util.actions.CallableSystemAction;

public final class OpenAction extends CallableSystemAction {

public OpenAction() {
putValue(Action.SHORT_DESCRIPTION, "Open...");
// D is the Control key on most platforms, the Command (meta) key on Macintosh
putValue(Action.ACCELERATOR_KEY, Utilities.stringToKey("D-O"));
putValue(Action.SMALL_ICON, ImageUtilities.loadImageIcon(iconResource(), true));
}

@Override
public void performAction() {
OutlineTopComponent.findInstance().openFile();
}

@Override
public String getName() {
return NbBundle.getMessage(OpenAction.class, "CTL_OpenAction");
}

@Override
public HelpCtx getHelpCtx() {
return HelpCtx.DEFAULT_HELP;
}

@Override
protected boolean asynchronous() {
return false;
}

@Override
protected String iconResource() {
return "com/sun/hotspot/igv/coordinator/images/open.png";
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -28,6 +28,7 @@
import javax.swing.Action;
import org.openide.nodes.Node;
import org.openide.util.HelpCtx;
import org.openide.util.ImageUtilities;
import org.openide.util.NbBundle;
import org.openide.util.actions.NodeAction;

Expand All @@ -37,6 +38,11 @@
*/
public final class RemoveAction extends NodeAction {

public RemoveAction() {
putValue(Action.SHORT_DESCRIPTION, getName());
putValue(Action.SMALL_ICON, ImageUtilities.loadImageIcon(iconResource(), true));
}

@Override
protected void performAction(Node[] activatedNodes) {
for (Node n : activatedNodes) {
Expand All @@ -47,10 +53,6 @@ protected void performAction(Node[] activatedNodes) {
}
}

public RemoveAction() {
putValue(Action.SHORT_DESCRIPTION, getName());
}

@Override
public String getName() {
return NbBundle.getMessage(RemoveAction.class, "CTL_RemoveAction");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,6 +27,7 @@
import com.sun.hotspot.igv.coordinator.OutlineTopComponent;
import javax.swing.Action;
import org.openide.util.HelpCtx;
import org.openide.util.ImageUtilities;
import org.openide.util.NbBundle;
import org.openide.util.actions.CallableSystemAction;

Expand All @@ -42,7 +43,8 @@ public String getName() {
}

public RemoveAllAction() {
putValue(Action.SHORT_DESCRIPTION, "Remove all graphs and groups");
putValue(Action.SHORT_DESCRIPTION, "Clear workspace");
putValue(Action.SMALL_ICON, ImageUtilities.loadImageIcon(iconResource(), true));
}

@Override
Expand All @@ -62,6 +64,6 @@ protected boolean asynchronous() {

@Override
public void performAction() {
OutlineTopComponent.findInstance().clear();
OutlineTopComponent.findInstance().clearWorkspace();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,37 +27,34 @@
import com.sun.hotspot.igv.coordinator.OutlineTopComponent;
import javax.swing.Action;
import org.openide.util.HelpCtx;
import org.openide.util.ImageUtilities;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.util.actions.CallableSystemAction;

/**
*
* @author Thomas Wuerthinger
*/

public final class SaveAllAction extends CallableSystemAction {
public final class SaveAction extends CallableSystemAction {

public SaveAction() {
putValue(Action.SHORT_DESCRIPTION, "Save");
// D is the Control key on most platforms, the Command (meta) key on Macintosh
putValue(Action.ACCELERATOR_KEY, Utilities.stringToKey("D-S"));
putValue(Action.SMALL_ICON, ImageUtilities.loadImageIcon(iconResource(), true));
}

@Override
public void performAction() {
final OutlineTopComponent component = OutlineTopComponent.findInstance();
SaveAsAction.save(component.getDocument());
OutlineTopComponent.findInstance().save();
}

@Override
public String getName() {
return NbBundle.getMessage(SaveAllAction.class, "CTL_SaveAllAction");
}

public SaveAllAction() {
putValue(Action.SHORT_DESCRIPTION, "Save all groups to XML file...");
// D is the Control key on most platforms, the Command (meta) key on Macintosh
putValue(Action.ACCELERATOR_KEY, Utilities.stringToKey("D-S"));
return NbBundle.getMessage(SaveAction.class, "CTL_SaveAction");
}

@Override
protected String iconResource() {
return "com/sun/hotspot/igv/coordinator/images/saveall.gif";
return "com/sun/hotspot/igv/coordinator/images/save.png";
}

@Override
Expand Down
Loading