Fabio Dalle Ave 2 месяцев назад
Родитель
Сommit
0d1d1c779d

+ 0 - 205
src/main/java/commons/utility/SeparatedText.java

@@ -1,205 +0,0 @@
-package commons.utility;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * 	Gestisce una lista di oggetti come testo separato da un
- * 	delimitatore
- */
-public class SeparatedText
-{
-	static public class Factory
-	{
-		static public SeparatedText create(Object[] values,char delimiter)
-		{
-			SeparatedText st = new SeparatedText();
-			st.setDelimiter(delimiter);
-			st.setValues(Arrays.asList(values));
-			return st;
-		}
-
-		static public SeparatedText create(List values,char delimiter)
-		{
-			SeparatedText st = new SeparatedText();
-			st.setDelimiter(delimiter);
-			st.setValues(values);
-			return st;
-		}
-
-		static public SeparatedText create(Object[] values)
-		{
-			return create(values,',');
-		}
-
-		static public SeparatedText create(List values)
-		{
-			return create(values,',');
-		}
-
-		static public SeparatedText create(String textValues,char delimiter)
-		{
-			return new SeparatedText(textValues,delimiter);
-		}
-
-		static public SeparatedText create(String textValues)
-		{
-			return create(textValues,',');
-		}
-	}
-	
-	private String separatedText;
-	private char delimiter;
-	private List values;
-	
-	public SeparatedText()
-	{
-		super();
-		setDelimiter(',');
-	}
-
-	public SeparatedText(String text)
-	{
-		this(text,',');
-	}
-
-	public SeparatedText(String text,char delimiter)
-	{
-		super();
-		setDelimiter(delimiter);
-		setSeparatedText(text);
-	}
-	
-	public char getDelimiter()
-	{
-		return delimiter;
-	}
-
-	public String getSeparatedText()
-	{
-		return separatedText;
-	}
-
-	public void setDelimiter(char c)
-	{
-		delimiter = c;
-	}
-
-	public void setSeparatedText(String text)
-	{
-		separatedText = text;
-		values = split(text,getDelimiter());
-	}
-
-	public List getValues()
-	{
-		return values;
-	}
-
-	public void setValues(List values)
-	{
-		this.values = values;
-		separatedText = join(values,getDelimiter());
-	}
-
-	static public List split(String text,char delimiter)
-	{
-		List l = new ArrayList();
-		boolean inQuotes = false;
-		StringBuffer part = new StringBuffer();
-		
-		for(int i = 0;i < text.length();i++)
-		{
-			char ch = text.charAt(i);
-			
-			if(delimiter == ch || ' ' == ch)
-			{
-				//	Fine della stringa!
-				if(!inQuotes)
-				{
-					l.add(part.toString());
-					part.setLength(0);
-					continue;
-				}
-			}
-			else
-			{
-				if('\"' == ch)
-				{
-					//	Leggi il successivo...
-					if(i+1 < text.length())
-					{
-						//	Se il successivo non ? un " allora deve essere uno
-						//	spazio oppure un separatore
-						if(text.charAt(i+1) != '\"')
-						{
-							inQuotes = !inQuotes;
-							continue;
-						}
-						else
-						{
-							//	Questo " deve essere escluso...
-							++i;
-							//	...ed il prossimo carattere verr? inserito!
-						}
-					}
-					else
-					{
-						assert(inQuotes);
-						inQuotes = !inQuotes;
-						continue;
-					}
-				}
-			}
-			part.append(ch);
-		}
-		assert(inQuotes);
-		//	Aggiungi l'ultima stringa se non ? vuota oppure se ? vuota ma l'ultimo carattere
-		//	? un separatore
-		if(	part.length() > 0 ||
-			(0 == part.length() && text.length() > 0 && delimiter == text.charAt(text.length()-1))
-		)
-			l.add(part.toString());
-			
-		return l;
-	}
-	
-	static public String join(List values,char delimiter)
-	{
-		final StringBuffer ret = new StringBuffer();
-		boolean first = true;
-		for(Iterator i = values.iterator();i.hasNext();)
-		{
-			if(!first)	ret.append(delimiter);
-			first = false;
-			ret.append(createSDFText(i.next().toString(),delimiter));
-		}
-		return ret.toString();
-	}
-	
-	private static String createSDFText(String value,char delimiter)
-	{
-		final StringBuffer ret = new StringBuffer();
-		boolean needQuotes = false;
-		for(int i = 0;i < value.length();i++)
-		{
-			final char ch = value.charAt(i);
-			if(delimiter == ch || ' ' == ch)
-			{
-				needQuotes = true;
-			}
-			else
-			{
-				if('\"' == ch)
-				{
-					ret.append('\"');
-				}
-			}
-			ret.append(ch);
-		}
-		if(needQuotes)	ret.insert(0,'\"').append('\"');
-		return ret.toString();
-	}
-}

