|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Dictionary java.util.Hashtable quick.dbtable.Skin
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);
DBTable.setSkin(Skin)
,
Serialized FormField 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 |
public static final java.lang.String TABLE_FONT
public static final java.lang.String TABLE_BACKGROUND
public static final java.lang.String TABLE_FOREGROUND
public static final java.lang.String SELECTION_BACKGROUND
public static final java.lang.String SELECTION_FOREGROUND
public static final java.lang.String HEADER_FOREGROUND
public static final java.lang.String HEADER_BACKGROUND
public static final java.lang.String HEADER_FONT
public static final java.lang.String NAVIGATION_FOREGROUND
public static final java.lang.String NAVIGATION_BACKGROUND
public static final java.lang.String NAVIGATION_FONT
public static final java.lang.String FOCUS_CELL_BACKGROUND
public static final java.lang.String FOCUS_CELL_FOREGROUND
public static final java.lang.String FOCUS_CELL_HIGHLIGHT_BORDER
public static final java.lang.String CELL_BORDER
public static final java.lang.String GRID_COLOR
public static final java.lang.String SHOW_HORIZONTAL_LINES
public static final java.lang.String SHOW_VERTICAL_LINES
public static final java.lang.String ROW_HEIGTH
public static final java.lang.String CELL_PROPERTIES_MODEL
public static final java.lang.String NEXT_ICON
public static final java.lang.String PREVIOUS_ICON
public static final java.lang.String FIRST_ICON
public static final java.lang.String LAST_ICON
public static final java.lang.String DELETE_ICON
public static final java.lang.String ADD_ICON
public static final java.lang.String NAVIGATION_BUTTON_COLOR
public static final java.lang.String INTERCELL_SPACING
Constructor Detail |
public Skin()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |