source: josm/trunk/src/org/openstreetmap/josm/gui/mappaint/IconElemStyle.java@ 2657

Last change on this file since 2657 was 2512, checked in by stoecker, 15 years ago

i18n updated, fixed files to reduce problems when applying patches, fix #4017

  • Property svn:eol-style set to native
File size: 928 bytes
Line 
1package org.openstreetmap.josm.gui.mappaint;
2
3import javax.swing.GrayFilter;
4import javax.swing.ImageIcon;
5
6public class IconElemStyle extends ElemStyle
7{
8 public ImageIcon icon;
9 private ImageIcon disabledIcon;
10 public boolean annotate;
11
12 public IconElemStyle (IconElemStyle i, long maxScale, long minScale) {
13 this.icon = i.icon;
14 this.annotate = i.annotate;
15 this.priority = i.priority;
16 this.maxScale = maxScale;
17 this.minScale = minScale;
18 this.rules = i.rules;
19 }
20 public IconElemStyle() { init(); }
21
22 public void init() {
23 icon = null;
24 priority = 0;
25 annotate = true;
26 }
27
28 public ImageIcon getDisabledIcon() {
29 if (disabledIcon != null)
30 return disabledIcon;
31 if (icon == null)
32 return null;
33 return disabledIcon = new ImageIcon(GrayFilter.createDisabledImage(icon.getImage()));
34 }
35}
Note: See TracBrowser for help on using the repository browser.