Java Code Examples for javax.swing.plaf.synth.SynthContext

The following examples show how to use javax.swing.plaf.synth.SynthContext. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: dragonwell8_jdk   Source File: NimbusStyle.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * <p>Overridden to cause this style to populate itself with data from
 * UIDefaults, if necessary.</p>
 *
 * <p>In addition, NimbusStyle handles ColorTypes slightly differently from
 * Synth.</p>
 * <ul>
 *  <li>ColorType.BACKGROUND will equate to the color stored in UIDefaults
 *      named "background".</li>
 *  <li>ColorType.TEXT_BACKGROUND will equate to the color stored in
 *      UIDefaults named "textBackground".</li>
 *  <li>ColorType.FOREGROUND will equate to the color stored in UIDefaults
 *      named "textForeground".</li>
 *  <li>ColorType.TEXT_FOREGROUND will equate to the color stored in
 *      UIDefaults named "textForeground".</li>
 * </ul>
 */
@Override protected Color getColorForState(SynthContext ctx, ColorType type) {
    String key = null;
    if (type == ColorType.BACKGROUND) {
        key = "background";
    } else if (type == ColorType.FOREGROUND) {
        //map FOREGROUND as TEXT_FOREGROUND
        key = "textForeground";
    } else if (type == ColorType.TEXT_BACKGROUND) {
        key = "textBackground";
    } else if (type == ColorType.TEXT_FOREGROUND) {
        key = "textForeground";
    } else if (type == ColorType.FOCUS) {
        key = "focus";
    } else if (type != null) {
        key = type.toString();
    } else {
        return DEFAULT_COLOR;
    }
    Color c = (Color) get(ctx, key);
    //if all else fails, return a default color (which is a ColorUIResource)
    if (c == null) c = DEFAULT_COLOR;
    return c;
}
 
Example 2
Source Project: hottub   Source File: NimbusIcon.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Scale a size based on the "JComponent.sizeVariant" client property of the
 * component that is using this icon
 *
 * @param context The synthContext to get the component from
 * @param size The size to scale
 * @return The scaled size or original if "JComponent.sizeVariant" is not
 *          set
 */
private int scale(SynthContext context, int size) {
    if (context == null || context.getComponent() == null){
        return size;
    }
    // The key "JComponent.sizeVariant" is used to match Apple's LAF
    String scaleKey = (String) context.getComponent().getClientProperty(
            "JComponent.sizeVariant");
    if (scaleKey != null) {
        if (NimbusStyle.LARGE_KEY.equals(scaleKey)) {
            size *= NimbusStyle.LARGE_SCALE;
        } else if (NimbusStyle.SMALL_KEY.equals(scaleKey)) {
            size *= NimbusStyle.SMALL_SCALE;
        } else if (NimbusStyle.MINI_KEY.equals(scaleKey)) {
            // mini is not quite as small for icons as full mini is
            // just too tiny
            size *= NimbusStyle.MINI_SCALE + 0.07;
        }
    }
    return size;
}
 
Example 3
Source Project: netbeans   Source File: ThemeValue.java    License: Apache License 2.0 6 votes vote down vote up
private static SynthContext getSynthContext () {
    try {
        JButton dummyButton = getDummyButton();
        
        ButtonUI bui = dummyButton.getUI();
        if (bui instanceof SynthUI) {
            return ((SynthUI) bui).getContext(dummyButton);
        } else {
           throw new IllegalStateException ("I don't have a SynthButtonUI to play with"); //NOI18N
        }
    } catch (Exception e) {
        functioning = Boolean.FALSE;
        if (log) {
            e.printStackTrace();
        }
        return null;
    }
}
 
Example 4
Source Project: jdk1.8-source-analysis   Source File: NimbusIcon.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public int getIconWidth(SynthContext context) {
    if (context == null) {
        return width;
    }
    JComponent c = context.getComponent();
    if (c instanceof JToolBar && ((JToolBar)c).getOrientation() == JToolBar.VERTICAL) {
        //we only do the -1 hack for UIResource borders, assuming
        //that the border is probably going to be our border
        if (c.getBorder() instanceof UIResource) {
            return c.getWidth() - 1;
        } else {
            return c.getWidth();
        }
    } else {
        return scale(context, width);
    }
}
 
Example 5
Source Project: JDKSourceCode1.8   Source File: NimbusIcon.java    License: MIT License 6 votes vote down vote up
@Override
public int getIconWidth(SynthContext context) {
    if (context == null) {
        return width;
    }
    JComponent c = context.getComponent();
    if (c instanceof JToolBar && ((JToolBar)c).getOrientation() == JToolBar.VERTICAL) {
        //we only do the -1 hack for UIResource borders, assuming
        //that the border is probably going to be our border
        if (c.getBorder() instanceof UIResource) {
            return c.getWidth() - 1;
        } else {
            return c.getWidth();
        }
    } else {
        return scale(context, width);
    }
}
 
