Skip to content

Commit

Permalink
Remove BasicRenderer and Fix panel location
Browse files Browse the repository at this point in the history
  • Loading branch information
hichbra committed Feb 9, 2018
1 parent 125cd47 commit 9575d60
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 1,212 deletions.
14 changes: 8 additions & 6 deletions app/src/main/java/org/graphstream/ui/android/BackendJ2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ public Matrix getMatrixSurface(){
Matrix origin = surface.getMatrix();

if (!surface.isHardwareAccelerated()) {
int statusBarHeight = 0;
int resourceId = surface.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = surface.getResources().getDimensionPixelSize(resourceId);
}
origin.postTranslate(0, statusBarHeight);
// get the surfaceView's location on screen
int[] location = new int[2];
location[0] = 0; location[1] = 0;

surface.getLocationOnScreen(location);

origin.postTranslate(location[0], location[1]);
}
return origin ;
}
Expand Down Expand Up @@ -190,6 +191,7 @@ public void endTransform() {
}

private void computeInverse() {
Log.e("Debug", getMatrix()+"");
xT = new Matrix(Tx);
if( !xT.invert(xT)) {
Log.e("Error", "Cannot inverse matrix. " + this.getClass().getSimpleName());
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.graphstream.stream.ProxyPipe;
import org.graphstream.stream.Source;
import org.graphstream.stream.thread.ThreadProxyPipe;
import org.graphstream.ui.android_viewer.basicRenderer.AndroidBasicGraphRenderer;
import org.graphstream.ui.android.AndroidFullGraphRenderer;
import org.graphstream.ui.graphicGraph.GraphicGraph;
import org.graphstream.ui.view.GraphRenderer;
import org.graphstream.ui.view.View;
Expand Down Expand Up @@ -195,7 +195,7 @@ public void close() {
}

public GraphRenderer<?, ?> newDefaultGraphRenderer() {
return new AndroidBasicGraphRenderer();
return new AndroidFullGraphRenderer();
}

class MyTimer extends CountDownTimer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,15 @@ public Camera getCamera() {
}

public void render(Canvas c) {
int statusBarHeight = 0;
// get the surfaceView's location on screen
int[] location = new int[2];
location[0] = 0; location[1] = 0;

if (!isHardwareAccelerated()) {
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = getResources().getDimensionPixelSize(resourceId);
}
getLocationOnScreen(location);
}

renderer.render(c, (int)getX(), (int)getY()+statusBarHeight, getWidth(), getHeight());
renderer.render(c, location[0], location[1], getWidth(), getHeight());
//renderer.render(c, 0, statusBarHeight, getWidth(), getHeight());

// No screenshot in android, renderer.screenshot is empty
Expand Down
Loading

0 comments on commit 9575d60

Please sign in to comment.