Search in sources :

Example 41 with NamedIcon

use of jmri.jmrit.catalog.NamedIcon in project JMRI by JMRI.

the class ItemPanel method makeNewIconMap.

protected static HashMap<String, NamedIcon> makeNewIconMap(String type) {
    HashMap<String, NamedIcon> newMap = new HashMap<String, NamedIcon>();
    String[] names = getNames(type);
    for (int i = 0; i < names.length; i++) {
        NamedIcon icon = new jmri.jmrit.catalog.NamedIcon(redX, redX);
        newMap.put(names[i], icon);
    }
    return newMap;
}
Also used : NamedIcon(jmri.jmrit.catalog.NamedIcon) HashMap(java.util.HashMap)

Example 42 with NamedIcon

use of jmri.jmrit.catalog.NamedIcon in project JMRI by JMRI.

the class SpeedometerFrame method setupIconMap.

private void setupIconMap(SensorIcon sensor) {
    sensor.setIcon("SensorStateActive", new NamedIcon("resources/icons/smallschematics/tracksegments/circuit-occupied.gif", "resources/icons/smallschematics/tracksegments/circuit-occupied.gif"));
    sensor.setIcon("SensorStateInactive", new NamedIcon("resources/icons/smallschematics/tracksegments/circuit-empty.gif", "resources/icons/smallschematics/tracksegments/circuit-empty.gif"));
    sensor.setIcon("BeanStateInconsistent", new NamedIcon("resources/icons/smallschematics/tracksegments/circuit-error.gif", "resources/icons/smallschematics/tracksegments/circuit-error.gif"));
    sensor.setIcon("BeanStateUnknown", new NamedIcon("resources/icons/smallschematics/tracksegments/circuit-error.gif", "resources/icons/smallschematics/tracksegments/circuit-error.gif"));
}
Also used : NamedIcon(jmri.jmrit.catalog.NamedIcon)

Example 43 with NamedIcon

use of jmri.jmrit.catalog.NamedIcon in project JMRI by JMRI.

the class LargePowerManagerButton method loadIcons.

@Override
protected void loadIcons() {
    setPowerOnIcon(new NamedIcon("resources/icons/throttles/power_green.png", "resources/icons/throttles/power_green.png"));
    setPowerOffIcon(new NamedIcon("resources/icons/throttles/power_red.png", "resources/icons/throttles/power_red.png"));
    setPowerUnknownIcon(new NamedIcon("resources/icons/throttles/power_yellow.png", "resources/icons/throttles/power_yellow.png"));
}
Also used : NamedIcon(jmri.jmrit.catalog.NamedIcon)

Example 44 with NamedIcon

use of jmri.jmrit.catalog.NamedIcon in project JMRI by JMRI.

the class Editor method setUpBackground.

/*
     * *********************** End Marker Menu Methods **********************
     */
/*
     * ************ Adding content to the panel **********************
     */
public PositionableLabel setUpBackground(String name) {
    NamedIcon icon = NamedIcon.getIconByName(name);
    PositionableLabel l = new PositionableLabel(icon, this);
    // no text
    l.setPopupUtility(null);
    l.setPositionable(false);
    l.setShowTooltip(false);
    l.setSize(icon.getIconWidth(), icon.getIconHeight());
    l.setDisplayLevel(BKG);
    l.setLocation(getNextBackgroundLeft(), 0);
    putItem(l);
    return l;
}
Also used : NamedIcon(jmri.jmrit.catalog.NamedIcon)

Example 45 with NamedIcon

use of jmri.jmrit.catalog.NamedIcon in project JMRI by JMRI.

the class Editor method putBlockContents.

protected BlockContentsIcon putBlockContents() {
    BlockContentsIcon l = new BlockContentsIcon(new NamedIcon("resources/icons/misc/X-red.gif", "resources/icons/misc/X-red.gif"), this);
    IconAdder blockIconEditor = getIconEditor("BlockLabel");
    l.setBlock(blockIconEditor.getTableSelection().getDisplayName());
    l.setSize(l.getPreferredSize().width, l.getPreferredSize().height);
    l.setDisplayLevel(MEMORIES);
    setNextLocation(l);
    putItem(l);
    return l;
}
Also used : NamedIcon(jmri.jmrit.catalog.NamedIcon)

Aggregations

NamedIcon (jmri.jmrit.catalog.NamedIcon)128 Entry (java.util.Map.Entry)28 Element (org.jdom2.Element)27 HashMap (java.util.HashMap)23 JPanel (javax.swing.JPanel)13 Editor (jmri.jmrit.display.Editor)13 Attribute (org.jdom2.Attribute)13 ActionEvent (java.awt.event.ActionEvent)12 ActionListener (java.awt.event.ActionListener)12 JLabel (javax.swing.JLabel)11 JButton (javax.swing.JButton)10 DataFlavor (java.awt.datatransfer.DataFlavor)6 CatalogTreeNode (jmri.jmrit.catalog.CatalogTreeNode)6 DragJLabel (jmri.jmrit.catalog.DragJLabel)6 Sensor (jmri.Sensor)5 CatalogTreeLeaf (jmri.jmrit.catalog.CatalogTreeLeaf)5 RosterEntry (jmri.jmrit.roster.RosterEntry)5 Point (java.awt.Point)4 JComponent (javax.swing.JComponent)4 JDialog (javax.swing.JDialog)4