Package org.baseagent.ui
Class GridCanvasContext
java.lang.Object
org.baseagent.ui.GridCanvasContext
-
Constructor Summary
ConstructorDescriptionGridCanvasContext
(Simulation simulation, Grid grid, GridCanvas gridCanvas, int cellWidth, int cellHeight, int cellXSpacing, int cellYSpacing) -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeZoom
(double delta) int
int
int
int
List<javafx.scene.paint.Color>
javafx.scene.canvas.GraphicsContext
getGrid()
double
Returns a factor of (the cell width plus the cell X spacing) times the zoom.double
Returns a factor of (the cell height plus the cell Y spacing) times the zoom.double
getZoom()
void
setCellHeight
(int cellHeight) void
setCellWidth
(int cellWidth) void
setCellXSpacing
(int cellXSpacing) void
setCellYSpacing
(int cellYSpacing) void
setColorPalette
(List<javafx.scene.paint.Color> colors) void
setGraphicsContext
(javafx.scene.canvas.GraphicsContext gc) void
setProperties
(Map<String, Object> props) void
setZoom
(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)
-