import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.applet.*; import java.awt.geom.*; import java.math.*; public class DocumentControlPanel { Manager M; public DocumentControlPanel(Manager MM) { this.M=MM; } public void displayInfo() { String S="Display Control Panel "; S=S+"\n\nThis control panel toggles the displays of various objects on the picture window."; S=S+"\n\nmin1: This displays small neighborhoods of the first of two bi-pyramidal arrangements. In this arrangement:\nP0=0\nP1=1\nP2 and P3 are cube roots of unity\nP4=infinity.\nThe arrow keys labelled `confine diameter' dictate the size of the neighborhood. This first configuration is the main one of interest to us."; S=S+"\n\nmin2: This displays small neighborhoods of the second of two bi-pyramidal arrangements. In this arrangement:\nP0=-1\nP1=1\nP2 and P3 are such that P0P2P3 and P1P2P3 are equilateral triangles\nP4=infinity.\nThe operation of swapping P0 and P4 interchanges this configuration with the first one. We don't really ever deal with this configuration, because we always use symmetry to avoid it."; S=S+"\n\ngrid: This displays a dyadic grid, covering the square of sidelength 4 centered at the origin. The arrow keys labelled 'grid display' control the level of detail."; S=S+"\n\nunit: This displays the unit circle in the plane."; S=S+"\n\ninverted: The operation of swapping P0 and P4 carries the displayed configuration to a new configuration, which we call the inverted configuration. This option lets you see the inverted configuration alongside the original configuration."; S=S+"\n\nprof update: Essentially the main proof makes a depth-first search through the tree of dyadic rectangular solids in the configuration space. Each dyadic solid corresponds to a union of 3 squares in the plane, and one interval on the real axis. The proof update option allows you to see these square configurations as they are considered and `passed' by the proof algorithm. I think that the proof algorithm might run a bit faster with this option turned off, but I'm not positive."; S=S+"\n\nsolids: This option tells you how to draw the square configurations mentioned above, either solid or in outline."; M.E.setExplain(S); M.E.repaint(); } public void actionInfo() { String S="Action Control Panel "; S=S+"\n\nThis control panel selects which program to run. In all cases, you press the green go button to run the program and the red halt button to force the program to stop. There are 3 options."; S=S+"\n\nevolve: This option evolves the current electron configuration according to an annealing process. The computer searches a finite list of nearby configurations and tries to move to one that has lower enerty. In practice, this program always moves the confituration to the triangular bi-pyramid. To see this option in action, you can press the 'random' reset and then press 'go'. The program shuts off once the configuration is sufficiently close to the triangular bi-pyramid. Using the configuration control, you can force the annealing process to ignore certain of the points. You do this by clicking the middle mouse button over the appropriate colored circle so as to make the white boundary ring disappear. If you do this, you can see what the lowest energy configuration would be if one or more of the points was frozen in its current position and the others were allowed to evolve. "; S=S+"\n\n proof: This option runs the proof from the paper. When you call up the proof option, you get a secondary control panel. The secondary control panel alows you to do two things:\n\n1.toggle between a basic and advanced mode or running the program\n\n2. turn the interval arithmetic feature on and off.\n\nIf you want to see the proof from the paper, you should run the proof in the basic mode and turn the interval arithmetic on. The 'proof update' button on the display control panel lets you see a graphical display of the proof as it runs. If you run the advanced mode of the proof, you will get another control panel which gives you more running options."; S=S+"\n\nchecker: This option contains a number of debugging tests I used during the writing of the program. "; M.E.setExplain(S); M.E.repaint(); } public void resetInfo() { String S="Reset Control Panel "; S=S+"\n\nThis control panel lets you reset the point configuration shown on the picture window. The 4 points shown in the picture window represent a 5 point configuration on the sphere. One maps the 4 points in the picture window to the sphere by inverse stereographic projection, and then the point (0,0,1) makes up the 5th point. The point (0,0,1) is the image of the point infinity under inverse stereographic projection."; S=S+"\n\nmin1: In this arrangement:\nP0=0\nP1=1\nP2 and P3 are cube roots of unity\nP4=infinity.\nThe arrow keys labelled `confine diameter' dictate the size of the neighborhood. This first configuration is the main one of interest to us."; S=S+"\n\nmin2: In this arrangement:\nP0=-1\nP1=1\nP2 and P3 are such that P0P2P3 and P1P2P3 are equilateral triangles\nP4=infinity.\nThe operation of swapping P0 and P4 interchanges this configuration with the first one. We don't really ever deal with this configuration, because we always use symmetry to avoid it."; S=S+"\n\nrandom: This selects a random configuration in which all coordinates have absolute value at most 2."; S=S+"\n\ndyadic: This replaces the current configuration by a nearby one in which the points have coordinates which are dyadic rationals."; M.E.setExplain(S); M.E.repaint(); } public void goInfo() { String S="Go button"; S=S+"\n\nThis button activates the runnable part of the program. When part of the program is running, a halt button also appears. You stop the program by pushing the halt button. The 'action' control panel controls which part of the code the go button activates."; M.E.setExplain(S); M.E.repaint(); } public void confineInfo() { String S="confinement selector"; S=S+"\n\nThese arrow keys select the confinement neighborhood about the triangular bi-pyramid. If you set the value to k, and then run the program in the proof mode, the program automatically eliminates and configuration that is within 2^(-k-1)) of the triangular bi-pyramid in the L_infinity norm. More concretely, the eliminated configurations have the property that the jth point lies within the square of sideength 2^(-k) centered at the jth point of the configuration corresponding to the TBP."; M.E.setExplain(S); M.E.repaint(); } public void gridInfo() { String S="Grid selector"; S=S+"\n\nThese keys select the level of detail of the grid that you can display over the picture window."; M.E.setExplain(S); M.E.repaint(); } public void exponentInfo() { String S="Exponent Selector"; S=S+"\n\nThese keys allow you to select the exponent for the power law potential used in the program. You can select any rational exponent within reason. However, the interval arithmetic part of our code only runs with the exponents 1 and 2."; S=S+"\n\nThe 'reduce' key will reduce the fraction you select to lowest terms."; M.E.setExplain(S); M.E.repaint(); } }