com.esri.map
Class Grid

java.lang.Object
  extended by com.esri.map.Grid

public class Grid
extends Object

This class allows you to control the display of a grid on a JMap by setting its type and visibility.


Nested Class Summary
static class Grid.GridType
           
 
Method Summary
 Color getLabelColor(int gridLevel)
          Gets the label background color for a given grid level
 boolean getLabelVisibility()
          Gets the visibility of the labels for all grid levels.
 int getLevelCount()
          Returns the number of levels in a Grid.
 Color getLineColor(int gridLevel)
          Gets the line color for a given grid level.
 int getLineWidth(int gridLevel)
          Gets the line width in pixels for a given grid level.
 Grid.GridType getType()
          Returns the type of the grid.
 boolean getVisibility()
          Returns the visibility of the grid
 void setLabelColor(int gridLevel, Color color)
          Sets the label background color for a given grid level.
 void setLabelVisility(boolean visibility)
          Sets the visibility of the labels for all grid levels.
 void setLineColor(int gridLevel, Color color)
          Sets the line color for a given grid level.
 void setLineWidth(int gridLevel, int width)
          Sets the line width in pixels for a given grid level.
 void setType(Grid.GridType gridType)
           Sets the type of grid displayed on the map.
 void setVisibility(boolean visibility)
          Sets the visibility of the grid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setType

public void setType(Grid.GridType gridType)

Sets the type of grid displayed on the map.
The default grid type is "None".

Parameters:
gridType - the Grid.GridType of the grid

getType

public Grid.GridType getType()
Returns the type of the grid.

Returns:
the Grid.GridType

getVisibility

public boolean getVisibility()
Returns the visibility of the grid

Returns:
true if the grid is visible, false otherwise

setVisibility

public void setVisibility(boolean visibility)
Sets the visibility of the grid.
The default is true.

Parameters:
visibility - the visibility to set

getLevelCount

public int getLevelCount()
Returns the number of levels in a Grid. The style of each grid level can be changed.

Returns:
number of levels in the grid

setLabelVisility

public void setLabelVisility(boolean visibility)
Sets the visibility of the labels for all grid levels.

Parameters:
visibility - true for visible, false to hide

getLabelVisibility

public boolean getLabelVisibility()
Gets the visibility of the labels for all grid levels.

Returns:
true for visible, false for hidden

setLineColor

public void setLineColor(int gridLevel,
                         Color color)
Sets the line color for a given grid level.

Parameters:
gridLevel - grid level to set color for
color - color to set

getLineColor

public Color getLineColor(int gridLevel)
Gets the line color for a given grid level.

Parameters:
gridLevel - grid level to get color from
Returns:
color of given grid level

setLabelColor

public void setLabelColor(int gridLevel,
                          Color color)
Sets the label background color for a given grid level.

Parameters:
gridLevel - grid level to set color for
color - color to set

getLabelColor

public Color getLabelColor(int gridLevel)
Gets the label background color for a given grid level

Parameters:
gridLevel - grid level to get color from
Returns:
color of given grid level's label background

getLineWidth

public int getLineWidth(int gridLevel)
Gets the line width in pixels for a given grid level.

Parameters:
gridLevel - level to get line width from
Returns:
line width in pixels of given grid level

setLineWidth

public void setLineWidth(int gridLevel,
                         int width)
Sets the line width in pixels for a given grid level.

Parameters:
gridLevel - level to set line width for
width - width to set in pixels


Copyright © 2012. All Rights Reserved.