Drawable, Measurable, ByteLatticepublic class CellLattice extends java.lang.Object implements ByteLattice
| Constructor | Description |
|---|---|
CellLattice() |
Constructor CellLattice
|
CellLattice(int nx,
int ny) |
Constructor CellLattice
|
| 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 a representation of an object in a drawing panel.
|
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.
|
double |
getXMax() |
Gets the maximum x needed to draw this object.
|
double |
getXMin() |
Gets the minimum x needed to draw this object.
|
double |
getYMax() |
Gets the maximum y needed to draw this object.
|
double |
getYMin() |
Gets the minimum y needed to draw this object.
|
int |
indexFromPoint(double x,
double y) |
Determines the lattice index (row-major order) from given x and y world coordinates.
|
boolean |
isMeasured() |
Determines if information is available to set min/max values.
|
void |
randomize() |
Randomizes the values.
|
void |
resizeLattice(int nx,
int ny) |
Resizes the lattice.
|
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 new values.
|
void |
setBlock(int ix_offset,
int iy_offset,
int[][] val) |
Sets a block of cells using 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 c) |
Sets the color for grid line boundaries
|
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 show) |
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 |
setVisible(boolean isVisible) |
Sets the visibility of the lattice.
|
void |
setXMax(double xmax) |
Sets xmax.
|
void |
setXMin(double xmin) |
Sets xmin.
|
void |
setYMax(double ymax) |
Sets ymax.
|
void |
setYMin(double ymin) |
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.
|
public CellLattice()
public CellLattice(int nx,
int ny)
nx - ny - public double getXMin()
MeasurablegetXMin in interface Measurablepublic double getXMax()
MeasurablegetXMax in interface Measurablepublic double getYMin()
MeasurablegetYMin in interface Measurablepublic double getYMax()
MeasurablegetYMax in interface Measurablepublic boolean isMeasured()
MeasurableisMeasured in interface Measurablepublic void draw(DrawingPanel panel, java.awt.Graphics g)
Drawablepublic int getNx()
ByteLatticegetNx in interface ByteLatticepublic int getNy()
ByteLatticegetNy in interface ByteLatticepublic int indexFromPoint(double x,
double y)
ByteLatticeindexFromPoint in interface ByteLatticepublic int xToIndex(double x)
ByteLatticexToIndex in interface ByteLatticex - double the coordinatepublic int yToIndex(double y)
ByteLatticeyToIndex in interface ByteLatticey - double the coordinatepublic byte getValue(int ix,
int iy)
ByteLatticegetValue in interface ByteLatticepublic void setValue(int ix,
int iy,
byte val)
ByteLatticesetValue in interface ByteLatticepublic void randomize()
ByteLatticerandomize in interface ByteLatticepublic void resizeLattice(int nx,
int ny)
ByteLatticeresizeLattice in interface ByteLatticepublic 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(int ix_offset,
int iy_offset,
byte[][] val)
ByteLatticesetBlock in interface ByteLatticeix_offset - the x offset into the latticeiy_offset - the y offset into the latticepublic void setBlock(byte[][] val)
ByteLatticesetBlock in interface ByteLatticepublic void setCol(int ix,
int iy_offset,
byte[] val)
ByteLatticesetCol 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)
ByteLatticesetRow in interface ByteLatticeiy - the y index of the rowix_offset - the x offset in the rowpublic void setShowGridLines(boolean show)
ByteLatticesetShowGridLines in interface ByteLatticepublic void setGridLineColor(java.awt.Color c)
ByteLatticesetGridLineColor in interface ByteLatticepublic javax.swing.JFrame showLegend()
ByteLatticeshowLegend in interface ByteLatticepublic void setVisible(boolean isVisible)
ByteLatticesetVisible in interface ByteLatticepublic void setColorPalette(java.awt.Color[] colors)
ByteLatticesetColorPalette in interface ByteLatticepublic void setIndexedColor(int i,
java.awt.Color color)
ByteLatticesetIndexedColor in interface ByteLatticepublic void setMinMax(double xmin,
double xmax,
double ymin,
double ymax)
ByteLatticesetMinMax in interface ByteLatticepublic SiteLattice createSiteLattice()
public void setBlock(int ix_offset,
int iy_offset,
int[][] val)
ix_offset - intiy_offset - intval - int[][]public void setXMin(double xmin)
ByteLatticesetXMin in interface ByteLatticexmin - doublepublic void setXMax(double xmax)
ByteLatticesetXMax in interface ByteLatticexmax - doublepublic void setYMin(double ymin)
ByteLatticesetYMin in interface ByteLatticeymin - doublepublic void setYMax(double ymax)
ByteLatticesetYMax in interface ByteLatticeymax - doublepublic void createDefaultColors()
ByteLatticecreateDefaultColors in interface ByteLattice