This commit is contained in:
Martin Pernollet 2014-11-16 21:19:54 +01:00
parent c9b666fab7
commit 75f5ff3b54
5 changed files with 34 additions and 7 deletions

View File

@ -84,6 +84,18 @@ public class Chart {
view.setChart(this);
}
public void black(){
getView().setBackgroundColor(Color.BLACK);
getAxeLayout().setGridColor(Color.WHITE);
getAxeLayout().setMainColor(Color.WHITE);
}
public void white(){
getView().setBackgroundColor(Color.WHITE);
getAxeLayout().setGridColor(Color.BLACK);
getAxeLayout().setMainColor(Color.BLACK);
}
public IFrame display(Rectangle rectangle, String title) {
return getFactory().newFrame(this, rectangle, title);
}

View File

@ -48,7 +48,6 @@ public class Chart2d extends AWTChart {
layout2d();
}
public void layout2d() {
IAxeLayout axe = getAxeLayout();
axe.setZAxeLabelDisplayed(false);

View File

@ -1,5 +1,6 @@
package org.jzy3d.chart2d;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@ -17,6 +18,10 @@ public class SerieManager {
return instance;
}
public Collection<Serie2d> getSeries(){
return series.values();
}
public Serie2d getSerie(String name, Serie2d.Type type) {
Serie2d serie = null;
if (!series.keySet().contains(name)) {

View File

@ -9,12 +9,13 @@ import org.jzy3d.plot3d.primitives.ConcurrentLineStrip;
import org.jzy3d.plot3d.primitives.Point;
public class LineSerie2d implements Serie2d {
protected ConcurrentLineStrip line = new ConcurrentLineStrip();
protected ConcurrentLineStrip line;
protected String name;
public LineSerie2d(String name){
this.name = name;
this.line = new ConcurrentLineStrip();
}
@Override

View File

@ -69,7 +69,7 @@ public class View {
* set one time by the init() method.
*/
public View(IChartComponentFactory factory, Scene scene, ICanvas canvas, Quality quality) {
BoundingBox3d sceneBounds = scene.getGraph().getBounds();
BoundingBox3d sceneBounds = getSceneGraphBounds(scene);
this.viewpoint = DEFAULT_VIEW.clone();
this.center = sceneBounds.getCenter();
@ -144,6 +144,8 @@ public class View {
return p;
}
/******************************* GENERAL DISPLAY CONTROLS ***********************************/
public void rotate(final Coord2d move) {
@ -533,7 +535,7 @@ public class View {
*/
public void updateBounds() {
if (boundmode == ViewBoundMode.AUTO_FIT)
lookToBox(scene.getGraph().getBounds()); // set axe and camera
lookToBox(getSceneGraphBounds()); // set axe and camera
else if (boundmode == ViewBoundMode.MANUAL)
lookToBox(viewbounds); // set axe and camera
else
@ -541,12 +543,20 @@ public class View {
shoot();
}
protected BoundingBox3d getSceneGraphBounds(){
return getSceneGraphBounds(scene);
}
protected BoundingBox3d getSceneGraphBounds(Scene scene){
return scene.getGraph().getBounds();
}
/**
* Update the bounds according to the scene graph whatever is the current
* {@link ViewBoundMode}, and orders a {@link Camera.shoot()}
*/
public void updateBoundsForceUpdate(boolean refresh) {
lookToBox(scene.getGraph().getBounds());
lookToBox(getSceneGraphBounds());
if (refresh)
shoot();
}
@ -762,7 +772,7 @@ public class View {
BoundingBox3d boundsScaled = new BoundingBox3d();
boundsScaled.add(viewbounds.scale(scaling));
if (MAINTAIN_ALL_OBJECTS_IN_VIEW)
boundsScaled.add(scene.getGraph().getBounds().scale(scaling));
boundsScaled.add(getSceneGraphBounds().scale(scaling));
return boundsScaled;
}
@ -786,7 +796,7 @@ public class View {
// Get the view bounds
BoundingBox3d bounds;
if (boundmode == ViewBoundMode.AUTO_FIT)
bounds = scene.getGraph().getBounds();
bounds = getSceneGraphBounds();
else if (boundmode == ViewBoundMode.MANUAL)
bounds = viewbounds;
else {