package prefuse.util.ui;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import prefuse.util.force.Force;
import prefuse.util.force.ForceSimulator;
/**
* Swing component for configuring the parameters of the
* Force functions in a given ForceSimulator. Useful for exploring
* different parameterizations when crafting a visualization.
*
* @author jeffrey heer
*/
public class JForcePanel extends JPanel {
private ForcePanelChangeListener lstnr = new ForcePanelChangeListener();
private ForceSimulator fsim;
/**
* Create a new JForcePanel
* @param fsim the ForceSimulator to configure
*/
public JForcePanel(ForceSimulator fsim) {
this.fsim = fsim;
this.setBackground(Color.WHITE);
initUI();
}
/**
* Initialize the UI.
*/
private void initUI() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
Force[] forces = fsim.getForces();
for ( int i=0; i