當前位置: 首頁>>代碼示例>>Java>>正文


Java GUIUtils.clearDrawingFrameData方法代碼示例

本文整理匯總了Java中org.opensourcephysics.display.GUIUtils.clearDrawingFrameData方法的典型用法代碼示例。如果您正苦於以下問題:Java GUIUtils.clearDrawingFrameData方法的具體用法?Java GUIUtils.clearDrawingFrameData怎麽用?Java GUIUtils.clearDrawingFrameData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.opensourcephysics.display.GUIUtils的用法示例。


在下文中一共展示了GUIUtils.clearDrawingFrameData方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadObject

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Loads data from the control into the LJParticlesApp model.
 *
 * @param element XMLControl
 * @param obj Object
 * @return Object
 */
public Object loadObject(XMLControl control, Object obj) {
  // GUI has been loaded with the saved values; now restore the LJ state
  LJParticlesDemonApp model = (LJParticlesDemonApp) obj;
  model.initialize(); // reads values from the GUI into the LJ model
  model.md.initialConfiguration = control.getString("initial_configuration");
  model.md.state = (double[]) control.getObject("state");
  if(model.md.state!=null) {
    int N = (model.md.state.length-1)/4;
    model.md.ax = new double[N];
    model.md.ay = new double[N];
    model.md.computeAcceleration();
    model.md.resetAverages();
  }
  GUIUtils.clearDrawingFrameData(false); // clears old data from the plot frames
  return obj;
}
 
開發者ID:OpenSourcePhysics,項目名稱:STP,代碼行數:24,代碼來源:LJParticlesDemonLoader.java

示例2: resetBtnActionPerformed

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Method resetBtnActionPerformed
 *
 * @param e
 */
void resetBtnActionPerformed(ActionEvent e) {
  if(e.getActionCommand().equals(resetText)) {
    GUIUtils.clearDrawingFrameData(true);
    if(model==null) {
      println("This AnimationControl's model is null."); //$NON-NLS-1$
      return;
    }
    ((Animation) model).resetAnimation();
    if(xmlDefault!=null) {
      xmlDefault.loadObject(getOSPApp(), true, true);
    }
    table.refresh();
  } else {                                               // action command = New
    startBtn.setText(initText);
    startBtn.setToolTipText(initToolTipText);
    resetBtn.setText(resetText);
    resetBtn.setToolTipText(resetToolTipText);
    stepBtn.setEnabled(false);
    readItem.setEnabled(true);
    table.setEnabled(true);
    messageTextArea.setEditable(true);
    setCustomButtonsEnabled(true);
  }
}
 
開發者ID:OpenSourcePhysics,項目名稱:osp,代碼行數:30,代碼來源:AnimationControl.java

示例3: loadObject

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Loads data from the control into the LJParticlesApp model.
 *
 * @param element XMLControl
 * @param obj Object
 * @return Object
 */
public Object loadObject(XMLControl control, Object obj) {
  // GUI has been loaded with the saved values; now restore the LJ state
  WidomApp model = (WidomApp) obj;
  model.initialize(); // reads values from the GUI into the LJ model
  model.mc.x = (double[]) control.getObject("x");
  model.mc.y = (double[]) control.getObject("y");
  //    int N = model.mc.x.length;
  model.mc.resetAverages();
  GUIUtils.clearDrawingFrameData(false); // clears old data from the plot frames
  return obj;
}
 
開發者ID:OpenSourcePhysics,項目名稱:STP,代碼行數:19,代碼來源:WidomLoader.java

示例4: resetData

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
   * Resets the LJ model and the data graphs.
   *
   * This method is invoked using a custom button.
   */
  public void resetData() {
    GUIUtils.clearDrawingFrameData(false); // clears old data from the plot frames
    gr.reset();
    mc.steps = 0;
    mc.mcs = 0;
    mc.totalPotentialEnergyAccumulator = 0;
    mc.totalPotentialEnergyAccumulator2 = 0;
    mc.virialAccumulator = 0;
}
 
開發者ID:OpenSourcePhysics,項目名稱:STP,代碼行數:15,代碼來源:LJMCApp.java

示例5: resetData

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
public void resetData() {
   GUIUtils.clearDrawingFrameData(false); // clears old data from the plot frames
   gr.reset();
   mc.steps = 0;
   mc.mcs = 0;
   mc.accept= 0;
}
 
開發者ID:OpenSourcePhysics,項目名稱:STP,代碼行數:8,代碼來源:HDMCApp.java

示例6: actionPerformed

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 *  Performs the calculation and shows all drawing frames.
 *
 * @param  e
 */
public void actionPerformed(ActionEvent e) {
  GUIUtils.clearDrawingFrameData(false);
  if(calculation==null) {
    println("The CalculationControl's model is null."); //$NON-NLS-1$
    return;
  }
  calculation.calculate();
  org.opensourcephysics.display.GUIUtils.showDrawingAndTableFrames();
}
 
開發者ID:OpenSourcePhysics,項目名稱:osp,代碼行數:15,代碼來源:CalculationControl.java

示例7: resetSimulation

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Resets the model and switches the text on the run button.
 */
