Package org.pushingpixels.substance.api

Examples of org.pushingpixels.substance.api.SubstanceColorScheme


   */
  public OfficeBlue2007Skin() {
    SubstanceSkin.ColorSchemes colorSchemes = SubstanceSkin
        .getColorSchemes("org/pushingpixels/substance/api/skin/office2007.colorschemes");

    SubstanceColorScheme activeScheme = colorSchemes
        .get("Office Blue Active");
    SubstanceColorScheme enabledScheme = colorSchemes
        .get("Office Blue Enabled");

    SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
        activeScheme, enabledScheme, enabledScheme);
    defaultSchemeBundle.registerColorScheme(enabledScheme, 0.5f,
        ComponentState.DISABLED_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(activeScheme, 0.5f,
        ComponentState.DISABLED_SELECTED);

    SubstanceColorScheme rolloverScheme = colorSchemes
        .get("Office Blue Rollover");
    SubstanceColorScheme rolloverSelectedScheme = colorSchemes
        .get("Office Blue Rollover Selected");
    SubstanceColorScheme selectedScheme = colorSchemes
        .get("Office Blue Selected");
    SubstanceColorScheme pressedScheme = colorSchemes
        .get("Office Blue Pressed");
    SubstanceColorScheme pressedSelectedScheme = colorSchemes
        .get("Office Blue Pressed Selected");

    // register state-specific color schemes on rollovers and selections
    defaultSchemeBundle.registerColorScheme(rolloverScheme,
        ComponentState.ROLLOVER_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(rolloverSelectedScheme,
        ComponentState.ROLLOVER_SELECTED);
    defaultSchemeBundle.registerColorScheme(selectedScheme,
        ComponentState.SELECTED);
    defaultSchemeBundle.registerColorScheme(pressedScheme,
        ComponentState.PRESSED_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(pressedSelectedScheme,
        ComponentState.PRESSED_SELECTED);

    // register state-specific highlight color schemes on rollover and
    // selections
    defaultSchemeBundle.registerHighlightColorScheme(rolloverScheme, 0.8f,
        ComponentState.ROLLOVER_UNSELECTED);
    defaultSchemeBundle.registerHighlightColorScheme(selectedScheme, 0.8f,
        ComponentState.SELECTED);
    defaultSchemeBundle.registerHighlightColorScheme(
        rolloverSelectedScheme, 0.8f, ComponentState.ROLLOVER_SELECTED);
    defaultSchemeBundle.registerHighlightColorScheme(selectedScheme, 0.8f,
        ComponentState.ARMED, ComponentState.ROLLOVER_ARMED);

    // borders and marks
    SubstanceColorScheme borderEnabledScheme = colorSchemes
        .get("Office Blue Border Enabled");
    SubstanceColorScheme borderActiveScheme = colorSchemes
        .get("Office Blue Border Active");
    SubstanceColorScheme borderRolloverScheme = colorSchemes
        .get("Office Border Rollover");
    SubstanceColorScheme borderRolloverSelectedScheme = colorSchemes
        .get("Office Border Rollover Selected");
    SubstanceColorScheme borderSelectedScheme = colorSchemes
        .get("Office Border Selected");
    SubstanceColorScheme borderPressedScheme = colorSchemes
        .get("Office Border Pressed");

    defaultSchemeBundle.registerColorScheme(borderEnabledScheme,
        ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED);
    defaultSchemeBundle.registerColorScheme(borderEnabledScheme,
        ColorSchemeAssociationKind.BORDER,
        ComponentState.DISABLED_SELECTED,
        ComponentState.DISABLED_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(borderActiveScheme,
        ColorSchemeAssociationKind.BORDER, ComponentState.DEFAULT);
    defaultSchemeBundle.registerColorScheme(borderRolloverScheme,
        ColorSchemeAssociationKind.BORDER,
        ComponentState.ROLLOVER_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(borderRolloverSelectedScheme,
        ColorSchemeAssociationKind.BORDER,
        ComponentState.ROLLOVER_SELECTED, ComponentState.ARMED,
        ComponentState.ROLLOVER_ARMED);
    defaultSchemeBundle.registerColorScheme(borderSelectedScheme,
        ColorSchemeAssociationKind.BORDER, ComponentState.SELECTED);
    defaultSchemeBundle.registerColorScheme(borderPressedScheme,
        ColorSchemeAssociationKind.BORDER,
        ComponentState.PRESSED_SELECTED,
        ComponentState.PRESSED_UNSELECTED);

    // tabs and tab borders
    SubstanceColorScheme tabSelectedScheme = colorSchemes
        .get("Office Blue Tab Selected");
    SubstanceColorScheme tabRolloverScheme = colorSchemes
        .get("Office Blue Tab Rollover");
    defaultSchemeBundle.registerColorScheme(tabSelectedScheme,
        ColorSchemeAssociationKind.TAB, ComponentState.SELECTED,
        ComponentState.ROLLOVER_SELECTED,
        ComponentState.PRESSED_SELECTED,
        ComponentState.PRESSED_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(tabRolloverScheme,
        ColorSchemeAssociationKind.TAB,
        ComponentState.ROLLOVER_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(borderEnabledScheme,
        ColorSchemeAssociationKind.TAB_BORDER, ComponentState.SELECTED,
        ComponentState.ROLLOVER_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(rolloverSelectedScheme,
        ColorSchemeAssociationKind.TAB_BORDER,
        ComponentState.ROLLOVER_SELECTED);

    // separator
    SubstanceColorScheme separatorScheme = colorSchemes
        .get("Office Blue Separator");
    defaultSchemeBundle.registerColorScheme(separatorScheme,
        ColorSchemeAssociationKind.SEPARATOR);

    this.registerDecorationAreaSchemeBundle(defaultSchemeBundle,
        DecorationAreaType.NONE);

    this.watermarkScheme = colorSchemes.get("Office Blue Watermark");

    SubstanceColorScheme generalWatermarkScheme = colorSchemes
        .get("Office Blue Header Watermark");

    this.registerAsDecorationArea(generalWatermarkScheme,
        DecorationAreaType.FOOTER, DecorationAreaType.HEADER,
        DecorationAreaType.TOOLBAR);

    SubstanceColorScheme titleWatermarkScheme = colorSchemes
        .get("Office Blue Title Watermark");

    this.registerAsDecorationArea(titleWatermarkScheme,
        DecorationAreaType.GENERAL,
        DecorationAreaType.PRIMARY_TITLE_PANE,
View Full Code Here


   * Creates a new <code>Creme Coffee</code> skin.
   */
  public CremeCoffeeSkin() {
    SubstanceSkin.ColorSchemes kitchenSinkSchemes = SubstanceSkin
        .getColorSchemes("org/pushingpixels/substance/api/skin/kitchen-sink.colorschemes");
    SubstanceColorScheme activeScheme = kitchenSinkSchemes
        .get("Coffee Active");
    SubstanceColorScheme enabledScheme = new CremeColorScheme();
    SubstanceColorScheme disabledScheme = new LightGrayColorScheme().tint(
        0.35).named("Creme Coffee Disabled");

    SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
        activeScheme, enabledScheme, disabledScheme);
    this.registerDecorationAreaSchemeBundle(defaultSchemeBundle,
View Full Code Here

   */
  public NebulaSkin() {
    SubstanceSkin.ColorSchemes schemes = SubstanceSkin
        .getColorSchemes("org/pushingpixels/substance/api/skin/nebula.colorschemes");

    SubstanceColorScheme activeScheme = schemes.get("Nebula Active");
    SubstanceColorScheme enabledScheme = schemes.get("Nebula Enabled");
    SubstanceColorScheme rolloverUnselectedScheme = schemes
        .get("Nebula Rollover Unselected");
    SubstanceColorScheme pressedScheme = schemes.get("Nebula Pressed");
    SubstanceColorScheme rolloverSelectedScheme = schemes
        .get("Nebula Rollover Selected");
    SubstanceColorScheme disabledScheme = schemes.get("Nebula Disabled");

    SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
        activeScheme, enabledScheme, disabledScheme);
    defaultSchemeBundle.registerColorScheme(rolloverUnselectedScheme,
        ComponentState.ROLLOVER_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(rolloverSelectedScheme,
        ComponentState.ROLLOVER_SELECTED);
    defaultSchemeBundle.registerColorScheme(pressedScheme,
        ComponentState.PRESSED_SELECTED,
        ComponentState.PRESSED_UNSELECTED, ComponentState.ARMED,
        ComponentState.ROLLOVER_ARMED);

    defaultSchemeBundle.registerColorScheme(rolloverUnselectedScheme,
        ColorSchemeAssociationKind.BORDER, ComponentState.SELECTED);

    defaultSchemeBundle.registerHighlightColorScheme(pressedScheme, 0.6f,
        ComponentState.ROLLOVER_UNSELECTED);
    defaultSchemeBundle.registerHighlightColorScheme(pressedScheme, 0.8f,
        ComponentState.SELECTED);
    defaultSchemeBundle.registerHighlightColorScheme(pressedScheme, 0.95f,
        ComponentState.ROLLOVER_SELECTED);
    defaultSchemeBundle.registerHighlightColorScheme(pressedScheme, 0.8f,
        ComponentState.ARMED, ComponentState.ROLLOVER_ARMED);

    // for progress bars
    ComponentState determinateState = new ComponentState("determinate",
        new ComponentStateFacet[] { ComponentStateFacet.ENABLE,
            ComponentStateFacet.DETERMINATE }, null);
    ComponentState indeterminateState = new ComponentState("indeterminate",
        new ComponentStateFacet[] { ComponentStateFacet.ENABLE },
        new ComponentStateFacet[] { ComponentStateFacet.DETERMINATE });
    SubstanceColorScheme determinateScheme = schemes
        .get("Nebula Determinate");
    SubstanceColorScheme determinateBorderScheme = schemes
        .get("Nebula Determinate Border");
    defaultSchemeBundle.registerColorScheme(determinateScheme,
        determinateState, indeterminateState);
    defaultSchemeBundle.registerColorScheme(determinateBorderScheme,
        ColorSchemeAssociationKind.BORDER, determinateState,
        indeterminateState);

    ComponentState determinateDisabledState = new ComponentState(
        "determinate disabled",
        new ComponentStateFacet[] { ComponentStateFacet.DETERMINATE },
        new ComponentStateFacet[] { ComponentStateFacet.ENABLE });
    ComponentState indeterminateDisabledState = new ComponentState(
        "indeterminate disabled", null, new ComponentStateFacet[] {
            ComponentStateFacet.ENABLE,
            ComponentStateFacet.DETERMINATE });
    SubstanceColorScheme determinateDisabledScheme = schemes
        .get("Nebula Determinate Disabled");
    SubstanceColorScheme determinateDisabledBorderScheme = schemes
        .get("Nebula Determinate Disabled Border");
    defaultSchemeBundle.registerColorScheme(determinateDisabledScheme,
        determinateDisabledState, indeterminateDisabledState);
    defaultSchemeBundle.registerColorScheme(
        determinateDisabledBorderScheme,
View Full Code Here

        .getFillPainter(this.menuItem);
    SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
        .getBorderPainter(this.menuItem);
    ComponentState currState = modelStateInfo.getCurrModelState();

    SubstanceColorScheme baseFillColorScheme = SubstanceColorSchemeUtilities
        .getColorScheme(this.menuItem, ColorSchemeAssociationKind.FILL,
            currState);
    SubstanceColorScheme baseMarkColorScheme = SubstanceColorSchemeUtilities
        .getColorScheme(this.menuItem, ColorSchemeAssociationKind.MARK,
            currState);
    SubstanceColorScheme baseBorderColorScheme = SubstanceColorSchemeUtilities
        .getColorScheme(this.menuItem,
            ColorSchemeAssociationKind.BORDER, currState);
    float visibility = stateTransitionTracker
        .getFacetStrength(ComponentStateFacet.SELECTION);
    boolean isCheckMarkFadingOut = !currState
        .isFacetActive(ComponentStateFacet.SELECTION);

    int fontSize = SubstanceSizeUtils.getComponentFontSize(this.menuItem);
    int checkMarkSize = this.size + 3;

    HashMapKey keyBase = SubstanceCoreUtilities.getHashKey(fontSize,
        checkMarkSize, fillPainter.getDisplayName(), borderPainter
            .getDisplayName(),
        baseFillColorScheme.getDisplayName(), baseMarkColorScheme
            .getDisplayName(), baseBorderColorScheme
            .getDisplayName(), visibility, isCheckMarkFadingOut);
    Icon iconBase = iconMap.get(keyBase);
    if (iconBase == null) {
      iconBase = new ImageIcon(SubstanceImageCreator.getCheckBox(
          this.menuItem, fillPainter, borderPainter, checkMarkSize,
          currState, baseFillColorScheme, baseMarkColorScheme,
          baseBorderColorScheme, visibility, isCheckMarkFadingOut));
      iconMap.put(keyBase, iconBase);
    }
    if (currState.isDisabled() || (activeStates.size() == 1)) {
      return iconBase;
    }

    BufferedImage result = SubstanceCoreUtilities.getBlankImage(iconBase
        .getIconWidth(), iconBase.getIconHeight());
    Graphics2D g2d = result.createGraphics();
    // draw the base layer
    iconBase.paintIcon(this.menuItem, g2d, 0, 0);

    // draw other active layers
    for (Map.Entry<ComponentState, StateTransitionTracker.StateContributionInfo> activeEntry : activeStates
        .entrySet()) {
      ComponentState activeState = activeEntry.getKey();
      // System.out.println("Painting state " + activeState + "[curr is "
      // + currState + "] with " + activeEntry.getValue());
      if (activeState == currState)
        continue;

      float stateContribution = activeEntry.getValue().getContribution();
      if (stateContribution > 0.0f) {
        g2d.setComposite(AlphaComposite.SrcOver
            .derive(stateContribution));
        SubstanceColorScheme fillColorScheme = SubstanceColorSchemeUtilities
            .getColorScheme(this.menuItem,
                ColorSchemeAssociationKind.FILL, activeState);
        SubstanceColorScheme markColorScheme = SubstanceColorSchemeUtilities
            .getColorScheme(this.menuItem,
                ColorSchemeAssociationKind.MARK, activeState);
        SubstanceColorScheme borderColorScheme = SubstanceColorSchemeUtilities
            .getColorScheme(this.menuItem,
                ColorSchemeAssociationKind.BORDER, activeState);

        HashMapKey keyLayer = SubstanceCoreUtilities.getHashKey(
            fontSize, checkMarkSize, fillPainter.getDisplayName(),
            borderPainter.getDisplayName(), fillColorScheme
                .getDisplayName(), markColorScheme
                .getDisplayName(), borderColorScheme
                .getDisplayName(), visibility);
        Icon iconLayer = iconMap.get(keyLayer);
        if (iconLayer == null) {
          iconLayer = new ImageIcon(SubstanceImageCreator
              .getCheckBox(this.menuItem, fillPainter,
View Full Code Here

   */
  public MagellanSkin() {
    SubstanceSkin.ColorSchemes colorSchemes = SubstanceSkin
        .getColorSchemes("org/pushingpixels/substance/api/skin/magellan.colorschemes");

    SubstanceColorScheme blueControlsActive = colorSchemes
        .get("Magellan Blue Controls Active");
    SubstanceColorScheme blueControlsEnabled = colorSchemes
        .get("Magellan Blue Controls Enabled");

    SubstanceColorSchemeBundle defaultColorSchemeBundle = new SubstanceColorSchemeBundle(
        blueControlsActive, blueControlsEnabled, blueControlsEnabled);
    defaultColorSchemeBundle.registerColorScheme(blueControlsEnabled, 0.5f,
        ComponentState.DISABLED_UNSELECTED);
    defaultColorSchemeBundle.registerColorScheme(blueControlsActive, 0.5f,
        ComponentState.DISABLED_SELECTED);

    // color schemes for the active states
    SubstanceColorScheme blueControlsActiveBorder = colorSchemes
        .get("Magellan Blue Controls Active Border");
    SubstanceColorScheme blueControlsEnabledBorder = colorSchemes
        .get("Magellan Blue Controls Enabled Border");
    defaultColorSchemeBundle.registerColorScheme(blueControlsActiveBorder,
        ColorSchemeAssociationKind.BORDER, ComponentState
            .getActiveStates());
    defaultColorSchemeBundle.registerColorScheme(blueControlsActiveBorder,
        ColorSchemeAssociationKind.BORDER,
        ComponentState.DISABLED_SELECTED);
    defaultColorSchemeBundle.registerColorScheme(blueControlsEnabledBorder,
        ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED,
        ComponentState.DISABLED_UNSELECTED);

    // color schemes for the pressed states
    SubstanceColorScheme blueControlsPressed = colorSchemes
        .get("Magellan Blue Controls Pressed");
    SubstanceColorScheme blueControlsPressedBorder = colorSchemes
        .get("Magellan Blue Controls Pressed Border");
    defaultColorSchemeBundle.registerColorScheme(blueControlsPressed,
        ColorSchemeAssociationKind.FILL,
        ComponentState.PRESSED_SELECTED,
        ComponentState.PRESSED_UNSELECTED);
    defaultColorSchemeBundle.registerColorScheme(blueControlsPressedBorder,
        ColorSchemeAssociationKind.BORDER,
        ComponentState.PRESSED_SELECTED,
        ComponentState.PRESSED_UNSELECTED);

    // color schemes for the rollover / armed states
    SubstanceColorScheme greenControls = colorSchemes
        .get("Magellan Green Controls");
    SubstanceColorScheme greenControlsMark = colorSchemes
        .get("Magellan Green Controls Mark");
    SubstanceColorScheme greenControlsBorder = colorSchemes
        .get("Magellan Green Controls Border");
    defaultColorSchemeBundle.registerColorScheme(greenControls,
        ColorSchemeAssociationKind.FILL,
        ComponentState.ROLLOVER_SELECTED,
        ComponentState.ROLLOVER_UNSELECTED, ComponentState.ARMED,
        ComponentState.ROLLOVER_ARMED);
    defaultColorSchemeBundle.registerColorScheme(greenControlsMark,
        ColorSchemeAssociationKind.MARK,
        ComponentState.ROLLOVER_SELECTED,
        ComponentState.ROLLOVER_UNSELECTED, ComponentState.ARMED,
        ComponentState.ROLLOVER_ARMED);
    defaultColorSchemeBundle.registerColorScheme(greenControlsBorder,
        ColorSchemeAssociationKind.BORDER,
        ComponentState.ROLLOVER_SELECTED,
        ComponentState.ROLLOVER_UNSELECTED, ComponentState.ARMED,
        ComponentState.ROLLOVER_ARMED);

    // color scheme for the uneditable text components
    ComponentState uneditable = new ComponentState("uneditable",
        new ComponentStateFacet[] { ComponentStateFacet.ENABLE },
        new ComponentStateFacet[] { ComponentStateFacet.EDITABLE });
    SubstanceColorScheme uneditableControls = colorSchemes
        .get("Magellan Uneditable Controls");
    defaultColorSchemeBundle.registerColorScheme(uneditableControls,
        ColorSchemeAssociationKind.FILL, uneditable);

    // color scheme for the selected state - preventing fallback to the
    // rollover selected state
    defaultColorSchemeBundle.registerColorScheme(blueControlsActive,
        ColorSchemeAssociationKind.FILL, ComponentState.SELECTED);

    // highlight alphas
    defaultColorSchemeBundle.registerHighlightColorScheme(greenControls,
        0.7f, ComponentState.ROLLOVER_UNSELECTED);
    defaultColorSchemeBundle.registerHighlightColorScheme(greenControls,
        0.8f, ComponentState.SELECTED);
    defaultColorSchemeBundle.registerHighlightColorScheme(greenControls,
        0.95f, ComponentState.ROLLOVER_SELECTED);
    defaultColorSchemeBundle.registerHighlightColorScheme(greenControls,
        1.0f, ComponentState.ARMED, ComponentState.ROLLOVER_ARMED);

    SubstanceColorScheme lightBlueBackground = colorSchemes
        .get("Magellan Light Blue Background");

    this.registerDecorationAreaSchemeBundle(defaultColorSchemeBundle,
        lightBlueBackground, DecorationAreaType.NONE);

    SubstanceColorScheme mediumBlueBackground = colorSchemes
        .get("Magellan Medium Blue Background");
    SubstanceColorScheme darkBlueBackground = colorSchemes
        .get("Magellan Dark Blue Background");
    this.registerAsDecorationArea(mediumBlueBackground,
        DecorationAreaType.GENERAL, DecorationAreaType.TOOLBAR);
    this.registerAsDecorationArea(darkBlueBackground,
        DecorationAreaType.PRIMARY_TITLE_PANE,
        DecorationAreaType.SECONDARY_TITLE_PANE,
        DecorationAreaType.HEADER);

    SubstanceColorScheme lightBlueControlsActive = colorSchemes
        .get("Magellan Light Blue Controls Active");
    SubstanceColorScheme lightBlueControlsEnabled = colorSchemes
        .get("Magellan Light Blue Controls Enabled");
    SubstanceColorScheme lightBlueBordersEnabled = colorSchemes
        .get("Magellan Light Blue Borders Enabled");
    SubstanceColorSchemeBundle footerColorSchemeBundle = new SubstanceColorSchemeBundle(
        lightBlueControlsActive, lightBlueControlsEnabled,
        lightBlueControlsEnabled);
    footerColorSchemeBundle.registerColorScheme(lightBlueControlsEnabled,
        0.5f, ComponentState.DISABLED_UNSELECTED);
    footerColorSchemeBundle.registerColorScheme(lightBlueControlsActive,
        0.5f, ComponentState.DISABLED_SELECTED);
    footerColorSchemeBundle.registerColorScheme(lightBlueBordersEnabled,
        ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED);

    SubstanceColorScheme lightBlueSeparator = colorSchemes
        .get("Magellan Light Blue Separator");
    footerColorSchemeBundle.registerColorScheme(lightBlueSeparator,
        ColorSchemeAssociationKind.SEPARATOR);

    SubstanceColorScheme ultraLightBlueBackground = colorSchemes
        .get("Magellan Ultralight Blue Background");
    this.registerDecorationAreaSchemeBundle(footerColorSchemeBundle,
        ultraLightBlueBackground, DecorationAreaType.FOOTER);

    // Add overlay painter to paint drop shadows along the bottom
View Full Code Here

   * Creates a new <code>Dust Coffee</code> skin.
   */
  public DustCoffeeSkin() {
    SubstanceSkin.ColorSchemes kitchenSinkSchemes = SubstanceSkin
        .getColorSchemes("org/pushingpixels/substance/api/skin/kitchen-sink.colorschemes");
    SubstanceColorScheme activeScheme = kitchenSinkSchemes
        .get("Coffee Active");

    SubstanceSkin.ColorSchemes schemes = SubstanceSkin
        .getColorSchemes("org/pushingpixels/substance/api/skin/dust.colorschemes");
    SubstanceColorScheme enabledScheme = schemes.get("Dust Coffee Enabled");

    SubstanceColorScheme watermarkScheme = schemes
        .get("Dust Coffee Watermark");

    SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
        activeScheme, enabledScheme, enabledScheme);
    defaultSchemeBundle.registerColorScheme(enabledScheme, 0.5f,
        ComponentState.DISABLED_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(activeScheme, 0.5f,
        ComponentState.DISABLED_SELECTED);

    // borders and marks
    SubstanceColorScheme borderEnabledScheme = schemes
        .get("Dust Border Enabled");
    defaultSchemeBundle.registerColorScheme(borderEnabledScheme,
        ColorSchemeAssociationKind.BORDER, ComponentState.ENABLED,
        ComponentState.DISABLED_SELECTED,
        ComponentState.DISABLED_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(activeScheme,
        ColorSchemeAssociationKind.BORDER, ComponentState
            .getActiveStates());
    defaultSchemeBundle.registerColorScheme(borderEnabledScheme,
        ColorSchemeAssociationKind.MARK);

    // text highlight
    SubstanceColorScheme textHighlightScheme = schemes
        .get("Dust Coffee Text Highlight");
    defaultSchemeBundle.registerColorScheme(textHighlightScheme,
        ColorSchemeAssociationKind.TEXT_HIGHLIGHT,
        ComponentState.SELECTED, ComponentState.ROLLOVER_SELECTED);

View Full Code Here

  /**
   * Creates a new <code>Emerald Dusk</code> skin.
   */
  public EmeraldDuskSkin() {
    SubstanceColorScheme activeScheme = new CharcoalColorScheme().hueShift(
        0.3).named("Emerald Dusk Active");
    SubstanceColorScheme enabledScheme = new CharcoalColorScheme()
        .hueShift(0.4).named("Emerald Dusk Enabled");

    SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
        activeScheme, enabledScheme, enabledScheme);
    defaultSchemeBundle.registerColorScheme(activeScheme, 0.5f,
View Full Code Here

   * @return Noise image.
   */
  public static BufferedImage getNoiseImage(SubstanceSkin skin, int width,
      int height, double xFactor, double yFactor, boolean hasConstantZ,
      boolean toBlur, boolean isPreview) {
    SubstanceColorScheme scheme = skin.getWatermarkColorScheme();
    Color c1 = scheme.getWatermarkDarkColor();
    // c1 = new Color(255, 0, 0, 0);
    // System.out.println(c1.getAlpha());
    // Color c2 = scheme.getWatermarkStampColor();
    Color c3 = scheme.getWatermarkLightColor();

    BufferedImage dst = SubstanceCoreUtilities.getBlankImage(width, height);
    //     
    // new BufferedImage(width, height,
    // BufferedImage.TYPE_INT_ARGB);
View Full Code Here

   */
  public GeminiSkin() {
    SubstanceSkin.ColorSchemes schemes = SubstanceSkin
        .getColorSchemes("org/pushingpixels/substance/api/skin/gemini.colorschemes");

    SubstanceColorScheme grayScheme = schemes.get("Gemini Gray");
    SubstanceColorScheme lightGrayScheme = schemes.get("Gemini Light Gray");

    // use the same color scheme for active and enabled controls
    SubstanceColorSchemeBundle defaultSchemeBundle = new SubstanceColorSchemeBundle(
        grayScheme, grayScheme, lightGrayScheme);

    // highlight fill scheme + custom alpha for rollover unselected state
    SubstanceColorScheme highlightScheme = schemes.get("Gemini Highlight");
    SubstanceColorScheme highlightBorderScheme = schemes
        .get("Gemini Highlight Border");
    applyHighlightColorScheme(defaultSchemeBundle, highlightScheme,
        highlightBorderScheme);

    // borders, separators, marks
    SubstanceColorScheme grayBorderScheme = schemes
        .get("Gemini Gray Border");
    SubstanceColorScheme lightGrayBorderScheme = schemes
        .get("Gemini Light Gray Border");
    SubstanceColorScheme lightGraySeparatorScheme = schemes
        .get("Gemini Light Gray Separator");
    defaultSchemeBundle.registerColorScheme(grayBorderScheme,
        ColorSchemeAssociationKind.BORDER);
    defaultSchemeBundle.registerColorScheme(lightGrayBorderScheme,
        ColorSchemeAssociationKind.BORDER,
        ComponentState.DISABLED_DEFAULT,
        ComponentState.DISABLED_SELECTED,
        ComponentState.DISABLED_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(grayScheme,
        ComponentState.ROLLOVER_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(lightGraySeparatorScheme,
        ColorSchemeAssociationKind.SEPARATOR);
    defaultSchemeBundle.registerColorScheme(grayScheme,
        ColorSchemeAssociationKind.MARK);

    defaultSchemeBundle.registerColorScheme(lightGrayScheme, 0.5f,
        ComponentState.DISABLED_UNSELECTED);
    defaultSchemeBundle.registerColorScheme(lightGrayScheme, 0.7f,
        ComponentState.DISABLED_SELECTED);

    SubstanceColorScheme whiteBackgroundScheme = schemes
        .get("Gemini White Background");

    this.registerDecorationAreaSchemeBundle(defaultSchemeBundle,
        whiteBackgroundScheme, DecorationAreaType.NONE);

    // general color scheme bundle
    SubstanceColorSchemeBundle generalSchemeBundle = new SubstanceColorSchemeBundle(
        grayScheme, grayScheme, lightGrayScheme);
    generalSchemeBundle.registerColorScheme(grayScheme,
        ComponentState.ROLLOVER_UNSELECTED);
    generalSchemeBundle.registerColorScheme(grayScheme,
        ColorSchemeAssociationKind.MARK);
    generalSchemeBundle.registerColorScheme(grayBorderScheme,
        ColorSchemeAssociationKind.BORDER);
    applyHighlightColorScheme(generalSchemeBundle, highlightScheme,
        highlightBorderScheme);
    this.registerDecorationAreaSchemeBundle(generalSchemeBundle,
        grayScheme, DecorationAreaType.GENERAL,
        DecorationAreaType.FOOTER);

    // header color scheme bundle
    SubstanceColorScheme blackColorScheme = schemes.get("Gemini Black");
    SubstanceColorSchemeBundle headerSchemeBundle = new SubstanceColorSchemeBundle(
        blackColorScheme, blackColorScheme, blackColorScheme);
    headerSchemeBundle.registerColorScheme(blackColorScheme, 0.5f,
        ComponentState.DISABLED_SELECTED,
        ComponentState.DISABLED_UNSELECTED);
    headerSchemeBundle.registerColorScheme(blackColorScheme,
        ComponentState.ROLLOVER_UNSELECTED);
    headerSchemeBundle.registerColorScheme(blackColorScheme,
        ColorSchemeAssociationKind.MARK);
    headerSchemeBundle.registerColorScheme(blackColorScheme,
        ColorSchemeAssociationKind.BORDER);
    applyHighlightColorScheme(headerSchemeBundle, highlightScheme,
        highlightBorderScheme);
    this.registerDecorationAreaSchemeBundle(headerSchemeBundle,
        blackColorScheme, DecorationAreaType.PRIMARY_TITLE_PANE,
        DecorationAreaType.SECONDARY_TITLE_PANE,
        DecorationAreaType.HEADER);

    // toolbar color scheme bundle
    SubstanceColorScheme darkBlueColorScheme = schemes
        .get("Gemini Dark Blue");
    SubstanceColorScheme darkBlueBackgroundColorScheme = schemes
        .get("Gemini Dark Blue Background");
    SubstanceColorSchemeBundle toolbarSchemeBundle = new SubstanceColorSchemeBundle(
        blackColorScheme, darkBlueColorScheme, darkBlueColorScheme);
    toolbarSchemeBundle.registerColorScheme(blackColorScheme, 0.5f,
        ComponentState.DISABLED_SELECTED);
View Full Code Here

    if (menuItem.getParent() instanceof JPopupMenu) {
      if (menuItem.getComponentOrientation().isLeftToRight()) {
        MenuGutterFillKind fillKind = SubstanceCoreUtilities
            .getMenuGutterFillKind();
        if (fillKind != MenuGutterFillKind.NONE) {
          SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
              .getColorScheme(menuItem, ComponentState.ENABLED);
          Color leftColor = ((fillKind == MenuGutterFillKind.SOFT_FILL) || (fillKind == MenuGutterFillKind.HARD)) ? scheme
              .getUltraLightColor()
              : scheme.getLightColor();
          Color rightColor = ((fillKind == MenuGutterFillKind.SOFT_FILL) || (fillKind == MenuGutterFillKind.SOFT)) ? scheme
              .getUltraLightColor()
              : scheme.getLightColor();
          LinearGradientPaint gp = new LinearGradientPaint(0, 0,
              textOffset, 0, new float[] { 0.0f, 1.0f },
              new Color[] { leftColor, rightColor },
              CycleMethod.REPEAT);
          graphics.setComposite(LafWidgetUtilities.getAlphaComposite(
              menuItem, 0.7f, g));

          // System.out.println(menuItem.getText()
          // + "["
          // + menuItem.isEnabled()
          // + "] : "
          // + ((AlphaComposite) graphics.getComposite())
          // .getAlpha() + ", " + leftColor + "->"
          // + rightColor);
          //
          graphics.setPaint(gp);
          graphics.fillRect(0, 0, textOffset - 2, menuHeight);
        }
      } else {
        // fix for defect 125 - support of RTL menus
        MenuGutterFillKind fillKind = SubstanceCoreUtilities
            .getMenuGutterFillKind();
        if (fillKind != MenuGutterFillKind.NONE) {
          SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
              .getColorScheme(menuItem, ComponentState.ENABLED);
          Color leftColor = ((fillKind == MenuGutterFillKind.HARD_FILL) || (fillKind == MenuGutterFillKind.HARD)) ? scheme
              .getLightColor()
              : scheme.getUltraLightColor();
          Color rightColor = ((fillKind == MenuGutterFillKind.HARD_FILL) || (fillKind == MenuGutterFillKind.SOFT)) ? scheme
              .getLightColor()
              : scheme.getUltraLightColor();

          LinearGradientPaint gp = new LinearGradientPaint(
              textOffset, 0, menuWidth, 0, new float[] { 0.0f,
                  1.0f },
              new Color[] { leftColor, rightColor },
View Full Code Here

TOP

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

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.