Revision 1086 org.gvsig.raster.tools/trunk/org.gvsig.raster.tools/org.gvsig.raster.tools.app/org.gvsig.raster.tools.app.basic/src/main/java/org/gvsig/raster/tools/app/basic/tool/colortable/ui/library/ColorTableIconPainter.java
ColorTableIconPainter.java | ||
---|---|---|
24 | 24 |
import java.awt.Color; |
25 | 25 |
import java.awt.Graphics2D; |
26 | 26 |
import java.awt.Rectangle; |
27 |
import java.util.ArrayList; |
|
27 | 28 |
|
28 | 29 |
import org.gvsig.fmap.dal.coverage.datastruct.ColorItem; |
29 | 30 |
import org.gvsig.fmap.dal.coverage.store.props.ColorTable; |
31 |
import org.gvsig.gui.ColorTablePainter; |
|
30 | 32 |
import org.gvsig.gui.beans.listview.IIconPaint; |
31 | 33 |
/** |
32 | 34 |
* Clase para dibujar los iconos del ListViewComponent del panel de color. Se |
... | ... | |
36 | 38 |
* @version 29/06/2007 |
37 | 39 |
* @author BorSanZa - Borja S?nchez Zamorano (borja.sanchez@iver.es) |
38 | 40 |
*/ |
39 |
public class ColorTableIconPainter implements IIconPaint { |
|
41 |
public class ColorTableIconPainter implements IIconPaint, ColorTablePainter {
|
|
40 | 42 |
private ColorTable colorTable; |
41 | 43 |
|
42 | 44 |
/** |
... | ... | |
62 | 64 |
public ColorTable getColorTable() { |
63 | 65 |
return colorTable; |
64 | 66 |
} |
67 |
|
|
68 |
/* |
|
69 |
* (non-Javadoc) |
|
70 |
* @see org.gvsig.gui.ColorTablePainter#getColors() |
|
71 |
*/ |
|
72 |
public Color[] getColors() { |
|
73 |
ArrayList<ColorItem> cItem = colorTable.getColorItems(); |
|
74 |
Color[] colorList = new Color[cItem.size()]; |
|
75 |
for (int i = 0; i < colorList.length; i++) { |
|
76 |
colorList[i] = cItem.get(i).getColor(); |
|
77 |
} |
|
78 |
return colorList; |
|
79 |
} |
|
65 | 80 |
|
66 | 81 |
/** |
67 | 82 |
* Metodo de pintado de la tabla de color |
... | ... | |
104 | 119 |
else |
105 | 120 |
g.setColor(new Color(96, 96, 96)); |
106 | 121 |
g.drawRect(x1, area.y, x2 - x1, area.height - 1); |
122 |
} |
|
123 |
|
|
124 |
/* |
|
125 |
* (non-Javadoc) |
|
126 |
* @see org.gvsig.gui.ColorTablePainter#getTableName() |
|
127 |
*/ |
|
128 |
public String getTableName() { |
|
129 |
return colorTable.getName(); |
|
107 | 130 |
} |
108 | 131 |
} |
Also available in: Unified diff