|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display2d.TriangularByteLattice
public class TriangularByteLattice
A TriangularByteLattice is an array where each array element can assume one of 256 values. Values can be set between -128 and 127. Because byte values larger than 127 overflow to negative, values can also be set between 0 and 255.
Constructor Summary | |
---|---|
TriangularByteLattice(int _row,
int _col)
Constructs a byte lattice with the given size. |
Method Summary | |
---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws the lattice. |
int |
getCell(int row,
int col)
Gets a lattice cell value. |
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. |
boolean |
isMeasured()
Determines if information is available to set min/max values. |
void |
randomize()
Ranomizes the lattice values. |
void |
setBlock(int row_offset,
int col_offset,
byte[][] val)
Sets a block of cells to new values. |
void |
setCell(int row,
int col,
byte val)
Sets a lattice cell to a new value. |
void |
setCol(int row_offset,
int col,
byte[] val)
Sets a column of cells to new values. |
void |
setColorPalette(java.awt.Color[] colors)
Sets the color palette. |
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)
|
void |
setRow(int row,
int col_offset,
byte[] val)
Sets a row of cells to new values. |
void |
showLegend()
Shows the color associated with each value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TriangularByteLattice(int _row, int _col)
_row
- the number of rows_col
- the number of columnsMethod Detail |
---|
public void setMinMax(double xmin, double xmax, double ymin, double ymax)
public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
panel
- g
- public void setBlock(int row_offset, int col_offset, byte[][] val)
row_offset
- col_offset
- val
- public void setCol(int row_offset, int col, byte[] val)
row_offset
- col
- val
- public void setRow(int row, int col_offset, byte[] val)
row
- col_offset
- val
- public void setCell(int row, int col, byte val)
row
- col
- val
- public int getCell(int row, int col)
row
- col
-
public void randomize()
public void showLegend()
public void setColorPalette(java.awt.Color[] colors)
colors
- public void setIndexedColor(int i, java.awt.Color color)
i
- color
- public boolean isMeasured()
Measurable
isMeasured
in interface Measurable
public double getXMin()
Measurable
getXMin
in interface Measurable
public double getYMin()
Measurable
getYMin
in interface Measurable
public double getXMax()
Measurable
getXMax
in interface Measurable
public double getYMax()
Measurable
getYMax
in interface Measurable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |