Package mgui.io.domestic.maps
Class DiscreteColourMapLoader
java.lang.Object
mgui.io.FileLoader
mgui.io.domestic.maps.ColourMapLoader
mgui.io.domestic.maps.DiscreteColourMapLoader
- All Implemented Interfaces:
InterfaceIO
,IconObject
- Direct Known Subclasses:
CaretAreaColourLoader
,MricroLutLoader
public class DiscreteColourMapLoader extends ColourMapLoader
Loads a discrete colour map from either delimited ASCII or XML.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields inherited from class mgui.io.FileLoader
dataFile, dataURL, options
-
Constructor Summary
Constructors Constructor Description DiscreteColourMapLoader()
DiscreteColourMapLoader(java.io.File file)
-
Method Summary
Modifier and Type Method Description javax.swing.Icon
getObjectIcon()
Returns theIcon
associated with this object.boolean
load(InterfaceIOOptions options, ProgressUpdater progress_bar)
Loads data from the set of files or URLs specified byoptions
.ContinuousColourMap
loadAsContinuousMap(DiscreteColourMapInOptions.Format format, int no_anchors, boolean normalized)
Loads this discrete map as a continuous maps withno_anchors
anchors.DiscreteColourMap
loadMap()
DiscreteColourMap
loadMap(DiscreteColourMapInOptions.Format format, boolean normalized)
Loads a discrete colour map from the specified format.Methods inherited from class mgui.io.domestic.maps.ColourMapLoader
getSupportedObjects, loadMap, loadObject
Methods inherited from class mgui.io.FileLoader
getComplementIOType, getFailureMessage, getFile, getIOType, getOptions, getProgressMessage, getSuccessMessage, getTitle, getWriterComplement, load, load, loadObject, loadObject, loadObject, setFile, setOptions, setURL, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
map
-
-
Constructor Details
-
DiscreteColourMapLoader
public DiscreteColourMapLoader() -
DiscreteColourMapLoader
public DiscreteColourMapLoader(java.io.File file)
-
-
Method Details
-
load
Description copied from class:FileLoader
Loads data from the set of files or URLs specified byoptions
. Loading is controlled by the specifications ofoptions
. If loaded object is of typePersistentObject
, this method should also set the file loader and reference URL for the object.This method should also set the URL reference and writer and loader attributes to match this one and its complement.
- Overrides:
load
in classColourMapLoader
progress_bar
- An optional progress updater. Can benull
.- Returns:
-
loadMap
- Overrides:
loadMap
in classColourMapLoader
- Throws:
java.io.IOException
-
loadMap
public DiscreteColourMap loadMap(DiscreteColourMapInOptions.Format format, boolean normalized) throws java.io.IOExceptionLoads a discrete colour map from the specified format.- Parameters:
format
-- Returns:
- the map
- Throws:
java.io.IOException
-
loadAsContinuousMap
public ContinuousColourMap loadAsContinuousMap(DiscreteColourMapInOptions.Format format, int no_anchors, boolean normalized) throws java.io.IOExceptionLoads this discrete map as a continuous maps withno_anchors
anchors. This is useful for converting discrete look-up tables (LUTs) which are meant to be continuous.- Parameters:
no_anchors
-- Returns:
- the continuous version of this discrete map
- Throws:
java.io.IOException
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObject
Returns theIcon
associated with this object.- Specified by:
getObjectIcon
in interfaceIconObject
- Overrides:
getObjectIcon
in classFileLoader
- Returns:
-