package de.jangobrick.swapper;

import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Font;


/**
 * This class controls a Swap's appearance or style by providing setters for the
 * most common properties like font, background or cursor.
 */
public class ComponentStyle
{
    private Component component;

    /**
     * @param component The component this instance controls.
     */
    public ComponentStyle(Component component)
    {
        this.component = component;
    }

    /**
     * Sets the component's font.
     * 
     * @param f The new font.
     * 
     * @return This instance.
     */
    public ComponentStyle font(Font f)
    {
        component.setFont(f);
        return this;
    }

    /**
     * Sets the component's background color.
     * 
     * @param c The new background color.
     * 
     * @return This instance.
     */
    public ComponentStyle background(Color c)
    {
        component.setBackground(c);
        return this;
    }

    /**
     * Sets the component's foreground color.
     * 
     * @param c The new foreground color.
     * 
     * @return This instance.
     */
    public ComponentStyle foreground(Color c)
    {
        component.setForeground(c);
        return this;
    }

    /**
     * Sets the component's cursor.
     * 
     * @param cursor The new cursor.
     * 
     * @return This instance.
     */
    public ComponentStyle cursor(Cursor cursor)
    {
        component.setCursor(cursor);
        return this;
    }
}

@@ -122,16 +122,82 @@
 .Font;%0A%0A
+import javax.swing.JComponent;%0Aimport javax.swing.border.Border;%0A%0A
 %0A/**%0A * 
@@ -333,16 +333,306 @@
 cursor.%0A
+ * %0A * %3Cp%3E%0A * Some properties might not be supported by every instance of this class; for%0A * example, border, or whether the component is opaque, are limited to%0A * subclasses of %7B@code JComponent%7D. In case of an unsupported property being%0A * set anyway, this class guarantees not to throw.%0A
  */%0Apubl
@@ -1807,32 +1807,32 @@
 r cursor)%0A    %7B%0A
-
         componen
@@ -1878,11 +1878,1118 @@
 s;%0A    %7D
+%0A%0A    /**%0A     * Sets whether the component shall be opaque, i.e. whether it shall paint%0A     * every pixel inside its bounds (for a value of %7B@code true%7D) or allow the%0A     * background to show through (for a value of %7B@code false%7D, the default).%0A     * %0A     * %3Cp%3E%0A     * This requires the component to be a subclass of %7B@code JComponent%7D.%0A     * %0A     * @param o Whether the component shall be opaque.%0A     * %0A     * @return This instance.%0A     */%0A    public ComponentStyle opaque(boolean o)%0A    %7B%0A        if (!(component instanceof JComponent)) %7B%0A            return this;%0A        %7D%0A        ((JComponent) component).setOpaque(o);%0A        return this;%0A    %7D%0A%0A    /**%0A     * Sets the component's border.%0A     * %0A     * %3Cp%3E%0A     * This requires the component to be a subclass of %7B@code JComponent%7D.%0A     * %0A     * @param border The new border.%0A     * %0A     * @return This instance.%0A     */%0A    public ComponentStyle border(Border border)%0A    %7B%0A        if (!(component instanceof JComponent)) %7B%0A            return this;%0A        %7D%0A        ((JComponent) component).setBorder(border);%0A        return this;%0A    %7D
 %0A%7D%0A

Add `border` and `opaque` setters to ComponentStyle