1 19 package org.openharmonise.him.editors.report; 20 21 import java.awt.*; 22 23 import javax.swing.*; 24 25 import org.openharmonise.him.editors.report.rqom.*; 26 27 28 35 public class ReportPanel extends JPanel implements LayoutManager { 36 37 40 private ReportQuery m_reportQuery = null; 41 42 45 private ReportHeader m_header = null; 46 47 50 private ReportMetadata m_metadata = null; 51 52 55 private ReportWorkflows m_workflows = null; 56 57 60 private ReportUsers m_users = null; 61 62 65 private ReportFooter m_footer = null; 66 67 70 private ReportOrderBy m_orderBy = null; 71 72 75 private int m_nHeight = 100; 76 77 82 public ReportPanel(ReportQuery query) { 83 super(); 84 this.m_reportQuery = query; 85 this.setup(); 86 } 87 88 92 private void setup() { 93 this.setLayout(this); 94 95 this.m_header = new ReportHeader(this.m_reportQuery); 96 this.add(m_header); 97 98 this.m_metadata = new ReportMetadata(this.m_reportQuery); 99 this.add(m_metadata); 100 101 this.m_workflows = new ReportWorkflows(this.m_reportQuery); 102 this.add(m_workflows); 103 104 this.m_users = new ReportUsers(this.m_reportQuery); 105 this.add(m_users); 106 107 this.m_orderBy = new ReportOrderBy(m_reportQuery); 108 this.add(m_orderBy); 109 110 this.m_footer = new ReportFooter(this.m_reportQuery); 111 this.add(m_footer); 112 } 113 114 117 public void layoutContainer(Container arg0) { 118 int nHeight = 0; 119 this.m_header.setSize(this.m_header.getPreferredSize()); 120 this.m_header.setLocation(0, nHeight); 121 nHeight = nHeight + this.m_header.getSize().height; 122 123 this.m_metadata.setSize(this.m_metadata.getPreferredSize()); 124 this.m_metadata.setLocation(0, nHeight); 125 nHeight = nHeight + this.m_metadata.getSize().height; 126 127 this.m_workflows.setSize(this.m_workflows.getPreferredSize()); 128 this.m_workflows.setLocation(0, nHeight); 129 nHeight = nHeight + this.m_workflows.getSize().height; 130 131 this.m_users.setSize(this.m_users.getPreferredSize()); 132 this.m_users.setLocation(0, nHeight); 133 nHeight = nHeight + this.m_users.getSize().height; 134 135 m_orderBy.setSize(m_orderBy.getPreferredSize()); 136 m_orderBy.setLocation(0, nHeight); 137 nHeight = nHeight + m_orderBy.getSize().height; 138 139 this.m_footer.setSize(this.m_footer.getPreferredSize()); 140 this.m_footer.setLocation(0, nHeight); 141 nHeight = nHeight + this.m_footer.getSize().height; 142 143 this.m_nHeight = nHeight; 144 } 145 146 149 public Dimension getPreferredSize() { 150 return new Dimension(700, this.m_nHeight); 151 } 152 153 156 private ReportPanel(boolean arg0) { 157 super(arg0); 158 } 159 160 163 private ReportPanel(LayoutManager arg0) { 164 super(arg0); 165 } 166 167 171 private ReportPanel(LayoutManager arg0, boolean arg1) { 172 super(arg0, arg1); 173 } 174 175 178 public void removeLayoutComponent(Component arg0) { 179 } 180 181 184 public void addLayoutComponent(String arg0, Component arg1) { 185 } 186 187 190 public Dimension minimumLayoutSize(Container arg0) { 191 return this.getPreferredSize(); 192 } 193 194 197 public Dimension preferredLayoutSize(Container arg0) { 198 return this.getPreferredSize(); 199 } 200 public void setScopeEnabled(boolean isEnabled){ 201 this.m_header.setScopeEnabled(isEnabled); 202 } 203 } 204 | Popular Tags |