|
@@ -121,7 +121,7 @@ public final class GraphDisplayManager {
|
|
|
*
|
|
|
* @return the id to access the specific Graph
|
|
|
*/
|
|
|
- public static int addGraph() {
|
|
|
+ public static MyGraph addGraph() {
|
|
|
String id = getGraphStringID(count);
|
|
|
MyGraph g = new MyGraph(id);
|
|
|
return addGraph(g, true);
|
|
@@ -138,7 +138,7 @@ public final class GraphDisplayManager {
|
|
|
* the current layer, if false they will be merged.
|
|
|
* @return the id to access the specific Graph
|
|
|
*/
|
|
|
- public static int addGraph(String fileName, boolean replaceCurrent) {
|
|
|
+ public static MyGraph addGraph(String fileName, boolean replaceCurrent) {
|
|
|
String id = getGraphStringID(count);
|
|
|
MyGraph g = importer.readGraph(id, Main.class.getResource(fileName));
|
|
|
return addGraph(g, replaceCurrent);
|
|
@@ -154,11 +154,11 @@ public final class GraphDisplayManager {
|
|
|
* the current layer, if false they will be merged.
|
|
|
* @return the id to access the specific Graph
|
|
|
*/
|
|
|
- public static int addGraph(Stage stage, boolean replaceCurrent) {
|
|
|
+ public static MyGraph addGraph(Stage stage, boolean replaceCurrent) {
|
|
|
String id = getGraphStringID(count);
|
|
|
MyGraph g = importer.readGraph(id, stage);
|
|
|
if (g == null) {
|
|
|
- return currentGraphManager;
|
|
|
+ return getGraphManager().getGraph();
|
|
|
}
|
|
|
return addGraph(g, replaceCurrent);
|
|
|
}
|
|
@@ -173,7 +173,7 @@ public final class GraphDisplayManager {
|
|
|
* the current layer, if false they will be merged.
|
|
|
* @return the id to access the specific Graph
|
|
|
*/
|
|
|
- public static int addGraph(URL fileURL, boolean replaceCurrent) {
|
|
|
+ public static MyGraph addGraph(URL fileURL, boolean replaceCurrent) {
|
|
|
String id = getGraphStringID(count);
|
|
|
MyGraph g = importer.readGraph(id, fileURL);
|
|
|
return addGraph(g, replaceCurrent);
|
|
@@ -190,13 +190,12 @@ public final class GraphDisplayManager {
|
|
|
* the current layer, if false they will be merged.
|
|
|
* @return the id to access the specific graph
|
|
|
*/
|
|
|
- public static int addGraph(MyGraph g, boolean replaceCurrent) {
|
|
|
+ public static MyGraph addGraph(MyGraph g, boolean replaceCurrent) {
|
|
|
if (g == null) {
|
|
|
throw new NullArgumentException();
|
|
|
}
|
|
|
|
|
|
GraphManager v;
|
|
|
- int ret = 0;
|
|
|
// replacing the current graph or merging
|
|
|
if (replaceCurrent) {
|
|
|
v = new GraphManager(g);
|
|
@@ -206,7 +205,7 @@ public final class GraphDisplayManager {
|
|
|
v.getGraph().addAttribute("ui.antialias");
|
|
|
removeAllCurrentGraphs();
|
|
|
vList.add(v);
|
|
|
- ret = count++;
|
|
|
+ count++;
|
|
|
// set basic style
|
|
|
v.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
|
|
|
} else {
|
|
@@ -217,7 +216,7 @@ public final class GraphDisplayManager {
|
|
|
g.addAttribute("ui.antialias");
|
|
|
removeAllCurrentGraphs();
|
|
|
vList.add(v);
|
|
|
- ret = count++;
|
|
|
+ count++;
|
|
|
// set basic style
|
|
|
v.setStylesheet(StylesheetManager.DEFAULT_STYLESHEET);
|
|
|
}
|
|
@@ -226,7 +225,7 @@ public final class GraphDisplayManager {
|
|
|
v.convertUiClass();
|
|
|
// display the graph
|
|
|
switchActiveGraph();
|
|
|
- return ret;
|
|
|
+ return g;
|
|
|
}
|
|
|
|
|
|
/**
|