Package org.jvnet.substance.api

Examples of org.jvnet.substance.api.SubstanceColorScheme


     */
    private void initComponents() {
        setLayout(new BorderLayout());
        setFocusable(false);

        SubstanceColorScheme borderColorScheme = SubstanceColorSchemeUtilities.getColorScheme(
                this, ColorSchemeAssociationKind.BORDER, ComponentState.DEFAULT);
        setBorder(BorderFactory.createMatteBorder(1, 1, 0, 1,
                borderColorScheme.getDarkColor()));

        JToolBar tbHeaderBar = new JToolBar();
        tbHeaderBar.setPreferredSize(new Dimension(150, 25));

        JLabel lblCaption = new JLabel(I18n.COMMON.getString("AbstractPreviewPanel.Title"));
View Full Code Here


     *
     * @param component component for border color.
     * @return border color of the component in substance look and feel.
     */
    public static Color getSubstanceComponentBorderColor(Component component) {
        SubstanceColorScheme borderColorScheme = SubstanceColorSchemeUtilities
                .getColorScheme(component, ColorSchemeAssociationKind.BORDER,
                        ComponentState.DEFAULT);

        return borderColorScheme.getDarkColor();
    }
View Full Code Here

   * org.jvnet.substance.skin.SubstanceSkin)
   */
  public void paintDecorationArea(Graphics2D graphics, Component comp,
      DecorationAreaType decorationAreaType, int width, int height,
      SubstanceSkin skin) {
    SubstanceColorScheme scheme = skin
        .getBackgroundColorScheme(decorationAreaType);
    if (width * height < 100000) {
      HashMapKey key = SubstanceCoreUtilities.getHashKey(width, height,
          scheme.getDisplayName());
      BufferedImage result = smallImageCache.get(key);
      if (result == null) {
        result = SubstanceCoreUtilities.getBlankImage(width, height);
        this.internalPaint((Graphics2D) result.getGraphics(), comp,
            width, height, scheme);
View Full Code Here

        progressBar.isEnabled() ? ComponentState.DEFAULT
            : ComponentState.DISABLED_UNSELECTED);
    g2d.setComposite(TransitionLayout.getAlphaComposite(progressBar,
        stateAlpha, g));

    SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
        .getColorScheme(progressBar,
            progressBar.isEnabled() ? ComponentState.DEFAULT
                : ComponentState.DISABLED_UNSELECTED);

    SubstanceGradientPainter gp = SubstanceCoreUtilities
        .getGradientPainter(progressBar);
    if (progressBar.getOrientation() == SwingConstants.HORIZONTAL) {
      BufferedImage back = getDeterminateBackground(progressBar,
          barRectWidth + 1, barRectHeight + 1, scheme, gp,
          progressBar.getOrientation(), this.progressBar
              .getComponentOrientation());
      g2d.drawImage(back, margin, margin, null);
    } else {
      BufferedImage back = getDeterminateBackground(progressBar,
          barRectHeight + 1, barRectWidth + 1, scheme, gp,
          progressBar.getOrientation(), this.progressBar
              .getComponentOrientation());
      g2d.drawImage(back, margin, margin, null);
    }

    if (amountFull > 0) {
      // float borderStrokeWidth = SubstanceSizeUtils
      // .getBorderStrokeWidth(SubstanceSizeUtils
      // .getComponentFontSize(progressBar));
      // SubstanceBorderPainter borderPainter = SubstanceCoreUtilities
      // .getBorderPainter(null);
      int borderDelta = 0;
      // (borderPainter instanceof InnerDelegateBorderPainter) ? (int)
      // (Math
      // .ceil(2.0 * borderStrokeWidth)) / 2
      // : (int) (Math.ceil(borderStrokeWidth / 2.0));// : 0;
      // if (borderDelta == 0)

      SubstanceColorScheme fillColorScheme = SubstanceColorSchemeUtilities
          .getColorScheme(progressBar,
              progressBar.isEnabled() ? ComponentState.SELECTED
                  : ComponentState.DISABLED_UNSELECTED);
      if (progressBar.getOrientation() == SwingConstants.HORIZONTAL) {
        int barWidth = amountFull - 2 * borderDelta;
 
View Full Code Here

   *
   * @see javax.swing.plaf.basic.BasicProgressBarUI#getSelectionBackground()
   */
  @Override
  protected Color getSelectionBackground() {
    SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
        .getColorScheme(progressBar,
            progressBar.isEnabled() ? ComponentState.DEFAULT
                : ComponentState.DISABLED_UNSELECTED);
    return SubstanceColorUtilities.getForegroundColor(scheme);
  }
View Full Code Here

   *
   * @see javax.swing.plaf.basic.BasicProgressBarUI#getSelectionForeground()
   */
  @Override
  protected Color getSelectionForeground() {
    SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
        .getColorScheme(progressBar,
            progressBar.isEnabled() ? ComponentState.SELECTED
                : ComponentState.DISABLED_UNSELECTED);
    return SubstanceColorUtilities.getForegroundColor(scheme);
  }
View Full Code Here

        progressBar.isEnabled() ? ComponentState.SELECTED
            : ComponentState.DISABLED_UNSELECTED);
    g2d.setComposite(TransitionLayout.getAlphaComposite(progressBar,
        stateAlpha, g));

    SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
        .getColorScheme(progressBar,
            progressBar.isEnabled() ? ComponentState.SELECTED
                : ComponentState.DISABLED_UNSELECTED);
    if (progressBar.getOrientation() == SwingConstants.HORIZONTAL) {
      SubstanceImageCreator.paintRectangularStripedBackground(
View Full Code Here

   */
  private void paintTitleBackground(Graphics2D graphics, Component comp,
      DecorationAreaType decorationAreaType, int width, int height,
      SubstanceSkin skin) {

    SubstanceColorScheme tileScheme = skin
        .getBackgroundColorScheme(decorationAreaType);
    if (this.baseDecorationPainter == null) {
      graphics.setColor(tileScheme.getMidColor());
      graphics.fillRect(0, 0, width, height);
    } else {
      this.baseDecorationPainter.paintDecorationArea(graphics, comp,
          decorationAreaType, width, height, skin);
    }
View Full Code Here

          }
        }
      }
    }

    SubstanceColorScheme tileScheme = skin
        .getBackgroundColorScheme(decorationAreaType);
    if (this.baseDecorationPainter != null) {
      this.baseDecorationPainter.paintDecorationArea(graphics, comp,
          decorationAreaType, width, height, skin);
    } else {
      graphics.setColor(tileScheme.getMidColor());
      graphics.fillRect(0, 0, width, height);
    }
    Graphics2D temp = (Graphics2D) graphics.create();
    this.tileArea(temp, comp, tileScheme, dx, dy, 0, 0, width, height);
    temp.dispose();
View Full Code Here

   * @return Noise image.
   */
  public static BufferedImage getNoiseImage(SubstanceSkin skin, int width,
      int height, double xFactor, double yFactor, boolean hasConstantZ,
      NoiseFilter noiseFilter, 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

TOP

Related Classes of org.jvnet.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.