|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.graphics.Display
etomica.graphics.DisplayBox
public class DisplayBox
Displays a picture of a box, with configurations of molecules, boundaries, and other objects as appropriate, assuming 2-dimensional system. Instantiates a ConfigurationCanvas (an inner class of this one) for most of the work. DisplayBox is an input event (mouse and key) listener of the canvas. It receives these events and uses information from them to form and fire a DisplayBoxEvent to registered listeners.
| Field Summary | |
|---|---|
int[] |
align
|
protected AtomFilter |
atomFilter
|
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 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. |
static int |
TOP
|
| Fields inherited from class etomica.graphics.Display |
|---|
label, support |
| Constructor Summary | |
|---|---|
DisplayBox(ISimulation sim,
IBox box,
ISpace space,
Controller controller)
Warning: after instantiation, clients using G3DSys may need to toggle display.canvas.setVisible false and then true to fix the 'sometimes gray' bug. |
|
| Method Summary | |
|---|---|
void |
addDrawable(Drawable obj)
|
void |
addDrawable(Object obj)
|
void |
computeImageParameters()
|
void |
computeImageParameters2(int w,
int h)
|
int |
getAlign(int i)
|
AtomFilter |
getAtomFilter()
Accessor method for the atom filter that determines which atoms are displayed. |
IBox |
getBox()
|
ColorScheme |
getColorScheme()
Accessor method for the color scheme used for this display |
LinkedList |
getDrawables()
|
int |
getDrawingHeight()
return int : height of the drawing area (only relevant for 1D) |
boolean |
getDrawOverflow()
|
int[] |
getDrawSize()
|
static EtomicaInfo |
getEtomicaInfo()
Returns a very brief description of Etomica. |
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. |
Dimension |
getSize()
Gets the size of the box graphic. |
double |
getToPixels()
|
Component |
graphic(Object obj)
Simulation.GraphicalElement interface method. |
void |
removeDrawable(Drawable obj)
|
void |
removeDrawable(Object obj)
|
void |
repaint()
Repaint the graphic associated with the display box. |
void |
setAlign(int i,
int value)
|
void |
setAtomFilter(AtomFilter filter)
Mutator method for the atom filter that determines which atoms are displayed. |
void |
setBox(IBox p)
Specifies the box for this display. |
void |
setBoxCanvas(DisplayCanvas boxCanvas)
|
void |
setColorScheme(ColorScheme colorScheme)
Accessor method for the color scheme used for this display |
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. |
| Methods inherited from class etomica.graphics.Display |
|---|
addPropertyChangeListener, getLabel, graphic, removePropertyChangeListener, setLabel, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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 AtomFilter atomFilter
protected boolean displayBoundary
public DisplayCanvas canvas
public final int[] align
protected final int[] drawSize
#computeDrawSizeprotected double scale
protected final int[] centralOrigin
protected final Controller controller
| Constructor Detail |
|---|
public DisplayBox(ISimulation sim,
IBox box,
ISpace space,
Controller controller)
box - | Method Detail |
|---|
public static EtomicaInfo getEtomicaInfo()
public 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(Object obj)
public void removeDrawable(Object obj)
public final IBox getBox()
public double getPaddingSigma()
public void setPaddingSigma(double sigma)
public void setBox(IBox p)
public void setBoxCanvas(DisplayCanvas boxCanvas)
public void setColorScheme(ColorScheme colorScheme)
public ColorScheme getColorScheme()
public void setAtomFilter(AtomFilter filter)
public AtomFilter getAtomFilter()
public LinkedList getDrawables()
public Component graphic(Object obj)
graphic in interface GraphicalElementgraphic in class Displayobj - ignored by this method.
Device,
Displaypublic int getImageShells()
public void setImageShells(int n)
n - the new value of imageShellspublic void computeImageParameters()
public void computeImageParameters2(int w,
int h)
int - w :int - h :public void repaint()
repaint in class Displaypublic Pixel getPixelUnit()
public void setPixelUnit(Pixel pixel)
Pixel - :public void setDrawingHeight(int newDrawingHeight)
int - newDrawingHeight :public int getDrawingHeight()
public void setShowBoundary(boolean b)
boolean - b : draw boundary flagpublic boolean getShowBoundary()
public void setResizeOnNewBox(boolean b)
boolean - bpublic boolean getResizeOnNewBox()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||