Examples of IconLoader


Examples of org.tools.ui.utils.IconLoader

     * them from the test/icons directory.
     *
     * @return
     */
    public static IconLoader getAsLoader() {
        IconLoader loader = new IconLoader() {
            @Override
            public Icon getAsIcon(String location) {
                return TestIOManager.getAsIcon(location);
            }
        };
View Full Code Here

Examples of org.tools.ui.utils.IconLoader

     *
     * @param place
     * @return
     */
    public static IconLoader getAsLoader(final Places place) {
        IconLoader loader = new IconLoader() {
            @Override
            public Icon getAsIcon(String location) {
                return IOManager.getAsIcon(place, location);
            }
        };
View Full Code Here

Examples of org.tools.ui.utils.IconLoader

     * them from the test/icons directory.
     *
     * @return
     */
    public static IconLoader getAsLoader() {
        IconLoader loader = new IconLoader() {
            @Override
            public Icon getAsIcon(String location) {
                return TestIOManager.getAsIcon(location);
            }
        };
View Full Code Here

Examples of ptolemy.moml.IconLoader

            container.requestChange(request);
            NamedObj newObject = ((CompositeEntity) container)
                    .getEntity(compositeActorName);
            // Kepler wants a different icon.
            IconLoader _iconLoader = MoMLParser.getIconLoader();
            if (_iconLoader != null) {
                _iconLoader.loadIconForClass(
                        "ptolemy.actor.TypedCompositeActor", newObject);
            }
        } catch (Throwable throwable) {
            MessageHandler.error("Creating hierarchy failed", throwable);
        }
View Full Code Here

Examples of util.tvdataservice.IconLoader

  public ActionMenu getContextMenuActions(Program program) {
    return null;
  }

  protected IconLoader getIconLoader(final String groupId, final File workingDirectory) throws IOException {
    return new IconLoader(this, groupId, workingDirectory);
  }
View Full Code Here

Examples of util.tvdataservice.IconLoader

    /**
     * ChannelList.readFromStream is called by both MirrorUpdater and
     * TvBrowserDataService. The MirrorUpdater calls this method without
     * DataService and doesn't need the IconLoader
     */
    IconLoader iconLoader = null;
    if (dataService != null && dataService instanceof TvBrowserDataService) {
      File dataDir = ((TvBrowserDataService) dataService).getWorkingDirectory();
      iconLoader = new IconLoader(TvBrowserDataService.getInstance(), mGroup.getId(), dataDir);
    }

    String[] tokens;
    while ((tokens = reader.readNext()) != null) {
      if (tokens.length < 4) {
        throw new FileFormatException("Syntax error in mirror file line " + lineCount + ": column count is '" + tokens.length + " < 4' : " + tokens[0]);
      }

      String country = null, timezone = null, id = null, name = null, copyright = null, webpage = null, iconUrl = null, categoryStr = null, unescapedname = null;
      try {
        country = tokens[0];
        timezone = tokens[1];
        id = tokens[2];
        name = tokens[3];
        copyright = tokens[4];
        webpage = tokens[5];
        iconUrl = tokens[6];
        categoryStr = tokens[7];

        if (tokens.length > 8) {
          unescapedname = name;
          name = StringEscapeUtils.unescapeHtml(tokens[8]);
        }

      } catch (ArrayIndexOutOfBoundsException e) {
        // ignore
      }

      int categories = Channel.CATEGORY_NONE;
      if (categoryStr != null) {
        try {
          categories = Integer.parseInt(categoryStr);
        } catch (NumberFormatException e) {
          categories = Channel.CATEGORY_NONE;
        }
      }
      Channel channel = new Channel(dataService, name, id, TimeZone.getTimeZone(timezone), country, copyright,
          webpage, mGroup, null, categories, unescapedname);
      if (iconLoader != null && iconUrl != null && iconUrl.length() > 0) {
        Icon icon = iconLoader.getIcon(id, iconUrl);
        if (icon != null) {
          channel.setDefaultIcon(icon);
        }
      }
      addChannel(channel, iconUrl);
      lineCount++;
    }

    reader.close();
    if (iconLoader != null) {
      iconLoader.close();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.