Class JDialogSmoothMesh

All Implemented Interfaces:
DialogDefaultsInterface, ActionListener, FocusListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class JDialogSmoothMesh extends JDialogBase
User-interface for smoothing the ModelTriangleMesh surfaces. When the JDialogSmoothMesh object is created the type of smooth dialog is specified. The smooth type may be SMOOTH1, SMOOTH2, or SMOOTH3. These correspond to the different smooth operations available for the ModelTriangleMesh object. The smooth type variable determines which components of the user-interface are displayed -- whichever components correspond to the parameters of the ModelTriangleMesh smooth operations. SMOOTH1 -- corresponds to ModelTriangleMesh.smoothMesh function. The interface components displayed are the Number of Iterations, Alpha, Volume Limit, and the Volume Percent Change. SMOOTH2 -- corresponds to ModelTriangleMesh.smoothTwo function. The interface components displayed are the Number of Iterations, Stiffness, Volume Limit, and Volume Percent Change. SMOOTH3 -- corresponds to ModelTriangleMesh.smoothThree function. The interface components displayed are the Number of Iterations, Lambda, and Mu.
See Also:
  • invalid reference
    ModelTriangleMesh.java
  • invalid reference
    JPanelSurfaces.java
  • Serialized Form
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • SMOOTH1

      public static final int SMOOTH1
      Smooth type: SMOOTH1 corresponds to ModelTriangleMesh.smoothMesh()
      See Also:
    • SMOOTH2

      public static final int SMOOTH2
      Smooth type: SMOOTH2 corresponds to ModelTriangleMesh.smoothTwo()
      See Also:
    • SMOOTH3

      public static final int SMOOTH3
      Smooth type: SMOOTH3 corresponds to ModelTriangleMesh.smoothThree()
      See Also:
    • alpha

      private float alpha
      Alpha smoothing factor.
    • alphaText

      private JTextField alphaText
      Text field for getting alpha smoothing factor.
    • stiffness

      private float stiffness
      stiffness.
    • stiffnessText

      private JTextField stiffnessText
      Text field for getting stiffness for smoothing.
    • lambda

      private float lambda
      positive scale factor.
    • lambdaText

      private JTextField lambdaText
      Text field for getting lambda for smoothing.
    • mu

      private float mu
      negative scale factor.
    • muText

      private JTextField muText
      Volume text field.
    • mainPanel

      JPanel mainPanel
      main panel containing interface:
    • iterations

      private int iterations
      Number of iterations for smoothing formula.
    • iterationsText

      private JTextField iterationsText
      Text field for getting iterations.
    • limitCheckBox

      private JCheckBox limitCheckBox
      If limitCheckBox is selected iterations stop when volume change from initial volume is greater than or equal to volumePercent.
    • volumeLimit

      private boolean volumeLimit
      flag indicates volume is greater than or equal to volumePercent.
    • volumePercent

      private float volumePercent
      Volume percentage.
    • volumeText

      private JTextField volumeText
      Volume text field.
  • Constructor Details

    • JDialogSmoothMesh

      public JDialogSmoothMesh(Frame parent, boolean show, int type)
      Creates new dialog to get iterations and alpha for smoothing a mesh surface.
      Parameters:
      parent - Parent frame.
      show - when true display the interface in a dialog.
      type - smooth level (1, 2, 3)
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Sets smoothing varaibles when "OK" is pressed; enables the volumeText box when the limitCheckBox is pressed, disposes dialog when "Cancel" is pressed.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      e - Event that triggered function.
    • getMainPanel

      public JPanel getMainPanel()
      returns the mainPanel so this interface can be displayed inside another panel.
      Returns:
      mainPanel, the main panel containing the user-interface for this object.
    • getAlpha

      public float getAlpha()
      Accessor that returns the alpha smoothing factor.
      Returns:
      Alpha smoothing factor.
    • getStiffness

      public float getStiffness()
      Accessor that returns the stiffness.
      Returns:
      stiffness.
    • getLambda

      public float getLambda()
      Accessor that returns the positive scale factor lambda.
      Returns:
      lambda.
    • getMu

      public float getMu()
      Accessor that returns the negative scale factor mu.
      Returns:
      mu.
    • getIterations

      public int getIterations()
      Accessor that returns the number of iterations.
      Returns:
      Number of iterations.
    • getVolumeLimit

      public boolean getVolumeLimit()
      Accessor that returns whether or not iterations are stopped after the present volume is different from the initial volume by volumePercent or more.
      Returns:
      volumeLimit.
    • getVolumePercent

      public float getVolumePercent()
      Accessor that returns the percentage difference from the initial volume at which iterations stop.
      Returns:
      volumePercent.
    • setVariables

      public void setVariables()
      sets the variables based on user-input.
    • init

      private void init(boolean show, int type)
      Initializes GUI components based on the type parameter.. When show parameter is true the interface is displayed as a separate dialog box.
      Parameters:
      show - when true display the interface as a separate dialog box.
      type - the type of smooth dialog to create (SMOOTH1, SMOOTH2, SMOOTH3). The type will determine which components of the user-interface are displayed to match the ModelTriangleMesh smooth type operation parameters.