Package javax.swing

Examples of javax.swing.Icon


  }

  private void updateComponents() {
    final SortedSet<InputColumn<?>> sourceColumns = new TreeSet<InputColumn<?>>(_analysisJobBuilder.getSourceColumns());

    final Icon validIcon = ImageManager.getInstance().getImageIcon("images/status/valid.png", IconUtils.ICON_SIZE_SMALL);

    DefaultTableModel model = new DefaultTableModel(columnNames, sourceColumns.size());

    int i = 0;
    for (InputColumn<?> inputColumn : sourceColumns) {
View Full Code Here


    _listPanel.removeAll();

    final String[] names = _catalog.getSynonymCatalogNames();
    Arrays.sort(names);

    final Icon icon = imageManager.getImageIcon("images/model/synonym.png");

    for (final String name : names) {
      final SynonymCatalog synonymCatalog = _catalog.getSynonymCatalog(name);

      final DCLabel synonymCatalogLabel = DCLabel.dark("<html><b>" + name + "</b><br/>"
View Full Code Here

    }
  }

  private JXTaskPane createTaskPane(final FilterJobBuilder<?, ?> fjb) {
    String title = LabelUtils.getLabel(fjb);
    Icon icon = IconUtils.getDescriptorIcon(fjb.getDescriptor(), IconUtils.ICON_SIZE_SMALL);
    final JXTaskPane taskPane = WidgetFactory.createTaskPane(title, icon);
    taskPane.add(_presenters.get(fjb).createJComponent());
    return taskPane;
  }
View Full Code Here

        if (value instanceof DatabaseDriverDescriptor) {
          DatabaseDriverDescriptor databaseDriver = (DatabaseDriverDescriptor) value;

          String iconImagePath = DatabaseDriverCatalog.getIconImagePath(databaseDriver);
          Icon driverIcon = imageManager.getImageIcon(iconImagePath, IconUtils.ICON_SIZE_SMALL);

          result.setText(databaseDriver.getDisplayName());
          result.setIcon(driverIcon);
        } else if (MANAGE_DATABASE_DRIVERS.equals(value)) {
          result.setIcon(imageManager.getImageIcon("images/menu/options.png", IconUtils.ICON_SIZE_SMALL));
View Full Code Here

              if (textureImage == null
                  || textureImage == WAIT_TEXTURE_IMAGE) {
                final boolean waitForTexture = paintMode != PaintMode.PAINT;
                if ("true".equalsIgnoreCase(System.getProperty("com.eteks.sweethome3d.no3D"))) {
                  // Use icon manager if texture manager should be ignored
                  Icon textureIcon = IconManager.getInstance().getIcon(floorTexture.getImage(),
                      waitForTexture ? null : this);
                  if (IconManager.getInstance().isWaitIcon(textureIcon)) {
                    floorTextureImagesCache.put(floorTexture.getImage(), WAIT_TEXTURE_IMAGE);                   
                  } else if (IconManager.getInstance().isErrorIcon(textureIcon)) {
                    floorTextureImagesCache.put(floorTexture.getImage(), ERROR_TEXTURE_IMAGE);                   
                  } else {
                    BufferedImage textureIconImage = new BufferedImage(
                        textureIcon.getIconWidth(), textureIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
                    Graphics2D g2DIcon = (Graphics2D)textureIconImage.getGraphics();
                    textureIcon.paintIcon(this, g2DIcon, 0, 0);
                    g2DIcon.dispose();
                    floorTextureImagesCache.put(floorTexture.getImage(), textureIconImage);
                  }
                } else {
                  // Prefer to share textures images with texture manager if it's available
View Full Code Here

   */
  private void paintPieceOfFurnitureIcon(Graphics2D g2D, HomePieceOfFurniture piece,
                                         Shape pieceShape2D, float planScale,
                                         Color backgroundColor, PaintMode paintMode) {
    // Get piece icon
    Icon icon = IconManager.getInstance().getIcon(piece.getIcon(), 128,
        paintMode == PaintMode.PAINT ? this : null);
    paintPieceOfFurnitureIcon(g2D, piece, icon, pieceShape2D, planScale, backgroundColor);
  }
View Full Code Here

              }))));
          // Don't need color information anymore
          this.pieceColor = null;
        } else if (this.pieceTexture != null) {
          if ("true".equalsIgnoreCase(System.getProperty("com.eteks.sweethome3d.no3D"))) {
            Icon textureIcon = IconManager.getInstance().getIcon(this.pieceTexture.getImage(), null);
            if (IconManager.getInstance().isErrorIcon(textureIcon)) {
              setTexturedIcon(c, ERROR_TEXTURE_IMAGE);                   
            } else {
              BufferedImage textureIconImage = new BufferedImage(
                  textureIcon.getIconWidth(), textureIcon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
              Graphics2D g2DIcon = (Graphics2D)textureIconImage.getGraphics();
              textureIcon.paintIcon(c, g2DIcon, 0, 0);
              g2DIcon.dispose();
              setTexturedIcon(c, textureIconImage);
            }
          } else {
            // Prefer to share textures images with texture manager if it's available
View Full Code Here

        (URLContent)TestUtilities.getField(iconManager, "waitIconContent");
    URLContent errorIconContent =
        (URLContent)TestUtilities.getField(iconManager, "errorIconContent");

    // Check waitIcon is loaded directly without proxy
    Icon waitIcon = iconManager.getIcon(waitIconContent, HEIGHT, null);
    assertNotSame("Wait icon loaded with IconProxy", waitIcon.getClass(), iconProxyClass);

    // Check errorIcon is loaded directly without proxy
    Icon errorIcon = iconManager.getIcon(errorIconContent, HEIGHT, null);
    assertNotSame("Error icon loaded with IconProxy", errorIcon.getClass(), iconProxyClass);

    // For other tests, replace again iconLoader by an executor that let icon loading complete normally
    iconManager.clear();
  }
View Full Code Here

        awaitBarrier(waitingComponentBarrier);
      }
    };

    Content iconContent = new URLContent(iconURL);
    Icon icon = iconManager.getIcon(iconContent, HEIGHT, waitingComponent);
    assertEquals("Icon not equal to wait icon while loading", waitIconContent.getURL(), icon);

    // Let iconManager load the iconContent
    iconLoadingStartBarrier.await();
    // Wait iconContent loading completion
    waitingComponentBarrier.await();
    if (goodIcon) {
      assertEquals("Icon not equal to icon read from resource", iconURL, icon);
    } else {
      assertEquals("Wrong icon not equal to errorIcon", errorIconContent.getURL(), icon);
    }
   
    // Check icon is loaded with proxy
    assertSame("Icon not loaded with IconProxy", icon.getClass(), iconProxyClass);

    // Check that icon is stored in cache
    Icon iconFromCache = iconManager.getIcon(iconContent, HEIGHT, waitingComponent);
    assertSame("Test icon reloaded", icon, iconFromCache);
  }
View Full Code Here

                        Graphics g,
                        int x,
                        int y) {
    super.paintIcon(c, g, x, y);

    Icon overlay = null;

    switch(bundle.getState()) {
    case Bundle.ACTIVE:
      overlay = activeIcon;
      break;
    case Bundle.INSTALLED:
      overlay = installedIcon;
      break;
    case Bundle.RESOLVED:
      overlay = resolvedIcon;
      break;
    case Bundle.STARTING:
      overlay = startingIcon;
      break;
    case Bundle.STOPPING:
      overlay = stoppingIcon;
      break;
    case Bundle.UNINSTALLED:
      overlay = uninstalledIcon;
      break;
    default:
    }

    if(overlay != null) {
      int x1 = x + (getIconWidth() - overlay.getIconWidth());
      int y1 = y + (getIconHeight() - overlay.getIconHeight());

      int w = overlay.getIconWidth();
      int h = overlay.getIconHeight();

      g.setColor(Color.white);
      g.fill3DRect(x1-1, y1-1, w+2, h+2, true);
      overlay.paintIcon(c, g, x1, y1);
    }
  }
View Full Code Here

TOP

Related Classes of javax.swing.Icon

Copyright © 2018 www.massapicom. 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.