Merge "Issue #2361 remove using SerializationUtil for processing XML colormaps" into development
Former-commit-id:695f25ba66
[formerly3480148f14
] [formerlybca5793e3d
] [formerly695f25ba66
[formerly3480148f14
] [formerlybca5793e3d
] [formerlyda8a858727
[formerlybca5793e3d
[formerly 621fb8fce876fdd3bde1b37d43d5f00945cd50f5]]]] Former-commit-id:da8a858727
Former-commit-id:493d79f524
[formerlyddebd81c73
] [formerly 9671b7375763905e318a2a92acb4933c27a059b8 [formerlyd758e5ab57
]] Former-commit-id: 58b849d5f1654c0d9121acbfd8935de1329365c0 [formerlyf1b25ed227
] Former-commit-id:83c9d010c4
This commit is contained in:
commit
7cd003eda9
8 changed files with 29 additions and 29 deletions
|
@ -38,7 +38,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
|||
import com.raytheon.uf.common.localization.PathManager;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
/**
|
||||
|
@ -57,6 +56,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* Aug 06, 2013 2210 njensen Moved colormaps to common_static
|
||||
* Sep 18, 2013 2421 bsteffen Moved some listing capabilities into
|
||||
* ColorMapTree.
|
||||
* Nov 11, 2013 2361 njensen Use ColorMap.JAXB for XML processing
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -263,8 +263,8 @@ public class ColorMapLoader {
|
|||
private static IColorMap loadColorMap(String name,
|
||||
LocalizationFile colorMapFile) throws SerializationException {
|
||||
if (colorMapFile != null) {
|
||||
ColorMap cm = SerializationUtil.jaxbUnmarshalFromXmlFile(
|
||||
ColorMap.class, colorMapFile.getFile().getAbsolutePath());
|
||||
ColorMap cm = ColorMap.JAXB.unmarshalFromXmlFile(colorMapFile
|
||||
.getFile().getAbsolutePath());
|
||||
cm.setName(name);
|
||||
cm.setChanged(false);
|
||||
return cm;
|
||||
|
|
|
@ -36,7 +36,6 @@ import com.raytheon.uf.common.colormap.ColorMap;
|
|||
import com.raytheon.uf.common.colormap.IColorMap;
|
||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.viz.ui.dialogs.colordialog.ColorData;
|
||||
import com.raytheon.viz.ui.dialogs.colordialog.ColorEditComposite;
|
||||
import com.raytheon.viz.ui.dialogs.colordialog.IColorEditCompCallback;
|
||||
|
@ -52,6 +51,7 @@ import com.raytheon.viz.ui.dialogs.colordialog.IColorEditCompCallback;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 18, 2010 mschenke Initial creation
|
||||
* Nov 11, 2013 2361 njensen Use ColorMap.JAXB for XML processing
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -161,8 +161,7 @@ public class ColorMapEditor extends EditorPart implements
|
|||
IFileEditorInput fei = (IFileEditorInput) input;
|
||||
File file = fei.getFile().getRawLocation().toFile();
|
||||
try {
|
||||
IColorMap cmap = (IColorMap) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(file);
|
||||
IColorMap cmap = ColorMap.JAXB.unmarshalFromXmlFile(file);
|
||||
fakeParameters = new ColorMapParameters();
|
||||
fakeParameters.setColorMap(cmap);
|
||||
fakeParameters.setColorMapMin(0);
|
||||
|
|
|
@ -30,12 +30,9 @@ import org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart;
|
|||
|
||||
import com.raytheon.uf.common.colormap.ColorMap;
|
||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.status.StatusConstants;
|
||||
import com.raytheon.viz.ui.UiPlugin;
|
||||
import com.raytheon.viz.ui.dialogs.colordialog.ColorData;
|
||||
import com.raytheon.viz.ui.dialogs.colordialog.IColorEditCompCallback;
|
||||
|
||||
|
@ -50,7 +47,8 @@ import com.raytheon.viz.ui.dialogs.colordialog.IColorEditCompCallback;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 18, 2010 mschenke Initial creation
|
||||
* Nov 18, 2010 mschenke Initial creation
|
||||
* Nov 11, 2013 2361 njensen Use ColorMap.JAXB for XML processing
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -61,7 +59,8 @@ import com.raytheon.viz.ui.dialogs.colordialog.IColorEditCompCallback;
|
|||
@SuppressWarnings("restriction")
|
||||
public class ColorMapMultiPageEditorPart extends XMLMultiPageEditorPart
|
||||
implements IColorEditCompCallback {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(ColorMapMultiPageEditorPart.class);
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ColorMapMultiPageEditorPart.class);
|
||||
|
||||
private ColorMapEditor editor;
|
||||
|
||||
|
@ -103,7 +102,7 @@ public class ColorMapMultiPageEditorPart extends XMLMultiPageEditorPart
|
|||
}
|
||||
if (editor != null) {
|
||||
try {
|
||||
String newXml = SerializationUtil
|
||||
String newXml = ColorMap.JAXB
|
||||
.marshalToXml((ColorMap) getColorMapParameters()
|
||||
.getColorMap());
|
||||
IDocument document = editor.getDocumentProvider().getDocument(
|
||||
|
|
|
@ -39,7 +39,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
|
@ -54,6 +53,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* Aug 20, 2008 dglazesk Updated for the new ColorMap interface
|
||||
* and for the JiBX to JaXB transition
|
||||
* Aug 06, 2013 2210 njensen Moved colormaps to common_static
|
||||
* Nov 11, 2013 2361 njensen Use ColorMap.JAXB for XML processing
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -181,7 +181,7 @@ public class ColorUtil {
|
|||
}
|
||||
|
||||
try {
|
||||
SerializationUtil.jaxbMarshalToXmlFile(aColorMap, path.toString());
|
||||
ColorMap.JAXB.marshalToXmlFile(aColorMap, path.toString());
|
||||
} catch (SerializationException e) {
|
||||
throw new VizException("Unable to serialize ColorMap "
|
||||
+ aColorMap.getName(), e);
|
||||
|
@ -250,7 +250,7 @@ public class ColorUtil {
|
|||
String xml;
|
||||
try {
|
||||
// JAXB marshaling
|
||||
xml = SerializationUtil.marshalToXml(aColorMap);
|
||||
xml = ColorMap.JAXB.marshalToXml(aColorMap);
|
||||
} catch (JAXBException e1) {
|
||||
throw new LocalizationOpFailedException(
|
||||
"Unable to Marshal colormap " + aColorMap.getName(), e1);
|
||||
|
|
|
@ -36,7 +36,6 @@ import com.raytheon.uf.common.localization.IPathManager;
|
|||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -55,6 +54,7 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* Feb 15, 2013 1638 mschenke Moved IndexColorModel creation to common.colormap utility
|
||||
* Mar 14, 2013 1794 djohnson FileUtil.listFiles now returns List.
|
||||
* Aug 06, 2013 2210 njensen Moved colormaps to common_static
|
||||
* Nov 11, 2013 2361 njensen Use ColorMap.JAXB for XML processing
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -113,8 +113,7 @@ public class ColorMapManager {
|
|||
if (baseFile.exists()) {
|
||||
|
||||
try {
|
||||
map = (ColorMap) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(baseFilePath);
|
||||
map = ColorMap.JAXB.unmarshalFromXmlFile(baseFilePath);
|
||||
} catch (SerializationException e) {
|
||||
throw new ColorTableException("Exception during serialization "
|
||||
+ baseFilePath, e);
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
com.raytheon.uf.common.colormap.ColorMap
|
||||
com.raytheon.uf.common.colormap.prefs.ColorMapParameters
|
||||
|
|
|
@ -33,7 +33,7 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
||||
|
||||
/**
|
||||
* Implementation of a colormap
|
||||
|
@ -51,6 +51,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
* usable
|
||||
* Jan 10, 2013 15648 ryu Added removeDuplicates() method.
|
||||
* Apr 18, 2013 1920 mpduff Default changed to true.
|
||||
* Nov 11, 2013 2361 njensen Added JAXB
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -59,7 +60,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
*/
|
||||
@XmlRootElement(name = "colorMap")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class ColorMap extends AbstractColorMap implements ISerializableObject {
|
||||
public class ColorMap extends AbstractColorMap {
|
||||
|
||||
public static final SingleTypeJAXBManager<ColorMap> JAXB = SingleTypeJAXBManager
|
||||
.createWithoutException(ColorMap.class);
|
||||
|
||||
@XmlElements({ @XmlElement(name = "color", type = Color.class) })
|
||||
List<Color> colors;
|
||||
|
@ -71,7 +75,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
|
|||
private boolean changed = true;
|
||||
|
||||
/**
|
||||
* Constructor used by JiBX
|
||||
* Constructor
|
||||
*/
|
||||
public ColorMap() {
|
||||
this.colors = new ArrayList<Color>();
|
||||
|
|
|
@ -21,7 +21,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
/**
|
||||
|
@ -43,6 +42,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* load/check for locked colormaps.
|
||||
* 04/10/2013 #958 qzhou Added SolarImage in getColorMapCategories.
|
||||
* 08/06/2013 2210 njensen Moved colormaps to common_static
|
||||
* Nov 11, 2013 2361 njensen Use ColorMap.JAXB for XML processing
|
||||
* </pre>
|
||||
*
|
||||
* @author Q. Zhou
|
||||
|
@ -77,8 +77,8 @@ public class ColorMapUtil {
|
|||
+ cmapCat + File.separator + name + ".cmap");
|
||||
|
||||
if (f != null) {
|
||||
ColorMap cm = (ColorMap) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(f.getAbsolutePath());
|
||||
ColorMap cm = ColorMap.JAXB.unmarshalFromXmlFile(f
|
||||
.getAbsolutePath());
|
||||
|
||||
cm.setName(name);
|
||||
return cm;
|
||||
|
@ -179,8 +179,8 @@ public class ColorMapUtil {
|
|||
File cmapFile = lclFile.getFile();
|
||||
|
||||
try {
|
||||
SerializationUtil.jaxbMarshalToXmlFile(colorMap,
|
||||
cmapFile.getAbsolutePath());
|
||||
ColorMap.JAXB
|
||||
.marshalToXmlFile(colorMap, cmapFile.getAbsolutePath());
|
||||
|
||||
lclFile.save();
|
||||
|
||||
|
@ -299,8 +299,8 @@ public class ColorMapUtil {
|
|||
if (files.containsKey(LocalizationLevel.SITE)) {
|
||||
f = files.get(LocalizationLevel.SITE).getFile();
|
||||
}
|
||||
ColorMap cm = (ColorMap) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(f.getAbsolutePath());
|
||||
ColorMap cm = ColorMap.JAXB.unmarshalFromXmlFile(f
|
||||
.getAbsolutePath());
|
||||
cm.setName(name);
|
||||
return cm;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue