001package org.jdesktop.swingx; 002 003import java.awt.Component; 004import java.awt.Container; 005import java.awt.Dimension; 006import java.awt.LayoutManager; 007import java.io.Serializable; 008 009/** 010 * A simple abstract class to handle common layout implementations. Package-private as we do NOT 011 * want to export this as part of the public API. 012 * 013 * @author kschaefer 014 */ 015abstract class AbstractLayoutManager implements LayoutManager, Serializable { 016 private static final long serialVersionUID = 1446292747820044161L; 017 018 /** 019 * {@inheritDoc} 020 * <p> 021 * This implementation does nothing. 022 */ 023 @Override 024 public void addLayoutComponent(String name, Component comp) { 025 //does nothing 026 } 027 028 /** 029 * {@inheritDoc} 030 * <p> 031 * This implementation does nothing. 032 */ 033 @Override 034 public void removeLayoutComponent(Component comp) { 035 // does nothing 036 } 037 038 /** 039 * {@inheritDoc} 040 * <p> 041 * This implementation defers to {@link #preferredLayoutSize(Container)}. 042 */ 043 @Override 044 public Dimension minimumLayoutSize(Container parent) { 045 return preferredLayoutSize(parent); 046 } 047}