etomica.graphics
Class SimulationGraphic

java.lang.Object
  extended by etomica.graphics.SimulationGraphic
All Implemented Interfaces:
SimulationContainer

public class SimulationGraphic
extends Object
implements SimulationContainer

General class for graphical presentation of the elements of a molecular simulation.


Field Summary
protected  String appName
           
protected  Controller controller
           
static int GRAPHIC_ONLY
           
protected  ISimulation simulation
           
protected  ISpace space
           
static int TABBED_PANE
           
static WindowAdapter WINDOW_CLOSER
           
 
Constructor Summary
SimulationGraphic(ISimulation simulation, int graphicType, ISpace space, Controller controller)
           
SimulationGraphic(ISimulation simulation, int graphicType, String appName, int updateInterval, ISpace space, Controller controller)
           
SimulationGraphic(ISimulation simulation, int graphicType, String appName, ISpace space, Controller controller)
           
SimulationGraphic(ISimulation simulation, ISpace space, Controller controller)
           
SimulationGraphic(ISimulation simulation, String appName, int updateInterval, ISpace space, Controller controller)
           
SimulationGraphic(ISimulation simulation, String appName, ISpace space, Controller controller)
           
 
Method Summary
 void add(Device device)
          Adds displays graphic to the simulation display pane
 void add(Display display)
           
 LinkedList<Device> deviceList()
           
 LinkedList<Display> displayList()
           
 DeviceTrioControllerButton getController()
           
 DisplayBox getDisplayBox(IBox box)
           
 IAction getPaintAction(IBox box)
          getPaintAction()
 SimulationPanel getPanel()
          A visual display of the simulation via a JPanel.
 ISimulation getSimulation()
           
static void main(String[] args)
          Demonstrates how this class is implemented.
 JFrame makeAndDisplayFrame()
           
static JFrame makeAndDisplayFrame(JPanel panel)
           
static JFrame makeAndDisplayFrame(JPanel panel, String title)
           
 JFrame makeAndDisplayFrame(String title)
           
 void remove(Device device)
           
 void remove(Display display)
           
 void setPaintInterval(IBox box, int interval)
          setPaintInterval() Sets the integrator interval between repaint actions to the value specified for the given Box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAPHIC_ONLY

public static final int GRAPHIC_ONLY
See Also:
Constant Field Values

TABBED_PANE

public static final int TABBED_PANE
See Also:
Constant Field Values

simulation

protected final ISimulation simulation

controller

protected final Controller controller

space

protected final ISpace space

appName

protected final String appName

WINDOW_CLOSER

public static final WindowAdapter WINDOW_CLOSER
Constructor Detail

SimulationGraphic

public SimulationGraphic(ISimulation simulation,
                         ISpace space,
                         Controller controller)

SimulationGraphic

public SimulationGraphic(ISimulation simulation,
                         int graphicType,
                         ISpace space,
                         Controller controller)

SimulationGraphic

public SimulationGraphic(ISimulation simulation,
                         String appName,
                         ISpace space,
                         Controller controller)

SimulationGraphic

public SimulationGraphic(ISimulation simulation,
                         int graphicType,
                         String appName,
                         ISpace space,
                         Controller controller)

SimulationGraphic

public SimulationGraphic(ISimulation simulation,
                         String appName,
                         int updateInterval,
                         ISpace space,
                         Controller controller)

SimulationGraphic

public SimulationGraphic(ISimulation simulation,
                         int graphicType,
                         String appName,
                         int updateInterval,
                         ISpace space,
                         Controller controller)
Method Detail

getSimulation

public ISimulation getSimulation()
Specified by:
getSimulation in interface SimulationContainer

displayList

public final LinkedList<Display> displayList()

deviceList

public final LinkedList<Device> deviceList()

getPanel

public SimulationPanel getPanel()
A visual display of the simulation via a JPanel.


setPaintInterval

public void setPaintInterval(IBox box,
                             int interval)
setPaintInterval() Sets the integrator interval between repaint actions to the value specified for the given Box.


getPaintAction

public IAction getPaintAction(IBox box)
getPaintAction()

Returns:
Returns the paint action associated with the given Box.

add

public void add(Display display)

remove

public void remove(Display display)

add

public void add(Device device)
Adds displays graphic to the simulation display pane


remove

public void remove(Device device)

getController

public DeviceTrioControllerButton getController()

makeAndDisplayFrame

public final JFrame makeAndDisplayFrame()

makeAndDisplayFrame

public final JFrame makeAndDisplayFrame(String title)

makeAndDisplayFrame

public static JFrame makeAndDisplayFrame(JPanel panel,
                                         String title)

makeAndDisplayFrame

public static JFrame makeAndDisplayFrame(JPanel panel)

getDisplayBox

public DisplayBox getDisplayBox(IBox box)

main

public static void main(String[] args)
Demonstrates how this class is implemented.