Example #1
0
 /** ****** popup AbstractAction.actionPerformed method overrides ******** */
 protected void rotateOrthogonal() {
   active.setRotation(active.getRotation() + 1, this);
   error.setRotation(error.getRotation() + 1, this);
   displayState();
   // bug fix, must repaint icons that have same width and height
   repaint();
 }
Example #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;
 }
 protected void rotateOrthogonal() {
   _namedIcon.setRotation(_namedIcon.getRotation() + 1, this);
   super.setIcon(_namedIcon);
   updateSize();
   repaint();
 }