root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.gui / src / main / java / es / unex / sextante / gui / algorithm / IconFieldComboBoxRenderer.java @ 338
History | View | Annotate | Download (1003 Bytes)
1 | 315 | omartinez | /*
|
---|---|---|---|
2 | * To change this license header, choose License Headers in Project Properties.
|
||
3 | * To change this template file, choose Tools | Templates
|
||
4 | * and open the template in the editor.
|
||
5 | */
|
||
6 | package es.unex.sextante.gui.algorithm; |
||
7 | |||
8 | import es.unex.sextante.dataObjects.IVectorLayer; |
||
9 | import java.awt.Color; |
||
10 | import javax.swing.Icon; |
||
11 | import java.awt.Component; |
||
12 | import java.awt.Graphics; |
||
13 | /**
|
||
14 | *
|
||
15 | * @author osc
|
||
16 | */
|
||
17 | public class IconFieldComboBoxRenderer implements Icon { |
||
18 | public String fieldType; |
||
19 | |||
20 | public IconFieldComboBoxRenderer(String fieldType) { |
||
21 | this.fieldType = fieldType;
|
||
22 | } |
||
23 | |||
24 | @Override
|
||
25 | public int getIconHeight() { |
||
26 | return 20; |
||
27 | } |
||
28 | |||
29 | @Override
|
||
30 | public int getIconWidth() { |
||
31 | return 20; |
||
32 | } |
||
33 | |||
34 | @Override
|
||
35 | public void paintIcon(Component c, Graphics g, int x, int y) { |
||
36 | if (false) { |
||
37 | g.setColor(Color.BLUE);
|
||
38 | g.drawRect(2, 2, 10, 10); |
||
39 | } else {
|
||
40 | g.setColor(Color.BLUE);
|
||
41 | g.drawOval(5, 5, 4, 4); |
||
42 | g.drawRect(2, 2, 10, 10); |
||
43 | } |
||
44 | } |
||
45 | } |