Class JDialogMemoryAllocation
- 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.JDialogMemoryAllocation
-
- 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 JDialogMemoryAllocation extends JDialogBase
Dialog to alter memory allocation of the runtime environment. The runtime memory allocation for the InstallAnywhere executable can be found in the LAX file: "mipav.lax" or "iaso.lax" within most environments or the file "Info.plist" in a Darwin/Mac OS 10 environment.Reads the InstallAnywhere start up file then parses it, line-by-line, to come up with the memory options for the dialog. Waits for user input to declare what memory settings should be applied into the start-up file. InstallAnywhere will read those settings for the next time it restarts the application.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JDialogMemoryAllocation.VMConfigType
-
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 static java.lang.String
debugLauncherStr
private static java.lang.String
laxExt
private static java.lang.String
macAppVMOptions
private static java.lang.String
maxHeapLAX
Flag to the java-runtime (as used in the LAX-files) to indicate an maximum heap-size memory-option.private static java.lang.String
maxHeapOption
Flag to the java-runtime (as used in the XML-files) to indicate an maximum heap-size memory-option.private javax.swing.JTextField
maxHeapText
DOCUMENT ME!private static int
MIN_HEAP_SIZE
private static java.lang.String
optionFlag
Flag to the java-runtime (as used in the XML-files) to indicate a memory-option.private static java.lang.String
plistExt
private static long
serialVersionUID
Use serialVersionUID for interoperability.private java.io.File
startupFile
Contains all java properties of the MIPAV app (used at least when loading!)private javax.swing.JButton
usePreferencesButton
DOCUMENT ME!private ViewUserInterface
userInterface
DOCUMENT ME!private static java.lang.String
vmoptionsExt
private static JDialogMemoryAllocation.VMConfigType
vmType
-
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 JDialogMemoryAllocation()
builds the dialog interface to get user to change the lax-file settings for the JVM to use on java start-up.JDialogMemoryAllocation(ViewUserInterface ui, boolean checkOnPreferences)
strictly reads the memory settings from the LAX-file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent ae)
Reads event from one of the buttons to perform that buttons action.javax.swing.JPanel
buildButtons(boolean includePrefs)
creates the buttons, USE PREFERENCES, OKAY, CANCEL, and HELP.protected static java.lang.String
convertBytesToGBytes(java.lang.String byteString)
convert the number given by the string (assuming it is a number indicating a quantity of bytes) to a number indicating a quantity of gigabytes.protected static java.lang.String
convertBytesToMBytes(java.lang.String byteString)
convert the number given by the string (assuming it is a number indicating a quantity of bytes) to a number indicating a quantity of megabytes.protected static java.lang.String
convertGBytesToBytes(java.lang.String gigabyteString)
convert the number given by the string (assuming it is a number indicating a quantity of gigabytes) to a number indicating a quantity of bytes.protected static java.lang.String
convertGBytesToMBytes(java.lang.String gigabyteString)
convert the number given by the string (assuming it is a number indicating a quantity of gigabytes) to a number indicating a quantity of megabytes.protected static java.lang.String
convertKBytesToGBytes(java.lang.String kilobyteString)
convert the number given by the string (assuming it is a number indicating a quantity of kilabytes) to a number indicating a quantity of gigabytes.protected static java.lang.String
convertKBytesToMBytes(java.lang.String kilobyteString)
convert the number given by the string (assuming it is a number indicating a quantity of kilabytes) to a number indicating a quantity of megabytes.protected static java.lang.String
convertMBytesToBytes(java.lang.String megabyteString)
convert the number given by the string (assuming it is a number indicating a quantity of megabytes) to a number indicating a quantity of bytes.protected static java.lang.String
convertMBytesToGBytes(java.lang.String megabyteString)
convert the number given by the string (assuming it is a number indicating a quantity of megabytes) to a number indicating a quantity of gigabytes.protected javax.swing.JPanel
createInputPanel(boolean usePrefs)
creates the main panel with all the inputs.. argumenttrue
includes preferences if available.static java.lang.String
getAppName()
static java.io.File
getLaxStartupFile(java.lang.String app)
This method returns the startup file which contains the MIPAV start-up options.static java.io.File
getPlistStartupFile(java.lang.String app)
This method returns the startup file which contains the MIPAV start-up options.static java.io.File
getStartupFile()
This method returns the startup file which contains the MIPAV start-up options.protected static java.lang.String
getVMOptionsMaxHeap(java.lang.String line)
static java.io.File
getVMOptionsStartupFile(java.lang.String app, boolean debug)
protected static java.lang.String[]
interpretLAX(java.lang.String line)
reads the given line of a LAX file to search for the initial heap size and maximum heap size Strings.protected static java.lang.String[]
interpretXML(java.lang.String line)
reads the given line of a plist file to search for the initial heap size and maximum heap size Strings.protected static boolean
isLaxFile(java.io.File file)
protected static boolean
isPListFile(java.io.File file)
protected static boolean
isVMOptionsFile(java.io.File file)
protected static java.lang.String
readFileContents(java.io.File file)
static java.lang.String
readHeapMax(java.io.File file)
static java.lang.String
readLaxFileHeapMax(java.io.File lax)
Reads the InstallAnywhere startup file and returns the start up heap memory string.static java.lang.String
readPlistFileHeapMax(java.io.File file)
Reads the InstallAnywhere startup file and returns the start up heap memory string.protected static java.lang.String
readVMOptionsFileHeapMax(java.io.File file)
protected static java.lang.String
replacePatternMultiline(java.lang.String regex, java.lang.String origStr, java.lang.String replaceVal)
protected boolean
setHeapMaxField()
protected void
writeLaxOptionsFile()
write startup options file which is used during InstallAnywhere to run the executable.protected void
writePlistOptionsFile()
write startup options file which is used during InstallAnywhere to run the executable.protected void
writeStartOptionsFile()
protected void
writeVMOptionsFile(java.io.File vmoptionsFile)
Write out changes to the vmoptions file used to set the VM max heap size.-
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
-
optionFlag
private static final java.lang.String optionFlag
Flag to the java-runtime (as used in the XML-files) to indicate a memory-option. Literally,-X
.- See Also:
- Constant Field Values
-
maxHeapOption
private static final java.lang.String maxHeapOption
Flag to the java-runtime (as used in the XML-files) to indicate an maximum heap-size memory-option. Literally,mx
.- See Also:
- Constant Field Values
-
maxHeapLAX
private static final java.lang.String maxHeapLAX
Flag to the java-runtime (as used in the LAX-files) to indicate an maximum heap-size memory-option. Literally,lax.nl.java.option.java.heap.size.max=
.- See Also:
- Constant Field Values
-
vmoptionsExt
private static final java.lang.String vmoptionsExt
- See Also:
- Constant Field Values
-
laxExt
private static final java.lang.String laxExt
- See Also:
- Constant Field Values
-
plistExt
private static final java.lang.String plistExt
- See Also:
- Constant Field Values
-
debugLauncherStr
private static final java.lang.String debugLauncherStr
- See Also:
- Constant Field Values
-
macAppVMOptions
private static final java.lang.String macAppVMOptions
- See Also:
- Constant Field Values
-
MIN_HEAP_SIZE
private static final int MIN_HEAP_SIZE
- See Also:
- Constant Field Values
-
vmType
private static JDialogMemoryAllocation.VMConfigType vmType
-
maxHeapText
private javax.swing.JTextField maxHeapText
DOCUMENT ME!
-
startupFile
private java.io.File startupFile
Contains all java properties of the MIPAV app (used at least when loading!)
-
usePreferencesButton
private javax.swing.JButton usePreferencesButton
DOCUMENT ME!
-
userInterface
private final ViewUserInterface userInterface
DOCUMENT ME!
-
-
Constructor Detail
-
JDialogMemoryAllocation
public JDialogMemoryAllocation()
builds the dialog interface to get user to change the lax-file settings for the JVM to use on java start-up. calls to read the InstallAnywhere start up file then parses it, line-by-line to come up with the memory options for the dialog. Waits for user input to declare what memory settings should be applied into the start-up file. InstallAnywhere will read those settings for the next time it restarts the application.Failure to read the startup file will dispose the dialog before it is displayed.
-
JDialogMemoryAllocation
public JDialogMemoryAllocation(ViewUserInterface ui, boolean checkOnPreferences)
strictly reads the memory settings from the LAX-file.- Parameters:
ui
- A reference to the VUI. Must be passed in since this dialog may be called while the VUI is still being constructed (can't use VUI.getReference()).checkOnPreferences
- Whether this is a preferences-vs-lax file check.
-
-
Method Detail
-
getStartupFile
public static java.io.File getStartupFile() throws java.io.FileNotFoundException
This method returns the startup file which contains the MIPAV start-up options. For most systems, the options are kept in a file called "mipav.lax". For Macintosh OS 10 (X), the application in the application menu is actually a directory "mipav.app" In this case, the start-up file is in "mipav.app/Contents/Info.plist". This method gets the application name ("mipav" or "iaso") and looks for a .lax file with that name; if it cannot find a .lax file, it then looks for a file "Info.plist" in the directory with the name of the application (.app)/Contents/.Ideally, the GetPath would look in application.app/Contents, but for now that location is found here.
- Parameters:
ui
- The main user-interface.- Returns:
- DOCUMENT ME!
- Throws:
java.io.FileNotFoundException
- when the app title is not in the preferences file or the ViewUserInterface isnull
.
-
getAppName
public static java.lang.String getAppName() throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
getVMOptionsStartupFile
public static java.io.File getVMOptionsStartupFile(java.lang.String app, boolean debug) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
getLaxStartupFile
public static java.io.File getLaxStartupFile(java.lang.String app) throws java.io.FileNotFoundException
This method returns the startup file which contains the MIPAV start-up options. For most systems, the options are kept in a file called "mipav.lax". This method gets the application name ("mipav" or "iaso") and looks for a .lax file with that name.- Parameters:
app
- The application name.- Returns:
- DOCUMENT ME!
- Throws:
java.io.FileNotFoundException
- when the app title is not in the preferences file or the ViewUserInterface isnull
.
-
getPlistStartupFile
public static java.io.File getPlistStartupFile(java.lang.String app) throws java.io.FileNotFoundException
This method returns the startup file which contains the MIPAV start-up options. For most systems, the options are kept in a file called "mipav.lax". For Macintosh OS 10 (X), the application in the application menu is actually a directory "mipav.app" In this case, the start-up file is in "mipav.app/Contents/Info.plist". This method gets the application name ("mipav" or "iaso") and looks for a .lax file with that name; if it cannot find a .lax file, it then looks for a file "Info.plist" in the directory with the name of the application (.app)/Contents/.Ideally, the GetPath would look in application.app/Contents, but for now that location is found here.
- Parameters:
app
- The application name.- Returns:
- DOCUMENT ME!
- Throws:
java.io.FileNotFoundException
- when the app title is not in the preferences file or the ViewUserInterface isnull
.
-
setHeapMaxField
protected boolean setHeapMaxField() throws java.io.IOException, java.io.FileNotFoundException
- Throws:
java.io.IOException
java.io.FileNotFoundException
-
readHeapMax
public static java.lang.String readHeapMax(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
- Throws:
java.io.IOException
java.io.FileNotFoundException
-
readVMOptionsFileHeapMax
protected static java.lang.String readVMOptionsFileHeapMax(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
- Throws:
java.io.IOException
java.io.FileNotFoundException
-
readLaxFileHeapMax
public static java.lang.String readLaxFileHeapMax(java.io.File lax) throws java.io.IOException, java.io.FileNotFoundException
Reads the InstallAnywhere startup file and returns the start up heap memory string. Method can read LAX (Window,UNIX) finds the entryJDialogMemoryAllocation#maxHeap
. It returns the values of the associated entry in Megabytes.- Parameters:
lax
- The File referring to the InstallAnywhere startup options LAX- Returns:
- The maximum heap size-text
- Throws:
java.io.IOException
- when the LAX file cannot be read.java.io.FileNotFoundException
- When the LAX file cannot be found.
-
readPlistFileHeapMax
public static java.lang.String readPlistFileHeapMax(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
Reads the InstallAnywhere startup file and returns the start up heap memory string. Method can reads Info preferences list (Mac OS X) file, and findsJDialogMemoryAllocation#maxHeap
. It returns the values of the associated entry in Megabytes.- Parameters:
lax
- The File referring to the InstallAnywhere startup options PLIST file- Returns:
- The maximum heap size-text
- Throws:
java.io.IOException
- when the PLIST file cannot be read.java.io.FileNotFoundException
- When the LAX PLIST cannot be found.
-
readFileContents
protected static java.lang.String readFileContents(java.io.File file) throws java.io.IOException, java.io.FileNotFoundException
- Throws:
java.io.IOException
java.io.FileNotFoundException
-
getVMOptionsMaxHeap
protected static final java.lang.String getVMOptionsMaxHeap(java.lang.String line)
-
isVMOptionsFile
protected static final boolean isVMOptionsFile(java.io.File file)
-
isLaxFile
protected static final boolean isLaxFile(java.io.File file)
-
isPListFile
protected static final boolean isPListFile(java.io.File file)
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
Reads event from one of the buttons to perform that buttons action. Buttons include OK, Cancel, Use Preferences and HELP- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classJDialogBase
- Parameters:
ae
- The button's fired action event.
-
buildButtons
public javax.swing.JPanel buildButtons(boolean includePrefs)
creates the buttons, USE PREFERENCES, OKAY, CANCEL, and HELP. Over-ridesJDialog#buildButtons()
if includesPrefs is false, otherwise, it returns what JDialog#buildButtons() returns.- Parameters:
includePrefs
- If the preferences are available, the "Use Preferences" button is added to the panel when it is returned.- Returns:
- A JPanel which holds the buttons for user input.
-
convertBytesToMBytes
protected static java.lang.String convertBytesToMBytes(java.lang.String byteString) throws java.lang.NumberFormatException
convert the number given by the string (assuming it is a number indicating a quantity of bytes) to a number indicating a quantity of megabytes. If the input is improperly formatted it throws a NumberFormatException.- Parameters:
byteString
- a number indicating a quantity of bytes- Returns:
- String a number indicating the rounded value of the input as a megabyte
- Throws:
java.lang.NumberFormatException
- if the byteString cannot be represented as a number.
-
convertBytesToGBytes
protected static java.lang.String convertBytesToGBytes(java.lang.String byteString) throws java.lang.NumberFormatException
convert the number given by the string (assuming it is a number indicating a quantity of bytes) to a number indicating a quantity of gigabytes. If the input is improperly formatted it throws a NumberFormatException.- Parameters:
byteString
- a number indicating a quantity of bytes- Returns:
- String a number indicating the rounded value of the input as a gigabyte
- Throws:
java.lang.NumberFormatException
- if the byteString cannot be represented as a number.
-
convertKBytesToMBytes
protected static java.lang.String convertKBytesToMBytes(java.lang.String kilobyteString) throws java.lang.NumberFormatException
convert the number given by the string (assuming it is a number indicating a quantity of kilabytes) to a number indicating a quantity of megabytes. If the input is improperly formatted it throws a NumberFormatException.- Parameters:
kilobyteString
- a number indicating a quantity of kilobytes- Returns:
- String a number indicating the rounded value of the input as a byte
- Throws:
java.lang.NumberFormatException
- DOCUMENT ME!
-
convertMBytesToGBytes
protected static java.lang.String convertMBytesToGBytes(java.lang.String megabyteString) throws java.lang.NumberFormatException
convert the number given by the string (assuming it is a number indicating a quantity of megabytes) to a number indicating a quantity of gigabytes. If the input is improperly formatted it throws a NumberFormatException.- Parameters:
kilobyteString
- a number indicating a quantity of megabytes- Returns:
- String a number indicating the rounded value of the input in gigabytes
- Throws:
java.lang.NumberFormatException
- DOCUMENT ME!
-
convertGBytesToMBytes
protected static java.lang.String convertGBytesToMBytes(java.lang.String gigabyteString) throws java.lang.NumberFormatException
convert the number given by the string (assuming it is a number indicating a quantity of gigabytes) to a number indicating a quantity of megabytes. If the input is improperly formatted it throws a NumberFormatException.- Parameters:
kilobyteString
- a number indicating a quantity of gigabytes- Returns:
- String a number indicating the rounded value of the input in megabytes
- Throws:
java.lang.NumberFormatException
- DOCUMENT ME!
-
convertKBytesToGBytes
protected static java.lang.String convertKBytesToGBytes(java.lang.String kilobyteString) throws java.lang.NumberFormatException
convert the number given by the string (assuming it is a number indicating a quantity of kilabytes) to a number indicating a quantity of gigabytes. If the input is improperly formatted it throws a NumberFormatException.- Parameters:
kilobyteString
- a number indicating a quantity of kilobytes- Returns:
- String a number indicating the rounded value of the input as gigabytes
- Throws:
java.lang.NumberFormatException
- DOCUMENT ME!
-
convertMBytesToBytes
protected static java.lang.String convertMBytesToBytes(java.lang.String megabyteString) throws java.lang.NumberFormatException
convert the number given by the string (assuming it is a number indicating a quantity of megabytes) to a number indicating a quantity of bytes. If the input is improperly formatted it throws a NumberFormatException.- Parameters:
megabyteString
- a number indicating a quantity of megabytes- Returns:
- String a number indicating the rounded value of the input as a byte
- Throws:
java.lang.NumberFormatException
- DOCUMENT ME!
-
convertGBytesToBytes
protected static java.lang.String convertGBytesToBytes(java.lang.String gigabyteString) throws java.lang.NumberFormatException
convert the number given by the string (assuming it is a number indicating a quantity of gigabytes) to a number indicating a quantity of bytes. If the input is improperly formatted it throws a NumberFormatException.- Parameters:
megabyteString
- a number indicating a quantity of gigabytes- Returns:
- String a number indicating the rounded value of the input as a byte
- Throws:
java.lang.NumberFormatException
- DOCUMENT ME!
-
interpretLAX
protected static java.lang.String[] interpretLAX(java.lang.String line)
reads the given line of a LAX file to search for the initial heap size and maximum heap size Strings.if the line starts with initial or max size strings given by initHeapLAX or maxHeapLAX, the value is converted into megabytes and loaded into the appropriate textBox.
If the value found is not possible (ie., the conversion threw a NumberFormatException), the substitute "1" is given.
- Parameters:
line
- A line of a LAX file which is to be searched for the memory strings.- Returns:
- the heap string, including LAX file variable name, the value in the text box as it would be found in the file.
-
interpretXML
protected static java.lang.String[] interpretXML(java.lang.String line)
reads the given line of a plist file to search for the initial heap size and maximum heap size Strings.If the file contains the "-X" java option the value is parsed out. the value is converted into megabytes, if needed and loaded into the appropriate textBox.
If the value found is not possible (ie., the conversion threw a NumberFormatException), the substitute "1" is given.
- Parameters:
line
- A line of an XML file which is to be searched for the memory strings.- Returns:
- the heap string, including XML formatting, the value in the text box as it would be found in the file.
-
createInputPanel
protected javax.swing.JPanel createInputPanel(boolean usePrefs)
creates the main panel with all the inputs.. argumenttrue
includes preferences if available. argumentfalse
does not include preferences ever.- Parameters:
usePrefs
- Whether or not to include the preferences, if available.- Returns:
- DOCUMENT ME!
-
writeStartOptionsFile
protected void writeStartOptionsFile() throws java.io.IOException
- Throws:
java.io.IOException
-
writeVMOptionsFile
protected void writeVMOptionsFile(java.io.File vmoptionsFile) throws java.io.IOException
Write out changes to the vmoptions file used to set the VM max heap size.- Throws:
java.io.IOException
- DOCUMENT ME!
-
writePlistOptionsFile
protected void writePlistOptionsFile() throws java.io.IOException
write startup options file which is used during InstallAnywhere to run the executable. The starting options file it writes out is the one which would be native to the system (that is, on Windows or UNIX systems, the startup file is a LAX file; on the Macintosh OS 10 systems, it is the Info.plist file) as determined when by {@see getStartupFile} during dialog instantiation. This method writes initHeapText and maxHeapText to the appropriate start and max values.- Throws:
java.io.IOException
- DOCUMENT ME!
-
writeLaxOptionsFile
protected void writeLaxOptionsFile() throws java.io.IOException
write startup options file which is used during InstallAnywhere to run the executable. The starting options file it writes out is the one which would be native to the system (that is, on Windows or UNIX systems, the startup file is a LAX file; on the Macintosh OS 10 systems, it is the Info.plist file) as determined when by {@see getStartupFile} during dialog instantiation. This method writes initHeapText and maxHeapText to the appropriate start and max values.- Throws:
java.io.IOException
- DOCUMENT ME!
-
replacePatternMultiline
protected static java.lang.String replacePatternMultiline(java.lang.String regex, java.lang.String origStr, java.lang.String replaceVal)
-
-