Examples of Icon


Examples of javax.swing.Icon

          ProgramReceiveTarget[] targets = plugin.getProgramReceiveTargets();
          if (!plugin.canReceiveProgramsWithTarget()) {
            JMenuItem item = new JMenuItem(plugin.getInfo().getName());
            item.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);

            Icon icon = plugin.getPluginIcon();

            item.setIcon(icon != null ? icon : null);
            menu.add(item);
            item.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                Program[] programs = collectProgramsFromNode(node);
                if ((programs != null) && (programs.length > 0)) {
                  plugin.receivePrograms(programs, ProgramReceiveTarget.createDefaultTargetForProgramReceiveIfId(plugin.getId()));
                }
              }
            });
          } else if (targets.length == 1 && (!(o instanceof ProgramReceiveTarget) || !o.equals(targets[0]))) {
            JMenuItem item = new JMenuItem(targets[0].toString());
            item.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);

            Icon icon = plugin.getPluginIcon();

            item.setIcon(icon != null ? icon : null);
            menu.add(item);

            final ProgramReceiveTarget target = targets[0];

            item.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                Program[] programs = collectProgramsFromNode(node);
                if ((programs != null) && (programs.length > 0)) {
                  plugin.receivePrograms(programs, target);
                }
              }
            });
          } else if (targets.length >= 1) {
            JMenu subMenu = new JMenu(plugin.getInfo().getName());
            subMenu.setFont(MenuUtil.CONTEXT_MENU_PLAINFONT);

            Icon icon = plugin.getPluginIcon();

            subMenu.setIcon(icon != null ? icon : null);
            menu.add(subMenu);

            for (final ProgramReceiveTarget target : targets) {
View Full Code Here

Examples of javax.swing.Icon

  {
    final JButton button = new ActionButton(action);
    boolean needText = true;
    if (isLargeButtonsEnabled(swingGuiContext))
    {
      final Icon icon = (Icon) action.getValue(SwingCommonModule.LARGE_ICON_PROPERTY);
      if (icon != null && (icon.getIconHeight() > 1 && icon.getIconHeight() > 1))
      {
        button.setIcon(icon);
        needText = false;
      }
    }
    else
    {
      final Icon icon = (Icon) action.getValue(Action.SMALL_ICON);
      if (icon != null && (icon.getIconHeight() > 1 && icon.getIconHeight() > 1))
      {
        button.setIcon(icon);
        needText = false;
      }
    }
View Full Code Here

Examples of javax.swing.Icon

    }
  }

  private JPanel createOrientationPanel()
  {
    final Icon portraitIcon = guiContext.getIconTheme().getLargeIcon(getLocale(), "pagesetup.portrait");
    final JLabel portraitLabel = new JLabel(messages.getString("PageSetupDialog.Portrait"), portraitIcon, SwingConstants.LEFT);
    portraitLabel.setLabelFor(portraitModeBox);

    final Icon landscapeIcon = guiContext.getIconTheme().getLargeIcon(getLocale(), "pagesetup.landscape");
    final JLabel landscapeLabel = new JLabel(messages.getString("PageSetupDialog.Landscape"), landscapeIcon, SwingConstants.LEFT);
    landscapeLabel.setLabelFor(landscapeModeBox);

    final JPanel contentPane = new JPanel();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.X_AXIS));
View Full Code Here

Examples of javax.swing.Icon

  {
    if (iconTheme != null)
    {
      if (StatusType.ERROR.equals(type))
      {
        final Icon res = getIconTheme().getSmallIcon(getLocale(), "statusbar.errorIcon"); //$NON-NLS-1$
        statusHolder.setIcon(res);
      }
      else if (StatusType.WARNING.equals(type))
      {
        final Icon res = getIconTheme().getSmallIcon(getLocale(), "statusbar.warningIcon"); //$NON-NLS-1$
        statusHolder.setIcon(res);
      }
      else if (StatusType.INFORMATION.equals(type))
      {
        final Icon res = getIconTheme().getSmallIcon(getLocale(), "statusbar.informationIcon"); //$NON-NLS-1$
        statusHolder.setIcon(res);
      }
      else
      {
        final Icon res = getIconTheme().getSmallIcon(getLocale(), "statusbar.otherIcon"); //$NON-NLS-1$
        statusHolder.setIcon(res);
      }
    }
  }
View Full Code Here

Examples of javax.swing.Icon

   */
  protected Icon getEmptyIcon()
  {
    if (emptyIcon == null)
    {
      final Icon errorIcon = getErrorIcon();
      final int width = errorIcon.getIconWidth();
      final int height = errorIcon.getIconHeight();

      final BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
      emptyIcon = new ImageIcon(bi);
    }
    return emptyIcon;
View Full Code Here

Examples of javax.swing.Icon

        getFolderBySize(flag_size) +UNKNOWN_COUNTRY_FLAG);
  }
 
  public static Icon getFlagAsIcon(String countryCode, FlagSize flag_size) {
   
    Icon icon = null;
   
    try {
      icon = new ImageIcon(getFlagAsURL(countryCode, flag_size));
    }catch(Throwable t) {
      return null;
View Full Code Here

Examples of javax.swing.Icon

      if (currentValue instanceof ActiveNode) return ((ActiveNode)currentValue).getIcon();
    return null;
  }
 
  public Icon getLeafIcon(){
    Icon i=getSceneGraphIcon();
    if(i==null){
      return super.getLeafIcon();
    }
    else{
      return i;
View Full Code Here

Examples of javax.swing.Icon

      return i;
    }
  }
 
  public Icon getOpenIcon(){
    Icon i=getSceneGraphIcon();
    if(i==null){
      return super.getOpenIcon();
    }
    else{
      return i;
View Full Code Here

Examples of javax.swing.Icon

      return i;
    }
  }
 
  public Icon getClosedIcon(){
    Icon i=getSceneGraphIcon();
    if(i==null){
      return super.getClosedIcon();
    }
    else{
      return i;
View Full Code Here

Examples of javax.swing.Icon

            if (value instanceof SourceNode) {
                Object o = ((SourceNode) value).getUserObject();
                if (o instanceof ExpressionDataSource) {
                    setText(DataInfo.toString(o) + " = " + DataInfo.getComment(o));
                }
                Icon icon = (Icon) dataSourceIcons.get(o.getClass());
                if (icon != null) {
                    setIcon(icon);
                } else {
                    Class parent = o.getClass().getSuperclass();
                    if (parent != null) {
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.