public abstract class ModuleWindow extends InternalWindow
InternalWindow.CommandInfo
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
private boolean |
calcCanceled |
private java.awt.event.ActionListener |
calcCancelListener |
private long |
calcCompleted |
private java.awt.event.ActionListener |
calcProgressListener |
private java.awt.GridBagConstraints |
constraints
The GridBagConstraints for this window.
|
private java.util.HashMap<java.awt.Component,java.lang.Boolean> |
enabledState |
protected boolean |
isRNA
A boolean, true if the calculation handles RNA, false if not.
|
private static java.util.HashMap<java.lang.String,java.lang.Boolean> |
knownDirs |
(package private) long |
lastUpdate |
private java.awt.GridBagLayout |
layout
The layout for this window.
|
protected static AppLog |
log |
protected java.lang.Thread |
mainCalcThread |
protected java.awt.Component |
progressIndicator
The progress bar dialog for this window.
|
protected static java.lang.String |
protectedExamplesDir |
protected ModuleWindow |
self |
private static long |
serialVersionUID |
protected javax.swing.JButton |
startButton |
backend, changeListener, frameListener, warnings
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Modifier | Constructor and Description |
---|---|
protected |
ModuleWindow(java.lang.String acid,
java.lang.String title)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
calcWasCanceled() |
protected void |
cancelMainCalculation() |
void |
close() |
protected void |
closeProgress() |
protected void |
closeProgress(boolean resetUI) |
protected java.lang.String |
combineFileNames(java.lang.String file1,
java.lang.String file2,
java.lang.String ext)
Combine two file names into a new file name.
|
protected boolean |
displayCalcError(java.lang.String text)
Handle finishing of a module.
|
protected boolean |
drawStructures(java.lang.String file) |
private void |
enableControls(java.awt.Container parent,
boolean enable) |
protected javax.swing.JComponent |
getInputControl(java.awt.Container hold,
int index)
Get a particular input control from a given container.
|
protected javax.swing.JComponent |
getInputControl(int index)
Get a particular input control from the content pane.
|
static java.lang.String |
getOutputFile(java.lang.String file) |
static java.lang.String |
getOutputFile(java.lang.String file,
java.lang.String extension)
Replace the extension on a file name.
|
protected abstract void |
makeInputControls()
Make any input controls necessary to get data from this window for a
calculation.
|
protected void |
makeStartButton(int x,
int y)
Create the "START" button.
|
protected void |
placeComponent(int x,
int y,
javax.swing.JComponent component)
.
|
protected void |
processCommand(InternalWindow.CommandInfo ci)
Perform an action specific to this window.
|
static boolean |
promptDraw() |
static boolean |
promptDraw(java.lang.String prompt,
java.lang.String promptSetting) |
protected abstract boolean |
runMainCalculation()
Run the module calculation in the back end.
|
(package private) void |
runOnUiThread(java.lang.Runnable r) |
protected void |
setAnchorCenter()
Set the anchoring area for the GridBagConstraints to CENTER.
|
protected void |
setAnchorNorth()
Set the anchoring area for the GridBagConstraints to NORTH.
|
protected void |
setFillCenter()
Set the fill for the GridBagConstraints as CENTER.
|
protected void |
setFillHorizontal()
Set the fill for the GridBagConstraints as HORIZONTAL.
|
protected void |
setGrid(int width,
int height)
Set the amount of space a component takes up in the grid.
|
protected void |
setInsets(int top,
int left,
int bottom,
int right)
Set the external padding of the constraints.
|
protected void |
setPad(int xPad,
int yPad)
Set the internal padding of the constraints.
|
protected void |
showDrawProgress() |
protected void |
showDrawProgress(java.lang.String message) |
protected void |
showProgress()
Create a determinate progress bar.
|
protected void |
showProgress(boolean determinate)
Create a progress bar.
|
protected void |
showProgress(boolean determinate,
boolean canCancel) |
protected void |
showProgress(boolean determinate,
boolean canCancel,
java.lang.String message) |
protected void |
updateCalcProgress(ProgressPanel panel) |
protected boolean |
verifyBackendResult(java.lang.String result,
java.lang.String details,
java.lang.Object... detailArgs)
Check to see if the module was initialized correctly.
|
actionPerformed, createCustomMenus, frameActivated, frameClosed, frameClosing, getCustomMenus, invokeCommand, invokeCommand, invokeCommand, isActiveFrame, notifyUpdated, onFocusGained, propertyChanged, setCaption, setCustomMenus, showWindow
addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private boolean calcCanceled
private java.awt.event.ActionListener calcCancelListener
private long calcCompleted
private java.awt.event.ActionListener calcProgressListener
private java.awt.GridBagConstraints constraints
private java.util.HashMap<java.awt.Component,java.lang.Boolean> enabledState
protected boolean isRNA
private static java.util.HashMap<java.lang.String,java.lang.Boolean> knownDirs
long lastUpdate
private java.awt.GridBagLayout layout
protected static final AppLog log
protected java.lang.Thread mainCalcThread
protected volatile java.awt.Component progressIndicator
protected static java.lang.String protectedExamplesDir
protected final ModuleWindow self
private static final long serialVersionUID
protected javax.swing.JButton startButton
protected ModuleWindow(java.lang.String acid, java.lang.String title)
acid
- The nucleic acid type, as a string.title
- The title of the window.protected boolean calcWasCanceled()
protected void cancelMainCalculation()
public void close()
protected void closeProgress()
protected void closeProgress(boolean resetUI)
protected final java.lang.String combineFileNames(java.lang.String file1, java.lang.String file2, java.lang.String ext)
file1
- The first file name.file2
- The second file name.ext
- The extension of the new file name.protected final boolean displayCalcError(java.lang.String text)
text
- The result of the calculation spawned by the module.protected boolean drawStructures(java.lang.String file)
private void enableControls(java.awt.Container parent, boolean enable)
protected final javax.swing.JComponent getInputControl(java.awt.Container hold, int index)
hold
- The container that holds the input control.index
- The index of the control to get, one-indexed.protected final javax.swing.JComponent getInputControl(int index)
index
- The index of the control to get, one-indexed.public static java.lang.String getOutputFile(java.lang.String file)
public static java.lang.String getOutputFile(java.lang.String file, java.lang.String extension)
file
- The file name whose extension to replace.extension
- The new extension.protected abstract void makeInputControls()
protected final void makeStartButton(int x, int y)
x
- The X index at which to place the button in the layout.y
- The Y index at which to place the button in the layout.protected final void placeComponent(int x, int y, javax.swing.JComponent component)
x
- The X coordinate of the grid.y
- The Y coordinate of the grid.component
- The component to set in place.protected void processCommand(InternalWindow.CommandInfo ci)
processCommand
in class InternalWindow
ci
- Information about the command.public static boolean promptDraw()
public static boolean promptDraw(java.lang.String prompt, java.lang.String promptSetting)
protected abstract boolean runMainCalculation()
void runOnUiThread(java.lang.Runnable r)
protected final void setAnchorCenter()
protected final void setAnchorNorth()
protected final void setFillCenter()
protected final void setFillHorizontal()
protected final void setGrid(int width, int height)
width
- The width of the component.height
- The height of the component.protected final void setInsets(int top, int left, int bottom, int right)
top
- The top padding.left
- The left padding.bottom
- The bottom padding.right
- The right padding.protected final void setPad(int xPad, int yPad)
xPad
- The padding in the X direction.yPad
- The padding in the Y direction.protected void showDrawProgress()
protected void showDrawProgress(java.lang.String message)
protected void showProgress()
protected void showProgress(boolean determinate)
determinate
- True if the progress bar is determinate,
false if not.protected void showProgress(boolean determinate, boolean canCancel)
protected void showProgress(boolean determinate, boolean canCancel, java.lang.String message)
protected void updateCalcProgress(ProgressPanel panel)
protected final boolean verifyBackendResult(java.lang.String result, java.lang.String details, java.lang.Object... detailArgs)
result
- The result of the data structure construction.