quick.dbtable
Class Skin

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byquick.dbtable.Skin
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class Skin
extends java.util.Hashtable
implements java.io.Serializable

Skins are used to apply style for your quickTable.

  Advantages of skins are
  1) Business logic and presentation separation
  2) You can change the style without changing the code
  3) You can get good skins from professional designers

  Visit http://quicktable.org/skin.htm for free skins


  A sample skin


  import java.io.*;
  import javax.swing.*;
  import java.awt.*;
  import quick.dbtable.*;

  public class SimpleSkin extends Skin
  {
    Font headerFont = new Font("Arial",Font.BOLD,14);
    Font font = new Font("Arial",Font.BOLD,12);

    Color background = new Color(204, 255, 102);
    Color selectionFontColor = new Color(255, 144, 34);
    Color header = new Color(0,0,102);
    Color headerFontColor = Color.white;
    Color fontColor = new Color(52, 103, 254);

    CellPropertiesModel cp = new CellPropertiesModel()
    {
           public Color getForeground(int row, int col)
           {
                return fontColor;
           }

           public Color getBackground(int row, int col)
           {
                return background;
           }
    };

    public SimpleSkin()
    {
      put(Skin.TABLE_FONT,font);
      put(Skin.SELECTION_BACKGROUND,Color.white);//
      put(Skin.SELECTION_FOREGROUND, selectionFontColor);
      put(Skin.HEADER_FOREGROUND,headerFontColor);//
      put(Skin.HEADER_BACKGROUND,header);
      put(Skin.HEADER_FONT,headerFont);//
      put(Skin.FOCUS_CELL_HIGHLIGHT_BORDER,new javax.swing.border.MatteBorder(3, 3,3,3, header) );
      put(Skin.FOCUS_CELL_BACKGROUND,Color.white);
      put(Skin.FOCUS_CELL_FOREGROUND,Color.red);
      put(Skin.GRID_COLOR,Color.white);   //
      put(Skin.NAVIGATION_FOREGROUND,headerFontColor);
      put(Skin.NAVIGATION_BACKGROUND,header);
      put(Skin.NAVIGATION_FONT,headerFont);
      put(Skin.ROW_HEIGTH, new Integer(25));  //
      put(Skin.CELL_PROPERTIES_MODEL,cp);

      //examples to set other properties
      //put(Skin.TABLE_BACKGROUND,Color.lightGray);
      //put(Skin.TABLE_FOREGROUND,Color.black);
      //put(Skin.SHOW_HORIZONTAL_LINES, Boolean.TRUE);
      //put(Skin.SHOW_VERTICAL_LINES, Boolean.TRUE);
      //put(Skin.NEXT_ICON,new ImageIcon(getClass().getResource("next.gif")));
      //put(Skin.PREVIOUS_ICON, new ImageIcon(getClass().getResource("prev.gif")));
      //put(Skin.FIRST_ICON,new ImageIcon(getClass().getResource("first.gif")));
      //put(Skin.LAST_ICON,new ImageIcon(getClass().getResource("last.gif")));
      //put(Skin.DELETE_ICON,new ImageIcon(getClass().getResource("delete.gif")));
      //put(Skin.ADD_ICON,new ImageIcon(getClass().getResource("new.gif")));
      //put(Skin.NAVIGATION_BUTTON_COLOR,Color.lightGray);
      //put(Skin.INTERCELL_SPACING,new Dimension(1,1));
    }
  }


  //after creating your skin you can use the setSkin() method in DBTable to set to DBTable
  SimpleSkin mySkin = new SimpleSkin();

  yourQuicktable.setSkin(mySkin);

  

Author:
Benjamin D. Franklin
See Also:
DBTable.setSkin(Skin), Serialized Form

Field Summary
static java.lang.String ADD_ICON
          The value for this property should be the type javax.swing.ImageIcon
static java.lang.String CELL_BORDER
          The value for this property should be the type javax.swing.border.Border
static java.lang.String CELL_PROPERTIES_MODEL
          The value for this property should be the type quick.dbtable.CellPropertiesModel
static java.lang.String DELETE_ICON
          The value for this property should be the type javax.swing.ImageIcon
static java.lang.String FIRST_ICON
          The value for this property should be the type javax.swing.ImageIcon
static java.lang.String FOCUS_CELL_BACKGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String FOCUS_CELL_FOREGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String FOCUS_CELL_HIGHLIGHT_BORDER
          The value for this property should be the type javax.swing.border.Border
static java.lang.String GRID_COLOR
          The value for this property should be the type java.awt.Color
static java.lang.String HEADER_BACKGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String HEADER_FONT
          The value for this property should be the type java.awt.Font
static java.lang.String HEADER_FOREGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String INTERCELL_SPACING
          The value for this property should be the type java.awt.Dimension
static java.lang.String LAST_ICON
          The value for this property should be the type javax.swing.ImageIcon
static java.lang.String NAVIGATION_BACKGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String NAVIGATION_BUTTON_COLOR
          The value for this property should be the type java.awt.Color
