001/*
002 * Copyright (c) 2010 The Regents of the University of California.
003 * All rights reserved.
004 *
005 * '$Author: barseghian $'
006 * '$Date: 2010-07-13 23:03:43 +0000 (Tue, 13 Jul 2010) $' 
007 * '$Revision: 25099 $'
008 * 
009 * Permission is hereby granted, without written agreement and without
010 * license or royalty fees, to use, copy, modify, and distribute this
011 * software and its documentation for any purpose, provided that the above
012 * copyright notice and the following two paragraphs appear in all copies
013 * of this software.
014 *
015 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
016 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
017 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
018 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
019 * SUCH DAMAGE.
020 *
021 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
022 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
023 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
024 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
025 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
026 * ENHANCEMENTS, OR MODIFICATIONS.
027 *
028 */
029
030package org.kepler.reporting.rio;
031
032import java.net.URL;
033
034import javax.swing.ImageIcon;
035
036public class StaticReportItemSection extends StaticReportItem {
037        
038        Object view;
039        String type;
040        
041        public static final int ROW_ALIGNMENT = 0;
042        public static final int ROW_BREAK_BEFORE = 1;
043        public static final int ROW_SIZE = 2;
044        
045        public static final String SECTION = "section";
046
047        
048        public enum StaticReportItemSectionProperties {
049                ALIGNMENT,
050                BREAK_BEFORE,
051                FONT_SIZE
052                
053        }
054        
055        public enum AlignmentValues {
056                LEFT,
057                RIGHT,
058                CENTER
059        }
060        
061        public enum BreakValues {
062                TRUE {
063                        public String toString() {
064                                return "true";
065                        }
066                },
067                FALSE {
068                        public String toString() {
069                                return "false";
070                        }
071                }
072        }
073        
074        public enum FontSizeValues {
075                SMALL {
076                        public String toString() {
077                                return "12pt";
078                        }
079                },
080                MEDIUM {
081                        public String toString() {
082                                return "14pt";
083                        }
084                },
085                LARGE {
086                        public String toString() {
087                                return "16pt";
088                        }
089                }
090        }
091        
092        public StaticReportItemSection() {
093                
094                
095                super();
096                
097                this.type = SECTION;
098                this.name = SECTION;
099                
100                init();
101        }
102        
103        public StaticReportItemSection(String name) {
104                super();
105                setName(name);
106                init();
107        }       
108        
109        private void init() {
110                StaticReportItemSectionProperties[] props = StaticReportItemSectionProperties.values();
111                
112                this.itemProperties = new ItemProperties();
113                for (StaticReportItemSectionProperties key: props) {
114                        this.itemProperties.setProperty(key.toString(), null);
115                }
116        }
117        
118
119        @Override
120        public String getName() {
121                return this.name;
122                
123        }
124        
125        @Override
126        public String getType() {
127                return this.type;
128                
129        }
130
131        @Override
132        public ImageIcon getIcon() {
133                URL sectionheaderURL = getIconURL("sectionheader3", "png");
134                ImageIcon sectionheadericon = new ImageIcon(sectionheaderURL);
135                
136                return sectionheadericon;
137        }
138
139        
140        @Override
141        public void initializeType() throws Exception {
142                // TODO Auto-generated method stub
143                
144        }
145
146        @Override
147        public void getView() {
148                // TODO Auto-generated method stub
149                
150        }
151        
152        @Override
153        public void setView() {
154                // TODO Auto-generated method stub
155                
156        }
157        
158}