public class DisplayBox extends Display
Modifier and Type | Field | Description |
---|---|---|
int[] |
align |
|
protected AtomTest |
atomTestDoDisplay |
|
static int |
BOTTOM |
|
DisplayCanvas |
canvas |
|
static int |
CENTER |
|
protected int[] |
centralOrigin |
Coordinate origin for central image
Explicit to 2D because drawing is done to 2D image
|
protected ColorScheme |
colorScheme |
|
protected Controller |
controller |
|
protected DiameterHash |
diameterHash |
|
protected boolean |
displayBoundary |
|
protected int[] |
drawSize |
Size of drawing region of central image, in pixels
|
static int |
LEFT |
|
static int |
RIGHT |
|
protected double |
scale |
Factor used to scale the size of the image.
|
protected Simulation |
sim |
|
static int |
TOP |
Constructor | Description |
---|---|
DisplayBox(Simulation sim,
Box box) |
Warning: after instantiation, clients using G3DSys may need to toggle
display.canvas.setVisible false and then true to fix the 'sometimes
gray' bug.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addDrawable(Drawable obj) |
|
void |
addDrawable(java.lang.Object obj) |
|
void |
computeImageParameters() |
|
void |
computeImageParameters2(int w,
int h) |
|
int |
getAlign(int i) |
|
AtomTest |
getAtomTestDoDisplay() |
Accessor method for the atom filter that determines which atoms
are displayed.
|
Box |
getBox() |
|
ColorScheme |
getColorScheme() |
Accessor method for the color scheme used for this display
|
DiameterHash |
getDiameterHash() |
Returns the DiameterHash used by this DisplayBox.
|
java.util.LinkedList |
getDrawables() |
|
int |
getDrawingHeight() |
return int : height of the drawing area (only relevant for 1D)
|
boolean |
getDrawOverflow() |
|
int[] |
getDrawSize() |
|
int |
getImageShells() |
|
int[] |
getOrigin() |
|
double |
getPaddingSigma() |
Returns the amount of padding added around the edge of the drawing area.
|
Pixel |
getPixelUnit() |
|
boolean |
getResizeOnNewBox() |
Get the flag indicating whether the graphic should resize from its
currently displayed size when a new box is set.
|
double |
getScale() |
|
boolean |
getShowBoundary() |
Get the flag indicating if the boundary should be drawn.
|
java.awt.Dimension |
getSize() |
Gets the size of the box graphic.
|
double |
getToPixels() |
|
java.awt.Component |
graphic() |
Simulation.GraphicalElement interface method.
|
void |
removeDrawable(Drawable obj) |
|
void |
removeDrawable(java.lang.Object obj) |
|
void |
repaint() |
Repaint the graphic associated with the display box.
|
void |
setAlign(int i,
int value) |
|
void |
setAtomTestDoDisplay(AtomTest atomTest) |
Mutator method for the atom filter that determines which atoms
are displayed.
|
void |
setBox(Box p) |
Specifies the box for this display.
|
void |
setBoxCanvas(DisplayCanvas boxCanvas) |
|
void |
setColorScheme(ColorScheme colorScheme) |
Mutator method for the color scheme used for this display
|
void |
setDiameterHash(DiameterHash newDiameterManager) |
Sets the DiameterHash used by this DisplayBox.
|
void |
setDrawingHeight(int newDrawingHeight) |
Set the height of the drawing area (only relevant for 1D)
|
void |
setDrawOverflow(boolean b) |
|
void |
setImageShells(int n) |
Changes the value of image shells, and increases/decreases scale accordingly.
|
void |
setOriginShift(int dimension,
int shift) |
Amount (in pixels) of a simple shift (translation) applied in determing origin.
|
void |
setPaddingSigma(double sigma) |
Sets the amount of padding added around the edge of the drawing area.
|
void |
setPixelUnit(Pixel pixel) |
Sets unit for conversion between simulation units and display pixels.
|
void |
setResizeOnNewBox(boolean b) |
Set the flag indicating whether the graphic should resize from its
currently displayed size when a new box is set.
|
void |
setScale(double s) |
|
void |
setShowBoundary(boolean b) |
Set the flag indicating if the boundary should be drawn.
|
addPropertyChangeListener, getLabel, removePropertyChangeListener, setLabel, toString
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
protected ColorScheme colorScheme
protected DiameterHash diameterHash
protected AtomTest atomTestDoDisplay
protected boolean displayBoundary
protected final Simulation sim
public DisplayCanvas canvas
public final int[] align
protected final int[] drawSize
computeImageParameters()
protected double scale
protected final int[] centralOrigin
protected final Controller controller
public DisplayBox(Simulation sim, Box box)
box
- public java.awt.Dimension getSize()
public void setOriginShift(int dimension, int shift)
Dimension : 0 : X direction 1 : Y direction 2 : Z direction (not used)
public int[] getOrigin()
public int[] getDrawSize()
public void setAlign(int i, int value)
public int getAlign(int i)
public final boolean getDrawOverflow()
public final void setDrawOverflow(boolean b)
public double getToPixels()
public void setScale(double s)
public double getScale()
public void addDrawable(Drawable obj)
public void removeDrawable(Drawable obj)
public void addDrawable(java.lang.Object obj)
public void removeDrawable(java.lang.Object obj)
public final Box getBox()
public double getPaddingSigma()
public void setPaddingSigma(double sigma)
public void setBox(Box p)
public void setBoxCanvas(DisplayCanvas boxCanvas)
public void setColorScheme(ColorScheme colorScheme)
public ColorScheme getColorScheme()
public DiameterHash getDiameterHash()
public void setDiameterHash(DiameterHash newDiameterManager)
public void setAtomTestDoDisplay(AtomTest atomTest)
public AtomTest getAtomTestDoDisplay()
public java.util.LinkedList getDrawables()
public java.awt.Component graphic()
public int getImageShells()
public void setImageShells(int n)
n
- the new value of imageShellspublic void computeImageParameters()
public void computeImageParameters2(int w, int h)
w
- h
- public void repaint()
public Pixel getPixelUnit()
public void setPixelUnit(Pixel pixel)
pixel
- :public void setDrawingHeight(int newDrawingHeight)
newDrawingHeight
- :public int getDrawingHeight()
public void setShowBoundary(boolean b)
b
- : draw boundary flagpublic boolean getShowBoundary()
public void setResizeOnNewBox(boolean b)
b
- public boolean getResizeOnNewBox()