Package org.baseagent.ui
Class GridCanvasContext
java.lang.Object
org.baseagent.ui.GridCanvasContext
-
Constructor Summary
ConstructorsConstructorDescriptionGridCanvasContext(Simulation simulation, Grid grid, GridCanvas gridCanvas, int cellWidth, int cellHeight, int cellXSpacing, int cellYSpacing) -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeZoom(double delta) intintintintList<javafx.scene.paint.Color>javafx.scene.canvas.GraphicsContextgetGrid()doubleReturns a factor of (the cell width plus the cell X spacing) times the zoom.doubleReturns a factor of (the cell height plus the cell Y spacing) times the zoom.doublegetZoom()voidsetCellHeight(int cellHeight) voidsetCellWidth(int cellWidth) voidsetCellXSpacing(int cellXSpacing) voidsetCellYSpacing(int cellYSpacing) voidsetColorPalette(List<javafx.scene.paint.Color> colors) voidsetGraphicsContext(javafx.scene.canvas.GraphicsContext gc) voidsetProperties(Map<String, Object> props) voidsetZoom(double zoom)
-
Constructor Details
-
GridCanvasContext
public GridCanvasContext(Simulation simulation, Grid grid, GridCanvas gridCanvas, int cellWidth, int cellHeight, int cellXSpacing, int cellYSpacing)
-
-
Method Details
-
getSimulation
-
getGrid
-
getGridCanvas
-
getCellWidth
public int getCellWidth() -
setCellWidth
public void setCellWidth(int cellWidth) -
getCellHeight
public int getCellHeight() -
setCellHeight
public void setCellHeight(int cellHeight) -
getCellXSpacing
public int getCellXSpacing() -
setCellXSpacing
public void setCellXSpacing(int cellXSpacing) -
getCellYSpacing
public int getCellYSpacing() -
setCellYSpacing
public void setCellYSpacing(int cellYSpacing) -
getXFactor
public double getXFactor()Returns a factor of (the cell width plus the cell X spacing) times the zoom. -
getYFactor
public double getYFactor()Returns a factor of (the cell height plus the cell Y spacing) times the zoom. -
setGraphicsContext
public void setGraphicsContext(javafx.scene.canvas.GraphicsContext gc) -
getGraphicsContext
public javafx.scene.canvas.GraphicsContext getGraphicsContext() -
setColorPalette
-
getColorPalette
-
setProperties
-
getProperties
-
setZoom
public void setZoom(double zoom) -
getZoom
public double getZoom() -
changeZoom
public void changeZoom(double delta)
-