Example 6
/**
 * {@inheritDoc}
 *
 * <p>Overridden to cause this style to populate itself with data from
 * UIDefaults, if necessary.</p>
 *
 * <p>In addition, NimbusStyle handles ColorTypes slightly differently from
 * Synth.</p>
 * <ul>
 *  <li>ColorType.BACKGROUND will equate to the color stored in UIDefaults
 *      named "background".</li>
 *  <li>ColorType.TEXT_BACKGROUND will equate to the color stored in
 *      UIDefaults named "textBackground".</li>
 *  <li>ColorType.FOREGROUND will equate to the color stored in UIDefaults
 *      named "textForeground".</li>
 *  <li>ColorType.TEXT_FOREGROUND will equate to the color stored in
 *      UIDefaults named "textForeground".</li>
 * </ul>
 */
@Override protected Color getColorForState(SynthContext ctx, ColorType type) {
    String key = null;
    if (type == ColorType.BACKGROUND) {
        key = "background";
    } else if (type == ColorType.FOREGROUND) {
        //map FOREGROUND as TEXT_FOREGROUND
        key = "textForeground";
    } else if (type == ColorType.TEXT_BACKGROUND) {
        key = "textBackground";
    } else if (type == ColorType.TEXT_FOREGROUND) {
        key = "textForeground";
    } else if (type == ColorType.FOCUS) {
        key = "focus";
    } else if (type != null) {
        key = type.toString();
    } else {
        return DEFAULT_COLOR;
    }
    Color c = (Color) get(ctx, key);
    //if all else fails, return a default color (which is a ColorUIResource)
    if (c == null) c = DEFAULT_COLOR;
    return c;
}
 
Example 7
Source Project: Java8CN   Source File: SynthPainterImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Paints the border of a text field.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintTextFieldBorder(SynthContext context,
                                  Graphics g, int x, int y,
                                  int w, int h) {
    if (context.getComponent().getComponentOrientation().isLeftToRight()){
        paintBorder(context, g, x, y, w, h, null);
    } else {
        AffineTransform transform = new AffineTransform();
        transform.translate(x,y);
        transform.scale(-1, 1);
        transform.translate(-w,0);
        paintBorder(context, g, 0, 0, w, h, transform);
    }
}
 
Example 8
Source Project: openjdk-jdk9   Source File: NimbusStyle.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * Overridden to cause this style to populate itself with data from
 * UIDefaults, if necessary.
 */
@Override public void installDefaults(SynthContext ctx) {
    validate();

    //delegate to the superclass to install defaults such as background,
    //foreground, font, and opaque onto the swing component.
    super.installDefaults(ctx);
}
 
Example 9
Source Project: swift-k   Source File: MSynthPainter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void paintTabbedPaneContentBorder(SynthContext context, Graphics g, int x, int y, int w, int h) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g.setColor(BG);
    g.drawRoundRect(x, y, w, h, 6, 6);
}
 
Example 10
Source Project: Java8CN   Source File: SynthPainterImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Paints the background of a formatted text field.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintFormattedTextFieldBackground(SynthContext context,
                                      Graphics g, int x, int y,
                                      int w, int h) {
    if (context.getComponent().getComponentOrientation().isLeftToRight()){
        paintBackground(context, g, x, y, w, h, null);
    } else {
        AffineTransform transform = new AffineTransform();
        transform.translate(x,y);
        transform.scale(-1, 1);
        transform.translate(-w,0);
        paintBackground(context, g, 0, 0, w, h, transform);
    }
}
 
Example 11
/**
 * Paints the background of an arrow button. Arrow buttons are created by
 * some components, such as <code>JScrollBar</code>.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintArrowButtonBackground(SynthContext context,
                                       Graphics g, int x, int y,
                                       int w, int h) {
    if (context.getComponent().getComponentOrientation().isLeftToRight()){
        paintBackground(context, g, x, y, w, h, null);
    } else {
        AffineTransform transform = new AffineTransform();
        transform.translate(x,y);
        transform.scale(-1, 1);
        transform.translate(-w,0);
        paintBackground(context, g, 0, 0, w, h, transform);
    }
}
 
Example 12
Source Project: dragonwell8_jdk   Source File: NimbusStyle.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * Overridden to cause this style to populate itself with data from
 * UIDefaults, if necessary. If opacity is not specified in UI defaults,
 * then it defaults to being non-opaque.
 */
