1 14 package org.wings; 15 16 import org.wings.io.Device; 17 import org.wings.plaf.LayoutCG; 18 import org.wings.session.SessionManager; 19 20 import java.io.IOException ; 21 22 28 public abstract class SAbstractLayoutManager 29 implements SLayoutManager { 30 34 protected transient LayoutCG cg; 35 36 39 protected SContainer container; 40 41 44 protected SDimension preferredSize = null; 45 46 47 protected SAbstractLayoutManager() { 48 updateCG(); 49 } 50 51 protected void setCG(LayoutCG newCG) { 52 cg = newCG; 53 } 54 55 60 public LayoutCG getCG() { 61 return cg; 62 } 63 64 70 public void updateCG() { 71 setCG((LayoutCG) SessionManager.getSession().getCGManager().getCG(this)); 72 } 73 74 public void write(Device d) 75 throws IOException { 76 cg.write(d, this); 77 } 78 79 public void setContainer(SContainer c) { 80 container = c; 81 } 82 83 public SContainer getContainer() { 84 return container; 85 } 86 87 96 public final void setPreferredSize(SDimension preferredSize) { 97 this.preferredSize = preferredSize; 98 } 99 100 105 public final SDimension getPreferredSize() { 106 return this.preferredSize; 107 } 108 } 109 110 111 | Popular Tags |