static java.lang.String NAVIGATION_FONT
          The value for this property should be the type java.awt.Font
static java.lang.String NAVIGATION_FOREGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String NEXT_ICON
          The value for this property should be the type javax.swing.ImageIcon
static java.lang.String PREVIOUS_ICON
          The value for this property should be the type javax.swing.ImageIcon
static java.lang.String ROW_HEIGTH
          The value for this property should be the type java.lang.Integer
static java.lang.String SELECTION_BACKGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String SELECTION_FOREGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String SHOW_HORIZONTAL_LINES
          The value for this property should be the type java.lang.Boolean
static java.lang.String SHOW_VERTICAL_LINES
          The value for this property should be the type java.lang.Boolean
static java.lang.String TABLE_BACKGROUND
          The value for this property should be the type java.awt.Color
static java.lang.String TABLE_FONT
          The value for this property should be the type java.awt.Font
static java.lang.String TABLE_FOREGROUND
          The value for this property should be the type java.awt.Color
 
Constructor Summary
Skin()
           
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TABLE_FONT

public static final java.lang.String TABLE_FONT
The value for this property should be the type java.awt.Font

See Also:
Constant Field Values

TABLE_BACKGROUND

public static final java.lang.String TABLE_BACKGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

TABLE_FOREGROUND

public static final java.lang.String TABLE_FOREGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

SELECTION_BACKGROUND

public static final java.lang.String SELECTION_BACKGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

SELECTION_FOREGROUND

public static final java.lang.String SELECTION_FOREGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

HEADER_FOREGROUND

public static final java.lang.String HEADER_FOREGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

HEADER_BACKGROUND

public static final java.lang.String HEADER_BACKGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

HEADER_FONT

public static final java.lang.String HEADER_FONT
The value for this property should be the type java.awt.Font

See Also:
Constant Field Values

NAVIGATION_FOREGROUND

public static final java.lang.String NAVIGATION_FOREGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

NAVIGATION_BACKGROUND

public static final java.lang.String NAVIGATION_BACKGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

NAVIGATION_FONT

public static final java.lang.String NAVIGATION_FONT
The value for this property should be the type java.awt.Font

See Also:
Constant Field Values

FOCUS_CELL_BACKGROUND

public static final java.lang.String FOCUS_CELL_BACKGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

FOCUS_CELL_FOREGROUND

public static final java.lang.String FOCUS_CELL_FOREGROUND
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

FOCUS_CELL_HIGHLIGHT_BORDER

public static final java.lang.String FOCUS_CELL_HIGHLIGHT_BORDER
The value for this property should be the type javax.swing.border.Border

See Also:
Constant Field Values

CELL_BORDER

public static final java.lang.String CELL_BORDER
The value for this property should be the type javax.swing.border.Border

See Also:
Constant Field Values

GRID_COLOR

public static final java.lang.String GRID_COLOR
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

SHOW_HORIZONTAL_LINES

public static final java.lang.String SHOW_HORIZONTAL_LINES
The value for this property should be the type java.lang.Boolean

See Also:
Constant Field Values

SHOW_VERTICAL_LINES

public static final java.lang.String SHOW_VERTICAL_LINES
The value for this property should be the type java.lang.Boolean

See Also:
Constant Field Values

ROW_HEIGTH

public static final java.lang.String ROW_HEIGTH
The value for this property should be the type java.lang.Integer

See Also:
Constant Field Values

CELL_PROPERTIES_MODEL

public static final java.lang.String CELL_PROPERTIES_MODEL
The value for this property should be the type quick.dbtable.CellPropertiesModel

See Also:
Constant Field Values

NEXT_ICON

public static final java.lang.String NEXT_ICON
The value for this property should be the type javax.swing.ImageIcon

See Also:
Constant Field Values

PREVIOUS_ICON

public static final java.lang.String PREVIOUS_ICON
The value for this property should be the type javax.swing.ImageIcon

See Also:
Constant Field Values

FIRST_ICON

public static final java.lang.String FIRST_ICON
The value for this property should be the type javax.swing.ImageIcon

See Also:
Constant Field Values

LAST_ICON

public static final java.lang.String LAST_ICON
The value for this property should be the type javax.swing.ImageIcon

See Also:
Constant Field Values

DELETE_ICON

public static final java.lang.String DELETE_ICON
The value for this property should be the type javax.swing.ImageIcon

See Also:
Constant Field Values

ADD_ICON

public static final java.lang.String ADD_ICON
The value for this property should be the type javax.swing.ImageIcon

See Also:
Constant Field Values

NAVIGATION_BUTTON_COLOR

public static final java.lang.String NAVIGATION_BUTTON_COLOR
The value for this property should be the type java.awt.Color

See Also:
Constant Field Values

INTERCELL_SPACING

public static final java.lang.String INTERCELL_SPACING
The value for this property should be the type java.awt.Dimension

See Also:
Constant Field Values
Constructor Detail

Skin

public Skin()