-
- All Implemented Interfaces:
-
it.unibo.alchemist.boundary.gui.effects.DrawLayers
,it.unibo.alchemist.boundary.gui.effects.Effect
,it.unibo.alchemist.boundary.gui.effects.FunctionDrawer
,java.io.Serializable
public abstract class DrawLayersValues extends AbstractDrawLayers implements FunctionDrawer
This is a basic class for all the effects meant to draw it.unibo.alchemist.model.interfaces.Layers values in different points of the view. One effect could draw isolines, whereas another could represent different values with a gradient. Normally, drawing a layer's values only makes sense for "numerical" layers (i.e. layers for which the values are Numbers). However, one could have a "non-numerical" layer whose getValue return type is an object from which a value can be extracted somehow. In the end, drawing a layer's values makes sense as long as there is a way to map those values to Numbers. More generally, a LayerToFunctionMapper is needed. As this class is not aware of which mapper to use, this responsibility is left to subclasses. When drawing layers values, it can be important to know the min and max layer values that will be drawn. This class declares gui controls that allow the user to specify such boundaries.
-
-
Field Summary
Fields Modifier and Type Field Description private String
minLayerValue
private String
maxLayerValue
-
Method Summary
Modifier and Type Method Description String
getMinLayerValue()
void
setMinLayerValue(String minLayerValue)
String
getMaxLayerValue()
void
setMaxLayerValue(String maxLayerValue)
<T, P extends Position2D<P>> void
drawLayers(Collection<Layer<T, P>> toDraw, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)
abstract <T, P extends Position2D<P>> void
drawFunction(Function<out Object, out Number> function, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)
Draw the provided function. -
Methods inherited from class it.unibo.alchemist.boundary.gui.effects.AbstractDrawLayers
getAlpha, getBlue, getColorSummary, getGreen, getMolString, getRed, isLayerFilter, setAlpha, setBlue, setGreen, setLayerFilter, setMolString, setRed
-
Methods inherited from class it.unibo.alchemist.boundary.gui.effects.DrawOnce
apply, getMarkerNodeID
-
Methods inherited from class it.unibo.alchemist.boundary.gui.effects.Effect
apply, apply, equals, hashCode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getMinLayerValue
String getMinLayerValue()
-
setMinLayerValue
void setMinLayerValue(String minLayerValue)
- Parameters:
minLayerValue
- a string representation of the min layer value to set
-
getMaxLayerValue
String getMaxLayerValue()
-
setMaxLayerValue
void setMaxLayerValue(String maxLayerValue)
- Parameters:
maxLayerValue
- a string representation of the max layer value to set
-
drawLayers
<T, P extends Position2D<P>> void drawLayers(Collection<Layer<T, P>> toDraw, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)
-
drawFunction
abstract <T, P extends Position2D<P>> void drawFunction(Function<out Object, out Number> function, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)
Draw the provided function.
-
-
-
-