1 package jimm.datavision.gui; 2 import java.awt.*; 3 4 9 class SectionLayout implements LayoutManager { 10 11 17 public void addLayoutComponent(String name, Component comp) { 18 } 19 20 25 public void removeLayoutComponent(Component comp) { 26 } 27 28 35 public Dimension preferredLayoutSize(Container parent) { 36 return minimumLayoutSize(parent); 37 } 38 39 46 public Dimension minimumLayoutSize(Container parent) { 47 return parent.getPreferredSize(); 48 } 49 50 55 public void layoutContainer(Container parent) { 56 SectionWidget sw = (SectionWidget)parent; 57 int height = sw.getSectionHeight(); 58 Component[] components = parent.getComponents(); 59 60 components[0].setBounds(0, 0, SectionWidget.LHS_WIDTH, height); 62 63 components[1].setBounds(SectionWidget.LHS_WIDTH, 0, sw.getPaperWidth(), 65 height); 66 67 components[2].setBounds(0, height, sw.getTotalWidth(), 69 SectionResizer.HEIGHT); 70 } 71 72 } 73 | Popular Tags |