Package gov.nih.mipav.view
Class ViewOpenFileUI
- java.lang.Object
-
- gov.nih.mipav.view.ViewFileChooserBase
-
- gov.nih.mipav.view.ViewOpenFileUI
-
public class ViewOpenFileUI extends ViewFileChooserBase
Opens an image file by calling FileIO.readImage and puts it into an image frame.- Version:
- 0.1 Sept 4, 1997
- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
FileIO
-
-
Field Summary
Fields Modifier and Type Field Description private int
filterType
Indicate what the current filter should be on opening the the dialog.private ModelImage
image
DOCUMENT ME!private ModelImage
image2
DOCUMENT ME!private ModelLUT
LUT
DOCUMENT ME!private ModelLUT
LUT2
DOCUMENT ME!private ModelRGB
modelRGB
DOCUMENT ME!private ModelRGB
modelRGB2
DOCUMENT ME!private boolean
putInFrame
DOCUMENT ME!private RawImageInfo
rawInfo
private boolean
setLastImageFlag
DOCUMENT ME!private boolean
xmlLinked
DOCUMENT ME!-
Fields inherited from class gov.nih.mipav.view.ViewFileChooserBase
chooser, dialog, directory, fileName, openedFile, UI
-
-
Constructor Summary
Constructors Constructor Description ViewOpenFileUI(boolean openDialog)
Creates the way to open and verify files before they are loaded by the FileIO.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.filechooser.FileFilter
findFilter(javax.swing.JFileChooser chooser, int filterType)
DOCUMENT ME!ModelImage
getImage()
DOCUMENT ME!ModelImage
getImage2()
DOCUMENT ME!java.lang.String
getImagePath()
Returns the path to the last opened image.ModelLUT
getLUT()
Returns the model LUT from the file.ModelLUT
getLUT2()
Returns the model LUT2 from the file.RawImageInfo
getRawImageInfo()
boolean
hasXMLLinked()
Indicates whether there is an xml linked image.boolean
isPutInFrame()
Returns whether or not the new image will be put into a frame.java.util.ArrayList<java.util.Vector<java.lang.String>>
open(boolean multiFile)
Open an image based on the suffix of the file.java.lang.String
open(java.lang.String fileName, boolean multiFile, FileInfoBase fileInfo)
Open an image based on the suffix of the file.java.util.ArrayList<java.util.Vector<java.lang.String>>
openJSON()
private ModelImage
readLinkedImage()
DOCUMENT ME!void
setFilterType(int fType)
Set the current filter type to the given parameter.void
setLastImage(boolean flag)
Indicates whether or not to put the image file path into the list of recently opened images.void
setPutInFrame(boolean putIn)
Indicates whether or not the new image should be put into a frame.void
setRawImageInfo(RawImageInfo rawInfo)
-
Methods inherited from class gov.nih.mipav.view.ViewFileChooserBase
getDirectory, getFileChooser, getFileDialog, getFileName, getOpenedFile, isMulti, setMulti, setSaveAs
-
-
-
-
Field Detail
-
filterType
private int filterType
Indicate what the current filter should be on opening the the dialog. The values for this are the static ints in ViewImageFileFilter.
-
image
private ModelImage image
DOCUMENT ME!
-
image2
private ModelImage image2
DOCUMENT ME!
-
LUT
private ModelLUT LUT
DOCUMENT ME!
-
LUT2
private ModelLUT LUT2
DOCUMENT ME!
-
modelRGB
private ModelRGB modelRGB
DOCUMENT ME!
-
modelRGB2
private ModelRGB modelRGB2
DOCUMENT ME!
-
putInFrame
private boolean putInFrame
DOCUMENT ME!
-
setLastImageFlag
private boolean setLastImageFlag
DOCUMENT ME!
-
xmlLinked
private boolean xmlLinked
DOCUMENT ME!
-
rawInfo
private RawImageInfo rawInfo
-
-
Constructor Detail
-
ViewOpenFileUI
public ViewOpenFileUI(boolean openDialog)
Creates the way to open and verify files before they are loaded by the FileIO.- Parameters:
openDialog
- a boolean that selects whether this UI should be built and displayed.true
indicates the UI will be displayed, andfalse
is that it will not be displayed.
-
-
Method Detail
-
findFilter
public static final javax.swing.filechooser.FileFilter findFilter(javax.swing.JFileChooser chooser, int filterType)
DOCUMENT ME!- Parameters:
chooser
- DOCUMENT ME!filterType
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getImage
public ModelImage getImage()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getImage2
public ModelImage getImage2()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getImagePath
public java.lang.String getImagePath()
Returns the path to the last opened image.- Returns:
- imagePath
-
getLUT
public ModelLUT getLUT()
Returns the model LUT from the file.- Returns:
- ModelLUT -- returns LUT.
-
getLUT2
public ModelLUT getLUT2()
Returns the model LUT2 from the file.- Returns:
- ModelLUT -- returns LUT2.
-
hasXMLLinked
public boolean hasXMLLinked()
Indicates whether there is an xml linked image.- Returns:
- xmllinked
-
isPutInFrame
public boolean isPutInFrame()
Returns whether or not the new image will be put into a frame.- Returns:
- boolean -- if true, then image will be put into a frame.
-
openJSON
public java.util.ArrayList<java.util.Vector<java.lang.String>> openJSON()
-
open
public java.util.ArrayList<java.util.Vector<java.lang.String>> open(boolean multiFile)
Open an image based on the suffix of the file.- Parameters:
multiFile
- Flag to indicate if image is an array of 2D image files (true
) or if the image is stored in a single file (false
).imageset
- DOCUMENT ME!- Returns:
- List of the names of the images that were opened.
-
open
public java.lang.String open(java.lang.String fileName, boolean multiFile, FileInfoBase fileInfo)
Open an image based on the suffix of the file.- Parameters:
fileName
- Full pathname of file to open.multiFile
- Flag to indicate if image is an array of 2D image files (true
) or if the image is stored in a single file (false
).fileInfo
- File info, can be null. In the case of RAW images read by the script, will not be null.- Returns:
- The image name of the image that was read in.
-
setFilterType
public void setFilterType(int fType)
Set the current filter type to the given parameter.- Parameters:
fType
- Indicate what the current filter should be on opening the the dialog. The values for this are the static ints in ViewImageFileFilter.
-
setLastImage
public void setLastImage(boolean flag)
Indicates whether or not to put the image file path into the list of recently opened images.- Parameters:
flag
- if true, then image path is put into recently used image list
-
setPutInFrame
public void setPutInFrame(boolean putIn)
Indicates whether or not the new image should be put into a frame.- Parameters:
putIn
- -- if true, then image is put into a frame.
-
setRawImageInfo
public void setRawImageInfo(RawImageInfo rawInfo)
-
getRawImageInfo
public RawImageInfo getRawImageInfo()
-
readLinkedImage
private ModelImage readLinkedImage()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
-