Class DrawLayersIsolines
-
- All Implemented Interfaces:
-
it.unibo.alchemist.boundary.swingui.effect.api.DrawLayers
,it.unibo.alchemist.boundary.swingui.effect.api.Effect
,it.unibo.alchemist.boundary.swingui.effect.api.FunctionDrawer
,java.io.Serializable
public abstract class DrawLayersIsolines extends DrawLayersValues
Draw layers isolines. The user must specify: - the number of isolines to draw - the min layer value - the max layer value - the distribution, used to space isoline values between min and max This class defines the drawFunction method, which is capable of drawing a layer's isolines given a function. The only responsibility left to subclasses is to provide a LayerToFunctionMapper.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
DrawLayersIsolines.Distribution
Distributions describing how values within an interval should be spaced.
-
Field Summary
Fields Modifier and Type Field Description public DrawLayersIsolines.Distribution
distribution
public String
minLayerValue
public String
maxLayerValue
public String
molString
public RangedInteger
alpha
public RangedInteger
red
public RangedInteger
green
public RangedInteger
blue
public Integer
markerNodeID
-
Constructor Summary
Constructors Constructor Description DrawLayersIsolines(IsolinesFinder algorithm, LayerToFunctionMapper mapper)
Every class extending this one should call this constructor.
-
Method Summary
Modifier and Type Method Description DrawLayersIsolines.Distribution
getDistribution()
void
setDistribution(DrawLayersIsolines.Distribution distribution)
<T, P extends Position2D<P>> void
drawFunction(Function<out Object, out Number> function, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)
RangedInteger
getNumberOfIsolines()
void
setNumberOfIsolines(RangedInteger nOfIsolines)
Boolean
getDrawValues()
void
setDrawValues(Boolean drawValues)
static Array<double>
logspace(double d1, double d2, int n, double base)
generates n logarithmically-spaced points between d1 and d2 using the provided base. static Array<double>
linspace(double d1, double d2, int n)
generates n linearly-spaced points between d1 and d2. -
Methods inherited from class it.unibo.alchemist.boundary.swingui.effect.impl.DrawLayersValues
drawLayers, getMaxLayerValue, getMinLayerValue, setMaxLayerValue, setMinLayerValue
-
Methods inherited from class it.unibo.alchemist.boundary.swingui.effect.impl.AbstractDrawLayers
drawLayers, getAlpha, getBlue, getColorSummary, getGreen, getMolString, getRed, isLayerFilter, setAlpha, setBlue, setGreen, setLayerFilter, setMolString, setRed
-
Methods inherited from class it.unibo.alchemist.boundary.swingui.effect.impl.AbstractDrawOnce
apply, getMarkerNodeID
-
Methods inherited from class it.unibo.alchemist.boundary.swingui.effect.api.Effect
apply, apply, equals, hashCode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
DrawLayersIsolines
DrawLayersIsolines(IsolinesFinder algorithm, LayerToFunctionMapper mapper)
Every class extending this one should call this constructor.- Parameters:
algorithm
- - the algorithm used to extract isolinesmapper
- - the function converting a layer to a function
-
-
Method Detail
-
getDistribution
DrawLayersIsolines.Distribution getDistribution()
-
setDistribution
void setDistribution(DrawLayersIsolines.Distribution distribution)
- Parameters:
distribution
- to set
-
drawFunction
<T, P extends Position2D<P>> void drawFunction(Function<out Object, out Number> function, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)
-
getNumberOfIsolines
RangedInteger getNumberOfIsolines()
-
setNumberOfIsolines
void setNumberOfIsolines(RangedInteger nOfIsolines)
- Parameters:
nOfIsolines
- the number of isolines
-
getDrawValues
Boolean getDrawValues()
-
setDrawValues
void setDrawValues(Boolean drawValues)
- Parameters:
drawValues
- whether the values of the isolines are to be drawn or not
-
logspace
static Array<double> logspace(double d1, double d2, int n, double base)
generates n logarithmically-spaced points between d1 and d2 using the provided base.
- Parameters:
d1
- The min valued2
- The max valuen
- The number of points to generatedbase
- the logarithmic base to use
-
-
-
-