mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
update antialias functions
This commit is contained in:
parent
e0ef54726a
commit
9e5394ae89
@ -510,7 +510,8 @@ public class Chart {
|
||||
Margin shrink = this.getPlotsShrink(g, plotArea);
|
||||
for (int i = 0; i < this.plots.size(); i++) {
|
||||
Plot plot = this.plots.get(i);
|
||||
plot.setSymbolAntialias(this.symbolAntialias);
|
||||
plot.setAntiAlias(this.antiAlias);
|
||||
plot.setSymbolAntiAlias(this.symbolAntialias);
|
||||
if (plot.isOuterPosActive()){
|
||||
if (plot.isSubPlot || plot.isSameShrink()) {
|
||||
plot.setPlotShrink(shrink);
|
||||
|
||||
@ -566,7 +566,8 @@ public class GLChart implements GLEventListener {
|
||||
Margin shrink = this.getPlotsShrink(g, plotArea);
|
||||
for (int i = 0; i < this.plots.size(); i++) {
|
||||
Plot plot = this.plots.get(i);
|
||||
plot.setSymbolAntialias(this.symbolAntialias);
|
||||
plot.setAntiAlias(this.antialias);
|
||||
plot.setSymbolAntiAlias(this.symbolAntialias);
|
||||
if (plot.isOuterPosActive()){
|
||||
if (plot.isSubPlot || plot.isSameShrink()) {
|
||||
plot.setPlotShrink(shrink);
|
||||
|
||||
@ -55,7 +55,6 @@ public abstract class AbstractPlot2D extends Plot {
|
||||
protected double aspect = 1;
|
||||
protected boolean clip = true;
|
||||
protected boolean fixDrawExtent = false;
|
||||
protected boolean antiAlias = false;
|
||||
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="Constructor">
|
||||
@ -720,22 +719,6 @@ public abstract class AbstractPlot2D extends Plot {
|
||||
this.fixDrawExtent = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return antiAlias
|
||||
* @return AntiAlias
|
||||
*/
|
||||
public boolean isAntiAlias() {
|
||||
return this.antiAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set antiAlias
|
||||
* @param value Set antiAlias
|
||||
*/
|
||||
public void setAntiAlias(boolean value) {
|
||||
this.antiAlias = value;
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
// <editor-fold desc="Method">
|
||||
/**
|
||||
|
||||
@ -8,6 +8,7 @@ package org.meteoinfo.chart.plot;
|
||||
import org.meteoinfo.chart.Margin;
|
||||
import org.meteoinfo.common.Extent;
|
||||
import org.meteoinfo.data.Dataset;
|
||||
import org.meteoinfo.geometry.graphic.Artist;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Ellipse2D;
|
||||
@ -18,7 +19,7 @@ import java.util.List;
|
||||
*
|
||||
* @author yaqiang
|
||||
*/
|
||||
public abstract class Plot {
|
||||
public abstract class Plot extends Artist {
|
||||
|
||||
/** The default outline stroke. */
|
||||
public static final Stroke DEFAULT_OUTLINE_STROKE = new BasicStroke(0.5f,
|
||||
@ -69,8 +70,8 @@ public abstract class Plot {
|
||||
|
||||
//units - normalized or pixels
|
||||
protected AxesUnits units = AxesUnits.NORMALIZED;
|
||||
|
||||
protected boolean symbolAntialias = true;
|
||||
|
||||
protected boolean symbolAntiAlias = true;
|
||||
|
||||
/**
|
||||
* Get units
|
||||
@ -286,16 +287,16 @@ public abstract class Plot {
|
||||
* Get symbol antialias
|
||||
* @return Boolean
|
||||
*/
|
||||
public boolean isSymbolAntialias() {
|
||||
return this.symbolAntialias;
|
||||
public boolean isSymbolAntiAlias() {
|
||||
return this.symbolAntiAlias;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set symbol antialias
|
||||
* @param value Boolean
|
||||
*/
|
||||
public void setSymbolAntialias(boolean value) {
|
||||
this.symbolAntialias = value;
|
||||
public void setSymbolAntiAlias(boolean value) {
|
||||
this.symbolAntiAlias = value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -292,7 +292,7 @@ public class Plot2D extends AbstractPlot2D {
|
||||
}
|
||||
|
||||
protected void drawGraphics(Graphics2D g, Graphic graphic, Rectangle2D area) {
|
||||
if (graphic.isAntiAlias()) {
|
||||
if (this.antiAlias || graphic.isAntiAlias()) {
|
||||
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
|
||||
g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
|
||||
@ -461,7 +461,7 @@ public class Plot2D extends AbstractPlot2D {
|
||||
PointF pf = new PointF((float) sXY[0], (float) sXY[1]);
|
||||
RenderingHints rend = g.getRenderingHints();
|
||||
boolean rc = false;
|
||||
if (this.symbolAntialias && rend.get(RenderingHints.KEY_ANTIALIASING) != RenderingHints.VALUE_ANTIALIAS_ON) {
|
||||
if (this.symbolAntiAlias && rend.get(RenderingHints.KEY_ANTIALIASING) != RenderingHints.VALUE_ANTIALIAS_ON) {
|
||||
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
rc = true;
|
||||
}
|
||||
|
||||
@ -88,12 +88,11 @@ public class PointShape extends Shape implements Cloneable{
|
||||
/**
|
||||
* Set point
|
||||
*
|
||||
* @param aPoint point
|
||||
* @param point Point
|
||||
*/
|
||||
public void setPoint(PointD aPoint) {
|
||||
List<PointD> pts = new ArrayList<>();
|
||||
pts.add(aPoint);
|
||||
this.setPoints(pts);
|
||||
public void setPoint(PointD point) {
|
||||
((List<PointD>) this.points).set(0, point);
|
||||
updateExtent();
|
||||
}
|
||||
|
||||
// </editor-fold>
|
||||
|
||||
@ -75,12 +75,12 @@ public class PointZShape extends PointShape {
|
||||
* @param aPoint point
|
||||
*/
|
||||
@Override
|
||||
public void setPoint(PointD aPoint) {
|
||||
if (aPoint instanceof PointZ){
|
||||
this.setPoint(aPoint);
|
||||
} else {
|
||||
this.getPoint().X = aPoint.X;
|
||||
this.getPoint().Y = aPoint.Y;
|
||||
public void setPoint(PointD point) {
|
||||
PointZ p = (PointZ) this.getPoint();
|
||||
p.X = point.X;
|
||||
p.Y = point.Y;
|
||||
if (point instanceof PointZ){
|
||||
p.Z = ((PointZ) point).Z;
|
||||
}
|
||||
this.updateExtent();
|
||||
}
|
||||
|
||||
@ -1,32 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\meteo">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\contour"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\annotate"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\boxplot"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\geod"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\geoshow"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\maskout"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\projection"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\webmap"/>
|
||||
<Path OpenPath="D:\Working\MIScript\Jython\mis\plot_types\funny">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\topology"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\calc"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo\wrf"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\meteo"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\map\webmap"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\scatter"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\bar"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\slice"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
|
||||
<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\animation"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\funny"/>
|
||||
</Path>
|
||||
<File>
|
||||
<OpenedFiles>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\map\geoshow\map_2.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\map\projection\lcc_proj_gridlabel.py"/>
|
||||
<OpenedFile File="D:\Working\MIScript\Jython\mis\meteo\mpv_1.py"/>
|
||||
</OpenedFiles>
|
||||
<RecentFiles>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\map\geoshow\map_2.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\map\projection\lcc_proj_gridlabel.py"/>
|
||||
<RecentFile File="D:\Working\MIScript\Jython\mis\meteo\mpv_1.py"/>
|
||||
</RecentFiles>
|
||||
</File>
|
||||
<Font>
|
||||
@ -34,5 +32,5 @@
|
||||
</Font>
|
||||
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatDarkLaf"/>
|
||||
<Figure DoubleBuffering="true"/>
|
||||
<Startup MainFormLocation="-7,0" MainFormSize="1457,819"/>
|
||||
<Startup MainFormLocation="-7,-7" MainFormSize="1293,685"/>
|
||||
</MeteoInfo>
|
||||
|
||||
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
import miplot
|
||||
from .miplot import *
|
||||
from ._axes import Axes, PolarAxes
|
||||
from ._mapaxes import MapAxes
|
||||
from ._mapaxes import *
|
||||
from ._axes3d import Axes3D
|
||||
from ._axes3dgl import Axes3DGL
|
||||
from ._figure import Figure
|
||||
@ -10,7 +10,8 @@ from .colors import *
|
||||
from .io import *
|
||||
from .graphic import *
|
||||
|
||||
__all__ = ['Figure', 'GLFigure', 'Axes', 'PolarAxes', 'MapAxes', 'Axes3D', 'Axes3DGL']
|
||||
__all__ = ['Figure', 'GLFigure', 'Axes', 'PolarAxes', 'Axes3D', 'Axes3DGL']
|
||||
__all__ += _mapaxes.__all__
|
||||
__all__ += miplot.__all__
|
||||
__all__ += colors.__all__
|
||||
__all__ += io.__all__
|
||||
|
||||
Binary file not shown.
@ -37,7 +37,7 @@ import colors
|
||||
import mipylib.migl as migl
|
||||
import mipylib.miutil as miutil
|
||||
|
||||
__all__ = ['MapAxes']
|
||||
__all__ = ['MapAxes','WebMapProvider']
|
||||
|
||||
##############################################
|
||||
class MapAxes(Axes):
|
||||
@ -1567,9 +1567,11 @@ class MapAxes(Axes):
|
||||
if isinstance(provider, TileFactoryInfo):
|
||||
tf = DefaultTileFactory(provider)
|
||||
graphic.setTileFactory(tf)
|
||||
else:
|
||||
elif isinstance(provider, basestring):
|
||||
provider = WebMapProvider.valueOf(provider)
|
||||
graphic.setWebMapProvider(provider)
|
||||
else:
|
||||
graphic.setWebMapProvider(provider)
|
||||
|
||||
self.add_graphic(graphic, zorder=zorder)
|
||||
return graphic
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user