public void resetSimulation() {
  model.stopAnimation();
  messageArea.setText(""); //$NON-NLS-1$
  GUIUtils.clearDrawingFrameData(true);
  model.resetAnimation();
  if(xmlDefault!=null) { // loading an object should initialize the model
    xmlDefault.loadObject(getOSPApp());
  } else {
    initialize();
  }
  //getControl("runButton").setProperty("text", "Start");
  getControl("runButton").setProperty("image", "/org/opensourcephysics/resources/controls/images/play.gif"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  GUIUtils.showDrawingAndTableFrames();
}
 
開發者ID:OpenSourcePhysics,項目名稱:osp,代碼行數:18,代碼來源:EjsSimulationControl.java

示例8: initialize

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Does the calculation.
 */
public void initialize() {
  model.stopAnimation();
  getControl("runButton").setProperty("image", "/org/opensourcephysics/resources/controls/images/play.gif"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  GUIUtils.clearDrawingFrameData(true);
  model.initializeAnimation();
  GUIUtils.showDrawingAndTableFrames();
}
 
開發者ID:OpenSourcePhysics,項目名稱:osp,代碼行數:11,代碼來源:EjsSimulationControl.java

示例9: resetCalculation

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Resets the calculation.
 */
public void resetCalculation() {
  messageArea.setText(""); //$NON-NLS-1$
  GUIUtils.clearDrawingFrameData(true);
  model.resetCalculation();
  if(xmlDefault!=null) { // the default xml loader invokes calculate.
    xmlDefault.loadObject(getOSPApp());
  } else {               // do the calculation to bring everything up to date
    model.calculate();
  }
  GUIUtils.showDrawingAndTableFrames();
}
 
開發者ID:OpenSourcePhysics,項目名稱:osp,代碼行數:15,代碼來源:EjsCalculationControl.java

示例10: startBtnActionPerformed

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Method startBtnActionPerformed
 *
 * @param e
 */
void startBtnActionPerformed(ActionEvent e) {
  // table.getDefaultEditor(Object.class).stopCellEditing();
  if(e.getActionCommand().equals(initText)) {
    stepBtn.setEnabled(true);
    startBtn.setText(startText);
    startBtn.setToolTipText(startToolTipText);
    resetBtn.setText(newText);
    resetBtn.setToolTipText(newToolTipText);
    resetBtn.setEnabled(true);
    readItem.setEnabled(stepModeEditing);
    table.setEnabled(stepModeEditing);
    messageTextArea.setEditable(false);
    GUIUtils.clearDrawingFrameData(false);
    if(model==null) {
      println("This AnimationControl's model is null."); //$NON-NLS-1$
    } else {
      ((Animation) model).initializeAnimation();
    }
    org.opensourcephysics.display.GUIUtils.showDrawingAndTableFrames();
  } else if(e.getActionCommand().equals(startText)) {
    setCustomButtonsEnabled(false);
    startBtn.setText(stopText);
    startBtn.setToolTipText(stopToolTipText);
    stepBtn.setEnabled(false);
    resetBtn.setEnabled(false);
    readItem.setEnabled(false);
    table.setEnabled(false);
    org.opensourcephysics.display.GUIUtils.enableMenubars(false);
    ((Animation) model).startAnimation();
  } else {                                               // action command = Stop
    startBtn.setText(startText);
    setCustomButtonsEnabled(true);
    startBtn.setToolTipText(startToolTipText);
    stepBtn.setEnabled(true);
    resetBtn.setEnabled(true);
    org.opensourcephysics.display.GUIUtils.enableMenubars(true);
    readItem.setEnabled(stepModeEditing);
    table.setEnabled(stepModeEditing);
    ((Animation) model).stopAnimation();
  }
}
 
開發者ID:OpenSourcePhysics,項目名稱:osp,代碼行數:47,代碼來源:AnimationControl.java

示例11: calculate

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Does the calculation.
 */
public void calculate() {
  GUIUtils.clearDrawingFrameData(true);
  model.calculate();
  GUIUtils.showDrawingAndTableFrames();
}
 
開發者ID:OpenSourcePhysics,項目名稱:osp,代碼行數:9,代碼來源:EjsCalculationControl.java

示例12: resetData

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Resets the LJ model and the data graphs.
 *
 * This method is invoked using a custom button.
 */
public void resetData() {
  mc.resetAverages();
  GUIUtils.clearDrawingFrameData(false); // clears old data from the plot frames
}
 
開發者ID:OpenSourcePhysics,項目名稱:STP,代碼行數:10,代碼來源:WidomApp.java

示例13: resetData

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**
 * Resets the LJ model and the data graphs.
 *
 * This method is invoked using a custom button.
 */
public void resetData() {
  md.resetAverages();
  GUIUtils.clearDrawingFrameData(false); // clears old data from the plot frames
}
 
開發者ID:OpenSourcePhysics,項目名稱:STP,代碼行數:10,代碼來源:LJParticlesDemonApp.java

示例14: resetData

import org.opensourcephysics.display.GUIUtils; //導入方法依賴的package包/類
/**

   * Resets the LJ model and the data graphs.

   *

   * This method is invoked using a custom button.

   */
  public void resetData() {
    md.resetAverages();
    GUIUtils.clearDrawingFrameData(false); // clears old data from the plot frames
  }
 
開發者ID:OpenSourcePhysics,項目名稱:STP,代碼行數:14,代碼來源:LJfluidApp.java


注:本文中的org.opensourcephysics.display.GUIUtils.clearDrawingFrameData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。