示例#1
0
 protected void editIcon() {
   String url = _iconEditor.getIcon("plainIcon").getURL();
   _namedIcon = NamedIcon.getIconByName(url);
   super.setIcon(_namedIcon);
   updateSize();
   _iconEditorFrame.dispose();
   _iconEditorFrame = null;
   _iconEditor = null;
   invalidate();
 }
示例#2
0
 private NamedIcon loadTurnoutIcon(
     String state, int rotation, TurnoutIcon l, Element element, String name, Editor ed) {
   NamedIcon icon = null;
   if (element.getAttribute(state) != null) {
     String iconName = element.getAttribute(state).getValue();
     icon = NamedIcon.getIconByName(iconName);
     if (icon == null) {
       icon = ed.loadFailed("Turnout \"" + name + "\" icon \"" + state + "\" ", iconName);
       if (icon == null) {
         log.info("Turnout \"" + name + "\" icon \"" + state + "\" removed for url= " + iconName);
       }
     } else {
       icon.setRotation(rotation, l);
     }
   } else {
     log.warn("did not locate " + state + " icon file for Turnout " + name);
   }
   if (icon == null) {
     log.info("Turnout Icon \"" + name + "\": icon \"" + state + "\" removed");
   } else {
     l.setIcon(_nameMap.get(state), icon);
   }
   return icon;
 }