Package HAL.Gui

Class UIGrid

  • All Implemented Interfaces:
    Grid2D, GuiComp
    Direct Known Subclasses:
    GridWindow

    public class UIGrid
    extends java.lang.Object
    implements Grid2D, GuiComp
    a gui item that is used to efficiently visualize a grid in 2 dimensions uses an array of pixels whose color values are individually set
    • Constructor Summary

      Constructors 
      Constructor Description
      UIGrid​(int gridW, int gridH, int scaleFactor)  
      UIGrid​(int gridW, int gridH, int scaleFactor, boolean active)  
      UIGrid​(int gridW, int gridH, int scaleFactor, int compX, int compY)  
      UIGrid​(int gridW, int gridH, int scaleFactor, int compX, int compY, boolean active)  
    • Method Summary

      Modifier and Type Method Description
      void _GetComps​(java.util.ArrayList<java.awt.Component> putHere, java.util.ArrayList<java.lang.Integer> coordsHere, java.util.ArrayList<java.lang.Integer> compSizesHere)
      called by the UIWindow class to place the vis window
      void AddAlphaGrid​(UIGrid overlay)
      adds another UIGrid as an overlay to compose with the main UIGrid.
      void AddMouseListeners​(java.awt.event.MouseAdapter mouseListener)
      adds a mouse listener function to the UIGrid that will be called whenever the user interacts with the UIGrid
      void Clear​(int color)
      sets all pixels to a single color.
      double ClickXpt​(java.awt.event.MouseEvent e)
      gets the X coordinate of the mouse event in terms of the UIGrid coordinate space, useful with AddMouseListeners
      int ClickXsq​(java.awt.event.MouseEvent e)
      gets the X square of the mouse event in terms of the UIGrid coordinate space, useful with AddMouseListeners
      double ClickYpt​(java.awt.event.MouseEvent e)
      gets the Y coordinate of the mouse event in terms of the UIGrid coordinate space, useful with AddMouseListeners
      int ClickYsq​(java.awt.event.MouseEvent e)
      gets the Y square of the mouse event in terms of the UIGrid coordinate space, useful with AddMouseListeners
      int compX()
      gets the xDim component of the vis window
      int compY()
      gets the yDim component of the vis window
      <Q extends AgentBaseSpatial,​T extends AgentGrid2D<Q>>
      void
      DrawAgents​(T drawMe, AgentToColorInt<Q> ColorFn)
      sets every pixel in the UIGrid by iterating over the AgentGrid2D and drawing the first agent found at each position.
      <Q extends AgentBaseSpatial,​T extends AgentGrid2D<Q>>
      void
      DrawAgents​(T drawMe, AgentToColorInt<Q> ColorFn, Coords2DInt backgroundColor)
      sets every pixel in the UIGrid by iterating over the AgentGrid2D and drawing the first agent found at each position.
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawClosestAgentsXY​(T drawMe, AgentToColorInt<Q> ColorFn)
      sets every pixel in the UIGrid by drawing the closest agent (agent with lowest Z value) at each X,Y pair, positions with no agent will be skipped
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawClosestAgentsXY​(T drawMe, AgentToColorInt<Q> ColorFn, Coords2DInt backgroundColor)
      sets every pixel in the UIGrid by drawing the closest agent (agent with lowest Z value) at each X,Y pair, the background color will be used when no agent is found
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawClosestAgentsXZ​(T drawMe, AgentToColorInt<Q> ColorFn)
      sets every pixel in the UIGrid by drawing the closest agent (agent with lowest Y value) at each X,Z pair, positions with no agent will be skipped
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawClosestAgentsXZ​(T drawMe, AgentToColorInt<Q> ColorFn, Coords2DInt backgroundColor)
      sets every pixel in the UIGrid by drawing the closest agent (agent with lowest Y value) at each X,Z pair, the background color will be used when no agent is found
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawClosestAgentsYZ​(T drawMe, AgentToColorInt<Q> ColorFn)
      sets every pixel in the UIGrid by drawing the closest agent (agent with lowest X value) at each Y,Z pair, positions with no agent will be skipped
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawClosestAgentsYZ​(T drawMe, AgentToColorInt<Q> ColorFn, Coords2DInt backgroundColor)
      sets every pixel in the UIGrid by drawing the closest agent (agent with lowest X value) at each Y,Z pair, the background color will be used when no agent is found
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawFurthestAgentsXY​(T drawMe, AgentToColorInt<Q> ColorFn)
      sets every pixel in the UIGrid by drawing the furthest agent (agent with highest Z value) at each X,Y pair, positions with no agent will be skipped
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawFurthestAgentsXY​(T drawMe, AgentToColorInt<Q> ColorFn, Coords2DInt backgroundColor)
      sets every pixel in the UIGrid by drawing the furthest agent (agent with highest Z value) at each X,Y pair, the background color will be used when no agent is found
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawFurthestAgentsXZ​(T drawMe, AgentToColorInt<Q> ColorFn)
      sets every pixel in the UIGrid by drawing the furthest agent (agent with highest Y value) at each X,Z pair, positions with no agent will be skipped
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawFurthestAgentsXZ​(T drawMe, AgentToColorInt<Q> ColorFn, Coords2DInt backgroundColor)
      sets every pixel in the UIGrid by drawing the furthest agent (agent with highest Y value) at each X,Z pair, the background color will be used when no agent is found
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawFurthestAgentsYZ​(T drawMe, AgentToColorInt<Q> ColorFn)
      sets every pixel in the UIGrid by drawing the furthest agent (agent with highest X value) at each Y,Z pair, positions with no agent will be skipped
      <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>>
      void
      DrawFurthestAgentsYZ​(T drawMe, AgentToColorInt<Q> ColorFn, Coords2DInt backgroundColor)
      sets every pixel in the UIGrid by drawing the furthest agent (agent with highest X value) at each Y,Z pair, the background color will be used when no agent is found
      void DrawPDEGrid​(PDEGrid2D drawMe, DoubleToInt ColorFn)
      sets every pixel in the UIGrid by reading values from the PDEGrid2D
      void DrawPDEGridXY​(PDEGrid3D drawMe, DoubleToInt ColorFn)
      sets every pixel in the UIGrid by reading values from the PDEGrid3D, values are summed over the Z dimension
      void DrawPDEGridXZ​(PDEGrid3D drawMe, DoubleToInt ColorFn)
      sets every pixel in the UIGrid by reading values from the PDEGrid3D, values are summed over the Y dimension
      void DrawPDEGridYZ​(PDEGrid3D drawMe, DoubleToInt ColorFn)
      sets every pixel in the UIGrid by reading values from the PDEGrid3D, values are summed over the X dimension
      int GetPix​(int i)
      returns the pixel color at that location as a colorInt
      int GetPix​(int x, int y)
      returns the pixel color at that location as a colorInt
      boolean IsActive()
      returns whether the UIGrid is active (whether it exists)
      boolean IsWrapX()  
      boolean IsWrapY()  
      void Legend​(java.lang.String[] labels, int[] colors, int labelsColor, int bkColor, int xLeft, int yTop)  
      int Length()  
      void PlotLine​(double[] xs, double[] ys, int color)
      plots a line, connecting all pixels between the points defined by the x,y pairs from the xs and ys array with the provided color
      void PlotLine​(double[] xs, double[] ys, int color, double scale)
      plots a line, connecting all pixels between the points defined by the x,y pairs from the xs and ys array with the provided color.
      void PlotLine​(double[] xs, double[] ys, int color, int startPoint, int endPoint)
      plots a line, connecting all pixels between the points defined by the x,y pairs with the provided color.
      void PlotLine​(double[] xs, double[] ys, int color, int startPoint, int endPoint, double scale)
      plots a line, connecting all pixels between the points defined by the x,y pairs with the provided color.
      void PlotLine​(double[] xs, double[] ys, int color, int startPoint, int endPoint, double scaleX, double scaleY)
      plots a line, connecting all pixels between the points defined by the x,y pairs with the provided color.
      void PlotLine​(double[] xys, int color)
      plots a line, connecting all pixels between the points defined by the list of x,y,x,y...
      void PlotLine​(double[] xys, int color, double scale)
      plots a line, connecting all pixels between the points defined by the list of x,y,x,y...
      void PlotLine​(double[] xys, int color, int startPoint, int endPoint)
      plots a line, connecting all pixels between the points defined by the list of x,y,x,y...
      void PlotLine​(double[] xys, int color, int startPoint, int endPoint, double scale)
      plots a line, connecting all pixels between the points defined by the list of x,y,x,y...
      void PlotLine​(double[] xys, int color, int startPoint, int endPoint, double scaleX, double scaleY)
      plots a line, connecting all pixels between the points defined by the list of x,y,x,y...
      void PlotSegment​(double x1, double y1, double x2, double y2, int color)
      plots a line segment, connecting all pixels between the points defined by (x1,y1) and (x2,y2) with the provided color.
      void PlotSegment​(double x1, double y1, double x2, double y2, int color, double scale)
      plots a line segment, connecting all pixels between the points defined by (x1,y1) and (x2,y2) with the provided color.
      void PlotSegment​(double x1, double y1, double x2, double y2, int color, double scaleX, double scaleY)
      plots a line segment, connecting all pixels between the points defined by (x1,y1) and (x2,y2) with the provided color.
      void SetActive​(boolean isActive)
      can be used to inactivate the component, preventing drawing and other overhead
      void SetAll​(Coords2DColor DrawPix)
      sets every pixel in the UIGrid using the DrawPix function
      void SetChar​(char c, int xLeft, int yTop, int color, int bkColor)
      draws a single character to the UIGrid
      void SetPix​(int i, int color)
      sets an individual pixel on the GridWindow.
      void SetPix​(int x, int y, int color)
      sets an individual pixel on the GridWindow.
      void SetPix​(int x, int y, ColorIntGenerator ColorFunction)
      same functionality as SetPix with a color argument, but instead takes a ColorIntGenerator function (a function that takes no arguments and returns an int).
      void SetPix​(int i, ColorIntGenerator ColorFunction)
      same functionality as SetPix with a color argument, but instead takes a ColorIntGenerator function (a function that takes no arguments and returns an int).
      void SetPixRect​(int color, int xLeft, int xRight, int yBottom, int yTop)  
      void SetRect​(int xStart, int yStart, int xLen, int yLen, Coords2DColor ColorFn)
      sets a rectangular section of the UIGrid using the ColorFn argument
      void SetString​(java.lang.String s, int xLeft, int yTop, int color, int bkColor)
      draws a string to the UIGrid on a single line.
      void SetString​(java.lang.String s, int xLeft, int yTop, int color, int bkColor, int charsPerLine)  
      void SetString​(java.lang.String s, int xLeft, int yTop, int color, int bkColor, int charsPerLine, int maxLines)  
      void TickPause​(int millis)
      call this once per step of your model, and the function will ensure that your model runs at the rate provided in milliseconds.
      void ToGIF​(java.lang.String path)
      saves the current state image to a GIF
      void ToJPG​(java.lang.String path)
      saves the current state image to a JPG
      void ToPNG​(java.lang.String path)
      saves the current state image to a PNG
      int Xdim()  
      int Ydim()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • xDim

        public final int xDim
      • yDim

        public final int yDim
      • length

        public final int length
      • scale

        public final int scale
      • compX

        public final int compX
      • compY

        public final int compY
    • Constructor Detail

      • UIGrid

        public UIGrid​(int gridW,
                      int gridH,
                      int scaleFactor,
                      int compX,
                      int compY,
                      boolean active)
        Parameters:
        gridW - width of the UIGrid in pixels
        gridH - height of the UIGrid in pixels
        scaleFactor - the width and height in screen pixels of each UIGrid pixel
        compX - width on the gui GridBagLayout
        compY - height on the gui GridBagLayout
        active -
      • UIGrid

        public UIGrid​(int gridW,
                      int gridH,
                      int scaleFactor,
                      int compX,
                      int compY)
      • UIGrid

        public UIGrid​(int gridW,
                      int gridH,
                      int scaleFactor,
                      boolean active)
        Parameters:
        gridW - width of the UIGrid in pixels
        gridH - height of the UIGrid in pixels
        scaleFactor - the width and height in screen pixels of each UIGrid pixel
      • UIGrid

        public UIGrid​(int gridW,
                      int gridH,
                      int scaleFactor)
    • Method Detail

      • TickPause

        public void TickPause​(int millis)
        call this once per step of your model, and the function will ensure that your model runs at the rate provided in milliseconds. the function will take the amount time between calls into account to ensure a consistent tick rate.
      • SetPix

        public void SetPix​(int x,
                           int y,
                           int color)
        sets an individual pixel on the GridWindow. in the visualization the pixel will take up scaleFactor*scaleFactor screen pixels.
      • SetPix

        public void SetPix​(int i,
                           int color)
        sets an individual pixel on the GridWindow. in the visualization the pixel will take up scaleFactor*scaleFactor screen pixels.
      • SetPix

        public void SetPix​(int x,
                           int y,
                           ColorIntGenerator ColorFunction)
        same functionality as SetPix with a color argument, but instead takes a ColorIntGenerator function (a function that takes no arguments and returns an int). the reason to use this method is that when the gui is inactivated the ColorIntGenerator function will not be called, which saves the computation time of generating the color.
      • SetPix

        public void SetPix​(int i,
                           ColorIntGenerator ColorFunction)
        same functionality as SetPix with a color argument, but instead takes a ColorIntGenerator function (a function that takes no arguments and returns an int). the reason to use this method is that when the gui is inactivated the ColorIntGenerator function will not be called, which saves the computation time of generating the color.
      • GetPix

        public int GetPix​(int x,
                          int y)
        returns the pixel color at that location as a colorInt
      • GetPix

        public int GetPix​(int i)
        returns the pixel color at that location as a colorInt
      • Clear

        public void Clear​(int color)
        sets all pixels to a single color.
      • SetRect

        public void SetRect​(int xStart,
                            int yStart,
                            int xLen,
                            int yLen,
                            Coords2DColor ColorFn)
        sets a rectangular section of the UIGrid using the ColorFn argument
      • AddAlphaGrid

        public void AddAlphaGrid​(UIGrid overlay)
        adds another UIGrid as an overlay to compose with the main UIGrid. alpha blending will be used to combine them.
      • PlotSegment

        public void PlotSegment​(double x1,
                                double y1,
                                double x2,
                                double y2,
                                int color)
        plots a line segment, connecting all pixels between the points defined by (x1,y1) and (x2,y2) with the provided color.
      • PlotSegment

        public void PlotSegment​(double x1,
                                double y1,
                                double x2,
                                double y2,
                                int color,
                                double scale)
        plots a line segment, connecting all pixels between the points defined by (x1,y1) and (x2,y2) with the provided color. the coordinates will be multiplied by the scale parameter
      • PlotSegment

        public void PlotSegment​(double x1,
                                double y1,
                                double x2,
                                double y2,
                                int color,
                                double scaleX,
                                double scaleY)
        plots a line segment, connecting all pixels between the points defined by (x1,y1) and (x2,y2) with the provided color. the coordinates will be multiplied by the scale parameters
      • PlotLine

        public void PlotLine​(double[] xys,
                             int color)
        plots a line, connecting all pixels between the points defined by the list of x,y,x,y... pairs with the provided color
      • PlotLine

        public void PlotLine​(double[] xys,
                             int color,
                             double scale)
        plots a line, connecting all pixels between the points defined by the list of x,y,x,y... pairs with the provided color. the coordinates will be multiplied by the scale parameter
      • PlotLine

        public void PlotLine​(double[] xys,
                             int color,
                             int startPoint,
                             int endPoint)
        plots a line, connecting all pixels between the points defined by the list of x,y,x,y... beginning with pair startPoint and ending with pair endPoint pairs with the provided color.
      • PlotLine

        public void PlotLine​(double[] xys,
                             int color,
                             int startPoint,
                             int endPoint,
                             double scale)
        plots a line, connecting all pixels between the points defined by the list of x,y,x,y... beginning with pair startPoint and ending with pair endPoint pairs with the provided color. the coordinates will be multiplied by the scale parameter
      • PlotLine

        public void PlotLine​(double[] xys,
                             int color,
                             int startPoint,
                             int endPoint,
                             double scaleX,
                             double scaleY)
        plots a line, connecting all pixels between the points defined by the list of x,y,x,y... beginning with pair startPoint and ending with pair endPoint pairs with the provided color. the coordinates will be multiplied by the scale parameters
      • PlotLine

        public void PlotLine​(double[] xs,
                             double[] ys,
                             int color)
        plots a line, connecting all pixels between the points defined by the x,y pairs from the xs and ys array with the provided color
      • PlotLine

        public void PlotLine​(double[] xs,
                             double[] ys,
                             int color,
                             double scale)
        plots a line, connecting all pixels between the points defined by the x,y pairs from the xs and ys array with the provided color.
      • PlotLine

        public void PlotLine​(double[] xs,
                             double[] ys,
                             int color,
                             int startPoint,
                             int endPoint,
                             double scale)
        plots a line, connecting all pixels between the points defined by the x,y pairs with the provided color. the coordinates will be multiplied by the scale parameter beginning with pair startPoint and ending with pair endPoint
      • PlotLine

        public void PlotLine​(double[] xs,
                             double[] ys,
                             int color,
                             int startPoint,
                             int endPoint)
        plots a line, connecting all pixels between the points defined by the x,y pairs with the provided color. beginning with pair startPoint and ending with pair endPoint
      • PlotLine

        public void PlotLine​(double[] xs,
                             double[] ys,
                             int color,
                             int startPoint,
                             int endPoint,
                             double scaleX,
                             double scaleY)
        plots a line, connecting all pixels between the points defined by the x,y pairs with the provided color. the coordinates will be multiplied by the scale parametesr beginning with pair startPoint and ending with pair endPoint
      • compX

        public int compX()
        gets the xDim component of the vis window
        Specified by:
        compX in interface GuiComp
      • compY

        public int compY()
        gets the yDim component of the vis window
        Specified by:
        compY in interface GuiComp
      • IsActive

        public boolean IsActive()
        returns whether the UIGrid is active (whether it exists)
        Specified by:
        IsActive in interface GuiComp
      • SetActive

        public void SetActive​(boolean isActive)
        can be used to inactivate the component, preventing drawing and other overhead
        Specified by:
        SetActive in interface GuiComp
      • ClickXpt

        public double ClickXpt​(java.awt.event.MouseEvent e)
        gets the X coordinate of the mouse event in terms of the UIGrid coordinate space, useful with AddMouseListeners
      • ClickXsq

        public int ClickXsq​(java.awt.event.MouseEvent e)
        gets the X square of the mouse event in terms of the UIGrid coordinate space, useful with AddMouseListeners
      • ClickYpt

        public double ClickYpt​(java.awt.event.MouseEvent e)
        gets the Y coordinate of the mouse event in terms of the UIGrid coordinate space, useful with AddMouseListeners
      • ClickYsq

        public int ClickYsq​(java.awt.event.MouseEvent e)
        gets the Y square of the mouse event in terms of the UIGrid coordinate space, useful with AddMouseListeners
      • AddMouseListeners

        public void AddMouseListeners​(java.awt.event.MouseAdapter mouseListener)
        adds a mouse listener function to the UIGrid that will be called whenever the user interacts with the UIGrid
      • SetAll

        public void SetAll​(Coords2DColor DrawPix)
        sets every pixel in the UIGrid using the DrawPix function
      • DrawPDEGrid

        public void DrawPDEGrid​(PDEGrid2D drawMe,
                                DoubleToInt ColorFn)
        sets every pixel in the UIGrid by reading values from the PDEGrid2D
      • DrawPDEGridXY

        public void DrawPDEGridXY​(PDEGrid3D drawMe,
                                  DoubleToInt ColorFn)
        sets every pixel in the UIGrid by reading values from the PDEGrid3D, values are summed over the Z dimension
      • DrawPDEGridYZ

        public void DrawPDEGridYZ​(PDEGrid3D drawMe,
                                  DoubleToInt ColorFn)
        sets every pixel in the UIGrid by reading values from the PDEGrid3D, values are summed over the X dimension
      • DrawPDEGridXZ

        public void DrawPDEGridXZ​(PDEGrid3D drawMe,
                                  DoubleToInt ColorFn)
        sets every pixel in the UIGrid by reading values from the PDEGrid3D, values are summed over the Y dimension
      • DrawAgents

        public <Q extends AgentBaseSpatial,​T extends AgentGrid2D<Q>> void DrawAgents​(T drawMe,
                                                                                           AgentToColorInt<Q> ColorFn,
                                                                                           Coords2DInt backgroundColor)
        sets every pixel in the UIGrid by iterating over the AgentGrid2D and drawing the first agent found at each position. the background color will be used when no agent exists
      • DrawAgents

        public <Q extends AgentBaseSpatial,​T extends AgentGrid2D<Q>> void DrawAgents​(T drawMe,
                                                                                           AgentToColorInt<Q> ColorFn)
        sets every pixel in the UIGrid by iterating over the AgentGrid2D and drawing the first agent found at each position. positions with no agent will be skipped
      • DrawClosestAgentsXY

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawClosestAgentsXY​(T drawMe,
                                                                                                    AgentToColorInt<Q> ColorFn,
                                                                                                    Coords2DInt backgroundColor)
        sets every pixel in the UIGrid by drawing the closest agent (agent with lowest Z value) at each X,Y pair, the background color will be used when no agent is found
      • DrawClosestAgentsXZ

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawClosestAgentsXZ​(T drawMe,
                                                                                                    AgentToColorInt<Q> ColorFn,
                                                                                                    Coords2DInt backgroundColor)
        sets every pixel in the UIGrid by drawing the closest agent (agent with lowest Y value) at each X,Z pair, the background color will be used when no agent is found
      • DrawClosestAgentsYZ

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawClosestAgentsYZ​(T drawMe,
                                                                                                    AgentToColorInt<Q> ColorFn,
                                                                                                    Coords2DInt backgroundColor)
        sets every pixel in the UIGrid by drawing the closest agent (agent with lowest X value) at each Y,Z pair, the background color will be used when no agent is found
      • DrawFurthestAgentsXY

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawFurthestAgentsXY​(T drawMe,
                                                                                                     AgentToColorInt<Q> ColorFn,
                                                                                                     Coords2DInt backgroundColor)
        sets every pixel in the UIGrid by drawing the furthest agent (agent with highest Z value) at each X,Y pair, the background color will be used when no agent is found
      • DrawFurthestAgentsXZ

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawFurthestAgentsXZ​(T drawMe,
                                                                                                     AgentToColorInt<Q> ColorFn,
                                                                                                     Coords2DInt backgroundColor)
        sets every pixel in the UIGrid by drawing the furthest agent (agent with highest Y value) at each X,Z pair, the background color will be used when no agent is found
      • DrawFurthestAgentsYZ

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawFurthestAgentsYZ​(T drawMe,
                                                                                                     AgentToColorInt<Q> ColorFn,
                                                                                                     Coords2DInt backgroundColor)
        sets every pixel in the UIGrid by drawing the furthest agent (agent with highest X value) at each Y,Z pair, the background color will be used when no agent is found
      • DrawClosestAgentsXY

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawClosestAgentsXY​(T drawMe,
                                                                                                    AgentToColorInt<Q> ColorFn)
        sets every pixel in the UIGrid by drawing the closest agent (agent with lowest Z value) at each X,Y pair, positions with no agent will be skipped
      • DrawClosestAgentsXZ

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawClosestAgentsXZ​(T drawMe,
                                                                                                    AgentToColorInt<Q> ColorFn)
        sets every pixel in the UIGrid by drawing the closest agent (agent with lowest Y value) at each X,Z pair, positions with no agent will be skipped
      • DrawClosestAgentsYZ

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawClosestAgentsYZ​(T drawMe,
                                                                                                    AgentToColorInt<Q> ColorFn)
        sets every pixel in the UIGrid by drawing the closest agent (agent with lowest X value) at each Y,Z pair, positions with no agent will be skipped
      • DrawFurthestAgentsXY

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawFurthestAgentsXY​(T drawMe,
                                                                                                     AgentToColorInt<Q> ColorFn)
        sets every pixel in the UIGrid by drawing the furthest agent (agent with highest Z value) at each X,Y pair, positions with no agent will be skipped
      • DrawFurthestAgentsXZ

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawFurthestAgentsXZ​(T drawMe,
                                                                                                     AgentToColorInt<Q> ColorFn)
        sets every pixel in the UIGrid by drawing the furthest agent (agent with highest Y value) at each X,Z pair, positions with no agent will be skipped
      • DrawFurthestAgentsYZ

        public <Q extends AgentBaseSpatial,​T extends AgentGrid3D<Q>> void DrawFurthestAgentsYZ​(T drawMe,
                                                                                                     AgentToColorInt<Q> ColorFn)
        sets every pixel in the UIGrid by drawing the furthest agent (agent with highest X value) at each Y,Z pair, positions with no agent will be skipped
      • ToPNG

        public void ToPNG​(java.lang.String path)
        saves the current state image to a PNG
      • ToJPG

        public void ToJPG​(java.lang.String path)
        saves the current state image to a JPG
      • ToGIF

        public void ToGIF​(java.lang.String path)
        saves the current state image to a GIF
      • SetString

        public void SetString​(java.lang.String s,
                              int xLeft,
                              int yTop,
                              int color,
                              int bkColor)
        draws a string to the UIGrid on a single line. will crash if the UIGrid is too short
      • SetString

        public void SetString​(java.lang.String s,
                              int xLeft,
                              int yTop,
                              int color,
                              int bkColor,
                              int charsPerLine,
                              int maxLines)
      • SetString

        public void SetString​(java.lang.String s,
                              int xLeft,
                              int yTop,
                              int color,
                              int bkColor,
                              int charsPerLine)
      • SetPixRect

        public void SetPixRect​(int color,
                               int xLeft,
                               int xRight,
                               int yBottom,
                               int yTop)
      • Legend

        public void Legend​(java.lang.String[] labels,
                           int[] colors,
                           int labelsColor,
                           int bkColor,
                           int xLeft,
                           int yTop)
      • SetChar

        public void SetChar​(char c,
                            int xLeft,
                            int yTop,
                            int color,
                            int bkColor)
        draws a single character to the UIGrid
      • _GetComps

        public void _GetComps​(java.util.ArrayList<java.awt.Component> putHere,
                              java.util.ArrayList<java.lang.Integer> coordsHere,
                              java.util.ArrayList<java.lang.Integer> compSizesHere)
        called by the UIWindow class to place the vis window
        Specified by:
        _GetComps in interface GuiComp
      • Xdim

        public int Xdim()
        Specified by:
        Xdim in interface Grid2D
      • Ydim

        public int Ydim()
        Specified by:
        Ydim in interface Grid2D
      • Length

        public int Length()
        Specified by:
        Length in interface Grid2D
      • IsWrapX

        public boolean IsWrapX()
        Specified by:
        IsWrapX in interface Grid2D
      • IsWrapY

        public boolean IsWrapY()
        Specified by:
        IsWrapY in interface Grid2D