Revision 46863 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featurequery/DefaultFeatureQueryCalculatedColumnsPanel.java

View differences:

DefaultFeatureQueryCalculatedColumnsPanel.java
41 41
import org.gvsig.fmap.dal.swing.featurequery.FeatureQueryCalculatedColumnsPanel;
42 42
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypeAttributePanel;
43 43
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel;
44
import static org.gvsig.fmap.dal.swing.impl.DefaultDALSwingLibrary.LIBRARY_NAME;
45
import org.gvsig.fmap.dal.swing.impl.expressionevaluator.FeatureStoreElementFactory;
44 46
import org.gvsig.tools.ToolsLocator;
45 47
import org.gvsig.tools.dataTypes.Coercion;
46 48
import org.gvsig.tools.dataTypes.CoercionException;
......
51 53
import org.gvsig.tools.swing.api.ListElement;
52 54
import org.gvsig.tools.swing.api.ToolsSwingLocator;
53 55
import org.gvsig.tools.swing.api.ToolsSwingManager;
56
import org.gvsig.tools.swing.api.ToolsSwingUtils;
54 57
import org.gvsig.tools.swing.api.pickercontroller.DataTypePickerController;
55 58
import org.gvsig.tools.swing.api.threadsafedialogs.ThreadSafeDialogsManager;
56 59
import org.gvsig.tools.swing.api.windowmanager.Dialog;
......
374 377

  
375 378
    @Override
376 379
    public ImageIcon loadImage(String imageName) {
377
        String name = FilenameUtils.getBaseName(imageName);
378
        IconTheme theme = ToolsSwingLocator.getIconThemeManager().getDefault();
379
        if (theme.exists(name)) {
380
            return theme.get(name);
381
        }
382
        URL url = this.getClass().getResource(name + ".png");
383
        if (url == null) {
384
            return null;
385
        }
386
        return new ImageIcon(url);
380
        return ToolsSwingUtils.loadImage(this, imageName);
387 381
    }
388 382

  
389 383
    @Override
......
645 639
    }
646 640

  
647 641
    public static void selfRegister() {
648
        IconTheme theme;
649
        try {
650
           theme = ToolsSwingLocator.getIconThemeManager().getCurrent();
651
        } catch(ReferenceNotRegisteredException ex) {
652
            return;
653
        }
654
        String[][] iconNames = new String[][]{
655
            new String[]{"dalswing", "featurequery-column-add"},
656
            new String[]{"dalswing", "featurequery-column-remove"},
657
            new String[]{"dalswing", "featurequery-column-down"},
658
            new String[]{"dalswing", "featurequery-column-up"}
659
        };
660
        for (String[] icon : iconNames) {
661
            URL url = DefaultFeatureQueryOrderPanel.class.getResource(icon[1] + ".png");
662
            theme.registerDefault("DALSwing", icon[0], icon[1], null, url);
663
        }
642
        boolean n = ToolsSwingUtils.registerIcons( 
643
                DefaultFeatureQueryOrderPanel.class,
644
                null,
645
                LIBRARY_NAME,
646
                new String[]{ "featurequery", "featurequery-column-add"},
647
                new String[]{ "featurequery", "featurequery-column-remove"},
648
                new String[]{ "featurequery", "featurequery-column-down"},
649
                new String[]{ "featurequery", "featurequery-column-up"}
650
        );          
664 651
    }
665 652

  
666 653
    private void doAdd() {

Also available in: Unified diff