Permalink
Browse files

Added a way to choose the frame size of the viewer.

View.resizeFrame(int, int) is now avaiable.
Also changed the name of the view created by Graph.display() so that
the default view is created.
  • Loading branch information...
1 parent f044834 commit 7a8ee31d42cf765181257a717f749c95d40c8991 @Ant01n3 Ant01n3 committed May 5, 2011
View
24 Roadmap
@@ -4,7 +4,6 @@ Reorganisation
- Remove the old elasticBox package in ui.layout.
- Where to put the ToolBox ? Is this the right name ?
-
GraphStream Roadmap
===================
@@ -15,7 +14,6 @@ Legend:
- To do.
~ To figure out.
-
- Future:
---------
~ Add organisation/community detection methods (in tools ?).
@@ -43,7 +41,7 @@ Legend:
- Add more metrics in tools:
* Maintain the number of connected components (for static and dynamic graphs).
* Modularity.
- - diameter
+ * diameter
* The APSP subproblem (all-pair shortest paths) needed to compute the
diameter.
* Use the APSP to store the paths (is there an efficient way to
@@ -62,32 +60,32 @@ Legend:
iteratively in another thread with the GraphListenerProxy, etc.)
I/O
- - Add more features in the DGS format :
- - Allow to remove attributes.
- - Allow to change attributes for the graph.
- - Allow to change the direction of directed edges.
- ~ Related : It is not possible to delete attributes from elements with the
+ * Add more features in the DGS format :
+ * Allow to remove attributes.
+ * Allow to change attributes for the graph.
+ / Allow to change the direction of directed edges.
+ * Related : It is not possible to delete attributes from elements with the
GraphReader/GraphWriter interfaces.
- Add more algorithms:
~ Design a dynamic version of the dot file format ?.
~ It is not possible to change the orientation of an edge with the
GraphReader interface.
- Add a GraphWriterGML that can write "objects" (deserialisation).
- ~ How do GraphReader and GraphWriters should act:
- - for the attributes when a change occur: add the attributes ? in this
+ * How do GraphReader and GraphWriters should act:
+ * for the attributes when a change occur: add the attributes ? in this
case how to delete attributes ? Replace the existing set of attributes
by another ? In this case we have to specify the new set each time a
small change occurs. => a solution would be to propose a new API to
treat attribute events separately. It would impose to remove all
change node and edge events...
- - for the edge orientation changes. Actually the Graph API allows to
+ * for the edge orientation changes. Actually the Graph API allows to
switch an edge direction, but the reader and writers cannot read or
output theses changes in dynamic graphs.
- Add a reader for the Chaco format (already in Go2).
Viewer
- - Allow the SettingsWindow of the GraphPanel to be also embeddable in GUIs
+ / Allow the SettingsWindow of the GraphPanel to be also embeddable in GUIs
as a panel.
- Could be as a panel or
- as a tool bar.
@@ -98,7 +96,7 @@ Legend:
* Add more metrics in tools:
* Maintain the number of connected components (for static and dynamic graphs).
* Modularity.
- - diameter
+ * diameter
* The APSP subproblem (all-pair shortest paths) needed to compute the
diameter.
* Use the APSP to store the paths (is there an efficient way to
View
6 src/org/graphstream/graph/implementations/AdjacencyListGraph.java
@@ -848,11 +848,13 @@ public Viewer display(boolean autoLayout) {
Viewer viewer = new Viewer(this,
Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
GraphRenderer renderer = Viewer.newGraphRenderer();
-
+
+ viewer.addView(Viewer.DEFAULT_VIEW_ID, renderer);
+/*
viewer.addView(
String.format("defaultView_%d", (long) (Math.random() * 10000)),
renderer);
-
+*/
if (autoLayout) {
Layout layout = Layouts.newLayoutAlgorithm();
viewer.enableAutoLayout(layout);
View
4 src/org/graphstream/graph/implementations/ConcurrentGraph.java
@@ -832,10 +832,12 @@ public Viewer display(boolean autoLayout) {
Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
GraphRenderer renderer = Viewer.newGraphRenderer();
+ viewer.addView(Viewer.DEFAULT_VIEW_ID, renderer);
+/*
viewer.addView(
String.format("defaultView_%d", (long) (Math.random() * 10000)),
renderer);
-
+*/
if (autoLayout) {
Layout layout = newLayoutAlgorithm();
viewer.enableAutoLayout(layout);
View
6 src/org/graphstream/graph/implementations/DefaultGraph.java
@@ -817,10 +817,12 @@ public Viewer display(boolean autoLayout) {
Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
GraphRenderer renderer = Viewer.newGraphRenderer();
- viewer.addView(
+ viewer.addView(Viewer.DEFAULT_VIEW_ID, renderer);
+
+/* viewer.addView(
String.format("defaultView_%d", (long) (Math.random() * 10000)),
renderer);
-
+*/
if (autoLayout) {
Layout layout = Layouts.newLayoutAlgorithm();
viewer.enableAutoLayout(layout);
View
7 src/org/graphstream/ui/swingViewer/DefaultView.java
@@ -221,6 +221,13 @@ public void close(GraphicGraph graph) {
removeMouseMotionListener(mouseClicks);
openInAFrame(false);
}
+
+ @Override
+ public void resizeFrame(int width, int height) {
+ if(frame != null) {
+ frame.setSize(width, height);
+ }
+ }
@Override
public void openInAFrame(boolean on) {
View
9 src/org/graphstream/ui/swingViewer/View.java
@@ -186,6 +186,15 @@ public abstract void setBounds(double minx, double miny, double minz,
public abstract void openInAFrame(boolean on);
/**
+ * Set the size of the view frame, if any. If this view has been open in a frame, this changes
+ * the size of the frame containing it.
+ *
+ * @param width The new width.
+ * @param height The new height.
+ */
+ public abstract void resizeFrame(int width, int height);
+
+ /**
* Reset the view to the automatic mode.
*/
public abstract void resetView();

0 comments on commit 7a8ee31

Please sign in to comment.