Class edu.cornell.lassp.mck10.HysteresisApplet.CheckLatticeSize
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class edu.cornell.lassp.mck10.HysteresisApplet.CheckLatticeSize

java.lang.Object
   |
   +----edu.cornell.lassp.mck10.HysteresisApplet.CheckLatticeSize

public class CheckLatticeSize
extends Object
implements CheckConfigurable
The CheckLatticeSize class is an implementation of the CheckConfigurable interface, which checks the values of a pair of configurable integers. It treats the first as the width of a lattice, and the second as a number of dimensions for the lattice. if the lattice would have more than maxSize spins for a changed value of the width or the dimensions, CheckLatticeSize tells the user how big the lattice would be, and asks them if they really want to change the size. If they do, the change occurs, and if they don't, the change is blocked.

Source Code is available.

Version:
1.0
Author:
Matt Kuntz (e-mail: mck10@cornell.edu)

Constructor Index

 o CheckLatticeSize(ConfigurableInteger, ConfigurableInteger, int, ConfigurableCollection)
The CheckLatticeSize(width,dimensions,maxSize,menu) constructor constructs a new size checker, and attatches it to the width and dimensions variables with the maximum size set to maxSize.

Method Index

 o check(Configurable, Object)
check(variable,value) is called when either someone tries to change either the width or the number of dimensions.

Constructors

 o CheckLatticeSize
  public CheckLatticeSize(ConfigurableInteger width,
                          ConfigurableInteger dimensions,
                          int maxSize,
                          ConfigurableCollection menu)
The CheckLatticeSize(width,dimensions,maxSize,menu) constructor constructs a new size checker, and attatches it to the width and dimensions variables with the maximum size set to maxSize. It also puts the maximumSize in the configuration menu menu.
Parameters:
width - The width variable to be checked.
dimensions - The dimensions variable to be checked.
maxSize - The maximum simulation size to be accepted.
menu - The menu to put the maximum size in.

Methods

 o check
  public boolean check(Configurable variable,
                       Object value)
check(variable,value) is called when either someone tries to change either the width or the number of dimensions. If the resulting simulation size would be bigger than maximumSize, the user is prompted with a dialog box, asking them if they really want the size to be changed.
Parameters:
variable - The variable which is going to be changed.
value - The value the variable would be changed to.

All Packages  Class Hierarchy  This Package  Previous  Next  Index