Revision 1942
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/resources-plugin/i18n/text_en.properties | ||
---|---|---|
23 | 23 |
_Calculate_the_minimun_of_the_selected_attribute_for_the_grouped_features=Calculate the minimun of the selected attribute for the grouped features |
24 | 24 |
_Select_style=Select style |
25 | 25 |
_Calculate_the_sum_of_the_selected_attribute_for_the_grouped_features=Calculate the sum of the selected attribute for the grouped features |
26 |
Sum=Sum |
|
26 |
Sum=Sum |
|
27 |
_Select_font=Select font |
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/resources-plugin/i18n/text.properties | ||
---|---|---|
24 | 24 |
_Select_style=Seleccion de estilo |
25 | 25 |
Sum=Suma |
26 | 26 |
_Calculate_the_sum_of_the_selected_attribute_for_the_grouped_features=Calcula la suma del atributo seleccionado para las features agrupadas |
27 |
_Select_font=Seleccione fuente |
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
44 | 44 |
<include>org.gvsig:org.gvsig.legend.aggregate.lib.impl</include> |
45 | 45 |
<include>org.gvsig:org.gvsig.legend.aggregate.swing.api</include> |
46 | 46 |
<include>org.gvsig:org.gvsig.legend.aggregate.swing.impl</include> |
47 |
<include>org.jfree:jcommon</include> |
|
47 | 48 |
</includes> |
48 | 49 |
</dependencySet> |
49 | 50 |
</dependencySets> |
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.app/org.gvsig.legend.aggregate.app.mainplugin/pom.xml | ||
---|---|---|
53 | 53 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
54 | 54 |
<scope>compile</scope> |
55 | 55 |
</dependency> |
56 |
<dependency> |
|
57 |
<groupId>org.jfree</groupId> |
|
58 |
<artifactId>jcommon</artifactId> |
|
59 |
<scope>runtime</scope> |
|
60 |
</dependency> |
|
56 | 61 |
</dependencies> |
57 | 62 |
</project> |
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/pom.xml | ||
---|---|---|
84 | 84 |
<artifactId>org.gvsig.legend.aggregate.app.mainplugin</artifactId> |
85 | 85 |
<version>1.0.5-SNAPSHOT</version> |
86 | 86 |
</dependency> |
87 |
<dependency> |
|
88 |
<groupId>org.jfree</groupId> |
|
89 |
<artifactId>jcommon</artifactId> |
|
90 |
<version>1.0.24</version> |
|
91 |
</dependency> |
|
92 |
|
|
87 | 93 |
</dependencies> |
88 | 94 |
</dependencyManagement> |
89 | 95 |
<modules> |
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.swing/org.gvsig.legend.aggregate.swing.impl/src/main/java/org/gvsig/legend/aggregate/swing/impl/DefaultAggregateLegendEditor.java | ||
---|---|---|
2 | 2 |
package org.gvsig.legend.aggregate.swing.impl; |
3 | 3 |
|
4 | 4 |
import java.awt.Dimension; |
5 |
import java.awt.Font; |
|
5 | 6 |
import java.awt.event.ActionEvent; |
6 | 7 |
import java.awt.event.ActionListener; |
7 | 8 |
import java.awt.event.ItemEvent; |
... | ... | |
34 | 35 |
import org.gvsig.tools.i18n.I18nManager; |
35 | 36 |
import org.gvsig.tools.swing.api.ColorChooserController; |
36 | 37 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
38 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
37 | 39 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
38 | 40 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
39 | 41 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
42 |
import org.jfree.ui.FontChooserPanel; |
|
40 | 43 |
|
41 | 44 |
|
42 | 45 |
public class DefaultAggregateLegendEditor extends DefaultAggregateLegendEditorView implements AggregateLegendEditor { |
... | ... | |
50 | 53 |
private ColorChooserController outlineColor; |
51 | 54 |
private ColorChooserController fillColor; |
52 | 55 |
private ColorChooserController textColor; |
56 |
private Font font; |
|
53 | 57 |
|
54 | 58 |
public DefaultAggregateLegendEditor() { |
55 | 59 |
this.legendClass = AggregateLegendLocator.getAggregateLegendManager().getLegendClass(); |
... | ... | |
152 | 156 |
this.fillColor.set(this.legend.getFillColor()); |
153 | 157 |
this.textColor.set(this.legend.getTextColor()); |
154 | 158 |
this.chkShowBounds.setSelected(this.legend.isShowBounds()); |
155 |
this.txtTextFont.setText(this.legend.getFont().getFontName()); |
|
159 |
this.font = this.legend.getFont(); |
|
160 |
this.txtTextFont.setText(getFontLabel(font)); |
|
156 | 161 |
if( this.legend.getLabelStyle()!=null ) { |
157 | 162 |
this.txtStyle.setText(this.legend.getLabelStyle().getDescription()); |
158 | 163 |
} |
... | ... | |
195 | 200 |
legend.setTextColor(this.textColor.get()); |
196 | 201 |
legend.setShowBounds(this.chkShowBounds.isSelected()); |
197 | 202 |
legend.setLabelStyle(this.style); |
203 |
legend.setFont(this.font); |
|
198 | 204 |
Operation operation = (Operation) this.cboOperation.getSelectedItem(); |
199 | 205 |
if( operation!=null ) { |
200 | 206 |
operation = operation.clone(); |
... | ... | |
249 | 255 |
} |
250 | 256 |
|
251 | 257 |
private void showFontChooser() { |
258 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
259 |
WindowManager_v2 winmgr = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
252 | 260 |
|
261 |
final FontChooserPanel fontChooser = new FontChooserPanel(font); |
|
262 |
// fontChooser.setPreferredSize(new Dimension(500,350)); |
|
263 |
final Dialog dialog = winmgr.createDialog( |
|
264 |
fontChooser, |
|
265 |
i18n.getTranslation("_Select_font"), |
|
266 |
null, |
|
267 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
268 |
); |
|
269 |
dialog.addActionListener(new ActionListener() { |
|
270 |
@Override |
|
271 |
public void actionPerformed(ActionEvent e) { |
|
272 |
if( dialog.getAction() == WindowManager_v2.BUTTONS_OK ) { |
|
273 |
font = fontChooser.getSelectedFont(); |
|
274 |
txtTextFont.setText(getFontLabel(font)); |
|
275 |
} |
|
276 |
} |
|
277 |
}); |
|
278 |
dialog.show(WindowManager.MODE.DIALOG); |
|
253 | 279 |
} |
280 |
|
|
281 |
private String getFontLabel(Font font) { |
|
282 |
StringBuilder b = new StringBuilder(); |
|
283 |
b.append(font.getFontName()); |
|
284 |
b.append(", "); |
|
285 |
b.append(font.getSize()); |
|
286 |
return b.toString(); |
|
287 |
} |
|
254 | 288 |
|
255 | 289 |
@Override |
256 | 290 |
public String getDescription() { |
org.gvsig.legend.aggregate/trunk/org.gvsig.legend.aggregate/org.gvsig.legend.aggregate.swing/org.gvsig.legend.aggregate.swing.impl/pom.xml | ||
---|---|---|
33 | 33 |
<artifactId>org.gvsig.symbology.lib.api</artifactId> |
34 | 34 |
<scope>compile</scope> |
35 | 35 |
</dependency> |
36 |
|
|
36 |
<dependency> |
|
37 |
<groupId>org.jfree</groupId> |
|
38 |
<artifactId>jcommon</artifactId> |
|
39 |
<scope>compile</scope> |
|
40 |
</dependency> |
|
37 | 41 |
</dependencies> |
38 | 42 |
</project> |
Also available in: Unified diff