@Override public boolean isOpaque(SynthContext ctx) {
    // Force Table CellRenderers to be opaque
    if ("Table.cellRenderer".equals(ctx.getComponent().getName())) {
        return true;
    }
    Boolean opaque = (Boolean)get(ctx, "opaque");
    return opaque == null ? false : opaque;
}
 
Example 13
private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w,
                         int h, AffineTransform transform) {
    Painter<Object> borderPainter = style.getBorderPainter(ctx);
    if (borderPainter != null) {
        paint(borderPainter, ctx, g, x, y, w, h,transform);
    }
}
 
Example 14
Source Project: seaglass   Source File: SeaGlassIcon.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns the icon's height. This is a cover method for <code>
 * getIconHeight(null)</code>.
 *
 * @param  context the SynthContext describing the component/region, the
 *                 style, and the state.
 *
 * @return an int specifying the fixed height of the icon.
 */
@Override
public int getIconHeight(SynthContext context) {
    if (context == null) {
        return height;
    }

    JComponent c = context.getComponent();

    if (c instanceof JToolBar) {
        JToolBar toolbar = (JToolBar) c;

        if (toolbar.getOrientation() == JToolBar.HORIZONTAL) {

            // we only do the -1 hack for UIResource borders, assuming
            // that the border is probably going to be our border
            if (toolbar.getBorder() instanceof UIResource) {
                return c.getHeight() - 1;
            } else {
                return c.getHeight();
            }
        } else {
            return scale(context, width);
        }
    } else {
        return scale(context, height);
    }
}
 
Example 15
/**
 * Paints the border of a formatted text field.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintFormattedTextFieldBorder(SynthContext context,
                                  Graphics g, int x, int y,
                                  int w, int h) {
    if (context.getComponent().getComponentOrientation().isLeftToRight()){
        paintBorder(context, g, x, y, w, h, null);
    } else {
        AffineTransform transform = new AffineTransform();
        transform.translate(x,y);
        transform.scale(-1, 1);
        transform.translate(-w,0);
        paintBorder(context, g, 0, 0, w, h, transform);
    }
}
 
Example 16
Source Project: jdk8u_jdk   Source File: SynthPainterImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Paints the background of a combo box.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintComboBoxBackground(SynthContext context,
                                    Graphics g, int x, int y,
                                    int w, int h) {
    if (context.getComponent().getComponentOrientation().isLeftToRight()){
        paintBackground(context, g, x, y, w, h, null);
    } else {
        AffineTransform transform = new AffineTransform();
        transform.translate(x,y);
        transform.scale(-1, 1);
        transform.translate(-w,0);
        paintBackground(context, g, 0, 0, w, h, transform);
    }
}
 
Example 17
Source Project: JDKSourceCode1.8   Source File: NimbusStyle.java    License: MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * <p>Overridden to cause this style to populate itself with data from
 * UIDefaults, if necessary.</p>
 *
 * <p>Properties in UIDefaults may be specified in a chained manner. For
 * example:
 * <pre>
 * background
 * Button.opacity
 * Button.Enabled.foreground
 * Button.Enabled+Selected.background
 * </pre>
 *
 * <p>In this example, suppose you were in the Enabled+Selected state and
 * searched for "foreground". In this case, we first check for
 * Button.Enabled+Selected.foreground, but no such color exists. We then
 * fall back to the next valid state, in this case,
 * Button.Enabled.foreground, and have a match. So we return it.</p>
 *
 * <p>Again, if we were in the state Enabled and looked for "background", we
 * wouldn't find it in Button.Enabled, or in Button, but would at the top
 * level in UIManager. So we return that value.</p>
 *
 * <p>One special note: the "key" passed to this method could be of the form
 * "background" or "Button.background" where "Button" equals the prefix
 * passed to the NimbusStyle constructor. In either case, it looks for
 * "background".</p>
 *
 * @param ctx
 * @param key must not be null
 */
@Override public Object get(SynthContext ctx, Object key) {
    Values v = getValues(ctx);

    // strip off the prefix, if there is one.
    String fullKey = key.toString();
    String partialKey = fullKey.substring(fullKey.indexOf(".") + 1);

    Object obj = null;
    int xstate = getExtendedState(ctx, v);

    // check the cache
    tmpKey.init(partialKey, xstate);
    obj = v.cache.get(tmpKey);
    boolean wasInCache = obj != null;
    if (!wasInCache){
        // Search exact matching states and then lesser matching states
        RuntimeState s = null;
        int[] lastIndex = new int[] {-1};
        while (obj == null &&
                (s = getNextState(v.states, lastIndex, xstate)) != null) {
            obj = s.defaults.get(partialKey);
        }
        // Search Region Defaults
        if (obj == null && v.defaults != null) {
            obj = v.defaults.get(partialKey);
        }
        // return found object
        // Search UIManager Defaults
        if (obj == null) obj = UIManager.get(fullKey);
        // Search Synth Defaults for InputMaps
        if (obj == null && partialKey.equals("focusInputMap")) {
            obj = super.get(ctx, fullKey);
        }
        // if all we got was a null, store this fact for later use
        v.cache.put(new CacheKey(partialKey, xstate),
                obj == null ? NULL : obj);
    }
    // return found object
    return obj == NULL ? null : obj;
}
 
