Drawable, Measurable, ByteLatticepublic class CellLatticePC extends MeasuredImage implements ByteLattice
| Constructor | Description |
|---|---|
CellLatticePC() |
Constructs a cell lattice.
|
CellLatticePC(int _nx,
int _ny) |
Constructs a cell lattice with the given size.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
createDefaultColors() |
Creates the default palette.
|
SiteLattice |
createSiteLattice() |
Creates a new SiteLattice containing the same data as this lattice.
|
void |
draw(DrawingPanel panel,
java.awt.Graphics g) |
Draws the lattice and the grid.
|
int |
getNx() |
Gets the number of x entries.
|
int |
getNy() |
Gets the number of y entries.
|
byte |
getValue(int ix,
int iy) |
Gets a value from the given location.
|
int |
indexFromPoint(double x,
double y) |
Determines the lattice index (row-major order) from given x and y world coordinates
Returns -1 if the world coordinates are outside the lattice.
|
void |
randomize() |
Randomizes the lattice values.
|
void |
resizeLattice(int _nx,
int _ny) |
Resizes the lattice using the given number of x and y entries.
|
void |
setAll(byte[][] val) |
Sets a block of data to new values.
|
void |
setAll(byte[][] val,
double xmin,
double xmax,
double ymin,
double ymax) |
Sets the lattice values and scale.
|
void |
setBlock(byte[][] val) |
Sets a block of data starting at (0,0) to new values.
|
void |
setBlock(int ix_offset,
int iy_offset,
byte[][] val) |
Sets a block of data to byte values.
|
void |
setBlock(int ix_offset,
int iy_offset,
int[][] val) |
Sets a block of data to integer values.
|
void |
setCol(int ix,
int iy_offset,
byte[] val) |
Sets a column to new values.
|
void |
setColorPalette(java.awt.Color[] colors) |
Sets the color palette.
|
void |
setGridLineColor(java.awt.Color color) |
Sets the grid color.
|
void |
setIndexedColor(int i,
java.awt.Color color) |
Sets the color for a single index.
|
void |
setMinMax(double xmin,
double xmax,
double ymin,
double ymax) |
Assigns a scale to the lattice in world units.
|
void |
setRow(int iy,
int ix_offset,
byte[] val) |
Sets a row to new values.
|
void |
setShowGridLines(boolean showGridLines) |
Outlines the lattice boundaries with a grid.
|
void |
setValue(int ix,
int iy,
byte val) |
Sets the given x,y location to a value.
|
void |
setXMax(double _value) |
Sets xmax.
|
void |
setXMin(double _value) |
Sets xmin.
|
void |
setYMax(double _value) |
Sets ymax.
|
void |
setYMin(double _value) |
Sets ymin.
|
javax.swing.JFrame |
showLegend() |
Shows the color associated with each value.
|
int |
xToIndex(double x) |
Gets closest index from the given x world coordinate.
|
int |
yToIndex(double y) |
Gets closest index from the given y world coordinate.
|
setVisiblegetXMax, getXMin, getYMax, getYMin, isMeasuredgetImage, getXMax, getXMin, getYMax, getYMin, isMeasured, setImage, setVisiblepublic CellLatticePC()
public CellLatticePC(int _nx,
int _ny)
_nx - the number of values in x direction_ny - the number of values in y directionpublic SiteLattice createSiteLattice()
public void resizeLattice(int _nx,
int _ny)
resizeLattice in interface ByteLattice_nx - the number of x entries_ny - the number of y entriespublic void setXMin(double _value)
ByteLatticesetXMin in interface ByteLatticesetXMin in class MeasuredImage_value - doublepublic void setXMax(double _value)
ByteLatticesetXMax in interface ByteLatticesetXMax in class MeasuredImage_value - doublepublic void setYMin(double _value)
ByteLatticesetYMin in interface ByteLatticesetYMin in class MeasuredImage_value - doublepublic void setYMax(double _value)
ByteLatticesetYMax in interface ByteLatticesetYMax in class MeasuredImage_value - doublepublic int getNx()
getNx in interface ByteLatticepublic int getNy()
getNy in interface ByteLatticepublic void setMinMax(double xmin,
double xmax,
double ymin,
double ymax)
setMinMax in interface ByteLatticesetMinMax in class MeasuredImagexmin - xmax - ymin - ymax - public void draw(DrawingPanel panel, java.awt.Graphics g)
draw in interface Drawabledraw in class MeasuredImagepanel - g - public void setAll(byte[][] val)
val - public void setAll(byte[][] val,
double xmin,
double xmax,
double ymin,
double ymax)
setAll in interface ByteLatticeval - int[][] the new valuesxmin - doublexmax - doubleymin - doubleymax - doublepublic void setBlock(byte[][] val)
setBlock in interface ByteLatticeval - public void setBlock(int ix_offset,
int iy_offset,
byte[][] val)
setBlock in interface ByteLatticeix_offset - the x offset into the latticeiy_offset - the y offset into the latticeval - the new valuespublic void setBlock(int ix_offset,
int iy_offset,
int[][] val)
ix_offset - the x offset into the latticeiy_offset - the y offset into the latticeval - the new valuespublic void setCol(int ix,
int iy_offset,
byte[] val)
setCol in interface ByteLatticeix - the x index of the columniy_offset - the y offset in the columnval - values in columnpublic void setRow(int iy,
int ix_offset,
byte[] val)
setRow in interface ByteLatticeiy - the y index of the rowix_offset - the x offset in the rowval - public void setValue(int ix,
int iy,
byte val)
setValue in interface ByteLatticeix - iy - val - public byte getValue(int ix,
int iy)
getValue in interface ByteLatticeix - iy - public int indexFromPoint(double x,
double y)
indexFromPoint in interface ByteLatticex - y - public int xToIndex(double x)
xToIndex in interface ByteLatticex - double the coordinatepublic int yToIndex(double y)
yToIndex in interface ByteLatticey - double the coordinatepublic void setShowGridLines(boolean showGridLines)
setShowGridLines in interface ByteLatticeshowGridLines - public void randomize()
randomize in interface ByteLatticepublic javax.swing.JFrame showLegend()
showLegend in interface ByteLatticepublic void setColorPalette(java.awt.Color[] colors)
setColorPalette in interface ByteLatticecolors - public void setGridLineColor(java.awt.Color color)
setGridLineColor in interface ByteLatticecolor - public void setIndexedColor(int i,
java.awt.Color color)
setIndexedColor in interface ByteLatticei - color - public void createDefaultColors()
createDefaultColors in interface ByteLattice