bugfix for TextRender memory leak

This commit is contained in:
wyq 2022-11-22 23:37:54 +08:00
parent a0485f8525
commit dca0941af2
9 changed files with 250 additions and 208 deletions

View File

@ -680,27 +680,24 @@ public class GLChartPanel extends GLJPanel implements IChartPanel{
void onMouseReleased(MouseEvent e) {
this.dragMode = false;
Plot plt = this.chart.findPlot(mouseDownPoint.x, mouseDownPoint.y);
if (!(plt instanceof AbstractPlot2D)) {
return;
}
AbstractPlot2D xyplot = (AbstractPlot2D) plt;
this.currentPlot = xyplot;
Plot plot = selPlot(this.mouseDownPoint.x, this.mouseDownPoint.y);
this.currentPlot = plot;
switch (this.mouseMode) {
case ZOOM_IN:
if (Math.abs(mouseLastPos.x - mouseDownPoint.x) > 5) {
if (plot instanceof AbstractPlot2D) {
AbstractPlot2D xyplot = (AbstractPlot2D) plot;
if (xyplot instanceof MapPlot) {
MapPlot plot = (MapPlot) xyplot;
Rectangle2D graphArea = xyplot.getGraphArea();
double[] xy1 = plot.screenToProj(mouseDownPoint.x - graphArea.getX(), mouseDownPoint.y - graphArea.getY(), graphArea);
double[] xy2 = plot.screenToProj(mouseLastPos.x - graphArea.getX(), mouseLastPos.y - graphArea.getY(), graphArea);
MapPlot mapPlot = (MapPlot) xyplot;
Rectangle2D graphArea = plot.getGraphArea();
double[] xy1 = mapPlot.screenToProj(mouseDownPoint.x - graphArea.getX(), mouseDownPoint.y - graphArea.getY(), graphArea);
double[] xy2 = mapPlot.screenToProj(mouseLastPos.x - graphArea.getX(), mouseLastPos.y - graphArea.getY(), graphArea);
Extent extent = new Extent();
extent.minX = Math.min(xy1[0], xy2[0]);
extent.maxX = Math.max(xy1[0], xy2[0]);
extent.minY = Math.min(xy1[1], xy2[1]);
extent.maxY = Math.max(xy1[1], xy2[1]);
plot.setDrawExtent(extent);
mapPlot.setDrawExtent(extent);
//this.paintGraphics();
this.repaintNew();
} else {
@ -733,9 +730,12 @@ public class GLChartPanel extends GLJPanel implements IChartPanel{
this.repaintNew();
}
}
}
break;
case ZOOM_OUT:
if (e.getButton() == MouseEvent.BUTTON1) {
if (plot instanceof AbstractPlot2D) {
AbstractPlot2D xyplot = (AbstractPlot2D) plot;
double zoom = 1.5;
Extent extent = xyplot.getDrawExtent();
double owidth = extent.getWidth();
@ -752,30 +752,36 @@ public class GLChartPanel extends GLJPanel implements IChartPanel{
//this.paintGraphics();
this.repaintNew();
}
}
break;
case SELECT:
if (Math.abs(mouseLastPos.x - mouseDownPoint.x) > 5) {
if (plot instanceof AbstractPlot2D) {
AbstractPlot2D xyplot = (AbstractPlot2D) plot;
if (xyplot instanceof XY1DPlot) {
XY1DPlot plot = (XY1DPlot) xyplot;
Rectangle2D graphArea = plot.getGraphArea();
XY1DPlot plt = (XY1DPlot) xyplot;
Rectangle2D graphArea = plt.getGraphArea();
if (graphArea.contains(mouseDownPoint.x, mouseDownPoint.y) || graphArea.contains(mouseLastPos.x, mouseLastPos.y)) {
double[] xy1 = plot.screenToProj(mouseDownPoint.x - graphArea.getX(), mouseDownPoint.y - graphArea.getY(), graphArea);
double[] xy2 = plot.screenToProj(mouseLastPos.x - graphArea.getX(), mouseLastPos.y - graphArea.getY(), graphArea);
double[] xy1 = plt.screenToProj(mouseDownPoint.x - graphArea.getX(), mouseDownPoint.y - graphArea.getY(), graphArea);
double[] xy2 = plt.screenToProj(mouseLastPos.x - graphArea.getX(), mouseLastPos.y - graphArea.getY(), graphArea);
Extent extent = new Extent();
extent.minX = Math.min(xy1[0], xy2[0]);
extent.maxX = Math.max(xy1[0], xy2[0]);
extent.minY = Math.min(xy1[1], xy2[1]);
extent.maxY = Math.max(xy1[1], xy2[1]);
this.selectedPoints = plot.getDataset().selectPoints(extent);
this.selectedPoints = plt.getDataset().selectPoints(extent);
this.firePointSelectedEvent();
//this.paintGraphics();
this.repaintNew();
}
}
}
}
break;
case PAN:
if (e.getButton() == MouseEvent.BUTTON1) {
if (plot instanceof AbstractPlot2D) {
AbstractPlot2D xyplot = (AbstractPlot2D) plot;
double[] xy1 = xyplot.screenToProj(mouseDownPoint.x, mouseDownPoint.y);
double[] xy2 = xyplot.screenToProj(e.getX(), e.getY());
Extent extent = xyplot.getDrawExtent();
@ -791,6 +797,7 @@ public class GLChartPanel extends GLJPanel implements IChartPanel{
//this.paintGraphics();
this.repaintNew();
}
}
break;
}
}

View File

@ -80,6 +80,7 @@ public class GLPlot extends Plot {
protected Extent3D drawExtent;
protected Extent3D axesExtent;
protected boolean fixExtent;
protected TextRenderer textRenderer;
protected ChartText title;
protected GridLine gridLine;
protected java.util.List<ChartLegend> legends;
@ -1224,6 +1225,8 @@ public class GLPlot extends Plot {
final GL2 gl = drawable.getGL().getGL2();
gl.glLoadIdentity();
this.updateTextRender(this.xAxis.getTickLabelFont());
//Set light position - follow glLoadIdentity
this.lighting.setPosition(gl);
@ -1299,6 +1302,9 @@ public class GLPlot extends Plot {
//Draw title
this.drawTitle();
this.textRenderer.dispose();
this.textRenderer = null;
gl.glFlush();
/*//Do screenshot
@ -1904,6 +1910,9 @@ public class GLPlot extends Plot {
}
strWidth = 0.0f;
strHeight = 0.0f;
if (this.xAxis.isDrawTickLabel()) {
this.updateTextRender(tlabs.get(0).getFont());
}
for (int i = 0; i < this.xAxis.getTickValues().length; i += skip) {
v = (float) this.xAxis.getTickValues()[i];
if (v < axesExtent.minX || v > axesExtent.maxX) {
@ -1924,6 +1933,7 @@ public class GLPlot extends Plot {
gl.glEnd();
//Draw tick label
if (this.xAxis.isDrawTickLabel()) {
rect = drawString(gl, tlabs.get(i), v, y1, zMin, xAlign, yAlign);
if (strWidth < rect.getWidth()) {
strWidth = (float) rect.getWidth();
@ -1932,10 +1942,13 @@ public class GLPlot extends Plot {
strHeight = (float) rect.getHeight();
}
}
}
//Draw x axis label
if (this.xAxis.isDrawLabel()) {
ChartText label = this.xAxis.getLabel();
if (label != null) {
this.updateTextRender(label.getFont());
strWidth += this.tickSpace;
float angle = this.toScreenAngle(xMin, y, zMin, xMax, y, zMin);
angle = y < 0 ? 270 - angle : 90 - angle;
@ -1945,6 +1958,7 @@ public class GLPlot extends Plot {
}
drawString(gl, label, 0.0f, y1, zMin, XAlign.CENTER, yAlign, angle, 0, yShift);
}
}
////////////////////////////////////////////
//y axis line
@ -1980,6 +1994,9 @@ public class GLPlot extends Plot {
}
strWidth = 0.0f;
strHeight = 0.0f;
if (this.yAxis.isDrawTickLabel()) {
this.updateTextRender(tlabs.get(0).getFont());
}
for (int i = 0; i < this.yAxis.getTickValues().length; i += skip) {
v = (float) this.yAxis.getTickValues()[i];
if (v < axesExtent.minY || v > axesExtent.maxY) {
@ -2000,6 +2017,7 @@ public class GLPlot extends Plot {
gl.glEnd();
//Draw tick label
if (this.yAxis.isDrawTickLabel()) {
rect = drawString(gl, tlabs.get(i), x1, v, zMin, xAlign, yAlign);
if (strWidth < rect.getWidth()) {
strWidth = (float) rect.getWidth();
@ -2008,10 +2026,13 @@ public class GLPlot extends Plot {
strHeight = (float) rect.getHeight();
}
}
}
//Draw y axis label
label = this.yAxis.getLabel();
if (this.yAxis.isDrawLabel()) {
ChartText label = this.yAxis.getLabel();
if (label != null) {
this.updateTextRender(label.getFont());
strWidth += this.tickSpace;
float angle = this.toScreenAngle(x, yMin, zMin, x, yMax, xMin);
angle = x > 0 ? 270 - angle : 90 - angle;
@ -2022,6 +2043,7 @@ public class GLPlot extends Plot {
drawString(gl, label, x1, 0.0f, zMin, XAlign.CENTER, yAlign, angle, 0, yShift);
}
}
}
//Draw z axis
if (this.displayZ) {
@ -2087,6 +2109,9 @@ public class GLPlot extends Plot {
xAlign = XAlign.RIGHT;
yAlign = YAlign.CENTER;
strWidth = 0.0f;
if (this.zAxis.isDrawTickLabel()) {
this.updateTextRender(tlabs.get(0).getFont());
}
for (int i = 0; i < this.zAxis.getTickValues().length; i += skip) {
v = (float) this.zAxis.getTickValues()[i];
if (v < axesExtent.minZ || v > axesExtent.maxZ) {
@ -2107,19 +2132,24 @@ public class GLPlot extends Plot {
gl.glEnd();
//Draw tick label
if (this.zAxis.isDrawTickLabel()) {
rect = drawString(gl, tlabs.get(i), x1, y1, v, xAlign, yAlign, -this.tickSpace, 0);
if (strWidth < rect.getWidth()) {
strWidth = (float) rect.getWidth();
}
}
}
//Draw z axis label
if (this.zAxis.isDrawLabel()) {
ChartText label = this.zAxis.getLabel();
if (label != null) {
this.updateTextRender(label.getFont());
float yShift = strWidth + this.tickSpace * 3;
drawString(gl, label, x1, y1, 0.0f, XAlign.CENTER, YAlign.BOTTOM, 90.f, 0, yShift);
}
}
}
protected void drawZAxis(GL2 gl, ZAxisOption zAxisOption) {
Matrix4f mvMatrix = toMatrix(mvmatrix);
@ -2234,6 +2264,26 @@ public class GLPlot extends Plot {
}
}
void updateTextRender(Font font) {
boolean newTR = false;
if (this.textRenderer == null) {
newTR = true;
} else {
if (!this.textRenderer.getFont().equals(font)) {
//this.textRenderer.dispose();
newTR = true;
}
}
if (newTR) {
if (this.dpiScale == 1) {
textRenderer = new TextRenderer(font, true, true);
} else {
textRenderer = new TextRenderer(new Font(font.getFontName(), font.getStyle(),
(int) (font.getSize() * this.dpiScale)), true, true);
}
}
}
Rectangle2D drawString(GL2 gl, ChartText text, float vx, float vy, float vz, XAlign xAlign, YAlign yAlign) {
return drawString(gl, text, vx, vy, vz, xAlign, yAlign, 0, 0);
}
@ -2257,13 +2307,6 @@ public class GLPlot extends Plot {
float y = coord.y;
//Rendering text string
TextRenderer textRenderer;
if (this.dpiScale == 1) {
textRenderer = new TextRenderer(font, true, true);
} else {
textRenderer = new TextRenderer(new Font(font.getFontName(), font.getStyle(),
(int)(font.getSize() * (1 + (this.dpiScale - 1) * 0.8))), true, true);
}
textRenderer.beginRendering(this.width, this.height);
textRenderer.setColor(color);
textRenderer.setSmoothing(true);
@ -2292,22 +2335,22 @@ public class GLPlot extends Plot {
Rectangle2D drawString(GL2 gl, ChartText text, float vx, float vy, float vz,
XAlign xAlign, YAlign yAlign, float angle) {
return drawString(gl, text.getText(), text.getFont(), text.getColor(), vx, vy, vz, xAlign, yAlign, angle,
return drawString(gl, text.getText(), text.getColor(), vx, vy, vz, xAlign, yAlign, angle,
(float)text.getXShift(), (float)text.getYShift());
}
Rectangle2D drawString(GL2 gl, ChartText text, float vx, float vy, float vz,
XAlign xAlign, YAlign yAlign, float angle, float xShift, float yShift) {
return drawString(gl, text.getText(), text.getFont(), text.getColor(), vx, vy,
return drawString(gl, text.getText(), text.getColor(), vx, vy,
vz, xAlign, yAlign, angle, (float)text.getXShift() + xShift, (float)text.getYShift() + yShift);
}
Rectangle2D drawString(GL2 gl, String str, Font font, Color color, float vx, float vy, float vz,
Rectangle2D drawString(GL2 gl, String str, Color color, float vx, float vy, float vz,
XAlign xAlign, YAlign yAlign, float angle) {
return drawString(gl, str, font, color, vx, vy, vz, xAlign, yAlign, angle, 0, 0);
return drawString(gl, str, color, vx, vy, vz, xAlign, yAlign, angle, 0, 0);
}
Rectangle2D drawString(GL2 gl, String str, Font font, Color color, float vx, float vy, float vz,
Rectangle2D drawString(GL2 gl, String str, Color color, float vx, float vy, float vz,
XAlign xAlign, YAlign yAlign, float angle, float xShift, float yShift) {
//Get screen coordinates
Vector2f coord = this.toScreen(vx, vy, vz);
@ -2315,13 +2358,6 @@ public class GLPlot extends Plot {
float y = coord.y;
//Rendering text string
TextRenderer textRenderer;
if (this.dpiScale == 1) {
textRenderer = new TextRenderer(font, true, true);
} else {
textRenderer = new TextRenderer(new Font(font.getFontName(), font.getStyle(),
(int)(font.getSize() * (1 + (this.dpiScale - 1) * 0.8))), true, true);
}
textRenderer.beginRendering(this.width, this.height);
textRenderer.setColor(color);
textRenderer.setSmoothing(true);
@ -2354,30 +2390,22 @@ public class GLPlot extends Plot {
y += yShift;
textRenderer.draw(str, (int) x, (int) y);
textRenderer.endRendering();
textRenderer.dispose();
gl.glPopMatrix();
return rect;
}
Rectangle2D drawString3D(GL2 gl, ChartText3D text3D, float vx, float vy, float vz) {
return drawString3D(gl, text3D.getText(), text3D.getFont(), text3D.getColor(), vx, vy, vz);
return drawString3D(gl, text3D.getText(), text3D.getColor(), vx, vy, vz);
}
Rectangle2D drawString3D(GL2 gl, String str, Font font, Color color, float vx, float vy, float vz) {
Rectangle2D drawString3D(GL2 gl, String str, Color color, float vx, float vy, float vz) {
//Get screen coordinates
Vector2f coord = this.toScreen(vx, vy, vz);
float x = coord.x;
float y = coord.y;
//Rendering text string
TextRenderer textRenderer;
if (this.dpiScale == 1) {
textRenderer = new TextRenderer(font, true, true);
} else {
textRenderer = new TextRenderer(new Font(font.getFontName(), font.getStyle(),
(int)(font.getSize() * (1 + (this.dpiScale - 1) * 0.8))), true, true);
}
textRenderer.beginRendering(this.width, this.height, false);
//textRenderer.begin3DRendering();
textRenderer.setColor(color);
@ -2395,7 +2423,7 @@ public class GLPlot extends Plot {
if (title != null) {
//Rendering text string
Font font = title.getFont();
TextRenderer textRenderer;
this.updateTextRender(font);
if (this.dpiScale == 1) {
textRenderer = new TextRenderer(font, true, true);
} else {
@ -2575,6 +2603,7 @@ public class GLPlot extends Plot {
protected void drawText(GL2 gl, ChartText3D text) {
Vector3f xyz = this.transform.transform((float) text.getX(), (float) text.getY(), (float) text.getZ());
this.updateTextRender(text.getFont());
if (text.isDraw3D()) {
this.drawString3D(gl, text, xyz.x, xyz.y, xyz.z);
} else {
@ -4238,6 +4267,8 @@ public class GLPlot extends Plot {
GL2 gl = drawable.getGL().getGL2();
this.gl = gl;
this.glu = GLU.createGLU(gl);
Font font = this.xAxis.getTickLabelFont();
updateTextRender(font);
//Background
//gl.glClearColor(1f, 1f, 1f, 1.0f);
gl.glEnable(GL2.GL_POINT_SMOOTH);

View File

@ -7,5 +7,5 @@ public interface GraphicRender {
/**
* Draw graphic
*/
public abstract void draw();
void draw();
}

View File

@ -1,4 +1,7 @@
import org.meteoinfo.chart.jogl.GLChartPanel;
import org.meteoinfo.chart.GLChart;
import org.meteoinfo.chart.GLChartPanel;
import org.meteoinfo.chart.MouseMode;
import org.meteoinfo.chart.jogl.GLPlot;
import org.meteoinfo.chart.jogl.Plot3DGL;
import org.meteoinfo.chart.graphic.VolumeGraphic;
import org.meteoinfo.chart.render.jogl.RayCastingType;
@ -107,33 +110,30 @@ public class VolumeTest {
VolumeGraphic graphics = test.createGraphics();
graphics.setRayCastingType(RayCastingType.SPECULAR);
JFrame frame = new JFrame("Volume Test");
Plot3DGL plot = new Plot3DGL();
GLPlot plot = new GLPlot();
plot.setOrthographic(false);
plot.setClipPlane(false);
//plot.setBackground(Color.black);
//plot.setForeground(Color.blue);
plot.setDrawBoundingBox(false);
plot.setDrawBase(false);
plot.setBoxed(false);
plot.getGridLine().setDrawXLine(false);
plot.getGridLine().setDrawYLine(false);
plot.getGridLine().setDrawZLine(false);
GLChartPanel canvas = new GLChartPanel(plot);
plot.setDrawBoundingBox(true);
plot.setDrawBase(true);
plot.setBoxed(true);
plot.setDisplayXY(true);
//plot.getXAxis().setDrawTickLabel(false);
//plot.getYAxis().setDrawTickLabel(false);
plot.setDisplayZ(true);
plot.getZAxis().setLabel("Z axis");
//plot.getGridLine().setDrawXLine(false);
//plot.getGridLine().setDrawYLine(false);
//plot.getGridLine().setDrawZLine(false);
plot.addGraphic(graphics);
GLChartPanel canvas = new GLChartPanel(new GLChart());
canvas.getChart().addPlot(plot);
canvas.setMouseMode(MouseMode.ROTATE);
frame.getContentPane().add(canvas);
frame.pack();
frame.setSize(600, 400);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
/*try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
int width = canvas.getWidth();
int height = canvas.getHeight();
canvas.setSize(width, height + 1);
canvas.setSize(width, height);*/
//frame.setSize(600, 401);
}
}

View File

@ -116,7 +116,7 @@ public class GridData {
this.missingValue = missingValue;
this.projInfo = projInfo;
if (this.getYDelta() < 0) {
/*if (this.getYDelta() < 0) {
this.yArray = IntStream.range(0, this.yArray.length)
.mapToDouble(i -> this.yArray[this.yArray.length - 1 - i])
.toArray();
@ -128,7 +128,7 @@ public class GridData {
.mapToDouble(i -> this.xArray[this.xArray.length - 1 - i])
.toArray();
this.xReverse();
}
}*/
}
/**

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MeteoInfo File="milconfig.xml" Type="configurefile">
<Path OpenPath="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\funny"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\dataframe\series"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\dataframe"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\burf"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\interpolate"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\stats"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\common_math\linalg"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\data_process"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\projection"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\radar"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\LaSW"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\LaSW\airship"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\isosurface"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf"/>
@ -21,14 +21,14 @@
<OpenedFiles>
<OpenedFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\sounding.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\radar_bz2.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\funny\rocket.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\common_math\linalg\norm_1.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf\surf_1.py"/>
</OpenedFiles>
<RecentFiles>
<RecentFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\sounding.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\LaSW\airship\radar_bz2.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\funny\rocket.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\common_math\linalg\norm_1.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\surf\surf_1.py"/>
</RecentFiles>
</File>
<Font>
@ -36,5 +36,5 @@
</Font>
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/>
<Figure DoubleBuffering="true"/>
<Startup MainFormLocation="-7,0" MainFormSize="1398,812"/>
<Startup MainFormLocation="-7,-7" MainFormSize="1293,685"/>
</MeteoInfo>

View File

@ -47,7 +47,7 @@ __all__ = [
'webmap','gca','gcf','gc_collect','geoshow','get_figure','gifaddframe','gifanimation','giffinish',
'grid','gridshow','gridshowm','hist','imshow','imshowm','isosurface','legend','left_title','lighting','loglog','makecolors',
'makelegend','makesymbolspec','masklayer','material','mesh','particles','pcolor','pcolorm','pie','plot','plot3','plotm','quiver','quiver3',
'quiverkey','quiverm','readlegend','right_title','savefig','savefig_jpeg','scatter','scatter3','scatterm',
'quiverkey','quiverm','readlegend','right_title','refresh','savefig','savefig_jpeg','scatter','scatter3','scatterm',
'semilogx','semilogy','show','slice3','stationmodel','stem','stem3','step','streamplot','streamplot3',
'streamplotm','streamslice','subplot','subplots','suptitle','supxlabel','supylabel',
'surf','taylor_diagram','text','text3','title','twinx','twiny','violinplot','volumeplot','weatherspec','xaxis',
@ -1267,6 +1267,7 @@ def zticks(*args, **kwargs):
if len(args) > 0:
locs = args[0]
if len(locs) > 0:
if isinstance(locs, (NDArray, DimArray)):
locs = locs.aslist()
if isinstance(locs[0], datetime.datetime):
@ -2168,3 +2169,10 @@ def gc_collect():
clear()
import gc
gc.collect()
def refresh():
"""
Refresh the figure
"""
migl.milapp.getFigureDock().setVisible(False)
migl.milapp.getFigureDock().setVisible(True)

View File

@ -2033,7 +2033,6 @@ public class FrmSectionPlot extends javax.swing.JFrame {
}
private void setXYCoords(GridData aGridData) {
boolean yReverse = aGridData.getYDelta() < 0;
int i;
int xNum = 0, yNum = 0;
switch (_plotDimension) {
@ -2069,9 +2068,6 @@ public class FrmSectionPlot extends javax.swing.JFrame {
}
aGridData.setXArray(xArray);
aGridData.setYArray(yArray);
if (yReverse) {
aGridData.yReverse();
}
}
private void zoomToExtent(Extent aExtent) {