+ 0 - 290
src/main/java/commons/utility/WebUtility.java

@@ -1,290 +0,0 @@
-package commons.utility;
-
-import java.io.File;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import jakarta.servlet.ServletContext;
-import jakarta.servlet.http.Cookie;
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
-import org.hibernate.Hibernate;
-
-import commons.exception.ZSystemException;
-import commons.utility.database.NullValue;
-import commons.exception.ZCryptoException;
-import commons.utility.field.BinaryBooleanWebField;
-
-
-public class WebUtility
-{
-	public static String riceviRealPath(ServletContext context, String percorsoFileSystemCondiviso)
-	{
-		if (percorsoFileSystemCondiviso != null && !percorsoFileSystemCondiviso.equalsIgnoreCase(NullValue.STRING))
-		    return percorsoFileSystemCondiviso;
-
-	    String returnValue = context.getRealPath("/");
-	    if (null == returnValue)
-	    		return NullValue.STRING;
-		if (!String.valueOf(returnValue.charAt(returnValue.length() - 1)).equalsIgnoreCase(File.separator))
-			returnValue += File.separator;
-		return returnValue;
-	}
-
-	public static String riceviRealPathHBM(ServletContext context)
-	{
-	    String returnValue = context.getRealPath("/");
-		if (!String.valueOf(returnValue.charAt(returnValue.length() - 1)).equalsIgnoreCase(File.separator))
-			returnValue += File.separator;
-		return returnValue;
-	}
-
-	public static void clearAuthCookie(HttpServletRequest req, HttpServletResponse res, String cookieName)
-	{
-		//cancellazione eventuale cookie di autenticazione
-		Cookie[] cookies = req.getCookies();
-		if (cookies != null)
-		{
-			for (int i = 0; i < cookies.length; i++)
-			{
-				Cookie thisCookie = cookies[i];
-				if (thisCookie.getName().equals(cookieName))
-				{
-					thisCookie.setValue("");
-					thisCookie.setMaxAge(0);
-					res.addCookie(thisCookie);
-				}
-			}
-		}
-	}
-
-
-	public static void writeAuthCookie(HttpServletResponse res, String cf, String cookieName) throws ZCryptoException
-	{
-		Cookie ck = new Cookie(cookieName, Crypto.encrypt(cf));
-		res.addCookie(ck);
-	}
-
-
-	/**
-	 * Cancella un cookie
-	 * @param res
-	 * @param cf
-	 * @param cookieName - nome del cookie
-	 * @param percoso
-	 * @throws ZCryptoException
-	 */
-	public static void writeAuthCookie(HttpServletResponse res, String cf, String cookieName, String path) throws ZCryptoException
-	{
-		Cookie ck = new Cookie(cookieName, Crypto.encrypt(cf));
-		ck.setPath(path);
-		res.addCookie(ck);
-	}
-
-	
-	/**
-	 * Cancella un cookie
-	 * @param res
-	 * @param cf
-	 * @param cookieName - nome del cookie
-	 * @throws ZCryptoException
-	 */
-	public static void deleteCookie(HttpServletRequest req, HttpServletResponse res, String cookieName)
-	{
-		//cancellazione eventuale cookie di autenticazione
-		Cookie[] cookies = req.getCookies();
-		if (cookies != null)
-		{
-			for (int i = 0; i < cookies.length; i++)
-			{
-				Cookie thisCookie = cookies[i];
-				if (thisCookie.getName().equals(cookieName))
-				{
-					thisCookie.setValue("");
-					thisCookie.setMaxAge(0);
-					res.addCookie(thisCookie);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Legge un cookie con propriet? VALUE CRIPTATA. Il cookie viene ritornato con la propriet? VALUE DECRIPTATO
-	 * @param req
-	 * @param cookieName
-	 * @return
-	 */
-	public static Cookie readCookie(HttpServletRequest req, String cookieName)
-	{
-		try
-        {
-            Cookie[] cookies = req.getCookies();
-    		if (cookies != null)
-    		{
-    			for (int i = 0; i < cookies.length; i++)
-    			{
-    				Cookie thisCookie = cookies[i];
-    				if (thisCookie.getName().equals(cookieName))
-    				{
-    					//thisCookie.setValue(Crypto.decrypt(thisCookie.getValue()));
-    					return new CryptedCookie(thisCookie);
-    				}
-    			}
-    		}
-    		return null;
-        }
-        catch (Exception ex)
-        {
-            return null;
-        }
-	}
-
-	/**
-	 * Scrive un cookie CRIPTANDONE la propriet? value
-	 * @param res
-	 * @param cookieName
-	 * @param testo
-	 * @throws ZCryptoException
-	 */
-	public static void writeCookie(HttpServletResponse res, String cookieName, String testo) throws ZCryptoException
-	{
-		try
-        {
-			CryptedCookie cryptoC = new CryptedCookie(cookieName, testo);
-    		cryptoC.setMaxAge(31536000);
-    		Cookie writeCk = new Cookie(cookieName, cryptoC.getCk().getValue());
-    		writeCk.setMaxAge(cryptoC.getMaxAge());
-    		res.addCookie(writeCk);
-        }
-		catch (Exception ex)
-		{
-		    return;
-		}
-	}
-
-	//	Campo di comodo per le conversioni
-	private static BinaryBooleanWebField booleanConv = new BinaryBooleanWebField(null,false);
-	/**	Converte un valore string nel relativo valore boolean
-	 * @param value Il valore del boolean in formato stringa 0/1
-	 * @return Il valore boolean (false come default)
-	 */
-	public final static boolean convertBinaryBoolean(final String value)
-	{
-		booleanConv.setFormattedText(value);
-		return booleanConv.getBoolean();
-	}
-	
-	
-	/**	Inizializza le properties di una rootEntity mappata con Hibernate
-	 * @param <T>
-	 * @param rootEntity L'entit? connessa alla sessione
-	 * @param properties La lista di property nella forma prop1.prop11.prop111,prop2.prop22... etc
-	 * @return L'oggetto con le property specificate inizializzate!
-	 */
-	public final static <T> T initEntityProperties(final T rootEntity,final String...properties)
-	{
-		if(null != rootEntity)
-		{
-			for(final String property : properties)
-			{
-				Object currentProperty = rootEntity;
-				{
-					final StringTokenizer strtok = new StringTokenizer(property,".");
-					while(strtok.hasMoreTokens())
-					{
-						//	Verifica se la property ? stata inizializzata!
-						final String token = strtok.nextToken();
-						//	L'oggetto corrente va letto!
-						final String getMethodName = "get" + token.substring(0,1).toUpperCase() + token.substring(1);
-						try
-						{
-							final Method getMethod = currentProperty.getClass().getMethod(getMethodName);
-							boolean getMethodAccessible = getMethod.isAccessible();
-							try
-							{
-								getMethod.setAccessible(true);
-								currentProperty = getMethod.invoke(currentProperty);
-							}
-							catch (Throwable e)
-							{
-								throw new ZSystemException(e);
-							}
-							finally
-							{
-								getMethod.setAccessible(getMethodAccessible);
-							}
-						}
-						catch (SecurityException e)
-						{
-							throw new ZSystemException(e);
-						}
-						catch (NoSuchMethodException e)
-						{
-							//	Accesso tramite field!
-							try
-							{
-								Field propertyField = currentProperty.getClass().getDeclaredField(token);
-								boolean propertyFieldAccessible = propertyField.isAccessible();
-								try
-								{
-									propertyField.setAccessible(true);
-									currentProperty = propertyField.get(currentProperty);
-								}
-								catch (Throwable e2)
-								{
-									throw new ZSystemException(e2);
-								}
-								finally
-								{
-									propertyField.setAccessible(propertyFieldAccessible);
-								}
-							}
-							catch (SecurityException e1)
-							{
-								throw new ZSystemException(e);
-							}
-							catch (NoSuchFieldException e1)
-							{
-								break;
-							}
-						}
-						
-						//	Se non ? stata inizializzata...
-						if(!Hibernate.isInitialized(currentProperty))
-						{
-							//	allora ? da fare!
-							Hibernate.getClass(currentProperty);
-						}					
-					}
-				}
-			}
-		}		
-		return rootEntity;
-	}
-	
-	/**	Inizializza le properties di una lista di entity mappate con Hibernate
-	 * @param <T>
-	 * @param rootEntities la lista di oggetto
-	 * @param properties la lista di properties da inizializzare
-	 * @return
-	 */
-	public final static <T> List<T> initEntitiesProperties(final List<T> rootEntities,final String...properties)
-	{
-		if(null != rootEntities)
-		{
-			for(final T rootEntity : rootEntities)
-				initEntityProperties(rootEntity, properties);
-		}
-		
-		return rootEntities;
-	}
-	
-	public static String traduciPathPerJsp(String path)
-	{
-		return path.replaceAll("\\\\", "\\\\\\\\") ;
-	}
-	
-}

+ 0 - 42
src/main/java/commons/utility/spool/AttributeImpl.java

@@ -1,42 +0,0 @@
-package commons.utility.spool;
-
-
-
-/**
- * Implementazione base di un attributo
-*/
-public class AttributeImpl implements IAttribute
-{
-	String name;
-	String value;
-	
-	public AttributeImpl(String name)
-	{
-		setName(name);
-	}
-
-	public AttributeImpl(String name,String value)
-	{
-		this(name);
-		setValue(value);
-	}
-	
-	//	IAttribute implementation
-	
-	public String getName()
-	{
-		return name;
-	}
-	public String getValue()
-	{
-		return value;
-	}
-	public void setName(String name)
-	{
-		this.name = name;
-	}
-	public void setValue(String value)
-	{
-		this.value = value;
-	}
-}

+ 0 - 75
src/main/java/commons/utility/spool/AttributeListImpl.java

@@ -1,75 +0,0 @@
-package commons.utility.spool;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * Implementazione base di un contenitore di attributi
-*/
-public class AttributeListImpl implements IAttributeList
-{
-	Map<String, IAttribute> attrList = new Hashtable<String, IAttribute>();
-	
-	public AttributeListImpl()
-	{
-	}
-	
-	public void addAttributes(Iterator attrs)
-	{
-		removeAllAttributes();
-		while(attrs.hasNext())
-		{
-			addAttribute((IAttribute)attrs.next());
-		}
-	}
-
-	public void addAttributes(IAttribute[] attrs)
-	{
-		removeAllAttributes();
-		for(int i = 0;i < attrs.length;i++)
-		{
-			addAttribute(attrs[i]);
-		}
-	}
-	
-	//	IAttributeList implementation
-	
-	public void addAttribute(IAttribute attr)
-	{
-		attrList.put(attr.getName(),attr);
-	}
-
-	public IAttribute getAttribute(String attrName)
-	{
-		return attrList.get(attrName);
-	}
-
-	public Iterator getAttributes()
-	{
-		return attrList.values().iterator();
-	}
-
-	public IAttribute removeAttribute(String attrName)
-	{
-		return attrList.remove(attrName);
-	}
-
-	public boolean hasAttribute(String attrName)
-	{
-		return attrList.containsKey(attrName);
-	}
-	
-	public void removeAllAttributes()
-	{
-		attrList.clear();
-	}
-	
-	public String getAttributeValue(String attrName)
-	{
-		String value = "";
-		if(hasAttribute(attrName))
-			value = getAttribute(attrName).getValue();
-		return value;
-	}
-}

+ 0 - 244
src/main/java/commons/utility/spool/BoundText.java

@@ -1,244 +0,0 @@
-package commons.utility.spool;
-
-import java.awt.Color;
-import java.io.IOException;
-
-
-
-import commons.enumerate.AllineamentoCampoSpool_e;
-import commons.type.ModifyException;
-import commons.utility.field.tranf.PaddingModificator;
-
-import com.lowagie.text.DocumentException;
-import com.lowagie.text.pdf.BaseFont;
-import com.lowagie.text.pdf.PdfContentByte;
-
-public class BoundText implements IBound, IBoundWrite {
-
-	/* nome attributi nel file XML */
-	public final static String ATTR_X     = "x";
-	public final static String ATTR_Y     = "y";
-	public final static String ATTR_ALIGN = "a";
-	public final static String ATTR_LEN   = "l";
-	public final static String ATTR_NAME  = "nome";
-	
-	/* tipologia allineamento */
-	public static final String CENTRATO  = "c";
-	public static final String SINISTRA  = "s";
-	public static final String DESTRA    = "d";
-
-	public final static char EMPTY_CHAR = ' ';
-
-	private IPoint point;
-	private IFont font;
-	private int length;
-	private AllineamentoCampoSpool_e alignment;
-	private String name;
-	private String valore;
-	private float angle;
-	private float charSpacing;
-	private Color color;
-
-	public Color getColor() {
-		return color;
-	}
-
-	public void setColor(Color color) {
-		this.color = color;
-	}
-
-	public BoundText(Point point,
-	                 IFont font,
-	                 int length,
-	                 AllineamentoCampoSpool_e align,
-	                 String name,
-	                 String valore,
-	                 float angle,
-	                 float charSpacing,
-	                 Color color) {
-
-		setPoint(point);
-		setFont(font);
-		setLength(length);
-		setAlignment(align);
-		setName(name);
-		setValue(valore);
-		setCharSpacing(charSpacing);
-		setAngle(angle);
-		setColor(color);
-	}
-
-	public BoundText(Point point,
-	                 IFont font,
-	                 int length,
-	                 AllineamentoCampoSpool_e align,
-	                 String name,
-	                 String valore) {
-
-		this(point, font, length, align, name, valore, 0, 0, Color.BLACK);
-	}
-
-	public AllineamentoCampoSpool_e getAlignment() {
-		return alignment;
-	}
-
-	public IPoint getPoint() {
-		return point;
-	}
-
-	public int getLength() {
-		return length;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-	public void setAlignment(AllineamentoCampoSpool_e spool_e) {
-		alignment = spool_e;
-	}
-
-	public void setPoint(IPoint point) {
-		this.point = point;
-	}
-
-	public void setFont(IFont font) {
-		this.font = font;
-	}
-
-	public IFont getFont() {
-		return font;
-	}
-	public void setLength(int i) {
-		length = i;
-	}
-
-	public void setName(String string) {
-		name = string;
-	}
-
-	public String getValue() {
-		return valore;
-	}
-	public void setValue(String value) {
-		valore = value;
-	}
-
-	public float getCharSpacing() {
-		return charSpacing;
-	}
-
-	public void setCharSpacing(float charSpacing) {
-		this.charSpacing = charSpacing;
-	}
-	public float getAngle() {
-		return angle;
-	}
-	public void setAngle(float angle) {
-		this.angle = angle;
-	}
-
-	public void write(PdfContentByte cb){
-
-		String carat = formatText(this, getValue());
-
-		BaseFont bf;
-
-		try {
-			if (font.getBaseFont() != null)
-			{
-				bf = font.getBaseFont();
-			}
-			else
-			{
-				bf = BaseFont.createFont(font.getFontName(), BaseFont.WINANSI, false);
-			}
-
-			cb.beginText();
-
-			cb.setFontAndSize(bf, font.getFontHeight());
-
-			cb.setCharacterSpacing(getCharSpacing());
-
-			cb.setColorFill(color);
-
-			cb.showTextAligned(PdfContentByte.ALIGN_LEFT,
-			                   carat,
-			                   point.getX(),
-			                   point.getY(),
-			                   angle);
-
-			cb.endText();
-		} catch (DocumentException e) {
-			throw new RuntimeException( e );
-		} catch (IOException e) {
-			throw new RuntimeException( e );
-		}
-			
-
-	}
-
-	/**
-	 * Costruisce il testo da scrivere a seconda dell'allineamento
-	 * specificato
-	 * @param bound
-	 * @param value
-	 * @return
-	 */
-	private String formatText(IBound bound, String value) {
-
-		String ret = value;
-
-		if ( bound.getAlignment()!= null
-			 && 
-			 !AllineamentoCampoSpool_e.NULLO.equals(bound.getAlignment()) ) {
-
-			PaddingModificator pm = new PaddingModificator(PaddingModificator.Padding_e.LEFT, 
-			                                               bound.getLength(), 
-			                                               EMPTY_CHAR);
-
-			switch (bound.getAlignment().getOrdinal()) {
-				case AllineamentoCampoSpool_e.Values.CENTRATO:
-					pm.setPadding(PaddingModificator.Padding_e.CENTER);
-					break;
-				case AllineamentoCampoSpool_e.Values.DESTRA:
-					pm.setPadding(PaddingModificator.Padding_e.LEFT);
-					break;
-				case AllineamentoCampoSpool_e.Values.SINISTRA:
-					pm.setPadding(PaddingModificator.Padding_e.RIGHT);
-					break;
-			}
-			try {
-				ret = pm.modify(value);
-			} catch (ModifyException e) {
-				ret = value;
-			}
-		}
-
-		return ret;
-
-	}
-
-	/**
-	 * Traduce l'allineamento del file XML nel tipo
-	 * enumerato
-	 * @param align
-	 * @return
-	 */
-	public static AllineamentoCampoSpool_e getAlign(String align){    
-		if (align.equalsIgnoreCase( CENTRATO ))
-			return AllineamentoCampoSpool_e.CENTRATO;
-		else if (align.equalsIgnoreCase( SINISTRA ))
-			return AllineamentoCampoSpool_e.SINISTRA;
-		else if (align.equalsIgnoreCase( DESTRA ))
-			return AllineamentoCampoSpool_e.DESTRA;
-		else
-			return AllineamentoCampoSpool_e.NULLO;
-	}
-	
-	public IAttributeList getAttributes() {
-		return null;
-	}
-
-
-}

+ 0 - 63
src/main/java/commons/utility/spool/Font.java

@@ -1,63 +0,0 @@
-package commons.utility.spool;
-
-import com.lowagie.text.pdf.BaseFont;
-
-public class Font implements IFont {
-
-	private static final int CHAR_HEIGHT = 10;
-	private static final int CHAR_WIDTH = 6;  
-
-	private BaseFont baseFont;
-	private String fontName;
-	private int fontHeight;
-	private int fontWidth;
-	public Font(BaseFont baseFont) {
-		this.baseFont = baseFont;
-	}
-	
-	public Font() {
-		this(BaseFont.COURIER_BOLD, CHAR_HEIGHT, CHAR_WIDTH);
-	}
-
-	
-	public Font(String fontName,
-	            int fontHeight,
-	            int fontWidth) {
-		this.fontName = fontName;
-		this.fontHeight = fontHeight;
-		this.fontWidth = fontWidth;
-	}
-	public BaseFont getBaseFont()
-    {
-	    return baseFont;
-    }
-	public void setBaseFont(BaseFont bf)
-    {
-		this.baseFont = bf;
-    }
-	public String getFontName() {
-		return fontName;
-	}
-
-	public void setFontName(String valore) {
-		this.fontName = valore;
-	}
-
-	public int getFontHeight() {
-		return fontHeight;
-	}
-
-	public void setFontHeight(int valore) {
-		this.fontHeight = valore;
-	}
-
-	public int getFontWidth() {
-		return fontWidth;
-	}
-
-	public void setFontWidth(int valore) {
-		this.fontWidth = valore;
-	}
-
-
-}

+ 0 - 12
src/main/java/commons/utility/spool/IAttribute.java

@@ -1,12 +0,0 @@
-package commons.utility.spool;
-
-/**
- * Intf di un singolo attributo
-*/
-public interface IAttribute
-{
-	public abstract String getName();
-	public abstract String getValue();
-	public abstract void setName(String name);
-	public abstract void setValue(String value);
-}

+ 0 - 18
src/main/java/commons/utility/spool/IAttributeList.java

@@ -1,18 +0,0 @@
-package commons.utility.spool;
-
-import java.util.Iterator;
-
-/**
- * Intf per contenitore di attributi
-*/
-public interface IAttributeList
-{
-	public abstract void addAttribute(IAttribute attr);
-	public abstract IAttribute getAttribute(String attrName);
-	public abstract Iterator getAttributes();
-	public abstract IAttribute removeAttribute(String attrName);
-	public abstract boolean hasAttribute(String attrName);
-	public abstract void removeAllAttributes();
-	//	Forward method
-	public abstract String getAttributeValue(String attrName);
-}

+ 0 - 30
src/main/java/commons/utility/spool/IBound.java

@@ -1,30 +0,0 @@
-package commons.utility.spool;
-
-import commons.enumerate.AllineamentoCampoSpool_e;
-
-
-
-/**
- * @author basluc
-*/
-public interface IBound
-{
-	//	Allineamento del campo
-	public abstract AllineamentoCampoSpool_e getAlignment();
-	public abstract void setAlignment(AllineamentoCampoSpool_e spool_e);
-
-	//	Spiazzamento
-	public abstract IPoint getPoint();
-	public abstract void setPoint(IPoint point);
-
-	//	Lunghezza del campo
-	public abstract int getLength();
-	public abstract void setLength(int i);
-
-	//	Nome del bound
-	public abstract String getName();
-	public abstract void setName(String string);
-	
-	//	Attributi
-	public abstract IAttributeList getAttributes();
-}

+ 0 - 10
src/main/java/commons/utility/spool/IBoundNode.java

@@ -1,10 +0,0 @@
-package commons.utility.spool;
-
-
-public interface IBoundNode
-{
-	public abstract String getNodeName();
-	public abstract String getBoundAttribute(String attrName);
-	public abstract boolean hasAttribute(String attrName);
-	public abstract IAttributeList getAttributes();
-}

+ 0 - 9
src/main/java/commons/utility/spool/IBoundWrite.java

@@ -1,9 +0,0 @@
-package commons.utility.spool;
-
-import com.lowagie.text.pdf.PdfContentByte;
-
-public interface IBoundWrite {
-
-	public void write(final PdfContentByte cb);
-
-}

+ 0 - 15
src/main/java/commons/utility/spool/IFont.java

@@ -1,15 +0,0 @@
-package commons.utility.spool;
-
-import com.lowagie.text.pdf.BaseFont;
-
-public interface IFont {
-
-    public String getFontName();
-    public void setFontName(String valore);
-    public int getFontHeight();
-    public void setFontHeight(int valore);
-    public int getFontWidth();
-    public void setFontWidth(int valore);
-	public BaseFont getBaseFont();
-    
-}

+ 0 - 12
src/main/java/commons/utility/spool/IPoint.java

@@ -1,12 +0,0 @@
-package commons.utility.spool;
-
-
-public interface IPoint
-{
-	//	Larghezza
-	public int getX();
-	public void setX(int x);
-	//	Altezza
-	public int getY();
-	public void setY(int y);
-}

+ 0 - 13
src/main/java/commons/utility/spool/ISectionNode.java

@@ -1,13 +0,0 @@
-package commons.utility.spool;
-
-import java.util.Iterator;
-
-public interface ISectionNode
-{
-	public abstract String getNodeName();
-	public abstract Iterator/*<IBoundNode>*/ getBounds();
-	public abstract IBoundNode getBound(String name);
-	public abstract ISectionNode getChild(String name);
-	public abstract String getAttribute(String attrName);
-	public abstract IAttributeList getAttributes();
-}

+ 0 - 75
src/main/java/commons/utility/spool/MemoryBoundNode.java

@@ -1,75 +0,0 @@
-package commons.utility.spool;
-
-
-/**
- * Implementazione in memoria di un nodo
-*/
-public class MemoryBoundNode implements IBoundNode
-{
-	//	Il nodo parent
-	MemorySectionNode parent;
-	//	Gli attributi
-	AttributeListImpl attrsListImpl = new AttributeListImpl();
-	
-	public MemoryBoundNode(MemorySectionNode parent)
-	{
-		setParent(parent);
-	}
-
-	public MemorySectionNode getParent()
-	{
-		return parent;
-	}
-	public void setParent(MemorySectionNode node)
-	{
-		parent = node;
-	}
-
-	public AttributeListImpl getAttrsListImpl()
-	{
-		return attrsListImpl;
-	}
-	public void setAttrsListImpl(AttributeListImpl impl)
-	{
-		attrsListImpl = impl;
-	}
-
-	//	This impl public intf
-	public void addAttribute(String attrName,String value)
-	{
-		attrsListImpl.addAttribute(new AttributeImpl(attrName,value));
-	}
-	public void removeAttribute(String attrName)
-	{
-		attrsListImpl.removeAttribute(attrName);
-	}
-	public String getAttribute(String attrName)
-	{
-		String value = null;
-		if(attrsListImpl.hasAttribute(attrName))
-			value = attrsListImpl.getAttribute(attrName).getValue();
-		return value;	
-	}
-	
-	//	IBoundNode implementation
-
-	public String getNodeName()
-	{
-		return getBoundAttribute("nome");
-	}
-
-	public String getBoundAttribute(String attrName)
-	{
-		return getAttribute(attrName);
-	}
-
-	public boolean hasAttribute(String attrName)
-	{
-		return attrsListImpl.hasAttribute(attrName);
-	}
-	
-	public IAttributeList getAttributes()
-	{
-		return attrsListImpl;
-	}
-}

+ 0 - 74
src/main/java/commons/utility/spool/MemorySectionNode.java

@@ -1,74 +0,0 @@
-package commons.utility.spool;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * Implementazione di una sezione in memoria
-*/
-public class MemorySectionNode implements ISectionNode
-{
-	//	Il nodo
-	MemoryBoundNode thisNodeImpl;
-	//	I bounds contenuti
-	Map<String, MemoryBoundNode> bounds = new Hashtable<String, MemoryBoundNode>();
-	//	Le sotto-sezioni
-	Hashtable<String, MemorySectionNode> sections = new Hashtable<String, MemorySectionNode>();
-	
-	public MemorySectionNode(MemorySectionNode parent)
-	{
-		thisNodeImpl = new MemoryBoundNode(parent);
-	}
-	
-	public void addBound(MemoryBoundNode bound)
-	{
-		bound.setParent(this);
-		bounds.put(bound.getNodeName(),bound);
-	}
-	
-	public void addSection(MemorySectionNode node)
-	{
-		sections.put(node.getNodeName(),node);
-	}
-
-	/**
-	 * @return L'implementazione del nodo che rappresenta la sezione
-	 */
-	public MemoryBoundNode getInternalNode()
-	{
-		return thisNodeImpl;
-	}
-	
-	//	ISectionNode implementation
-	
-	public String getNodeName()
-	{
-		return thisNodeImpl.getNodeName();
-	}
-
-	public Iterator getBounds()
-	{
-		return bounds.values().iterator();
-	}
-
-	public IBoundNode getBound(String name)
-	{
-		return bounds.get(name);
-	}
-
-	public ISectionNode getChild(String name)
-	{
-		return sections.get(name);
-	}
-
-	public String getAttribute(String attrName)
-	{
-		return thisNodeImpl.getBoundAttribute(attrName);
-	}
-
-	public IAttributeList getAttributes()
-	{
-		return thisNodeImpl.getAttributes();
-	}
-}

+ 0 - 42
src/main/java/commons/utility/spool/Point.java

@@ -1,42 +0,0 @@
-package commons.utility.spool;
-
-
-
-/**
- * @author basluc
-*/
-public final class Point implements IPoint
-{
-	int x,y;
-	
-	public Point()
-	{
-		this(0,0);
-	}
-	
-	public Point(int x,int y)
-	{
-		setX(x);
-		setY(y);
-	}
-	
-	public int getX()
-	{
-		return x;
-	}
-
-	public void setX(int x)
-	{
-		this.x = x;
-	}
-
-	public int getY()
-	{
-		return y;
-	}
-
-	public void setY(int y)
-	{
-		this.y = y;
-	}
-}