Example 18
Source Project: seaglass   Source File: SeaGlassToolBarUI.java    License: Apache License 2.0 4 votes vote down vote up
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h) {
    ((SeaGlassContext) context).getPainter().paintToolBarBorder(context, g, x, y, w, h, toolBar.getOrientation());
}
 
Example 19
Source Project: jdk8u-jdk   Source File: SynthPainterImpl.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Paints the background of a button.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintButtonBackground(SynthContext context,
                                  Graphics g, int x, int y,
                                  int w, int h) {
    paintBackground(context, g, x, y, w, h, null);
}
 
Example 20
Source Project: openjdk-8   Source File: SynthPainterImpl.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Paints the background of the viewport.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintViewportBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    paintBackground(context, g, x, y, w, h, null);
}
 
Example 21
Source Project: Bytecoder   Source File: SynthPainterImpl.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Paints the border of a scroll pane.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintScrollPaneBorder(SynthContext context,
                             Graphics g, int x, int y,
                             int w, int h) {
    paintBorder(context, g, x, y, w, h, null);
}
 
Example 22
Source Project: Java8CN   Source File: SynthPainterImpl.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Paints the border of a slider. This implementation invokes the
 * method of the same name without the orientation.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 * @param orientation One of <code>JSlider.HORIZONTAL</code> or
 *                           <code>JSlider.VERTICAL</code>
 * @since 1.6
 */
public void paintSliderBorder(SynthContext context,
                             Graphics g, int x, int y,
                             int w, int h, int orientation) {
    paintBorder(context, g, x, y, w, h, orientation);
}
 
Example 23
Source Project: openjdk-8   Source File: SynthPainterImpl.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Paints the border of the content area of a tool bar.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintToolBarContentBorder(SynthContext context,
                             Graphics g, int x, int y,
                             int w, int h) {
    paintBorder(context, g, x, y, w, h, null);
}
 
Example 24
Source Project: Bytecoder   Source File: SynthPainterImpl.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Paints the background of a split pane.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintSplitPaneBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    paintBackground(context, g, x, y, w, h, null);
}
 
Example 25
/**
 * Paints the border of a scrollbar.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintScrollBarBorder(SynthContext context,
                             Graphics g, int x, int y,
                             int w, int h) {
    paintBorder(context, g, x, y, w, h, null);
}
 
Example 26
Source Project: jdk8u-jdk   Source File: SynthPainterImpl.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Paints the border of a password field.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintPasswordFieldBorder(SynthContext context,
                             Graphics g, int x, int y,
                             int w, int h) {
    paintBorder(context, g, x, y, w, h, null);
}
 
Example 27
Source Project: jdk8u_jdk   Source File: SynthPainterImpl.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Paints the background of a text pane.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintTextPaneBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    paintBackground(context, g, x, y, w, h, null);
}
 
Example 28
Source Project: Java8CN   Source File: SynthPainterImpl.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Paints the border of an internal frame title pane.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintInternalFrameTitlePaneBorder(SynthContext context,
                                  Graphics g, int x, int y,
                                  int w, int h) {
    paintBorder(context, g, x, y, w, h, null);
}
 
Example 29
Source Project: hottub   Source File: SynthPainterImpl.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * Paints the background of the viewport.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 */
public void paintViewportBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h) {
    paintBackground(context, g, x, y, w, h, null);
}
 
Example 30
/**
 * Paints the background of the window containing the tool bar when it
 * has been detached from its primary frame. This implementation invokes the
 * method of the same name without the orientation.
 *
 * @param context SynthContext identifying the <code>JComponent</code> and
 *        <code>Region</code> to paint to
 * @param g <code>Graphics</code> to paint to
 * @param x X coordinate of the area to paint to
 * @param y Y coordinate of the area to paint to
 * @param w Width of the area to paint to
 * @param h Height of the area to paint to
 * @param orientation One of <code>JToolBar.HORIZONTAL</code> or
 *                           <code>JToolBar.VERTICAL</code>
 * @since 1.6
 */
public void paintToolBarDragWindowBackground(SynthContext context,
                                 Graphics g, int x, int y,
                                 int w, int h, int orientation) {
    paintBackground(context, g, x, y, w, h, orientation);
}