Revision 23819 trunk/extensions/extSymbology/src/org/gvsig/symbology/gui/layerproperties/LabelTextStylePanel.java
LabelTextStylePanel.java | ||
---|---|---|
48 | 48 |
import java.util.ArrayList; |
49 | 49 |
|
50 | 50 |
import javax.swing.BorderFactory; |
51 |
import javax.swing.BoxLayout; |
|
51 | 52 |
import javax.swing.ButtonGroup; |
53 |
import javax.swing.JColorChooser; |
|
52 | 54 |
import javax.swing.JLabel; |
53 | 55 |
import javax.swing.JPanel; |
54 | 56 |
import javax.swing.JRadioButton; |
... | ... | |
60 | 62 |
import com.iver.andami.PluginServices; |
61 | 63 |
import com.iver.cit.gvsig.fmap.MapContext; |
62 | 64 |
import com.iver.cit.gvsig.fmap.core.symbols.ITextSymbol; |
65 |
import com.iver.cit.gvsig.gui.panels.ColorChooserPanel; |
|
63 | 66 |
import com.iver.cit.gvsig.gui.styling.JComboBoxUnitsReferenceSystem; |
64 | 67 |
|
65 | 68 |
public class LabelTextStylePanel extends JPanel implements ActionListener{ |
66 | 69 |
private static final long serialVersionUID = 8351591938535233138L; |
67 | 70 |
private ITextSymbol symbol; |
68 | 71 |
private JComboBoxFonts cmbFont; |
72 |
private ColorChooserPanel colorFont; |
|
69 | 73 |
private JRadioButton rdBtnTextHeight; |
70 | 74 |
private JRadioButton rdBtnFitOnTextArea; |
71 | 75 |
private JIncrementalNumberField incrTextSize; |
... | ... | |
77 | 81 |
public LabelTextStylePanel() { |
78 | 82 |
setLayout(new BorderLayout(10, 2)); |
79 | 83 |
JPanel aux = new JPanel(); |
84 |
aux.setLayout(new BoxLayout(aux,BoxLayout.Y_AXIS)); |
|
85 |
JPanel auxA = new JPanel(); |
|
80 | 86 |
aux.setBorder(BorderFactory.createTitledBorder(PluginServices.getText(this, "font"))); |
81 |
aux.add(new JLabel(PluginServices.getText(this, "font"))); |
|
82 |
aux.add(cmbFont = new JComboBoxFonts()); |
|
87 |
auxA.add(new JLabel(PluginServices.getText(this, "font"))); |
|
88 |
auxA.add(cmbFont = new JComboBoxFonts(),BorderLayout.NORTH); |
|
89 |
JPanel auxB = new JPanel(); |
|
90 |
auxB.add(new JLabel(PluginServices.getText(this, "color"))); |
|
91 |
auxB.add(colorFont = new ColorChooserPanel(true),BorderLayout.SOUTH); |
|
83 | 92 |
cmbFont.addActionListener(this); |
93 |
colorFont.addActionListener(this); |
|
94 |
aux.add(auxA); |
|
95 |
aux.add(auxB); |
|
84 | 96 |
add(aux, BorderLayout.WEST); |
85 | 97 |
|
86 | 98 |
aux = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 2)); |
... | ... | |
126 | 138 |
rdBtnFitOnTextArea.setSelected(textSymbol.isAutoresizeEnabled()); |
127 | 139 |
performAction = false; |
128 | 140 |
cmbFont.setSelectedItem(textSymbol.getFont().getName()); |
141 |
colorFont.setColor(textSymbol.getTextColor()); |
|
129 | 142 |
performAction = true; |
130 | 143 |
this.symbol = textSymbol; |
131 | 144 |
} |
... | ... | |
153 | 166 |
(String) cmbFont.getSelectedItem(), |
154 | 167 |
Font.PLAIN, |
155 | 168 |
0)); |
169 |
symbol.setTextColor(colorFont.getColor()); |
|
156 | 170 |
symbol.setFontSize(incrTextSize.getDouble()); |
157 | 171 |
} |
158 | 172 |
for (ActionListener l : listeners) { |
Also available in: Unified diff