mirror of
https://github.com/meteoinfo/MeteoInfo.git
synced 2025-12-08 20:36:05 +00:00
add FlatMacLightLaf and FlatMacDarkLaf look&feel
This commit is contained in:
parent
7aa817dfa4
commit
544b505fc7
45
.idea/inspectionProfiles/Project_Default.xml
generated
45
.idea/inspectionProfiles/Project_Default.xml
generated
@ -60,6 +60,7 @@
|
||||
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="ConstantExpression" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="ConstantValue" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ContinueOrBreakFromFinallyBlock" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="Contract" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ControlFlowStatementWithoutBraces" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
@ -202,6 +203,7 @@
|
||||
<inspection_tool class="JavaReflectionMemberAccess" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JavaRequiresAutoModule" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JavacQuirks" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JavadocDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="JavadocReference" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="JoinDeclarationAndAssignmentJava" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="LambdaBodyCanBeCodeBlock" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
@ -241,6 +243,39 @@
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MismatchedStringBuilderQueryUpdate" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MismatchedStringCase" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="MissingJavadoc" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="PACKAGE_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="MODULE_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="TOP_LEVEL_CLASS_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="INNER_CLASS_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="METHOD_SETTINGS">
|
||||
<Options>
|
||||
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="FIELD_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MissingOverrideAnnotation" enabled="false" level="INFORMATION" enabled_by_default="false">
|
||||
<option name="ignoreObjectMethods" value="true" />
|
||||
<option name="ignoreAnonymousClassMethods" value="false" />
|
||||
@ -300,6 +335,14 @@
|
||||
<value />
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyInterpreterInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ignoredIdentifiers">
|
||||
<list>
|
||||
<option value="org.meteoinfo.*" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="RawTypeCanBeGeneric" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
||||
<inspection_tool class="RawUseOfParameterizedType" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ReadWriteStringCanBeUsed" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
@ -482,7 +525,7 @@
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="unused" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<inspection_tool class="unused" enabled="false" level="WARNING" enabled_by_default="false" checkParameterExcludingHierarchy="false">
|
||||
<option name="LOCAL_VARIABLE" value="true" />
|
||||
<option name="FIELD" value="true" />
|
||||
<option name="METHOD" value="true" />
|
||||
|
||||
@ -32,6 +32,7 @@ public class ConsoleColors {
|
||||
case "Darcula":
|
||||
case "FlatDarculaLaf":
|
||||
case "FlatDarkLaf":
|
||||
case "FlatMacDarkLaf":
|
||||
this.promptColor = new Color(255, 100, 100);
|
||||
this.commandColor = Color.WHITE;
|
||||
this.codeLinesColor = new Color(0, 153, 204);
|
||||
|
||||
@ -1,34 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<MeteoInfo File="milconfig.xml" Type="configurefile">
|
||||
<Path OpenPath="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui">
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array\slice"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\array"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\3d\jogl\isosurface"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\funny"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\toolbox"/>
|
||||
<RecentFolder Folder="D:\Run\emips\test\setting"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\toolbox\emips"/>
|
||||
<RecentFolder Folder="D:\Run\emips"/>
|
||||
<RecentFolder Folder="D:\Run\emips\run_meic"/>
|
||||
<RecentFolder Folder="D:\Run\emips\test"/>
|
||||
<RecentFolder Folder="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips"/>
|
||||
<RecentFolder Folder="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\form"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\io\grads"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\annotate"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\arrow"/>
|
||||
<RecentFolder Folder="D:\Working\MIScript\Jython\mis\plot_types\bar"/>
|
||||
<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\plot_types\funny"/>
|
||||
<RecentFolder Folder="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui"/>
|
||||
</Path>
|
||||
<File>
|
||||
<OpenedFiles>
|
||||
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\main_gui.py"/>
|
||||
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\_reload.py"/>
|
||||
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\emission_panel.py"/>
|
||||
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\vertical_panel.py"/>
|
||||
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\temporal_panel.py"/>
|
||||
<OpenedFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\spatial_panel.py"/>
|
||||
</OpenedFiles>
|
||||
<RecentFiles>
|
||||
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\main_gui.py"/>
|
||||
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\_reload.py"/>
|
||||
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\emission_panel.py"/>
|
||||
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\vertical_panel.py"/>
|
||||
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\temporal_panel.py"/>
|
||||
<RecentFile File="D:\MyProgram\java\MeteoInfoDev\toolbox\EMIPS\emips\gui\spatial_panel.py"/>
|
||||
</RecentFiles>
|
||||
</File>
|
||||
<Font>
|
||||
@ -36,5 +37,5 @@
|
||||
</Font>
|
||||
<LookFeel DockWindowDecorated="true" LafDecorated="true" Name="FlatLightLaf"/>
|
||||
<Figure DoubleBuffering="true"/>
|
||||
<Startup MainFormLocation="-7,0" MainFormSize="1378,893"/>
|
||||
<Startup MainFormLocation="-7,-7" MainFormSize="1293,685"/>
|
||||
</MeteoInfo>
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
|
||||
from ..core import numeric as _nx
|
||||
from ..core._ndarray import NDArray
|
||||
from ..core.fromnumeric import (ravel, nonzero)
|
||||
from org.meteoinfo.ndarray.math import ArrayMath
|
||||
|
||||
__all__ = ['extract','place']
|
||||
__all__ = ['extract', 'place', 'grid_edge']
|
||||
|
||||
|
||||
def extract(condition, arr):
|
||||
"""
|
||||
@ -46,6 +46,7 @@ def extract(condition, arr):
|
||||
"""
|
||||
return _nx.take(ravel(arr), nonzero(ravel(condition))[0])
|
||||
|
||||
|
||||
def place(arr, mask, vals):
|
||||
"""
|
||||
Change elements of an array based on conditional and input values.
|
||||
@ -54,6 +55,7 @@ def place(arr, mask, vals):
|
||||
True values in `mask`, while `copyto` uses the elements where `mask`
|
||||
is True.
|
||||
Note that `extract` does the exact opposite of `place`.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
arr : ndarray
|
||||
@ -65,9 +67,11 @@ def place(arr, mask, vals):
|
||||
N is the number of True values in `mask`. If `vals` is smaller
|
||||
than N, it will be repeated, and if elements of `a` are to be masked,
|
||||
this sequence must be non-empty.
|
||||
|
||||
See Also
|
||||
--------
|
||||
copyto, put, take, extract
|
||||
|
||||
Examples
|
||||
--------
|
||||
>>> arr = np.arange(6).reshape(2, 3)
|
||||
@ -83,4 +87,28 @@ def place(arr, mask, vals):
|
||||
if isinstance(vals, (list, tuple)):
|
||||
vals = NDArray(vals)
|
||||
|
||||
ArrayMath.place(arr.asarray(), mask.asarray(), vals.asarray())
|
||||
ArrayMath.place(arr.asarray(), mask.asarray(), vals.asarray())
|
||||
|
||||
|
||||
def grid_edge(x, y):
|
||||
"""
|
||||
Return grid edge coordinate array.
|
||||
:param x: (*array*) X coordinate array with one dimension.
|
||||
:param y: (*array*) Y coordinate array width one dimension.
|
||||
:return: Grid edge coordinate array of x and y with one dimension.
|
||||
"""
|
||||
yn = y.size
|
||||
xn = x.size
|
||||
n = (xn + yn) * 2
|
||||
xx = _nx.zeros(n)
|
||||
yy = _nx.zeros(n)
|
||||
xx[:xn] = x
|
||||
yy[:xn] = y[0]
|
||||
xx[xn:xn + yn] = x[-1]
|
||||
yy[xn:xn + yn] = y
|
||||
xx[xn + yn:xn + yn + xn] = x[::-1]
|
||||
yy[xn + yn:xn + yn + xn] = y[-1]
|
||||
xx[xn + yn + xn:] = x[0]
|
||||
yy[xn + yn + xn:] = y[::-1]
|
||||
|
||||
return xx, yy
|
||||
|
||||
Binary file not shown.
@ -54,7 +54,8 @@ __all__ = [
|
||||
'scatterm',
|
||||
'semilogx', 'semilogy', 'show', 'slice3', 'stationmodel', 'stem', 'stem3', 'step', 'streamplot', 'streamplot3',
|
||||
'streamplotm', 'streamslice', 'subplot', 'subplots', 'suptitle', 'supxlabel', 'supylabel',
|
||||
'surf', 'taylor_diagram', 'text', 'text3', 'title', 'trisurf', 'twinx', 'twiny', 'violinplot', 'volumeplot', 'weatherspec',
|
||||
'surf', 'taylor_diagram', 'text', 'text3', 'title', 'trisurf', 'twinx', 'twiny', 'violinplot', 'volumeplot',
|
||||
'weatherspec',
|
||||
'xaxis',
|
||||
'xlabel', 'xlim', 'xreverse', 'xticks', 'yaxis', 'ylabel', 'ylim', 'yreverse', 'yticks', 'zaxis', 'zlabel', 'zlim',
|
||||
'zticks',
|
||||
@ -133,7 +134,7 @@ def plot(*args, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.plot(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -151,7 +152,7 @@ def step(x, y, *args, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.step(x, y, *args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -183,7 +184,7 @@ def semilogy(*args, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.semilogy(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -201,7 +202,7 @@ def semilogx(*args, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.semilogx(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -219,7 +220,7 @@ def loglog(*args, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.loglog(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -238,7 +239,7 @@ def errorbar(x, y, yerr=None, xerr=None, fmt='', ecolor=None, elinewidth=None, c
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.errorbar(x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -256,7 +257,7 @@ def bar(x, height, width=0.8, bottom=None, align='center', data=None, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.bar(x, height, width, bottom, align, data, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -288,7 +289,7 @@ def barh(*args, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.barh(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -309,7 +310,7 @@ def hist(x, bins=10, range=None, density=False, cumulative=False,
|
||||
|
||||
r = g_axes.hist(x, bins, range, density, cumulative,
|
||||
bottom, histtype, align, orientation, rwidth, log, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -327,7 +328,7 @@ def stem(*args, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.stem(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -360,7 +361,7 @@ def scatter(*args, **kwargs):
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.scatter(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -390,7 +391,7 @@ def arrow(x, y, dx, dy, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.arrow(x, y, dx, dy, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -408,7 +409,7 @@ def arrowline(x, y, dx=0, dy=0, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.arrowline(x, y, dx, dy, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -426,7 +427,7 @@ def annotate(s, xy, *args, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.annotate(s, xy, *args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -441,7 +442,7 @@ def fill(x, y=None, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.patch(x, y, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -459,7 +460,7 @@ def patch(x, y=None, **kwargs):
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.patch(x, y, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -477,7 +478,7 @@ def rectangle(position, curvature=None, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.rectangle(position, curvature, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -495,7 +496,7 @@ def fill_between(x, y1, y2=0, where=None, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.fill_between(x, y1, y2, where, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -513,7 +514,7 @@ def fill_betweenx(y, x1, x2=0, where=None, **kwargs):
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.fill_betweenx(y, x1, x2, where, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -533,16 +534,15 @@ def pie(x, explode=None, labels=None, colors=None, autopct=None, pctdistance=0.6
|
||||
|
||||
r = g_axes.pie(x, explode, labels, colors, autopct, pctdistance, shadow,
|
||||
labeldistance, startangle, radius, wedgeprops, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
|
||||
@_copy_docstring_and_deprecators(Axes.boxplot)
|
||||
def boxplot(x, sym=None, vert=True, positions=None, widths=None, color=None, showcaps=True, showfliers=True,
|
||||
showmeans=False, \
|
||||
showmedians=True, meanline=False, medianline=True, boxprops=None, medianprops=None, meanprops=None,
|
||||
whiskerprops=None, capprops=None, flierprops=None):
|
||||
showmeans=False, showmedians=True, meanline=False, medianline=True, boxprops=None,
|
||||
medianprops=None, meanprops=None, whiskerprops=None, capprops=None, flierprops=None):
|
||||
global g_axes
|
||||
if g_figure is None:
|
||||
figure()
|
||||
@ -553,10 +553,10 @@ def boxplot(x, sym=None, vert=True, positions=None, widths=None, color=None, sho
|
||||
if g_axes.axestype != 'cartesian':
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.boxplot(x, sym, vert, positions, widths, color, showcaps, showfliers, showmeans, \
|
||||
r = g_axes.boxplot(x, sym, vert, positions, widths, color, showcaps, showfliers, showmeans,
|
||||
showmedians, meanline, medianline, boxprops, medianprops, meanprops, whiskerprops, capprops,
|
||||
flierprops)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -575,7 +575,7 @@ def violinplot(dataset, positions=None, widths=0.5, boxwidth=0.01, boxprops=None
|
||||
g_axes = axes()
|
||||
|
||||
r = g_axes.violinplot(dataset, positions, widths, boxwidth, boxprops, whiskerprops, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -593,7 +593,7 @@ def windrose(wd, ws, nwdbins=16, wsbins=None, degree=True, colors=None, cmap='ma
|
||||
|
||||
bars = g_axes.windrose(wd, ws, nwdbins, wsbins, degree, colors, cmap, alpha,
|
||||
rmax, rtickloc, rticks, rlabelpos, xticks, **kwargs)
|
||||
if not bars is None:
|
||||
if bars is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
return g_axes, bars
|
||||
@ -694,7 +694,7 @@ def caxes(ax=None):
|
||||
|
||||
g_axes = __get_axes(chart, ax)
|
||||
chart.setCurrentPlot(ax - 1)
|
||||
elif not ax is None:
|
||||
elif ax is not None:
|
||||
g_axes = ax
|
||||
chart.setCurrentPlot(chart.getPlotIndex(ax._axes))
|
||||
return g_axes
|
||||
@ -722,7 +722,7 @@ def subplot(nrows, ncols, plot_number, **kwargs):
|
||||
return g_axes
|
||||
|
||||
|
||||
def subplots(nrows=1, ncols=1, position=None, sharex=False, sharey=False, \
|
||||
def subplots(nrows=1, ncols=1, position=None, sharex=False, sharey=False,
|
||||
wspace=None, hspace=None, axestype='Axes', **kwargs):
|
||||
"""
|
||||
Create a figure and a set of subplots.
|
||||
@ -805,7 +805,7 @@ def axes(*args, **kwargs):
|
||||
"""
|
||||
global g_axes
|
||||
|
||||
if g_figure is None or isinstance(g_figure, GLFigure):
|
||||
if g_figure is None:
|
||||
figure()
|
||||
|
||||
ax = g_figure.add_axes(*args, **kwargs)
|
||||
@ -1424,14 +1424,14 @@ def text3(x, y, z, s, zdir=None, **kwargs):
|
||||
@_copy_docstring_and_deprecators(Axes.axis)
|
||||
def axis(limits):
|
||||
r = g_axes.axis(limits)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
|
||||
@_copy_docstring_and_deprecators(MapAxes.axis)
|
||||
def axism(limits=None, lonlat=True):
|
||||
r = g_axes.axis(limits, lonlat)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
|
||||
@ -1474,7 +1474,7 @@ def yreverse():
|
||||
@_copy_docstring_and_deprecators(Axes.legend)
|
||||
def legend(*args, **kwargs):
|
||||
r = g_axes.legend(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1506,28 +1506,6 @@ def colorbar(mappable=None, **kwargs):
|
||||
return cb
|
||||
|
||||
|
||||
# def set(obj, **kwargs):
|
||||
# """
|
||||
# Set properties to an object. Used to change the plot parameters.
|
||||
# """
|
||||
# if isinstance(obj, Axes):
|
||||
# xminortick = kwargs.pop('xminortick', None)
|
||||
# if not xminortick is None:
|
||||
# locs = [Location.BOTTOM, Location.TOP]
|
||||
# for loc in locs:
|
||||
# axis = obj._axes.getAxis(loc)
|
||||
# axis.setMinorTickVisible(xminortick)
|
||||
# yminortick = kwargs.pop('yminortick', None)
|
||||
# if not yminortick is None:
|
||||
# locs = [Location.LEFT, Location.RIGHT]
|
||||
# for loc in locs:
|
||||
# axis = obj._axes.getAxis(loc)
|
||||
# axis.setMinorTickVisible(yminortick)
|
||||
# tickin = kwargs.pop('tickin', None)
|
||||
# if not tickin is None:
|
||||
# obj._axes.setInsideTick(tickin)
|
||||
# draw_if_interactive()
|
||||
|
||||
@_copy_docstring_and_deprecators(Axes.imshow)
|
||||
def imshow(*args, **kwargs):
|
||||
global g_axes
|
||||
@ -1536,12 +1514,9 @@ def imshow(*args, **kwargs):
|
||||
|
||||
if g_axes is None:
|
||||
g_axes = axes()
|
||||
# else:
|
||||
# if g_axes.axestype != 'cartesian':
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.imshow(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1554,12 +1529,9 @@ def pcolor(*args, **kwargs):
|
||||
|
||||
if g_axes is None:
|
||||
g_axes = axes()
|
||||
# else:
|
||||
# if g_axes.axestype != 'cartesian':
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.pcolor(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1577,7 +1549,7 @@ def gridshow(*args, **kwargs):
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.gridshow(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1590,12 +1562,9 @@ def contour(*args, **kwargs):
|
||||
|
||||
if g_axes is None:
|
||||
g_axes = axes()
|
||||
# else:
|
||||
# if g_axes.axestype != 'cartesian' and g_axes.axestype != 'polar':
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.contour(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1608,12 +1577,9 @@ def contourf(*args, **kwargs):
|
||||
|
||||
if g_axes is None:
|
||||
g_axes = axes()
|
||||
# else:
|
||||
# if g_axes.axestype != 'cartesian' and g_axes.axestype != 'polar':
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.contourf(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1626,12 +1592,9 @@ def quiver(*args, **kwargs):
|
||||
|
||||
if g_axes is None:
|
||||
g_axes = axes()
|
||||
# else:
|
||||
# if g_axes.axestype != 'cartesian' and g_axes.axestype != 'polar':
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.quiver(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1656,12 +1619,9 @@ def barbs(*args, **kwargs):
|
||||
|
||||
if g_axes is None:
|
||||
g_axes = axes()
|
||||
# else:
|
||||
# if g_axes.axestype != 'cartesian' and g_axes.axestype != 'polar':
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.barbs(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1674,12 +1634,9 @@ def streamplot(*args, **kwargs):
|
||||
|
||||
if g_axes is None:
|
||||
g_axes = axes()
|
||||
# else:
|
||||
# if g_axes.axestype != 'cartesian' and g_axes.axestype != 'polar':
|
||||
# g_axes = axes()
|
||||
|
||||
r = g_axes.streamplot(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1697,7 +1654,7 @@ def scatterm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.scatter(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1743,7 +1700,7 @@ def plotm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.plot(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1761,7 +1718,7 @@ def stationmodel(smdata, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.stationmodel(smdata, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1779,7 +1736,7 @@ def imshowm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.imshow(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
return r
|
||||
@ -1798,7 +1755,7 @@ def contourm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.contour(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
return r
|
||||
@ -1817,7 +1774,7 @@ def contourfm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.contourf(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
return r
|
||||
@ -1836,7 +1793,7 @@ def pcolorm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.pcolor(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
return r
|
||||
@ -1855,7 +1812,7 @@ def gridshowm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.gridshow(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
return r
|
||||
@ -1874,7 +1831,7 @@ def quiverm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.quiver(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
return r
|
||||
@ -1899,7 +1856,7 @@ def barbsm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.barbs(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1917,7 +1874,7 @@ def streamplotm(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.streamplot(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
@ -1962,7 +1919,7 @@ def geoshow(*args, **kwargs):
|
||||
g_axes = axesm()
|
||||
|
||||
r = g_axes.geoshow(*args, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
|
||||
return r
|
||||
@ -1982,7 +1939,7 @@ def taylor_diagram(stddev, correlation, std_max=1.65, labels=None, ref_std=1., c
|
||||
g_axes = axes(position=[0.13, 0.11, 0.775, 0.75])
|
||||
|
||||
r = g_axes.taylor_diagram(stddev, correlation, std_max, labels, ref_std, colors, **kwargs)
|
||||
if not r is None:
|
||||
if r is not None:
|
||||
draw_if_interactive()
|
||||
return r
|
||||
|
||||
|
||||
@ -23,6 +23,8 @@ import com.formdev.flatlaf.FlatDarculaLaf;
|
||||
import com.formdev.flatlaf.FlatDarkLaf;
|
||||
import com.formdev.flatlaf.FlatIntelliJLaf;
|
||||
import com.formdev.flatlaf.FlatLightLaf;
|
||||
import com.formdev.flatlaf.themes.FlatMacDarkLaf;
|
||||
import com.formdev.flatlaf.themes.FlatMacLightLaf;
|
||||
import org.meteoinfo.common.DataConvert;
|
||||
import org.meteoinfo.ui.util.FontUtil;
|
||||
import org.meteoinfo.common.util.GlobalUtil;
|
||||
@ -288,6 +290,18 @@ public class MeteoInfoLab {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (laf.equals("FlatMacLightLaf")) {
|
||||
try {
|
||||
UIManager.setLookAndFeel(new FlatMacLightLaf());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else if (laf.equals("FlatMacDarkLaf")) {
|
||||
try {
|
||||
UIManager.setLookAndFeel(new FlatMacDarkLaf());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
String lafName;
|
||||
|
||||
@ -71,6 +71,7 @@ public class EditorDockable extends DefaultSingleCDockable {
|
||||
switch (lfName) {
|
||||
case "FlatDarculaLaf":
|
||||
case "FlatDarkLaf":
|
||||
case "FlatMacDarkLaf":
|
||||
themeName = "dark";
|
||||
break;
|
||||
}
|
||||
@ -132,6 +133,22 @@ public class EditorDockable extends DefaultSingleCDockable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get theme of the editor
|
||||
* @return The theme
|
||||
*/
|
||||
public Theme getTheme() {
|
||||
return theme;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set theme of the editor
|
||||
* @param value The theme
|
||||
*/
|
||||
public void setTheme(Theme value) {
|
||||
this.theme = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set python interpreter
|
||||
*
|
||||
|
||||
@ -9,6 +9,8 @@ import com.formdev.flatlaf.FlatDarculaLaf;
|
||||
import com.formdev.flatlaf.FlatDarkLaf;
|
||||
import com.formdev.flatlaf.FlatIntelliJLaf;
|
||||
import com.formdev.flatlaf.FlatLightLaf;
|
||||
import com.formdev.flatlaf.themes.FlatMacLightLaf;
|
||||
import com.formdev.flatlaf.themes.FlatMacDarkLaf;
|
||||
import com.l2fprod.common.swing.JFontChooser;
|
||||
import java.awt.Font;
|
||||
import java.io.IOException;
|
||||
@ -47,6 +49,8 @@ public class FrmSetting extends javax.swing.JDialog {
|
||||
this.jComboBox_LookFeel.addItem("FlatDarkLaf");
|
||||
this.jComboBox_LookFeel.addItem("FlatDarculaLaf");
|
||||
this.jComboBox_LookFeel.addItem("FlatIntelliJLaf");
|
||||
this.jComboBox_LookFeel.addItem("FlatMacLightLaf");
|
||||
this.jComboBox_LookFeel.addItem("FlatMacDarkLaf");
|
||||
this.jComboBox_LookFeel.setSelectedItem(this.parent.getOptions().getLookFeel());
|
||||
|
||||
//Decoration
|
||||
@ -254,6 +258,8 @@ public class FrmSetting extends javax.swing.JDialog {
|
||||
case "FlatDarkLaf":
|
||||
case "FlatDarculaLaf":
|
||||
case "FlatIntelliJLaf":
|
||||
case "FlatMacLightLaf":
|
||||
case "FlatMacDarkLaf":
|
||||
lafName = laf;
|
||||
break;
|
||||
default:
|
||||
@ -275,6 +281,12 @@ public class FrmSetting extends javax.swing.JDialog {
|
||||
} else if (lafName.equals("FlatDarkLaf")) {
|
||||
UIManager.setLookAndFeel(new FlatDarkLaf());
|
||||
this.changeStyleViaThemeXml("dark");
|
||||
} else if (lafName.equals("FlatMacLightLaf")) {
|
||||
UIManager.setLookAndFeel(new FlatMacLightLaf());
|
||||
this.changeStyleViaThemeXml("default");
|
||||
} else if (lafName.equals("FlatMacDarkLaf")) {
|
||||
UIManager.setLookAndFeel(new FlatMacDarkLaf());
|
||||
this.changeStyleViaThemeXml("dark");
|
||||
} else {
|
||||
UIManager.setLookAndFeel(lafName);
|
||||
this.changeStyleViaThemeXml("default");
|
||||
@ -323,6 +335,7 @@ public class FrmSetting extends javax.swing.JDialog {
|
||||
try {
|
||||
Theme theme = Theme.load(getClass().getResourceAsStream(
|
||||
"/org/fife/ui/rsyntaxtextarea/themes/" + themeName + ".xml"));
|
||||
this.parent.getEditorDock().setTheme(theme);
|
||||
for (TextEditor textEditor : this.parent.getEditorDock().getAllTextEditor())
|
||||
theme.apply(textEditor.getTextArea());
|
||||
} catch (IOException ioe) { // Never happens
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user