public class MainView
extends org.jdesktop.application.FrameView
implements javax.swing.event.UndoableEditListener, javax.swing.event.ChangeListener, javax.swing.event.DocumentListener, org.jdesktop.application.Application.ExitListener, java.awt.event.ActionListener
Constructor and Description |
---|
MainView(org.jdesktop.application.SingleFrameApplication app)
Builds the main view of jNormaliz
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt) |
boolean |
canExit(java.util.EventObject event)
Confirms whether or not the user really wants to exit.
|
void |
changedUpdate(javax.swing.event.DocumentEvent e) |
boolean |
checkSaveBeforeClosing(java.lang.String message)
Method that opens a dialog box with the specified message, offering the
possibility of saving the input file and of canceling the operation
|
void |
clearConsole()
Clears the contents of the console
|
void |
closeFileAction()
Closes the currently opened input and output files, forcing the update of
the interface.
|
java.io.File |
getInputFile()
Get the current input file (if any).
|
void |
helpAlgorith()
Opens the dialog with help for the algorithms
|
void |
helpJNormalizAction() |
void |
helpNormaliz()
Opens Normaliz PDF documentation
|
void |
insertUpdate(javax.swing.event.DocumentEvent e)
Take note that file was changed
|
boolean |
isFileChanged()
Tests if input file has unsaved changes
|
boolean |
isFileLoaded()
Checks if there is a loaded input file
|
boolean |
isRunnable()
Returns whether or not the option for running Normaliz is available.
|
boolean |
isRunning()
Returns whether or not there is a currently running computation.
|
boolean |
isTextualTabSelected()
Indicates whether or not the currently selected tab has text to be printed.
|
boolean |
isUndo()
Returns whether or not there are undoable operations.
|
void |
jobFinished(boolean result)
Called when a Normaliz execution is finished.
|
boolean |
loadInputFile(java.io.File file)
Effectively loads a new input file, forcing the update of the
interface accordingly
|
void |
loadInputFileAction()
Offers the user the possibility of opening another input file.
|
boolean |
loadOutputFile(java.io.File file)
Loads the contents of the output file to the output file tab.
|
void |
newFileAction()
Opens the dialog for creating a new input file
|
void |
openDirectoryAction() |
void |
openWebAction() |
void |
printAction()
Opens the java print dialog to print the currently selected tab contents.
|
void |
removeUpdate(javax.swing.event.DocumentEvent e)
Take note that file was changed
|
void |
runNormalize()
Runs Normaliz command-line in background.
|
void |
saveFileAction()
Saves the currently opened input file.
|
void |
saveFileAsAction()
Offers the possibility of saving the currently opened input file with
another name.
|
void |
setFileLoaded(boolean b)
Updates the situation regarding whether or not there is an input file
currently loaded, updating the interface accordingly.
|
void |
setInputFile(java.io.File inputFile)
Changes the input file, updating interface and application state
accordingly.
|
void |
setRunning(boolean b)
Sets whether or not there is a currently running computation.
|
void |
setTextualTabSelected(boolean b)
Sets whether or not the currently selected tab has text to be printed.
|
void |
showAboutBox()
Shows about for of jNormaliz
|
void |
stateChanged(javax.swing.event.ChangeEvent evt) |
void |
stopNormaliz()
Interrupts a currently running execution of Normaliz
|
void |
undoableEditHappened(javax.swing.event.UndoableEditEvent e)
Registers a new undoable edit
|
void |
undoAction()
Undoes the most recent change in input file.
|
void |
updateConsole(java.lang.String text)
Adds more text to the console area
|
void |
updateMemory()
Updates physical memory information
|
void |
willExit(java.util.EventObject event) |
getApplication, getComponent, getContext, getMenuBar, getResourceMap, getStatusBar, getToolBar, getToolBars, setComponent, setMenuBar, setStatusBar, setToolBar, setToolBars
public MainView(org.jdesktop.application.SingleFrameApplication app)
app
- the application associated with this viewpublic java.io.File getInputFile()
public void setInputFile(java.io.File inputFile)
inputFile
- new input filepublic boolean isFileChanged()
public void jobFinished(boolean result)
result
- true if the execution was ok, false if Normaliz reported
some error.public void updateConsole(java.lang.String text)
text
- String to be addedpublic void updateMemory()
@Action public void showAboutBox()
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
public void stateChanged(javax.swing.event.ChangeEvent evt)
stateChanged
in interface javax.swing.event.ChangeListener
@Action(enabledProperty="runnable") public void runNormalize()
@Action public void clearConsole()
@Action public void loadInputFileAction()
public boolean loadInputFile(java.io.File file)
file
- the new input file to be loadedpublic boolean loadOutputFile(java.io.File file)
file
- output file to be loaded.@Action(enabledProperty="running") public void stopNormaliz()
@Action(enabledProperty="fileChanged") public void saveFileAction()
@Action(enabledProperty="fileLoaded") public void closeFileAction()
@Action(enabledProperty="fileLoaded") public void saveFileAsAction()
public boolean checkSaveBeforeClosing(java.lang.String message)
message
- the message to be displayed to the user@Action public void newFileAction()
@Action(enabledProperty="undo") public void undoAction()
public boolean isFileLoaded()
public void setFileLoaded(boolean b)
b
- true if there is an input file loaded, false otherwise@Action(enabledProperty="textualTabSelected") public void printAction()
public boolean isTextualTabSelected()
public void setTextualTabSelected(boolean b)
b
- the new value of this property.@Action public void helpNormaliz()
@Action public void helpAlgorith()
public boolean isRunning()
public void setRunning(boolean b)
b
- the new state of this property.public boolean isRunnable()
public boolean isUndo()
@Action public void openWebAction()
public boolean canExit(java.util.EventObject event)
canExit
in interface org.jdesktop.application.Application.ExitListener
event
- public void willExit(java.util.EventObject event)
willExit
in interface org.jdesktop.application.Application.ExitListener
public void undoableEditHappened(javax.swing.event.UndoableEditEvent e)
undoableEditHappened
in interface javax.swing.event.UndoableEditListener
e
- public void insertUpdate(javax.swing.event.DocumentEvent e)
insertUpdate
in interface javax.swing.event.DocumentListener
e
- public void removeUpdate(javax.swing.event.DocumentEvent e)
removeUpdate
in interface javax.swing.event.DocumentListener
e
- public void changedUpdate(javax.swing.event.DocumentEvent e)
changedUpdate
in interface javax.swing.event.DocumentListener
@Action public void helpJNormalizAction()
@Action(enabledProperty="fileLoaded") public void openDirectoryAction()