add visible property in Graphic class

This commit is contained in:
wyq 2024-04-04 17:25:57 +08:00
parent 9476908639
commit 74363fd57c
20 changed files with 384 additions and 146 deletions

View File

@ -21,6 +21,7 @@ public class MapGridLine3D extends MapGridLine {
*/ */
public MapGridLine3D() { public MapGridLine3D() {
super(); super();
this.extent = new Extent3D(-100, 100, -100, 100, 0, 100);
} }
/** /**
@ -28,7 +29,7 @@ public class MapGridLine3D extends MapGridLine {
* @param projInfo Projection * @param projInfo Projection
* @param extent Extent * @param extent Extent
*/ */
public MapGridLine3D(ProjectionInfo projInfo, Extent extent) { public MapGridLine3D(ProjectionInfo projInfo, Extent3D extent) {
super(true); super(true);
this.projInfo = projInfo; this.projInfo = projInfo;
this.setExtent(extent); this.setExtent(extent);

View File

@ -489,30 +489,32 @@ public class MapPlot extends Plot2D implements IWebMapPanel {
int barIdx = 0; int barIdx = 0;
for (int m = 0; m < this.graphics.getNumGraphics(); m++) { for (int m = 0; m < this.graphics.getNumGraphics(); m++) {
Graphic graphic = this.graphics.get(m); Graphic graphic = this.graphics.get(m);
if (graphic instanceof WebMapImage) { if (graphic.isVisible()) {
this.drawWebMapImage(g, (WebMapImage) graphic, area); if (graphic instanceof WebMapImage) {
continue; this.drawWebMapImage(g, (WebMapImage) graphic, area);
}
ColorBreak cb = graphic.getLegend();
ShapeTypes shapeType = graphic.getGraphicN(0).getShape().getShapeType();
switch(shapeType){
case BAR:
this.drawBars(g, (GraphicCollection) graphic, barIdx, area);
barIdx += 1;
continue; continue;
case STATION_MODEL: }
this.drawStationModel(g, (GraphicCollection) graphic, area);
continue;
}
if (graphic.getExtent().intersects(this.drawExtent)) { ColorBreak cb = graphic.getLegend();
drawGraphics(g, graphic, area); ShapeTypes shapeType = graphic.getGraphicN(0).getShape().getShapeType();
} switch (shapeType) {
case BAR:
this.drawBars(g, (GraphicCollection) graphic, barIdx, area);
barIdx += 1;
continue;
case STATION_MODEL:
this.drawStationModel(g, (GraphicCollection) graphic, area);
continue;
}
if (this.isLonLatMap() && graphic instanceof GeoGraphicCollection) { if (graphic.getExtent().intersects(this.drawExtent)) {
if (this.drawExtent.maxX > 180) { drawGraphics(g, graphic, area);
drawGraphics(g, ((GeoGraphicCollection) graphic).xShiftCopy(360), area); }
if (this.isLonLatMap() && graphic instanceof GeoGraphicCollection) {
if (this.drawExtent.maxX > 180) {
drawGraphics(g, ((GeoGraphicCollection) graphic).xShiftCopy(360), area);
}
} }
} }
} }

View File

@ -7,13 +7,13 @@ import org.meteoinfo.common.PointD;
import org.meteoinfo.geometry.graphic.Graphic; import org.meteoinfo.geometry.graphic.Graphic;
import org.meteoinfo.geometry.graphic.GraphicCollection; import org.meteoinfo.geometry.graphic.GraphicCollection;
import org.meteoinfo.geometry.legend.*; import org.meteoinfo.geometry.legend.*;
import org.meteoinfo.geometry.shape.PointShape; import org.meteoinfo.geometry.shape.*;
import org.meteoinfo.geometry.shape.PolylineShape;
import org.meteoinfo.geometry.shape.Shape; import org.meteoinfo.geometry.shape.Shape;
import org.meteoinfo.geometry.shape.ShapeTypes;
import org.meteoinfo.ndarray.DataType; import org.meteoinfo.ndarray.DataType;
import org.meteoinfo.projection.ProjectionInfo; import org.meteoinfo.projection.ProjectionInfo;
import org.meteoinfo.table.AttributeTable; import org.meteoinfo.table.AttributeTable;
import org.meteoinfo.table.DataRow;
import org.meteoinfo.table.DataTable;
import org.meteoinfo.table.Field; import org.meteoinfo.table.Field;
import javax.swing.*; import javax.swing.*;
@ -38,6 +38,57 @@ public class GeoGraphicCollection extends GraphicCollection {
this.projInfo = ProjectionInfo.LONG_LAT; this.projInfo = ProjectionInfo.LONG_LAT;
} }
/**
* Factory method create GeoGraphicCollection from GraphicsCollection
* @param graphics The GraphicCollection object
* @return GeoGraphicCollection object
*/
public static GeoGraphicCollection factory(GraphicCollection graphics) {
GeoGraphicCollection geoGraphics = new GeoGraphicCollection();
geoGraphics.graphics = graphics.getGraphics();
geoGraphics.extent = graphics.getExtent();
geoGraphics.setSingleLegend(graphics.isSingleLegend());
geoGraphics.setLabelSet(graphics.getLabelSet());
geoGraphics.setLabelPoints(graphics.getLabelPoints());
geoGraphics.setLegendScheme(graphics.getLegendScheme());
geoGraphics.setLegendBreak(graphics.getLegendBreak());
geoGraphics.setAntiAlias(graphics.isAntiAlias());
AttributeTable attrTable = new AttributeTable();
ShapeTypes shapeType = graphics.getShapeType();
switch (shapeType) {
case POLYGON:
case POLYGON_Z:
attrTable.addField(new Field("data_Low", DataType.DOUBLE));
attrTable.addField(new Field("data_High", DataType.DOUBLE));
break;
default:
attrTable.addField(new Field("data", DataType.DOUBLE));
break;
}
DataTable dataTable = attrTable.getTable();
for (Graphic graphic : geoGraphics.graphics) {
try {
DataRow dataRow = dataTable.addRow();
switch (shapeType) {
case POLYGON:
case POLYGON_Z:
dataRow.setValue("data_Low", ((PolygonShape) graphic.getShape()).lowValue);
dataRow.setValue("data_High", ((PolygonShape) graphic.getShape()).highValue);
break;
default:
dataRow.setValue("data", graphic.getShape().getValue());
break;
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
geoGraphics.setAttributeTable(attrTable);
return geoGraphics;
}
/** /**
* Get attribute table * Get attribute table
* @return Attribute table * @return Attribute table

View File

@ -521,7 +521,12 @@ public class EarthGLPlot extends GLPlot {
@Override @Override
protected void drawPolygonShape(GL2 gl, Graphic graphic) { protected void drawPolygonShape(GL2 gl, Graphic graphic) {
//gl.glDisable(GL2.GL_DEPTH_TEST);
//gl.glEnable(GL2.GL_CULL_FACE);
//gl.glFrontFace(GL2.GL_CW);
super.drawPolygonShape(gl, graphic); super.drawPolygonShape(gl, graphic);
//gl.glEnable(GL2.GL_DEPTH_TEST);
//gl.glDisable(GL2.GL_CULL_FACE);
} }
// </editor-fold> // </editor-fold>

View File

@ -285,17 +285,19 @@ public class Plot2D extends AbstractPlot2D {
int barIdx = 0; int barIdx = 0;
for (int m = 0; m < this.graphics.getNumGraphics(); m++) { for (int m = 0; m < this.graphics.getNumGraphics(); m++) {
Graphic graphic = this.graphics.get(m); Graphic graphic = this.graphics.get(m);
ColorBreak cb = graphic.getLegend(); if (graphic.isVisible()) {
ShapeTypes shapeType = graphic.getGraphicN(0).getShape().getShapeType(); ColorBreak cb = graphic.getLegend();
switch(shapeType){ ShapeTypes shapeType = graphic.getGraphicN(0).getShape().getShapeType();
case BAR: switch (shapeType) {
this.drawBars(g, (GraphicCollection) graphic, barIdx, area); case BAR:
barIdx += 1; this.drawBars(g, (GraphicCollection) graphic, barIdx, area);
continue; barIdx += 1;
} continue;
}
if (graphic.getExtent().intersects(this.drawExtent)) { if (graphic.getExtent().intersects(this.drawExtent)) {
drawGraphics(g, graphic, area); drawGraphics(g, graphic, area);
}
} }
} }
} }

View File

@ -67,7 +67,7 @@ import java.util.zip.ZipInputStream;
public static String getVersion(){ public static String getVersion(){
String version = GlobalUtil.class.getPackage().getImplementationVersion(); String version = GlobalUtil.class.getPackage().getImplementationVersion();
if (version == null || version.equals("")) { if (version == null || version.equals("")) {
version = "3.8.2"; version = "3.8.3";
} }
return version; return version;
} }

View File

@ -13,16 +13,19 @@
*/ */
package org.meteoinfo.geo.mapdata; package org.meteoinfo.geo.mapdata;
import org.meteoinfo.chart.graphic.GeoGraphicCollection;
import org.meteoinfo.common.Extent; import org.meteoinfo.common.Extent;
import org.meteoinfo.common.PointD; import org.meteoinfo.common.PointD;
import org.meteoinfo.common.io.EndianDataOutputStream; import org.meteoinfo.common.io.EndianDataOutputStream;
import org.meteoinfo.geo.layer.LayerDrawType; import org.meteoinfo.geo.layer.LayerDrawType;
import org.meteoinfo.geo.layer.VectorLayer; import org.meteoinfo.geo.layer.VectorLayer;
import org.meteoinfo.geo.legend.LegendManage; import org.meteoinfo.geo.legend.LegendManage;
import org.meteoinfo.geometry.graphic.GraphicCollection;
import org.meteoinfo.geometry.shape.Shape; import org.meteoinfo.geometry.shape.Shape;
import org.meteoinfo.geometry.shape.*; import org.meteoinfo.geometry.shape.*;
import org.meteoinfo.projection.ProjectionInfo; import org.meteoinfo.projection.ProjectionInfo;
import org.meteoinfo.table.AttributeTable; import org.meteoinfo.table.AttributeTable;
import org.w3c.dom.Attr;
import java.awt.*; import java.awt.*;
import java.io.*; import java.io.*;
@ -714,28 +717,10 @@ public class ShapeFileManage {
* @param shpfilepath Shape file path * @param shpfilepath Shape file path
* @param aLayer Vector layer * @param aLayer Vector layer
* @return Boolean * @return Boolean
* @throws IOException*/ * @throws IOException
*/
public static boolean saveShapeFile(String shpfilepath, VectorLayer aLayer) throws IOException { public static boolean saveShapeFile(String shpfilepath, VectorLayer aLayer) throws IOException {
String shxfilepath = shpfilepath.replace(shpfilepath.substring(shpfilepath.lastIndexOf(".")), ".shx"); return saveShapeFile(shpfilepath, aLayer, null);
String dbffilepath = shpfilepath.replace(shpfilepath.substring(shpfilepath.lastIndexOf(".")), ".dbf");
String projFilePath = shpfilepath.replace(shpfilepath.substring(shpfilepath.lastIndexOf(".")), ".prj");
switch (aLayer.getShapeType()) {
case POINT:
case POINT_Z:
case POLYLINE:
case POLYLINE_Z:
case POLYGON:
case POLYGON_Z:
writeShxFile(shxfilepath, aLayer);
writeShpFile(shpfilepath, aLayer);
writeDbfFile(dbffilepath, aLayer);
writeProjFile(projFilePath, aLayer);
return true;
default:
return false;
}
} }
/** /**
@ -743,8 +728,8 @@ public class ShapeFileManage {
* @param shpfilepath Shape file path * @param shpfilepath Shape file path
* @param aLayer Vector layer * @param aLayer Vector layer
* @param encoding Encoding * @param encoding Encoding
* @return Boolean * @throws IOException
* @throws IOException*/ */
public static boolean saveShapeFile(String shpfilepath, VectorLayer aLayer, String encoding) throws IOException { public static boolean saveShapeFile(String shpfilepath, VectorLayer aLayer, String encoding) throws IOException {
String shxfilepath = shpfilepath.replace(shpfilepath.substring(shpfilepath.lastIndexOf(".")), ".shx"); String shxfilepath = shpfilepath.replace(shpfilepath.substring(shpfilepath.lastIndexOf(".")), ".shx");
String dbffilepath = shpfilepath.replace(shpfilepath.substring(shpfilepath.lastIndexOf(".")), ".dbf"); String dbffilepath = shpfilepath.replace(shpfilepath.substring(shpfilepath.lastIndexOf(".")), ".dbf");
@ -759,15 +744,83 @@ public class ShapeFileManage {
case POLYGON_Z: case POLYGON_Z:
writeShxFile(shxfilepath, aLayer); writeShxFile(shxfilepath, aLayer);
writeShpFile(shpfilepath, aLayer); writeShpFile(shpfilepath, aLayer);
writeDbfFile(dbffilepath, aLayer, encoding); if (encoding == null) {
writeDbfFile(dbffilepath, aLayer);
} else {
writeDbfFile(dbffilepath, aLayer, encoding);
}
writeProjFile(projFilePath, aLayer); writeProjFile(projFilePath, aLayer);
return true; return true;
default: default:
return false; return false;
} }
} }
/**
* Save shape file
* @param shpFilePath Shape file path
* @param graphics Graphics
* @throws IOException
*/
public static boolean saveShapeFile(String shpFilePath, GraphicCollection graphics) throws IOException {
return saveShapeFile(shpFilePath, GeoGraphicCollection.factory(graphics), null);
}
/**
* Save shape file
* @param shpFilePath Shape file path
* @param graphics Graphics
* @param encoding Encoding
* @throws IOException
*/
public static boolean saveShapeFile(String shpFilePath, GraphicCollection graphics, String encoding) throws IOException {
return saveShapeFile(shpFilePath, GeoGraphicCollection.factory(graphics), encoding);
}
/**
* Save shape file
* @param shpFilePath Shape file path
* @param geoGraphics GeoGraphics
* @param encoding Encoding
* @throws IOException
*/
public static boolean saveShapeFile(String shpFilePath, GeoGraphicCollection geoGraphics) throws IOException {
return saveShapeFile(shpFilePath, geoGraphics, null);
}
/**
* Save shape file
* @param shpFilePath Shape file path
* @param geoGraphics GeoGraphics
* @param encoding Encoding
* @throws IOException
*/
public static boolean saveShapeFile(String shpFilePath, GeoGraphicCollection geoGraphics, String encoding) throws IOException {
String shxFilePath = shpFilePath.replace(shpFilePath.substring(shpFilePath.lastIndexOf(".")), ".shx");
String dbfFilePath = shpFilePath.replace(shpFilePath.substring(shpFilePath.lastIndexOf(".")), ".dbf");
String projFilePath = shpFilePath.replace(shpFilePath.substring(shpFilePath.lastIndexOf(".")), ".prj");
switch (geoGraphics.getShapeType()) {
case POINT:
case POINT_Z:
case POLYLINE:
case POLYLINE_Z:
case POLYGON:
case POLYGON_Z:
writeShxFile(shxFilePath, geoGraphics);
writeShpFile(shpFilePath, geoGraphics);
if (encoding == null) {
writeDbfFile(dbfFilePath, geoGraphics.getAttributeTable());
} else {
writeDbfFile(dbfFilePath, geoGraphics.getAttributeTable(), encoding);
}
writeProjFile(projFilePath, geoGraphics.getProjInfo());
return true;
default:
return false;
}
}
private static void writeShpFile(String shpfilepath, VectorLayer aLayer) throws FileNotFoundException, IOException { private static void writeShpFile(String shpfilepath, VectorLayer aLayer) throws FileNotFoundException, IOException {
File shpFile = new File(shpfilepath); File shpFile = new File(shpfilepath);
EndianDataOutputStream bw = new EndianDataOutputStream(new BufferedOutputStream(new FileOutputStream(shpFile))); EndianDataOutputStream bw = new EndianDataOutputStream(new BufferedOutputStream(new FileOutputStream(shpFile)));
@ -789,6 +842,27 @@ public class ShapeFileManage {
bw.close(); bw.close();
} }
private static void writeShpFile(String shpFilePath, GraphicCollection graphics) throws FileNotFoundException, IOException {
File shpFile = new File(shpFilePath);
EndianDataOutputStream bw = new EndianDataOutputStream(new BufferedOutputStream(new FileOutputStream(shpFile)));
//Write header
int FileLength = getShpFileLength(graphics);
writeHeader(bw, graphics, FileLength);
//Write records
int RecordNumber;
for (int i = 0; i < graphics.getNumGraphics(); i++) {
Shape aShape = graphics.getShapes().get(i);
RecordNumber = i + 1;
writeRecord(bw, RecordNumber, aShape, graphics.getShapeType());
}
//Close
bw.close();
}
private static int getShpFileLength(VectorLayer aLayer) { private static int getShpFileLength(VectorLayer aLayer) {
int fileLength = 50; int fileLength = 50;
@ -801,6 +875,18 @@ public class ShapeFileManage {
return fileLength; return fileLength;
} }
private static int getShpFileLength(GraphicCollection graphics) {
int fileLength = 50;
for (int i = 0; i < graphics.getNumGraphics(); i++) {
Shape aShape = graphics.getShapes().get(i);
int cLen = getContentLength(aShape, graphics.getShapeType());
fileLength += 4 + cLen;
}
return fileLength;
}
private static int getContentLength(Shape aShape, ShapeTypes aST) { private static int getContentLength(Shape aShape, ShapeTypes aST) {
int contentLength = 0; int contentLength = 0;
switch (aST) { switch (aST) {
@ -933,32 +1019,40 @@ public class ShapeFileManage {
} }
} }
private static void writeHeader(EndianDataOutputStream bw, VectorLayer aLayer, int FileLength) throws IOException { private static void writeHeader(EndianDataOutputStream bw, VectorLayer aLayer, int fileLength) throws IOException {
int i; writeHeader(bw, aLayer.getShapeType(), aLayer.getExtent(), fileLength);
int FileCode = 9994;
//FileCode = swapByteOrder(FileCode);
int Unused = 0;
//Unused = swapByteOrder(Unused);
//FileLength = swapByteOrder(FileLength);
int Version = 1000;
int aShapeType = aLayer.getShapeType().getValue();
bw.writeIntBE(FileCode);
for (i = 0; i < 5; i++) {
bw.writeIntBE(Unused);
}
bw.writeIntBE(FileLength);
bw.writeIntLE(Version);
bw.writeIntLE(aShapeType);
bw.writeDoubleLE(aLayer.getExtent().minX);
bw.writeDoubleLE(aLayer.getExtent().minY);
bw.writeDoubleLE(aLayer.getExtent().maxX);
bw.writeDoubleLE(aLayer.getExtent().maxY);
for (i = 0; i < 4; i++) {
bw.writeDoubleLE(0.0);
}
} }
private static void writeHeader(EndianDataOutputStream bw, GraphicCollection graphics, int fileLength) throws IOException {
writeHeader(bw, graphics.getShapeType(), graphics.getExtent(), fileLength);
}
private static void writeHeader(EndianDataOutputStream bw, ShapeTypes shapeType, Extent extent, int fileLength) throws IOException {
int i;
int FileCode = 9994;
//FileCode = swapByteOrder(FileCode);
int Unused = 0;
//Unused = swapByteOrder(Unused);
//FileLength = swapByteOrder(FileLength);
int Version = 1000;
int aShapeType = shapeType.getValue();
bw.writeIntBE(FileCode);
for (i = 0; i < 5; i++) {
bw.writeIntBE(Unused);
}
bw.writeIntBE(fileLength);
bw.writeIntLE(Version);
bw.writeIntLE(aShapeType);
bw.writeDoubleLE(extent.minX);
bw.writeDoubleLE(extent.minY);
bw.writeDoubleLE(extent.maxX);
bw.writeDoubleLE(extent.maxY);
for (i = 0; i < 4; i++) {
bw.writeDoubleLE(0.0);
}
}
private static void writeShxFile(String shxfilepath, VectorLayer aLayer) throws IOException { private static void writeShxFile(String shxfilepath, VectorLayer aLayer) throws IOException {
File shxFile = new File(shxfilepath); File shxFile = new File(shxfilepath);
EndianDataOutputStream bw = new EndianDataOutputStream(new BufferedOutputStream(new FileOutputStream(shxFile))); EndianDataOutputStream bw = new EndianDataOutputStream(new BufferedOutputStream(new FileOutputStream(shxFile)));
@ -985,35 +1079,72 @@ public class ShapeFileManage {
bw.close(); bw.close();
} }
private static void writeDbfFile(String dbffilepath, VectorLayer aLayer) { private static void writeShxFile(String shxFilePath, GraphicCollection graphics) throws IOException {
aLayer.getAttributeTable().saveAs(dbffilepath, true); File shxFile = new File(shxFilePath);
EndianDataOutputStream bw = new EndianDataOutputStream(new BufferedOutputStream(new FileOutputStream(shxFile)));
//Write header
int FileLength = graphics.getNumGraphics() * 4 + 50;
writeHeader(bw, graphics, FileLength);
//Write content
int OffSet, ContentLength;
OffSet = 50;
for (int i = 0; i < graphics.getNumGraphics(); i++) {
Shape aShape = graphics.getShapes().get(i);
ContentLength = getContentLength(aShape, graphics.getShapeType());
bw.writeIntBE(OffSet);
bw.writeIntBE(ContentLength);
OffSet = OffSet + 4 + ContentLength;
}
//Close
bw.close();
}
private static void writeDbfFile(String dbfFilePath, VectorLayer aLayer) {
writeDbfFile(dbfFilePath, aLayer.getAttributeTable());
} }
private static void writeDbfFile(String dbffilepath, VectorLayer aLayer, String encoding) { private static void writeDbfFile(String dbfFilePath, VectorLayer aLayer, String encoding) {
AttributeTable attTable = aLayer.getAttributeTable(); writeDbfFile(dbfFilePath, aLayer.getAttributeTable(), encoding);
attTable.setEncoding(encoding);
attTable.saveAs(dbffilepath, true);
} }
private static void writeProjFile(String projFilePath, VectorLayer aLayer) { private static void writeDbfFile(String dbfFilePath, AttributeTable attrTable) {
BufferedWriter sw = null; attrTable.saveAs(dbfFilePath, true);
try { }
String esriString = aLayer.getProjInfo().toEsriString();
sw = new BufferedWriter(new FileWriter(new File(projFilePath))); private static void writeDbfFile(String dbfFilePath, AttributeTable attrTable, String encoding) {
sw.write(esriString); attrTable.setEncoding(encoding);
sw.flush(); attrTable.saveAs(dbfFilePath, true);
sw.close(); }
} catch (IOException ex) {
Logger.getLogger(ShapeFileManage.class.getName()).log(Level.SEVERE, null, ex); private static void writeProjFile(String projFilePath, VectorLayer layer) {
} finally { writeProjFile(projFilePath, layer.getProjInfo());
try {
sw.close();
} catch (IOException ex) {
Logger.getLogger(ShapeFileManage.class.getName()).log(Level.SEVERE, null, ex);
}
}
} }
private static void writeProjFile(String projFilePath, ProjectionInfo projectionInfo) {
BufferedWriter sw = null;
try {
String esriString = projectionInfo.toEsriString();
sw = new BufferedWriter(new FileWriter(new File(projFilePath)));
sw.write(esriString);
sw.flush();
sw.close();
} catch (IOException ex) {
Logger.getLogger(ShapeFileManage.class.getName()).log(Level.SEVERE, null, ex);
} finally {
try {
sw.close();
} catch (IOException ex) {
Logger.getLogger(ShapeFileManage.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
/** /**
* Swaps the byte order of an int32 * Swaps the byte order of an int32
* *

View File

@ -3,6 +3,7 @@ package org.meteoinfo.geometry.graphic;
public class Artist { public class Artist {
protected boolean antiAlias = false; protected boolean antiAlias = false;
protected boolean visible = true;
/** /**
* Return antiAlias * Return antiAlias
@ -19,4 +20,20 @@ public class Artist {
public void setAntiAlias(boolean value) { public void setAntiAlias(boolean value) {
this.antiAlias = value; this.antiAlias = value;
} }
/**
* Return visible
* @return Visible
*/
public boolean isVisible() {
return this.visible;
}
/**
* Set visible
* @param value Visible
*/
public void setVisible(boolean value) {
this.visible = value;
}
} }

View File

@ -71,6 +71,19 @@ public class GraphicCollection extends Graphic implements Iterator {
} }
} }
/**
* Get shape by index
* @param index The index
* @return Shape
*/
public Shape getShape(int index) {
if (this.graphics.isEmpty()) {
return null;
} else {
return this.graphics.get(index).getShape();
}
}
/** /**
* Get graphic list * Get graphic list
* *

View File

@ -1,38 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<MeteoInfo File="milconfig.xml" Type="configurefile"> <MeteoInfo File="milconfig.xml" Type="configurefile">
<Path OpenPath="D:\Working\MIScript\Jython\mis\meteo\wrf"> <Path OpenPath="D:\Working\MIScript\Jython\mis\io\netcdf">
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\scatter"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\3d_earth"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\grads"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\geoshow"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\json"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\plot"/> <RecentFolder Folder="D:\Temp\working\acidrain"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\chart\subplot"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\geoshow"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\awx"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\projection"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\contour"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\plot"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\eof"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\hdf"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\wrf"/> <RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\awx"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\grads"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\netcdf"/>
</Path> </Path>
<File> <File>
<OpenedFiles> <OpenedFiles>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\eof\reof_elnino.py"/> <OpenedFile File="D:\Working\MIScript\Jython\mis\map\geoshow\geoshow_2.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\eof\reof_sst.py"/> <OpenedFile File="D:\Working\MIScript\Jython\mis\plot_types\plot\Line2D_1.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\map\projection\stere_proj.py"/> <OpenedFile File="D:\Working\MIScript\Jython\mis\io\netcdf\eccc_1.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\eof\reof_function_hgt.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\wrf\wrf_destagger_uv_webmap_loop.py"/>
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\wrf\wrf_destagger_uv_webmap_loop_1.py"/>
</OpenedFiles> </OpenedFiles>
<RecentFiles> <RecentFiles>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\eof\reof_elnino.py"/> <RecentFile File="D:\Working\MIScript\Jython\mis\map\geoshow\geoshow_2.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\eof\reof_sst.py"/> <RecentFile File="D:\Working\MIScript\Jython\mis\plot_types\plot\Line2D_1.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\map\projection\stere_proj.py"/> <RecentFile File="D:\Working\MIScript\Jython\mis\io\netcdf\eccc_1.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\eof\reof_function_hgt.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\wrf\wrf_destagger_uv_webmap_loop.py"/>
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\wrf\wrf_destagger_uv_webmap_loop_1.py"/>
</RecentFiles> </RecentFiles>
</File> </File>
<Font> <Font>
@ -40,5 +34,5 @@
</Font> </Font>
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/> <LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/>
<Figure DoubleBuffering="true"/> <Figure DoubleBuffering="true"/>
<Startup MainFormLocation="-7,0" MainFormSize="1358,821"/> <Startup MainFormLocation="-7,-7" MainFormSize="1293,685"/>
</MeteoInfo> </MeteoInfo>

View File

@ -49,10 +49,15 @@
<artifactId>docking-frames-core</artifactId> <artifactId>docking-frames-core</artifactId>
<version>2.0.0</version> <version>2.0.0</version>
</dependency> </dependency>
<dependency> <!--<dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId> <artifactId>slf4j-simple</artifactId>
<version>1.7.25</version> <version>1.7.25</version>
</dependency>-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.25</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -1,3 +1,7 @@
"""
For EOF analysis. The code were ported from Python eofs library - https://github.com/ajdawson/eofs
"""
import mipylib.numeric as np import mipylib.numeric as np
import warnings import warnings

View File

@ -13,7 +13,7 @@ from org.meteoinfo.math.stats import StatsUtil
from .. import core as np from .. import core as np
__all__ = ['solve', 'cholesky', 'cond', 'det', 'lu', 'qr', 'svd', 'eig', 'inv', 'lstsq', 'slogdet', __all__ = ['solve', 'cholesky', 'cond', 'det', 'lu', 'qr', 'svd', 'eig', 'inv', 'lstsq', 'slogdet',
'solve_triangular', 'norm', 'pinv'] 'solve_triangular', 'norm', 'pinv', 'LinAlgError']
class LinAlgError(Exception): class LinAlgError(Exception):

View File

@ -529,9 +529,10 @@ class MapAxes(Axes):
if antialias is not None: if antialias is not None:
graphics.setAntiAlias(antialias) graphics.setAntiAlias(antialias)
graphics = self.add_graphic(graphics, projection=layer.proj, zorder=zorder) if visible:
self._axes.setDrawExtent(graphics.getExtent().clone()) graphics = self.add_graphic(graphics, projection=layer.proj, zorder=zorder)
self._axes.setExtent(graphics.getExtent().clone()) #self._axes.setDrawExtent(graphics.getExtent().clone())
#self._axes.setExtent(graphics.getExtent().clone())
return GeoGraphicCollection(graphics) return GeoGraphicCollection(graphics)
else: else:
if isinstance(args[0], Graphic): if isinstance(args[0], Graphic):

View File

@ -40,6 +40,18 @@ class Line2D(Line2DGraphic, Artist):
if curve: if curve:
self.setCurve(curve) self.setCurve(curve)
@property
def visible(self):
"""
The artist is visible or not.
"""
return self.isVisible()
@visible.setter
def visible(self, val):
self.setVisible(val)
self.stale = True
@property @property
def xdata(self): def xdata(self):
""" """

View File

@ -948,16 +948,16 @@ public class ProjectionUtil {
public static Graphic projectClipGraphic(Graphic graphic, ProjectionInfo fromProj, ProjectionInfo toProj) { public static Graphic projectClipGraphic(Graphic graphic, ProjectionInfo fromProj, ProjectionInfo toProj) {
if (graphic instanceof GraphicCollection) { if (graphic instanceof GraphicCollection) {
try { try {
GraphicCollection newGCollection = new GraphicCollection(); Graphic newGCollection = graphic.getClass().getDeclaredConstructor().newInstance();
for (Graphic aGraphic : ((GraphicCollection) graphic).getGraphics()) { for (Graphic aGraphic : ((GraphicCollection) graphic).getGraphics()) {
List<? extends Shape> shapes = projectClipShape(aGraphic.getShape(), fromProj, toProj); List<? extends Shape> shapes = projectClipShape(aGraphic.getShape(), fromProj, toProj);
if (shapes != null && shapes.size() > 0) { if (shapes != null && shapes.size() > 0) {
aGraphic.setShape(shapes.get(0)); aGraphic.setShape(shapes.get(0));
newGCollection.add(aGraphic); ((GraphicCollection) newGCollection).add(aGraphic);
} }
} }
newGCollection.setLegendScheme(((GraphicCollection) graphic).getLegendScheme()); ((GraphicCollection) newGCollection).setLegendScheme(((GraphicCollection) graphic).getLegendScheme());
newGCollection.setSingleLegend(((GraphicCollection) graphic).isSingleLegend()); ((GraphicCollection) newGCollection).setSingleLegend(((GraphicCollection) graphic).isSingleLegend());
newGCollection.setAntiAlias(graphic.isAntiAlias()); newGCollection.setAntiAlias(graphic.isAntiAlias());
return newGCollection; return newGCollection;

View File

@ -549,7 +549,7 @@ public final class AttributeTable implements Cloneable {
* Save this table to the specified file name * Save this table to the specified file name
* *
* @param fileName The file name to be saved * @param fileName The file name to be saved
* @param overwrite If over write the file if it exists * @param overwrite If overwrite the file if it exists
*/ */
public void saveAs(String fileName, boolean overwrite) { public void saveAs(String fileName, boolean overwrite) {
if (_file == null) { if (_file == null) {

View File

@ -35,7 +35,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<revision>3.8.2</revision> <revision>3.8.3</revision>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release> <maven.compiler.release>8</maven.compiler.release>