001/* 002 * Copyright (c) 2010 The Regents of the University of California. 003 * All rights reserved. 004 * 005 * '$Author: barseghian $' 006 * '$Date: 2011-01-12 02:49:21 +0000 (Wed, 12 Jan 2011) $' 007 * '$Revision: 26675 $' 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 036import org.kepler.objectmanager.lsid.KeplerLSID; 037import org.kepler.provenance.Queryable; 038 039public class StaticReportItemText extends StaticReportItem { 040 041 public static final int ROW_SIZE= 1; 042 public static final int ROW_WEIGHT = 2; 043 public static final int ROW_ALIGNMENT = 0; 044 045 public static final String TEXT = "text"; 046 047 048 public enum StaticReportItemTextProperties { 049 FONT_SIZE, 050 FONT_WEIGHT, 051 ALIGNMENT, 052 } 053 054 public enum TextSize { 055 SMALL { 056 public String toString() { 057 return "8pt"; 058 } 059 }, 060 MEDIUM { 061 public String toString() { 062 return "10pt"; 063 } 064 }, 065 LARGE { 066 public String toString() { 067 return "12pt"; 068 } 069 } 070 } 071 072 073 public enum TextWeight { 074 NORMAL, 075 BOLD 076 } 077 078 public enum TextAlignment { 079 LEFT, 080 CENTER, 081 RIGHT 082 } 083 084 085 public StaticReportItemText() { 086 super(); 087 088 this.type = TEXT; 089 this.name = TEXT; 090 091 init(); 092 } 093 094 public StaticReportItemText(String name) { 095 super(); 096 setName(name); 097 init(); 098 } 099 100 private void init() { 101 StaticReportItemTextProperties[] props = StaticReportItemTextProperties.values(); 102 this.itemProperties = new ItemProperties(); 103 for (StaticReportItemTextProperties key: props) { 104 this.itemProperties.setProperty(key.toString(), null); 105 } 106 } 107 108 109 public void generateValues(Queryable queryable, KeplerLSID lsid, int execId) { 110 //do nothing 111 } 112 113 114 @Override 115 public String getName() { 116 return this.name; 117 118 } 119 120 121 @Override 122 public String getType() { 123 return this.type; 124 125 } 126 127 @Override 128 public ImageIcon getIcon() { 129 URL texticonURL = getIconURL("text3", "png"); 130 ImageIcon texticon = new ImageIcon(texticonURL); 131 132 return texticon; 133 } 134 135 136 @Override 137 public void initializeType() throws Exception { 138 // TODO Auto-generated method stub 139 140 } 141 142 @Override 143 public void getView() { 144 // TODO Auto-generated method stub 145 146 } 147 148 @Override 149 public void setView() { 150 // TODO Auto-generated method stub 151 152 } 153 154 155}