|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.graphics.Display
etomica.graphics.DisplayPolytope
public class DisplayPolytope
Displays a picture of a polytope. Instantiates a DisplayCanvas for most of the work. DisplayPolytope is an input event (mouse and key) listener of the canvas.
| Nested Class Summary | |
|---|---|
static class |
DisplayPolytope.Applet
|
| Field Summary | |
|---|---|
static boolean |
_3dEnabled
|
int[] |
align
|
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 int[] |
drawSize
Size of drawing region of central image, in pixels |
static int |
LEFT
|
protected Polytope |
polytope
|
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 | |
|---|---|
DisplayPolytope(Polytope polytope)
|
|
| Method Summary | |
|---|---|
void |
actionPerformed()
Completes the action defined by the class implementing this interface. |
protected void |
computeImageParameters()
|
void |
computeImageParameters2(int w,
int h)
|
int |
computeOrigin(int alignX,
int drawSizeX,
int size)
|
IVector |
dimensions()
returns dimensions of polytope as the (max - min) value in each dimension for all the vertices. |
void |
doUpdate()
|
int |
getAlign(int i)
|
int[] |
getDrawSize()
|
static EtomicaInfo |
getEtomicaInfo()
|
int[] |
getOrigin()
|
Pixel |
getPixelUnit()
Returns unit for conversion between simulation units and display pixels. |
Polytope |
getPolytope()
|
double |
getScale()
|
double |
getToPixels()
|
Component |
graphic(Object obj)
Simulation.GraphicalElement interface method. |
boolean |
isMovable()
|
boolean |
isResizable()
|
void |
repaint()
|
void |
setAlign(int i,
int value)
|
void |
setBounds(int x,
int y,
int width,
int height)
|
void |
setMovable(boolean b)
|
void |
setPixelUnit(Pixel pixel)
Sets unit for conversion between simulation units and display pixels. |
void |
setPolytope(Polytope p)
Specifies the polytope for this display. |
void |
setPolytopeCanvas(DisplayCanvas polytopeCanvas)
|
void |
setResizable(boolean b)
|
void |
setScale(double s)
|
void |
setSize(int width,
int height)
|
| 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
public static boolean _3dEnabled
public DisplayCanvas canvas
public final int[] align
protected final int[] drawSize
#computeDrawSizeprotected final int[] centralOrigin
protected double scale
protected Polytope polytope
| Constructor Detail |
|---|
public DisplayPolytope(Polytope polytope)
| Method Detail |
|---|
public static EtomicaInfo getEtomicaInfo()
public void setSize(int width,
int height)
public void actionPerformed()
IAction
actionPerformed in interface IActionpublic IVector dimensions()
public int[] getOrigin()
public int[] getDrawSize()
public void setBounds(int x,
int y,
int width,
int height)
public void setAlign(int i,
int value)
public int getAlign(int i)
public double getToPixels()
public double getScale()
public void setScale(double s)
public final Polytope getPolytope()
public void setPolytope(Polytope p)
public void setPolytopeCanvas(DisplayCanvas polytopeCanvas)
public Component graphic(Object obj)
graphic in interface GraphicalElementgraphic in class Displayobj - ignored by this method.
Device,
Displayprotected void computeImageParameters()
public void computeImageParameters2(int w,
int h)
public int computeOrigin(int alignX,
int drawSizeX,
int size)
public void doUpdate()
public void repaint()
repaint in class Displaypublic void setMovable(boolean b)
public boolean isMovable()
public void setResizable(boolean b)
public boolean isResizable()
public Pixel getPixelUnit()
public void setPixelUnit(Pixel pixel)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||