org.primordion.xholon.io
Interface IGridPanel

All Known Implementing Classes:
GridPanel, GridPanel__XholonTemplate__, GridPanel09SpatialGames, GridPanel1dSimple, GridPanelAntForaging, GridPanelAntTrail, GridPanelBrenda, GridPanelCombo, GridPanelGameOfLife, GridPanelHex, GridPanelRcs_GP_FSM_Grid, GridPanelStupidModel1, GridPanelStupidModel10, GridPanelStupidModel11, GridPanelStupidModel12, GridPanelStupidModel13, GridPanelStupidModel14, GridPanelStupidModel15, GridPanelStupidModel16, GridPanelStupidModel16nl, GridPanelStupidModel2, GridPanelStupidModel3, GridPanelStupidModel4, GridPanelStupidModel5, GridPanelStupidModel5tg, GridPanelStupidModel6, GridPanelStupidModel7, GridPanelStupidModel8, GridPanelStupidModel9, GridPanelTurtleExample1, GridPanelWolfSheepGrass

public interface IGridPanel

A graphic panel in which to display 2D grids.

Since:
0.2 (Created on November 27, 2005)
Author:
Ken Webb

Field Summary
static int GPSHAPE_CIRCLE
           
static int GPSHAPE_HEXAGON
           
static int GPSHAPE_NOSHAPE
           
static int GPSHAPE_OCTOGON
           
static int GPSHAPE_PENTAGON
           
static int GPSHAPE_RECTANGLE
           
static int GPSHAPE_STAR
           
static int GPSHAPE_TRIANGLE
           
static int GPSHAPE_TURTLE
           
 
Method Summary
 int getCellSize()
          Get the size of a grid cell.
 java.awt.Color getColor(IXholon xhNode)
          Get the color that this xholon should currently be displayed as.
 java.awt.Graphics getGraphics()
          This is a method inherited by GridPanel from JPanel.
 IXholon getGridOwner()
          Get grid owner.
 int getNeighType()
          Get the neighborhood type, as defined in IGrid.
 int getNumCols()
          Get the number of columns in the grid.
 int getNumRows()
          Get the number of rows in the grid.
 int getShape(IXholon xhNode)
          Get the shape that should be used to represent this xholon.
 boolean getUseShapes()
          Get whether or not to use shapes to draw objects.
 void initGridPanel(IXholon gridOwner)
          Initialize the GridPanel.
 void paintComponent(java.awt.Graphics g)
           
 void setCellSize(int cellSize)
          Set the size of a grid cell.
 void setNeighType(int neighType)
          Set the neighborhood type, as defined in IGrid.
 void setUseShapes(boolean useShapes)
          Set whether or not to use shapes to draw objects.
 

Field Detail

GPSHAPE_NOSHAPE

public static final int GPSHAPE_NOSHAPE
See Also:
Constant Field Values

GPSHAPE_CIRCLE

public static final int GPSHAPE_CIRCLE
See Also:
Constant Field Values

GPSHAPE_TRIANGLE

public static final int GPSHAPE_TRIANGLE
See Also:
Constant Field Values

GPSHAPE_RECTANGLE

public static final int GPSHAPE_RECTANGLE
See Also:
Constant Field Values

GPSHAPE_PENTAGON

public static final int GPSHAPE_PENTAGON
See Also:
Constant Field Values

GPSHAPE_HEXAGON

public static final int GPSHAPE_HEXAGON
See Also:
Constant Field Values

GPSHAPE_OCTOGON

public static final int GPSHAPE_OCTOGON
See Also:
Constant Field Values

GPSHAPE_STAR

public static final int GPSHAPE_STAR
See Also:
Constant Field Values

GPSHAPE_TURTLE

public static final int GPSHAPE_TURTLE
See Also:
Constant Field Values
Method Detail

getGridOwner

public IXholon getGridOwner()
Get grid owner.

Returns:
Grid owner.

initGridPanel

public void initGridPanel(IXholon gridOwner)
Initialize the GridPanel.

Parameters:
gridOwner - Owner of the grid.

getNumRows

public int getNumRows()
Get the number of rows in the grid.

Returns:
The number of rows.

getNumCols

public int getNumCols()
Get the number of columns in the grid.

Returns:
The number of columns.

getCellSize

public int getCellSize()
Get the size of a grid cell.

Returns:
The size in pixels.

setCellSize

public void setCellSize(int cellSize)
Set the size of a grid cell.

Parameters:
cellSize - The size in pixels.

getUseShapes

public boolean getUseShapes()
Get whether or not to use shapes to draw objects.

Returns:
true or false

setUseShapes

public void setUseShapes(boolean useShapes)
Set whether or not to use shapes to draw objects.

Parameters:
useShapes - true or false

getNeighType

public int getNeighType()
Get the neighborhood type, as defined in IGrid.

Returns:
The neighborhood type.

setNeighType

public void setNeighType(int neighType)
Set the neighborhood type, as defined in IGrid.

Parameters:
neighType - The neighborhood type.

paintComponent

public void paintComponent(java.awt.Graphics g)

getGraphics

public java.awt.Graphics getGraphics()
This is a method inherited by GridPanel from JPanel.

Returns:
The Graphics object used to paint the grid.

getColor

public java.awt.Color getColor(IXholon xhNode)
Get the color that this xholon should currently be displayed as.

Parameters:
xhNode - An instance of Xholon.
Returns:
A color.

getShape

public int getShape(IXholon xhNode)
Get the shape that should be used to represent this xholon.

Parameters:
xhNode - An instance of Xholon.
Returns:
A shape identifier.