Package gov.nih.mipav.view.dialogs
Class JDialogSmoothMesh
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- gov.nih.mipav.view.dialogs.JDialogBase
-
- gov.nih.mipav.view.dialogs.JDialogSmoothMesh
-
- All Implemented Interfaces:
DialogDefaultsInterface
,java.awt.event.ActionListener
,java.awt.event.FocusListener
,java.awt.event.ItemListener
,java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.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:
ModelTriangleMesh.java
,JPanelSurfaces.java
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKAction
-
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private float
alpha
Alpha smoothing factor.private javax.swing.JTextField
alphaText
Text field for getting alpha smoothing factor.private int
iterations
Number of iterations for smoothing formula.private javax.swing.JTextField
iterationsText
Text field for getting iterations.private float
lambda
positive scale factor.private javax.swing.JTextField
lambdaText
Text field for getting lambda for smoothing.private javax.swing.JCheckBox
limitCheckBox
If limitCheckBox is selected iterations stop when volume change from initial volume is greater than or equal to volumePercent.(package private) javax.swing.JPanel
mainPanel
main panel containing interface:private float
mu
negative scale factor.private javax.swing.JTextField
muText
Volume text field.private static long
serialVersionUID
Use serialVersionUID for interoperability.static int
SMOOTH1
Smooth type: SMOOTH1 corresponds to ModelTriangleMesh.smoothMesh()static int
SMOOTH2
Smooth type: SMOOTH2 corresponds to ModelTriangleMesh.smoothTwo()static int
SMOOTH3
Smooth type: SMOOTH3 corresponds to ModelTriangleMesh.smoothThree()private float
stiffness
stiffness.private javax.swing.JTextField
stiffnessText
Text field for getting stiffness for smoothing.private boolean
volumeLimit
flag indicates volume is greater than or equal to volumePercent.private float
volumePercent
Volume percentage.private javax.swing.JTextField
volumeText
Volume text field.-
Fields inherited from class gov.nih.mipav.view.dialogs.JDialogBase
applyButton, bar, cancelButton, cancelFlag, closeButton, HELP, helpButton, mainDialogPanel, NEW, OKButton, parentFrame, progressBar, REPLACE, runInSeparateThread, runningScriptFlag, runQuiet, serif12, serif12B, voiManager
-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JDialogSmoothMesh(java.awt.Frame parent, boolean show, int type)
Creates new dialog to get iterations and alpha for smoothing a mesh surface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
Sets smoothing varaibles when "OK" is pressed; enables the volumeText box when the limitCheckBox is pressed, disposes dialog when "Cancel" is pressed.float
getAlpha()
Accessor that returns the alpha smoothing factor.int
getIterations()
Accessor that returns the number of iterations.float
getLambda()
Accessor that returns the positive scale factor lambda.javax.swing.JPanel
getMainPanel()
returns the mainPanel so this interface can be displayed inside another panel.float
getMu()
Accessor that returns the negative scale factor mu.float
getStiffness()
Accessor that returns the stiffness.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.float
getVolumePercent()
Accessor that returns the percentage difference from the initial volume at which iterations stop.private void
init(boolean show, int type)
Initializes GUI components based on the type parameter..void
setVariables()
sets the variables based on user-input.-
Methods inherited from class gov.nih.mipav.view.dialogs.JDialogBase
buildApplyButton, buildButtons, buildCancelButton, buildCancelButton, buildCloseButton, buildHelpButton, buildImageComboBox, buildOKButton, buildOKButton, buildOKCancelButtons, buildTitledBorder, buildTitledBorder, createLabel, createProgressBar, createProgressBar, createTextField, focusGained, focusLost, getDialogName, isCancelled, isQuietRunning, isRunInSeparateThread, isScriptRunning, itemStateChanged, loadDefaults, loadDefaults, makeImageName, makeString, openNewFrame, saveDefaults, saveDefaults, setLeftHandSystem, setQuietRunning, setScriptRunning, setSeparateThread, setVisible, setVisible, setVisibleMenuBar, setVisibleStandard, setVOIManager, setWCSystem, testParameter, testParameterMin, updateFFTFileInfo, updateFileInfo, updateFileInfoOtherModality, updateFileInfoStatic, updateFileInfoStatic, updateFileTypeInfo, updateFileTypeInfo, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
SMOOTH1
public static final int SMOOTH1
Smooth type: SMOOTH1 corresponds to ModelTriangleMesh.smoothMesh()- See Also:
- Constant Field Values
-
SMOOTH2
public static final int SMOOTH2
Smooth type: SMOOTH2 corresponds to ModelTriangleMesh.smoothTwo()- See Also:
- Constant Field Values
-
SMOOTH3
public static final int SMOOTH3
Smooth type: SMOOTH3 corresponds to ModelTriangleMesh.smoothThree()- See Also:
- Constant Field Values
-
alpha
private float alpha
Alpha smoothing factor.
-
alphaText
private javax.swing.JTextField alphaText
Text field for getting alpha smoothing factor.
-
stiffness
private float stiffness
stiffness.
-
stiffnessText
private javax.swing.JTextField stiffnessText
Text field for getting stiffness for smoothing.
-
lambda
private float lambda
positive scale factor.
-
lambdaText
private javax.swing.JTextField lambdaText
Text field for getting lambda for smoothing.
-
mu
private float mu
negative scale factor.
-
muText
private javax.swing.JTextField muText
Volume text field.
-
mainPanel
javax.swing.JPanel mainPanel
main panel containing interface:
-
iterations
private int iterations
Number of iterations for smoothing formula.
-
iterationsText
private javax.swing.JTextField iterationsText
Text field for getting iterations.
-
limitCheckBox
private javax.swing.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 javax.swing.JTextField volumeText
Volume text field.
-
-
Constructor Detail
-
JDialogSmoothMesh
public JDialogSmoothMesh(java.awt.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 Detail
-
actionPerformed
public void actionPerformed(java.awt.event.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 interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJDialogBase
- Parameters:
e
- Event that triggered function.
-
getMainPanel
public javax.swing.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.
-
-