Revision 6897 org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.raster/org.gvsig.raster.lib/org.gvsig.raster.lib.legend/org.gvsig.raster.lib.legend.impl/src/main/java/org/gvsig/raster/lib/legend/impl/DefaultRasterLegend.java
DefaultRasterLegend.java | ||
---|---|---|
26 | 26 |
import org.gvsig.raster.lib.buffer.api.FilterList; |
27 | 27 |
import org.gvsig.raster.lib.buffer.api.NoData; |
28 | 28 |
import org.gvsig.raster.lib.buffer.api.exceptions.BufferException; |
29 |
import org.gvsig.raster.lib.buffer.api.statistics.Statistics; |
|
30 | 29 |
import org.gvsig.raster.lib.legend.api.ColorInterpretation; |
31 | 30 |
import org.gvsig.raster.lib.legend.api.ColorTable; |
32 | 31 |
import org.gvsig.raster.lib.legend.api.RasterLegend; |
... | ... | |
38 | 37 |
import org.gvsig.tools.persistence.PersistenceManager; |
39 | 38 |
import org.gvsig.tools.persistence.PersistentState; |
40 | 39 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
40 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
41 | 41 |
import org.gvsig.tools.task.SimpleTaskStatus; |
42 | 42 |
import org.gvsig.tools.task.TaskStatusManager; |
43 | 43 |
|
... | ... | |
331 | 331 |
BufferedImage image = null; |
332 | 332 |
|
333 | 333 |
if (colorInterpretation.isRGB() || colorInterpretation.isRGBA() || colorInterpretation.hasAnyRGBBand()) { |
334 |
image = |
|
335 |
new BufferedImage(buffer.getColumns(), buffer.getRows(), |
|
334 |
image = ToolsSwingLocator.getToolsSwingManager().createBufferedImage(buffer.getColumns(), buffer.getRows(), |
|
336 | 335 |
BufferedImage.TYPE_INT_ARGB); |
337 | 336 |
} else if (colorInterpretation.isBGR()) { |
338 |
image = |
|
339 |
new BufferedImage(buffer.getColumns(), buffer.getRows(), BufferedImage.TYPE_INT_BGR);
|
|
337 |
image = ToolsSwingLocator.getToolsSwingManager().createBufferedImage(buffer.getColumns(), buffer.getRows(),
|
|
338 |
BufferedImage.TYPE_INT_BGR); |
|
340 | 339 |
} |
341 | 340 |
|
342 | 341 |
if (image == null) { |
... | ... | |
677 | 676 |
|
678 | 677 |
BufferedImage image = null; |
679 | 678 |
|
680 |
image = |
|
681 |
new BufferedImage(buffer.getColumns(), buffer.getRows(), |
|
682 |
BufferedImage.TYPE_INT_ARGB); |
|
679 |
image = ToolsSwingLocator.getToolsSwingManager().createBufferedImage(buffer.getColumns(), buffer.getRows(), |
|
680 |
BufferedImage.TYPE_INT_ARGB); |
|
683 | 681 |
|
684 | 682 |
int hueBandIndex = colorInterpretation.getBand(ColorInterpretation.HUE_BAND); |
685 | 683 |
int saturationBandIndex = colorInterpretation.getBand(ColorInterpretation.SATURATION_BAND); |
... | ... | |
735 | 733 |
|
736 | 734 |
BufferedImage image = null; |
737 | 735 |
|
738 |
image = |
|
739 |
new BufferedImage(buffer.getColumns(), buffer.getRows(), |
|
740 |
BufferedImage.TYPE_INT_ARGB); |
|
736 |
image = ToolsSwingLocator.getToolsSwingManager().createBufferedImage(buffer.getColumns(), buffer.getRows(), |
|
737 |
BufferedImage.TYPE_INT_ARGB); |
|
741 | 738 |
|
742 | 739 |
int cyanBandIndex = colorInterpretation.getBand(ColorInterpretation.CYAN_BAND); |
743 | 740 |
int magentaBandIndex = colorInterpretation.getBand(ColorInterpretation.MAGENTA_BAND); |
... | ... | |
802 | 799 |
|
803 | 800 |
BufferedImage image = null; |
804 | 801 |
|
805 |
image = |
|
806 |
new BufferedImage(buffer.getColumns(), buffer.getRows(), |
|
807 |
BufferedImage.TYPE_INT_ARGB); |
|
802 |
image = ToolsSwingLocator.getToolsSwingManager().createBufferedImage(buffer.getColumns(), buffer.getRows(), |
|
803 |
BufferedImage.TYPE_INT_ARGB); |
|
808 | 804 |
|
809 | 805 |
int yIndex = colorInterpretation.getBand(ColorInterpretation.YCBCR_Y_BAND); |
810 | 806 |
int cbBandIndex = colorInterpretation.getBand(ColorInterpretation.YCBCR_CB_BAND); |
... | ... | |
868 | 864 |
|
869 | 865 |
BufferedImage image = null; |
870 | 866 |
|
871 |
image = |
|
872 |
new BufferedImage(buffer.getColumns(), buffer.getRows(), BufferedImage.TYPE_INT_ARGB);
|
|
867 |
image = ToolsSwingLocator.getToolsSwingManager().createBufferedImage(buffer.getColumns(), buffer.getRows(),
|
|
868 |
BufferedImage.TYPE_INT_ARGB); |
|
873 | 869 |
|
874 | 870 |
Band greyBand = buffer.getBand(0); |
875 | 871 |
|
876 |
Statistics statistics = buffer.getStatistics(null); |
|
872 |
// Statistics statistics = buffer.getStatistics(null);
|
|
877 | 873 |
// double maximum = statistics.getMaximun();// ver drawRGBBuffer |
878 | 874 |
// double minimum = statistics.getMinimun(); |
879 | 875 |
|
... | ... | |
930 | 926 |
private Image drawPaletteBuffer(Graphics graphics, Buffer buffer, ColorTable colorTable, |
931 | 927 |
Transparency transparency, FilterList filters) { |
932 | 928 |
|
933 |
BufferedImage image = |
|
934 |
new BufferedImage(buffer.getColumns(), buffer.getRows(), BufferedImage.TYPE_INT_ARGB);
|
|
929 |
BufferedImage image = ToolsSwingLocator.getToolsSwingManager().createBufferedImage(buffer.getColumns(), buffer.getRows(),
|
|
930 |
BufferedImage.TYPE_INT_ARGB); |
|
935 | 931 |
|
936 | 932 |
for (int i = 0; i < buffer.getRows(); i++) { |
937 | 933 |
for (int j = 0; j < buffer.getColumns(); j++) { |
Also available in: Unified diff