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,ActionListener,FocusListener,ItemListener,WindowListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class gov.nih.mipav.view.dialogs.JDialogBase
JDialogBase.CancelAction, JDialogBase.HelpAction, JDialogBase.OKActionNested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatAlpha smoothing factor.private JTextFieldText field for getting alpha smoothing factor.private intNumber of iterations for smoothing formula.private JTextFieldText field for getting iterations.private floatpositive scale factor.private JTextFieldText field for getting lambda for smoothing.private JCheckBoxIf limitCheckBox is selected iterations stop when volume change from initial volume is greater than or equal to volumePercent.(package private) JPanelmain panel containing interface:private floatnegative scale factor.private JTextFieldVolume text field.private static final longUse serialVersionUID for interoperability.static final intSmooth type: SMOOTH1 corresponds to ModelTriangleMesh.smoothMesh()static final intSmooth type: SMOOTH2 corresponds to ModelTriangleMesh.smoothTwo()static final intSmooth type: SMOOTH3 corresponds to ModelTriangleMesh.smoothThree()private floatstiffness.private JTextFieldText field for getting stiffness for smoothing.private booleanflag indicates volume is greater than or equal to volumePercent.private floatVolume percentage.private JTextFieldVolume 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, voiManagerFields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionJDialogSmoothMesh(Frame parent, boolean show, int type) Creates new dialog to get iterations and alpha for smoothing a mesh surface. -
Method Summary
Modifier and TypeMethodDescriptionvoidSets smoothing varaibles when "OK" is pressed; enables the volumeText box when the limitCheckBox is pressed, disposes dialog when "Cancel" is pressed.floatgetAlpha()Accessor that returns the alpha smoothing factor.intAccessor that returns the number of iterations.floatAccessor that returns the positive scale factor lambda.returns the mainPanel so this interface can be displayed inside another panel.floatgetMu()Accessor that returns the negative scale factor mu.floatAccessor that returns the stiffness.booleanAccessor that returns whether or not iterations are stopped after the present volume is different from the initial volume by volumePercent or more.floatAccessor that returns the percentage difference from the initial volume at which iterations stop.private voidinit(boolean show, int type) Initializes GUI components based on the type parameter..voidsets 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, windowOpenedMethods 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, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods 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, toFrontMethods 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, validateTreeMethods 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 Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
SMOOTH1
public static final int SMOOTH1Smooth type: SMOOTH1 corresponds to ModelTriangleMesh.smoothMesh()- See Also:
-
SMOOTH2
public static final int SMOOTH2Smooth type: SMOOTH2 corresponds to ModelTriangleMesh.smoothTwo()- See Also:
-
SMOOTH3
public static final int SMOOTH3Smooth type: SMOOTH3 corresponds to ModelTriangleMesh.smoothThree()- See Also:
-
alpha
private float alphaAlpha smoothing factor. -
alphaText
Text field for getting alpha smoothing factor. -
stiffness
private float stiffnessstiffness. -
stiffnessText
Text field for getting stiffness for smoothing. -
lambda
private float lambdapositive scale factor. -
lambdaText
Text field for getting lambda for smoothing. -
mu
private float munegative scale factor. -
muText
Volume text field. -
mainPanel
JPanel mainPanelmain panel containing interface: -
iterations
private int iterationsNumber of iterations for smoothing formula. -
iterationsText
Text field for getting iterations. -
limitCheckBox
If limitCheckBox is selected iterations stop when volume change from initial volume is greater than or equal to volumePercent. -
volumeLimit
private boolean volumeLimitflag indicates volume is greater than or equal to volumePercent. -
volumePercent
private float volumePercentVolume percentage. -
volumeText
Volume text field.
-
-
Constructor Details
-
JDialogSmoothMesh
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
Sets smoothing varaibles when "OK" is pressed; enables the volumeText box when the limitCheckBox is pressed, disposes dialog when "Cancel" is pressed.- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classJDialogBase- Parameters:
e- Event that triggered function.
-
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.
-