diff --git a/.gitignore b/.gitignore
index 4235ce1e1..4d66429c2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,7 +9,7 @@ target/
.settings
.idea/
**/.idea/
-
+**/bin/
# OS specific folder data files
.DS_Store
diff --git a/jzy3d-core-awt/pom.xml b/jzy3d-core-awt/pom.xml
index 1a7fbc3b4..779f6c051 100644
--- a/jzy3d-core-awt/pom.xml
+++ b/jzy3d-core-awt/pom.xml
@@ -17,6 +17,15 @@
jzy3d-core
${project.version}
+
+
+ ${project.groupId}
+ jzy3d-core
+ ${project.version}
+ test-jar
+ test
+
+
-
+
\ No newline at end of file
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/chart/AWTChart.java b/jzy3d-core-awt/src/main/java/org/jzy3d/chart/AWTChart.java
index f828b516c..1a038e5bc 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/chart/AWTChart.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/chart/AWTChart.java
@@ -7,8 +7,10 @@
import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
import org.jzy3d.plot3d.rendering.canvas.Quality;
import org.jzy3d.plot3d.rendering.legends.colorbars.AWTColorbarLegend;
+import org.jzy3d.plot3d.rendering.legends.colorbars.IColorbarLegend;
import org.jzy3d.plot3d.rendering.view.AWTRenderer2d;
import org.jzy3d.plot3d.rendering.view.AWTView;
+import org.jzy3d.plot3d.rendering.view.View;
public class AWTChart extends Chart {
public AWTChart(IChartFactory components, Quality quality) {
@@ -20,32 +22,33 @@ protected AWTChart() {
}
public void addRenderer(AWTRenderer2d renderer2d) {
- getAWTView().addRenderer2d(renderer2d);
+ getView().addRenderer2d(renderer2d);
}
public void removeRenderer(AWTRenderer2d renderer2d) {
- getAWTView().removeRenderer2d(renderer2d);
- }
-
- public AWTView getAWTView() {
- return (AWTView) view;
+ getView().removeRenderer2d(renderer2d);
}
public AWTColorbarLegend colorbar(Drawable drawable) {
- return colorbar(drawable, null, getView().getAxis().getLayout());
+ return colorbar(drawable, getView().getAxis().getLayout());
}
public AWTColorbarLegend colorbar(Drawable drawable, AxisLayout layout) {
- return colorbar(drawable, null, layout);
- }
-
- public AWTColorbarLegend colorbar(Drawable drawable, Dimension minDimension, AxisLayout layout) {
- AWTColorbarLegend colorbar = new AWTColorbarLegend(drawable, layout);
-
- if(minDimension!=null)
- colorbar.setMinimumDimension(minDimension);
-
+ AWTColorbarLegend colorbar = new AWTColorbarLegend(drawable, layout, layout.getMainColor(), view.getBackgroundColor());
drawable.setLegend(colorbar);
return colorbar;
}
+
+ @Override
+ public AWTColorbarLegend getColorbar() {
+ AWTColorbarLegend bar = (AWTColorbarLegend)super.getColorbar();
+ return bar;
+ }
+
+
+ @Override
+ public AWTView getView() {
+ return (AWTView)super.getView();
+ }
}
+
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot2d/primitive/AWTColorbarImageGenerator.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot2d/primitive/AWTColorbarImageGenerator.java
index c001496c4..4dce88c8b 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot2d/primitive/AWTColorbarImageGenerator.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot2d/primitive/AWTColorbarImageGenerator.java
@@ -24,14 +24,17 @@ public class AWTColorbarImageGenerator extends AWTAbstractImageGenerator
public static final int MIN_BAR_HEIGHT = 100;
protected ColorMapper mapper;
- protected ITickProvider provider;
- protected ITickRenderer renderer;
+ protected ITickProvider tickProvider;
+ protected ITickRenderer tickRenderer;
protected double min;
protected double max;
public static int BAR_WIDTH_DEFAULT = 20;
+ public static int TEXT_TO_BAR_DEFAULT = 2;
+
protected int barWidth;
- protected int textToBarHorizontalMargin = 2;
+ protected int textToBarHorizontalMargin = TEXT_TO_BAR_DEFAULT;
+ protected int maxTextWidth;
protected boolean addTextHeightToVerticalMargin = false;
@@ -45,8 +48,8 @@ public AWTColorbarImageGenerator(IColorMap map, float min, float max, ITickProvi
public AWTColorbarImageGenerator(ColorMapper mapper, ITickProvider provider,
ITickRenderer renderer) {
this.mapper = mapper;
- this.provider = provider;
- this.renderer = renderer;
+ this.tickProvider = provider;
+ this.tickRenderer = renderer;
this.min = mapper.getMin();
this.max = mapper.getMax();
@@ -62,8 +65,8 @@ public BufferedImage toImage(int width, int height) {
/** Renders the colorbar to an image. */
public BufferedImage toImage(int width, int height, int barWidth) {
- if (barWidth > width)
- return null;
+ //if (barWidth > width)
+ // return null;
this.barWidth = barWidth;
@@ -75,9 +78,9 @@ public BufferedImage toImage(int width, int height, int barWidth) {
configureText(graphic);
drawBackground(width, height, graphic);
- drawBarColors(height, this.barWidth/*getScaledBarWidth()*/, graphic);
- drawBarContour(height, this.barWidth/*getScaledBarWidth()*/, graphic);
- drawTextAnnotations(height, this.barWidth/*getScaledBarWidth()*/, graphic);
+ drawBarColors(height, getScaledBarWidth(), graphic);
+ drawBarContour(height, getScaledBarWidth(), graphic);
+ drawTextAnnotations(height, getScaledBarWidth(), graphic);
return image;
}
@@ -95,7 +98,7 @@ public BufferedImage toImage(int width, int height, int barWidth) {
protected void drawBarContour(int height, int barWidth, Graphics2D graphic) {
int finalY = 0;
- int finalH = height;
+ int finalH = height-1; // let bottom contour appear in the image
// add little space to avoid cutting the text
// on top and bottom of colorbar
@@ -118,7 +121,7 @@ protected void drawBarContour(int height, int barWidth, Graphics2D graphic) {
protected void drawBarColors(int height, int barWidth, Graphics2D graphic) {
int finalFrom = 0;
- int finalTo = height;
+ int finalTo = height-1;
// add little space to avoid cutting the text
// on top and bottom of colorbar
@@ -140,8 +143,8 @@ protected void drawBarColors(int height, int barWidth, Graphics2D graphic) {
}
protected void drawTextAnnotations(int height, int barWidth, Graphics2D graphic) {
- if (provider != null) {
- double[] ticks = provider.generateTicks(min, max);
+ if (tickProvider != null) {
+ double[] ticks = tickProvider.generateTicks(min, max);
//System.out.println("AWTColorbarImageGen : min=" + min + " max=" + max);
@@ -158,7 +161,7 @@ protected void drawTextAnnotations(int height, int barWidth, Graphics2D graphic)
int ypos = (int) (height - (heightNoText * ratioOfRange));
- String txt = renderer.format(ticks[t]);
+ String txt = tickRenderer.format(ticks[t]);
graphic.drawString(txt, xpos, ypos);
}
}
@@ -174,7 +177,7 @@ public void setPixelScale(Coord2d pixelScale) {
/* */
- protected int getScaledBarWidth() {
+ public int getScaledBarWidth() {
if(pixelScale!=null) {
return (int)(barWidth * pixelScale.x);
}
@@ -183,18 +186,10 @@ protected int getScaledBarWidth() {
}
}
- /**
- * Compute the optimal image width to contain the text as defined by the tick provided and
- * renderer.
- */
- public int getPreferedWidth(IPainter painter) {
- int maxWidth = getMaxTickLabelWidth(painter);
- return getPreferedWidth(maxWidth);
+ public int getBarWidth() {
+ return barWidth;
}
- protected int getPreferedWidth(int maxTextWidth) {
- return maxTextWidth + textToBarHorizontalMargin + BAR_WIDTH_DEFAULT;
- }
public int getTextToBarHorizontalMargin() {
return textToBarHorizontalMargin;
@@ -204,16 +199,51 @@ public void setTextToBarHorizontalMargin(int textToBarHorizontalMargin) {
this.textToBarHorizontalMargin = textToBarHorizontalMargin;
}
- protected int getMaxTickLabelWidth(IPainter painter) {
+ /**
+ * Compute the optimal image width to contain the text as defined by the tick provided and
+ * renderer.
+ */
+ public int getPreferredWidth(IPainter painter) {
+ maxTextWidth = getMaxTickLabelWidth(painter);
+
+ //System.out.println("AWTColorbarImageGen : max txt width " + maxTextWidth);
+
+ // we unscale it : we here use a graphics2D context that consider
+ // text scale by itself. As font is globally magnified, mainly for JOGL
+ // text renderer, we will unscale it for processing the width
+
+ int maxTextActual = maxTextWidth;
+
+ if(pixelScale.x>0)
+ maxTextActual = Math.round(maxTextWidth / pixelScale.x);
+
+ //System.out.println("AWTColorbarImageGen : max txt act " + maxTextActual + " " + pixelScale);
+
+ return getPreferredWidth(maxTextActual);
+ }
+
+ protected int getPreferredWidth(int maxTextWidth) {
+ return maxTextWidth + getTextToBarHorizontalMargin() + getBarWidth();
+ }
+
+ /**
+ * Only valid after a call to {@link #getPreferredWidth(IPainter)}
+ * @return
+ */
+ public int getMaxTextWidth() {
+ return maxTextWidth;
+ }
+
+ public int getMaxTickLabelWidth(IPainter painter) {
int maxWidth = 0;
- if (provider != null) {
- double[] ticks = provider.generateTicks(min, max);
+ if (tickProvider != null) {
+ double[] ticks = tickProvider.generateTicks(min, max);
String tickLabel;
for (int t = 0; t < ticks.length; t++) {
- tickLabel = renderer.format(ticks[t]);
+ tickLabel = tickRenderer.format(ticks[t]);
int stringWidth = painter.getTextLengthInPixels(font, tickLabel);
-
+ //System.out.println("Gen : " + stringWidth + " for " + tickLabel);
if (maxWidth < stringWidth) {
maxWidth = stringWidth;
}
@@ -221,4 +251,20 @@ protected int getMaxTickLabelWidth(IPainter painter) {
}
return maxWidth;
}
+
+ public ITickProvider getTickProvider() {
+ return tickProvider;
+ }
+
+ public void setTickProvider(ITickProvider tickProvider) {
+ this.tickProvider = tickProvider;
+ }
+
+ public ITickRenderer getTickRenderer() {
+ return tickRenderer;
+ }
+
+ public void setTickRenderer(ITickRenderer tickRenderer) {
+ this.tickRenderer = tickRenderer;
+ }
}
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot2d/rendering/AWTGraphicsUtils.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot2d/rendering/AWTGraphicsUtils.java
index 752f4c0b7..8b9cd715d 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot2d/rendering/AWTGraphicsUtils.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot2d/rendering/AWTGraphicsUtils.java
@@ -67,6 +67,11 @@ public static void drawString(Graphics2D g2d, Font font, boolean useOSFontRender
}
}
+ public static int stringWidth(String string) {
+ BufferedImage i = new BufferedImage(0,0, BufferedImage.TYPE_4BYTE_ABGR);
+
+ return stringWidth(i.createGraphics(), string);
+ }
public static int stringWidth(Graphics2D g2d, String string) {
FontMetrics fm = g2d.getFontMetrics();
if (fm != null) {
diff --git a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/builder/concrete/BufferedImageMapper.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/builder/concrete/BufferedImageMapper.java
similarity index 100%
rename from jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/builder/concrete/BufferedImageMapper.java
rename to jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/builder/concrete/BufferedImageMapper.java
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/AWTLegend.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/AWTLegend.java
index 9c3d74ce6..4d5d71e05 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/AWTLegend.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/AWTLegend.java
@@ -81,7 +81,8 @@ public void setViewPort(int width, int height, float left, float right) {
if (imageWidth != imgWidth || imageHeight != height) {
- //System.out.println("AWTLegend width:" + imgWidth + " height:" + height + " mode:" + getViewportMode());
+ //System.out.println("AWTLegend left:" + left + " right:" + right);
+ //System.out.println("AWTLegend imgWidth:" + imgWidth + " width:" + width + " height:" + height + " mode:" + getViewportMode());
setImage(toImage(imgWidth, height));
}
}
@@ -107,10 +108,16 @@ public Dimension getMinimumDimension() {
return minimumDimension;
}
+ /**
+ * Now overriden by automatic processing of minimum dimension
+ * @param dimension
+ */
+ @Deprecated
public void setMinimumDimension(Dimension dimension) {
minimumDimension = dimension;
}
+ @Deprecated
public void setMinimumWidth(int minimumWidth) {
this.minimumDimension.width = minimumWidth;
}
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/colorbars/AWTColorbarLegend.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/colorbars/AWTColorbarLegend.java
index 7aba1fdce..ab7677a48 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/colorbars/AWTColorbarLegend.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/colorbars/AWTColorbarLegend.java
@@ -8,6 +8,7 @@
import org.jzy3d.colors.IMultiColorable;
import org.jzy3d.maths.Coord2d;
import org.jzy3d.maths.Dimension;
+import org.jzy3d.maths.Margin;
import org.jzy3d.painters.Font;
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot2d.primitive.AWTColorbarImageGenerator;
@@ -16,7 +17,6 @@
import org.jzy3d.plot3d.primitives.axis.layout.providers.ITickProvider;
import org.jzy3d.plot3d.primitives.axis.layout.renderers.ITickRenderer;
import org.jzy3d.plot3d.rendering.legends.AWTLegend;
-import org.jzy3d.plot3d.rendering.view.ViewportMode;
import org.jzy3d.plot3d.rendering.view.layout.ViewAndColorbarsLayout;
/**
@@ -44,8 +44,9 @@
* prepared image at the layout given position for this colorbar (which is defined with left/right
* parameters).
*
- *
- * Schema sources
+ * Schema
+ * sources
*
*
Rendering path
*
@@ -60,7 +61,9 @@
*
*
*
- * Schema sources
+ * Schema
+ * sources
*/
public class AWTColorbarLegend extends AWTLegend implements IColorbarLegend {
protected ITickProvider provider;
@@ -70,13 +73,13 @@ public class AWTColorbarLegend extends AWTLegend implements IColorbarLegend {
// without processing multiple time the margin
protected int askedWidth;
protected int askedHeight;
-
+
+ protected int choosenWidth;
+ protected int choosenHeight;
+
protected Font font;
-
- protected boolean usePixelScale = false;
-
+
protected static final int DEFAULT_MARGIN_HEIGHT = 20;
-
public AWTColorbarLegend(Drawable parent, Chart chart) {
this(parent, chart.getView().getAxis().getLayout());
@@ -91,8 +94,7 @@ public AWTColorbarLegend(Drawable parent, AxisLayout layout, Color foreground) {
this(parent, layout.getZTickProvider(), layout.getZTickRenderer(), foreground, null);
}
- public AWTColorbarLegend(Drawable parent, AxisLayout layout, Color foreground,
- Color background) {
+ public AWTColorbarLegend(Drawable parent, AxisLayout layout, Color foreground, Color background) {
this(parent, layout.getZTickProvider(), layout.getZTickRenderer(), foreground, background);
}
@@ -108,8 +110,8 @@ public AWTColorbarLegend(Drawable parent, ITickProvider provider, ITickRenderer
this.renderer = renderer;
this.minimumDimension = new Dimension(AWTColorbarImageGenerator.MIN_BAR_WIDTH,
AWTColorbarImageGenerator.MIN_BAR_HEIGHT);
-
- this.margin.height = DEFAULT_MARGIN_HEIGHT;
+
+ this.margin.setHeight(DEFAULT_MARGIN_HEIGHT);
initImageGenerator(parent, provider, renderer);
}
@@ -120,8 +122,7 @@ protected void initImageGenerator(Drawable parent, ITickProvider provider,
IMultiColorable mc = ((IMultiColorable) parent);
if (mc.getColorMapper() != null) {
imageGenerator = new AWTColorbarImageGenerator(mc.getColorMapper(), provider, renderer);
-
- if(font!=null)
+ if (font != null)
imageGenerator.setFont(font);
}
}
@@ -131,12 +132,46 @@ protected void initImageGenerator(Drawable parent, ITickProvider provider,
}
}
+ @Override
+ public Dimension getMinimumDimension() {
+ return minimumDimension;
+ }
+
@Override
public void render(IPainter painter) {
painter.glEnable_Blend();
super.render(painter);
}
+ /** Pre process an ideal width for the colorbar based on text width and other settings */
+ public void updateMinimumDimension(IPainter painter) {
+ AWTColorbarImageGenerator gen = getImageGenerator();
+
+ // We add the margin width because margin is handled by this viewport
+ // and not included inside the generated image.
+ int w = gen.getPreferredWidth(painter) + margin.getWidth();
+
+
+
+ w = Math.max(0, w);
+
+ if(pixelScale.x>0) {
+ minimumDimension.width = Math.round(w * pixelScale.x);
+
+ // a trick to get a correct emulgl layout
+ if(emulGLUnscale) {
+ minimumDimension.width /= pixelScale.x;
+ }
+
+ }
+ // deal with cases where pixel scale is undefined
+ else {
+ minimumDimension.width = w;
+ }
+ }
+
+ boolean emulGLUnscale = false;
+
@Override
public BufferedImage toImage(int width, int height) {
return toImage(width, height, margin, pixelScale);
@@ -147,33 +182,13 @@ public BufferedImage toImage(int width, int height) {
*
* If running on a HiDPI screen, width and height parameter will grow.
*/
- protected BufferedImage toImage(int width, int height, Dimension margin, Coord2d pixelScale) {
+ protected BufferedImage toImage(int width, int height, Margin margin, Coord2d pixelScale) {
if (imageGenerator != null) {
setGeneratorColors();
-
- int choosenWidth;
- int choosenHeight;
-
- // We here ignore pixel scale as considering it
- // 1. does not improve the final appearance of the
- // colorbar since the Graphics2D instance is already rendering with the
- // expected pixel scale.
- // 2. will lead to a larger image that will be rescaled to fit the area
- // which leads to a visually thinner bar a smaller tick labels for the colorbar
-
- if(usePixelScale) {
- choosenWidth = (int)((width - margin.width) * pixelScale.x);
- choosenHeight = (int)((height - margin.height) * pixelScale.y);
- }
- else {
- choosenWidth = (int) (width - margin.width);
- choosenHeight = (int) (height - margin.height);
- }
-
- //System.out.println("AWTColorbarLegend : asked.w:" + width + " asked.h:" + height + " m.w:" + margin.width + " m.h:" + margin.height + " pixScale:" + pixelScale);
- //System.out.println("AWTColorbarLegend : choosen.w:" + choosenWidth + " choosen.h:" + choosenHeight + " m.w:" + margin.width + " m.h:" + margin.height + " pixScale:" + pixelScale);
-
+
+ choosenWidth = (int) (width - (margin.getWidth() * pixelScale.x));
+ choosenHeight = (int) (height - (margin.getHeight() * pixelScale.y));
askedWidth = width;
askedHeight = height;
@@ -191,33 +206,33 @@ public void updateImage() {
* Update image according to new margin.
*/
@Override
- public void setMargin(Dimension margin) {
+ public void setMargin(Margin margin) {
super.setMargin(margin);
-
- if(getImageGenerator()!=null) {
+
+ if (getImageGenerator() != null) {
updateImage();
}
}
/** Update the image with pixel scale if scale changed */
@Override
- protected void updatePixelScale(Coord2d pixelScale) {
+ public void updatePixelScale(Coord2d pixelScale) {
if (!this.pixelScale.equals(pixelScale)) {
this.pixelScale = pixelScale;
-
- if(getImageGenerator()!=null) {
+
+ if (getImageGenerator() != null) {
getImageGenerator().setPixelScale(pixelScale);
updateImage();
}
}
}
-
+
/** Update image generator font */
public void setFont(Font font) {
- if(!font.equals(this.getFont())) {
+ if (!font.equals(this.getFont())) {
this.font = font;
-
- if(getImageGenerator()!=null) {
+
+ if (getImageGenerator() != null) {
getImageGenerator().setFont(font);
updateImage();
}
@@ -226,10 +241,9 @@ public void setFont(Font font) {
}
public Font getFont() {
- if(getImageGenerator()!=null) {
+ if (getImageGenerator() != null) {
return getImageGenerator().getFont();
- }
- else {
+ } else {
return null;
}
}
@@ -249,11 +263,19 @@ public int getHeight() {
return askedHeight;
}
- public boolean isUsePixelScale() {
- return usePixelScale;
+ public int getChoosenWidth() {
+ return choosenWidth;
+ }
+
+ public int getChoosenHeight() {
+ return choosenHeight;
+ }
+
+ public boolean isEmulGLUnscale() {
+ return emulGLUnscale;
}
- public void setUsePixelScale(boolean usePixelScale) {
- this.usePixelScale = usePixelScale;
+ public void setEmulGLUnscale(boolean emulGLUnscale) {
+ this.emulGLUnscale = emulGLUnscale;
}
}
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/overlay/LegendLayout.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/overlay/LegendLayout.java
index c0eaf2166..7b622f220 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/overlay/LegendLayout.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/overlay/LegendLayout.java
@@ -1,11 +1,11 @@
package org.jzy3d.plot3d.rendering.legends.overlay;
+import org.jzy3d.maths.Margin;
+
public class LegendLayout {
- /** External margin : distance between legend border canvas border. */
- protected int boxMarginX = 5;
- /** External margin : distance between legend border canvas border. */
- protected int boxMarginY = 5;
+ protected Margin margin = new Margin(10,10);
+
/** Legend position. */
protected Corner corner = Corner.TOP_LEFT;
@@ -13,20 +13,12 @@ public enum Corner {
TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT
}
- public int getBoxMarginX() {
- return boxMarginX;
- }
-
- public void setBoxMarginX(int boxMarginX) {
- this.boxMarginX = boxMarginX;
- }
-
- public int getBoxMarginY() {
- return boxMarginY;
+ public Margin getMargin() {
+ return margin;
}
- public void setBoxMarginY(int boxMarginY) {
- this.boxMarginY = boxMarginY;
+ public void setMargin(Margin margin) {
+ this.margin = margin;
}
public Corner getCorner() {
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/overlay/OverlayLegendRenderer.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/overlay/OverlayLegendRenderer.java
index 4dd377697..a9f66d28a 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/overlay/OverlayLegendRenderer.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/overlay/OverlayLegendRenderer.java
@@ -51,18 +51,29 @@ public void paint(Graphics g, int canvasWidth, int canvasHeight) {
int textWidthMax = maxStringWidth(fm);
// Box dimensions
- int xBoxPos = layout.boxMarginX;
- int yBoxPos = layout.boxMarginY;
+
int boxWidth = layout.txtMarginX + textWidthMax + layout.sampleLineMargin
+ layout.sampleLineLength + layout.txtMarginX;
int boxHeight = layout.txtMarginY + (textHeight + layout.txtInterline) * (info.size() - 1)
+ textHeight + layout.txtMarginY;
+
+ // Box offset to apply margins
+
+ // horizontal left
+ int xBoxPos = Math.round(layout.getMargin().getLeft());
+
+ // horizontal right
if (Corner.TOP_RIGHT.equals(layout.corner) || Corner.BOTTOM_RIGHT.equals(layout.corner)) {
- xBoxPos = canvasWidth - layout.boxMarginX - boxWidth;
+ xBoxPos = Math.round(canvasWidth - layout.getMargin().getRight() - boxWidth);
}
+
+ // vertical top
+ int yBoxPos = Math.round(layout.getMargin().getTop());
+
+ // vertical bottom
if (Corner.BOTTOM_LEFT.equals(layout.corner) || Corner.BOTTOM_RIGHT.equals(layout.corner)) {
- yBoxPos = canvasHeight - layout.boxMarginY - boxHeight;
+ yBoxPos = Math.round(canvasHeight - layout.getMargin().getBottom() - boxHeight);
}
// Background
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/AWTSerieLegend.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/AWTSerieLegend.java
index 9812824c1..d95e3276f 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/AWTSerieLegend.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/AWTSerieLegend.java
@@ -144,5 +144,10 @@ public int getHeight() {
return askedHeight;
}
+ @Override
+ public void updateMinimumDimension(IPainter painter) {
+
+ }
+
}
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/AWTSeriesLegend.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/AWTSeriesLegend.java
index 6a0290496..b1cd5369b 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/AWTSeriesLegend.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/AWTSeriesLegend.java
@@ -162,4 +162,9 @@ public int getHeight() {
return askedHeight;
}
+ @Override
+ public void updateMinimumDimension(IPainter painter) {
+
+ }
+
}
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/ViewAndLegendLayout.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/ViewAndLegendLayout.java
index 93a0c3f2e..6b3d485f1 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/ViewAndLegendLayout.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/legends/series/ViewAndLegendLayout.java
@@ -13,6 +13,7 @@
import org.jzy3d.plot3d.rendering.view.ViewportMode;
import org.jzy3d.plot3d.rendering.view.layout.IViewportLayout;
+@Deprecated
public class ViewAndLegendLayout implements IViewportLayout {
protected float screenSeparator = 1.0f;
protected boolean hasMeta = true;
@@ -22,6 +23,9 @@ public class ViewAndLegendLayout implements IViewportLayout {
protected ViewportConfiguration sceneViewPort;
protected ViewportConfiguration backgroundViewPort;
+ protected Chart chart;
+
+
@Override
public void update(Chart chart) {
final Scene scene = chart.getScene();
@@ -59,8 +63,6 @@ public void render(IPainter painter, Chart chart) {
renderLegends(painter, screenSeparator, 1.0f, legends, chart.getCanvas());
view.renderOverlay(view.getCamera().getLastViewPort());
-
- // showLayout((AWTView)view);
}
protected void renderLegends(IPainter painter, float left, float right, List data,
@@ -71,17 +73,4 @@ protected void renderLegends(IPainter painter, float left, float right, List 0) pencil.drawRect(null,
- * zone1.x, zone1.y, zone1.width, zone1.height, true); if (zone2.width > 0) pencil.drawRect(null,
- * zone2.x, zone2.y, zone2.width, zone2.height, true); }
- *
- * CanvasAWT pencil = null; }; view.addRenderer2d(layoutBorder); }
- */
-
-
}
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTImageRenderer.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTImageRenderer.java
index f1eb5e2df..a023f565f 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTImageRenderer.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTImageRenderer.java
@@ -38,20 +38,18 @@ public void paint(Graphics g, int canvasWidth, int canvasHeight) {
int y = 0;
if (Corner.TOP_LEFT.equals(layout.getCorner())) {
- x = layout.getBoxMarginX();
- y = layout.getBoxMarginY();
+ x = layout.getMargin().getLeft();
+ y = layout.getMargin().getTop();
} else if (Corner.TOP_RIGHT.equals(layout.getCorner())) {
- x = canvasWidth - imageWidth - layout.getBoxMarginX();
- y = layout.getBoxMarginY();
+ x = canvasWidth - imageWidth - layout.getMargin().getRight();
+ y = layout.getMargin().getTop();
} else if (Corner.BOTTOM_LEFT.equals(layout.getCorner())) {
- x = layout.getBoxMarginX();
- y = canvasHeight - imageHeight - layout.getBoxMarginY();
+ x = layout.getMargin().getLeft();
+ y = canvasHeight - imageHeight - layout.getMargin().getBottom();
} else if (Corner.BOTTOM_RIGHT.equals(layout.getCorner())) {
- x = canvasWidth - imageWidth - layout.getBoxMarginX();
- y = canvasHeight - imageHeight - layout.getBoxMarginY();
+ x = canvasWidth - imageWidth - layout.getMargin().getRight();
+ y = canvasHeight - imageHeight - layout.getMargin().getBottom();
}
-
-
g2d.drawImage(image, x, y, null);
}
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTImageViewport.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTImageViewport.java
index bdb7def22..456028a29 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTImageViewport.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTImageViewport.java
@@ -1,10 +1,12 @@
package org.jzy3d.plot3d.rendering.view;
import java.awt.Image;
+import java.awt.image.BufferedImage;
import java.nio.ByteBuffer;
import org.jzy3d.maths.Coord2d;
import org.jzy3d.maths.Coord3d;
import org.jzy3d.maths.Dimension;
+import org.jzy3d.maths.Margin;
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.rendering.image.AWTImageConvert;
@@ -14,15 +16,14 @@
* @author Martin Pernollet
*/
public class AWTImageViewport extends AbstractViewportManager implements IImageViewport {
- protected static final float IMAGE_Z = 0;
protected ByteBuffer imageData = null;
- protected Image image;
+ protected BufferedImage image;
protected int imageHeight;
protected int imageWidth;
-
- protected Dimension margin = new Dimension(0,0); // no margin by default
- protected Coord2d pixelScale = new Coord2d(1,1); // assume default pixel scale
+
+ protected Margin margin = new Margin(0, 0, 0, 0); // no margin by default
+ protected Coord2d pixelScale = new Coord2d(1, 1); // assume default pixel scale
public AWTImageViewport() {
setViewportMode(ViewportMode.RECTANGLE_NO_STRETCH);
@@ -44,52 +45,87 @@ public void render(IPainter painter) {
painter.glPushMatrix();
painter.glLoadIdentity();
- renderImage(painter, imageData, imageWidth, imageHeight, screenWidth,
- screenHeight, IMAGE_Z);
+ renderImage(painter);
// Restore matrices state
painter.glPopMatrix();
painter.glMatrixMode_Projection();
painter.glPopMatrix();
}
-
- protected void renderImage(IPainter painter, ByteBuffer imageBuffer, int imageWidth, int imageHeight,
- int screenWidth, int screenHeight, float z) {
- if (imageBuffer == null)
+
+ protected void renderImage(IPainter painter) {
+ if (imageData == null)
return;
- float xZoom = 1;
- float yZoom = 1;
- int xPosition = 0;
- int yPosition = 0;
-
- if (imageWidth < screenWidth)
- xPosition = (int) ((float) screenWidth / 2 - (float) imageWidth / 2);
- else
- xZoom = ((float) screenWidth) / ((float) imageWidth);
-
- if (imageHeight < screenHeight)
- yPosition = (int) ((float) screenHeight / 2 - (float) imageHeight / 2);
- else
- yZoom = ((float) screenHeight) / ((float) imageHeight);
-
- //System.out.println("AWTImageViewport posi.x:" + xPosition + " posi.y:" + xPosition);
- //System.out.println("AWTImageViewport zoom.x:" + xZoom + " zoom.y:" + yZoom);
- //System.out.println("AWTImageViewport size.x:" + imageWidth + " size.y:" + imageHeight);
-
+ ImageLayout iLayout = computeLayout(painter);
+
// Draw
-
- Coord2d zoom = new Coord2d(xZoom, yZoom);
- Coord3d position = new Coord3d(xPosition, yPosition, z);
-
- painter.drawImage(imageBuffer, imageWidth, imageHeight, zoom, position);
+
+ painter.drawImage(imageData, imageWidth, imageHeight, iLayout.zoom, iLayout.position);
+ }
+
+ /**
+ * Compute the position of the image in this viewport based on the image dimensions, the viewport
+ * dimensions and the margin.
+ */
+ protected ImageLayout computeLayout(IPainter painter) {
+ Coord2d scale = painter.getCanvas().getPixelScale();
+ ImageLayout iLayout = new ImageLayout();
+
+
+ // If image is smaller than viewport, move it a bit to let it appear in the center
+ if (imageWidth < screenWidth) {
+ // inspired by View2DLayout_Debug which is accurate
+ iLayout.position.x =
+ Math.round((screenWidth - (imageWidth + (margin.getWidth() * scale.x))) / 2f);
+ iLayout.position.x += (margin.getLeft() * scale.x);
+
+ }
+ // Else if image is bigger than viewport, unzoom it a bit to let it fit the dimensions
+ else if (imageWidth > screenWidth) {
+ iLayout.zoom.x = ((float) screenWidth) / ((float) imageWidth);
+ }
+ // If exact fit, keep default values
+
+ // If image is smaller than viewport, move it a bit to let it appear in the center
+ if (imageHeight < screenHeight) {
+ iLayout.position.y =
+ Math.round((screenHeight - (imageHeight + (margin.getHeight() * scale.y))) / 2f);
+ iLayout.position.y += (margin.getBottom() * scale.y);
+ }
+ // If image is bigger than viewport, unzoom it a bit to let it fit the dimensions
+ else if (imageWidth > screenWidth) {
+ iLayout.zoom.y = ((float) screenHeight) / ((float) imageHeight);
+ }
+ // If exact fit, keep default value
+
+ // System.out.println("AWTImageViewport posi.x:" + xPosition + " posi.y:" + xPosition);
+ // System.out.println("AWTImageViewport zoom.x:" + xZoom + " zoom.y:" + yZoom);
+ // System.out.println("AWTImageViewport size.x:" + imageWidth + " size.y:" + imageHeight);
+ return iLayout;
+ }
+
+ public class ImageLayout {
+ protected static final float IMAGE_Z = 0;
+
+ public Coord2d zoom = new Coord2d(1, 1);
+ public Coord3d position = new Coord3d(0, 0, IMAGE_Z);
}
+
+ /**
+ * Update internal pixel scale knowledge. Called by render loop and provided by painter's view.
+ * May be overrided to update the image.
+ */
+ @Override
+ public void updatePixelScale(Coord2d pixelScale) {
+ this.pixelScale = pixelScale;
+ }
- /** Update internal pixel scale knowledge. Called by render loop and provided by painter's view. May be overrided to update the image. */
- protected void updatePixelScale(Coord2d pixelScale) {
- this.pixelScale = pixelScale ;
+ @Override
+ public Coord2d getPixelScale() {
+ return this.pixelScale;
}
/**
@@ -97,7 +133,7 @@ protected void updatePixelScale(Coord2d pixelScale) {
*
* @param image
*/
- public void setImage(Image image, int width, int height) {
+ public void setImage(BufferedImage image, int width, int height) {
if (image != null) {
synchronized (image) {
ByteBuffer b = AWTImageConvert.getImageAsByteBuffer(image, width, height);
@@ -106,14 +142,14 @@ public void setImage(Image image, int width, int height) {
}
}
- public void setImage(Image image, int width, int height, ByteBuffer buffer) {
+ public void setImage(BufferedImage image, int width, int height, ByteBuffer buffer) {
this.image = image;
this.imageHeight = height;
this.imageWidth = width;
this.imageData = buffer;
}
- public void setImage(Image image) {
+ public void setImage(BufferedImage image) {
if (image != null) {
setImage(image, image.getWidth(null), image.getHeight(null));
}
@@ -122,7 +158,7 @@ public void setImage(Image image) {
/**
* Return the image rendered by the {@link AWTImageViewport}
*/
- public Image getImage() {
+ public BufferedImage getImage() {
return image;
}
@@ -132,11 +168,11 @@ public Dimension getMinimumDimension() {
return new Dimension(0, 0);
}
- public Dimension getMargin() {
+ public Margin getMargin() {
return margin;
}
- public void setMargin(Dimension margin) {
+ public void setMargin(Margin margin) {
this.margin = margin;
}
}
diff --git a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTShapeRenderer.java b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTShapeRenderer.java
index 536ff9a92..0945f6fea 100644
--- a/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTShapeRenderer.java
+++ b/jzy3d-core-awt/src/main/java/org/jzy3d/plot3d/rendering/view/AWTShapeRenderer.java
@@ -42,18 +42,19 @@ public void paint(Graphics g, int canvasWidth, int canvasHeight) {
int y = 0;
if (Corner.TOP_LEFT.equals(layout.getCorner())) {
- x = layout.getBoxMarginX() + shapeWidth/2;
- y = layout.getBoxMarginY();
+ x = layout.getMargin().getLeft();
+ y = layout.getMargin().getTop();
} else if (Corner.TOP_RIGHT.equals(layout.getCorner())) {
- x = canvasWidth - shapeWidth/2 - layout.getBoxMarginX();
- y = layout.getBoxMarginY();
+ x = canvasWidth - shapeWidth/2 - layout.getMargin().getRight();
+ y = layout.getMargin().getTop();
} else if (Corner.BOTTOM_LEFT.equals(layout.getCorner())) {
- x = layout.getBoxMarginX() + shapeWidth/2;
- y = canvasHeight - shapeHeight/2 - layout.getBoxMarginY();
+ x = layout.getMargin().getLeft();
+ y = canvasHeight - shapeHeight/2 - layout.getMargin().getBottom();
} else if (Corner.BOTTOM_RIGHT.equals(layout.getCorner())) {
- x = canvasWidth - shapeWidth/2 - layout.getBoxMarginX();
- y = canvasHeight - shapeHeight/2 - layout.getBoxMarginY();
+ x = canvasWidth - shapeWidth/2 - layout.getMargin().getRight();
+ y = canvasHeight - shapeHeight/2 - layout.getMargin().getBottom();
}
+
g2d.setColor(AWTColor.toAWT(color));
g2d.translate(x, y);
diff --git a/jzy3d-core-awt/src/test/java/org/jzy3d/plot2d/primitive/TestAWTColorbarImageGenerator.java b/jzy3d-core-awt/src/test/java/org/jzy3d/plot2d/primitive/TestAWTColorbarImageGenerator.java
new file mode 100644
index 000000000..5266b72c5
--- /dev/null
+++ b/jzy3d-core-awt/src/test/java/org/jzy3d/plot2d/primitive/TestAWTColorbarImageGenerator.java
@@ -0,0 +1,59 @@
+package org.jzy3d.plot2d.primitive;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.jzy3d.colors.ColorMapper;
+import org.jzy3d.colors.colormaps.ColorMapRainbow;
+import org.jzy3d.maths.Coord2d;
+import org.jzy3d.mocks.jzy3d.Mocks;
+import org.jzy3d.painters.Font;
+import org.jzy3d.painters.IPainter;
+import org.jzy3d.plot3d.primitives.axis.layout.providers.ITickProvider;
+import org.jzy3d.plot3d.primitives.axis.layout.providers.RegularTickProvider;
+import org.jzy3d.plot3d.primitives.axis.layout.renderers.DefaultDecimalTickRenderer;
+import org.jzy3d.plot3d.primitives.axis.layout.renderers.ITickRenderer;
+import org.mockito.Mockito;
+
+public class TestAWTColorbarImageGenerator {
+ @Test
+ public void whenPixelScaleLargerThan1_ThenBarWidthIsScaled() {
+ int TEXT_WIDTH = 10;
+
+ // Given
+ ColorMapper mapper = new ColorMapper(new ColorMapRainbow(), -1, 1);
+ ITickRenderer renderer = new DefaultDecimalTickRenderer();
+ ITickProvider provider = new RegularTickProvider();
+
+ AWTColorbarImageGenerator gen = new AWTColorbarImageGenerator(mapper, provider, renderer);
+
+ // Given a mock painter returning 10 pix width for any string & font
+ IPainter painter = Mocks.Painter();
+ Mockito.when(painter.getTextLengthInPixels(Mockito.any(), Mockito.any())).thenReturn(TEXT_WIDTH);
+ //Mockito.when(painter.getTextLengthInPixels(Font.Helvetica_12, "-1,00000")).thenReturn(20);
+
+ // When
+ int scale = 1;
+ int barWidth = 30;
+ int TEXT_TO_BAR = 2;
+
+ gen.setPixelScale(new Coord2d(scale, scale));
+
+ gen.toImage(1, 1, barWidth);
+
+ // Then
+ Assert.assertEquals(barWidth, gen.getScaledBarWidth());
+ Assert.assertEquals(TEXT_TO_BAR, gen.getTextToBarHorizontalMargin());
+ Assert.assertEquals(barWidth+TEXT_WIDTH+TEXT_TO_BAR, gen.getPreferredWidth(painter));
+
+ // When pixel scale
+ scale = 2;
+
+ gen.setPixelScale(new Coord2d(scale, scale));
+
+ gen.toImage(1, 1, barWidth);
+
+ // Then preferred width adapts
+ Assert.assertEquals(barWidth * scale, gen.getScaledBarWidth());
+ Assert.assertEquals(barWidth + TEXT_WIDTH / scale + TEXT_TO_BAR, gen.getPreferredWidth(painter));
+ }
+}
diff --git a/jzy3d-core-awt/src/test/java/org/jzy3d/plot3d/rendering/legends/colorbars/TestAWTColorbarLegend.java b/jzy3d-core-awt/src/test/java/org/jzy3d/plot3d/rendering/legends/colorbars/TestAWTColorbarLegend.java
index b5b1b0424..c79ba5705 100644
--- a/jzy3d-core-awt/src/test/java/org/jzy3d/plot3d/rendering/legends/colorbars/TestAWTColorbarLegend.java
+++ b/jzy3d-core-awt/src/test/java/org/jzy3d/plot3d/rendering/legends/colorbars/TestAWTColorbarLegend.java
@@ -3,9 +3,14 @@
import org.junit.Assert;
import org.junit.Test;
import org.jzy3d.maths.Coord2d;
-import org.jzy3d.maths.Dimension;
+import org.jzy3d.maths.Margin;
+import org.jzy3d.mocks.jzy3d.Mocks;
+import org.jzy3d.painters.IPainter;
+import org.jzy3d.plot2d.primitive.AWTColorbarImageGenerator;
import org.jzy3d.plot3d.primitives.SampleGeom;
import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
+import org.jzy3d.plot3d.rendering.view.View;
+import org.mockito.Mockito;
/**
* //tester toute l'api //dimension //size // //legend.getBackground() //legend.setFont(font);
@@ -29,9 +34,8 @@ public void whenLegendViewportDimensionSet_ThenDisplayedImageIsSmallerAccordingT
// When setting viewport to a size and having a non 0 margin
- Dimension margin = legend.getMargin();
- margin.width = 2;
- margin.height = 2;
+ Margin margin = legend.getMargin();
+ margin.set(2,2); // 1 pixel margin each side
int width = 300;
int height = 600;
@@ -42,7 +46,7 @@ public void whenLegendViewportDimensionSet_ThenDisplayedImageIsSmallerAccordingT
// Then actual image width is smaller according to horizontal margin
int actualImageWidth = legend.getImage().getWidth(null);
- int expectWidth = (int) (width * (right - left)) - margin.width;
+ int expectWidth = Math.round(width * (right - left) - margin.getWidth());
Assert.assertEquals(expectWidth, actualImageWidth, DELTA);
// ------------------------
@@ -54,29 +58,61 @@ public void whenLegendViewportDimensionSet_ThenDisplayedImageIsSmallerAccordingT
Assert.assertEquals(expectWidth, legend.getImage().getWidth(null), DELTA);
// ------------------------
- // By default, configuration states to ignore pixel scale
-
- Assert.assertFalse(legend.isUsePixelScale());
-
- // ------------------------
- // When updating pixel scale with an ignored pixel scale
+ // When updating pixel scale with a NON ignored pixel scale
+
+ int SCALE = 2;
- legend.updatePixelScale(new Coord2d(2, 2));
+ //legend.setUsePixelScale(true);
+ legend.updatePixelScale(new Coord2d(SCALE, SCALE));
legend.updateImage();
- // Then image size remains the same
+ // Then image size is a bit smaller since margin is multiplied by pixel scale
+ expectWidth = Math.round(width * (right - left) - margin.getWidth()*SCALE);
Assert.assertEquals(expectWidth, legend.getImage().getWidth(null), DELTA);
+
// ------------------------
- // When updating pixel scale
+ // When getting legend min dim before rendering
+ // Then dimension is default
+
+ Assert.assertEquals(AWTColorbarImageGenerator.MIN_BAR_WIDTH, legend.getMinimumDimension().width);
- legend.setUsePixelScale(true);
- legend.updatePixelScale(new Coord2d(2, 2));
- legend.updateImage();
+ // -----------------------------------
+ // Given a 20 px text width
+
+ int TEXT_WIDTH = 20;
+
+ View v = Mocks.ViewAndPainter(SCALE);
+ IPainter painter = v.getPainter();
+ Mockito.when(painter.getTextLengthInPixels(Mockito.any(), Mockito.any())).thenReturn(TEXT_WIDTH);
+
+ // -----------------
+ // When rendering with a painter computing static text width
+ legend.setEmulGLUnscale(false);
+ legend.updateMinimumDimension(painter);
- // Then image size is doubled
- Assert.assertEquals(expectWidth * 2, legend.getImage().getWidth(null), DELTA);
+ // Then min dim is updated according to pixel scale
+ expectWidth = AWTColorbarImageGenerator.BAR_WIDTH_DEFAULT; // 30
+ expectWidth += AWTColorbarImageGenerator.TEXT_TO_BAR_DEFAULT; // 2
+ expectWidth += TEXT_WIDTH / SCALE;
+ Assert.assertEquals((expectWidth+margin.getWidth()) * SCALE, legend.getMinimumDimension().width);
+
+ legend.updateImage();
+ //System.out.println("Legend width : " + legend.getImage().getWidth());
+
+ // -----------------
+ // When rendering for EmulGL
+ legend.setEmulGLUnscale(true);
+ legend.updateMinimumDimension(painter);
+
+ // Then min dim is updated without considering pixel scale
+ Assert.assertEquals((expectWidth+margin.getWidth()) * 1, legend.getMinimumDimension().width);
+
+ legend.updateImage();
+ //System.out.println(legend.getImage().getWidth());
+
+
}
public void whenViewportSmallerThanMinWidth_ThenImageIsSizedAtMinWidth() {
@@ -101,5 +137,4 @@ public void whenViewportSmallerThanMinWidth_ThenImageIsSizedAtMinWidth() {
Assert.assertEquals(MIN_WIDTH, actualWidth);
}
-
}
diff --git a/jzy3d-core/pom.xml b/jzy3d-core/pom.xml
index b1ff6e867..c903fe8d5 100644
--- a/jzy3d-core/pom.xml
+++ b/jzy3d-core/pom.xml
@@ -47,7 +47,6 @@
com.diogonunes
JColor
- 5.2.0
diff --git a/jzy3d-core/src/main/java/org/jzy3d/chart/Chart.java b/jzy3d-core/src/main/java/org/jzy3d/chart/Chart.java
index 50ebf75f4..e326837a5 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/chart/Chart.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/chart/Chart.java
@@ -38,9 +38,14 @@
import org.jzy3d.plot3d.rendering.canvas.ICanvas;
import org.jzy3d.plot3d.rendering.canvas.IScreenCanvas;
import org.jzy3d.plot3d.rendering.canvas.Quality;
+import org.jzy3d.plot3d.rendering.legends.ILegend;
+import org.jzy3d.plot3d.rendering.legends.colorbars.IColorbarLegend;
import org.jzy3d.plot3d.rendering.lights.Light;
+import org.jzy3d.plot3d.rendering.scene.Scene;
import org.jzy3d.plot3d.rendering.view.View;
import org.jzy3d.plot3d.rendering.view.ViewportMode;
+import org.jzy3d.plot3d.rendering.view.layout.IViewportLayout;
+import org.jzy3d.plot3d.rendering.view.layout.ViewAndColorbarsLayout;
import org.jzy3d.plot3d.rendering.view.lod.LODCandidates;
import org.jzy3d.plot3d.rendering.view.lod.LODPerf;
import org.jzy3d.plot3d.rendering.view.lod.LODSetting;
@@ -67,7 +72,7 @@ public class Chart {
protected IChartFactory factory;
protected Quality quality;
- protected ChartScene scene;
+ protected Scene scene;
protected View view;
protected ICanvas canvas;
@@ -138,19 +143,21 @@ public Chart view2d() {
View view = getView();
// Remember 3D layout
- axisZTickLabelDisplayed = axisLayout.isZTickLabelDisplayed();
- axisYLabelOrientation = axisLayout.getYAxisLabelOrientation();
- axisZLabelDisplayed = axisLayout.isZAxeLabelDisplayed();
- isTickLineDisplayed = axisLayout.isTickLineDisplayed();
-
- isSquaredViewActive = view.getSquared();
- viewPositionMode = view.getViewMode();
- viewportMode = view.getCamera().getViewportMode();
- viewpoint = view.getViewPoint();
+ if(view.is3D()) {
+ axisZTickLabelDisplayed = axisLayout.isZTickLabelDisplayed();
+ axisYLabelOrientation = axisLayout.getYAxisLabelOrientation();
+ axisZLabelDisplayed = axisLayout.isZAxisLabelDisplayed();
+ isTickLineDisplayed = axisLayout.isTickLineDisplayed();
+
+ isSquaredViewActive = view.getSquared();
+ viewPositionMode = view.getViewMode();
+ viewportMode = view.getCamera().getViewportMode();
+ viewpoint = view.getViewPoint().clone();
+ }
// Apply 2D layout to axis
axisLayout.setTickLineDisplayed(false);
- axisLayout.setZAxeLabelDisplayed(false);
+ axisLayout.setZAxisLabelDisplayed(false);
axisLayout.setZTickLabelDisplayed(false);
axisLayout.setYAxisLabelOrientation(LabelOrientation.VERTICAL);
@@ -174,7 +181,7 @@ public Chart view2d() {
protected boolean isSquaredViewActive = true;
protected ViewPositionMode viewPositionMode = ViewPositionMode.FREE;
protected ViewportMode viewportMode = ViewportMode.RECTANGLE_NO_STRETCH;
- protected Coord3d viewpoint = View.VIEWPOINT_DEFAULT;
+ protected Coord3d viewpoint = View.VIEWPOINT_DEFAULT.clone();
public Chart view3d() {
AxisLayout axisLayout = getAxisLayout();
@@ -184,7 +191,7 @@ public Chart view3d() {
axisLayout.setYAxisLabelOrientation(axisYLabelOrientation);
}
- axisLayout.setZAxeLabelDisplayed(axisZLabelDisplayed);
+ axisLayout.setZAxisLabelDisplayed(axisZLabelDisplayed);
axisLayout.setZTickLabelDisplayed(axisZTickLabelDisplayed);
axisLayout.setTickLineDisplayed(isTickLineDisplayed);
@@ -213,11 +220,6 @@ public IFrame display(Rectangle rectangle, String title) {
return getFactory().getPainterFactory().newFrame(this, rectangle, title);
}
- public void clear() {
- scene.clear();
- view.shoot();
- }
-
public void dispose() {
setAnimated(false);
@@ -237,6 +239,12 @@ public void render() {
view.shoot();
}
+ public void render(int n) {
+ for (int i = 0; i < n; i++) {
+ render();
+ }
+ }
+
public void setAnimated(boolean status) {
getQuality().setAnimated(status);
@@ -1016,7 +1024,7 @@ public View getView() {
return view;
}
- public ChartScene getScene() {
+ public Scene getScene() {
return scene;
}
@@ -1044,5 +1052,31 @@ public void setQuality(Quality quality) {
this.quality = quality;
}
+ /** Return the first available colorbar in the view layout, or null if none was created */
+ public IColorbarLegend getColorbar() {
+ ViewAndColorbarsLayout viewportLayout = (ViewAndColorbarsLayout) getView().getLayout();
+ if(viewportLayout.getChart()==null) {
+ viewportLayout.setChart(this);
+ }
+
+ List legends = getLegends();
+
+ /*if(legends.size()==0) {
+ view.getLayout().update(this);
+ legends = getLegends();
+ }*/
+
+ for(ILegend legend : legends) {
+ if(legend instanceof IColorbarLegend) {
+ return (IColorbarLegend)legend;
+ }
+ }
+ return null;
+ }
+
+ public List getLegends() {
+ ViewAndColorbarsLayout viewportLayout = (ViewAndColorbarsLayout) getView().getLayout();
+ return viewportLayout.getLegends();
+ }
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/chart/ChartScene.java b/jzy3d-core/src/main/java/org/jzy3d/chart/ChartScene.java
index 692bd4102..756d32c70 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/chart/ChartScene.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/chart/ChartScene.java
@@ -15,6 +15,7 @@
*
* @author Martin Pernollet
*/
+@Deprecated
public class ChartScene extends Scene {
public ChartScene(boolean graphsort, IChartFactory factory) {
super(factory, graphsort);
diff --git a/jzy3d-core/src/main/java/org/jzy3d/chart/ChartView.java b/jzy3d-core/src/main/java/org/jzy3d/chart/ChartView.java
index 18e043973..f72310dad 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/chart/ChartView.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/chart/ChartView.java
@@ -17,7 +17,6 @@
* @author Martin Pernollet
*/
public class ChartView extends View {
-
public ChartView(IChartFactory factory, Scene scene, ICanvas canvas, Quality quality) {
super(factory, scene, canvas, quality);
}
@@ -46,20 +45,9 @@ public void render() {
if (dimensionDirty)
dimensionDirty = false;
}
- }
-
-
- /* */
+
+ fireViewLifecycleHasRendered(null);
- public IViewportLayout getLayout() {
- return layout;
}
-
- public void setLayout(IViewportLayout layout) {
- this.layout = layout;
- }
-
-
- protected IViewportLayout layout;
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/chart/factories/ChartFactory.java b/jzy3d-core/src/main/java/org/jzy3d/chart/factories/ChartFactory.java
index 14a2d896b..4f022cf5b 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/chart/factories/ChartFactory.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/chart/factories/ChartFactory.java
@@ -3,7 +3,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jzy3d.chart.Chart;
-import org.jzy3d.chart.ChartScene;
import org.jzy3d.chart.ChartView;
import org.jzy3d.chart.controllers.thread.camera.CameraThreadController;
import org.jzy3d.chart.controllers.thread.camera.CameraThreadControllerWithTime;
@@ -77,8 +76,8 @@ public Chart newChart(IChartFactory factory, Quality quality) {
}
@Override
- public ChartScene newScene(boolean sort) {
- return new ChartScene(sort, getFactory());
+ public Scene newScene(boolean sort) {
+ return new Scene(getFactory(), sort);
}
@Override
diff --git a/jzy3d-core/src/main/java/org/jzy3d/chart/factories/IChartFactory.java b/jzy3d-core/src/main/java/org/jzy3d/chart/factories/IChartFactory.java
index 30be1fbc7..00a99b309 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/chart/factories/IChartFactory.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/chart/factories/IChartFactory.java
@@ -1,7 +1,6 @@
package org.jzy3d.chart.factories;
import org.jzy3d.chart.Chart;
-import org.jzy3d.chart.ChartScene;
import org.jzy3d.chart.controllers.thread.camera.CameraThreadController;
import org.jzy3d.maths.BoundingBox3d;
import org.jzy3d.maths.Coord3d;
@@ -30,7 +29,7 @@ public interface IChartFactory {
public Chart newChart(IChartFactory factory, Quality quality);
- public ChartScene newScene(boolean sort);
+ public Scene newScene(boolean sort);
public Graph newGraph(Scene scene, AbstractOrderingStrategy strategy, boolean sort);
diff --git a/jzy3d-core/src/main/java/org/jzy3d/events/IViewLifecycleEventListener.java b/jzy3d-core/src/main/java/org/jzy3d/events/IViewLifecycleEventListener.java
index b3cc54b31..858b80aab 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/events/IViewLifecycleEventListener.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/events/IViewLifecycleEventListener.java
@@ -4,4 +4,6 @@ public interface IViewLifecycleEventListener {
public void viewHasInit(ViewLifecycleEvent e);
public void viewWillRender(ViewLifecycleEvent e);
+
+ public void viewHasRendered(ViewLifecycleEvent e);
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/events/ViewLifecycleAdapter.java b/jzy3d-core/src/main/java/org/jzy3d/events/ViewLifecycleAdapter.java
index 1b23a182b..e24ec1edf 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/events/ViewLifecycleAdapter.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/events/ViewLifecycleAdapter.java
@@ -10,4 +10,9 @@ public void viewHasInit(ViewLifecycleEvent e) {
public void viewWillRender(ViewLifecycleEvent e) {
}
+ @Override
+ public void viewHasRendered(ViewLifecycleEvent e) {
+
+ }
+
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/maths/Coord2d.java b/jzy3d-core/src/main/java/org/jzy3d/maths/Coord2d.java
index 340014340..e3ec11a41 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/maths/Coord2d.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/maths/Coord2d.java
@@ -18,6 +18,9 @@ public class Coord2d implements Serializable {
private static final long serialVersionUID = 3968428005200709871L;
/** The origin is a Coord2d having value 0 for each dimension. */
public static final Coord2d ORIGIN = new Coord2d(0.0f, 0.0f);
+
+ public static final Coord2d IDENTITY = new Coord2d(1.0f, 1.0f);
+
/** An invalid Coord2d has value NaN for each dimension. */
public static final Coord2d INVALID = new Coord2d(Float.NaN, Float.NaN);
diff --git a/jzy3d-core/src/main/java/org/jzy3d/maths/Dimension.java b/jzy3d-core/src/main/java/org/jzy3d/maths/Dimension.java
index aa38e4690..27901085f 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/maths/Dimension.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/maths/Dimension.java
@@ -14,4 +14,8 @@ public Dimension(int width, int height) {
this.width = width;
this.height = height;
}
+
+ public String toString() {
+ return "width:" + width + " height:" + height;
+ }
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/maths/Margin.java b/jzy3d-core/src/main/java/org/jzy3d/maths/Margin.java
new file mode 100644
index 000000000..10758271a
--- /dev/null
+++ b/jzy3d-core/src/main/java/org/jzy3d/maths/Margin.java
@@ -0,0 +1,126 @@
+package org.jzy3d.maths;
+
+import java.util.Objects;
+
+public class Margin {
+ protected int left = 0;
+ protected int right = 0;
+ protected int top = 0;
+ protected int bottom = 0;
+
+ public Margin() {
+ }
+
+ public Margin(int width, int height) {
+ set(width, height);
+ }
+
+ public Margin(int left, int right, int top, int bottom) {
+ set(left, right, top, bottom);
+ }
+
+ public Margin(float left, float right, float top, float bottom) {
+ set(Math.round(left), Math.round(right), Math.round(top), Math.round(bottom));
+ }
+
+ /**
+ * Set left and right margin to width/2, top and bottom margin to height/2.
+ */
+ public void set(int width, int height) {
+ setWidth(width);
+ setHeight(height);
+ }
+
+ public void set(int left, int right, int top, int bottom) {
+ this.left = left;
+ this.right = right;
+ this.top = top;
+ this.bottom = bottom;
+ }
+
+ /**
+ * Set top and bottom margin to height/2.
+ */
+
+ public void setHeight(int height) {
+ setTop(height/2);
+ setBottom(height/2);
+ }
+
+ /**
+ * Set left and right margin to width/2.
+ */
+ public void setWidth(int width) {
+ setLeft(width/2);
+ setRight(width/2);
+ }
+
+ /**
+ * Return the sum of left and right margin
+ */
+ public int getWidth() {
+ return left+right;
+ }
+
+ /**
+ * Return the sum of left and right margin
+ */
+ public int getHeight() {
+ return top+bottom;
+ }
+
+ public int getLeft() {
+ return left;
+ }
+
+ public void setLeft(int left) {
+ this.left = left;
+ }
+
+ public int getRight() {
+ return right;
+ }
+
+ public void setRight(int right) {
+ this.right = right;
+ }
+
+ public int getTop() {
+ return top;
+ }
+
+ public void setTop(int top) {
+ this.top = top;
+ }
+
+ public int getBottom() {
+ return bottom;
+ }
+
+ public void setBottom(int bottom) {
+ this.bottom = bottom;
+ }
+
+ public String toString() {
+ return "left:" + left + " right:" + right + " top:" + top + " bottom:" + bottom;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(bottom, left, right, top);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Margin other = (Margin) obj;
+ return bottom == other.bottom && left == other.left && right == other.right && top == other.top;
+ }
+
+
+}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/maths/Rectangle.java b/jzy3d-core/src/main/java/org/jzy3d/maths/Rectangle.java
index 2e18746db..7752a7ccd 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/maths/Rectangle.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/maths/Rectangle.java
@@ -58,5 +58,10 @@ public Rectangle intersection(Rectangle r) {
public Rectangle clone() {
return new Rectangle (x, y, width, height);
}
+
+ public String toString() {
+ return "x:" + x + " y:" + y + " width:" + width + " height:" + height;
+ }
+
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisBox.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisBox.java
index c5424b9c3..42526e211 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisBox.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisBox.java
@@ -345,15 +345,15 @@ public void drawTicksAndLabelsZ(IPainter painter) {
///////////////////////////
protected boolean isZAxeLabelDisplayed(int direction) {
- return isZ(direction) && layout.isZAxeLabelDisplayed();
+ return isZ(direction) && layout.isZAxisLabelDisplayed();
}
protected boolean isYAxeLabelDisplayed(int direction) {
- return isY(direction) && layout.isYAxeLabelDisplayed();
+ return isY(direction) && layout.isYAxisLabelDisplayed();
}
protected boolean isXAxeLabelDisplayed(int direction) {
- return isX(direction) && layout.isXAxeLabelDisplayed();
+ return isX(direction) && layout.isXAxisLabelDisplayed();
}
protected boolean isZ(int direction) {
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisLabelProcessor.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisLabelProcessor.java
index 40711384a..a7dc5df0a 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisLabelProcessor.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisLabelProcessor.java
@@ -260,43 +260,60 @@ protected Coord3d axisLabelPosition_2D(int direction, Coord3d pos) {
View view = axis.getView();
AxisLayout axisLayout = axis.getLayout();
- View2DLayout layout2D = view.get2DLayout();
View2DProcessing processing2D = view.get2DProcessing();
+
+ Coord2d pixelScale = view.getPixelScale();
// for Y axis label, we do a shift along X dimension
- float xShiftPx = layout2D.getyTickLabelsDistance();
- xShiftPx += processing2D.getTickTextHorizontal();
- xShiftPx += layout2D.getyAxisLabelsDistance();
+ // the shift will be from the Y axis segment center,
+ // hence a positive shift is equivalent to moving the
+ // label to the left
- if(!LabelOrientation.HORIZONTAL.equals(axisLayout.getYAxisLabelOrientation())) {
-
+ float xShiftPx = processing2D.getVerticalTickDistance();
+ xShiftPx += processing2D.getTickTextWidth();
+ xShiftPx += processing2D.getVerticalAxisDistance();
+
+ // A non horizontal - hence rotated - text needs to be offset
+ // Non horizontal being either vertical or parallel to axis, we always
+ // consider it as a 90° rotation.
+ // see https://github.com/jzy3d/jzy3d-api/issues/283
+
+ boolean isVertical = !LabelOrientation.HORIZONTAL.equals(axisLayout.getYAxisLabelOrientation());
+ boolean isEmulGL = !view.getCanvas().isNative();
+
+ if(isVertical) {
// consider the rotation & offset due to vertical text
int textLength = view.getPainter().getTextLengthInPixels(axisLayout.getFont(), axisLayout.getYAxisLabel());
- // hack the emulgl vertical Y axis case
- if(!view.getCanvas().isNative())
- textLength /= view.getPixelScale().y;
+ // hack the emulgl vertical Y axis case by ignoring pixel scale for text
+ if(isEmulGL)
+ textLength /= pixelScale.y;
+ // move the text next to its anchor point, since it has been rotated
+ // from the text center and not from the anchor point that is on the
+ // right most letter side.
xShiftPx -= textLength/2;
int textHeight = axisLayout.getFont().getHeight();
- // hack the emulgl vertical Y axis case
- if(!view.getCanvas().isNative())
- textHeight /= view.getPixelScale().x;
-
- xShiftPx += textHeight/2;
+ // hack the emulgl vertical Y axis case by ignoring pixel scale for text
+ if(isEmulGL) {
+ textHeight /= (pixelScale.x*2);
+ // I can't explain why we need this x2 factor for emulglGL vertical text
+ }
+
+ xShiftPx += (textHeight/2);
}
-
// for X axis label, we do a shift along Y dimension
- float yShiftPx = layout2D.getxTickLabelsDistance();
- yShiftPx += processing2D.getTickTextVertical();
- yShiftPx += layout2D.getxAxisLabelsDistance();
-
+ float yShiftPx = processing2D.getHorizontalTickDistance();
+ yShiftPx += processing2D.getTickTextHeight();
+ yShiftPx += processing2D.getHorizontalAxisDistance();
- Coord2d modelToScreenRatio = view.get2DProcessing().getModelToScreen();
+ // Now convert this pixel shift into real world coordinates
+ // shift
+ Coord2d modelToScreenRatio = processing2D.getModelToScreen();
float xShift = xShiftPx * modelToScreenRatio.x;
float yShift = yShiftPx * modelToScreenRatio.y;
@@ -305,6 +322,7 @@ protected Coord3d axisLabelPosition_2D(int direction, Coord3d pos) {
double ylab = 0;
double zlab = 0;
+ // Build the axis label position
if (axis.isX(direction)) {
xlab = axis.center.x;
ylab = pos.y - yShift;
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisTickProcessor.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisTickProcessor.java
index 20798ec55..da9d6f620 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisTickProcessor.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/AxisTickProcessor.java
@@ -11,6 +11,7 @@
import org.jzy3d.plot3d.rendering.view.Camera;
import org.jzy3d.plot3d.rendering.view.View;
import org.jzy3d.plot3d.rendering.view.View2DLayout;
+import org.jzy3d.plot3d.rendering.view.View2DProcessing;
import org.jzy3d.plot3d.text.align.Horizontal;
import org.jzy3d.plot3d.text.align.Vertical;
@@ -24,11 +25,14 @@ public class AxisTickProcessor {
protected AxisBox axis;
protected AxisLayout layout;
protected AxisLabelProcessor labels;
-
+
+ protected View2DProcessing view2D;
+
public AxisTickProcessor(AxisBox axis) {
this.axis = axis;
this.layout = axis.getLayout();
this.labels = axis.labels;
+
}
public BoundingBox3d drawTicks(IPainter painter, int axis, int dimension, Color color) {
@@ -146,28 +150,30 @@ protected float getTickLength3D_OrComputeTickLength2D(IPainter painter, int dime
if(view != null && view.is2D()) {
- Font font = this.axis.getLayout().getFont();
- View2DLayout layout2D = view.get2DLayout();
- Coord2d modelToScreen = view.get2DProcessing().getModelToScreen();
+ View2DProcessing processing2D = view.get2DProcessing();
+ Coord2d modelToScreen = processing2D.getModelToScreen();
// -------------------------------
- // Occupation of X tick labels
+ // Distance of X tick labels to tick axis
// according to Y range, canvas height and font height
if (this.axis.isX(dimension)) {
- float worldTickLen = (layout2D.getxTickLabelsDistance() + font.getHeight()) * modelToScreen.y;
+ float fontHeight = processing2D.getTickTextHeight();
+ float worldTickLen = (processing2D.getHorizontalTickDistance() + fontHeight) * modelToScreen.y;
float range = this.axis.getBounds().getYRange().getRange();
- return range/worldTickLen;
+ float magic = range/worldTickLen;
+ return magic;
}
// -------------------------------
- // Occupation of Y tick labels
+ // Distance of Y tick labels to tick axis
// according to X range, canvas width and font width
else if (this.axis.isY(dimension)) {
- float worldTickLen = layout2D.getyTickLabelsDistance() * modelToScreen.x;
+ float worldTickLen = processing2D.getVerticalTickDistance() * modelToScreen.x;
float range = this.axis.getBounds().getXRange().getRange();
- return range/worldTickLen;
+ float magic = range/worldTickLen;
+ return magic;
}
// -------------------------------
@@ -215,8 +221,6 @@ public AxisRenderingInfo drawAxisTicks(IPainter painter, int dimension, Color co
info.tickLabels = new String[ticks.length];
info.tickLabelPositions = new Coord3d[ticks.length];
- // Coord3d[] axisSegment = new Coord3d[2];
-
for (int t = 0; t < ticks.length; t++) {
// Shift the tick vector along the selected axis
// and set the tick length
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/layout/AxisLayout.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/layout/AxisLayout.java
index fb2ae3b02..9e169c0dd 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/layout/AxisLayout.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/layout/AxisLayout.java
@@ -95,9 +95,9 @@ public AxisLayout() {
setYAxisLabel("Y");
setZAxisLabel("Z");
- setXAxeLabelDisplayed(true);
- setYAxeLabelDisplayed(true);
- setZAxeLabelDisplayed(true);
+ setXAxisLabelDisplayed(true);
+ setYAxisLabelDisplayed(true);
+ setZAxisLabelDisplayed(true);
setXTickProvider(new SmartTickProvider(5));
setYTickProvider(new SmartTickProvider(5));
@@ -138,7 +138,6 @@ public Color getMainColor() {
* Return the maximum text length in pixel as displayed on screen, given the current ticks and
* renderer
*/
-
public int getMaxXTickLabelWidth(IPainter painter) {
int maxWidth = 0;
@@ -153,6 +152,13 @@ public int getMaxXTickLabelWidth(IPainter painter) {
return maxWidth;
}
+
+ public int getRightMostXTickLabelWidth(IPainter painter) {
+ double t = getXTicks()[getXTicks().length-1];
+ String label = getXTickRenderer().format(t);
+ return painter.getTextLengthInPixels(font, label);
+
+ }
/**
* Return the maximum text length in pixel as displayed on screen, given the current ticks and
@@ -429,32 +435,32 @@ public void setZAxisLabel(String axeLabel) {
}
- public boolean isXAxeLabelDisplayed() {
+ public boolean isXAxisLabelDisplayed() {
return xAxeLabelDisplayed;
}
- public void setXAxeLabelDisplayed(boolean axeLabelDisplayed) {
+ public void setXAxisLabelDisplayed(boolean axeLabelDisplayed) {
xAxeLabelDisplayed = axeLabelDisplayed;
}
- public boolean isYAxeLabelDisplayed() {
+ public boolean isYAxisLabelDisplayed() {
return yAxeLabelDisplayed;
}
- public void setYAxeLabelDisplayed(boolean axeLabelDisplayed) {
+ public void setYAxisLabelDisplayed(boolean axeLabelDisplayed) {
yAxeLabelDisplayed = axeLabelDisplayed;
}
- public boolean isZAxeLabelDisplayed() {
+ public boolean isZAxisLabelDisplayed() {
return zAxeLabelDisplayed;
}
- public void setZAxeLabelDisplayed(boolean axeLabelDisplayed) {
+ public void setZAxisLabelDisplayed(boolean axeLabelDisplayed) {
zAxeLabelDisplayed = axeLabelDisplayed;
}
@@ -649,4 +655,68 @@ public void setFont(Font font, AxisLayout.FontType type, HiDPI hidpi) {
}
}
}
+
+ public AxisLayout clone() {
+ AxisLayout to = new AxisLayout();
+ AxisLayout from = this;
+ return copy(from, to);
+ }
+
+ public void applySettings(AxisLayout from) {
+ copy(from, this);
+ }
+
+
+
+ protected AxisLayout copy(AxisLayout from, AxisLayout to) {
+ // font
+ to.setFont(from.getFont());
+ to.setFontSizePolicy(from.getFontSizePolicy());
+ to.fontMajorHiDPI = from.fontMajorHiDPI;
+ to.fontMinorHiDPI = from.fontMinorHiDPI;
+ to.fontMajorNoHiDPI = from.fontMajorNoHiDPI;
+ to.fontMinorNoHiDPI = from.fontMinorNoHiDPI;
+
+ // color
+ to.setMainColor(from.getMainColor());
+ to.setGridColor(from.getGridColor());
+ to.setQuadColor(from.getQuadColor());
+
+ to.setFaceDisplayed(from.isFaceDisplayed());
+
+ // axis
+ to.setAxisLabelDistance(from.getAxisLabelDistance());
+ to.setAxisLabelOffsetAuto(from.isAxisLabelOffsetAuto());
+ to.setAxisLabelOffsetMargin(from.getAxisLabelOffsetMargin());
+
+ // ticks
+ to.setTickLengthRatio(from.getTickLengthRatio());
+ to.setTickLineDisplayed(from.isTickLineDisplayed());
+
+ // x
+ to.setXAxisLabelDisplayed(from.isXAxisLabelDisplayed());
+ to.setXAxisLabel(from.getXAxisLabel());
+ to.setXAxisLabelOrientation(from.getXAxisLabelOrientation());
+ to.setXTickColor(from.getXTickColor());
+ to.setXTickProvider(from.getXTickProvider());
+ to.setXTickRenderer(from.getXTickRenderer());
+
+ // y
+ to.setYAxisLabelDisplayed(from.isYAxisLabelDisplayed());
+ to.setYAxisLabel(from.getYAxisLabel());
+ to.setYAxisLabelOrientation(from.getYAxisLabelOrientation());
+ to.setYTickColor(from.getYTickColor());
+ to.setYTickProvider(from.getYTickProvider());
+ to.setYTickRenderer(from.getYTickRenderer());
+
+ // z
+ to.setZAxisLabelDisplayed(from.isZAxisLabelDisplayed());
+ to.setZAxisLabel(from.getZAxisLabel());
+ to.setZAxisLabelOrientation(from.getZAxisLabelOrientation());
+ to.setZTickColor(from.getZTickColor());
+ to.setZTickProvider(from.getZTickProvider());
+ to.setZTickRenderer(from.getZTickRenderer());
+
+ return to;
+ }
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/layout/fonts/HiDPIProportionalFontSizePolicy.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/layout/fonts/HiDPIProportionalFontSizePolicy.java
index 163135fe7..fa3d545ba 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/layout/fonts/HiDPIProportionalFontSizePolicy.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/primitives/axis/layout/fonts/HiDPIProportionalFontSizePolicy.java
@@ -25,6 +25,16 @@ public class HiDPIProportionalFontSizePolicy implements IFontSizePolicy {
public HiDPIProportionalFontSizePolicy(View view) {
this.view = view;
}
+
+ public Font getBaseFont() {
+ return baseFont;
+ }
+
+ public void setBaseFont(Font baseFont) {
+ this.baseFont = baseFont;
+ }
+
+
/**
* Modifies the {@link IAxisLayout} font according to the pixel scale returned by the {@link View}
@@ -67,10 +77,12 @@ public Font apply(AxisLayout layout) {
// Only if scale known
if (!Float.isNaN(scale.getY())) {
- int height = (int) (font.getHeight() * scale.getY());
+ int height = Math.round(font.getHeight() * scale.getY());
font.setHeight(height);
}
+ //System.out.println("HiDPIPropPolicy : " + font.getHeight());
+
// Set and return
layout.setFont(font);
return layout.getFont();
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/canvas/ICanvas.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/canvas/ICanvas.java
index fac4f71c2..551ae6149 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/canvas/ICanvas.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/canvas/ICanvas.java
@@ -4,6 +4,7 @@
import java.io.IOException;
import java.util.List;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.rendering.view.Camera;
import org.jzy3d.plot3d.rendering.view.View;
@@ -33,6 +34,8 @@ public interface ICanvas {
/** Returns the renderer's height, i.e. the display height. */
public int getRendererHeight();
+
+ public Dimension getDimension();
// Only defined for Native (JOGL) canvas
// public Renderer3d getRenderer();
@@ -104,6 +107,10 @@ public interface ICanvas {
*
*/
public void setPixelScale(float[] scale);
+
+ default void setPixelScale(Coord2d scale) {
+ setPixelScale(scale.toArray());
+ }
/**
* Provide pixel scale as feasible by the Hardware, OS, and JVM, independently of what was asked
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/legends/ILegend.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/legends/ILegend.java
index c33f4154b..92f060224 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/legends/ILegend.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/legends/ILegend.java
@@ -1,7 +1,9 @@
package org.jzy3d.plot3d.rendering.legends;
import org.jzy3d.events.DrawableChangedEvent;
+import org.jzy3d.maths.Margin;
import org.jzy3d.painters.Font;
+import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.rendering.view.IImageViewport;
public interface ILegend extends IImageViewport {
@@ -16,5 +18,9 @@ public interface ILegend extends IImageViewport {
public int getWidth();
public int getHeight();
+
+ public Margin getMargin();
+
+ public void updateMinimumDimension(IPainter painter);
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/legends/colorbars/IColorbarLegend.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/legends/colorbars/IColorbarLegend.java
index e3a63f35f..48e834f16 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/legends/colorbars/IColorbarLegend.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/legends/colorbars/IColorbarLegend.java
@@ -2,6 +2,7 @@
import org.jzy3d.events.DrawableChangedEvent;
import org.jzy3d.maths.Dimension;
+import org.jzy3d.maths.Margin;
import org.jzy3d.painters.IPainter;
public interface IColorbarLegend {
@@ -12,4 +13,10 @@ public interface IColorbarLegend {
public Dimension getMinimumDimension();
public void setMinimumDimension(Dimension dimension);
+
+
+
+ public Margin getMargin();
+
+ public void setMargin(Margin margin);
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/scene/Scene.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/scene/Scene.java
index 3e68a2373..cf13d5719 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/scene/Scene.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/scene/Scene.java
@@ -124,7 +124,7 @@ public void clearView(View view) {
views.remove(view);
view.dispose();
}
-
+
/** Return the scene {@link Graph} string representation. */
@Override
public String toString() {
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/AbstractViewportManager.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/AbstractViewportManager.java
index c01bff155..c31f4b04c 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/AbstractViewportManager.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/AbstractViewportManager.java
@@ -5,7 +5,6 @@
import org.jzy3d.maths.Rectangle;
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.rendering.canvas.ICanvas;
-import org.jzy3d.plot3d.rendering.canvas.IScreenCanvas;
/**
* An {@link AbstractViewportManager} describes an element that occupies the whole rendering
@@ -35,11 +34,10 @@ public abstract class AbstractViewportManager {
protected boolean screenGridDisplayed = false;
protected ViewportMode mode = ViewportMode.RECTANGLE_NO_STRETCH;
-
- protected float ratioWidth;
- protected float ratioHeight;
- protected boolean apply_WindowsHiDPI_Workaround = true;
+ protected ViewportConfiguration lastViewPort;
+
+ protected boolean applyWindowsHiDPIWorkaround = true;
/**
* Set the view port (size of the renderer).
@@ -77,11 +75,11 @@ public void setViewPort(int width, int height, float left, float right) {
this.screenWidth = getSliceWidth(width, left, right);
this.screenHeight = height;
this.screenLeft = (int) (left * width);
- this.screenBottom = 0;// screenLeft + screenWidth;
+ this.screenBottom = 0;
}
public int getSliceWidth(int width, float left, float right) {
- return (int) (width * (right - left));
+ return Math.round(width * (right - left));
}
@@ -91,12 +89,19 @@ public void setViewPort(ViewportConfiguration viewport) {
this.screenLeft = viewport.getX();
this.screenBottom = viewport.getY();
}
+
+ public ViewportConfiguration getViewPort() {
+ ViewportConfiguration vp =
+ new ViewportConfiguration(screenWidth, screenHeight, screenXOffset, screenYOffset);
+ vp.setMode(mode);
+ return vp;
+ }
+ /** Return the viewport as it was invoked at last rendering. */
public ViewportConfiguration getLastViewPort() {
return lastViewPort;
}
- protected ViewportConfiguration lastViewPort;
/**
* Build and return a {@link ViewportConfiguration}. Uses gl to
@@ -108,52 +113,22 @@ public ViewportConfiguration getLastViewPort() {
public ViewportConfiguration applyViewport(IPainter painter) {
// Workaround for https://github.com/jzy3d/jogl/issues/8
- if(apply_WindowsHiDPI_Workaround) {
- if(painter.getOS().isWindows() && painter.getWindowingToolkit().isAWT()) {
- // We here scale the viewport by either 1 or by the ratio indicated by the JVM
- // if only the JVM is able to detect the pixel ratio and if JOGL
- // can't guess it (which is the case for Windows 10).
- Coord2d scaleHardware = painter.getCanvas().getPixelScale();
- Coord2d scaleJVM = painter.getCanvas().getPixelScaleJVM();
-
- //System.out.println("HiDPI : " + isHiDPIEnabled);
- //System.out.println("GPU : " + scaleHardware);
- //System.out.println("JVM : " + scaleJVM);
-
- if (painter.isJVMScaleLargerThanNativeScale(scaleHardware, scaleJVM)) {
- Coord2d scale = scaleJVM.div(scaleHardware);
- //System.out.println("Scale : " + scale);
- screenWidth = (int) (screenWidth * scale.x);
- screenHeight = (int) (screenHeight * scale.y);
- }
- }
+ if(applyWindowsHiDPIWorkaround) {
+ Coord2d screen = apply_WindowsHiDPI_Workaround(painter, screenWidth, screenHeight);
+
+ screenWidth = (int) screen.x;
+ screenHeight = (int) screen.y;
}
// Stretch projection on the whole viewport
if (ViewportMode.STRETCH_TO_FILL.equals(mode)
|| ViewportMode.RECTANGLE_NO_STRETCH.equals(mode)) {
- screenXOffset = screenLeft;
- screenYOffset = 0;
-
-
- painter.glViewport(screenXOffset, screenYOffset, screenWidth, screenHeight);
-
- lastViewPort =
- new ViewportConfiguration(screenWidth, screenHeight, screenXOffset, screenYOffset);
- lastViewPort.setMode(mode);
+ applyViewportRectangle(painter);
}
// Set the projection into the largest square area centered in the
// window slice
else if (ViewportMode.SQUARE.equals(mode)) {
- screenSquaredDim = Math.min(screenWidth, screenHeight);
- screenXOffset = screenLeft + screenWidth / 2 - screenSquaredDim / 2;
- screenYOffset = screenBottom + screenHeight / 2 - screenSquaredDim / 2;
-
- painter.glViewport(screenXOffset, screenYOffset, screenSquaredDim, screenSquaredDim);
-
- lastViewPort = new ViewportConfiguration(screenSquaredDim, screenSquaredDim, screenXOffset,
- screenYOffset);
- lastViewPort.setMode(mode);
+ applyViewportSquared(painter);
} else {
throw new IllegalArgumentException("unknown mode " + mode);
}
@@ -165,7 +140,75 @@ else if (ViewportMode.SQUARE.equals(mode)) {
return lastViewPort;
}
+ public static Coord2d apply_WindowsHiDPI_Workaround(IPainter painter, int width, int height) {
+ return apply_WindowsHiDPI_Workaround(painter, new Coord2d(width, height));
+ }
+
+ public static Coord2d apply_WindowsHiDPI_Workaround(IPainter painter, Coord2d viewport) {
+ if(painter.getOS().isWindows() && painter.getWindowingToolkit().isAWT()) {
+ // We here scale the viewport by either 1 or by the ratio indicated by the JVM
+ // if only the JVM is able to detect the pixel ratio and if JOGL
+ // can't guess it (which is the case for Windows 10).
+ Coord2d scaleHardware = painter.getCanvas().getPixelScale();
+ Coord2d scaleJVM = painter.getCanvas().getPixelScaleJVM();
+
+ //System.out.println("AbstractViewportManager.HiDPI : " + isHiDPIEnabled);
+ //System.out.println("AbstractViewportManager.GPU : " + scaleHardware);
+ //System.out.println("AbstractViewportManager.JVM : " + scaleJVM);
+
+ if (painter.isJVMScaleLargerThanNativeScale(scaleHardware, scaleJVM)) {
+ Coord2d scale = scaleJVM.div(scaleHardware);
+ //System.out.println("AbstractViewportManager.Scale : " + scale);
+ return new Coord2d (viewport.x * scale.x, viewport.y * scale.y);
+ }
+ }
+
+ return viewport;
+ }
+ public static Coord2d getWindowsHiDPIScale_Workaround(IPainter painter) {
+ if(painter.getOS().isWindows() && painter.getWindowingToolkit().isAWT()) {
+ // We here scale the viewport by either 1 or by the ratio indicated by the JVM
+ // if only the JVM is able to detect the pixel ratio and if JOGL
+ // can't guess it (which is the case for Windows 10).
+ Coord2d scaleHardware = painter.getCanvas().getPixelScale();
+ Coord2d scaleJVM = painter.getCanvas().getPixelScaleJVM();
+
+ //System.out.println("AbstractViewportManager.HiDPI : " + isHiDPIEnabled);
+ //System.out.println("AbstractViewportManager.GPU : " + scaleHardware);
+ //System.out.println("AbstractViewportManager.JVM : " + scaleJVM);
+
+ if (painter.isJVMScaleLargerThanNativeScale(scaleHardware, scaleJVM)) {
+ return scaleJVM.div(scaleHardware);
+ }
+ }
+ return Coord2d.IDENTITY.clone();
+ }
+
+
+ protected void applyViewportRectangle(IPainter painter) {
+ screenXOffset = screenLeft;
+ screenYOffset = 0;
+ //System.out.println("AbstractViewportManager: yoffset " + screenYOffset);
+
+ painter.glViewport(screenXOffset, screenYOffset, screenWidth, screenHeight);
+
+ lastViewPort =
+ new ViewportConfiguration(screenWidth, screenHeight, screenXOffset, screenYOffset);
+ lastViewPort.setMode(mode);
+ }
+
+ protected void applyViewportSquared(IPainter painter) {
+ screenSquaredDim = Math.min(screenWidth, screenHeight);
+ screenXOffset = screenLeft + screenWidth / 2 - screenSquaredDim / 2;
+ screenYOffset = screenBottom + screenHeight / 2 - screenSquaredDim / 2;
+
+ painter.glViewport(screenXOffset, screenYOffset, screenSquaredDim, screenSquaredDim);
+
+ lastViewPort = new ViewportConfiguration(screenSquaredDim, screenSquaredDim, screenXOffset,
+ screenYOffset);
+ lastViewPort.setMode(mode);
+ }
/**
* Returns the (x,y) offset that was applied to make this {@link AbstractViewportManager} stand in
@@ -291,6 +334,19 @@ public boolean isScreenGridDisplayed() {
return screenGridDisplayed;
}
-
+ public boolean isApplyWindowsHiDPIWorkaround() {
+ return applyWindowsHiDPIWorkaround;
+ }
+ public void setApplyWindowsHiDPIWorkaround(boolean applyWindowsHiDPIWorkaround) {
+ this.applyWindowsHiDPIWorkaround = applyWindowsHiDPIWorkaround;
+ }
+
+ public void setScreenXOffset(int screenXOffset) {
+ this.screenXOffset = screenXOffset;
+ }
+
+ public void setScreenYOffset(int screenYOffset) {
+ this.screenYOffset = screenYOffset;
+ }
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/IImageViewport.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/IImageViewport.java
index cccace4b9..b09143959 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/IImageViewport.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/IImageViewport.java
@@ -1,5 +1,6 @@
package org.jzy3d.plot3d.rendering.view;
+import org.jzy3d.maths.Coord2d;
import org.jzy3d.maths.Dimension;
import org.jzy3d.painters.IPainter;
@@ -41,5 +42,9 @@ public interface IImageViewport {
public void setViewPort(ViewportConfiguration viewport);
public ViewportConfiguration getLastViewPort();
+
+ public void updatePixelScale(Coord2d pixelScale);
+
+ public Coord2d getPixelScale();
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View.java
index 3aaee4680..b12be30a7 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View.java
@@ -29,9 +29,11 @@
import org.jzy3d.plot3d.rendering.canvas.ICanvasListener;
import org.jzy3d.plot3d.rendering.canvas.IScreenCanvas;
import org.jzy3d.plot3d.rendering.canvas.Quality;
+import org.jzy3d.plot3d.rendering.legends.ILegend;
import org.jzy3d.plot3d.rendering.lights.LightSet;
import org.jzy3d.plot3d.rendering.scene.Graph;
import org.jzy3d.plot3d.rendering.scene.Scene;
+import org.jzy3d.plot3d.rendering.view.layout.IViewportLayout;
import org.jzy3d.plot3d.rendering.view.modes.CameraMode;
import org.jzy3d.plot3d.rendering.view.modes.ViewBoundMode;
import org.jzy3d.plot3d.rendering.view.modes.ViewPositionMode;
@@ -102,6 +104,10 @@ public class View {
protected BoundingBox3d viewBounds;
protected Chart chart;
+ // layout, for mixing this chart view with other viewports (e.g. colorbars on the side)
+ protected IViewportLayout layout;
+
+
// view listeners
protected List viewPointChangedListeners;
protected List viewEventListeners;
@@ -196,6 +202,7 @@ public void initInstance(IChartFactory factory, Scene scene, ICanvas canvas, Qua
this.painter.setCamera(cam);
this.painter.setView(this);
this.viewOverlay = factory.getPainterFactory().newViewOverlay();
+ this.layout = factory.getPainterFactory().newViewportLayout();
this.scene = scene;
this.canvas = canvas;
@@ -231,9 +238,14 @@ protected void configureHiDPIListener(ICanvas canvas) {
@Override
public void pixelScaleChanged(double pixelScaleX, double pixelScaleY) {
// Store current pixel scale
- pixelScale.x = (float) pixelScaleX;
- pixelScale.y = (float) pixelScaleY;
-
+ pixelScale.x = Double.isNaN(pixelScaleX) ? 1 : (float) pixelScaleX;
+ pixelScale.y = Double.isNaN(pixelScaleY) ? 1 : (float) pixelScaleY;
+
+ if(pixelScale.x<=0)
+ pixelScale.x = 1;
+ if(pixelScale.y<=0)
+ pixelScale.y = 1;
+
// Convert pixel scale to HiDPI status
if (pixelScaleX <= 1) {
hidpi = HiDPI.OFF;
@@ -243,66 +255,28 @@ public void pixelScaleChanged(double pixelScaleX, double pixelScaleY) {
// Edit font size accordingly
axis.getLayout().applyFontSizePolicy();
- }
- });
- }
-
-
-
- /**
- * Return a copy of the currently known pixel scale as notified by the canvas.
- *
- * If the View received no pixel scale change event, the pixel scale will be 0.
- */
- public Coord2d getPixelScale() {
- return pixelScale.clone();
- }
-
- /**
- * Return HiDPI status as ACTUALLY possible by the ICanvas on the current screen and computer,
- * regardless of the {@link Quality#setHiDPIEnabled(true)}.
- *
- * Will always return {@link HiDPI.OFF} is chart is set to {@link Quality#setHiDPIEnabled(false)}
- * as this forces the canvas to NOT make use of HiDPI.
- *
- * @return
- */
- public HiDPI getHiDPI() {
- return hidpi;
- }
-
- /** Return the configuration of a 2D layout */
- public View2DLayout get2DLayout() {
- return view2DLayout;
- }
-
- /**
- * Return the result of processing a 2D layout using the layout configured with the instance
- * returned by {@link #get2DLayout()}
- */
- public View2DProcessing get2DProcessing() {
- return view2DProcessing;
- }
- public IPainter getPainter() {
- return painter;
- }
+
+ //getLayout().update(chart);
+
+ for(ILegend legend : scene.getGraph().getLegends()) {
+ legend.updatePixelScale(pixelScale);
+ //legend.updateMinimumDimension(painter);
+ }
+
+ // --------------------------
+ // Trigger new render for different reasons
+ // EmulGL need this to layout colorbar properly
+ // Native need this to /sometime/ get the good resolution
- public Chart getChart() {
- return chart;
- }
+ //chart.render(2);
- public void setChart(Chart chart) {
- this.chart = chart;
+ //System.out.println("View :update pix scale");
+ }
+ });
}
- public boolean isSlave() {
- return slave;
- }
- public void setSlave(boolean slave) {
- this.slave = slave;
- }
public void dispose() {
axis.dispose();
@@ -317,8 +291,9 @@ public void dispose() {
* Current view selection into the mother Scene, and call to target canvas rendering.
*/
public void shoot() {
- if (canvas != null)
+ if (canvas != null) {
canvas.forceRepaint();
+ }
}
/**
@@ -571,408 +546,167 @@ public void lookToBox(BoundingBox3d box) {
viewBounds = box;
}
+ /* */
+
/**
- * Return the central point of the view scene, that is the last bounding box center set by
- * {@link lookToBox(BoundingBox3d box)}
+ * Select between an automatic bounding (that allows fitting the entire scene graph), or a custom
+ * bounding.
*/
- public Coord3d getCenter() {
- return center;
- }
-
- /** Get the {@link AxisBox}'s {@link BoundingBox3d} */
- public BoundingBox3d getBounds() {
- return axis.getBounds();
+ public void setBoundMode(ViewBoundMode mode) {
+ boundsMode = mode;
+ updateBounds();
}
- public ViewBoundMode getBoundsMode() {
- return boundsMode;
+ /**
+ * Set the bounds of the view according to the current {@link ViewBoundMode} , and orders a
+ * {@link Camera.shoot()}.
+ */
+ public void updateBounds() {
+ if (boundsMode == ViewBoundMode.AUTO_FIT)
+ lookToBox(getSceneGraphBounds()); // set axe and camera
+ else if (boundsMode == ViewBoundMode.MANUAL)
+ lookToBox(viewBounds); // set axe and camera
+ else
+ throw new RuntimeException("Unknown bounds");
+ shoot();
}
- /** Set the {@link ViewPositionMode} applied to this view. */
- public void setViewPositionMode(ViewPositionMode mode) {
- this.viewMode = mode;
+ public BoundingBox3d getSceneGraphBounds() {
+ return getSceneGraphBounds(scene);
}
- /** Return the {@link ViewPositionMode} applied to this view. */
- public ViewPositionMode getViewMode() {
- return viewMode;
+ protected BoundingBox3d getSceneGraphBounds(Scene scene) {
+ return squarifyGetSceneGraphBounds(scene);
}
- public boolean is2D() {
- return ViewPositionMode.TOP.equals(getViewMode());
+ /**
+ * 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(getSceneGraphBounds());
+ if (refresh)
+ shoot();
}
- public boolean is3D() {
- return !is2D();
+ /**
+ * Set a manual bounding box and switch the bounding mode to {ViewBoundMode.MANUAL}, meaning that
+ * any call to {@link updateBounds()} will update view bounds to the current bounds.
+ */
+ public void setBoundManual(BoundingBox3d bounds) {
+ boundsMode = ViewBoundMode.MANUAL;
+ lookToBox(bounds);
}
- /** Return the stretch ratio applied to the view */
- public Coord3d getScaling() {
- return scaling;
- }
+ /* GL */
/**
- * Set the viewpoint using polar coordinates relative to the target (i.e. the center of the
- * scene). Only X and Y dimensions are required, as the distance to center will be computed
- * automatically by {@link updateCamera()}.
- *
- * The input coordinate is polar and considers
+ * The initialization function:
*
- * - x is azimuth in [0;2xPI]
- *
- y is elevation in [-PI/2;+PI/2]. Will be clamped if out of bounds
- *
- z is range (distance to center) but ignored there as it is processed automatically
+ *
- specifies general GL settings that impact the rendering quality and performance
+ * (computation speed).
+ *
- enable light management
+ *
- load all required texture resources
+ *
- fix the current view bounds to the whole scene graph bounds
*
+ *
+ * The rendering settings are set by the {@link Quality} given in the constructor parameters.
*/
- public void setViewPoint(Coord3d polar, boolean updateView) {
- viewpoint = polar;
- viewpoint.y = viewpoint.y < -PI_div2 ? -PI_div2 : viewpoint.y;
- viewpoint.y = viewpoint.y > PI_div2 ? PI_div2 : viewpoint.y;
- if (updateView)
- shoot();
+ public void init() {
+ initQuality();
+ initLights();
+ initResources();
+ initBounds();
- fireViewPointChangedEvent(new ViewPointChangedEvent(this, polar));
+ initialized = true;
+
+ fireViewLifecycleHasInit(null);
}
- /**
- * Set the viewpoint and query a view update.
- *
- *
- * @see {@link setViewPoint(Coord3d polar, boolean updateView)}
- */
- public void setViewPoint(Coord3d polar) {
- setViewPoint(polar, true);
+ protected void initBounds() {
+ if (viewBounds == null) {
+ viewBounds = squarifyGetSceneGraphBounds(scene);
+ }
+ lookToBox(viewBounds);
}
- /**
- * Get the viewpoint. The Z dimension is the one defined by {@link updateCamera()}, which depends
- * on the view scaling.
- *
- * @see {@link setViewPoint(Coord3d polar, boolean updateView)}
- */
- public Coord3d getViewPoint() {
- return viewpoint;
+ public void initQuality() {
+ painter.configureGL(quality);
}
- /**
- * Return the last used view scaling that was set according to the {@link setSquared(boolean v)}
- * status.
- */
- public Coord3d getLastViewScaling() {
- return scaling;
+ public void initLights() {
+ initLights(scene);
}
- /* CONTROLS ANNOTATIONS & GENERAL RENDERING */
+ public void initLights(Scene scene) {
+ scene.getLightSet().init(painter);
+ scene.getLightSet().enableLightIfThereAreLights(painter);
+ }
- public void setAxis(IAxis axis) {
- this.axis = axis;
+ public void initResources() {
+ getScene().getGraph().mountAllGLBindedResources(painter);
+
+ // refresh bounds as we may have mount VBO objects which NOW have bounds defined
updateBounds();
}
- public IAxis getAxis() {
- return axis;
- }
+ /** Clear the color and depth buffer. */
+ public void clear() {
+ painter.clearColor(backgroundColor);
+ painter.glClearDepth(1);
- public AxisLayout getAxisLayout() {
- return axis.getLayout();
- }
+ // Console.println("View.clear with color", backgroundColor);
-
- public boolean getSquared() {
- return this.squared;
+ if (!slave) {
+ painter.glClearColorAndDepthBuffers();
+ }
}
- public void setSquared(boolean status) {
- this.squared = status;
+ /* RENDERING */
- if (is2D() && status)
- LOGGER.info(
- "View.setSquared : Setting a 2D chart squared may break the tick and axis label layout! Keep it to false for 2D charts");
- }
+ /**
+ * Trigger layout rendering which in turns invoke this {@link #renderView()}
+ */
+ public void render() {
+ fireViewLifecycleWillRender(null);
- public boolean isAxisDisplayed() {
- return axisDisplayed;
- }
+ if (layout != null && getChart() != null) {
+ layout.update(getChart());
+ layout.render(painter, getChart());
- public void setAxisDisplayed(boolean axisDisplayed) {
- this.axisDisplayed = axisDisplayed;
- }
+ // renderOverlay(gl);
+ if (dimensionDirty)
+ dimensionDirty = false;
+ }
- public void setBackgroundColor(Color color) {
- backgroundColor = color;
- }
+ fireViewLifecycleHasRendered(null);
- public Color getBackgroundColor() {
- return backgroundColor;
- }
- public Camera getCamera() {
- return cam;
}
/**
- * Set the projection of this view, either Camera.ORTHOGONAL or Camera.PERSPECTIVE.
+ * Default view render implementation.
+ *
+ * Triggering View rendering is performer {@link IViewportLayout}. The layout implementation may
+ * either call renderView() or
+ *
+ * Render background, scene and overlay Mark dimension dirty false Trigger view events
*/
- public void setCameraMode(CameraMode mode) {
- this.cameraMode = mode;
+ public void renderView() {
+ fireViewLifecycleWillRender(null);
+
+ renderBackground(0f, 1f);
+ renderScene();
+ renderOverlay();
+
+ if (dimensionDirty)
+ dimensionDirty = false;
+
+ fireViewLifecycleHasRendered(null);
}
/**
- * Get the projection of this view, either CameraMode.ORTHOGONAL or CameraMode.PERSPECTIVE.
- */
- public CameraMode getCameraMode() {
- return cameraMode;
- }
-
- public void setMaximized(boolean status) {
- if (status)
- this.cam.setViewportMode(ViewportMode.STRETCH_TO_FILL);
- else
- this.cam.setViewportMode(ViewportMode.RECTANGLE_NO_STRETCH);
- }
-
- public boolean isMaximized() {
- return ViewportMode.STRETCH_TO_FILL.equals(this.cam.getViewportMode());
- }
-
-
- /**
- * @see setter
- */
- public float getCameraRenderingSphereRadiusFactor() {
- return cameraRenderingSphereRadiusFactor;
- }
-
- /**
- * This allows zooming the 3d scene by editing the camera rendering sphere.
- *
- * - A value of 1 allows having an AxisBox with corners touching the top/bottom part of the
- * canvas.
- *
- A value greater than 1 makes the rendering sphere bigger, hence the AxisBox appears
- * smaller.
- *
- */
- public void setCameraRenderingSphereRadiusFactor(float cameraRenderingSphereRadiusFactor) {
- this.cameraRenderingSphereRadiusFactor = cameraRenderingSphereRadiusFactor;
- }
-
- public boolean isMaintainAllObjectsInView() {
- return maintainAllObjectsInView;
- }
-
- public void setMaintainAllObjectsInView(boolean maintainAllObjectsInView) {
- this.maintainAllObjectsInView = maintainAllObjectsInView;
- }
-
- public boolean isDisplayAxisWholeBounds() {
- return displayAxisWholeBounds;
- }
-
- public void setDisplayAxisWholeBounds(boolean displayAxisWholeBounds) {
- this.displayAxisWholeBounds = displayAxisWholeBounds;
- }
-
- public Scene getScene() {
- return scene;
- }
-
- public Rectangle getSceneViewportRectangle() {
- return cam.getRectangle();
- }
-
- public ICanvas getCanvas() {
- return canvas;
- }
-
- public Graph getAnnotations() {
- return annotations.getGraph();
- }
-
- public boolean addViewEventListener(IViewEventListener listener) {
- return viewEventListeners.add(listener);
- }
-
- public boolean removeViewOnTopEventListener(IViewEventListener listener) {
- return viewEventListeners.remove(listener);
- }
-
- protected void fireViewOnTopEvent(boolean isOnTop) {
- ViewIsVerticalEvent e = new ViewIsVerticalEvent(this);
-
- if (isOnTop)
- for (IViewEventListener listener : viewEventListeners)
- listener.viewVerticalReached(e);
- else
- for (IViewEventListener listener : viewEventListeners)
- listener.viewVerticalLeft(e);
- }
-
- protected void fireViewFirstRenderStarts() {
- for (IViewEventListener listener : viewEventListeners)
- listener.viewFirstRenderStarts();
- }
-
- public boolean addViewPointChangedListener(IViewPointChangedListener listener) {
- return viewPointChangedListeners.add(listener);
- }
-
- public boolean removeViewPointChangedListener(IViewPointChangedListener listener) {
- return viewPointChangedListeners.remove(listener);
- }
-
- protected void fireViewPointChangedEvent(ViewPointChangedEvent e) {
- for (IViewPointChangedListener vp : viewPointChangedListeners)
- vp.viewPointChanged(e);
- }
-
- public boolean addViewLifecycleChangedListener(IViewLifecycleEventListener listener) {
- return viewLifecycleListeners.add(listener);
- }
-
- public boolean removeViewLifecycleChangedListener(IViewLifecycleEventListener listener) {
- return viewLifecycleListeners.remove(listener);
- }
-
- protected void fireViewLifecycleHasInit(ViewLifecycleEvent e) {
- for (IViewLifecycleEventListener vp : viewLifecycleListeners)
- vp.viewHasInit(e);
- }
-
- protected void fireViewLifecycleWillRender(ViewLifecycleEvent e) {
- for (IViewLifecycleEventListener vp : viewLifecycleListeners)
- vp.viewWillRender(e);
- }
-
- /* */
-
- /**
- * Select between an automatic bounding (that allows fitting the entire scene graph), or a custom
- * bounding.
- */
- public void setBoundMode(ViewBoundMode mode) {
- boundsMode = mode;
- updateBounds();
- }
-
- /**
- * Set the bounds of the view according to the current {@link ViewBoundMode} , and orders a
- * {@link Camera.shoot()}.
- */
- public void updateBounds() {
- if (boundsMode == ViewBoundMode.AUTO_FIT)
- lookToBox(getSceneGraphBounds()); // set axe and camera
- else if (boundsMode == ViewBoundMode.MANUAL)
- lookToBox(viewBounds); // set axe and camera
- else
- throw new RuntimeException("Unknown bounds");
- shoot();
- }
-
- public BoundingBox3d getSceneGraphBounds() {
- return getSceneGraphBounds(scene);
- }
-
- protected BoundingBox3d getSceneGraphBounds(Scene scene) {
- return squarifyGetSceneGraphBounds(scene);
- }
-
- /**
- * 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(getSceneGraphBounds());
- if (refresh)
- shoot();
- }
-
- /**
- * Set a manual bounding box and switch the bounding mode to {ViewBoundMode.MANUAL}, meaning that
- * any call to {@link updateBounds()} will update view bounds to the current bounds.
- */
- public void setBoundManual(BoundingBox3d bounds) {
- boundsMode = ViewBoundMode.MANUAL;
- lookToBox(bounds);
- }
-
- /* GL */
-
- /**
- * The initialization function:
- *
- * - specifies general GL settings that impact the rendering quality and performance
- * (computation speed).
- *
- enable light management
- *
- load all required texture resources
- *
- fix the current view bounds to the whole scene graph bounds
- *
- *
- * The rendering settings are set by the {@link Quality} given in the constructor parameters.
- */
- public void init() {
- initQuality();
- initLights();
- initResources();
- initBounds();
-
- initialized = true;
-
- fireViewLifecycleHasInit(null);
- }
-
- protected void initBounds() {
- if (viewBounds == null) {
- viewBounds = squarifyGetSceneGraphBounds(scene);
- }
- lookToBox(viewBounds);
- }
-
- public void initQuality() {
- painter.configureGL(quality);
- }
-
- public void initLights() {
- initLights(scene);
- }
-
- public void initLights(Scene scene) {
- scene.getLightSet().init(painter);
- scene.getLightSet().enableLightIfThereAreLights(painter);
- }
-
- public void initResources() {
- getScene().getGraph().mountAllGLBindedResources(painter);
-
- // refresh bounds as we may have mount VBO objects which NOW have bounds defined
- updateBounds();
- }
-
- /** Clear the color and depth buffer. */
- public void clear() {
- painter.clearColor(backgroundColor);
- painter.glClearDepth(1);
-
- // Console.println("View.clear with color", backgroundColor);
-
- if (!slave) {
- painter.glClearColorAndDepthBuffers();
- }
- }
-
- /* RENDERING */
-
- public void render() {
- fireViewLifecycleWillRender(null);
-
- renderBackground(0f, 1f);
- renderScene();
- renderOverlay();
-
- if (dimensionDirty)
- dimensionDirty = false;
- }
-
- /**
- * To be implemented (see AWTView)
+ * To be implemented (see AWTView)
*/
public void renderBackground(float left, float right) {}
@@ -1329,7 +1063,12 @@ protected void computeCamera2D_RenderingSquare(Camera cam, ViewportConfiguration
BoundingBox3d bounds) {
// bounds = getSceneGraphBounds();
-
+ Coord2d c = AbstractViewportManager.apply_WindowsHiDPI_Workaround(getPainter(), viewport.width, viewport.height);
+
+ viewport = viewport.clone();
+ viewport.width = (int)c.x;
+ viewport.height = (int)c.y;
+
view2DProcessing.apply(viewport, bounds);
@@ -1344,12 +1083,12 @@ protected void computeCamera2D_RenderingSquare(Camera cam, ViewportConfiguration
BoundingBox2d xySquare = new BoundingBox2d(xmin, xmax, ymin, ymax);
-
+
// Z range
- float dist = (float)cam.getEye().distance(cam.getTarget());
- float zmax = dist - bounds.getZRange().getMax()-1;
- float zmin = dist - bounds.getZRange().getMin()+1 ;
-
+ float dist = (float) cam.getEye().distance(cam.getTarget());
+ float zmax = dist - bounds.getZRange().getMax() - 1;
+ float zmin = dist - bounds.getZRange().getMin() + 1;
+
// configure camera rendering volume
cam.setRenderingSquare(xySquare, zmax, zmin);
}
@@ -1463,7 +1202,63 @@ public void renderAnnotations(Camera camera) {
annotations.getGraph().draw(painter);
}
- /* */
+ //
+ /* GETTERS & SETTERS */
+
+ /**
+ * Return a copy of the currently known pixel scale as notified by the canvas.
+ *
+ * If the View received no pixel scale change event, the pixel scale will be 0.
+ */
+ public Coord2d getPixelScale() {
+ return pixelScale.clone();
+ }
+
+ /**
+ * Return HiDPI status as ACTUALLY possible by the ICanvas on the current screen and computer,
+ * regardless of the {@link Quality#setHiDPIEnabled(true)}.
+ *
+ * Will always return {@link HiDPI.OFF} is chart is set to {@link Quality#setHiDPIEnabled(false)}
+ * as this forces the canvas to NOT make use of HiDPI.
+ *
+ * @return
+ */
+ public HiDPI getHiDPI() {
+ return hidpi;
+ }
+
+ /** Return the configuration of a 2D layout */
+ public View2DLayout get2DLayout() {
+ return view2DLayout;
+ }
+
+ /**
+ * Return the result of processing a 2D layout using the layout configured with the instance
+ * returned by {@link #get2DLayout()}
+ */
+ public View2DProcessing get2DProcessing() {
+ return view2DProcessing;
+ }
+
+ public IPainter getPainter() {
+ return painter;
+ }
+
+ public Chart getChart() {
+ return chart;
+ }
+
+ public void setChart(Chart chart) {
+ this.chart = chart;
+ }
+
+ public boolean isSlave() {
+ return slave;
+ }
+
+ public void setSlave(boolean slave) {
+ this.slave = slave;
+ }
public SpaceTransformer getSpaceTransformer() {
return spaceTransformer;
@@ -1485,5 +1280,287 @@ public boolean isInitialized() {
return initialized;
}
+ public IViewportLayout getLayout() {
+ return layout;
+ }
+
+ public void setLayout(IViewportLayout layout) {
+ this.layout = layout;
+ }
+
+ /**
+ * Return the central point of the view scene, that is the last bounding box center set by
+ * {@link lookToBox(BoundingBox3d box)}
+ */
+ public Coord3d getCenter() {
+ return center;
+ }
+
+ /** Get the {@link AxisBox}'s {@link BoundingBox3d} */
+ public BoundingBox3d getBounds() {
+ return axis.getBounds();
+ }
+
+ public ViewBoundMode getBoundsMode() {
+ return boundsMode;
+ }
+
+ /** Set the {@link ViewPositionMode} applied to this view. */
+ public void setViewPositionMode(ViewPositionMode mode) {
+ this.viewMode = mode;
+ }
+
+ /** Return the {@link ViewPositionMode} applied to this view. */
+ public ViewPositionMode getViewMode() {
+ return viewMode;
+ }
+
+ public boolean is2D() {
+ return ViewPositionMode.TOP.equals(getViewMode());
+ }
+
+ public boolean is3D() {
+ return !is2D();
+ }
+
+ /** Return the stretch ratio applied to the view */
+ public Coord3d getScaling() {
+ return scaling;
+ }
+
+ /**
+ * Set the viewpoint using polar coordinates relative to the target (i.e. the center of the
+ * scene). Only X and Y dimensions are required, as the distance to center will be computed
+ * automatically by {@link updateCamera()}.
+ *
+ * The input coordinate is polar and considers
+ *
+ * - x is azimuth in [0;2xPI]
+ *
- y is elevation in [-PI/2;+PI/2]. Will be clamped if out of bounds
+ *
- z is range (distance to center) but ignored there as it is processed automatically
+ *
+ */
+ public void setViewPoint(Coord3d polar, boolean updateView) {
+ viewpoint = polar;
+ viewpoint.y = viewpoint.y < -PI_div2 ? -PI_div2 : viewpoint.y;
+ viewpoint.y = viewpoint.y > PI_div2 ? PI_div2 : viewpoint.y;
+ if (updateView)
+ shoot();
+
+ fireViewPointChangedEvent(new ViewPointChangedEvent(this, polar));
+ }
+
+ /**
+ * Set the viewpoint and query a view update.
+ *
+ *
+ * @see {@link setViewPoint(Coord3d polar, boolean updateView)}
+ */
+ public void setViewPoint(Coord3d polar) {
+ setViewPoint(polar, true);
+ }
+
+ /**
+ * Get the viewpoint. The Z dimension is the one defined by {@link updateCamera()}, which depends
+ * on the view scaling.
+ *
+ * @see {@link setViewPoint(Coord3d polar, boolean updateView)}
+ */
+ public Coord3d getViewPoint() {
+ return viewpoint;
+ }
+
+ /**
+ * Return the last used view scaling that was set according to the {@link setSquared(boolean v)}
+ * status.
+ */
+ public Coord3d getLastViewScaling() {
+ return scaling;
+ }
+
+ /* CONTROLS ANNOTATIONS & GENERAL RENDERING */
+
+ public void setAxis(IAxis axis) {
+ this.axis = axis;
+ updateBounds();
+ }
+
+ public IAxis getAxis() {
+ return axis;
+ }
+
+ public AxisLayout getAxisLayout() {
+ return axis.getLayout();
+ }
+
+
+ public boolean getSquared() {
+ return this.squared;
+ }
+
+ public void setSquared(boolean status) {
+ this.squared = status;
+
+ if (is2D() && status)
+ LOGGER.info(
+ "View.setSquared : Setting a 2D chart squared may break the tick and axis label layout! Keep it to false for 2D charts");
+ }
+
+ public boolean isAxisDisplayed() {
+ return axisDisplayed;
+ }
+
+ public void setAxisDisplayed(boolean axisDisplayed) {
+ this.axisDisplayed = axisDisplayed;
+ }
+ public void setBackgroundColor(Color color) {
+ backgroundColor = color;
+ }
+
+ public Color getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ public Camera getCamera() {
+ return cam;
+ }
+
+ /**
+ * Set the projection of this view, either Camera.ORTHOGONAL or Camera.PERSPECTIVE.
+ */
+ public void setCameraMode(CameraMode mode) {
+ this.cameraMode = mode;
+ }
+
+ /**
+ * Get the projection of this view, either CameraMode.ORTHOGONAL or CameraMode.PERSPECTIVE.
+ */
+ public CameraMode getCameraMode() {
+ return cameraMode;
+ }
+
+ public void setMaximized(boolean status) {
+ if (status)
+ this.cam.setViewportMode(ViewportMode.STRETCH_TO_FILL);
+ else
+ this.cam.setViewportMode(ViewportMode.RECTANGLE_NO_STRETCH);
+ }
+
+ public boolean isMaximized() {
+ return ViewportMode.STRETCH_TO_FILL.equals(this.cam.getViewportMode());
+ }
+
+
+ /**
+ * @see setter
+ */
+ public float getCameraRenderingSphereRadiusFactor() {
+ return cameraRenderingSphereRadiusFactor;
+ }
+
+ /**
+ * This allows zooming the 3d scene by editing the camera rendering sphere.
+ *
+ * - A value of 1 allows having an AxisBox with corners touching the top/bottom part of the
+ * canvas.
+ *
- A value greater than 1 makes the rendering sphere bigger, hence the AxisBox appears
+ * smaller.
+ *
+ */
+ public void setCameraRenderingSphereRadiusFactor(float cameraRenderingSphereRadiusFactor) {
+ this.cameraRenderingSphereRadiusFactor = cameraRenderingSphereRadiusFactor;
+ }
+
+ public boolean isMaintainAllObjectsInView() {
+ return maintainAllObjectsInView;
+ }
+
+ public void setMaintainAllObjectsInView(boolean maintainAllObjectsInView) {
+ this.maintainAllObjectsInView = maintainAllObjectsInView;
+ }
+
+ public boolean isDisplayAxisWholeBounds() {
+ return displayAxisWholeBounds;
+ }
+
+ public void setDisplayAxisWholeBounds(boolean displayAxisWholeBounds) {
+ this.displayAxisWholeBounds = displayAxisWholeBounds;
+ }
+
+ public Scene getScene() {
+ return scene;
+ }
+
+ public Rectangle getSceneViewportRectangle() {
+ return cam.getRectangle();
+ }
+
+ public ICanvas getCanvas() {
+ return canvas;
+ }
+
+ public Graph getAnnotations() {
+ return annotations.getGraph();
+ }
+
+ public boolean addViewEventListener(IViewEventListener listener) {
+ return viewEventListeners.add(listener);
+ }
+
+ public boolean removeViewOnTopEventListener(IViewEventListener listener) {
+ return viewEventListeners.remove(listener);
+ }
+
+ protected void fireViewOnTopEvent(boolean isOnTop) {
+ ViewIsVerticalEvent e = new ViewIsVerticalEvent(this);
+
+ if (isOnTop)
+ for (IViewEventListener listener : viewEventListeners)
+ listener.viewVerticalReached(e);
+ else
+ for (IViewEventListener listener : viewEventListeners)
+ listener.viewVerticalLeft(e);
+ }
+
+ protected void fireViewFirstRenderStarts() {
+ for (IViewEventListener listener : viewEventListeners)
+ listener.viewFirstRenderStarts();
+ }
+
+ public boolean addViewPointChangedListener(IViewPointChangedListener listener) {
+ return viewPointChangedListeners.add(listener);
+ }
+
+ public boolean removeViewPointChangedListener(IViewPointChangedListener listener) {
+ return viewPointChangedListeners.remove(listener);
+ }
+
+ protected void fireViewPointChangedEvent(ViewPointChangedEvent e) {
+ for (IViewPointChangedListener vp : viewPointChangedListeners)
+ vp.viewPointChanged(e);
+ }
+
+ public boolean addViewLifecycleChangedListener(IViewLifecycleEventListener listener) {
+ return viewLifecycleListeners.add(listener);
+ }
+
+ public boolean removeViewLifecycleChangedListener(IViewLifecycleEventListener listener) {
+ return viewLifecycleListeners.remove(listener);
+ }
+
+ protected void fireViewLifecycleHasInit(ViewLifecycleEvent e) {
+ for (IViewLifecycleEventListener vp : viewLifecycleListeners)
+ vp.viewHasInit(e);
+ }
+
+ protected void fireViewLifecycleWillRender(ViewLifecycleEvent e) {
+ for (IViewLifecycleEventListener vp : viewLifecycleListeners)
+ vp.viewWillRender(e);
+ }
+
+ protected void fireViewLifecycleHasRendered(ViewLifecycleEvent e) {
+ for (IViewLifecycleEventListener vp : viewLifecycleListeners)
+ vp.viewHasRendered(e);
+ }
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DLayout.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DLayout.java
index 0a879a46e..613ffd15a 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DLayout.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DLayout.java
@@ -1,5 +1,7 @@
package org.jzy3d.plot3d.rendering.view;
+import org.apache.commons.collections4.Get;
+import org.jzy3d.maths.Margin;
/**
* Allows configuring the layout of a view when the chart enters a 2D rendering mode.
@@ -24,22 +26,15 @@ public class View2DLayout {
protected boolean symetricVerticalMargin = false;
/** Distance between axis and tick labels (hence, length of the tick) */
- protected float xTickLabelsDistance = 0;
+ protected float horizontalTickLabelsDistance = 0;
/** Distance between tick labels and axis label */
- protected float xAxisLabelsDistance = 0;
+ protected float horizontalAxisLabelsDistance = 0;
/** Distance between axis and tick labels (hence, length of the tick) */
- protected float yTickLabelsDistance = 0;
+ protected float verticalTickLabelsDistance = 0;
/** Distance between tick labels and axis label */
- protected float yAxisLabelsDistance = 0;
+ protected float verticalAxisLabelsDistance = 0;
- /** Extra margin */
- protected float marginLeft = 0;
- /** Extra margin */
- protected float marginRight = 0;
- /** Extra margin */
- protected float marginTop = 0;
- /** Extra margin */
- protected float marginBottom = 0;
+ protected Margin margin = new Margin();
public View2DLayout(View view) {
@@ -58,68 +53,52 @@ public void setSymetricMargin(boolean symetricMargin) {
public void setTickLabelDistance(float dist) {
- setxTickLabelsDistance(dist);
- setyTickLabelsDistance(dist);
+ setHorizontalTickLabelsDistance(dist);
+ setVerticalTickLabelsDistance(dist);
}
public void setAxisLabelDistance(float dist) {
- setxAxisLabelsDistance(dist);
- setyAxisLabelsDistance(dist);
+ setHorizontalAxisLabelsDistance(dist);
+ setVerticalAxisLabelsDistance(dist);
}
- public void setMargin(float margin) {
+ /**
+ * A convenient shortcut to set the same margin to left, right, bottom and right canvas borders.
+ *
+ * @see {@link #getMargin()}
+ */
+ public void setMargin(int margin) {
setMarginHorizontal(margin);
setMarginVertical(margin);
}
-
+
/**
- * Set the same margin to left and right canvas borders
+ * A convenient shortcut to set the same margin to left and right canvas borders.
+ *
+ * @see {@link #getMargin()}
*/
- public void setMarginHorizontal(float margin) {
- setMarginLeft(margin);
- setMarginRight(margin);
+ public void setMarginHorizontal(int margin) {
+ this.margin.setWidth(margin*2);
}
/**
- * Set the same margin to top and bottom canvas borders
+ * A convenient shortcut to set the same margin to top and bottom canvas borders.
+ *
+ * @see {@link #getMargin()}
*/
- public void setMarginVertical(float margin) {
- setMarginTop(margin);
- setMarginBottom(margin);
- }
-
- public float getMarginLeft() {
- return marginLeft;
- }
-
- public void setMarginLeft(float marginLeft) {
- this.marginLeft = marginLeft;
- }
-
- public float getMarginRight() {
- return marginRight;
+ public void setMarginVertical(int margin) {
+ this.margin.setHeight(margin*2);
}
- public void setMarginRight(float marginRight) {
- this.marginRight = marginRight;
- }
- public float getMarginTop() {
- return marginTop;
+ public Margin getMargin() {
+ return margin;
}
- public void setMarginTop(float marginTop) {
- this.marginTop = marginTop;
+ public void setMargin(Margin margin) {
+ this.margin = margin;
}
-
- public float getMarginBottom() {
- return marginBottom;
- }
-
- public void setMarginBottom(float marginBottom) {
- this.marginBottom = marginBottom;
- }
-
+
public boolean isTextAddMargin() {
return textAddMargin;
}
@@ -129,40 +108,38 @@ public void setTextAddMargin(boolean keepTextVisible) {
this.textAddMargin = keepTextVisible;
}
-
-
- public float getxTickLabelsDistance() {
- return xTickLabelsDistance;
+ public float getHorizontalTickLabelsDistance() {
+ return horizontalTickLabelsDistance;
}
- public void setxTickLabelsDistance(float xAxisTickLabelsDistance) {
- this.xTickLabelsDistance = xAxisTickLabelsDistance;
+ public void setHorizontalTickLabelsDistance(float horizontalAxisLabelsDistance) {
+ this.horizontalTickLabelsDistance = horizontalAxisLabelsDistance;
}
- public float getxAxisLabelsDistance() {
- return xAxisLabelsDistance;
+ public float getHorizontalAxisLabelsDistance() {
+ return horizontalAxisLabelsDistance;
}
/** Distance between tick labels and axis label */
- public void setxAxisLabelsDistance(float xAxisNameLabelsDistance) {
- this.xAxisLabelsDistance = xAxisNameLabelsDistance;
+ public void setHorizontalAxisLabelsDistance(float horizontalAxisLabelsDistance) {
+ this.horizontalAxisLabelsDistance = horizontalAxisLabelsDistance;
}
- public float getyTickLabelsDistance() {
- return yTickLabelsDistance;
+ public float getVerticalTickLabelsDistance() {
+ return verticalTickLabelsDistance;
}
- public void setyTickLabelsDistance(float yAxisTickLabelsDistance) {
- this.yTickLabelsDistance = yAxisTickLabelsDistance;
+ public void setVerticalTickLabelsDistance(float verticalAxisLabelsDistance) {
+ this.verticalTickLabelsDistance = verticalAxisLabelsDistance;
}
- public float getyAxisLabelsDistance() {
- return yAxisLabelsDistance;
+ public float getVerticalAxisLabelsDistance() {
+ return verticalAxisLabelsDistance;
}
/** Distance between tick labels and axis label */
- public void setyAxisLabelsDistance(float yAxisNameLabelsDistance) {
- this.yAxisLabelsDistance = yAxisNameLabelsDistance;
+ public void setVerticalAxisLabelsDistance(float verticalAxisLabelsDistance) {
+ this.verticalAxisLabelsDistance = verticalAxisLabelsDistance;
}
public boolean isSymetricHorizontalMargin() {
@@ -184,4 +161,31 @@ public void setSymetricVerticalMargin(boolean symetricVerticalMargin) {
public void apply() {
view.getChart().render();
}
+
+ public View2DLayout clone() {
+ View2DLayout to = new View2DLayout(view);
+ return copy(this, to);
+ }
+
+ public void applySettings(View2DLayout source) {
+ copy(source, this);
+ }
+
+ protected View2DLayout copy(View2DLayout from, View2DLayout to) {
+
+ to.setHorizontalAxisLabelsDistance(from.getHorizontalAxisLabelsDistance());
+ to.setVerticalAxisLabelsDistance(from.getVerticalAxisLabelsDistance());
+
+ to.setHorizontalTickLabelsDistance(from.getHorizontalTickLabelsDistance());
+ to.setVerticalTickLabelsDistance(from.getVerticalTickLabelsDistance());
+
+ to.setSymetricHorizontalMargin(from.isSymetricHorizontalMargin());
+ to.setSymetricVerticalMargin(from.isSymetricVerticalMargin());
+
+ to.setTextAddMargin(from.isTextAddMargin());
+
+ to.setMargin(from.getMargin());
+
+ return to;
+ }
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DProcessing.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DProcessing.java
index 5cea14275..87d0845de 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DProcessing.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/View2DProcessing.java
@@ -1,16 +1,18 @@
package org.jzy3d.plot3d.rendering.view;
-import org.jzy3d.chart.ChartView;
+import java.util.List;
import org.jzy3d.maths.Area;
import org.jzy3d.maths.BoundingBox3d;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
+import org.jzy3d.maths.Margin;
import org.jzy3d.painters.Font;
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.primitives.axis.AxisLabelProcessor;
import org.jzy3d.plot3d.primitives.axis.AxisTickProcessor;
import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
import org.jzy3d.plot3d.primitives.axis.layout.LabelOrientation;
-import org.jzy3d.plot3d.rendering.view.layout.IViewportLayout;
+import org.jzy3d.plot3d.rendering.legends.ILegend;
import org.jzy3d.plot3d.rendering.view.layout.ViewAndColorbarsLayout;
/**
@@ -37,10 +39,23 @@ public class View2DProcessing {
protected View view;
// each text occupation given in pixels
- protected float tickTextHorizontal = 0;
- protected float tickTextVertical = 0;
- protected float axisTextHorizontal = 0;
- protected float axisTextVertical = 0;
+ protected float tickTextWidth = 0;
+ protected float tickTextHeight = 0;
+ protected float axisTextWidth = 0;
+ protected float axisTextHeight = 0;
+
+ // each distance multiplied by pixel scale
+ protected float horizontalTickDistance;
+ protected float horizontalAxisDistance;
+ protected float verticalTickDistance;
+ protected float verticalAxisDistance;
+
+ // each margin given in pixels
+ protected float marginLeftPxScaled = 0;
+ protected float marginRightPxScaled = 0;
+ protected float marginTopPxScaled = 0;
+ protected float marginBottomPxScaled = 0;
+
// each margin given in pixels
protected float marginLeftPx = 0;
@@ -56,7 +71,7 @@ public class View2DProcessing {
// the overall margins on the width and height, summing all margin of each dimension
- protected Area margin;
+ protected Area area;
protected Coord2d modelToScreen;
@@ -77,15 +92,30 @@ public void apply(ViewportConfiguration viewport, BoundingBox3d bounds) {
View2DLayout view2DLayout = view.get2DLayout();
Font font = axisLayout.getFont();
+
+ boolean isEmulGL = !view.getCanvas().isNative();
// ---------------------------------------------------
// initialize all margins according to configuration
- marginLeftPx = view2DLayout.marginLeft;
- marginRightPx = view2DLayout.marginRight;
- marginTopPx = view2DLayout.marginTop;
- marginBottomPx = view2DLayout.marginBottom;
-
+ marginLeftPxScaled = view2DLayout.getMargin().getLeft() * pixelScale.x;
+ marginRightPxScaled = view2DLayout.getMargin().getRight() * pixelScale.x;
+ marginTopPxScaled = view2DLayout.getMargin().getTop() * pixelScale.y;
+ marginBottomPxScaled = view2DLayout.getMargin().getBottom() * pixelScale.y;
+
+ if(isEmulGL) {
+ marginLeftPxScaled /= pixelScale.x;
+ marginRightPxScaled /= pixelScale.x;
+ marginTopPxScaled /= pixelScale.y;
+ marginBottomPxScaled /= pixelScale.y;
+ }
+
+ marginLeftPx = marginLeftPxScaled;
+ marginRightPx = marginRightPxScaled;
+ marginTopPx = marginTopPxScaled;
+ marginBottomPx = marginBottomPxScaled;
+
+ //System.err.println("View2DP : Margin : " + view2DLayout.getMargin());
// ---------------------------------------------------
// compute pixel occupation of ticks and axis labels
@@ -93,26 +123,26 @@ public void apply(ViewportConfiguration viewport, BoundingBox3d bounds) {
if (view2DLayout.textAddMargin) {
// consider space occupied by tick labels
- tickTextHorizontal = axisLayout.getMaxYTickLabelWidth(painter);
- tickTextVertical = font.getHeight();
-
+ tickTextWidth = axisLayout.getMaxYTickLabelWidth(painter);
+ tickTextHeight = font.getHeight();
// consider space occupied by the Y axis label
if (LabelOrientation.HORIZONTAL.equals(axisLayout.getYAxisLabelOrientation())) {
// horizontal Y axis involves considering the axis label width
- axisTextHorizontal = painter.getTextLengthInPixels(font, axisLayout.getYAxisLabel());
+ axisTextWidth = painter.getTextLengthInPixels(font, axisLayout.getYAxisLabel());
} else {
// vertical Y axis involves considering the axis label font height
- axisTextHorizontal = font.getHeight();
+ axisTextWidth = font.getHeight();
}
// consider space occupied by the X axis label, which is always horizontal
- axisTextVertical = font.getHeight();
+ axisTextHeight = font.getHeight();
+
} else {
- tickTextHorizontal = 0;
- tickTextVertical = 0;
- axisTextHorizontal = 0;
- axisTextVertical = 0;
+ tickTextWidth = 0;
+ tickTextHeight = 0;
+ axisTextWidth = 0;
+ axisTextHeight = 0;
}
// ------------------------------------------------
@@ -121,26 +151,47 @@ public void apply(ViewportConfiguration viewport, BoundingBox3d bounds) {
// according to pixel scale
// ------------------------------------------------
- if (!view.getCanvas().isNative()) {
- tickTextVertical /= pixelScale.y;
- axisTextVertical /= pixelScale.y;
- tickTextHorizontal /= pixelScale.x;
- axisTextHorizontal /= pixelScale.x;
+ if (isEmulGL) {
+
+ // Accurate Vertical axis layout
+ tickTextWidth /= pixelScale.x;
+ axisTextWidth /= pixelScale.x;
+
+ // Accurate Horizontal axis layout
+ tickTextHeight /= (pixelScale.y);
+ axisTextHeight /= (pixelScale.y);
}
// ---------------------------------------------------
// add space for text to the left margin
+
+ verticalTickDistance = view2DLayout.verticalTickLabelsDistance * pixelScale.x;
+ verticalAxisDistance = view2DLayout.verticalAxisLabelsDistance * pixelScale.x;
+
+ horizontalTickDistance = view2DLayout.horizontalTickLabelsDistance * pixelScale.y;
+ horizontalAxisDistance = view2DLayout.horizontalAxisLabelsDistance * pixelScale.y;
+
+ if(isEmulGL) {
+ verticalTickDistance /= pixelScale.x;
+ verticalAxisDistance /= pixelScale.x;
+ horizontalTickDistance /= pixelScale.y;
+ horizontalAxisDistance /= pixelScale.y;
+ }
- marginLeftPx += view2DLayout.yTickLabelsDistance; // add tick label distance
- marginLeftPx += tickTextHorizontal; // add maximum Y tick label width
- marginLeftPx += view2DLayout.yAxisLabelsDistance; // add axis label distance
- marginLeftPx += axisTextHorizontal; // add text width of axis label
+
+ marginLeftPx += verticalTickDistance; // add tick label distance
+ marginLeftPx += tickTextWidth; // add maximum Y tick label width
+ marginLeftPx += verticalAxisDistance; // add axis label distance
+ marginLeftPx += axisTextWidth; // add text width of axis label
// add space for text to the bottom margin
- marginBottomPx += view2DLayout.xTickLabelsDistance;
- marginBottomPx += tickTextVertical;
- marginBottomPx += view2DLayout.xAxisLabelsDistance;
- marginBottomPx += axisTextVertical;
+ marginBottomPx += horizontalTickDistance;
+ marginBottomPx += tickTextHeight;
+ marginBottomPx += horizontalAxisDistance;
+ marginBottomPx += axisTextHeight;
+
+ //System.err.println("V2DProc : axisTextHeight : " + axisTextHeight + " tickHeight " + tickTextHeight + " H tick " + horizontalTickDistance + " H axis " + horizontalAxisDistance + " BOTTOM = " + marginBottomPx);
+ //System.err.println("V2DProc : axisTextWidth : " + axisTextWidth + " tickWidth " + tickTextWidth);
// ---------------------------------------------------
// case of a symetric layout requirement
@@ -162,23 +213,23 @@ public void apply(ViewportConfiguration viewport, BoundingBox3d bounds) {
// view's viewport
// ------------------------------------------------
- if (!view.getCanvas().isNative()) {
- if (view instanceof ChartView) {
- IViewportLayout layout = ((ChartView) view).getLayout();
- if (layout instanceof ViewAndColorbarsLayout) {
- float legendWidth = ((ViewAndColorbarsLayout) layout).getLegendsWidth();
- legendWidth /= pixelScale.x;
- marginRightPx += legendWidth;
- }
+ if (isEmulGL) {
+ List legends = view.getChart().getScene().getGraph().getLegends();
+
+ for(ILegend legend: legends) {
+ legend.updateMinimumDimension(painter);
+ Dimension minDim = legend.getMinimumDimension();
+ //System.out.println("View2DProcessing minDim " + minDim.width);
+ marginRightPx += minDim.width;
}
}
// ---------------------------------------------------
// The actual processing of margin
- margin = new Area(marginLeftPx + marginRightPx, marginTopPx + marginBottomPx);
+ area = new Area(marginLeftPx + marginRightPx, marginTopPx + marginBottomPx);
- modelToScreen = getModelToScreenRatio(bounds, viewport, margin);
+ modelToScreen = getModelToScreenRatio(bounds, viewport, area);
// convert pixel margin to world coordinate to add compute the additional 3D space to grasp with
// the camera
@@ -300,14 +351,14 @@ public Coord2d getModelToScreenRatio(Area space, Area canvas, Area margins) {
float x = 1;
- if (margin.width != 0 && (canvas.width != margins.width)) {
+ if (area.width != 0 && (canvas.width != margins.width)) {
x = (((space.width * canvas.width) / (canvas.width - margins.width)) - space.width)
/ margins.width;
}
float y = 1;
- if (margin.height != 0 && (canvas.height != margins.height)) {
+ if (area.height != 0 && (canvas.height != margins.height)) {
y = (((space.height * canvas.height) / (canvas.height - margins.height)) - space.height)
/ margins.height;
@@ -339,40 +390,40 @@ public Coord2d getModelToScreenRatio(BoundingBox3d bounds, ViewportConfiguration
* Return the overall margin that was processed at the latest call to {@link #apply()} according
* to the axis and view layout settings
*/
- public Area getMargin() {
- return new Area(margin);
+ public Area getArea() {
+ return new Area(area);
}
/**
* Return the tick label width in pixel that was processed at the latest call to {@link #apply()}
* according to the axis and view layout settings
*/
- public float getTickTextHorizontal() {
- return tickTextHorizontal;
+ public float getTickTextWidth() {
+ return tickTextWidth;
}
/**
* Return the tick label height in pixel that was processed at the latest call to {@link #apply()}
* according to the axis and view layout settings
*/
- public float getTickTextVertical() {
- return tickTextVertical;
+ public float getTickTextHeight() {
+ return tickTextHeight;
}
/**
* Return the axis label width in pixel that was processed at the latest call to {@link #apply()}
* according to the axis and view layout settings
*/
- public float getAxisTextHorizontal() {
- return axisTextHorizontal;
+ public float getAxisTextWidth() {
+ return axisTextWidth;
}
/**
* Return the axis label height in pixel that was processed at the latest call to {@link #apply()}
* according to the axis and view layout settings
*/
- public float getAxisTextVertical() {
- return axisTextVertical;
+ public float getAxisTextHeight() {
+ return axisTextHeight;
}
/**
@@ -381,5 +432,37 @@ public float getAxisTextVertical() {
public Coord2d getModelToScreen() {
return modelToScreen;
}
+
+ /** Return the margin in pixels, as defined in settings */
+ public Margin getMarginPx() {
+ return new Margin(marginLeftPx, marginRightPx, marginTopPx, marginBottomPx);
+ }
+
+ /** Return the margin in pixels, already scaled according to pixel scale */
+ public Margin getMarginPxScaled() {
+ return new Margin(marginLeftPxScaled, marginRightPxScaled, marginTopPxScaled, marginBottomPxScaled);
+ }
+
+ /** Return the distance of tick labels to axis, already scaled according to pixel scale */
+ public float getHorizontalTickDistance() {
+ return horizontalTickDistance;
+ }
+
+ /** Return the distance of axis label to tick labels, already scaled according to pixel scale */
+ public float getHorizontalAxisDistance() {
+ return horizontalAxisDistance;
+ }
+
+ /** Return the distance of tick labels to axis, already scaled according to pixel scale */
+ public float getVerticalTickDistance() {
+ return verticalTickDistance;
+ }
+
+ /** Return the distance of axis label to tick labels, already scaled according to pixel scale */
+ public float getVerticalAxisDistance() {
+ return verticalAxisDistance;
+ }
+
+
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/ViewportConfiguration.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/ViewportConfiguration.java
index 44716dcd3..c22a1b4a3 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/ViewportConfiguration.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/ViewportConfiguration.java
@@ -11,6 +11,12 @@
* @author Martin Pernollet
*/
public class ViewportConfiguration {
+ protected int width;
+ protected int height;
+ protected int x;
+ protected int y;
+ protected ViewportMode mode;
+
public ViewportConfiguration(int width, int height) {
this.width = width;
this.height = height;
@@ -78,12 +84,12 @@ public void setMode(ViewportMode mode) {
@Override
public String toString() {
- return "(ViewPort) width=" + width + " height=" + height + " x=" + x + " y=" + y + " mode=" + mode;
+ return "width=" + width + " height=" + height + " x=" + x + " y=" + y + " mode=" + mode;
+ }
+
+ public ViewportConfiguration clone() {
+ ViewportConfiguration vc = new ViewportConfiguration(x, y, width, height);
+ vc.setMode(mode);
+ return vc;
}
-
- protected int width;
- protected int height;
- protected int x;
- protected int y;
- protected ViewportMode mode;
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/layout/IViewportLayout.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/layout/IViewportLayout.java
index 18df2ee3b..78eeb87fa 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/layout/IViewportLayout.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/layout/IViewportLayout.java
@@ -2,9 +2,9 @@
import org.jzy3d.chart.Chart;
import org.jzy3d.painters.IPainter;
+import org.jzy3d.plot3d.rendering.view.View;
public interface IViewportLayout {
public void update(Chart chart);
-
public void render(IPainter painter, Chart chart);
}
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/layout/ViewAndColorbarsLayout.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/layout/ViewAndColorbarsLayout.java
index 3c0476dd2..9e2950279 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/layout/ViewAndColorbarsLayout.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/rendering/view/layout/ViewAndColorbarsLayout.java
@@ -4,6 +4,7 @@
// import java.awt.Rectangle;
import java.util.List;
import org.jzy3d.chart.Chart;
+import org.jzy3d.maths.Coord2d;
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.primitives.Drawable;
import org.jzy3d.plot3d.rendering.canvas.ICanvas;
@@ -36,7 +37,7 @@
*/
public class ViewAndColorbarsLayout implements IViewportLayout {
protected float screenSeparator = 1.0f;
- protected boolean hasMeta = true;
+ protected boolean hasColorbars = false;
protected ViewportConfiguration sceneViewport;
protected ViewportConfiguration backgroundViewport;
@@ -44,41 +45,46 @@ public class ViewAndColorbarsLayout implements IViewportLayout {
// stored at render time for later layout processing
protected float legendsWidth = 0;
-
- /**
- * This shrink colorbar is actually not supported by this implementation but made available and
- * used by classes that inherit this class
- */
- protected boolean shrinkColorbar = false;
- protected int colorbarRightMargin = 10;
protected Chart chart;
+
+ public Chart getChart() {
+ return chart;
+ }
+
+ public void setChart(Chart chart) {
+ this.chart = chart;
+ }
@Override
public void update(Chart chart) {
this.chart = chart;
- final ICanvas canvas = chart.getCanvas();
- final List list = getLegends(chart);
+
+ IPainter painter = chart.getPainter();
+ ICanvas canvas = chart.getCanvas();
+ List list = getLegends();
- computeSeparator(canvas, list);
+ computeSeparator(painter, canvas, list);
+
sceneViewport = ViewportBuilder.column(canvas, 0, screenSeparator);
backgroundViewport = new ViewportConfiguration(canvas);
}
// Separator only used for native since emulgl can not have two viewport side by side,
// only a single viewport with images rendered on top
- protected void computeSeparator(final ICanvas canvas, final List list) {
- hasMeta = list.size() > 0;
- if (hasMeta) {
- int minwidth = 0;
- for (ILegend data : list) {
- minwidth += data.getMinimumDimension().width;
- }
+ protected void computeSeparator(IPainter painter, ICanvas canvas, List legends) {
+ hasColorbars = legends.size() > 0;
+
+ if (hasColorbars) {
- minwidth *= chart.getView().getPixelScale().x;
-
+ int minWidth = 0;
- screenSeparator =
- ((float) (canvas.getRendererWidth() - minwidth)) / ((float) canvas.getRendererWidth());/// 0.7f;
+ for (ILegend legend : legends) {
+ minWidth += updateAndGetMinDimensions(painter, legend);
+
+ //System.out.println("ViewAndColorbarsLayout : legend.minDim : " + legend.getMinimumDimension() + " minWidth:" +minWidth );
+ }
+
+ screenSeparator = computeSeparator(canvas, minWidth);
} else {
@@ -86,11 +92,32 @@ protected void computeSeparator(final ICanvas canvas, final List list)
}
}
+ protected int updateAndGetMinDimensions(IPainter painter, ILegend legend) {
+ // here we don't need to consider pixel scale as the colorbar
+ // is already returning a dimension considering pixel scale.
+ legend.updateMinimumDimension(painter);
+
+ return legend.getMinimumDimension().width;
+ }
+
+ protected float computeSeparator(final ICanvas canvas, int minWidth) {
+ int width = Math.round(canvas.getRendererWidth());
+
+ if(width==0)
+ throw new IllegalArgumentException("Canvas has no width!");
+
+ return ((float) (width - minWidth)) / width;
+ }
+
/**
* Once rendered, this layout knows the colorbar width which can be retrieved with {@link #getLegendsWidth()}
*/
@Override
public void render(IPainter painter, Chart chart) {
+ renderView(painter, chart);
+ }
+
+ protected void renderView(IPainter painter, Chart chart) {
View view = chart.getView();
// System.out.println("ViewAndColorbarLayout w:" + chart.getCanvas().getRendererWidth() + " h:"
@@ -118,44 +145,95 @@ public void render(IPainter painter, Chart chart) {
}
protected void renderLegends(IPainter painter, Chart chart) {
- if (hasMeta) {
- legendsWidth = screenSeparator * chart.getCanvas().getRendererWidth();
-
- //legendsWidth /= chart.getView().getPixelScale().x;
+ if (hasColorbars) {
+ updateLegendsWidth(chart);
- renderLegends(painter, screenSeparator, 1.0f, getLegends(chart), chart.getCanvas());
+ renderLegends(painter, screenSeparator, 1.0f, getLegends(), chart.getCanvas());
} else {
legendsWidth = 0;
}
}
+ protected void updateLegendsWidth(Chart chart) {
+ legendsWidth = (1-screenSeparator) * chart.getCanvas().getRendererWidth();
+ }
+
/**
- * Renders the legend within the screen slice given by the left and right parameters.
+ * Renders the legends within the screen slice given by the left and right parameters.
*/
protected void renderLegends(IPainter painter, float left, float right, List legends,
ICanvas canvas) {
float slice = (right - left) / legends.size();
int k = 0;
for (ILegend legend : legends) {
-
+
int width = canvas.getRendererWidth();
int height = canvas.getRendererHeight();
+
+ // This workaround for Windows+AWT (only) allow scaling viewport to
+ // fix a pixel scale error. It must be taken into account to get
+ // a colorbar properly scaled
+
+ Coord2d s = AbstractViewportManager.getWindowsHiDPIScale_Workaround(painter);
+ //System.out.println("ViewAndColorbars : hackScale:" + s);
+ if(hackWindowsAWTColorbarWidth) {
+ width = Math.round(canvas.getRendererWidth()*s.x);
+ }
+ if(hackWindowsAWTColorbarHeight) {
+ height = Math.round(canvas.getRendererHeight()*s.y);
+ }
+
+ // create left/right per legend
float theLeft = left + slice * (k++);
float theRight = left + slice * k;
-
+
+ //System.out.println("ViewAndColorbars : width:" + width + " height:" + height);
+ //System.out.println("ViewAndColorbars : TheLeft:" + theLeft + " TheRight:" + theRight);
+
+ //((AbstractViewportManager)legend).setApplyWindowsHiDPIWorkaround(true);
+
legend.setFont(painter.getView().getAxis().getLayout().getFont());
legend.setViewportMode(ViewportMode.STRETCH_TO_FILL);
+
+ if(hackWindowsAWTColorbarHeight && s.y>1) {
+ // We can not find a good yOffset so we keep this for later
+ AbstractViewportManager legendViewportHack = (AbstractViewportManager)legend;
+
+ int yOffset = Math.round(-canvas.getRendererHeight()/(s.y*2));
+
+ //int yOffset = Math.round(-(canvas.getRendererHeight()+legend.getMargin().getBottom()/2f)/(s.y*2));
+ //int yOffset = Math.round(-(canvas.getRendererHeight()-legend.getMargin().getTop()*s.y*2)/(s.y*2));
+
+ //System.out.println("ViewAndColorbars : hackOffset:" + yOffset);
+ legendViewportHack.setScreenYOffset(yOffset);
+ // NEED TO COMMENT AbstractViewportManager.applyViewportRectangle / screenYOffset = 0
+ }
+
legend.setViewPort(width, height, theLeft, theRight);
+
legend.render(painter);
+
}
}
+ boolean hackWindowsAWTColorbarWidth = true;
+ boolean hackWindowsAWTColorbarHeight = false;
+
+ public List getLegends() {
+ return getLegends(chart);
+ }
+
protected List getLegends(Chart chart) {
- if (chart != null && chart.getScene() != null && chart.getScene().getGraph() != null
- && chart.getScene().getGraph().getLegends() != null)
- return chart.getScene().getGraph().getLegends();
- else
- return new ArrayList<>();
+
+ List legends = null;
+
+ if(chart != null && chart.getScene() != null && chart.getScene().getGraph() != null
+ && chart.getScene().getGraph().getLegends() != null) {
+ legends = chart.getScene().getGraph().getLegends();
+ }else
+ legends = new ArrayList<>();
+
+ return legends;
}
/**
@@ -170,46 +248,6 @@ public ViewportConfiguration getBackgroundViewport() {
return backgroundViewport;
}
- public boolean isShrinkColorbar() {
- return shrinkColorbar;
- }
-
- /**
- * If true, will let the colorbar be as thin as possible and stick to the right of the chart.
- *
- * If the input value is different than internal state, then the chart will be updated to ensure
- * the setting takes effect immediately.
- */
- public void setShrinkColorbar(boolean shrinkColorbar) {
- boolean updateDisplay = (shrinkColorbar != this.shrinkColorbar);
-
- this.shrinkColorbar = shrinkColorbar;
-
- if (updateDisplay && chart != null) {
- chart.render();
- }
- }
-
- public int getColorbarRightMargin() {
- return colorbarRightMargin;
- }
-
- /**
- * Set a right margin for colorbar.
- *
- * If the input value is different than internal state, then the chart will be updated to ensure
- * the setting takes effect immediately.
- */
- public void setColorbarRightMargin(int colorbarRightMargin) {
- boolean updateDisplay = (colorbarRightMargin != this.colorbarRightMargin);
-
- this.colorbarRightMargin = colorbarRightMargin;
-
- if (updateDisplay) {
- chart.render();
- }
- }
-
/**
* Return the legend width as it was processed at the rendering stage. Hence this value is defined
* after a first rendering. It is used for processing the remaining part of the layout (other
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/TextRenderer.java b/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/TextRenderer.java
index 1f9a88294..ccdd94621 100644
--- a/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/TextRenderer.java
+++ b/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/TextRenderer.java
@@ -8,6 +8,7 @@
import org.jzy3d.maths.Coord3d;
import org.jzy3d.painters.Font;
import org.jzy3d.painters.IPainter;
+import org.jzy3d.plot3d.primitives.Point;
import org.jzy3d.plot3d.text.AbstractTextRenderer;
import org.jzy3d.plot3d.text.ITextRenderer;
import org.jzy3d.plot3d.text.align.Horizontal;
@@ -16,7 +17,8 @@
/**
* The {@link ITextRenderer} computes text layout according to {@link Horizontal}, {@link Vertical}
- * settings, text length, font size and text position. This is achieved with the help of {@link TextLayout} processor.
+ * settings, text length, font size and text position. This is achieved with the help of
+ * {@link TextLayout} processor.
*
* It can be given a 2D offset in screen coordinates and a 3D offset in world coordinates that are
* applied after the initial layout is processed according to the settings, the text length, the
@@ -27,12 +29,21 @@
* Rendering text relies on {@link IPainter#drawText(Font, String, Coord3d, Color, float)} which was
* introduced as of Jzy3D 2.0 and offers much more flexibility than the initial simple
* {@link IPainter#glutBitmapString(int, String)} which only support two fonts.
+ *
+ * Rotation of a text is always made from the center of the text, whatever the LEFT/CENTER/RIGHT
+ * layout of the text, which lead to all these possible layouts.
+ *
+ *
+ *
+ * This image was generated with {@link ITTest_Text#main()}
*/
public class TextRenderer extends AbstractTextRenderer implements ITextRenderer {
protected static Logger LOGGER = LogManager.getLogger(TextRenderer.class);
protected TextLayout layout = new TextLayout();
+ protected boolean showPositionDebug = false;
+
/**
* Draw a string at the specified position and return the 3d volume occupied by the string
* according to the current Camera configuration.
@@ -67,12 +78,17 @@ public BoundingBox3d drawText(IPainter painter, Font font, String text, Coord3d
// Draws actual string
painter.drawText(font, text, positionAligned, color, rotation);
// Formerly : painter.glutBitmapString(font, text, positionAligned, color);
-
+
+ if (showPositionDebug) {
+ Point p = new Point(position, Color.RED);
+ p.setWidth(5);
+ p.draw(painter);
+ }
// Return text bounds
return computeTextBounds(painter, font, screenAligned, textWidth);
}
-
+
/** Convert a 2D screen position to 3D world coordinate */
protected Coord3d to3D(IPainter painter, Coord3d screen) {
diff --git a/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/doc-files/text-rotation.png b/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/doc-files/text-rotation.png
new file mode 100644
index 000000000..275c97485
Binary files /dev/null and b/jzy3d-core/src/main/java/org/jzy3d/plot3d/text/renderers/doc-files/text-rotation.png differ
diff --git a/jzy3d-core/src/test/java/org/jzy3d/maths/TestMargins.java b/jzy3d-core/src/test/java/org/jzy3d/maths/TestMargins.java
new file mode 100644
index 000000000..403617970
--- /dev/null
+++ b/jzy3d-core/src/test/java/org/jzy3d/maths/TestMargins.java
@@ -0,0 +1,36 @@
+package org.jzy3d.maths;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestMargins {
+ @Test
+ public void set() {
+ Margin margin = new Margin();
+
+ margin.set(10, 20);
+
+ Assert.assertEquals(5, margin.getLeft(), 0);
+ Assert.assertEquals(5, margin.getRight(), 0);
+ Assert.assertEquals(10, margin.getTop(), 0);
+ Assert.assertEquals(10, margin.getBottom(), 0);
+
+ Assert.assertEquals(10, margin.getWidth(), 0);
+ Assert.assertEquals(20, margin.getHeight(), 0);
+
+
+ margin.setWidth(100);
+
+ Assert.assertEquals(50, margin.getLeft(), 0);
+ Assert.assertEquals(50, margin.getRight(), 0);
+ Assert.assertEquals(100, margin.getWidth(), 0);
+
+
+ margin.setHeight(200);
+
+ Assert.assertEquals(100, margin.getTop(), 0);
+ Assert.assertEquals(100, margin.getBottom(), 0);
+ Assert.assertEquals(200, margin.getHeight(), 0);
+
+ }
+}
diff --git a/jzy3d-core/src/test/java/org/jzy3d/mocks/jzy3d/Mocks.java b/jzy3d-core/src/test/java/org/jzy3d/mocks/jzy3d/Mocks.java
index 11974d4b3..9133c6e23 100644
--- a/jzy3d-core/src/test/java/org/jzy3d/mocks/jzy3d/Mocks.java
+++ b/jzy3d-core/src/test/java/org/jzy3d/mocks/jzy3d/Mocks.java
@@ -1,22 +1,62 @@
package org.jzy3d.mocks.jzy3d;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import java.io.File;
import java.io.IOException;
import java.util.List;
+import org.jzy3d.chart.Chart;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
import org.jzy3d.os.OperatingSystem;
import org.jzy3d.os.WindowingToolkit;
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.primitives.axis.AxisBox;
+import org.jzy3d.plot3d.primitives.axis.IAxis;
import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
import org.jzy3d.plot3d.rendering.canvas.ICanvas;
import org.jzy3d.plot3d.rendering.canvas.ICanvasListener;
+import org.jzy3d.plot3d.rendering.scene.Graph;
+import org.jzy3d.plot3d.rendering.scene.Scene;
+import org.jzy3d.plot3d.rendering.view.Camera;
import org.jzy3d.plot3d.rendering.view.View;
import org.mockito.Mockito;
public class Mocks {
+
+ public static Chart Chart(int width, int height, float viewScale) {
+ // Scene graph mocks
+ Graph graph = mock(Graph.class);
+
+ Scene scene = mock(Scene.class);
+ when(scene.getGraph()).thenReturn(graph);
+
+
+ // View, canvas and painter mocks
+ View view = Mocks.ViewAndPainter(viewScale);
+
+ ICanvas canvas = view.getCanvas();
+ when(canvas.getRendererWidth()).thenReturn(width);
+ when(canvas.getRendererHeight()).thenReturn(height);
+
+ IPainter painter = view.getPainter();
+
+
+ //Chart mock
+ Chart chart = Mockito.mock(Chart.class);
+
+ when(chart.getView()).thenReturn(view);
+ when(chart.getScene()).thenReturn(scene);
+ when(chart.getCanvas()).thenReturn(canvas);
+ when(chart.getPainter()).thenReturn(painter);
+
+ return chart;
+ }
+
+
+ // ---------------------------------------
+
public static AxisLayout AxisLayout() {
return mock(AxisLayout.class);
}
@@ -61,20 +101,47 @@ public static View ViewAndPainter(float viewScale) {
public static View ViewAndPainter(float viewScale, String os, String version, Coord2d jvmScale,
Coord2d gpuScale) {
+
+ // Axis
+ AxisLayout axisLayout = new AxisLayout();
+
+ IAxis axis = mock(IAxis.class);
+ when(axis.getLayout()).thenReturn(axisLayout);
+
+
+ // Camera
+ Camera camera = mock(Camera.class);
+
+ // View
View view = mock(View.class);
+
+ when(view.getAxis()).thenReturn(axis);
+ when(view.getCamera()).thenReturn(camera);
when(view.getPixelScale()).thenReturn(new Coord2d(viewScale, viewScale));
+ // Painter
IPainter painter = Painter(os, version);
+ // Canvas
ICanvas canvas = mock(ICanvas.class);
- if (gpuScale != null)
+ if (gpuScale != null) {
when(canvas.getPixelScale()).thenReturn(gpuScale);
+ }
+ else {
+ when(canvas.getPixelScale()).thenReturn(new Coord2d(viewScale, viewScale));
+ }
+
if (jvmScale != null)
when(canvas.getPixelScaleJVM()).thenReturn(jvmScale);
+ // All cross references
+ when(painter.getView()).thenReturn(view);
when(painter.getCanvas()).thenReturn(canvas);
+
+ when(view.getCanvas()).thenReturn(canvas);
when(view.getPainter()).thenReturn(painter);
+
return view;
}
@@ -117,6 +184,12 @@ public int getRendererWidth() {
public int getRendererHeight() {
return 0;
}
+
+ @Override
+ public Dimension getDimension() {
+ return new Dimension(0, 0);
+ }
+
@Override
public void screenshot(File file) throws IOException {}
diff --git a/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestAbstractViewportManager.java b/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestAbstractViewportManager.java
new file mode 100644
index 000000000..20a2cb3ca
--- /dev/null
+++ b/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestAbstractViewportManager.java
@@ -0,0 +1,14 @@
+package org.jzy3d.plot3d.rendering.view;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+public class TestAbstractViewportManager {
+ @Test
+ public void testSliceWidth() {
+ AbstractViewportManager avm = new AbstractViewportManager() {};
+
+ // ensure we properly round the value
+ Assert.assertEquals(220, avm.getSliceWidth(1600, 0.8625f, 1.0f));
+ }
+}
diff --git a/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestCamera.java b/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestCamera.java
index 2c26d35ea..ce17decbb 100644
--- a/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestCamera.java
+++ b/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestCamera.java
@@ -177,7 +177,7 @@ public void renderingPlane() {
// ------------------------------------
// When configure a rendering square
- float CLIP_DIST = 1;
+ //float CLIP_DIST = 1;
BoundingBox2d SQUARE = new BoundingBox2d(-5, +5, -5, +5);
camera.setRenderingSquare(SQUARE);
diff --git a/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestView2DProcessing.java b/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestView2DProcessing.java
index 3b4849cb5..c9741cff7 100644
--- a/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestView2DProcessing.java
+++ b/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/TestView2DProcessing.java
@@ -10,7 +10,6 @@
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
import org.jzy3d.plot3d.primitives.axis.layout.LabelOrientation;
-import org.jzy3d.plot3d.rendering.canvas.ICanvas;
public class TestView2DProcessing {
@@ -25,10 +24,13 @@ public void testView2DProcessing() {
int VIEWPORT_WIDTH = 1000;
int VIEWPORT_HEIGHT = VIEWPORT_WIDTH/2;
+ // scale
+ int pixScale = 1;
+
// layout
- int MARGIN = 10;
- int TICK_DIST = 20;
- int AXIS_DIST = 30;
+ int MARGIN = 10; // distance to canvas border
+ int TICK_DIST = 20; // tick distance to axis border
+ int AXIS_DIST = 30; // axis label distance to tick label
String yAxisLabel = "yLabel_100px_Width";
@@ -52,7 +54,6 @@ public void testView2DProcessing() {
View view = Mocks.View(Mocks.Axis(axisLayout), painter, Mocks.Canvas(true));
-
View2DLayout layout = new View2DLayout(view);
layout.setMargin(MARGIN);
layout.setTickLabelDistance(TICK_DIST);
@@ -65,9 +66,11 @@ public void testView2DProcessing() {
View2DProcessing processing = new View2DProcessing(view);
+ // -----------------------------------------------------------------
// ----------------------------------------
- // When processing margins with a vertical Y AXIS
+ // When processing margins with a vertical Y AXIS, pixel scale = 1
+ when(view.getPixelScale()).thenReturn(new Coord2d(pixScale,pixScale));
when(axisLayout.getYAxisLabelOrientation()).thenReturn(LabelOrientation.VERTICAL);
ViewportConfiguration viewport = new ViewportConfiguration(VIEWPORT_WIDTH, VIEWPORT_HEIGHT, 0, 0);
@@ -76,7 +79,7 @@ public void testView2DProcessing() {
processing.apply(viewport, bounds);
// ----------------------------------------
- // Then
+ // Then margin appropriately processed
Coord2d ratio = new Coord2d(0.02265006, 0.049261093);
@@ -86,12 +89,34 @@ public void testView2DProcessing() {
float xpectWidth = MARGIN*2 + TICK_DIST + Y_TICK_MAX_WIDTH + AXIS_DIST + FONT_HEIGHT;
float xpectHeight = MARGIN*2 + TICK_DIST + FONT_HEIGHT + AXIS_DIST + FONT_HEIGHT;
- Assert.assertEquals(xpectWidth, processing.getMargin().width, 0.1);
- Assert.assertEquals(xpectHeight, processing.getMargin().height, 0.1);
+ Assert.assertEquals(xpectWidth, processing.getArea().width, 0.1);
+ Assert.assertEquals(xpectHeight, processing.getArea().height, 0.1);
+
+
+ // ----------------------------------------
+ // When processing margins with a vertical Y AXIS, pixel scale = 2
+ pixScale = 2;
+ when(view.getPixelScale()).thenReturn(new Coord2d(pixScale,pixScale));
+
+ processing.apply(viewport, bounds);
+
+ // ----------------------------------------
+ // Then margins are larger
+
+ xpectWidth = 2*MARGIN*2 + 2*TICK_DIST + Y_TICK_MAX_WIDTH + 2*AXIS_DIST + FONT_HEIGHT;
+ xpectHeight = 2*MARGIN*2 + 2*TICK_DIST + FONT_HEIGHT + 2*AXIS_DIST + FONT_HEIGHT;
+
+ Assert.assertEquals(xpectWidth, processing.getArea().width, 0.1);
+ Assert.assertEquals(xpectHeight, processing.getArea().height, 0.1);
+
+ // -----------------------------------------------------------------
// ----------------------------------------
- // When processing margins with a horizontal Y AXIS
+ // When processing margins with a horizontal Y AXIS, pixel scale = 1
+ pixScale = 1;
+
+ when(view.getPixelScale()).thenReturn(new Coord2d(pixScale,pixScale));
when(axisLayout.getYAxisLabelOrientation()).thenReturn(LabelOrientation.HORIZONTAL);
processing.apply(viewport, bounds);
@@ -105,10 +130,28 @@ public void testView2DProcessing() {
xpectWidth = MARGIN*2 + TICK_DIST + Y_TICK_MAX_WIDTH + AXIS_DIST + Y_AXIS_WIDTH;
+ xpectHeight = MARGIN*2 + TICK_DIST + FONT_HEIGHT + AXIS_DIST + FONT_HEIGHT;
+
+ Assert.assertEquals(xpectWidth, processing.getArea().width, 0.1);
+ Assert.assertEquals(xpectHeight, processing.getArea().height, 0.1);
+
+ // ----------------------------------------
+ // When processing margins with a horizontal Y AXIS, pixel scale = 2
+
+ pixScale = 2;
+
+ when(view.getPixelScale()).thenReturn(new Coord2d(pixScale,pixScale));
+
+ processing.apply(viewport, bounds);
+
+ // ----------------------------------------
+ // Then margins are larger
- Assert.assertEquals(xpectWidth, processing.getMargin().width, 0.1);
- Assert.assertEquals(xpectHeight, processing.getMargin().height, 0.1);
+ xpectWidth = 2*MARGIN*2 + 2*TICK_DIST + Y_TICK_MAX_WIDTH + 2*AXIS_DIST + Y_AXIS_WIDTH;
+ xpectHeight = 2*MARGIN*2 + 2*TICK_DIST + FONT_HEIGHT + 2*AXIS_DIST + FONT_HEIGHT;
+ Assert.assertEquals(xpectWidth, processing.getArea().width, 0.1);
+ Assert.assertEquals(xpectHeight, processing.getArea().height, 0.1);
}
@@ -149,7 +192,8 @@ public void whenNoMargin_ThenNo_NAN_factor() {
// Given a view with settings
View view = Mocks.View(Mocks.Axis(axisLayout), painter, Mocks.Canvas(true));
-
+ when(view.getPixelScale()).thenReturn(new Coord2d(1,1));
+
View2DLayout layout = new View2DLayout(view);
layout.setMargin(MARGIN);
layout.setTickLabelDistance(TICK_DIST);
@@ -177,8 +221,8 @@ public void whenNoMargin_ThenNo_NAN_factor() {
Assert.assertEquals(1f, processing.getModelToScreen().x, 0.1);
Assert.assertEquals(1f, processing.getModelToScreen().y, 0.1);
- Assert.assertEquals(0, processing.getMargin().width, 0.1);
- Assert.assertEquals(0, processing.getMargin().height, 0.1);
+ Assert.assertEquals(0, processing.getArea().width, 0.1);
+ Assert.assertEquals(0, processing.getArea().height, 0.1);
}
@Test
@@ -218,7 +262,8 @@ public void whenMarginEqualsCanvas_ThenNo_NAN_factor() {
// Given a view with settings
View view = Mocks.View(Mocks.Axis(axisLayout), painter, Mocks.Canvas(true));
-
+ when(view.getPixelScale()).thenReturn(new Coord2d(1,1));
+
View2DLayout layout = new View2DLayout(view);
layout.setMargin(MARGIN);
layout.setTickLabelDistance(TICK_DIST);
@@ -243,7 +288,7 @@ public void whenMarginEqualsCanvas_ThenNo_NAN_factor() {
// ----------------------------------------
// Then
- System.out.println(processing.getModelToScreen());
+ //System.out.println(processing.getModelToScreen());
Assert.assertTrue(Float.isFinite(processing.getModelToScreen().x));
Assert.assertTrue(Float.isFinite(processing.getModelToScreen().y));
diff --git a/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/layout/TestViewAndColorbarsLayout.java b/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/layout/TestViewAndColorbarsLayout.java
new file mode 100644
index 000000000..ac2af0819
--- /dev/null
+++ b/jzy3d-core/src/test/java/org/jzy3d/plot3d/rendering/view/layout/TestViewAndColorbarsLayout.java
@@ -0,0 +1,198 @@
+package org.jzy3d.plot3d.rendering.view.layout;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Assert;
+import org.junit.Test;
+import org.jzy3d.chart.Chart;
+import org.jzy3d.maths.Dimension;
+import org.jzy3d.mocks.jzy3d.Mocks;
+import org.jzy3d.plot3d.rendering.legends.ILegend;
+import org.jzy3d.plot3d.rendering.view.Camera;
+import org.jzy3d.plot3d.rendering.view.TestView2DProcessing;
+import org.jzy3d.plot3d.rendering.view.ViewportMode;
+
+/**
+ * This verify that the {@link ViewAndColorbarsLayout} is able to split the canvas in two area, the
+ * view area on the left and the colorbar area on the right.
+ *
+ * Other tests relating to layout can be found at
+ *
+ * - core/{@link TestView2DProcessing}
+ *
- core/TestCamera_EmulGL_Onscreen
+ *
- core-awt/TestAWTColorbarLegend
+ *
- emulgl-awt/ITTestAWTColorbarLegend
+ *
- emulgl-awt/TestCamera_EmulGL_Offscreen
+ *
- emulgl-awt/TestCameraNative_Viewport
+ *
- native-jogl-core/TestCameraNative_Projection
+ *
+ *
+ * @author Martin
+ *
+ */
+public class TestViewAndColorbarsLayout {
+
+ @Test
+ public void whenNoColorbar_ThenNoColorbarSpace() {
+
+ int WIDTH = 800;
+ int HEIGHT = 600;
+ float SCALE = 1;
+
+ // -------------------------------
+ // Given a chart with NO colorbar
+
+ Chart chart = Mocks.Chart(WIDTH, HEIGHT, SCALE);
+ when(chart.getScene().getGraph().getLegends()).thenReturn(new ArrayList<>());
+
+
+ // -------------------------------
+ // When
+
+ ViewAndColorbarsLayout layout = new ViewAndColorbarsLayout();
+ layout.update(chart);
+
+
+ // --------------------------------
+ // Then layout configured for NO colorbar
+ // and scene will occupy full canvas
+
+ Assert.assertEquals(WIDTH, layout.sceneViewport.getWidth());
+ Assert.assertEquals(HEIGHT, layout.sceneViewport.getHeight());
+
+ Assert.assertEquals(WIDTH, layout.backgroundViewport.getWidth());
+ Assert.assertEquals(HEIGHT, layout.backgroundViewport.getHeight());
+
+ Assert.assertFalse(layout.hasColorbars);
+ Assert.assertEquals(1, layout.screenSeparator, 0.1);
+
+ }
+
+ @Test
+ public void whenColorbars_ThenScreenSeparatorIsProcessed() {
+ ViewAndColorbarsLayout layout = new ViewAndColorbarsLayout();
+
+ whenColorbars_ThenScreenSeparatorIsProcessed(layout, false);
+
+ }
+
+ public void whenColorbars_ThenScreenSeparatorIsProcessed(ViewAndColorbarsLayout layout,
+ boolean isEmulGL) {
+ int WIDTH = 800;
+ int HEIGHT = 600;
+ float SCALE = 1.5f; // pixel ratio not 1
+
+ int CBAR_WIDTH = 100; // width of a single colorbar
+ int CBAR_HEIGHT = 0; // useless in this test
+
+ int numberOfColorbars = 2; // multiple colorbars
+
+ // --------------------------------
+ // Check object under test
+
+ // Assert.assertFalse(layout.isShrinkColorbar());
+
+ // --------------------------------
+ // Given a chart with colorbars
+
+ Chart chart = Mocks.Chart(WIDTH, HEIGHT, SCALE);
+
+
+ // AWTColorbarLegend legend1 = new AWTC
+ // ILegend legend = mock(ILegend.class);
+ ILegend legend = spy(ILegend.class);
+ when(legend.getMinimumDimension()).thenReturn(new Dimension(CBAR_WIDTH, CBAR_HEIGHT));
+
+ // List legends = colorbars(numberOfColorbars, legend);
+
+ Camera camera = spy(Camera.class);
+
+ when(chart.getView().getCamera()).thenReturn(camera);
+
+ when(chart.getScene().getGraph().getLegends()).thenReturn(colorbars(numberOfColorbars, legend));
+
+
+ // --------------------------------
+ // When updating layout
+
+ layout.update(chart);
+
+
+ // --------------------------------
+ // Then layout configured for TWO colorbar
+
+ int expectRightSideWidth = Math.round(CBAR_WIDTH * numberOfColorbars);
+ int expectLeftSideWidth;
+
+ if (isEmulGL) {
+ expectLeftSideWidth = WIDTH;
+ } else {
+ expectLeftSideWidth = WIDTH - expectRightSideWidth;
+ }
+
+ // with scene occupying the whole the canvas MINUS the colorbar widths
+ Assert.assertEquals(expectLeftSideWidth, layout.sceneViewport.getWidth());
+ Assert.assertEquals(HEIGHT, layout.sceneViewport.getHeight());
+
+ // with background occupying full canvas
+ Assert.assertEquals(WIDTH, layout.backgroundViewport.getWidth());
+ Assert.assertEquals(HEIGHT, layout.backgroundViewport.getHeight());
+
+ Assert.assertTrue(layout.hasColorbars);
+
+
+ float expectSeparator = 1f * (WIDTH - expectRightSideWidth) / WIDTH;
+
+ Assert.assertNotEquals(1, expectSeparator);
+ Assert.assertEquals(expectSeparator, layout.screenSeparator, 0.1);
+
+
+ // --------------------------------
+ // When rendering
+
+ layout.render(chart.getPainter(), chart);
+
+
+ // --------------------------------
+ // Then legend width processed is known
+
+ float expectLegendWidth = expectRightSideWidth;
+ Assert.assertEquals(expectLegendWidth, layout.legendsWidth, 0);
+
+
+ // --------------------------------
+ // Then colorbars had their viewport defined
+
+ float from = expectSeparator;
+ float mid = from + (1 - expectSeparator) / 2;
+ float to = 1;
+
+ if (isEmulGL) {
+ verify(legend).setViewPort(1200, 900, from, mid);
+ verify(legend).setViewPort(1200, 900, mid, to);
+ //verify(legend, times(1)).setViewportMode(ViewportMode.STRETCH_TO_FILL);
+ } else {
+ verify(legend).setViewPort(800, 600, from, mid);
+ verify(legend).setViewPort(800, 600, mid, to);
+ verify(legend, times(2)).setViewportMode(ViewportMode.STRETCH_TO_FILL);
+ }
+
+ }
+
+
+
+ private List colorbars(int numberOfColorbars, ILegend legend) {
+ List legends = new ArrayList<>();
+
+ for (int i = 0; i < numberOfColorbars; i++) {
+ legends.add(legend);
+ }
+ return legends;
+ }
+
+
+}
diff --git a/jzy3d-emul-gl-awt/pom.xml b/jzy3d-emul-gl-awt/pom.xml
index 6482748ce..6ed46d5fa 100644
--- a/jzy3d-emul-gl-awt/pom.xml
+++ b/jzy3d-emul-gl-awt/pom.xml
@@ -25,15 +25,23 @@
${project.groupId}
- jzy3d-core-awt
+ jzy3d-jGL-awt
+ ${project.version}
+
+
+
+
+ ${project.groupId}
+ jzy3d-core
${project.version}
test-jar
${project.groupId}
- jzy3d-jGL-awt
+ jzy3d-core-awt
${project.version}
+ test-jar
@@ -60,7 +68,7 @@
-
+
diff --git a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/chart/factories/EmulGLChartFactory.java b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/chart/factories/EmulGLChartFactory.java
index c85163d5f..bedab595d 100644
--- a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/chart/factories/EmulGLChartFactory.java
+++ b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/chart/factories/EmulGLChartFactory.java
@@ -22,7 +22,17 @@ public EmulGLChartFactory(IPainterFactory windowFactory) {
}
@Override
- public Chart newChart(IChartFactory factory, Quality quality) {
+ public AWTChart newChart() {
+ return newChart(Quality.Advanced());
+ }
+
+ @Override
+ public AWTChart newChart(Quality quality) {
+ return newChart(getFactory(), quality);
+ }
+
+ @Override
+ public AWTChart newChart(IChartFactory factory, Quality quality) {
AWTChart chart = new AWTChart(factory, quality);
chart.getView().setBoundMode(ViewBoundMode.AUTO_FIT); // EMULGL NEEDS AUTO_FIT!!!
return chart;
diff --git a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/chart/factories/EmulGLPainterFactory.java b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/chart/factories/EmulGLPainterFactory.java
index 89f5193fa..5b80a3d29 100644
--- a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/chart/factories/EmulGLPainterFactory.java
+++ b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/chart/factories/EmulGLPainterFactory.java
@@ -65,7 +65,7 @@ public IViewOverlay newViewOverlay() {
@Override
public ViewAndColorbarsLayout newViewportLayout() {
return new EmulGLViewAndColorbarsLayout();
- // return new ViewAndColorbarsLayout();
+ //return new ViewAndColorbarsLayout();
}
@Override
@@ -216,5 +216,10 @@ public boolean isDebugGL() {
public void setDebugGL(boolean debugGL) {
this.debugGL = debugGL;
}
+
+ public void dispose() {
+ internalPainter = null;
+ internalCanvas = null;
+ }
}
diff --git a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/painters/EmulGLPainter.java b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/painters/EmulGLPainter.java
index 13175d943..248801512 100644
--- a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/painters/EmulGLPainter.java
+++ b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/painters/EmulGLPainter.java
@@ -35,6 +35,11 @@ public class EmulGLPainter extends AbstractPainter implements IPainter {
protected GL gl;
protected GLU glu;
protected GLUT glut;
+
+ /** A 1x1 image used for processing text length in pixel if no context is available */
+ protected BufferedImage textLengthFallbackImage;
+ protected FontMetrics fontMetricsFallback;
+
public GL getGL() {
return gl;
@@ -635,6 +640,7 @@ public void drawImage(ByteBuffer imageBuffer, int imageWidth, int imageHeight,
}
+
// elements of GL spec picked in JOGL GL interface
public static final int GL_RGBA = 0x1908;
public static final int GL_UNSIGNED_BYTE = 0x1401;
@@ -709,6 +715,19 @@ public int getTextLengthInPixels(Font font, String string) {
return fm.stringWidth(string);
}
}
+
+ // Fallback on an image
+ else {
+ if (textLengthFallbackImage == null) {
+ textLengthFallbackImage = new BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR);
+ fontMetricsFallback = textLengthFallbackImage.createGraphics().getFontMetrics();
+ }
+ if (fontMetricsFallback != null) {
+ return fontMetricsFallback.stringWidth(string);
+ } else {
+ return -1;
+ }
+ }
// Fallback on glut
return glutBitmapLength(font.getCode(), string);
diff --git a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/canvas/EmulGLCanvas.java b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/canvas/EmulGLCanvas.java
index 48d34ae5f..e1fec70e1 100644
--- a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/canvas/EmulGLCanvas.java
+++ b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/canvas/EmulGLCanvas.java
@@ -28,6 +28,7 @@
import org.jzy3d.colors.Color;
import org.jzy3d.io.AWTImageExporter;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
import org.jzy3d.maths.TicToc;
import org.jzy3d.monitor.IMonitorable;
import org.jzy3d.monitor.Measure.CanvasPerfMeasure;
@@ -501,6 +502,12 @@ public int getRendererWidth() {
public int getRendererHeight() {
return this.getHeight();
}
+
+ @Override
+ public Dimension getDimension() {
+ return new Dimension(getWidth(), getHeight());
+ }
+
@Override
diff --git a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/View2DLayout_Debug.java b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/View2DLayout_Debug.java
new file mode 100644
index 000000000..fd501031f
--- /dev/null
+++ b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/View2DLayout_Debug.java
@@ -0,0 +1,406 @@
+package org.jzy3d.plot3d.rendering.view;
+
+import java.awt.BasicStroke;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import org.jzy3d.colors.AWTColor;
+import org.jzy3d.colors.Color;
+import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Margin;
+import org.jzy3d.painters.AWTFont;
+import org.jzy3d.painters.EmulGLPainter;
+import org.jzy3d.plot2d.primitive.AWTColorbarImageGenerator;
+import org.jzy3d.plot2d.rendering.AWTGraphicsUtils;
+import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
+import org.jzy3d.plot3d.rendering.legends.ILegend;
+import org.jzy3d.plot3d.rendering.legends.colorbars.AWTColorbarLegend;
+import org.jzy3d.plot3d.rendering.view.AWTRenderer2d;
+import org.jzy3d.plot3d.rendering.view.AWTView;
+import org.jzy3d.plot3d.rendering.view.AbstractAWTRenderer2d;
+import org.jzy3d.plot3d.rendering.view.View2DProcessing;
+import org.jzy3d.plot3d.rendering.view.ViewportConfiguration;
+import org.jzy3d.plot3d.rendering.view.layout.ViewAndColorbarsLayout;
+
+public class View2DLayout_Debug extends AbstractAWTRenderer2d implements AWTRenderer2d{
+
+ View2DProcessing processing;
+ AxisLayout axisLayout;
+ ViewAndColorbarsLayout viewportLayout;
+ Color color = Color.CYAN;
+ Color color2 = Color.MAGENTA;
+
+ String info = "";
+
+ boolean enabled = true;
+ boolean showText = false;
+
+ int interlinePx = 8;
+
+ public View2DLayout_Debug() {
+ }
+
+ public View2DLayout_Debug(Color color) {
+ this.color = color;
+ }
+
+ @Override
+ public void setView(AWTView view) {
+ super.setView(view);
+
+ this.processing = view.get2DProcessing();
+ this.axisLayout = view.getAxis().getLayout();
+ this.viewportLayout = (ViewAndColorbarsLayout)view.getLayout();
+ }
+
+
+ @Override
+ public void paint(Graphics g, int canvasWidth, int canvasHeight) {
+ if(!enabled)
+ return;
+
+ Graphics2D g2d = (Graphics2D) g;
+ Coord2d pixelScale = view.getPixelScale();
+
+
+ configureFontAndHiDPI(g2d, pixelScale);
+ AWTGraphicsUtils.configureRenderingHints(g2d); // Text and aliasing settings
+
+ // Draw viewport info
+ ViewportConfiguration v = view.getCamera().getLastViewPort();
+ String info = "Viewport (" + v.getWidth() + "," + v.getHeight() + ")";
+
+ if(!view.getCanvas().isNative()) {
+ EmulGLPainter p = (EmulGLPainter)view.getPainter();
+ BufferedImage i = p.getGL().getRenderedImage();
+
+ if(i!=null) {
+ info += " img:" + i.getWidth() + "," + i.getHeight();
+ }
+ }
+
+ g2d.setColor(java.awt.Color.black);
+
+ if(showText)
+ g2d.drawString(info, 0, view.getAxisLayout().getFont().getHeight());
+
+ drawViewMargins(g2d, pixelScale);
+ drawColorbarMargins(g2d, pixelScale);
+
+ // draw other debug info
+ if(this.info!=null) {
+ g2d.setColor(java.awt.Color.white);
+ g2d.drawString(this.info, canvasWidth/2, canvasHeight/2);
+ }
+ }
+
+ /** Cancel the HiDPI scaling consideration to draw debug stuff properly on either EmulGL or Native*/
+ protected void configureFontAndHiDPI(Graphics2D g2d, Coord2d pixelScale) {
+ Font font = AWTFont.toAWT(axisLayout.getFont());
+
+ // Native
+ if(view.getCanvas().isNative()) {
+ g2d.scale(1/pixelScale.x, 1/pixelScale.y);
+ }
+ // EmulGL
+ else {
+ int newSize = (int)(font.getSize() / pixelScale.y);
+ font = new Font(font.getName(), font.getStyle(), newSize);
+ }
+ g2d.setFont(font);
+ }
+
+ protected void drawColorbarMargins(Graphics2D g2d, Coord2d pixelScale) {
+ g2d.setColor(AWTColor.toAWT(color2));
+
+ //viewportLayout.getColorbarRightMargin();
+
+ // print me
+ viewportLayout.getLegendsWidth();
+
+ for(ILegend legend : viewportLayout.getLegends()) {
+ if(legend instanceof AWTColorbarLegend) {
+ AWTColorbarLegend colorbar = (AWTColorbarLegend)legend;
+
+ // print me
+ colorbar.getRectangle();
+
+ // for native
+ ViewportConfiguration viewport = colorbar.getLastViewPort();
+
+ //System.out.println("View2DLayout_Debug : CBar viewport " + viewport);
+
+ /*if(!view.getCanvas().isNative()) {
+ EmulGLCanvas c = view.getCanvas();
+ }*/
+
+ if(viewport==null) {
+ return;
+ }
+
+ int x = viewport.getX();
+ int y = viewport.getY();
+ int w = viewport.getWidth()-1;
+ int h = viewport.getHeight()-1;
+
+ int lineHeight = getLineHeigth(pixelScale, 0);
+
+ String info = "Colorbar.Viewport (" + viewport.getWidth()+","+viewport.getHeight()+")";
+ if(showText)
+ g2d.drawString(info, x, y+lineHeight);
+
+
+ g2d.drawRect(x, y, w, h);
+
+ //System.out.println("H=" + h);
+ Margin margin = colorbar.getMargin();
+ x+=margin.getLeft()*pixelScale.x;
+ w-=margin.getWidth()*pixelScale.x;
+ y+=margin.getTop()*pixelScale.y;
+ h-=margin.getHeight()*pixelScale.y;
+
+ //info = "Colorbar.Margins (" + margin.getWidth() + "," + margin.getHeight() + ")";
+
+ BufferedImage image = colorbar.getImage();
+
+
+ info = "Colorbar.Image (" + image.getWidth() + "," + image.getHeight() + ")";
+ if(showText)
+ g2d.drawString(info, x, y);
+ g2d.drawRect(x, y, w, h);
+
+
+
+ AWTColorbarImageGenerator gen = colorbar.getImageGenerator();
+
+ // Bar
+ w = gen.getScaledBarWidth();
+ g2d.drawRect(x, y, w, h);
+
+ int yBar = y+lineHeight;
+ if(showText)
+ g2d.drawString("Colorbar.Bar", x, yBar);
+
+ // MinDim
+ g2d.setColor(AWTColor.toAWT(Color.ORANGE));
+
+ x= viewport.getX();
+ int yminDim= Math.round((yBar+lineHeight+100) * pixelScale.y);
+ w = Math.round(colorbar.getMinimumDimension().width*pixelScale.getX());
+ h = Math.round(colorbar.getMinimumDimension().height*pixelScale.getY());
+
+ g2d.setStroke(new BasicStroke(2));
+ g2d.drawRect(x, yminDim, w-1, h);
+
+ //maxTextWidth =
+
+ if(showText) {
+ g2d.drawString("Colorbar.MinDim", x, yminDim);
+ g2d.drawString(colorbar.getMinimumDimension().toString(), x, yminDim+g2d.getFont().getSize()+1);
+ }
+
+ g2d.setStroke(new BasicStroke(1));
+
+ //System.out.println("H=" + h + " (" +margin.getBottom());
+ }
+ }
+ }
+
+
+
+ protected void drawViewMargins(Graphics2D g2d, Coord2d pixelScale) {
+
+ g2d.setColor(AWTColor.toAWT(color));
+
+
+ // ------------------------
+ // Draw debug info
+
+ int height = view.getCanvas().getRendererHeight();
+ int width = view.getCanvas().getRendererWidth();
+
+ // ------------------------
+ // Horizontal lines
+
+ int txtSize = axisLayout.getFont().getHeight();
+
+ drawViewMarginsHorizontalLines(g2d, height, width, txtSize);
+
+
+ // ------------------------
+ // Vertical lines
+
+ int lineHeight = getLineHeigth(pixelScale);
+
+ drawViewMarginsVerticalLines(g2d, height, lineHeight);
+ }
+
+ private int getLineHeigth(Coord2d pixelScale) {
+ int topMargin = 8;
+
+ return getLineHeigth(pixelScale, topMargin);
+ }
+
+ private int getLineHeigth(Coord2d pixelScale, int topMargin) {
+ int txtSize = axisLayout.getFont().getHeight();
+ return Math.round(txtSize + topMargin*pixelScale.y);
+ }
+
+
+
+ protected void drawViewMarginsHorizontalLines(Graphics2D g2d, int height, int width, int txtSize) {
+ FontMetrics fm = g2d.getFontMetrics();
+
+
+ boolean isEmulGL = !view.getCanvas().isNative();
+
+ if (isEmulGL) {
+ txtSize /= view.getPixelScale().y;
+ }
+
+ int x;
+ int y;
+
+
+ x = processing.getMarginPxScaled().getLeft();
+
+
+ // ---------------------------
+ // under axis label
+
+ y = height - processing.getMarginPxScaled().getBottom();
+ g2d.drawLine(0, y, width, y);
+
+ String info = "Axis Label Bottom (" + y + ")";
+ if(showText)
+ g2d.drawString(info, x, y);
+ int shift = fm.stringWidth(info);
+
+
+ // up to axis label
+ y = height-(processing.getMarginPxScaled().getBottom()+txtSize);
+ g2d.drawLine(0, y, width, y);
+
+ info = "Axis Label Top (" + y + ")";
+ if(showText)
+ g2d.drawString(info, shift, y);
+ shift += fm.stringWidth(info);
+
+ // ---------------------------
+ // down to tick label
+ y = height-Math.round(processing.getMarginPxScaled().getBottom()+txtSize+processing.getHorizontalAxisDistance());
+ g2d.drawLine(0, y, width, y);
+
+ info = "Tick Label Bottom (" + y + ")";
+ if(showText)
+ g2d.drawString(info, shift, y);
+ shift += fm.stringWidth(info);
+
+ // up to tick label
+ y = height-Math.round(processing.getMarginPxScaled().getBottom()+txtSize+processing.getHorizontalAxisDistance()+txtSize);
+ g2d.drawLine(0, y, width, y);
+
+ info = "Tick Label Top (" + y + ")";
+ if(showText)
+ g2d.drawString(info, shift, y);
+ shift += fm.stringWidth(info);
+
+ // ---------------------------
+ // up to tick label margin
+ y = height-Math.round(processing.getMarginPxScaled().getBottom()+txtSize+processing.getHorizontalAxisDistance()+txtSize+processing.getHorizontalTickDistance());
+ g2d.drawLine(0, y, width, y);
+
+ info = "Chart bottom border (" + y + ")";
+ if(showText)
+ g2d.drawString(info, shift, y);
+ shift += fm.stringWidth(info);
+
+ // Horizontal top margin
+ y = processing.getMarginPxScaled().getTop();
+ g2d.drawLine(0, y, width, y);
+
+ info = "Chart top border (" + y + ")";
+ if(showText)
+ g2d.drawString(info, shift, y);
+
+ }
+
+
+
+ protected void drawViewMarginsVerticalLines(Graphics2D g2d, int height, int lineHeight) {
+ FontMetrics fm = g2d.getFontMetrics();
+
+ int x;
+ // left to axis label
+ x = processing.getMarginPxScaled().getLeft();
+ g2d.drawLine(x, 0, x, height);
+
+ if(showText)
+ g2d.drawString("Axis Label Left Side / Left Margin (" + x + ")", x, lineHeight*1);
+
+ // right to axis label
+ x = Math.round(processing.getMarginPxScaled().getLeft() + processing.getAxisTextWidth());
+ g2d.drawLine(x, 0, x, height);
+
+ if(showText)
+ g2d.drawString("Axis Label Right Side (" + x + ")", x, lineHeight*2);
+
+
+ // left to tick label
+ x = Math.round(x+processing.getVerticalAxisDistance());
+ g2d.drawLine(x, 0, x, height);
+
+ if(showText)
+ g2d.drawString("Tick Label Left Side (" + x + ")", x, lineHeight*3);
+
+
+ // right to tick label
+ x = Math.round(x+processing.getTickTextWidth());
+ g2d.drawLine(x, 0, x, height);
+
+ if(showText)
+ g2d.drawString("Tick Label Right Side (" + x + ")", x, lineHeight*4);
+
+ // on chart border
+ x = Math.round(x+processing.getVerticalTickDistance());
+ g2d.drawLine(x, 0, x, height);
+
+ if(showText)
+ g2d.drawString("Chart left border (" + x + ")", x, lineHeight*5);
+
+ x = Math.round(view.getCamera().getLastViewPort().getWidth()-processing.getMarginPxScaled().getRight());
+
+ // Using the processed right margin that differs between Native and EmulGL
+ // because of the different colobar management
+ x = view.getCamera().getLastViewPort().getWidth()-processing.getMarginPx().getRight();
+
+ g2d.drawLine(x, 0, x, height);
+
+ String txt = "Chart right border (" + x + ")";
+
+ if(showText)
+ g2d.drawString(txt, x - fm.stringWidth(txt), lineHeight*6);
+ }
+
+ public Color getColor() {
+ return color;
+ }
+
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ public void setInfo(String info) {
+ this.info = info;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+}
diff --git a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/EmulGLViewAndColorbarsLayout.java b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/EmulGLViewAndColorbarsLayout.java
index f8a626490..8e5e23fe3 100644
--- a/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/EmulGLViewAndColorbarsLayout.java
+++ b/jzy3d-emul-gl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/EmulGLViewAndColorbarsLayout.java
@@ -3,10 +3,11 @@
import java.awt.image.BufferedImage;
import java.util.List;
import org.jzy3d.chart.Chart;
+import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Margin;
import org.jzy3d.painters.EmulGLPainter;
import org.jzy3d.painters.Font;
import org.jzy3d.painters.IPainter;
-import org.jzy3d.plot2d.primitive.AWTColorbarImageGenerator;
import org.jzy3d.plot3d.rendering.canvas.ICanvas;
import org.jzy3d.plot3d.rendering.legends.ILegend;
import org.jzy3d.plot3d.rendering.legends.colorbars.AWTColorbarLegend;
@@ -16,27 +17,31 @@
import jgl.GL;
public class EmulGLViewAndColorbarsLayout extends ViewAndColorbarsLayout {
- boolean fixHiDPI = true;
@Override
- public void render(IPainter painter, Chart chart) {
- View view = chart.getView();
- view.renderBackground(backgroundViewport);
-
- // Here we force the scene to be rendered on the entire screen to avoid a GRAY
- // (=CLEAR COLOR?) BAND
- // that can't be overriden by legend image
- sceneViewport = ViewportBuilder.column(chart.getCanvas(), 0, 1);
- //sceneViewport = ViewportBuilder.column(chart.getCanvas(), 0, screenSeparator);
-
- view.renderScene(sceneViewport);
-
- renderLegends(painter, chart);
-
- // fix overlay on top of chart
- view.renderOverlay(view.getCamera().getLastViewPort());
+ public void update(Chart chart) {
+ super.update(chart);
+
+ // simply override to let scene viewport occupy full canvas
+ // due to jGL limitation with viewport that are not canvas-wide
+ sceneViewport = ViewportBuilder.column(chart.getCanvas(), 0, 1);
+ }
+
+ protected int updateAndGetMinDimensions(IPainter painter, ILegend legend) {
+
+ if (legend instanceof AWTColorbarLegend) {
+ AWTColorbarLegend awtLegend = (AWTColorbarLegend) legend;
+ //System.out.println("EMulGLView " + painter.getView().getPixelScale());
+ awtLegend.updatePixelScale(painter.getView().getPixelScale());
+ awtLegend.setEmulGLUnscale(true);
+ }
+
+ legend.updateMinimumDimension(painter);
+
+ return legend.getMinimumDimension().width;
}
+
/**
* This override allows
*
@@ -48,71 +53,65 @@ public void render(IPainter painter, Chart chart) {
@Override
protected void renderLegends(IPainter painter, float left, float right, List legends,
ICanvas canvas) {
- EmulGLPainter emulGL = (EmulGLPainter) painter;
-
- int width = canvas.getRendererWidth();
- int height = canvas.getRendererHeight();
+ Coord2d scale = chart.getView().getPixelScale();
- if (fixHiDPI) {
- width = (int) (sceneViewport.getWidth() * emulGL.getGL().getPixelScaleX());
- height = (int) (sceneViewport.getHeight() * emulGL.getGL().getPixelScaleY());// canvas.getRendererHeight();
- }
+ int width = Math.round(sceneViewport.getWidth() * scale.x);
+ int height = Math.round(sceneViewport.getHeight() * scale.y);
- legendsWidth = (right-left)*width;
+ //System.out.println("EmulGLViewAndColorbar : legendWidth " + legendsWidth);
- // ---------------------------------------
+ Font font = painter.getView().getAxis().getLayout().getFont();
+ // ---------------------------------------
float slice = (right - left) / legends.size();
int k = 0;
for (ILegend legend : legends) {
- legend.setViewportMode(ViewportMode.STRETCH_TO_FILL);
float from = left + slice * (k++);
float to = from + slice;
- Font font = painter.getView().getAxis().getLayout().getFont();
- legend.setFont(font);
+ //System.out.println("EmulGLViewLayout left " + from + " to " + to);
// FALLBACK ON DIRECT AWT IMAGE RENDERING THROUGH jGL
if (legend instanceof AWTColorbarLegend) {
- AWTColorbarLegend awtLegend = (AWTColorbarLegend) legend;
-
- //awtLegend.getImageGenerator().setFont(font);
- // optimize to shrink colorbar to required width
- if(isShrinkColorbar()) {
- from = updateFromValueToShrinkColorbar(painter, width, awtLegend);
- }
+ AWTColorbarLegend awtLegend = (AWTColorbarLegend) legend;
+ awtLegend.setViewPort(width, height, from, to);
+ awtLegend.setViewportMode(ViewportMode.STRETCH_TO_FILL);
+ awtLegend.setFont(font);
+ awtLegend.updateImage();
- legend.setViewPort(width, height, from, to);
+ //System.out.println("EmulGLViewLayout " + awtLegend.getViewPort());
BufferedImage legendImage = (BufferedImage) awtLegend.getImage();
+ int legendWidth = legendImage.getWidth();
+ int legendHeight = legendImage.getHeight();
- int legendWidth = (int) (legendImage.getWidth() / emulGL.getGL().getPixelScaleX());
-
// ---------------------------------------
- // Processing yoffset with pixel scale
- int yOffset = 0;
- if (emulGL.getGL().getPixelScaleY() == 1) {
- yOffset = (int) (awtLegend.getMargin().height / 2f);
- } else {
- yOffset =
- (int) ((emulGL.getGL().getPixelScaleY() - 1) * awtLegend.getMargin().height) / 2;
- }
+ // Processing image offset with pixel scale
+
+ Margin margin = awtLegend.getMargin();
+
+ // inspired from AWTImageViewport.computeLayout
+ int xOffset = Math.round(width - (legendWidth + (margin.getWidth() * scale.x)));
+ xOffset += (margin.getLeft() * scale.x);
+
+ int yOffset =
+ Math.round((height - (legendHeight + (margin.getHeight() * scale.y))) /*/ 2f*/);
+ yOffset += (margin.getTop() * scale.y);
+
// ---------------------------------------
// Send image rendering directly to jGL
- int xOffset = width - legendWidth * (k);
-
// Display colorbar only if their remain space for plot that is wider than higher
- //if(xOffset>height) {
- emulGL.getGL().appendImageToDraw(legendImage, xOffset, yOffset);
- //}
+ EmulGLPainter emulGL = (EmulGLPainter) painter;
+ emulGL.getGL().appendImageToDraw(legendImage, xOffset, yOffset);
}
+
// BYPASSED IMAGE RENDERING THAT DOES NOT WORK WELL IN jGL BUT KEEP EXPECTED OPENGL WAY
// FOR MEMORY
else {
@@ -123,22 +122,10 @@ protected void renderLegends(IPainter painter, float left, float right, List
+ 4.0.0
+
+
+ org.jzy3d
+ jzy3d-all
+ 2.1.1-SNAPSHOT
+
+
+ jzy3d-everything
+ Jzy3D Bundle Module (except SWT)
+
+
+ 1.8
+
+
+
+
+
+
+
+ ${project.groupId}
+ jzy3d-native-jogl-awt
+ ${project.version}
+
+
+
+ ${project.groupId}
+ jzy3d-native-jogl-swing
+ ${project.version}
+
+
+
+ ${project.groupId}
+ jzy3d-native-jogl-newt
+ ${project.version}
+
+
+
+
+
+
+ ${project.groupId}
+ jzy3d-emul-gl-awt
+ ${project.version}
+
+
+
+
+
+
+
+ ${project.groupId}
+ jzy3d-tester-native
+ ${project.version}
+
+
+
+
+
+ ${project.groupId}
+ jzy3d-io-xls
+ ${project.version}
+
+
+
+
+
+
diff --git a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/examples/apps/hello.java b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/examples/apps/hello.java
index a3107a573..4df41c188 100644
--- a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/examples/apps/hello.java
+++ b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/examples/apps/hello.java
@@ -47,6 +47,7 @@ private void myinit() {
/* initialize viewing values */
myGL.glMatrixMode(GL.GL_PROJECTION);
myGL.glLoadIdentity();
+
myGL.glOrtho(0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f);
}
diff --git a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GL.java b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GL.java
index 55a352b4a..66dd9f1e4 100644
--- a/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GL.java
+++ b/jzy3d-jGL/jzy3d-jGL-awt/src/main/java/jgl/wt/awt/GL.java
@@ -308,11 +308,15 @@ protected void doDrawString(Graphics2D g2d, TextToDraw text) {
// Render text
if (useOSFontRendering) {
+ //g2d.scale(1/pixelScaleX, 1/pixelScaleY);
g2d.drawString(text.string, 0, 0);
+ //g2d.scale(pixelScaleX, pixelScaleY);
} else {
FontRenderContext frc = g2d.getFontRenderContext();
GlyphVector gv = text.font.createGlyphVector(frc, text.string);
+ //g2d.scale(1/pixelScaleX, 1/pixelScaleY);
g2d.drawGlyphVector(gv, 0, 0);
+ //g2d.scale(pixelScaleX, pixelScaleY);
}
// Reset rotation from context
diff --git a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/chart/factories/AWTPainterFactory.java b/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/chart/factories/AWTPainterFactory.java
index d9b43c82b..8da276107 100644
--- a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/chart/factories/AWTPainterFactory.java
+++ b/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/chart/factories/AWTPainterFactory.java
@@ -50,9 +50,10 @@ public IViewOverlay newViewOverlay() {
}
@Override
- public IViewportLayout newViewportLayout() {
+ public ViewAndColorbarsLayout newViewportLayout() {
//return new NativeViewAndColorbarsLayout();
- return new ViewAndColorbarsLayout();
+ ViewAndColorbarsLayout layout = new ViewAndColorbarsLayout();
+ return layout;
}
/** Provide AWT Texture loading for screenshots */
diff --git a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/chart2d/Chart2d.java b/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/chart2d/Chart2d.java
index 4881284d9..cd1e320ac 100644
--- a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/chart2d/Chart2d.java
+++ b/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/chart2d/Chart2d.java
@@ -26,7 +26,7 @@ public class Chart2d extends AWTNativeChart {
public void layout2d() {
AxisLayout axe = getAxisLayout();
- axe.setZAxeLabelDisplayed(false);
+ axe.setZAxisLabelDisplayed(false);
axe.setTickLineDisplayed(false);
View view = getView();
diff --git a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasAWT.java b/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasAWT.java
index 0b8c0965f..341e175aa 100644
--- a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasAWT.java
+++ b/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasAWT.java
@@ -14,6 +14,7 @@
import org.jzy3d.chart.factories.IChartFactory;
import org.jzy3d.chart.factories.NativePainterFactory;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
import org.jzy3d.painters.IPainter;
import org.jzy3d.plot3d.GPUInfo;
import org.jzy3d.plot3d.rendering.scene.Scene;
@@ -141,17 +142,15 @@ public Coord2d getPixelScaleJVM() {
}
public double getPixelScaleX() {
- double scale = getSurfaceWidth() / (double) getWidth();
- return scale;
- //double scale2 = AWTHelper.getPixelScaleX(this);
- //return Math.max(scale, scale2);
+ float[] scale = new float[2];
+ getCurrentSurfaceScale(scale);
+ return scale[0];
}
public double getPixelScaleY() {
- double scale = getSurfaceHeight() / (double) getHeight();
- return scale;
- //double scale2 = AWTHelper.getPixelScaleY(this);
- //return Math.max(scale, scale2);
+ float[] scale = new float[2];
+ getCurrentSurfaceScale(scale);
+ return scale[1];
}
@@ -314,6 +313,7 @@ public View getView() {
* resize event.
*/
@Override
+ @Deprecated // use getDimension() instead
public int getRendererWidth() {
return (renderer != null ? renderer.getWidth() : 0);
}
@@ -323,10 +323,21 @@ public int getRendererWidth() {
* resize event.
*/
@Override
+ @Deprecated // use getDimension() instead
public int getRendererHeight() {
return (renderer != null ? renderer.getHeight() : 0);
}
+ @Override
+ public Dimension getDimension() {
+ if(renderer!=null) {
+ return new Dimension(renderer.getWidth(), renderer.getHeight());
+ }
+ else {
+ return new Dimension(0, 0);
+ }
+ }
+
@Override
public boolean isNative() {
return true;
diff --git a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/NativeViewAndColorbarsLayout.java b/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/NativeViewAndColorbarsLayout.java
index 219384079..add7c5fa5 100644
--- a/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/NativeViewAndColorbarsLayout.java
+++ b/jzy3d-native-jogl-awt/src/main/java/org/jzy3d/plot3d/rendering/view/layout/NativeViewAndColorbarsLayout.java
@@ -12,6 +12,7 @@
* This implementation allows to shrink colorbar, assuming it is an AWT implementation from which we
* can read image width
*/
+@Deprecated
public class NativeViewAndColorbarsLayout extends ViewAndColorbarsLayout {
boolean BYPASS_NATIVE_IMPLEMENTATION_HERE = true;
@@ -40,12 +41,6 @@ protected void renderLegends(IPainter painter, float from, float to, List txtRendererMap = new HashMap<>();
+ // protected Map txtRendererMap = new HashMap<>();
/**
@@ -577,13 +583,12 @@ public int glutBitmapLength(int font, String string) {
@Override
public int getTextLengthInPixels(int font, String string) {
- Font fnt = Font.getById(font);
-
- return getTextLengthInPixels(fnt, string);
+ return getTextLengthInPixels(Font.getById(font), string);
}
@Override
public int getTextLengthInPixels(Font font, String string) {
+
// Try to get text width using onscreen graphics
ICanvas c = getCanvas();
if (c instanceof Component) {
@@ -597,13 +602,29 @@ public int getTextLengthInPixels(Font font, String string) {
}
}
}
-
+
// Try to get text width using text renderer offscreen
- TextRenderer renderer = getOrCreateTextRenderer(font);
- Rectangle2D r = renderer.getBounds(string);
- return (int) r.getWidth();
+ if (gl != null && gl.getContext().isCurrent()) {
+ TextRenderer renderer = getOrCreateTextRenderer(font);
+ Rectangle2D r = renderer.getBounds(string);
+ return (int) r.getWidth();
+ }
+
+ // Otherwise use a fallback image to get a graphic context
+
+ if (textLengthFallbackImage == null) {
+ textLengthFallbackImage = new BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR);
+ fontMetricsFallback = textLengthFallbackImage.createGraphics().getFontMetrics();
+ }
+ if (fontMetricsFallback != null) {
+ return fontMetricsFallback.stringWidth(string);
+ } else {
+ return -1;
+ }
+
}
+
private java.awt.Font toAWT(Font font) {
return new java.awt.Font(font.getName(), java.awt.Font.PLAIN, font.getHeight());
}
@@ -810,13 +831,13 @@ public void glOrtho(double left, double right, double bottom, double top, double
double far_val) {
gl.getGL2().glOrtho(left, right, bottom, top, near_val, far_val);
}
-
+
@Override
public void gluOrtho2D(double left, double right, double bottom, double top) {
glu.gluOrtho2D(left, right, bottom, top);
}
-
-
+
+
@Override
public void gluPerspective(double fovy, double aspect, double zNear, double zFar) {
diff --git a/jzy3d-native-jogl-core/src/main/java/org/jzy3d/plot3d/rendering/canvas/OffscreenCanvas.java b/jzy3d-native-jogl-core/src/main/java/org/jzy3d/plot3d/rendering/canvas/OffscreenCanvas.java
index 4f4e58565..3032d58bf 100644
--- a/jzy3d-native-jogl-core/src/main/java/org/jzy3d/plot3d/rendering/canvas/OffscreenCanvas.java
+++ b/jzy3d-native-jogl-core/src/main/java/org/jzy3d/plot3d/rendering/canvas/OffscreenCanvas.java
@@ -8,6 +8,7 @@
import org.jzy3d.chart.factories.IChartFactory;
import org.jzy3d.chart.factories.NativePainterFactory;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
import org.jzy3d.painters.IPainter;
import org.jzy3d.painters.NativeDesktopPainter;
import org.jzy3d.plot3d.GPUInfo;
@@ -185,6 +186,17 @@ public Renderer3d getRenderer() {
return renderer;
}
+ @Override
+ public Dimension getDimension() {
+ if(renderer!=null) {
+ return new Dimension(renderer.getWidth(), renderer.getHeight());
+ }
+ else {
+ return new Dimension(0, 0);
+ }
+ }
+
+
@Override
public String getDebugInfo() {
IPainter painter = getView().getPainter();
diff --git a/jzy3d-native-jogl-newt/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasNewtAwt.java b/jzy3d-native-jogl-newt/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasNewtAwt.java
index bc3782126..6bc10a3bb 100644
--- a/jzy3d-native-jogl-newt/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasNewtAwt.java
+++ b/jzy3d-native-jogl-newt/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasNewtAwt.java
@@ -17,6 +17,7 @@
import org.jzy3d.chart.factories.IChartFactory;
import org.jzy3d.chart.factories.NativePainterFactory;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
import org.jzy3d.painters.IPainter;
import org.jzy3d.painters.NativeDesktopPainter;
import org.jzy3d.plot3d.GPUInfo;
@@ -150,11 +151,15 @@ public Coord2d getPixelScale() {
}
public double getPixelScaleX() {
- return window.getSurfaceWidth() / (double) getWidth();
+ float[] scale = new float[2];
+ window.getCurrentSurfaceScale(scale);
+ return scale[0];
}
public double getPixelScaleY() {
- return window.getSurfaceHeight() / (double) getHeight();
+ float[] scale = new float[2];
+ window.getCurrentSurfaceScale(scale);
+ return scale[1];
}
@Override
@@ -251,6 +256,17 @@ public int getRendererWidth() {
public int getRendererHeight() {
return (renderer != null ? renderer.getHeight() : 0);
}
+
+ @Override
+ public Dimension getDimension() {
+ if(renderer!=null) {
+ return new Dimension(renderer.getWidth(), renderer.getHeight());
+ }
+ else {
+ return new Dimension(0, 0);
+ }
+ }
+
@Override
public Renderer3d getRenderer() {
diff --git a/jzy3d-native-jogl-swing/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasSwing.java b/jzy3d-native-jogl-swing/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasSwing.java
index 2598243aa..314365230 100644
--- a/jzy3d-native-jogl-swing/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasSwing.java
+++ b/jzy3d-native-jogl-swing/src/main/java/org/jzy3d/plot3d/rendering/canvas/CanvasSwing.java
@@ -16,6 +16,7 @@
import org.jzy3d.chart.factories.IChartFactory;
import org.jzy3d.chart.factories.NativePainterFactory;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
import org.jzy3d.painters.IPainter;
import org.jzy3d.painters.NativeDesktopPainter;
import org.jzy3d.plot3d.GPUInfo;
@@ -126,11 +127,15 @@ public Coord2d getPixelScaleJVM() {
}
public double getPixelScaleX() {
- return getSurfaceWidth() / (double) getWidth();
+ float[] scale = new float[2];
+ getCurrentSurfaceScale(scale);
+ return scale[0];
}
public double getPixelScaleY() {
- return getSurfaceHeight() / (double) getHeight();
+ float[] scale = new float[2];
+ getCurrentSurfaceScale(scale);
+ return scale[1];
}
@Override
@@ -243,6 +248,17 @@ public int getRendererWidth() {
public int getRendererHeight() {
return (renderer != null ? renderer.getHeight() : 0);
}
+
+ @Override
+ public Dimension getDimension() {
+ if(renderer!=null) {
+ return new Dimension(renderer.getWidth(), renderer.getHeight());
+ }
+ else {
+ return new Dimension(0, 0);
+ }
+ }
+
@Override
public Renderer3d getRenderer() {
diff --git a/jzy3d-native-jogl-swt/src/main/java/org/jzy3d/chart/factories/CanvasNewtSWT.java b/jzy3d-native-jogl-swt/src/main/java/org/jzy3d/chart/factories/CanvasNewtSWT.java
index a1dcc867c..40e99e70c 100644
--- a/jzy3d-native-jogl-swt/src/main/java/org/jzy3d/chart/factories/CanvasNewtSWT.java
+++ b/jzy3d-native-jogl-swt/src/main/java/org/jzy3d/chart/factories/CanvasNewtSWT.java
@@ -13,6 +13,7 @@
import org.jzy3d.awt.AWTHelper;
import org.jzy3d.chart.IAnimator;
import org.jzy3d.maths.Coord2d;
+import org.jzy3d.maths.Dimension;
import org.jzy3d.painters.IPainter;
import org.jzy3d.painters.NativeDesktopPainter;
import org.jzy3d.plot3d.GPUInfo;
@@ -157,14 +158,18 @@ public Coord2d getPixelScaleJVM() {
return getPixelScale();
}
-
public double getPixelScaleX() {
- return window.getSurfaceWidth() / (double) getSize().x;
+ float[] scale = new float[2];
+ window.getCurrentSurfaceScale(scale);
+ return scale[0];
}
public double getPixelScaleY() {
- return window.getSurfaceHeight() / (double) getSize().y;
+ float[] scale = new float[2];
+ window.getCurrentSurfaceScale(scale);
+ return scale[1];
}
+
public GLWindow getWindow() {
return window;
}
@@ -233,6 +238,17 @@ public int getRendererWidth() {
public int getRendererHeight() {
return (renderer != null ? renderer.getHeight() : 0);
}
+
+ @Override
+ public Dimension getDimension() {
+ if(renderer!=null) {
+ return new Dimension(renderer.getWidth(), renderer.getHeight());
+ }
+ else {
+ return new Dimension(0, 0);
+ }
+ }
+
@Override
public Renderer3d getRenderer() {
diff --git a/jzy3d-tester/src/main/java/org/jzy3d/debug/View2DLayout_Debug.java b/jzy3d-tester/src/main/java/org/jzy3d/debug/View2DLayout_Debug.java
deleted file mode 100644
index 8838e3753..000000000
--- a/jzy3d-tester/src/main/java/org/jzy3d/debug/View2DLayout_Debug.java
+++ /dev/null
@@ -1,191 +0,0 @@
-package org.jzy3d.debug;
-
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import org.jzy3d.colors.AWTColor;
-import org.jzy3d.colors.Color;
-import org.jzy3d.painters.AWTFont;
-import org.jzy3d.plot2d.rendering.AWTGraphicsUtils;
-import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
-import org.jzy3d.plot3d.rendering.view.AWTRenderer2d;
-import org.jzy3d.plot3d.rendering.view.AWTView;
-import org.jzy3d.plot3d.rendering.view.AbstractAWTRenderer2d;
-import org.jzy3d.plot3d.rendering.view.View;
-import org.jzy3d.plot3d.rendering.view.View2DLayout;
-
-public class View2DLayout_Debug extends AbstractAWTRenderer2d implements AWTRenderer2d{
-
- View2DLayout layout;
- AxisLayout axisLayout;
-
- public View2DLayout_Debug() {
- }
-
- @Override
- public void setView(AWTView view) {
- super.setView(view);
-
- this.layout = view.get2DLayout();
- this.axisLayout = view.getAxis().getLayout();
- }
-
-
- @Override
- public void paint(Graphics g, int canvasWidth, int canvasHeight) {
- Graphics2D g2d = (Graphics2D) g;
-
-
- // Cancel the HiDPI scaling consideration to draw debug stuff properly
- //
-
- Font font = AWTFont.toAWT(axisLayout.getFont());
-
- // Native
- if(view.getCanvas().isNative()) {
- g2d.scale(1/view.getPixelScale().x, 1/view.getPixelScale().y);
- }
- // EmulGL
- else {
- int newSize = (int)(font.getSize() / view.getPixelScale().y);
- font = new Font(font.getName(), font.getStyle(), newSize);
- }
-
- g2d.setColor(AWTColor.toAWT(Color.BLUE));
- g2d.setFont(font);
-
- // Text and aliasing settings
- AWTGraphicsUtils.configureRenderingHints(g2d);
-
-
- // ------------------------
- // Draw debug info
-
- int height = view.getCanvas().getRendererHeight();
- int width = view.getCanvas().getRendererWidth();
-
- // ------------------------
- // Horizontal lines
-
- int txtSize = axisLayout.getFont().getHeight();
-
- drawHorizontalLines(g2d, height, width, txtSize);
-
-
- // ------------------------
- // Vertical lines
-
- int lineHeight = txtSize + 8;
-
- drawVerticalLines(g2d, height, lineHeight);
-
- }
-
-
-
- private void drawHorizontalLines(Graphics2D g2d, int height, int width, int txtSize) {
- FontMetrics fm = g2d.getFontMetrics();
-
- int x;
- int y;
- // under axis label
- y = height-(int)layout.getMarginBottom();
- g2d.drawLine(0, y, width, y);
-
- x = (int)layout.getMarginLeft();
-
- String info = "Axis Label Bottom";
- g2d.drawString(info, x, y);
- int shift = fm.stringWidth(info);
-
-
- // up to axis label
- y = height-(int)(layout.getMarginBottom()+txtSize);
- g2d.drawLine(0, y, width, y);
-
- info = "Axis Label Top";
- g2d.drawString(info, shift, y);
- shift += fm.stringWidth(info);
-
- // down to tick label
- y = height-(int)(layout.getMarginBottom()+txtSize+layout.getxAxisLabelsDistance());
- g2d.drawLine(0, y, width, y);
-
- info = "Tick Label Bottom";
- g2d.drawString(info, shift, y);
- shift += fm.stringWidth(info);
-
- // up to tick label
- y = height-(int)(layout.getMarginBottom()+txtSize+layout.getxAxisLabelsDistance()+txtSize);
- g2d.drawLine(0, y, width, y);
-
- info = "Tick Label Top";
- g2d.drawString(info, shift, y);
- shift += fm.stringWidth(info);
-
- // up to tick label margin
- y = height-(int)(layout.getMarginBottom()+txtSize+layout.getxAxisLabelsDistance()+txtSize+layout.getxTickLabelsDistance());
- g2d.drawLine(0, y, width, y);
-
- info = "Chart bottom border";
- g2d.drawString(info, shift, y);
- shift += fm.stringWidth(info);
-
- // Horizontal top margin
- y = (int)layout.getMarginTop();
- g2d.drawLine(0, y, width, y);
-
- info = "Chart top border";
- g2d.drawString(info, shift, y);
-
- }
-
-
-
- private void drawVerticalLines(Graphics2D g2d, int height, int lineHeight) {
- FontMetrics fm = g2d.getFontMetrics();
-
- int x;
- // left to axis label
- x = (int)layout.getMarginLeft();
- g2d.drawLine(x, 0, x, height);
-
- g2d.drawString("Axis Label Left Side / Left Margin (" + x + ")", x, lineHeight*1);
-
- // right to axis label
- x = (int)(layout.getMarginLeft()+view.get2DProcessing().getAxisTextHorizontal());
- g2d.drawLine(x, 0, x, height);
-
- g2d.drawString("Axis Label Right Side (" + x + ")", x, lineHeight*2);
-
-
- // left to tick label
- x = (int)(x+layout.getyAxisLabelsDistance());
- g2d.drawLine(x, 0, x, height);
-
- g2d.drawString("Tick Label Left Side (" + x + ")", x, lineHeight*3);
-
-
- // right to tick label
- x = (int)(x+view.get2DProcessing().getTickTextHorizontal());
- g2d.drawLine(x, 0, x, height);
-
- g2d.drawString("Tick Label Right Side (" + x + ")", x, lineHeight*4);
-
- // on chart border
- x = (int)(x+layout.getxTickLabelsDistance());
- g2d.drawLine(x, 0, x, height);
-
- g2d.drawString("Chart left border (" + x + ")", x, lineHeight*5);
-
- x = (int)(view.getCamera().getLastViewPort().getWidth()-layout.getMarginRight());
-
- g2d.drawLine(x, 0, x, height);
-
- String txt = "Chart right border (" + x + ")";
-
- g2d.drawString(txt, x - fm.stringWidth(txt), lineHeight*6);
- }
-
-}
diff --git a/jzy3d-tester/src/main/java/org/jzy3d/junit/ChartTester.java b/jzy3d-tester/src/main/java/org/jzy3d/junit/ChartTester.java
index 98abb87de..87f085a78 100644
--- a/jzy3d-tester/src/main/java/org/jzy3d/junit/ChartTester.java
+++ b/jzy3d-tester/src/main/java/org/jzy3d/junit/ChartTester.java
@@ -232,8 +232,6 @@ public void test(Chart chart, String testImage) throws IOException {
}
}
-
-
public void assertSimilar(IColorMap colormap, String testImage) {
try {
execute(colormap, testImage);
diff --git a/jzy3d-tests-java9/BASELINE_macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine.md b/jzy3d-tests-java9/BASELINE_macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine.md
index 2033e210d..e33f8b72e 100644
--- a/jzy3d-tests-java9/BASELINE_macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine.md
+++ b/jzy3d-tests-java9/BASELINE_macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine.md
@@ -10,20 +10,20 @@ This is a summary of existing baseline images for tests, which was generated on
# Surface
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -38,20 +38,20 @@ This is a summary of existing baseline images for tests, which was generated on
# Scatter
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -67,23 +67,23 @@ This is a summary of existing baseline images for tests, which was generated on
* Font=AppleChancery24
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
-Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
+ |
|
|
|
@@ -95,20 +95,20 @@ This is a summary of existing baseline images for tests, which was generated on
# Text : whenDrawableTextRenderer
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -123,48 +123,20 @@ This is a summary of existing baseline images for tests, which was generated on
# AxisLabelRotateLayout
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
-
-
-Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
- |
- |
- |
- |
- |
-
-
-
-# Colorbar : Shrink
-
-
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
+ |
+ |
|
@@ -176,54 +148,26 @@ This is a summary of existing baseline images for tests, which was generated on
-# Colorbar : ShrinkBigFont
+# Colorbar : IsModifiedByCustomFont
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
-
-
- |
- |
- |
- |
- |
- |
-
-
-
-# Colorbar : IsModifiedByCustomFont
-
-
EmulGL_AWT HiDPI:ON |
EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
-Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
+ |
|
|
|
@@ -232,56 +176,23 @@ This is a summary of existing baseline images for tests, which was generated on
-# Colorbar : HasMinimumWidth
+# 2D_Colorbar
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
-
-
-Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
- |
- |
- |
- |
- |
-
-
-
-# 2D Layout
-## 2D : when2DLayoutConfig_ThenApplyMargins
-* BorderMargin=0
-* TickLabel=0
-* AxisLabel=0
-* TextAddMargin=false
-
-
EmulGL_AWT HiDPI:ON |
EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
- |
- |
- |
- |
- |
- |
+ |
+ |
+ |
+ |
+ |
+ |
|
@@ -293,6 +204,7 @@ This is a summary of existing baseline images for tests, which was generated on
+# 2D Layout
## 2D : when2DLayoutConfig_ThenApplyMargins
* BorderMargin=0
* TickLabel=0
@@ -300,52 +212,20 @@ This is a summary of existing baseline images for tests, which was generated on
* TextAddMargin=true
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
-
-
-Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
- |
- |
- |
- |
- |
-
-
-
-## 2D : when2DLayoutConfig_ThenApplyMargins
-* BorderMargin=0
-* TickLabel=0
-* AxisLabel=10
-* TextAddMargin=false
-
-
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
+ |
+ |
|
@@ -364,20 +244,20 @@ This is a summary of existing baseline images for tests, which was generated on
* TextAddMargin=true
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -393,55 +273,23 @@ This is a summary of existing baseline images for tests, which was generated on
* BorderMargin=0
* TickLabel=10
* AxisLabel=0
-* TextAddMargin=false
+* TextAddMargin=true
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
-
-
- |
- |
- |
- |
- |
- |
-
-
-
-## 2D : when2DLayoutConfig_ThenApplyMargins
-* BorderMargin=0
-* TickLabel=10
-* AxisLabel=0
-* TextAddMargin=true
-
-
EmulGL_AWT HiDPI:ON |
EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -457,55 +305,23 @@ This is a summary of existing baseline images for tests, which was generated on
* BorderMargin=0
* TickLabel=10
* AxisLabel=10
-* TextAddMargin=false
+* TextAddMargin=true
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
-
-
- |
- |
- |
- |
- |
- |
-
-
-
-## 2D : when2DLayoutConfig_ThenApplyMargins
-* BorderMargin=0
-* TickLabel=10
-* AxisLabel=10
-* TextAddMargin=true
-
-
EmulGL_AWT HiDPI:ON |
EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -521,55 +337,23 @@ This is a summary of existing baseline images for tests, which was generated on
* BorderMargin=20
* TickLabel=0
* AxisLabel=0
-* TextAddMargin=false
+* TextAddMargin=true
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
-
-
- |
- |
- |
- |
- |
- |
-
-
-
-## 2D : when2DLayoutConfig_ThenApplyMargins
-* BorderMargin=20
-* TickLabel=0
-* AxisLabel=0
-* TextAddMargin=true
-
-
EmulGL_AWT HiDPI:ON |
EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -585,55 +369,23 @@ This is a summary of existing baseline images for tests, which was generated on
* BorderMargin=20
* TickLabel=0
* AxisLabel=10
-* TextAddMargin=false
+* TextAddMargin=true
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
-
-
- |
- |
- |
- |
- |
- |
-
-
-
-## 2D : when2DLayoutConfig_ThenApplyMargins
-* BorderMargin=20
-* TickLabel=0
-* AxisLabel=10
-* TextAddMargin=true
-
-
EmulGL_AWT HiDPI:ON |
EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -649,55 +401,23 @@ This is a summary of existing baseline images for tests, which was generated on
* BorderMargin=20
* TickLabel=10
* AxisLabel=0
-* TextAddMargin=false
+* TextAddMargin=true
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
-
-
- |
- |
- |
- |
- |
- |
-
-
-
-## 2D : when2DLayoutConfig_ThenApplyMargins
-* BorderMargin=20
-* TickLabel=10
-* AxisLabel=0
-* TextAddMargin=true
-
-
EmulGL_AWT HiDPI:ON |
EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -713,55 +433,23 @@ This is a summary of existing baseline images for tests, which was generated on
* BorderMargin=20
* TickLabel=10
* AxisLabel=10
-* TextAddMargin=false
+* TextAddMargin=true
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
-
-
- |
- |
- |
- |
- |
- |
-
-
-
-## 2D : when2DLayoutConfig_ThenApplyMargins
-* BorderMargin=20
-* TickLabel=10
-* AxisLabel=10
-* TextAddMargin=true
-
-
EmulGL_AWT HiDPI:ON |
EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -777,23 +465,23 @@ This is a summary of existing baseline images for tests, which was generated on
* yAxisOrientation=VERTICAL
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
-Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
+ |
|
|
|
@@ -806,51 +494,20 @@ This is a summary of existing baseline images for tests, which was generated on
* yAxisOrientation=HORIZONTAL
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
-
-
- |
- |
- |
- |
- |
- |
-
-
-
-## 2D : whenAxisRotated_ThenApplyMargins
-* yAxisOrientation=PARALLEL
-* TO
-* AXIS
-
-
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
-Native_AWT HiDPI:ON |
-Native_AWT HiDPI:OFF |
-Native_Swing HiDPI:ON |
-Native_Swing HiDPI:OFF |
-
-
- |
- |
- |
- |
- |
- |
+ |
+ |
|
@@ -870,26 +527,26 @@ This is a summary of existing baseline images for tests, which was generated on
* RIGHT
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
|
|
-Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
+ |
|
|
@@ -902,20 +559,20 @@ This is a summary of existing baseline images for tests, which was generated on
* RIGHT
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -934,20 +591,20 @@ This is a summary of existing baseline images for tests, which was generated on
* LEFT
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
@@ -966,20 +623,20 @@ This is a summary of existing baseline images for tests, which was generated on
* LEFT
-EmulGL_AWT HiDPI:ON |
-EmulGL_AWT HiDPI:OFF |
Native_AWT HiDPI:ON |
Native_AWT HiDPI:OFF |
Native_Swing HiDPI:ON |
Native_Swing HiDPI:OFF |
+EmulGL_AWT HiDPI:ON |
+EmulGL_AWT HiDPI:OFF |
- |
- |
|
|
|
|
+ |
+ |
|
diff --git a/jzy3d-tests-java9/BASELINE_macosx_11.4_AppleM1.md b/jzy3d-tests-java9/BASELINE_macosx_11.4_AppleM1.md
index 9d1f0be7d..4e52b79a5 100644
--- a/jzy3d-tests-java9/BASELINE_macosx_11.4_AppleM1.md
+++ b/jzy3d-tests-java9/BASELINE_macosx_11.4_AppleM1.md
@@ -3,8 +3,8 @@ jzy3d-test-java9-generated
This is a summary of existing baseline images for tests, which was generated on
* OS Name : mac os x
* OS Version : 11.4
-* Java Version : 17.0.1
-* CPU : aarch64
+* Java Version : 17-panama
+* CPU : x86_64
* GPU : AppleM1
# Surface
@@ -83,7 +83,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -111,7 +111,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -139,7 +139,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -167,7 +167,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -195,7 +195,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -223,7 +223,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -251,7 +251,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -316,7 +316,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -793,7 +793,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
@@ -886,7 +886,7 @@ This is a summary of existing baseline images for tests, which was generated on
|
- |
+Diff chart:
Actual chart:
Zoom on error:
Following tests of the same section have been skipped. |
|
|
|
diff --git a/jzy3d-tests-java9/pom.xml b/jzy3d-tests-java9/pom.xml
index 5b3779ce4..c4d0c77db 100644
--- a/jzy3d-tests-java9/pom.xml
+++ b/jzy3d-tests-java9/pom.xml
@@ -18,37 +18,7 @@
${project.groupId}
- jzy3d-native-jogl-awt
- ${project.version}
-
-
-
- ${project.groupId}
- jzy3d-native-jogl-swing
- ${project.version}
-
-
-
- ${project.groupId}
- jzy3d-native-jogl-newt
- ${project.version}
-
-
-
- ${project.groupId}
- jzy3d-emul-gl-awt
- ${project.version}
-
-
-
- ${project.groupId}
- jzy3d-tester-native
- ${project.version}
-
-
-
- ${project.groupId}
- jzy3d-io-xls
+ jzy3d-everything
${project.version}
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/performance/polygons/BenchmarkPlot.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/performance/polygons/BenchmarkPlot.java
index b1883a431..f6728b4da 100644
--- a/jzy3d-tests-java9/src/test/java/org/jzy3d/performance/polygons/BenchmarkPlot.java
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/performance/polygons/BenchmarkPlot.java
@@ -8,7 +8,6 @@
import org.jzy3d.chart.factories.AWTChartFactory;
import org.jzy3d.chart.factories.ChartFactory;
import org.jzy3d.colors.Color;
-import org.jzy3d.debug.View2DLayout_Debug;
import org.jzy3d.io.xls.ExcelBuilder;
import org.jzy3d.maths.BoundingBox3d;
import org.jzy3d.maths.Coord3d;
@@ -21,6 +20,7 @@
import org.jzy3d.plot3d.rendering.canvas.Quality;
import org.jzy3d.plot3d.rendering.view.AWTView;
import org.jzy3d.plot3d.rendering.view.View2DLayout;
+import org.jzy3d.plot3d.rendering.view.View2DLayout_Debug;
public class BenchmarkPlot implements BenchmarkXLS {
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest.java
index 5aa9b480a..ab16e3249 100644
--- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest.java
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest.java
@@ -56,7 +56,7 @@ public enum WT {
// //
// Toolkit and resolutions to apply to all tests using the forEach operator
- protected WT[] toolkits = {WT.EmulGL_AWT, WT.Native_AWT, WT.Native_Swing};
+ protected WT[] toolkits = {WT.Native_AWT, WT.Native_Swing, WT.EmulGL_AWT};
protected HiDPI[] resolutions = {HiDPI.ON, HiDPI.OFF};
/**
@@ -104,10 +104,12 @@ public void markdownAllTests() throws IOException {
section(sb, "AxisLabelRotateLayout");
// Colorbar tests
- section(sb, "Colorbar", "Shrink", null);
- section(sb, "Colorbar", "ShrinkBigFont", null);
+ //section(sb, "Colorbar", "Shrink", null);
+ //section(sb, "Colorbar", "ShrinkBigFont", null);
section(sb, "Colorbar", "IsModifiedByCustomFont", null);
- section(sb, "Colorbar", "HasMinimumWidth", null);
+ //section(sb, "Colorbar", "HasMinimumWidth", null);
+
+ section(sb, "2D_Colorbar");
// 2D tests
line(sb, "# 2D Layout");
@@ -302,8 +304,7 @@ public static Chart chart(ChartFactory factory, HiDPI hidpi, Rectangle offscreen
public static Quality quality(HiDPI hidpi) {
Quality q = Quality.Advanced();
- q.setHiDPIEnabled(HiDPI.ON.equals(hidpi) ? true : false); // Enable HiDPI if available on
- // computer
+ q.setHiDPI(hidpi);
q.setAnimated(false);
return q;
}
@@ -340,9 +341,7 @@ public static void assertChart(Chart chart, String name) {
// processing remain stable (I observed bugs where a margin may reduce
// after each rendering, hence the colorbar moves)
int nRefresh = 6;
- for (int i = 0; i < nRefresh; i++) {
- chart.render();
- }
+ chart.render(nRefresh);
// Verify
ChartTester tester = new ChartTester();
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D.java
index 9f3754c0d..3f548dcfb 100644
--- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D.java
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D.java
@@ -19,7 +19,7 @@ public class ITTest_2D extends ITTest {
protected static int[] margins = {0, 20};
protected static int[] tickLabelDists = {0, 10};
protected static int[] axisLabelDists = {0, 10};
- protected static boolean[] textAddMargin = {false, true};
+ protected static boolean[] textAddMargin = {true};
/** Toolkit and resolution iterator */
@Test
@@ -82,7 +82,7 @@ public static void forEach(ITTest2D_Margin_Instance runner) {
static String caseAxisRotated = "whenAxisRotated_ThenApplyMargins";
protected static LabelOrientation[] yOrientations =
- {LabelOrientation.VERTICAL, LabelOrientation.HORIZONTAL, LabelOrientation.PARALLEL_TO_AXIS};
+ {LabelOrientation.VERTICAL, LabelOrientation.HORIZONTAL};
/** Toolkit and resolution iterator */
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D_Colorbar.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D_Colorbar.java
new file mode 100644
index 000000000..d887ee104
--- /dev/null
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_2D_Colorbar.java
@@ -0,0 +1,227 @@
+package org.jzy3d.tests.integration;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import javax.imageio.ImageIO;
+import org.junit.Test;
+import org.jzy3d.chart.AWTChart;
+import org.jzy3d.chart.Chart;
+import org.jzy3d.maths.Margin;
+import org.jzy3d.maths.Range;
+import org.jzy3d.painters.Font;
+import org.jzy3d.plot2d.rendering.AWTGraphicsUtils;
+import org.jzy3d.plot3d.primitives.SampleGeom;
+import org.jzy3d.plot3d.primitives.Shape;
+import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
+import org.jzy3d.plot3d.primitives.axis.layout.LabelOrientation;
+import org.jzy3d.plot3d.primitives.axis.layout.fonts.HiDPIProportionalFontSizePolicy;
+import org.jzy3d.plot3d.primitives.axis.layout.providers.RegularTickProvider;
+import org.jzy3d.plot3d.primitives.axis.layout.renderers.DefaultDecimalTickRenderer;
+import org.jzy3d.plot3d.rendering.canvas.Quality;
+import org.jzy3d.plot3d.rendering.legends.colorbars.AWTColorbarLegend;
+import org.jzy3d.plot3d.rendering.legends.overlay.LegendLayout;
+import org.jzy3d.plot3d.rendering.view.AWTImageRenderer;
+import org.jzy3d.plot3d.rendering.view.AWTView;
+import org.jzy3d.plot3d.rendering.view.HiDPI;
+import org.jzy3d.plot3d.rendering.view.View2DLayout;
+import org.jzy3d.plot3d.rendering.view.View2DLayout_Debug;
+import org.jzy3d.tests.integration.ITTest.WT;
+
+public class ITTest_2D_Colorbar extends ITTest {
+ public static void main(String[] args) {
+ open(new ITTest_2D_Colorbar().when2DChartWithColorbarAndMargins(WT.EmulGL_AWT, HiDPI.ON));
+ //open(new ITTest_AxisLabelRotateLayout().whenAxisLabelOrientationNotHorizontal(WT.Native_AWT, HiDPI.ON));
+ }
+
+
+ // ----------------------------------------------------
+ // TEST MULTIPLE AXIS ORIENTATION SETTINGS
+ // ----------------------------------------------------
+
+ //static String caseAxisRotated = "whenAxisRotated_ThenApplyMargins";
+
+ /*protected static LabelOrientation[] yOrientations =
+ {LabelOrientation.VERTICAL, LabelOrientation.HORIZONTAL};
+
+
+ @Test
+ public void whenAxisRotated_ThenApplyMargins() {
+ System.out.println("ITTest : " + caseAxisRotated);
+
+ forEach((toolkit, resolution) -> whenAxisRotated_ThenApplyMargins(toolkit, resolution));
+ }*/
+
+ @Test
+ public void when2DChartWithColorbarAndMargins() {
+ System.out.println("ITTest : when2DChartWithColorbarAndMargins");
+
+ forEach((toolkit, resolution) -> when2DChartWithColorbarAndMargins(toolkit, resolution));
+ }
+
+
+
+ protected Chart when2DChartWithColorbarAndMargins(WT wt, HiDPI hidpi) {
+ // Given a chart with long Y axis name
+ AWTChart chart = (AWTChart)chart(wt, hidpi);
+ //chart.add(surface());
+ //chart.view2d();
+
+ //AxisLayout axisLayout = chart.getAxisLayout();
+ //axisLayout.setYAxisLabel("Y axis longer than usual");
+
+ /*forEach((yOrientation)->{
+ // When : vertical orientation
+ axisLayout.setYAxisLabelOrientation(yOrientation);
+
+ // Then
+ assertChart(chart, name(ITTest_2D_Colorbar.this, caseAxisRotated, wt, hidpi, properties(yOrientation)));
+
+ });*/
+
+
+ // ---------------------------------------
+ // CHART CONTENT
+ // ---------------------------------------
+
+ // Create a chart
+ //AWTChart chart = (AWTChart) f.newChart(Quality.Advanced().setHiDPI(hidpi));
+ AWTView view = (AWTView) chart.getView();
+
+ // Surface
+ Shape surface = SampleGeom.surface(new Range(-3, 1), new Range(-1, 3), 1f);
+ surface.setWireframeDisplayed(false);
+ chart.add(surface);
+
+
+ DefaultDecimalTickRenderer tickRenderer = new DefaultDecimalTickRenderer(12);
+
+ // Colorbar
+ AWTColorbarLegend colorbar = chart.colorbar(surface);
+ // TODO https://github.com/jzy3d/jzy3d-api/issues/273
+ colorbar.getImageGenerator().setTickRenderer(tickRenderer);
+
+
+
+ // Logo
+ BufferedImage logo = null;
+ try {
+ logo = ImageIO.read(new File("src/test/resources/icons/martin.jpeg"));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ logo = AWTGraphicsUtils.scale(logo, .25f, .25f);
+
+ AWTImageRenderer imageRenderer = new AWTImageRenderer(logo);
+ view.addRenderer2d(imageRenderer);
+
+
+ // ---------------------------------------
+ // LAYOUT CONFIGURATION
+ // ---------------------------------------
+
+ int minMargin = 10;
+ int defaultDistances = 10;
+ boolean spaceForRightMostTick = false;
+ boolean spaceForLogo = false;
+ // TODO : fix AWTImageViewport.renderImage to properly work for any x axis/tick label distance
+ boolean colorbarBottomAlignWithChartView = false;
+
+
+ // Axis layout configuration
+ AxisLayout axisLayout = view.getAxisLayout();
+ axisLayout.setTickLineDisplayed(true);
+ axisLayout.setYAxisLabel("Y axis is a bit longer than usual");
+ axisLayout.setZTickProvider(new RegularTickProvider(5));
+ axisLayout.setZTickRenderer(tickRenderer);
+
+ //axisLayout.setXAxisLabelDisplayed(false);
+
+
+ axisLayout.setFont(new Font("Arial", 14));
+ axisLayout.setFontSizePolicy(new HiDPIProportionalFontSizePolicy(chart.getView()));
+ axisLayout.setAxisLabelOffsetAuto(true);
+
+ // Logo layout configuration
+ LegendLayout legendLayout = imageRenderer.getLayout();
+ legendLayout.setCorner(LegendLayout.Corner.BOTTOM_LEFT);
+
+ // View layout configuration
+ View2DLayout viewLayout = view.get2DLayout();
+ viewLayout.setMargin(new Margin(minMargin, minMargin*2, minMargin*3, minMargin*4));
+ viewLayout.setTickLabelDistance(defaultDistances);
+ viewLayout.setAxisLabelDistance(defaultDistances*2);
+ viewLayout.setSymetricVerticalMargin(false);
+
+ // View layout with a bit more space on the left for the logo
+ if(spaceForLogo) {
+ int marginL = Math.round(logo.getWidth(null) + legendLayout.getMargin().getLeft()) / 2;
+ viewLayout.getMargin().setLeft(marginL);
+ }
+
+ // View layout avoid covering tick label with colorbar, or configure space for symetry
+ if(spaceForRightMostTick) {
+ if (surface.hasLegend()) {
+ // viewLayout.getMargin().setRight(minMargin + 15);
+
+ // NOT EXACT WHEN GROWING FONT!
+ int xWidth = axisLayout.getRightMostXTickLabelWidth(view.getPainter());
+
+ // distance between axis right border, and view main viewport border (distance to colorbar
+ // border)
+ viewLayout.getMargin().setRight(xWidth / 2);
+ } else {
+ viewLayout.setSymetricHorizontalMargin(true);
+ }
+ }
+
+
+ // Colorbar Layout
+ //ViewAndColorbarsLayout viewportLayout = (ViewAndColorbarsLayout) view.getLayout();
+
+
+ Margin viewMargin = viewLayout.getMargin();
+ int bottom = (int) viewMargin.getBottom();
+
+ if (colorbarBottomAlignWithChartView) {
+
+ bottom += viewLayout.getHorizontalTickLabelsDistance();
+ bottom += axisLayout.getFont().getHeight();
+ bottom += viewLayout.getHorizontalAxisLabelsDistance();
+ bottom += axisLayout.getFont().getHeight();
+ }
+
+ // SI RIGHT MARGIN NON NUL ET LEFT NULL, IMAGE MAL CENTREE
+ Margin colorbarMargin = new Margin(minMargin * 1, minMargin * 1, viewMargin.getTop(), bottom);
+ colorbar.setMargin(colorbarMargin);
+
+
+ view.addRenderer2d(new View2DLayout_Debug());
+
+
+ // Enable 2D mode
+ chart.view2d();
+
+
+
+
+ // Then
+ assertChart(chart, name(ITTest_2D_Colorbar.this, null, wt, hidpi));
+
+ return chart;
+ }
+
+/*
+ public static interface ITTest2D_Orientation_Instance {
+ public void run(LabelOrientation yAxisOrientation);
+ }
+
+ public static void forEach(ITTest2D_Orientation_Instance runner) {
+ for (LabelOrientation yAxisOrientation : yOrientations) {
+ runner.run(yAxisOrientation);
+ }
+ }
+*/
+
+}
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Colorbar.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Colorbar.java
index 6ec5fffb7..df7d6f8e2 100644
--- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Colorbar.java
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Colorbar.java
@@ -64,7 +64,7 @@ public String font(Chart chart) {
/* ************************************************************************************************** */
- @Test
+ /*@Test
public void whenColorbar_HasMininumWidth() {
System.out.println("ITTest : whenColorbar_HasMininumWidth");
@@ -97,11 +97,11 @@ public Chart whenColorbar_HasMininumWidth(WT wt, HiDPI hidpi) {
assertChart(chart, name(this, "HasMinimumWidth", wt, chart.getQuality().getHiDPI()));
return chart;
- }
+ }*/
/* ************************************************************************************************** */
- @Test
+ /*@Test
public void whenColorbar_ShrinkBigFont() {
System.out.println("ITTest : whenColorbar_ShrinkBigFont");
@@ -121,34 +121,28 @@ public Chart whenColorbar_ShrinkBigFont(WT wt, HiDPI hidpi) {
AWTColorbarLegend legend = new AWTColorbarLegend(surface, chart.getView().getAxis().getLayout());
surface.setLegend(legend);
- //legend.setMinimumWidth(300);
String name;
if(WT.EmulGL_AWT.equals(wt)) {
EmulGLSkin skin = EmulGLSkin.on(chart);
EmulGLViewAndColorbarsLayout layout = skin.getLayout();
- layout.setShrinkColorbar(true);
name = name(this, "ShrinkBigFont", wt, chart.getQuality().getHiDPI());
}
else {
- NativeViewAndColorbarsLayout layout = (NativeViewAndColorbarsLayout)((ChartView)chart.getView()).getLayout();
- layout.setShrinkColorbar(true);
-
name = name(this, "ShrinkBigFont", wt, chart.getQuality().getHiDPI());
-
}
// Then
assertChart(chart, name);
return chart;
- }
+ }*/
/* ************************************************************************************************** */
- @Test
+ /*@Test
public void whenColorbar_Shrink() {
System.out.println("ITTest : whenColorbar_Shrink");
@@ -174,23 +168,18 @@ public Chart whenColorbar_Shrink(WT wt, HiDPI hidpi) {
if(WT.EmulGL_AWT.equals(wt)) {
EmulGLSkin skin = EmulGLSkin.on(chart);
EmulGLViewAndColorbarsLayout layout = skin.getLayout();
- layout.setShrinkColorbar(true);
name = name(this, "Shrink", wt, chart.getQuality().getHiDPI());
}
else {
- NativeViewAndColorbarsLayout layout = (NativeViewAndColorbarsLayout)((ChartView)chart.getView()).getLayout();
- layout.setShrinkColorbar(true);
-
name = name(this, "Shrink", wt, chart.getQuality().getHiDPI());
-
}
// Then
assertChart(chart, name);
return chart;
- }
+ }*/
}
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Overlay.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Overlay.java
index 75b9e5506..54e222246 100644
--- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Overlay.java
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Overlay.java
@@ -20,7 +20,7 @@
public class ITTest_Overlay extends ITTest {
public static void main(String[] args) {
- open(new ITTest_Overlay().whenOverlayAreMoved(WT.EmulGL_AWT, HiDPI.ON));
+ open(new ITTest_Overlay().whenOverlayAreMoved(WT.Native_Swing, HiDPI.ON));
}
protected static String caseOverlayMove = "OverlayMove";
@@ -76,8 +76,8 @@ public Chart whenOverlayAreMoved(WT wt, HiDPI hidpi) {
infos.add(new Legend(line3.getName(), Color.GREEN));
OverlayLegendRenderer legend = new OverlayLegendRenderer(infos);
- legend.getLayout().setBoxMarginX(10);
- legend.getLayout().setBoxMarginY(10);
+ legend.getLayout().getMargin().setWidth(10);
+ legend.getLayout().getMargin().setHeight(10);
legend.getLayout().setBackgroundColor(Color.WHITE);
legend.getLayout().setFont(new java.awt.Font("Helvetica", java.awt.Font.PLAIN, 11));
chart.addRenderer(legend);
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Text.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Text.java
index 2206993d5..5dafca82c 100644
--- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Text.java
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/integration/ITTest_Text.java
@@ -22,8 +22,9 @@
public class ITTest_Text extends ITTest{
/** This main method is here to test manually a chart and keep it open until one close it explicitely. */
public static void main(String[] args) {
- //open(new ITTest_Text().whenCustomFont(WT.EmulGL_AWT, HiDPI.ON));
- open(new ITTest_Text().whenDrawableTextRenderer(WT.EmulGL_AWT, HiDPI.OFF));
+ open(new ITTest_Text().whenCustomFont(WT.Native_AWT, HiDPI.ON));
+ //open(new ITTest_Text().whenDrawableTextRenderer(WT.EmulGL_AWT, HiDPI.OFF));
+ //open(new ITTest_Text().whenDrawableTextRenderer(WT.Native_AWT, HiDPI.OFF));
}
/* ************************************************************************************************** */
@@ -139,6 +140,7 @@ private static void createDrawableText(Chart chart, Font font, Coord3d position,
t1.setDefaultFont(font);
t1.setHalign(h);
t1.setValign(v);
+ //t1.setRotation(45);
Point p1 = new Point(position, positionColor);
p1.setWidth(5);
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout.java
index c4207d811..cbb812a9f 100644
--- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout.java
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout.java
@@ -41,6 +41,9 @@ public class MTest_Layout extends AWTAbstractAnalysis {
public MTest_Layout() {
factory = new EmulGLChartFactory();
}
+
+ Shape surface;
+ AWTColorbarLegend colorbar;
@Override
public void init() {
@@ -64,8 +67,6 @@ public void init() {
//skin.getCanvas().setProfileDisplayMethod(true);
//skin.getCanvas().setDebugEvents(true);
- skin.getLayout().setShrinkColorbar(true);
-
AdaptiveRenderingPolicy policy = new AdaptiveRenderingPolicy();
policy.renderingRateLimiter = new RateLimiterAdaptsToRenderTime();
policy.optimizeForRenderingTimeLargerThan = 130;// ms
@@ -74,10 +75,8 @@ public void init() {
skin.getMouse().setPolicy(policy);
skin.getThread().setSpeed(15);
- } else {
- ((ViewAndColorbarsLayout) ((AWTView) chart.getView()).getLayout()).setShrinkColorbar(true);
- }
-
+ }
+
AxisLayout layout = chart.getAxisLayout();
// layout.setFont(new Font("Apple Chancery", 20));
layout.setFont(new Font("Helvetica", 20));
@@ -104,7 +103,7 @@ public void init() {
// view.setMaintainAllObjectsInView(true);
view.setCameraRenderingSphereRadiusFactor(1.1f);
- AWTColorbarLegend colorbar =
+ colorbar =
new AWTColorbarLegend(surface, chart.getView().getAxis().getLayout());
surface.setLegend(colorbar);
chart.add(surface);
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout_Native.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout_Native.java
index b258e458d..e0f574ed5 100644
--- a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout_Native.java
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout_Native.java
@@ -27,9 +27,6 @@ public static void main(String[] args) {
Chart chart = d.getChart();
chart.open(800, 600);
-
- DoubleScreenManualScenario scenario = new DoubleScreenManualScenario(chart, MTest_Layout_Native.class.getSimpleName());
- scenario.start();
}
diff --git a/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout_Native_Open.java b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout_Native_Open.java
new file mode 100644
index 000000000..f5ba168bc
--- /dev/null
+++ b/jzy3d-tests-java9/src/test/java/org/jzy3d/tests/manual/layout/MTest_Layout_Native_Open.java
@@ -0,0 +1,193 @@
+package org.jzy3d.tests.manual.layout;
+
+import java.awt.image.BufferedImage;
+import org.jzy3d.chart.AWTChart;
+import org.jzy3d.chart.factories.AWTChartFactory;
+import org.jzy3d.chart.factories.ChartFactory;
+import org.jzy3d.colors.Color;
+import org.jzy3d.events.IViewLifecycleEventListener;
+import org.jzy3d.events.ViewLifecycleEvent;
+import org.jzy3d.painters.Font;
+import org.jzy3d.plot2d.primitive.AWTColorbarImageGenerator;
+import org.jzy3d.plot3d.primitives.SampleGeom;
+import org.jzy3d.plot3d.primitives.Shape;
+import org.jzy3d.plot3d.primitives.axis.layout.AxisLayout;
+import org.jzy3d.plot3d.primitives.axis.layout.LabelOrientation;
+import org.jzy3d.plot3d.primitives.axis.layout.ZAxisSide;
+import org.jzy3d.plot3d.primitives.axis.layout.fonts.HiDPIProportionalFontSizePolicy;
+import org.jzy3d.plot3d.rendering.canvas.Quality;
+import org.jzy3d.plot3d.rendering.legends.colorbars.AWTColorbarLegend;
+import org.jzy3d.plot3d.rendering.view.AWTView;
+import org.jzy3d.plot3d.rendering.view.View2DLayout_Debug;
+
+/**
+ * QTP
+ * valider avec / sans HiDPI :
+ * - le layout du texte est le même
+ * - les marges / offset sont appliquées correctement
+ * - marche côté gauche / côté droit
+ * - avec vertical / oblique / etc
+ *
+ * - Le calcul d'offset de label ne prend pas en compte la rotation du texte dans la place qu'il prend
+ *
+ * @author martin
+ *
+ */
+public class MTest_Layout_Native_Open {
+
+ static final float ALPHA_FACTOR = 0.55f;// .61f;
+
+ public static void main(String[] args) throws InterruptedException {
+ AWTChartFactory factory = new AWTChartFactory();
+ //EmulGLChartFactory factory = new EmulGLChartFactory();
+
+ new MTest_Layout_Native_Open().go(factory);
+
+
+ }
+
+ private void go(ChartFactory factory) throws InterruptedException {
+ Quality q = Quality.Advanced();
+ q.setAnimated(false);
+ q.setHiDPIEnabled(true);
+
+
+ // --------------------------------------------------------
+ // Configure chart content
+
+ Shape surface = SampleGeom.surface();
+
+ AWTChart chart = (AWTChart)factory.newChart(q);
+ AWTView view = chart.getView();
+
+//((ViewAndColorbarsLayout) chart.getView().getLayout()).setShrinkColorbar(true);
+
+ AxisLayout layout = chart.getAxisLayout();
+ // layout.setFont(new Font("Apple Chancery", 20));
+ layout.setFont(new Font("Helvetica", 20));
+ layout.setFontSizePolicy(new HiDPIProportionalFontSizePolicy(chart.getView()));
+
+ layout.setXAxisLabel("My X axis label is a little long to draw");
+ layout.setYAxisLabel("My Y axis label is a little long to draw");
+ layout.setZAxisLabel("My Z axis label is a little long to draw");
+
+ layout.setZAxisSide(ZAxisSide.LEFT);
+ layout.setZAxisLabelOrientation(LabelOrientation.VERTICAL);
+ layout.setYAxisLabelOrientation(LabelOrientation.PARALLEL_TO_AXIS);
+ layout.setXAxisLabelOrientation(LabelOrientation.PARALLEL_TO_AXIS);
+
+ layout.setAxisLabelOffsetAuto(true);
+ layout.setAxisLabelOffsetMargin(20);
+
+ layout.setXTickColor(Color.RED);
+ layout.setYTickColor(Color.GREEN);
+ layout.setZTickColor(Color.BLUE);
+
+
+ //chart.getAxisLayout().setMainColor(Color.WHITE);
+ //chart.getView().setBackgroundColor(Color.BLACK);
+
+ // view.setDisplayAxisWholeBounds(true);
+ // view.setMaintainAllObjectsInView(true);
+ //view.setCameraRenderingSphereRadiusFactor(1.1f);
+
+ // TODO : auto configure colorbar with back color?
+
+ chart.add(surface);
+
+ AWTColorbarLegend colorbar = chart.colorbar(surface);
+
+ // --------------------------------------------------------
+ // Open and enable controllers
+
+
+ chart.getKeyboard();
+ chart.getMouse();
+
+
+
+
+
+
+ view.addRenderer2d(new View2DLayout_Debug(Color.GREEN));
+
+ /*view.getCamera().setScreenGridDisplayed(true);
+ colorbar.setScreenGridDisplayed(true);*/
+
+
+ view.addViewLifecycleChangedListener(new IViewLifecycleEventListener() {
+ @Override
+ public void viewWillRender(ViewLifecycleEvent e) {
+ }
+ @Override
+ public void viewHasInit(ViewLifecycleEvent e) {
+ }
+ @Override
+ public void viewHasRendered(ViewLifecycleEvent e) {
+ info(chart, view, colorbar);
+ }
+
+
+ });
+
+
+ chart.open(800, 600);
+ chart.view2d();
+
+ //Thread.sleep(100);
+ //info(chart, view, colorbar);
+
+ }
+
+ private void info(AWTChart chart, AWTView view, AWTColorbarLegend colorbar) {
+ //System.out.println("Canvas.bounds : " + ((Component)chart.getCanvas()).getBounds());
+ System.out.println("---------------------------------");
+ System.out.println("Canvas.dims : " + chart.getCanvas().getDimension());
+ System.out.println("---");
+ System.out.println("View.cam.viewport : " + view.getCamera().getLastViewPort());
+ System.out.println("View.scale : " + view.getPixelScale());
+ System.out.println("---");
+
+ BufferedImage i = colorbar.getImage();
+
+ System.out.println("Colorbar.askedDim : " + colorbar.getWidth() + " x " + colorbar.getHeight());
+ System.out.println("Colorbar.viewport : " + colorbar.getLastViewPort());
+ System.out.println("Colorbar.margins : " + colorbar.getMargin());
+ System.out.println("Colorbar.image : " + i.getWidth(null) + " x " + i.getHeight(null));
+ System.out.println("Colorbar.minDim : " + colorbar.getMinimumDimension());
+ System.out.println("---");
+
+
+ AWTColorbarImageGenerator gen = colorbar.getImageGenerator();
+ System.out.println("Colorbar.gen.scale : " + gen.getPixelScale());
+ System.out.println("Colorbar.gen.prefWidth : " + gen.getPreferredWidth(chart.getPainter()));
+ System.out.println("Colorbar.gen.bar : " + gen.getBarWidth());
+ System.out.println("Colorbar.gen.txt2bar : " + gen.getTextToBarHorizontalMargin());
+ System.out.println("Colorbar.gen.maxTxtWidth : " + gen.getMaxTextWidth());
+ }
+
+
+
+ /*
+ *
+ if (factory instanceof EmulGLChartFactory) {
+ EmulGLSkin skin = EmulGLSkin.on(chart);
+
+ //skin.getCanvas().setProfileDisplayMethod(true);
+ //skin.getCanvas().setDebugEvents(true);
+
+ skin.getLayout().setShrinkColorbar(true);
+
+ AdaptiveRenderingPolicy policy = new AdaptiveRenderingPolicy();
+ policy.renderingRateLimiter = new RateLimiterAdaptsToRenderTime();
+ policy.optimizeForRenderingTimeLargerThan = 130;// ms
+ policy.optimizeByDroppingFaceAndKeepingWireframeWithColor = true;
+
+ skin.getMouse().setPolicy(policy);
+
+ skin.getThread().setSpeed(15);
+ } else {
+ ((ViewAndColorbarsLayout) ((AWTView) chart.getView()).getLayout()).setShrinkColorbar(true);
+ }*/
+
+}
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_EmulGL_AWT_HiDPI=OFF.png
new file mode 100644
index 000000000..fddd986bb
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_EmulGL_AWT_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_EmulGL_AWT_HiDPI=ON.png
new file mode 100644
index 000000000..60ab91591
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_EmulGL_AWT_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_AWT_HiDPI=OFF.png
new file mode 100644
index 000000000..3e2f0b787
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_AWT_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_AWT_HiDPI=ON.png
new file mode 100644
index 000000000..b681dbc56
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_AWT_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_Swing_HiDPI=OFF.png
new file mode 100644
index 000000000..70c1edd88
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_Swing_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_Swing_HiDPI=ON.png
new file mode 100644
index 000000000..261fa57c0
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_Colorbar_Native_Swing_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 882949c30..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index 126e40f83..0e5d575d7 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 4849e4459..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index f5d2bac78..cd2b7db93 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 6a5f4803b..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 9712499a3..496679f3c 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index ca53622bd..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index d19437156..750091b93 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index fd0ae3087..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index df16096b0..c0f451125 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 66800c199..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index 82f3db7de..f8517c59e 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index e9e960bfa..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 27047b6ce..f3c0dfbb0 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index a1f98d7a7..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index ffc10dd42..69d8e2dfa 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 06209f3a4..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index 251252ea9..1c580b7d8 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 572ad545d..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index e4c6af09b..113980835 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 4259c3ae2..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 64daac7a5..21d826a6f 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 1bf94df93..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index f391d619b..410baff37 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index fa99eda12..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index fb295b43e..9a102d869 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 5cc2fcad8..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index c02a4cda1..53ce54fe9 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index f58aed859..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 72522b864..e9c19ddaf 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 9ae82a921..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index b51a7716d..ce48f4abe 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 8a0952a43..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index b1c383547..d78f48ada 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 925f0feaa..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index 6e41036cc..73f1e232d 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 9c4fae7cf..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 616a4c1f3..39610d74d 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index ce5dd2770..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index caf3ac5c9..f928b52bc 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index f3e9c8fbe..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index fcfb2bd58..1668ec65a 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 8d7e5c51c..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index 7b5d4270b..2b97509aa 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index d9b1a90f3..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 57d1587cc..6c4b8c057 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 8293c8116..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index e9cb640d5..88d9287d4 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 9aef6db22..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index 91af5a19e..bbb549feb 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 14989fd9a..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index f42b09c18..03b3f7b57 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 5ae1e800c..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 3e3d7fe16..19b97f1fd 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 7953c691e..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index d7b522939..16abbf6d9 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index a3a9a51e7..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index be179e65d..611eb85fb 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index d8076cd92..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index 70667f562..2a259dd9a 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index c377ea841..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 08c33e3d6..41b320127 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 657dc15d5..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index bc067e9e3..b5bc9f90b 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_AWT_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index d923d05b5..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index bd208dca3..def85d231 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 61f7a4b58..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index 3fd3d2cd8..bed004e1b 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index a7f639bd6..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index 8f35a0b92..0e09845c9 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 257787a59..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index e2048f962..65c0706b4 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 524c3d083..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index 463299dce..10b7df2e8 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 006a987fe..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index 98df6defe..e97a9dc2d 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 0a699052e..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index b541e3b7e..0d40cb742 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 2be9830e1..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index 4d76410bc..df3e234a5 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=OFF_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 40f2e2294..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index 28a6df494..0792de576 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 4b9d3f5d5..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index cbb13edac..4be156b3f 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index b4d0cf7ac..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index fdc57abc5..0284471c4 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index c6c82363c..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index 252ffe1f9..a985d231d 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=0_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index e0f82a384..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png
index b86996ea1..e4870ca2a 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index 5511b7169..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png
index 821c15333..06fb7eb90 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=0_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png
deleted file mode 100644
index 75e74d9c0..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png
index a3fb1e843..16b3f47b3 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=0_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png
deleted file mode 100644
index b73d43cc9..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=false.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png
index 1950889e2..7c6e61b8d 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_when2DLayoutConfig_ThenApplyMargins_Native_Swing_HiDPI=ON_BorderMargin=20_TickLabel=10_AxisLabel=10_TextAddMargin=true.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png
deleted file mode 100644
index 2faf2eb2d..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_yAxisOrientation=VERTICAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_yAxisOrientation=VERTICAL.png
index 2faf2eb2d..98ca88e47 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_yAxisOrientation=VERTICAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=OFF_yAxisOrientation=VERTICAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=HORIZONTAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=HORIZONTAL.png
index 669b70028..1144507f0 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=HORIZONTAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=HORIZONTAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png
deleted file mode 100644
index 5ba6af3ff..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=VERTICAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=VERTICAL.png
index 5ba6af3ff..13781aeb7 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=VERTICAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_EmulGL_AWT_HiDPI=ON_yAxisOrientation=VERTICAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=HORIZONTAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=HORIZONTAL.png
index e0130ffc6..0e5c26205 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=HORIZONTAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=HORIZONTAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png
deleted file mode 100644
index 4cddd69b2..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=VERTICAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=VERTICAL.png
index 2a9e0cf37..3f3ec6260 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=VERTICAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=OFF_yAxisOrientation=VERTICAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=HORIZONTAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=HORIZONTAL.png
index a0c6f7b96..dd1ed9bb1 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=HORIZONTAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=HORIZONTAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png
deleted file mode 100644
index 18f05ca06..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=VERTICAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=VERTICAL.png
index fd4db9f66..d24b6195f 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=VERTICAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_AWT_HiDPI=ON_yAxisOrientation=VERTICAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=HORIZONTAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=HORIZONTAL.png
index 407f04543..137580d62 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=HORIZONTAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=HORIZONTAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png
deleted file mode 100644
index e4088f857..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=PARALLEL_TO_AXIS.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=VERTICAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=VERTICAL.png
index 8d0c993ca..76a4196c7 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=VERTICAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=OFF_yAxisOrientation=VERTICAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=HORIZONTAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=HORIZONTAL.png
index 31cb592ee..c33d2873e 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=HORIZONTAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=HORIZONTAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png
deleted file mode 100644
index 07bc02217..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=PARALLEL_TO_AXIS.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=VERTICAL.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=VERTICAL.png
index 75d25e391..63363d347 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=VERTICAL.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/2D_whenAxisRotated_ThenApplyMargins_Native_Swing_HiDPI=ON_yAxisOrientation=VERTICAL.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_EmulGL_AWT_HiDPI=OFF.png
index ad676e8cd..eecf340ce 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_EmulGL_AWT_HiDPI=OFF.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_EmulGL_AWT_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_EmulGL_AWT_HiDPI=ON.png
index 88a3a04cb..5db5cbd26 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_EmulGL_AWT_HiDPI=ON.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_EmulGL_AWT_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_AWT_HiDPI=OFF.png
index f6df2d151..778ffc067 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_AWT_HiDPI=OFF.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_AWT_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_AWT_HiDPI=ON.png
index af4445303..18496e5e0 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_AWT_HiDPI=ON.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_AWT_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_Swing_HiDPI=OFF.png
index 91993f625..593b70667 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_Swing_HiDPI=OFF.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_Swing_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_Swing_HiDPI=ON.png
index 06ee333b1..8d363ee1f 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_Swing_HiDPI=ON.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/AxisLabelRotateLayout_Native_Swing_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_EmulGL_AWT_HiDPI=OFF.png
deleted file mode 100644
index 7fb5b831a..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_EmulGL_AWT_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_EmulGL_AWT_HiDPI=ON.png
deleted file mode 100644
index 0fbd71fb2..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_EmulGL_AWT_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_AWT_HiDPI=OFF.png
deleted file mode 100644
index 7a8f75a12..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_AWT_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_AWT_HiDPI=ON.png
deleted file mode 100644
index 200ab71de..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_AWT_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_Swing_HiDPI=OFF.png
deleted file mode 100644
index 8a579b570..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_Swing_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_Swing_HiDPI=ON.png
deleted file mode 100644
index 969338eb5..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_HasMinimumWidth_Native_Swing_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_EmulGL_AWT_HiDPI=OFF.png
index c671854f9..727b93bf5 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_EmulGL_AWT_HiDPI=OFF.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_EmulGL_AWT_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_EmulGL_AWT_HiDPI=ON.png
index 1569b5b09..96699d45c 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_EmulGL_AWT_HiDPI=ON.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_EmulGL_AWT_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_AWT_HiDPI=OFF.png
index 1c195b5b5..2a1fc7c8d 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_AWT_HiDPI=OFF.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_AWT_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_AWT_HiDPI=ON.png
index 0330e9967..7dc9820b6 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_AWT_HiDPI=ON.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_AWT_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_Swing_HiDPI=OFF.png
index 6279732c9..f7194b82a 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_Swing_HiDPI=OFF.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_Swing_HiDPI=OFF.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_Swing_HiDPI=ON.png
index 6c9951c4b..3a7a5903e 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_Swing_HiDPI=ON.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_IsModifiedByCustomFont_Native_Swing_HiDPI=ON.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_EmulGL_AWT_HiDPI=OFF.png
deleted file mode 100644
index a142d8842..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_EmulGL_AWT_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_EmulGL_AWT_HiDPI=ON.png
deleted file mode 100644
index a3234d1cb..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_EmulGL_AWT_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_AWT_HiDPI=OFF.png
deleted file mode 100644
index 1dab8d69b..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_AWT_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_AWT_HiDPI=ON.png
deleted file mode 100644
index 214604f18..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_AWT_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_Swing_HiDPI=OFF.png
deleted file mode 100644
index 99c59ae0a..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_Swing_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_Swing_HiDPI=ON.png
deleted file mode 100644
index 4c4ec8eb2..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_ShrinkBigFont_Native_Swing_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_EmulGL_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_EmulGL_AWT_HiDPI=OFF.png
deleted file mode 100644
index dcee84ba8..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_EmulGL_AWT_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_EmulGL_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_EmulGL_AWT_HiDPI=ON.png
deleted file mode 100644
index 523493f8d..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_EmulGL_AWT_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_AWT_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_AWT_HiDPI=OFF.png
deleted file mode 100644
index 1915065da..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_AWT_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_AWT_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_AWT_HiDPI=ON.png
deleted file mode 100644
index cc3c9bf93..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_AWT_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_Swing_HiDPI=OFF.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_Swing_HiDPI=OFF.png
deleted file mode 100644
index bd92c08a1..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_Swing_HiDPI=OFF.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_Swing_HiDPI=ON.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_Swing_HiDPI=ON.png
deleted file mode 100644
index 7bcacadb1..000000000
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Colorbar_Shrink_Native_Swing_HiDPI=ON.png and /dev/null differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png
index fcdb18212..51c02470e 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png
index faa60e7ac..a37069f35 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png
index fd6f91606..4bff065cd 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png
index 3e836771e..f1ee44ef6 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png
index 274ee5ace..f400332d5 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png
index 0212ee18f..d4334fdd0 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png
index 0263e1c9c..34907cc6d 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png
index 4ca3f39e2..911ddeee8 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_EmulGL_AWT_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png
index 83e12d5b1..807ad8bb3 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png
index 7281723f2..4b7cc712f 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png
index 992f09815..ba044f20b 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png
index 8297d9f0d..9d8fcb685 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png
index a090f53a2..65696ea06 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png
index 988293b45..8a1363f22 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png
index 17df06ae5..16a170134 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png
index 35de1fc50..0118fa883 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_AWT_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png
index 8925b634f..6ab77a251 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png
index f78150a33..047041ca1 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png
index 607575389..e29df7f45 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png
index d49f561f5..c054fa5a8 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=OFF_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png
index b7a2f889b..cfc2ac534 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png
index 1960d322b..f6aa5b6f2 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png
index a3950ff64..f22ecf2d1 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png
index b2ceb6dda..7d5ada06d 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_EmulGL_AWT_HiDPI=OFF_Font=AppleChancery24.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_EmulGL_AWT_HiDPI=OFF_Font=AppleChancery24.png
index 3cb1fcdb6..727b93bf5 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_EmulGL_AWT_HiDPI=OFF_Font=AppleChancery24.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_EmulGL_AWT_HiDPI=OFF_Font=AppleChancery24.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_EmulGL_AWT_HiDPI=ON_Font=AppleChancery24.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_EmulGL_AWT_HiDPI=ON_Font=AppleChancery24.png
index 2ec409ac2..ff7917033 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_EmulGL_AWT_HiDPI=ON_Font=AppleChancery24.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_EmulGL_AWT_HiDPI=ON_Font=AppleChancery24.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_AWT_HiDPI=OFF_Font=AppleChancery24.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_AWT_HiDPI=OFF_Font=AppleChancery24.png
index e844c2cc0..eb7f3f517 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_AWT_HiDPI=OFF_Font=AppleChancery24.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_AWT_HiDPI=OFF_Font=AppleChancery24.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_AWT_HiDPI=ON_Font=AppleChancery24.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_AWT_HiDPI=ON_Font=AppleChancery24.png
index 607321516..d74a55ec5 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_AWT_HiDPI=ON_Font=AppleChancery24.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_AWT_HiDPI=ON_Font=AppleChancery24.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_Swing_HiDPI=OFF_Font=AppleChancery24.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_Swing_HiDPI=OFF_Font=AppleChancery24.png
index f1a5620e1..51c177e68 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_Swing_HiDPI=OFF_Font=AppleChancery24.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_Swing_HiDPI=OFF_Font=AppleChancery24.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_Swing_HiDPI=ON_Font=AppleChancery24.png b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_Swing_HiDPI=ON_Font=AppleChancery24.png
index 87bd48119..f48568186 100644
Binary files a/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_Swing_HiDPI=ON_Font=AppleChancery24.png and b/jzy3d-tests-java9/src/test/resources/macosx_10.12.6_NVIDIAGeForceGT650MOpenGLEngine/Text_Native_Swing_HiDPI=ON_Font=AppleChancery24.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png b/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png
new file mode 100644
index 000000000..a293dbdfd
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_LEFT_Corner2=TOP_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png b/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png
new file mode 100644
index 000000000..f48d6e790
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=BOTTOM_RIGHT_Corner2=BOTTOM_LEFT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png b/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png
new file mode 100644
index 000000000..eee2c457b
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_LEFT_Corner2=TOP_RIGHT.png differ
diff --git a/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png b/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png
new file mode 100644
index 000000000..62e0eaf6d
Binary files /dev/null and b/jzy3d-tests-java9/src/test/resources/windows10_10.0_IntelIrisXeGraphics/Overlay_Native_Swing_HiDPI=ON_Corner1=TOP_RIGHT_Corner2=BOTTOM_RIGHT.png differ
diff --git a/jzy3d-tutorials/src/main/java/org/jzy3d/demos/chart2d/Line2D_DemoAWT.java b/jzy3d-tutorials/src/main/java/org/jzy3d/demos/chart2d/Line2D_DemoAWT.java
index 950521269..516ecee92 100644
--- a/jzy3d-tutorials/src/main/java/org/jzy3d/demos/chart2d/Line2D_DemoAWT.java
+++ b/jzy3d-tutorials/src/main/java/org/jzy3d/demos/chart2d/Line2D_DemoAWT.java
@@ -49,8 +49,8 @@ public static void main(String[] args) {
OverlayLegendRenderer legend = new OverlayLegendRenderer(infos);
LineLegendLayout layout = legend.getLayout();
- layout.setBoxMarginX(10);
- layout.setBoxMarginY(10);
+ layout.getMargin().setWidth(10);
+ layout.getMargin().setHeight(10);
layout.setBackgroundColor(Color.WHITE);
layout.setFont(new java.awt.Font("Helvetica", java.awt.Font.PLAIN, 11));
diff --git a/pom.xml b/pom.xml
index ce9ba0c79..d8ef0a43c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,6 @@
-
+
4.0.0
org.jzy3d
@@ -76,9 +78,14 @@
jzy3d-svm-mapper
jzy3d-tools-libsvm
+
jzy3d-io-xls
jzy3d-io-reports
+
+ jzy3d-everything
+
+
jzy3d-tests-java9
@@ -106,8 +113,8 @@
-
@@ -258,8 +265,8 @@
-
@@ -282,13 +289,21 @@
-
junit
junit
4.13.2
+
+
+ com.diogonunes
+ JColor
+ 5.2.0
+
+
+
@@ -363,16 +378,16 @@
false
-
-
-Djogamp.common.utils.locks.Lock.timeout=20000
-
**/ITTest*.java
@@ -386,7 +401,7 @@
**/*Test.java
-
--add-exports java.base/java.lang=ALL-UNNAMED
--add-exports java.desktop/sun.awt=ALL-UNNAMED
@@ -517,10 +532,10 @@
maven-release-plugin
-
@@ -541,6 +556,19 @@
+
+
+
+
+
+
+ org.pitest
+ pitest-maven
+ 1.8.0
+
+
@@ -592,9 +620,9 @@
integration-tests
-
-
+
org.apache.maven.plugins
maven-surefire-plugin
3.0.0-M5
@@ -605,18 +633,18 @@
**/ITTest*.java
-
-
-