SLookAndFeel.java :  » Swing-Library » Swinglets » com » javelin » swinglets » plaf » Java Open Source

Java Open Source » Swing Library » Swinglets 
Swinglets » com » javelin » swinglets » plaf » SLookAndFeel.java
/*
 * Copyright Javelin Software, All rights reserved.
 */
 
package com.javelin.swinglets.plaf;

import java.awt.*;
import java.util.*;
import java.io.*;

/**
 * SLookAndFeel defines a look and feel. 
 * 
 * @author Robin Sharp
 */
 
import java.awt.*;
import java.io.*;
import java.util.*;

import com.javelin.swinglets.*;
import com.javelin.swinglets.border.*;
import com.javelin.swinglets.plaf.*;

public abstract class SLookAndFeel
{
    public final static String TABLE_DEFAULT_CELL_RENDERER = "_TABLE_DCR";
    public final static String TABLE_DEFAULT_HEADER_RENDERER = "_TABLE_DHR";
    public final static String TABLE_DEFAULT_FOOTER_RENDERER = "_TABLE_DFR";
    public final static String TREE_DEFAULT_CELL_RENDERER = "_TREE_DCR";
    public final static String TABBED_DEFAULT_CELL_RENDERER = "_TAB_DCR";

    /**
     * Construct a SLookAndFeel. 
     */
    public SLookAndFeel()
    {
    }
    
   /**
    * Get the name of the look and feel.
    */
    public abstract String getName();
    
   /**
    * Get the content type for the look and feel.
    */
    public abstract String getContentType();
    
   /**
    * Does the look and feel require a Writer (char)
    * stream or a OutputStream (byte) stream.
    */
    public abstract boolean isWriter();
    
   /**
    * Get a SComponentUI for a SComponent.
    */
    public abstract SComponentUI getUI( SComponent component );
    
   /**
    * Get a SLayoutUI for a SLayout.
    */
    public abstract SLayoutUI getLayoutUI( SLayoutManager layout );

   /**
    * Get a SBorderUI for a SBorder.
    */
    public abstract SBorderUI getBorderUI( SBorder border );

   /**
    * Get the SUIDefaults
    */
    public SUIDefaults getUIDefaults()
    {
        if( defaults == null )
        {
            //new Exception().printStackTrace();
            defaults = new SUIDefaults();
            initClassDefaults( defaults );
        }
        
        return defaults;
    }
    
    /**
    * Called by the Constructor.
    */
    protected abstract void initClassDefaults( SUIDefaults defaults );
    
   /**
    * To string. get the name
    */
    public String toString()
    {
        return getName();
    }
    
    // PRIVATE ///////////////////////////////////////////////////////
    
    protected SUIDefaults defaults;
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.