Package 

Class AbstractDrawLayers

  • All Implemented Interfaces:
    it.unibo.alchemist.boundary.gui.effects.DrawLayers , it.unibo.alchemist.boundary.gui.effects.Effect , java.io.Serializable

    
    public abstract class AbstractDrawLayers
    extends DrawOnce implements DrawLayers
                        

    This class collects the following responsibilities: - it manages to draw layers only when necessary (as the apply method will be called for every node). Every subclass must only define the >#it.unibo.alchemist.model.interfaces.Environment, #java.awt.Graphics2D#it.unibo.alchemist.boundary.wormhole.interfaces.Wormhole2D

    /PointingToDeclaration/>drawLayers method, which is guaranteed to be called only when necessary. - it declares gui controls for the selection of the color to use - it declares gui controls for the selection of a filter, used to filter the layers to draw. In particular, it allows the user to specify a molecule, meaning that only the layer containing such molecule will be drawn (otherwise the effect is applied to all layers)

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean layerFilter
      private String molString
      private RangedInteger alpha
      private RangedInteger red
      private RangedInteger green
      private RangedInteger blue
    • Method Summary

      Modifier and Type Method Description
      Color getColorSummary() {@inheritDoc}
      abstract <T, P extends Position2D<P>> void drawLayers(Collection<Layer<T, P>> toDraw, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole) {@inheritDoc}
      boolean isLayerFilter()
      String getMolString()
      RangedInteger getAlpha()
      RangedInteger getRed()
      RangedInteger getGreen()
      RangedInteger getBlue()
      void setLayerFilter(boolean layerFilter)
      void setMolString(String molString)
      void setAlpha(RangedInteger alpha)
      void setRed(RangedInteger red)
      void setGreen(RangedInteger green)
      void setBlue(RangedInteger blue)
      • 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

      • drawLayers

         abstract <T, P extends Position2D<P>> void drawLayers(Collection<Layer<T, P>> toDraw, Environment<T, P> environment, Graphics2D graphics, Wormhole2D<P> wormhole)

        {@inheritDoc}

      • getRed

         RangedInteger getRed()
      • setLayerFilter

         void setLayerFilter(boolean layerFilter)
        Parameters:
        layerFilter - a boolean representing whether or not layer filter must be on
      • setMolString

         void setMolString(String molString)
        Parameters:
        molString - a string representing the molecule to use
      • setAlpha

         void setAlpha(RangedInteger alpha)
        Parameters:
        alpha - alpha channel
      • setRed

         void setRed(RangedInteger red)
        Parameters:
        red - red channel
      • setGreen

         void setGreen(RangedInteger green)
        Parameters:
        green - green channel
      • setBlue

         void setBlue(RangedInteger blue)
        Parameters:
        blue - blue channel