OSPFrame is the base class for Open Source Physics JFrames such as DrawingFrame and DataTableFrame. Copyright: Copyright (c) 2002 @author Wolfgang Christian @version 1.1
| 46 | * @version 1.1 |
| 47 | */ |
| 48 | public class OSPFrame extends JFrame implements Hidable, AppFrame { |
| 49 | |
| 50 | /** Location of OSP icon. */ |
| 51 | static final String OSP_ICON_FILE = "/org/opensourcephysics/resources/controls/images/osp_icon.gif"; //$NON-NLS-1$ |
| 52 | // value is set in static block |
| 53 | protected ArrayList<JButton> customButtons = new ArrayList<JButton>(); // list of custom buttons, custom buttons are |
| 54 | // enabled when the animation is stopped |
| 55 | static int topx = 10; |
| 56 | static int topy = 100; |
| 57 | |
| 58 | /** |
| 59 | * Set to <I>true</I> if a simulation should automatically render this frame |
| 60 | * after every animation step. |
| 61 | */ |
| 62 | protected boolean animated = false; |
| 63 | |
| 64 | /** |
| 65 | * Set to <I>true</I> if a simulation should automatically clear the data when |
| 66 | * it is initialized. |
| 67 | */ |
| 68 | protected boolean autoclear = false; |
| 69 | |
| 70 | /** |
| 71 | * Set <I>true</I> if the Frame's defaultCloseOperation has been changed by |
| 72 | * Launcher. |
| 73 | */ |
| 74 | private volatile boolean wishesToExit = false; |
| 75 | |
| 76 | /** The thread group that created this object. */ |
| 77 | public ThreadGroup constructorThreadGroup = Thread.currentThread().getThreadGroup(); |
| 78 | protected boolean keepHidden = false; |
| 79 | protected BufferStrategy strategy; |
| 80 | protected JPanel buttonPanel = new JPanel(); |
| 81 | protected Collection<JFrame> childFrames = new ArrayList<JFrame>(); |
| 82 | protected int myFontLevel; |
| 83 | |
| 84 | /** |
| 85 | * Gets a file chooser that is the same for all OSPFrames. |
| 86 | * |
| 87 | * @deprecated use <code>OSPRuntime.getChooser()<\code>. |
| 88 | * @return the chooser |
| 89 | */ |
| 90 | @Deprecated |
| 91 | public static JFileChooser getChooser() { |
| 92 | return OSPRuntime.getChooser(); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * OSPFrame constructor with a title. |
| 97 | * |
| 98 | * @param title |
| 99 | */ |
| 100 | public OSPFrame(String title) { |
| 101 | super(TeXParser.parseTeX(title)); |
| 102 | if (OSPRuntime.appletMode) { |
| 103 | keepHidden = true; |
| 104 | } |
| 105 | buttonPanel.setVisible(false); |
nothing calls this directly
no outgoing calls
no test coverage detected