Revision 19378 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/enhanced/graphics/OutputHistogram.java
OutputHistogram.java | ||
---|---|---|
18 | 18 |
*/ |
19 | 19 |
package org.gvsig.rastertools.enhanced.graphics; |
20 | 20 |
|
21 |
import java.awt.BorderLayout; |
|
22 | 21 |
import java.awt.Color; |
23 |
import java.awt.GridBagConstraints; |
|
24 |
import java.awt.GridBagLayout; |
|
25 | 22 |
|
26 |
import javax.swing.JPanel; |
|
27 |
|
|
28 | 23 |
import org.gvsig.raster.beans.canvas.GCanvas; |
29 | 24 |
import org.gvsig.raster.beans.canvas.layers.Border; |
30 | 25 |
import org.gvsig.raster.beans.canvas.layers.GraphicHistogram; |
... | ... | |
36 | 31 |
* @author Nacho Brodin nachobrodin@gmail.com |
37 | 32 |
*/ |
38 | 33 |
public class OutputHistogram extends HistogramGraphicBase { |
39 |
private static final long serialVersionUID = 1L;
|
|
34 |
private static final long serialVersionUID = -3827308936130572914L;
|
|
40 | 35 |
|
41 | 36 |
/** |
42 | 37 |
* Crea una nueva instancia de OutputHistogram. |
43 | 38 |
*/ |
44 | 39 |
public OutputHistogram(Histogram hist, int[] renderBands, double[] minList, double[] maxList) { |
45 | 40 |
super(hist, renderBands, minList, maxList); |
46 |
init(); |
|
47 | 41 |
} |
48 |
|
|
49 |
/** |
|
50 |
* Inicializaci?n de componentes gr?ficos |
|
51 |
*/ |
|
52 |
protected void init() { |
|
53 |
super.init(); |
|
54 |
histogramColor = Color.GREEN; |
|
55 |
this.setLayout(new BorderLayout()); |
|
56 |
this.add(getCanvas(), BorderLayout.CENTER); |
|
57 |
this.add(getSouthPanel(), BorderLayout.SOUTH); |
|
58 |
} |
|
59 |
|
|
60 |
/* |
|
61 |
* (non-Javadoc) |
|
62 |
* @see org.gvsig.rastertools.enhanced.graphics.HistogramGraphicBase#createDrawableElements() |
|
63 |
*/ |
|
64 |
protected void createDrawableElements() { |
|
65 |
} |
|
66 | 42 |
|
67 | 43 |
/* |
68 | 44 |
* (non-Javadoc) |
... | ... | |
70 | 46 |
*/ |
71 | 47 |
public GCanvas getCanvas() { |
72 | 48 |
if (canvas == null) { |
73 |
GraphicHistogram gHist = new GraphicHistogram(histogramDrawed, histogramColor);
|
|
49 |
GraphicHistogram gHist = new GraphicHistogram(histogramDrawed, Color.GREEN);
|
|
74 | 50 |
gHist.setType(GraphicHistogram.TYPE_LINE); |
75 | 51 |
|
76 | 52 |
canvas = new GCanvas(Color.BLACK); |
77 |
canvas.setDrawableElement(new Border(borderColor));
|
|
78 |
canvas.setDrawableElement(gHist);
|
|
53 |
canvas.addDrawableElement(new Border(borderColor));
|
|
54 |
canvas.addDrawableElement(gHist);
|
|
79 | 55 |
} |
80 | 56 |
return canvas; |
81 | 57 |
} |
82 |
|
|
83 |
/* |
|
84 |
* (non-Javadoc) |
|
85 |
* @see org.gvsig.rastertools.enhanced.graphics.HistogramGraphicBase#getSouthPanel() |
|
86 |
*/ |
|
87 |
public JPanel getSouthPanel() { |
|
88 |
if(south == null) { |
|
89 |
south = new JPanel(); |
|
90 |
south.setLayout(new GridBagLayout()); |
|
91 |
GridBagConstraints gb = new GridBagConstraints(); |
|
92 |
gb.weightx = 1; |
|
93 |
|
|
94 |
gb.anchor = GridBagConstraints.WEST; |
|
95 |
south.add(getMinValue(), gb); |
|
96 |
|
|
97 |
gb.anchor = GridBagConstraints.EAST; |
|
98 |
south.add(getMaxValue(), gb); |
|
99 |
} |
|
100 |
return south; |
|
101 |
} |
|
102 | 58 |
} |
Also available in: Unified diff