Package org.pushingpixels.substance.api

Examples of org.pushingpixels.substance.api.SubstanceSkin


  public SubstanceSkinComboSelector() {
    // populate the combobox
    super(new ArrayList<SkinInfo>(SubstanceLookAndFeel.getAllSkins()
        .values()).toArray());
    // set the current skin as the selected item
    SubstanceSkin currentSkin = SubstanceLookAndFeel.getCurrentSkin();
    for (SkinInfo skinInfo : SubstanceLookAndFeel.getAllSkins().values()) {
      if (skinInfo.getDisplayName().compareTo(
          currentSkin.getDisplayName()) == 0) {
        this.setSelectedItem(skinInfo);
        break;
      }
    }
    // set custom renderer to show the skin display name
View Full Code Here


    SwingUtilities.invokeLater(new Runnable() {

      @Override
      public void run() {
        JFrame.setDefaultLookAndFeelDecorated(true);
        SubstanceSkin skin = new SubstanceATunesBlueSkin();
        if (skin.isValid()) {
          SubstanceLookAndFeel.setSkin(skin);
        }
        new Test();
      }
    });
View Full Code Here

   * org.pushingpixels.substance.watermark.SubstanceWatermark#drawWatermarkImage(java
   * .awt.Graphics, int, int, int, int)
   */
  public void drawWatermarkImage(Graphics graphics, Component c, int x,
      int y, int width, int height) {
    SubstanceSkin skin = SubstanceCoreUtilities.getSkin(c);
    Graphics2D g2d = (Graphics2D) graphics.create();
    g2d.setComposite(TransitionLayout.getAlphaComposite(c, 0.2f, graphics));
    g2d.setColor(skin.getWatermarkColorScheme().getWatermarkLightColor());
    g2d.fillRect(x, y, width, height);
    g2d.dispose();
  }
View Full Code Here

    }

    result.add(new JXTitledSeparator("Substance", SwingConstants.CENTER)); //$NON-NLS-1$

    // Substance L&F
    final SubstanceSkin skin = SubstanceLookAndFeel.getCurrentSkin();
    for (final SkinInfo info : SubstanceLookAndFeel.getAllSkins().values()) {
      final JMenuItem item = new MenuItemRadioButton(info.getDisplayName());
      item.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(final ActionEvent e) {
          SubstanceLookAndFeel.setSkin(info.getClassName());

          data.setLookAndFeel(info.getClassName());
        }
      });
      if (null != skin) {
        item.setSelected(HelperObject.isEquals(info.getClassName(), skin.getClass().getCanonicalName()));
      }
      result.add(item);
      group.add(item);
    }
View Full Code Here

      SubstanceLookAndFeel.getTitlePaneComponent(window).setBackground(
          (Color) e.getNewValue());
    }

    if (propertyName.equals(SubstanceLookAndFeel.SKIN_PROPERTY)) {
      SubstanceSkin oldValue = (SubstanceSkin) e.getOldValue();
      SubstanceSkin newValue = (SubstanceSkin) e.getNewValue();
      if ((oldValue == null) && (newValue != null)) {
        rootPanesWithCustomSkin++;
      }
      if ((oldValue != null) && (newValue == null)) {
        rootPanesWithCustomSkin--;
View Full Code Here

   * Returns a metallic skin.
   *
   * @return Metallic skin.
   */
  private static SubstanceSkin getMetallicSkin() {
    SubstanceSkin res = new SubstanceSkin() {
      @Override
      public String getDisplayName() {
        return "Metallic Skin";
      }
    };
    res.registerDecorationAreaSchemeBundle(new SubstanceColorSchemeBundle(
        new MetallicColorScheme(), new MetallicColorScheme(),
        new LightGrayColorScheme()), DecorationAreaType.NONE);
    return res;
  }
View Full Code Here

   * @return The color scheme of the specified tabbed pane tab.
   */
  public static SubstanceColorScheme getColorScheme(final JTabbedPane jtp,
      final int tabIndex, ColorSchemeAssociationKind associationKind,
      ComponentState componentState) {
    SubstanceSkin skin = SubstanceCoreUtilities.getSkin(jtp);
    if (skin == null) {
      SubstanceCoreUtilities
          .traceSubstanceApiUsage(jtp,
              "Substance delegate used when Substance is not the current LAF");
    }
    SubstanceColorScheme nonColorized = skin.getColorScheme(jtp,
        associationKind, componentState);
    if (tabIndex >= 0) {
      Component component = jtp.getComponentAt(tabIndex);
      SubstanceColorScheme colorized = getColorizedScheme(component,
          nonColorized, jtp.getForegroundAt(tabIndex), jtp
View Full Code Here

    if (isButtonThatIsNeverPainted
        || (SubstanceCoreUtilities.hasFlatAppearance(component, false) && (componentState == ComponentState.ENABLED))) {
      component = component.getParent();
    }

    SubstanceSkin skin = SubstanceCoreUtilities.getSkin(component);
    if (skin == null) {
      SubstanceCoreUtilities
          .traceSubstanceApiUsage(component,
              "Substance delegate used when Substance is not the current LAF");
    }
    SubstanceColorScheme nonColorized = skin.getColorScheme(component,
        componentState);

    return getColorizedScheme(orig, nonColorized, !componentState
        .isDisabled());
  }
View Full Code Here

    this.defaultScheme = SubstanceColorSchemeUtilities.getColorScheme(
        this.component, ComponentState.ENABLED);
    this.decorationAreaType = SubstanceLookAndFeel
        .getDecorationType(this.component);

    SubstanceSkin skin = SubstanceCoreUtilities.getSkin(this.component);
    this.isInDecorationArea = (this.decorationAreaType != null)
        && skin.isRegisteredAsDecorationArea(this.decorationAreaType)
        && SubstanceCoreUtilities.isOpaque(this.component);
  }
View Full Code Here

    }

    public void actionPerformed(ActionEvent e) {
      SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          SubstanceSkin newSkin = SubstanceLookAndFeel
              .getCurrentSkin(null).transform(transform, name);
          SubstanceLookAndFeel.setSkin(newSkin);
        }
      });
    }
View Full Code Here

TOP

Related Classes of org.pushingpixels.substance.api.SubstanceSkin

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.