ejtools-cvs Mailing List for EJTools (Page 3)
Brought to you by:
letiemble
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(471) |
May
(303) |
Jun
(176) |
Jul
(67) |
Aug
(64) |
Sep
(84) |
Oct
(148) |
Nov
(57) |
Dec
(272) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(356) |
Feb
(304) |
Mar
(214) |
Apr
(22) |
May
(7) |
Jun
(25) |
Jul
|
Aug
(5) |
Sep
(106) |
Oct
|
Nov
(95) |
Dec
(193) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(2) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: <let...@us...> - 2003-12-14 10:50:07
|
Update of /cvsroot/ejtools/libraries/common/src/main/org/ejtools/beans In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common/src/main/org/ejtools/beans Modified Files: CustomPropertyEditorManager.java Sort.java Added Files: package.html Log Message: Add more javadocs. Add package.html files. --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> Provides utility classes related to the JavaBeans. </body> </html> Index: CustomPropertyEditorManager.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/beans/CustomPropertyEditorManager.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CustomPropertyEditorManager.java 15 Sep 2003 22:23:44 -0000 1.7 --- CustomPropertyEditorManager.java 13 Dec 2003 21:27:49 -0000 1.8 *************** *** 1,71 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.beans; ! ! import java.beans.PropertyEditor; ! import java.beans.PropertyEditorManager; ! import java.util.Arrays; ! import java.util.Vector; ! ! /** ! * Decorator class to enhance the functionnality of the {@link PropertyEditorManager}. ! * If a PropertyEditor is not found, a PropertyEditor matching one of the implemented interfaces ! * is searched. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public abstract class CustomPropertyEditorManager extends PropertyEditorManager ! { ! /** Description of the Field */ ! public final static String EDITORS_PACKAGE = "org.ejtools.adwt.editor"; ! ! ! /** ! * Add super interfaces search when finding a PropertyEditor ! * ! * @param clazz The class of the property ! * @return The PropertyEditor found, null otherwise ! */ ! public static synchronized PropertyEditor findEditor(Class clazz) ! { ! PropertyEditor result = PropertyEditorManager.findEditor(clazz); ! ! // If the PropertyEditor is not found in mapping, it is the first time it is required ! // so fetch it by the PropertyEditorManager ! if (result == null) ! { ! // Search among the interfaces if there is one that has a PropertyEditor ! Class[] interfaces = clazz.getInterfaces(); ! for (int i = 0; i < interfaces.length; i++) ! { ! Class current = interfaces[i]; ! result = PropertyEditorManager.findEditor(current); ! if (result != null) ! { ! PropertyEditorManager.registerEditor(clazz, result.getClass()); ! break; ! } ! } ! } ! ! return result; ! } ! ! /** Add a new package for the search */ ! static ! { ! String[] paths = PropertyEditorManager.getEditorSearchPath(); ! Vector newPaths = new Vector(); ! newPaths.addAll(Arrays.asList(paths)); ! if (!newPaths.contains(EDITORS_PACKAGE)) ! { ! newPaths.add(EDITORS_PACKAGE); ! } ! PropertyEditorManager.setEditorSearchPath((String[]) newPaths.toArray(new String[0])); ! } ! } --- 1,71 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.beans; ! ! import java.beans.PropertyEditor; ! import java.beans.PropertyEditorManager; ! import java.util.Arrays; ! import java.util.Vector; ! ! /** ! * Decorator class to enhance the functionnality of the {@link PropertyEditorManager}. ! * If a PropertyEditor is not found, a PropertyEditor matching one of the implemented interfaces ! * is searched. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public abstract class CustomPropertyEditorManager extends PropertyEditorManager ! { ! /** Description of the Field */ ! public final static String EDITORS_PACKAGE = "org.ejtools.adwt.editor"; ! ! ! /** ! * Add super interfaces search when finding a PropertyEditor ! * ! * @param clazz The class of the property ! * @return The PropertyEditor found, null otherwise ! */ ! public static synchronized PropertyEditor findEditor(Class clazz) ! { ! PropertyEditor result = PropertyEditorManager.findEditor(clazz); ! ! // If the PropertyEditor is not found in mapping, it is the first time it is required ! // so fetch it by the PropertyEditorManager ! if (result == null) ! { ! // Search among the interfaces if there is one that has a PropertyEditor ! Class[] interfaces = clazz.getInterfaces(); ! for (int i = 0; i < interfaces.length; i++) ! { ! Class current = interfaces[i]; ! result = CustomPropertyEditorManager.findEditor(current); ! if (result != null) ! { ! PropertyEditorManager.registerEditor(clazz, result.getClass()); ! break; ! } ! } ! } ! ! return result; ! } ! ! /** Add a new package for the search */ ! static ! { ! String[] paths = PropertyEditorManager.getEditorSearchPath(); ! Vector newPaths = new Vector(); ! newPaths.addAll(Arrays.asList(paths)); ! if (!newPaths.contains(EDITORS_PACKAGE)) ! { ! newPaths.add(EDITORS_PACKAGE); ! } ! PropertyEditorManager.setEditorSearchPath((String[]) newPaths.toArray(new String[0])); ! } ! } Index: Sort.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/beans/Sort.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Sort.java 15 Sep 2003 22:23:45 -0000 1.6 --- Sort.java 13 Dec 2003 21:27:49 -0000 1.7 *************** *** 20,25 **** * @version $Revision$ */ ! public abstract class Sort { /** * Extract the elements of the specified class from the Iterator. --- 20,29 ---- * @version $Revision$ */ ! public class Sort { + /** Constructor for the Sort object */ + private Sort() { } + + /** * Extract the elements of the specified class from the Iterator. |
Update of /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common/src/main/org/ejtools/util Modified Files: ClassTools.java KeyLimitedStack.java LimitedStack.java Platform.java Added Files: FileTools.java package.html Log Message: Add more javadocs. Add package.html files. --- NEW FILE: FileTools.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.util; import java.io.File; import java.text.MessageFormat; import java.util.ResourceBundle; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; /** * Helper class to make easy the file selection. Handles the overwrite in case of * save actions. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public class FileTools { /** Resource bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.util.Resources"); /** Default constructor */ protected FileTools() { } /** * Select a file through a JFileChooser. * * @param title The title for the JFileChooser * @param approveText The text that appears on the approve button * @param type The type of operation * @param filter The FileFilter to use * @return The selected file otherwise null * @see javax.swing.JFileChooser#OPEN_DIALOG * @see javax.swing.JFileChooser#SAVE_DIALOG */ public static File selectFile(String title, String approveText, int type, FileFilter filter) { File selectedFile = null; // Fix for JFileChooser/SecurityManager bug (#4264750) SecurityManager s = System.getSecurityManager(); System.setSecurityManager(null); // Choose file JFileChooser chooser = new JFileChooser(System.getProperty("user.dir")); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setDialogTitle(title); chooser.setDialogType(type); chooser.setFileFilter(filter); int returnVal = chooser.showDialog(null, approveText); System.setSecurityManager(s); if (returnVal == JFileChooser.APPROVE_OPTION) { selectedFile = chooser.getSelectedFile(); } if ((selectedFile != null) && (type == JFileChooser.SAVE_DIALOG) && (selectedFile.exists())) { int ret = JOptionPane.showConfirmDialog(null, MessageFormat.format(resources.getString("file.dialog.overwrite.text"), new Object[]{selectedFile.getName()})); if (ret != JOptionPane.OK_OPTION) { selectedFile = null; } } return selectedFile; } /** * An helper class that simplifies the creation of a FileFilter. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ protected static class SimpleFileFilter extends FileFilter { private String description; private String extension; /** * Constructor for SimpleFileFilter class * * @param extension The file extension. Must start with a dot. * @param description The description that will appears in the JFileChooser */ public SimpleFileFilter(String extension, String description) { this.extension = extension; this.description = description; } /** * Check wheter or not the file ends with the right extension. * * @param file The file to test * @return True if the file is accepted */ public boolean accept(File file) { return file.getName().endsWith(this.extension); } /** * Returns the description string for displaying inside the JFileChooser * * @return The description */ public String getDescription() { return this.description; } } } --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> </body> </html> Index: ClassTools.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/ClassTools.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ClassTools.java 15 Sep 2003 22:23:45 -0000 1.6 --- ClassTools.java 13 Dec 2003 21:27:49 -0000 1.7 *************** *** 1,189 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util; ! ! import java.util.ArrayList; ! ! ! /** ! * Utility class to handle Class realted stuff. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class ClassTools ! { ! /** Holds the numeric classes */ ! private static ArrayList numericClasses; ! ! ! /** ! * Pretty print a full qualified class name. Specially useful for object arrays. ! * ! * @param className The fully qualified class name ! * @return The pretty class name ! */ ! public static String classDisplay(String className) ! { ! String result = className; ! ! if (className == null) ! { ! return null; ! } ! ! if (className.startsWith("[Z")) ! { ! result = "boolean[]"; ! } ! if (className.startsWith("[C")) ! { ! result = "char[]"; ! } ! if (className.startsWith("[D")) ! { ! result = "double[]"; ! } ! if (className.startsWith("[F")) ! { ! result = "float[]"; ! } ! if (className.startsWith("[I")) ! { ! result = "int[]"; ! } ! if (className.startsWith("[S")) ! { ! result = "short[]"; ! } ! if (className.startsWith("[J")) ! { ! result = "long[]"; ! } ! if (className.startsWith("[B")) ! { ! result = "byte[]"; ! } ! if (className.startsWith("[L")) ! { ! result = className.substring(2, className.length() - 1) + "[]"; ! } ! ! return result; ! } ! ! ! /** ! * Get the class by its name. ! * ! * @param fullPathClassName The full qualified name of the class ! * @return The class if it is found, otherwise null ! */ ! public static Class getClass(String fullPathClassName) ! { ! // Check if the class is a primitive type ! if (fullPathClassName.equals("void")) ! { ! return Void.TYPE; ! } ! if (fullPathClassName.equals("int")) ! { ! return Integer.TYPE; ! } ! if (fullPathClassName.equals("short")) ! { ! return Short.TYPE; ! } ! if (fullPathClassName.equals("long")) ! { ! return Long.TYPE; ! } ! if (fullPathClassName.equals("byte")) ! { ! return Byte.TYPE; ! } ! if (fullPathClassName.equals("char")) ! { ! return Character.TYPE; ! } ! if (fullPathClassName.equals("float")) ! { ! return Float.TYPE; ! } ! if (fullPathClassName.equals("double")) ! { ! return Double.TYPE; ! } ! if (fullPathClassName.equals("boolean")) ! { ! return Boolean.TYPE; ! } ! ! // Try to load the class ! Class c = null; ! try ! { ! c = Class.forName(fullPathClassName); ! } ! catch (Throwable e) ! { ! // Ignore it ! } ! ! return c; ! } ! ! ! /** ! * Get the double value from a numeric class ! * ! * @param o Object to transform ! * @return The double value ! */ ! public static double getValue(Object o) ! { ! if (isNumeric(o.getClass())) ! { ! if (o instanceof Number) ! { ! return ((Number) o).doubleValue(); ! } ! return (new Double(o.toString())).doubleValue(); ! } ! return 0; ! } ! ! ! /** ! * Return whether or not a class is numeric ! * ! * @param clazz The class to test ! * @return true if the class is numeric ! */ ! public static boolean isNumeric(Class clazz) ! { ! return numericClasses.contains(clazz); ! } ! ! /** fill in with the numeric classes */ ! static ! { ! numericClasses = new ArrayList(); ! numericClasses.add(Byte.class); ! numericClasses.add(Double.class); ! numericClasses.add(Float.class); ! numericClasses.add(Integer.class); ! numericClasses.add(Long.class); ! numericClasses.add(Short.class); ! numericClasses.add(Byte.TYPE); ! numericClasses.add(Double.TYPE); ! numericClasses.add(Float.TYPE); ! numericClasses.add(Integer.TYPE); ! numericClasses.add(Long.TYPE); ! numericClasses.add(Short.TYPE); ! } ! } --- 1,189 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util; ! ! import java.util.ArrayList; ! ! ! /** ! * Utility class to handle Class realted stuff. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class ClassTools ! { ! /** Holds the numeric classes */ ! private static ArrayList numericClasses; ! ! ! /** ! * Pretty print a full qualified class name. Specially useful for object arrays. ! * ! * @param className The fully qualified class name ! * @return The pretty class name ! */ ! public static String classDisplay(String className) ! { ! String result = className; ! ! if (className == null) ! { ! return null; ! } ! ! if (className.startsWith("[Z")) ! { ! result = "boolean[]"; ! } ! if (className.startsWith("[C")) ! { ! result = "char[]"; ! } ! if (className.startsWith("[D")) ! { ! result = "double[]"; ! } ! if (className.startsWith("[F")) ! { ! result = "float[]"; ! } ! if (className.startsWith("[I")) ! { ! result = "int[]"; ! } ! if (className.startsWith("[S")) ! { ! result = "short[]"; ! } ! if (className.startsWith("[J")) ! { ! result = "long[]"; ! } ! if (className.startsWith("[B")) ! { ! result = "byte[]"; ! } ! if (className.startsWith("[L")) ! { ! result = className.substring(2, className.length() - 1) + "[]"; ! } ! ! return result; ! } ! ! ! /** ! * Get the class by its name. ! * ! * @param fullPathClassName The full qualified name of the class ! * @return The class if it is found, otherwise null ! */ ! public static Class getClass(String fullPathClassName) ! { ! // Check if the class is a primitive type ! if (fullPathClassName.equals("void")) ! { ! return Void.TYPE; ! } ! if (fullPathClassName.equals("int")) ! { ! return Integer.TYPE; ! } ! if (fullPathClassName.equals("short")) ! { ! return Short.TYPE; ! } ! if (fullPathClassName.equals("long")) ! { ! return Long.TYPE; ! } ! if (fullPathClassName.equals("byte")) ! { ! return Byte.TYPE; ! } ! if (fullPathClassName.equals("char")) ! { ! return Character.TYPE; ! } ! if (fullPathClassName.equals("float")) ! { ! return Float.TYPE; ! } ! if (fullPathClassName.equals("double")) ! { ! return Double.TYPE; ! } ! if (fullPathClassName.equals("boolean")) ! { ! return Boolean.TYPE; ! } ! ! // Try to load the class ! Class c = null; ! try ! { ! c = Class.forName(fullPathClassName); ! } ! catch (Throwable e) ! { ! // Ignore it ! } ! ! return c; ! } ! ! ! /** ! * Get the double value from a numeric class ! * ! * @param o Object to transform ! * @return The double value ! */ ! public static double getValue(Object o) ! { ! if (isNumeric(o.getClass())) ! { ! if (o instanceof Number) ! { ! return ((Number) o).doubleValue(); ! } ! return (new Double(o.toString())).doubleValue(); ! } ! return 0; ! } ! ! ! /** ! * Return whether or not a class is numeric ! * ! * @param clazz The class to test ! * @return true if the class is numeric ! */ ! public static boolean isNumeric(Class clazz) ! { ! return numericClasses.contains(clazz); ! } ! ! /** fill in with the numeric classes */ ! static ! { ! numericClasses = new ArrayList(); ! numericClasses.add(Byte.class); ! numericClasses.add(Double.class); ! numericClasses.add(Float.class); ! numericClasses.add(Integer.class); ! numericClasses.add(Long.class); ! numericClasses.add(Short.class); ! numericClasses.add(Byte.TYPE); ! numericClasses.add(Double.TYPE); ! numericClasses.add(Float.TYPE); ! numericClasses.add(Integer.TYPE); ! numericClasses.add(Long.TYPE); ! numericClasses.add(Short.TYPE); ! } ! } Index: KeyLimitedStack.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/KeyLimitedStack.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** KeyLimitedStack.java 15 Sep 2003 22:23:45 -0000 1.6 --- KeyLimitedStack.java 13 Dec 2003 21:27:49 -0000 1.7 *************** *** 1,61 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util; ! ! ! /** ! * Extension of the Limited Stack class, which doesn't allow duplicates. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class KeyLimitedStack extends LimitedStack ! { ! /** Constructor for KeyLimitedStack. */ ! public KeyLimitedStack() ! { ! super(); ! } ! ! ! /** ! * Constructor for KeyLimitedStack. ! * ! * @param size ! */ ! public KeyLimitedStack(int size) ! { ! super(size); ! } ! ! ! /** ! * Overrides the push method to limit the number of elements and skip duplicates. ! * ! * @param item Item to push onto the stack ! * @return The item pushed ! */ ! public Object push(Object item) ! { ! // Remove duplicate ! if (this.contains(item)) ! { ! this.remove(this.indexOf(item)); ! } ! else ! { ! // If size is exceeded, remove the first in ! if (this.size() >= this.maximumSize) ! { ! this.remove(0); ! } ! } ! ! // Push the item ! return super.push(item); ! } ! } --- 1,61 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util; ! ! ! /** ! * Extension of the Limited Stack class, which doesn't allow duplicates. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class KeyLimitedStack extends LimitedStack ! { ! /** Constructor for KeyLimitedStack. */ ! public KeyLimitedStack() ! { ! super(); ! } ! ! ! /** ! * Constructor for KeyLimitedStack. ! * ! * @param size ! */ ! public KeyLimitedStack(int size) ! { ! super(size); ! } ! ! ! /** ! * Overrides the push method to limit the number of elements and skip duplicates. ! * ! * @param item Item to push onto the stack ! * @return The item pushed ! */ ! public Object push(Object item) ! { ! // Remove duplicate ! if (this.contains(item)) ! { ! this.remove(this.indexOf(item)); ! } ! else ! { ! // If size is exceeded, remove the first in ! if (this.size() >= this.maximumSize) ! { ! this.remove(0); ! } ! } ! ! // Push the item ! return super.push(item); ! } ! } Index: LimitedStack.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/LimitedStack.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LimitedStack.java 15 Sep 2003 22:23:45 -0000 1.6 --- LimitedStack.java 13 Dec 2003 21:27:49 -0000 1.7 *************** *** 1,59 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util; ! ! import java.util.Stack; ! ! /** ! * Extension of the Stack class, which has a limited depth (FIFO stack). This class doesn't allow duplicates. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class LimitedStack extends Stack ! { ! /** Maximum number elements allowed in the stack */ ! protected int maximumSize; ! ! ! /** Constructor for the LimitedStack object */ ! public LimitedStack() ! { ! this(10); ! } ! ! ! /** ! * Constructor for the LimitedStack object ! * ! * @param size Depth size of the stack ! */ ! public LimitedStack(int size) ! { ! this.maximumSize = size; ! } ! ! ! /** ! * Overrides the push method to limit the number of elements. ! * ! * @param item Item to push onto the stack ! * @return The item pushed ! */ ! public Object push(Object item) ! { ! // If size is exceeded, remove the first in ! if (this.size() >= this.maximumSize) ! { ! this.remove(0); ! } ! ! // Push the item ! return super.push(item); ! } ! } ! --- 1,59 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util; ! ! import java.util.Stack; ! ! /** ! * Extension of the Stack class, which has a limited depth (FIFO stack). This class doesn't allow duplicates. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class LimitedStack extends Stack ! { ! /** Maximum number elements allowed in the stack */ ! protected int maximumSize; ! ! ! /** Constructor for the LimitedStack object */ ! public LimitedStack() ! { ! this(10); ! } ! ! ! /** ! * Constructor for the LimitedStack object ! * ! * @param size Depth size of the stack ! */ ! public LimitedStack(int size) ! { ! this.maximumSize = size; ! } ! ! ! /** ! * Overrides the push method to limit the number of elements. ! * ! * @param item Item to push onto the stack ! * @return The item pushed ! */ ! public Object push(Object item) ! { ! // If size is exceeded, remove the first in ! if (this.size() >= this.maximumSize) ! { ! this.remove(0); ! } ! ! // Push the item ! return super.push(item); ! } ! } ! Index: Platform.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/Platform.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Platform.java 15 Sep 2003 22:23:45 -0000 1.1 --- Platform.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 1,91 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class Platform ! { ! /** Description of the Field */ ! private static String JAVA_VERSION; ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_1 = Platform.getJavaVersionMatches(Platform.JAVA_1_1); ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_2 = Platform.getJavaVersionMatches(Platform.JAVA_1_2); ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_3 = Platform.getJavaVersionMatches(Platform.JAVA_1_3); ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_4 = Platform.getJavaVersionMatches(Platform.JAVA_1_4); ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_5 = Platform.getJavaVersionMatches(Platform.JAVA_1_5); ! /** Description of the Field */ ! public final static String JAVA_1_1 = "1.1"; ! /** Description of the Field */ ! public final static String JAVA_1_2 = "1.2"; ! /** Description of the Field */ ! public final static String JAVA_1_3 = "1.3"; ! /** Description of the Field */ ! public final static String JAVA_1_4 = "1.4"; ! /** Description of the Field */ ! public final static String JAVA_1_5 = "1.5"; ! ! ! /** Avoid instantiation */ ! private Platform() { } ! ! ! /** ! * Gets the javaVersion attribute of the Platform class ! * ! * @return The javaVersion value ! */ ! public static String getJavaVersion() ! { ! if (JAVA_VERSION == null) ! { ! JAVA_VERSION = System.getProperty("java.version"); ! } ! return JAVA_VERSION; ! } ! ! ! /** ! * Gets the javaVersionCompatible attribute of the Platform class ! * ! * @param version Description of the Parameter ! * @return The javaVersionCompatible value ! */ ! public static boolean isJavaVersionCompatible(String version) ! { ! if (getJavaVersion() == null) ! { ! return false; ! } ! return (JAVA_VERSION.compareTo(version) >= 0); ! } ! ! ! /** ! * Gets the javaVersionMatches attribute of the Platform class ! * ! * @param versionPrefix Description of the Parameter ! * @return The javaVersionMatches value ! */ ! private static boolean getJavaVersionMatches(String versionPrefix) ! { ! if (getJavaVersion() == null) ! { ! return false; ! } ! return JAVA_VERSION.startsWith(versionPrefix); ! } ! } --- 1,91 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class Platform ! { ! /** Description of the Field */ ! private static String JAVA_VERSION; ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_1 = Platform.getJavaVersionMatches(Platform.JAVA_1_1); ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_2 = Platform.getJavaVersionMatches(Platform.JAVA_1_2); ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_3 = Platform.getJavaVersionMatches(Platform.JAVA_1_3); ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_4 = Platform.getJavaVersionMatches(Platform.JAVA_1_4); ! /** Description of the Field */ ! public final static boolean IS_JAVA_1_5 = Platform.getJavaVersionMatches(Platform.JAVA_1_5); ! /** Description of the Field */ ! public final static String JAVA_1_1 = "1.1"; ! /** Description of the Field */ ! public final static String JAVA_1_2 = "1.2"; ! /** Description of the Field */ ! public final static String JAVA_1_3 = "1.3"; ! /** Description of the Field */ ! public final static String JAVA_1_4 = "1.4"; ! /** Description of the Field */ ! public final static String JAVA_1_5 = "1.5"; ! ! ! /** Avoid instantiation */ ! private Platform() { } ! ! ! /** ! * Gets the javaVersion attribute of the Platform class ! * ! * @return The javaVersion value ! */ ! public static String getJavaVersion() ! { ! if (JAVA_VERSION == null) ! { ! JAVA_VERSION = System.getProperty("java.version"); ! } ! return JAVA_VERSION; ! } ! ! ! /** ! * Gets the javaVersionCompatible attribute of the Platform class ! * ! * @param version Description of the Parameter ! * @return The javaVersionCompatible value ! */ ! public static boolean isJavaVersionCompatible(String version) ! { ! if (getJavaVersion() == null) ! { ! return false; ! } ! return (JAVA_VERSION.compareTo(version) >= 0); ! } ! ! ! /** ! * Gets the javaVersionMatches attribute of the Platform class ! * ! * @param versionPrefix Description of the Parameter ! * @return The javaVersionMatches value ! */ ! private static boolean getJavaVersionMatches(String versionPrefix) ! { ! if (getJavaVersion() == null) ! { ! return false; ! } ! return JAVA_VERSION.startsWith(versionPrefix); ! } ! } |
From: <let...@us...> - 2003-12-14 10:50:07
|
Update of /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/state In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common/src/main/org/ejtools/util/state Modified Files: DefaultRule.java DefaultStoreVisitor.java LoadHandler.java Rule.java Storable.java StoreVisitor.java Added Files: WorkspaceFileTools.java package.html Log Message: Add more javadocs. Add package.html files. --- NEW FILE: WorkspaceFileTools.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.util.state; import java.util.ResourceBundle; import javax.swing.filechooser.FileFilter; import org.ejtools.util.FileTools; /** * Description of the Class * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public class WorkspaceFileTools extends FileTools { /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.util.Resources"); /** Description of the Field */ public final static FileFilter WORKSPACE_FILE_FILTER = new FileTools.SimpleFileFilter(".xml", resources.getString("workspace.file.dialog.extension.description")); /** Constructor for the FileUtil object */ protected WorkspaceFileTools() { } } --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> </body> </html> Index: DefaultRule.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/state/DefaultRule.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultRule.java 15 Sep 2003 22:23:45 -0000 1.1 --- DefaultRule.java 13 Dec 2003 21:27:50 -0000 1.2 *************** *** 1,45 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.util.Map; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class DefaultRule implements Rule ! { ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadBody(Map context) ! { ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadEnter(Map context) ! { ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadExit(Map context) ! { ! } ! } --- 1,45 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.util.Map; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class DefaultRule implements Rule ! { ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadBody(Map context) ! { ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadEnter(Map context) ! { ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadExit(Map context) ! { ! } ! } Index: DefaultStoreVisitor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/state/DefaultStoreVisitor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DefaultStoreVisitor.java 15 Sep 2003 22:23:45 -0000 1.1 --- DefaultStoreVisitor.java 13 Dec 2003 21:27:50 -0000 1.2 *************** *** 1,127 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.lang.reflect.Method; ! import java.util.HashMap; ! import java.util.Iterator; ! import java.util.Map; ! import java.util.Stack; ! import org.w3c.dom.Node; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.Sort; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class DefaultStoreVisitor implements StoreVisitor ! { ! /** Description of the Field */ ! private Stack nodes = new Stack(); ! /** Description of the Field */ ! private Map persistMappings = new HashMap(); ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(DefaultStoreVisitor.class); ! ! ! ! /**Constructor for the ReflectivePersistenceStore object */ ! public DefaultStoreVisitor() { } ! ! ! /** ! * Description of the Method ! * ! * @param iterator Description of the Parameter ! */ ! public void persist(Iterator iterator) ! { ! Iterator it = Sort.getChildrenByClass(iterator, Storable.class); ! for (; it.hasNext(); ) ! { ! Storable p = (Storable) it.next(); ! p.accept(this); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! */ ! public void persist(Object o) ! { ! Class clazz = o.getClass(); ! Method m = (Method) this.persistMappings.get(clazz); ! try ! { ! m.invoke(this, new Object[]{o}); ! } ! catch (Exception e) ! { ! logger.debug("Object of type " + o.getClass().getName() + " will not be persist"); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! protected Node peekCurrentNode() ! { ! return (Node) this.nodes.peek(); ! } ! ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! protected Node popCurrentNode() ! { ! return (Node) this.nodes.pop(); ! } ! ! ! ! /** ! * Description of the Method ! * ! * @param node Description of the Parameter ! */ ! protected void pushCurrentNode(Node node) ! { ! this.nodes.push(node); ! } ! ! ! /** ! * Description of the Method ! * ! * @param clazz Description of the Parameter ! */ ! public final void registerForPersistence(Class clazz) ! { ! try ! { ! Method m = this.getClass().getMethod("persist", new Class[]{clazz}); ! this.persistMappings.put(clazz, m); ! } ! catch (NoSuchMethodException nsme) ! { ! logger.warn("Can't register for persistence class " + clazz.getName()); ! } ! } ! } --- 1,127 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.lang.reflect.Method; ! import java.util.HashMap; ! import java.util.Iterator; ! import java.util.Map; ! import java.util.Stack; ! import org.w3c.dom.Node; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.Sort; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class DefaultStoreVisitor implements StoreVisitor ! { ! /** Description of the Field */ ! private Stack nodes = new Stack(); ! /** Description of the Field */ ! private Map persistMappings = new HashMap(); ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(DefaultStoreVisitor.class); ! ! ! ! /**Constructor for the ReflectivePersistenceStore object */ ! public DefaultStoreVisitor() { } ! ! ! /** ! * Description of the Method ! * ! * @param iterator Description of the Parameter ! */ ! public void persist(Iterator iterator) ! { ! Iterator it = Sort.getChildrenByClass(iterator, Storable.class); ! for (; it.hasNext(); ) ! { ! Storable p = (Storable) it.next(); ! p.accept(this); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! */ ! public void persist(Object o) ! { ! Class clazz = o.getClass(); ! Method m = (Method) this.persistMappings.get(clazz); ! try ! { ! m.invoke(this, new Object[]{o}); ! } ! catch (Exception e) ! { ! logger.debug("Object of type " + o.getClass().getName() + " will not be persist"); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! protected Node peekCurrentNode() ! { ! return (Node) this.nodes.peek(); ! } ! ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! protected Node popCurrentNode() ! { ! return (Node) this.nodes.pop(); ! } ! ! ! ! /** ! * Description of the Method ! * ! * @param node Description of the Parameter ! */ ! protected void pushCurrentNode(Node node) ! { ! this.nodes.push(node); ! } ! ! ! /** ! * Description of the Method ! * ! * @param clazz Description of the Parameter ! */ ! public final void registerForPersistence(Class clazz) ! { ! try ! { ! Method m = this.getClass().getMethod("persist", new Class[]{clazz}); ! this.persistMappings.put(clazz, m); ! } ! catch (NoSuchMethodException nsme) ! { ! logger.warn("Can't register for persistence class " + clazz.getName()); ! } ! } ! } Index: LoadHandler.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/state/LoadHandler.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LoadHandler.java 15 Sep 2003 22:23:45 -0000 1.1 --- LoadHandler.java 13 Dec 2003 21:27:50 -0000 1.2 *************** *** 1,129 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.util.HashMap; ! import java.util.Hashtable; ! import java.util.Map; ! ! import org.xml.sax.Attributes; ! import org.xml.sax.SAXException; ! import org.xml.sax.helpers.DefaultHandler; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class LoadHandler extends DefaultHandler ! { ! /** Description of the Field */ ! private Map context = new HashMap(); ! /** Description of the Field */ ! private String path = ""; ! /** Description of the Field */ ! private Map rules = new Hashtable(); ! ! /** Description of the Field */ ! public final static String ATTRIBUTES = "ATTRIBUTES"; ! /** Description of the Field */ ! public final static String ELEMENT = "ELEMENT"; ! /** Description of the Field */ ! public final static String TEXT = "TEXT"; ! ! ! /**Constructor for the WorkbenchHandler object */ ! public LoadHandler() { } ! ! ! /** ! * Adds a feature to the Rule attribute of the WorkbenchHandler object ! * ! * @param path The feature to be added to the Rule attribute ! * @param rule The feature to be added to the Rule attribute ! */ ! public void addRule(String path, Rule rule) ! { ! this.rules.put(path, rule); ! } ! ! ! /** ! * Description of the Method ! * ! * @param ch Description of the Parameter ! * @param start Description of the Parameter ! * @param length Description of the Parameter ! * @exception SAXException Description of the Exception ! */ ! public void characters(char[] ch, int start, int length) ! throws SAXException ! { ! String text = new String(ch, start, length); ! this.context.put("TEXT", text); ! Rule rule = (Rule) this.rules.get(this.path); ! if (rule != null) ! { ! rule.loadBody(this.context); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param uri Description of the Parameter ! * @param localName Description of the Parameter ! * @param qName Description of the Parameter ! * @exception SAXException Description of the Exception ! */ ! public void endElement(String uri, String localName, String qName) ! throws SAXException ! { ! this.context.put("ELEMENT", qName); ! Rule rule = (Rule) this.rules.get(this.path); ! if (rule != null) ! { ! rule.loadExit(this.context); ! } ! this.path = this.path.substring(0, this.path.length() - qName.length() - 1); ! } ! ! ! /** ! * Gets the context attribute of the LoadHandler object ! * ! * @return The context value ! */ ! public Map getContext() ! { ! return this.context; ! } ! ! ! /** ! * Description of the Method ! * ! * @param uri Description of the Parameter ! * @param localName Description of the Parameter ! * @param qName Description of the Parameter ! * @param attributes Description of the Parameter ! * @exception SAXException Description of the Exception ! */ ! public void startElement(String uri, String localName, String qName, Attributes attributes) ! throws SAXException ! { ! this.context.put("ELEMENT", qName); ! this.context.put("ATTRIBUTES", attributes); ! this.path = path + "/" + qName; ! Rule rule = (Rule) this.rules.get(this.path); ! if (rule != null) ! { ! rule.loadEnter(this.context); ! } ! } ! } --- 1,129 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.util.HashMap; ! import java.util.Hashtable; ! import java.util.Map; ! ! import org.xml.sax.Attributes; ! import org.xml.sax.SAXException; ! import org.xml.sax.helpers.DefaultHandler; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class LoadHandler extends DefaultHandler ! { ! /** Description of the Field */ ! private Map context = new HashMap(); ! /** Description of the Field */ ! private String path = ""; ! /** Description of the Field */ ! private Map rules = new Hashtable(); ! ! /** Description of the Field */ ! public final static String ATTRIBUTES = "ATTRIBUTES"; ! /** Description of the Field */ ! public final static String ELEMENT = "ELEMENT"; ! /** Description of the Field */ ! public final static String TEXT = "TEXT"; ! ! ! /**Constructor for the WorkbenchHandler object */ ! public LoadHandler() { } ! ! ! /** ! * Adds a feature to the Rule attribute of the WorkbenchHandler object ! * ! * @param path The feature to be added to the Rule attribute ! * @param rule The feature to be added to the Rule attribute ! */ ! public void addRule(String path, Rule rule) ! { ! this.rules.put(path, rule); ! } ! ! ! /** ! * Description of the Method ! * ! * @param ch Description of the Parameter ! * @param start Description of the Parameter ! * @param length Description of the Parameter ! * @exception SAXException Description of the Exception ! */ ! public void characters(char[] ch, int start, int length) ! throws SAXException ! { ! String text = new String(ch, start, length); ! this.context.put("TEXT", text); ! Rule rule = (Rule) this.rules.get(this.path); ! if (rule != null) ! { ! rule.loadBody(this.context); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param uri Description of the Parameter ! * @param localName Description of the Parameter ! * @param qName Description of the Parameter ! * @exception SAXException Description of the Exception ! */ ! public void endElement(String uri, String localName, String qName) ! throws SAXException ! { ! this.context.put("ELEMENT", qName); ! Rule rule = (Rule) this.rules.get(this.path); ! if (rule != null) ! { ! rule.loadExit(this.context); ! } ! this.path = this.path.substring(0, this.path.length() - qName.length() - 1); ! } ! ! ! /** ! * Gets the context attribute of the LoadHandler object ! * ! * @return The context value ! */ ! public Map getContext() ! { ! return this.context; ! } ! ! ! /** ! * Description of the Method ! * ! * @param uri Description of the Parameter ! * @param localName Description of the Parameter ! * @param qName Description of the Parameter ! * @param attributes Description of the Parameter ! * @exception SAXException Description of the Exception ! */ ! public void startElement(String uri, String localName, String qName, Attributes attributes) ! throws SAXException ! { ! this.context.put("ELEMENT", qName); ! this.context.put("ATTRIBUTES", attributes); ! this.path = path + "/" + qName; ! Rule rule = (Rule) this.rules.get(this.path); ! if (rule != null) ! { ! rule.loadEnter(this.context); ! } ! } ! } Index: Rule.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/state/Rule.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Rule.java 15 Sep 2003 22:23:45 -0000 1.1 --- Rule.java 13 Dec 2003 21:27:50 -0000 1.2 *************** *** 1,40 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.util.Map; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface Rule ! { ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadEnter(Map context); ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadBody(Map context); ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadExit(Map context); ! } --- 1,40 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.util.Map; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface Rule ! { ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadEnter(Map context); ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadBody(Map context); ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! public void loadExit(Map context); ! } Index: Storable.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/state/Storable.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Storable.java 15 Sep 2003 22:23:45 -0000 1.1 --- Storable.java 13 Dec 2003 21:27:50 -0000 1.2 *************** *** 1,22 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface Storable ! { ! /** ! * Description of the Method ! * ! * @param visitor Description of the Parameter ! */ ! void accept(StoreVisitor visitor); ! } --- 1,22 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface Storable ! { ! /** ! * Description of the Method ! * ! * @param visitor Description of the Parameter ! */ ! void accept(StoreVisitor visitor); ! } Index: StoreVisitor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/util/state/StoreVisitor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StoreVisitor.java 15 Sep 2003 22:23:45 -0000 1.1 --- StoreVisitor.java 13 Dec 2003 21:27:50 -0000 1.2 *************** *** 1,40 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.util.Iterator; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface StoreVisitor ! { ! /** ! * Description of the Method ! * ! * @param iterator Description of the Parameter ! */ ! void persist(Iterator iterator); ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! */ ! void persist(Object o); ! ! ! /** ! * Description of the Method ! * ! * @param clazz Description of the Parameter ! */ ! void registerForPersistence(Class clazz); ! } --- 1,40 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.util.state; ! ! import java.util.Iterator; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface StoreVisitor ! { ! /** ! * Description of the Method ! * ! * @param iterator Description of the Parameter ! */ ! void persist(Iterator iterator); ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! */ ! void persist(Object o); ! ! ! /** ! * Description of the Method ! * ! * @param clazz Description of the Parameter ! */ ! void registerForPersistence(Class clazz); ! } |
From: <let...@us...> - 2003-12-14 10:50:06
|
Update of /cvsroot/ejtools/libraries/common/src/test/test/util In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common/src/test/test/util Modified Files: KeyLimitedStackTest.java LimitedStackTest.java PlatformTest.java Log Message: Add more javadocs. Add package.html files. Index: KeyLimitedStackTest.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/test/test/util/KeyLimitedStackTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** KeyLimitedStackTest.java 27 Nov 2003 00:40:25 -0000 1.3 --- KeyLimitedStackTest.java 13 Dec 2003 21:27:50 -0000 1.4 *************** *** 1,110 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package test.util; ! ! import org.ejtools.util.KeyLimitedStack; ! import org.ejtools.util.LimitedStack; ! ! import junit.framework.TestCase; ! ! /** ! * @author letiemble ! * @version $Revision$ ! */ ! public class KeyLimitedStackTest extends TestCase ! { ! ! /**Constructor for the LimitedStackTest object */ ! public KeyLimitedStackTest() ! { ! super(); ! } ! ! ! /** ! *Constructor for the LimitedStackTest object ! * ! * @param name Description of the Parameter ! */ ! public KeyLimitedStackTest(String name) ! { ! super(name); ! } ! ! ! /** A unit test for JUnit */ ! public void testPop() ! { ! LimitedStack stack = new KeyLimitedStack(5); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.pop(); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.push("key2"); ! assertEquals("Stack size must be 2", stack.size(), 2); ! stack.push("key3"); ! assertEquals("Stack size must be 3", stack.size(), 3); ! stack.push("key4"); ! assertEquals("Stack size must be 4", stack.size(), 4); ! stack.push("key5"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.push("key6"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.pop(); ! assertEquals("Stack size must be 4", stack.size(), 4); ! stack.pop(); ! assertEquals("Stack size must be 3", stack.size(), 3); ! stack.pop(); ! assertEquals("Stack size must be 2", stack.size(), 2); ! stack.pop(); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.pop(); ! assertEquals("Stack must be empty", stack.size(), 0); ! } ! ! ! /** A unit test for JUnit */ ! public void testPush() ! { ! LimitedStack stack = new KeyLimitedStack(5); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key2"); ! assertEquals("Stack size must be 2", stack.size(), 2); ! ! stack.push("key3"); ! assertEquals("Stack size must be 3", stack.size(), 3); ! ! stack.push("key4"); ! assertEquals("Stack size must be 4", stack.size(), 4); ! ! stack.push("key5"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.push("key6"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! } ! } --- 1,109 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package test.util; ! ! import org.ejtools.util.KeyLimitedStack; ! ! import junit.framework.TestCase; ! ! /** ! * @author letiemble ! * @version $Revision$ ! */ ! public class KeyLimitedStackTest extends TestCase ! { ! ! /** Constructor for the LimitedStackTest object */ ! public KeyLimitedStackTest() ! { ! super(); ! } ! ! ! /** ! * Constructor for the LimitedStackTest object ! * ! * @param name Description of the Parameter ! */ ! public KeyLimitedStackTest(String name) ! { ! super(name); ! } ! ! ! /** A unit test for JUnit */ ! public void testPop() ! { ! KeyLimitedStack stack = new KeyLimitedStack(5); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.pop(); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.push("key2"); ! assertEquals("Stack size must be 2", stack.size(), 2); ! stack.push("key3"); ! assertEquals("Stack size must be 3", stack.size(), 3); ! stack.push("key4"); ! assertEquals("Stack size must be 4", stack.size(), 4); ! stack.push("key5"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.push("key6"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.pop(); ! assertEquals("Stack size must be 4", stack.size(), 4); ! stack.pop(); ! assertEquals("Stack size must be 3", stack.size(), 3); ! stack.pop(); ! assertEquals("Stack size must be 2", stack.size(), 2); ! stack.pop(); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.pop(); ! assertEquals("Stack must be empty", stack.size(), 0); ! } ! ! ! /** A unit test for JUnit */ ! public void testPush() ! { ! KeyLimitedStack stack = new KeyLimitedStack(5); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key2"); ! assertEquals("Stack size must be 2", stack.size(), 2); ! ! stack.push("key3"); ! assertEquals("Stack size must be 3", stack.size(), 3); ! ! stack.push("key4"); ! assertEquals("Stack size must be 4", stack.size(), 4); ! ! stack.push("key5"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.push("key6"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! } ! } Index: LimitedStackTest.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/test/test/util/LimitedStackTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LimitedStackTest.java 27 Nov 2003 00:40:25 -0000 1.3 --- LimitedStackTest.java 13 Dec 2003 21:27:50 -0000 1.4 *************** *** 1,100 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package test.util; ! ! import org.ejtools.util.LimitedStack; ! ! import junit.framework.TestCase; ! ! /** ! * @author letiemble ! * @version $Revision$ ! */ ! public class LimitedStackTest extends TestCase ! { ! ! /**Constructor for the LimitedStackTest object */ ! public LimitedStackTest() ! { ! super(); ! } ! ! ! /** ! *Constructor for the LimitedStackTest object ! * ! * @param name Description of the Parameter ! */ ! public LimitedStackTest(String name) ! { ! super(name); ! } ! ! ! /** A unit test for JUnit */ ! public void testPop() ! { ! LimitedStack stack = new LimitedStack(5); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.pop(); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.push("key2"); ! assertEquals("Stack size must be 2", stack.size(), 2); ! stack.push("key3"); ! assertEquals("Stack size must be 3", stack.size(), 3); ! stack.push("key4"); ! assertEquals("Stack size must be 4", stack.size(), 4); ! stack.push("key5"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.push("key6"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.pop(); ! assertEquals("Stack size must be 4", stack.size(), 4); ! stack.pop(); ! assertEquals("Stack size must be 3", stack.size(), 3); ! stack.pop(); ! assertEquals("Stack size must be 2", stack.size(), 2); ! stack.pop(); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.pop(); ! assertEquals("Stack must be empty", stack.size(), 0); ! } ! ! ! /** A unit test for JUnit */ ! public void testPush() ! { ! LimitedStack stack = new LimitedStack(5); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key2"); ! assertEquals("Stack size must be 2", stack.size(), 2); ! ! stack.push("key3"); ! assertEquals("Stack size must be 3", stack.size(), 3); ! ! stack.push("key4"); ! assertEquals("Stack size must be 4", stack.size(), 4); ! ! stack.push("key5"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.push("key6"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! } ! } --- 1,100 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package test.util; ! ! import org.ejtools.util.LimitedStack; ! ! import junit.framework.TestCase; ! ! /** ! * @author letiemble ! * @version $Revision$ ! */ ! public class LimitedStackTest extends TestCase ! { ! ! /** Constructor for the LimitedStackTest object */ ! public LimitedStackTest() ! { ! super(); ! } ! ! ! /** ! * Constructor for the LimitedStackTest object ! * ! * @param name Description of the Parameter ! */ ! public LimitedStackTest(String name) ! { ! super(name); ! } ! ! ! /** A unit test for JUnit */ ! public void testPop() ! { ! LimitedStack stack = new LimitedStack(5); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.pop(); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.push("key2"); ! assertEquals("Stack size must be 2", stack.size(), 2); ! stack.push("key3"); ! assertEquals("Stack size must be 3", stack.size(), 3); ! stack.push("key4"); ! assertEquals("Stack size must be 4", stack.size(), 4); ! stack.push("key5"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.push("key6"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.pop(); ! assertEquals("Stack size must be 4", stack.size(), 4); ! stack.pop(); ! assertEquals("Stack size must be 3", stack.size(), 3); ! stack.pop(); ! assertEquals("Stack size must be 2", stack.size(), 2); ! stack.pop(); ! assertEquals("Stack size must be 1", stack.size(), 1); ! stack.pop(); ! assertEquals("Stack must be empty", stack.size(), 0); ! } ! ! ! /** A unit test for JUnit */ ! public void testPush() ! { ! LimitedStack stack = new LimitedStack(5); ! assertEquals("Stack must be empty", stack.size(), 0); ! ! stack.push("key1"); ! assertEquals("Stack size must be 1", stack.size(), 1); ! ! stack.push("key2"); ! assertEquals("Stack size must be 2", stack.size(), 2); ! ! stack.push("key3"); ! assertEquals("Stack size must be 3", stack.size(), 3); ! ! stack.push("key4"); ! assertEquals("Stack size must be 4", stack.size(), 4); ! ! stack.push("key5"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! ! stack.push("key6"); ! assertEquals("Stack size must be 5", stack.size(), 5); ! } ! } Index: PlatformTest.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/test/test/util/PlatformTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PlatformTest.java 15 Sep 2003 22:23:46 -0000 1.1 --- PlatformTest.java 13 Dec 2003 21:27:50 -0000 1.2 *************** *** 17,21 **** public class PlatformTest extends TestCase { ! /**Constructor for the ClassToolsTest object */ public PlatformTest() { --- 17,21 ---- public class PlatformTest extends TestCase { ! /** Constructor for the ClassToolsTest object */ public PlatformTest() { *************** *** 25,29 **** /** ! *Constructor for the ClassToolsTest object * * @param name Description of the Parameter --- 25,29 ---- /** ! * Constructor for the ClassToolsTest object * * @param name Description of the Parameter *************** *** 38,43 **** public void testJavaVersion() { ! System.setProperty("java.version", "1.4.1_b1"); ! assertFalse("Version is not 1.1", Platform.IS_JAVA_1_1); assertFalse("Version is not 1.2", Platform.IS_JAVA_1_2); --- 38,43 ---- public void testJavaVersion() { ! assertEquals("Version is wrong", Platform.getJavaVersion(), "1.4.5"); ! assertFalse("Version is not 1.1", Platform.IS_JAVA_1_1); assertFalse("Version is not 1.2", Platform.IS_JAVA_1_2); *************** *** 45,49 **** --- 45,54 ---- assertTrue("Version is not 1.4", Platform.IS_JAVA_1_4); assertFalse("Version is not 1.5", Platform.IS_JAVA_1_5); + } + + /** A unit test for JUnit */ + public void testJavaVersionCompatiblity() + { assertTrue("Version is compatible with 1.1", Platform.isJavaVersionCompatible(Platform.JAVA_1_1)); assertTrue("Version is compatible with 1.2", Platform.isJavaVersionCompatible(Platform.JAVA_1_2)); *************** *** 51,54 **** --- 56,71 ---- assertTrue("Version is compatible with 1.4", Platform.isJavaVersionCompatible(Platform.JAVA_1_4)); assertFalse("Version is compatible with 1.5", Platform.isJavaVersionCompatible(Platform.JAVA_1_5)); + } + + + /** + * The JUnit setup method + * + * @exception Exception Description of the Exception + */ + protected void setUp() + throws Exception + { + System.setProperty("java.version", "1.4.5"); } } |
From: <let...@us...> - 2003-12-14 10:50:06
|
Update of /cvsroot/ejtools/libraries/common/src/test/test/beans In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common/src/test/test/beans Modified Files: SortTest.java Added Files: CustomPropertyEditorManagerTest.java Log Message: Add more javadocs. Add package.html files. --- NEW FILE: CustomPropertyEditorManagerTest.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package test.beans; import java.beans.PropertyEditor; import java.beans.PropertyEditorManager; import java.beans.PropertyEditorSupport; import java.io.ObjectInput; import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import java.util.Arrays; import java.util.List; import junit.framework.TestCase; import org.ejtools.beans.CustomPropertyEditorManager; /** * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public class CustomPropertyEditorManagerTest extends TestCase { /** Constructor for the CustomPropertyEditorManagerTest object */ public CustomPropertyEditorManagerTest() { super(); } /** * Constructor for the CustomPropertyEditorManagerTest object * * @param name Description of the Parameter */ public CustomPropertyEditorManagerTest(String name) { super(name); } /** A unit test for JUnit */ public void testInitialization() { List paths = null; String[] beforePaths = PropertyEditorManager.getEditorSearchPath(); // Force class loading CustomPropertyEditorManager.findEditor(String.class); String path = CustomPropertyEditorManager.EDITORS_PACKAGE; String[] afterPaths = PropertyEditorManager.getEditorSearchPath(); paths = Arrays.asList(beforePaths); if (paths.contains(path)) { fail("Must not find " + path + " among the paths"); } paths = Arrays.asList(afterPaths); if (!paths.contains(path)) { fail("Must find " + path + " among the paths"); } } /** A unit test for JUnit */ public void testSearch() { PropertyEditor pe = null; pe = CustomPropertyEditorManager.findEditor(String.class); assertNotNull("Must find at least one property editor", pe); pe = CustomPropertyEditorManager.findEditor(Thread.class); assertNull("Must not find a property editor", pe); PropertyEditorManager.registerEditor(ObjectInput.class, InputStreamPropertyEditor.class); PropertyEditorManager.registerEditor(ObjectOutput.class, OutputStreamPropertyEditor.class); pe = CustomPropertyEditorManager.findEditor(ObjectInputStream.class); assertNotNull("Must find one property editor", pe); assertEquals("Must find one property editor", pe.getClass(), InputStreamPropertyEditor.class); pe = CustomPropertyEditorManager.findEditor(ObjectOutputStream.class); assertNotNull("Must find one property editor", pe); assertEquals("Must find one property editor", pe.getClass(), OutputStreamPropertyEditor.class); } /** * Description of the Class * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public static class InputStreamPropertyEditor extends PropertyEditorSupport { } /** * Description of the Class * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public static class OutputStreamPropertyEditor extends PropertyEditorSupport { } } Index: SortTest.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/test/test/beans/SortTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SortTest.java 27 Nov 2003 00:40:24 -0000 1.3 --- SortTest.java 13 Dec 2003 21:27:50 -0000 1.4 *************** *** 1,39 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package test.beans; ! ! import junit.framework.TestCase; ! ! /** ! * @author letiemble ! * @version $Revision$ ! */ ! public class SortTest extends TestCase ! { ! /**Constructor for the SortTest object */ ! public SortTest() ! { ! super(); ! } ! ! ! /** ! *Constructor for the SortTest object ! * ! * @param name Description of the Parameter ! */ ! public SortTest(String name) ! { ! super(name); ! } ! ! ! /** A unit test for JUnit */ ! public void testSortByClass() ! { ! } ! } --- 1,236 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package test.beans; ! ! import java.util.ArrayList; ! import java.util.Collection; ! import java.util.Iterator; ! ! import org.ejtools.beans.Sort; ! ! import junit.framework.TestCase; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class SortTest extends TestCase ! { ! private Collection content; ! ! ! /** Constructor for the SortTest object */ ! public SortTest() ! { ! super(); ! } ! ! ! /** ! * Constructor for the SortTest object ! * ! * @param name Description of the Parameter ! */ ! public SortTest(String name) ! { ! super(name); ! } ! ! ! /** A unit test for JUnit */ ! public void testGetChildrenByClass() ! { ! int i = 0; ! for (Iterator it = Sort.getChildrenByClass(this.content.iterator(), String.class); it.hasNext(); i++) ! { ! it.next(); ! } ! assertEquals("Four elements must be found", i, 4); ! ! i = 0; ! for (Iterator it = Sort.getChildrenByClass(this.content.iterator(), Double.class); it.hasNext(); i++) ! { ! it.next(); ! } ! assertEquals("Tow elements must be found", i, 2); ! ! i = 0; ! for (Iterator it = Sort.getChildrenByClass(this.content.iterator(), Object.class); it.hasNext(); i++) ! { ! it.next(); ! } ! assertEquals("Eight elements must be found", i, 8); ! } ! ! ! /** A unit test for JUnit */ ! public void testSortByClass() ! { ! int i = 0; ! for (Iterator it = Sort.sortByClass(this.content.iterator()); it.hasNext(); i++) ! { ! Object o = it.next(); ! switch (i) ! { ! case 0: ! assertEquals("Class is not correct", Double.class, o.getClass()); ! break; ! case 1: ! assertEquals("Class is not correct", Double.class, o.getClass()); ! break; ! case 2: ! assertEquals("Class is not correct", Object.class, o.getClass()); ! break; ! case 3: ! assertEquals("Class is not correct", Object.class, o.getClass()); ! break; ! case 4: ! assertEquals("Class is not correct", String.class, o.getClass()); ! break; ! case 5: ! assertEquals("Class is not correct", String.class, o.getClass()); ! break; ! case 6: ! assertEquals("Class is not correct", String.class, o.getClass()); ! break; ! case 7: ! assertEquals("Class is not correct", String.class, o.getClass()); ! break; ! default: ! } ! } ! } ! ! ! /** A unit test for JUnit */ ! public void testSortByClassAndName() ! { ! int i = 0; ! for (Iterator it = Sort.sortByClassAndName(this.content.iterator()); it.hasNext(); i++) ! { ! Object o = it.next(); ! switch (i) ! { ! case 0: ! assertEquals("Class is not correct", Double.class, o.getClass()); ! assertEquals("Name is not correct", "0.0", o.toString()); ! break; ! case 1: ! assertEquals("Class is not correct", Double.class, o.getClass()); ! assertEquals("Name is not correct", "1.0", o.toString()); ! break; ! case 2: ! assertEquals("Class is not correct", Object.class, o.getClass()); ! break; ! case 3: ! assertEquals("Class is not correct", Object.class, o.getClass()); ! break; ! case 4: ! assertEquals("Class is not correct", String.class, o.getClass()); ! assertEquals("Name is not correct", "s0", o.toString()); ! break; ! case 5: ! assertEquals("Class is not correct", String.class, o.getClass()); ! assertEquals("Name is not correct", "s1", o.toString()); ! break; ! case 6: ! assertEquals("Class is not correct", String.class, o.getClass()); ! assertEquals("Name is not correct", "s2", o.toString()); ! break; ! case 7: ! assertEquals("Class is not correct", String.class, o.getClass()); ! assertEquals("Name is not correct", "s3", o.toString()); ! break; ! default: ! } ! } ! } ! ! ! /** A unit test for JUnit */ ! public void testSortByName() ! { ! int i = 0; ! for (Iterator it = Sort.sortByName(this.content.iterator()); it.hasNext(); i++) ! { ! Object o = it.next(); ! switch (i) ! { ! case 0: ! assertEquals("Class is not correct", Double.class, o.getClass()); ! assertEquals("Name is not correct", "0.0", o.toString()); ! break; ! case 1: ! assertEquals("Class is not correct", Double.class, o.getClass()); ! assertEquals("Name is not correct", "1.0", o.toString()); ! break; ! case 2: ! assertEquals("Class is not correct", Object.class, o.getClass()); ! break; ! case 3: ! assertEquals("Class is not correct", Object.class, o.getClass()); ! break; ! case 4: ! assertEquals("Class is not correct", String.class, o.getClass()); ! assertEquals("Name is not correct", "s0", o.toString()); ! break; ! case 5: ! assertEquals("Class is not correct", String.class, o.getClass()); ! assertEquals("Name is not correct", "s1", o.toString()); ! break; ! case 6: ! assertEquals("Class is not correct", String.class, o.getClass()); ! assertEquals("Name is not correct", "s2", o.toString()); ! break; ! case 7: ! assertEquals("Class is not correct", String.class, o.getClass()); ! assertEquals("Name is not correct", "s3", o.toString()); ! break; ! default: ! } ! } ! } ! ! ! /** A unit test for JUnit */ ! public void testSortByProperty() ! { ! } ! ! ! /** ! * The JUnit setup method ! * ! * @exception Exception Description of the Exception ! */ ! protected void setUp() ! throws Exception ! { ! this.content = new ArrayList(); ! ! this.content.add("s0"); ! this.content.add(new Object()); ! this.content.add("s1"); ! this.content.add(new Double(1)); ! this.content.add("s2"); ! this.content.add(new Object()); ! this.content.add("s3"); ! this.content.add(new Double(0)); ! } ! ! ! /** ! * The teardown method for JUnit ! * ! * @exception Exception Description of the Exception ! */ ! protected void tearDown() ! throws Exception ! { ! this.content = null; ! } ! } |
From: <let...@us...> - 2003-12-14 10:50:04
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/action Modified Files: CommandAction.java Log Message: Add more javadocs. Add package.html files. Index: CommandAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/CommandAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CommandAction.java 15 Sep 2003 22:37:12 -0000 1.7 --- CommandAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 27,57 **** /** ! * Description of the Class * * @author Laurent Etiemble * @version $Revision$ ! * @todo Javadoc to complete */ public class CommandAction extends CustomBeanContextServicesSupport implements Action { ! /** Description of the Field */ protected AbstractAction action = null; ! /** Description of the Field */ protected Command command; ! /** Description of the Field */ protected ResourceBundle resource; ! /** Description of the Field */ private static Logger logger = Logger.getLogger(CommandAction.class); ! /** Description of the Field */ public final static String ICON = "Icon"; ! /** Description of the Field */ public final static String MENU = "Menu"; ! /** Description of the Field */ public final static String MENU_ITEM = "MenuItem"; ! /** Description of the Field */ public final static String MENU_LAYOUT = "MenuLayout"; ! /** Description of the Field */ public final static String TOOLBAR = "Toolbar"; ! /** Description of the Field */ public final static String TOOLTIP = "ToolTip"; --- 27,77 ---- /** ! * BeanContext that wraps an Action and delegates to a Command object. ! * <p> ! * It supports the Command pattern by delegating the <code>ActionEvent</code> event to the <code>execute</code> method of the Command object. ! * </p> ! * <p> ! * It automatically handles the negotiation in ToolBar and MenuBar if these services are present. ! * </p> ! * <p> ! * It supports the following properties :<ul> ! * <li>Custom Icon</li> ! * <li>Tooltip</li> ! * <li>Mnemonic key</li> ! * <li>Accelerator key</li> ! * <li>MenuBar presence</li> ! * <li>Toolbar presence</li> ! * <li>Menu name</li> ! * <li>Menu item</li> ! * <li>Menu position</li> ! * </ul> ! * </p> * * @author Laurent Etiemble * @version $Revision$ ! * @see org.ejtools.adwt.action.Command */ public class CommandAction extends CustomBeanContextServicesSupport implements Action { ! /** The wrapped action */ protected AbstractAction action = null; ! /** The command to execute */ protected Command command; ! /** Resource Bundle */ protected ResourceBundle resource; ! /** Default logger */ private static Logger logger = Logger.getLogger(CommandAction.class); ! ! /** Constant for ICON property */ public final static String ICON = "Icon"; ! /** Constant for MENU property */ public final static String MENU = "Menu"; ! /** Constant for MENU_ITEM property */ public final static String MENU_ITEM = "MenuItem"; ! /** Constant for MENU_LAYOUT property */ public final static String MENU_LAYOUT = "MenuLayout"; ! /** Constant for TOOLBAR property */ public final static String TOOLBAR = "Toolbar"; ! /** Constant for TOOLTIP property */ public final static String TOOLTIP = "ToolTip"; *************** *** 59,69 **** /** ! * Constructor for the CommandAction object * ! * @param command Description of Parameter ! * @param name Description of Parameter ! * @param res Description of Parameter */ ! public CommandAction(Command command, ResourceBundle res, String name) { this.setCommand(command); --- 79,89 ---- /** ! * Constructor used to fully define the CommandAction. * ! * @param command The command object to delegate the ActionEvent to ! * @param res The Resource Bundle used for resolving the name and other properties ! * @param name The name of the CommandAction. Must be a key found in the Resource Bundle */ ! protected CommandAction(Command command, ResourceBundle res, String name) { this.setCommand(command); *************** *** 110,116 **** /** ! * actionPerformed is what executed the command. actionPerformed is called whenever the action is acted upon. * ! * @param e the action event */ public void actionPerformed(ActionEvent e) --- 130,136 ---- /** ! * This method is called whenever the action is acted upon. The call will be delegated to the wrapped action. * ! * @param e The action event */ public void actionPerformed(ActionEvent e) *************** *** 121,127 **** /** ! * Adds a feature to the PropertyChangeListener attribute of the CommandAction object * ! * @param listener The feature to be added to the PropertyChangeListener attribute */ public void addPropertyChangeListener(PropertyChangeListener listener) --- 141,147 ---- /** ! * Adds a PropertyChangeListener. The call will be delegated to the wrapped action. * ! * @param listener The listener to be added */ public void addPropertyChangeListener(PropertyChangeListener listener) *************** *** 196,202 **** /** ! * Description of the Method * ! * @param listener Description of Parameter */ public void removePropertyChangeListener(PropertyChangeListener listener) --- 216,222 ---- /** ! * Removes a PropertyChangeListener. The call will be delegated to the wrapped action. * ! * @param listener The listener to remove */ public void removePropertyChangeListener(PropertyChangeListener listener) *************** *** 207,213 **** /** ! * Description of the Method * ! * @param bcsae Description of Parameter */ public void serviceAvailable(BeanContextServiceAvailableEvent bcsae) { } --- 227,233 ---- /** ! * Triggered when a service is made available. * ! * @param bcsae The availability event */ public void serviceAvailable(BeanContextServiceAvailableEvent bcsae) { } *************** *** 215,221 **** /** ! * Description of the Method * ! * @param bcsre Description of Parameter */ public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) { } --- 235,241 ---- /** ! * Triggered when a service is revoked. * ! * @param bcsre The revocation event */ public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) { } *************** *** 223,229 **** /** ! * Sets the enabled attribute of the CommandAction object * ! * @param b The new enabled value */ public void setEnabled(boolean b) --- 243,249 ---- /** ! * Enables the Action. The call will be delegated to the wrapped action. * ! * @param b If true, the action will be enable */ public void setEnabled(boolean b) *************** *** 233,237 **** ! /** Description of the Method */ protected void initializeBeanContextResources() { --- 253,257 ---- ! /** Called when the CommandAction is put in a BeanContext */ protected void initializeBeanContextResources() { *************** *** 283,287 **** ! /** Description of the Method */ protected void releaseBeanContextResources() { --- 303,307 ---- ! /** Called when the CommandAction is removed from a BeanContext */ protected void releaseBeanContextResources() { *************** *** 334,340 **** /** ! * Gets the menu attribute of the CommandAction object * ! * @return The menu value */ public final String getMenu() --- 354,360 ---- /** ! * Returns the menu property * ! * @return The menu property */ public final String getMenu() *************** *** 345,351 **** /** ! * Gets the menuLayout attribute of the CommandAction object * ! * @return The menuLayout value */ public final int getMenuLayout() --- 365,371 ---- /** ! * Returns the menu layout property * ! * @return The menu layout property */ public final int getMenuLayout() *************** *** 356,362 **** /** ! * Getter for the resourceBundle attribute * ! * @return The value of resourceBundle attribute */ public final ResourceBundle getResourceBundle() --- 376,382 ---- /** ! * Returns the Resource Bundle used by this object * ! * @return The Resource Bundle */ public final ResourceBundle getResourceBundle() *************** *** 367,373 **** /** ! * Gets the toolbar attribute of the CommandAction object * ! * @return The toolbar value */ public final boolean getToolBar() --- 387,393 ---- /** ! * Returns the toolbar presence property * ! * @return The toolbar presence property */ public final boolean getToolBar() *************** *** 456,462 **** /** ! * This method retrieves the encapsulated command. * ! * @return Command */ protected final Command getCommand() --- 476,482 ---- /** ! * Returns the wrapped command object * ! * @return The command object */ protected final Command getCommand() |
From: <let...@us...> - 2003-12-14 10:50:03
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/tools In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/action/tools Modified Files: ExportAction.java ImportAction.java Log Message: Add more javadocs. Add package.html files. Index: ExportAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/tools/ExportAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExportAction.java 15 Sep 2003 22:37:13 -0000 1.1 --- ExportAction.java 13 Dec 2003 21:29:34 -0000 1.2 *************** *** 21,25 **** public class ExportAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class ExportAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: ImportAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/tools/ImportAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ImportAction.java 15 Sep 2003 22:37:13 -0000 1.1 --- ImportAction.java 13 Dec 2003 21:29:34 -0000 1.2 *************** *** 21,25 **** public class ImportAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class ImportAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); |
From: <let...@us...> - 2003-12-14 10:50:03
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/action/file Modified Files: ExitAction.java FileHistoryAction.java FileHistoryActionTop.java NewAction.java OpenAction.java OpenWorkspaceAction.java PrintAction.java SaveAction.java SaveAsAction.java SaveAsWorkspaceAction.java SaveWorkspaceAction.java Log Message: Add more javadocs. Add package.html files. Index: ExitAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/ExitAction.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ExitAction.java 15 Sep 2003 22:37:13 -0000 1.9 --- ExitAction.java 13 Dec 2003 21:29:34 -0000 1.10 *************** *** 22,26 **** public class ExitAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 22,26 ---- public class ExitAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: FileHistoryAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/FileHistoryAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileHistoryAction.java 15 Sep 2003 22:37:13 -0000 1.7 --- FileHistoryAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 21,25 **** public class FileHistoryAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class FileHistoryAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: FileHistoryActionTop.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/FileHistoryActionTop.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FileHistoryActionTop.java 15 Sep 2003 22:37:13 -0000 1.8 --- FileHistoryActionTop.java 13 Dec 2003 21:29:34 -0000 1.9 *************** *** 22,26 **** public class FileHistoryActionTop extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 22,26 ---- public class FileHistoryActionTop extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: NewAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/NewAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NewAction.java 15 Sep 2003 22:37:13 -0000 1.8 --- NewAction.java 13 Dec 2003 21:29:34 -0000 1.9 *************** *** 21,25 **** public class NewAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class NewAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: OpenAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/OpenAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** OpenAction.java 15 Sep 2003 22:37:13 -0000 1.8 --- OpenAction.java 13 Dec 2003 21:29:34 -0000 1.9 *************** *** 21,25 **** public class OpenAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class OpenAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: OpenWorkspaceAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/OpenWorkspaceAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OpenWorkspaceAction.java 27 Nov 2003 00:51:44 -0000 1.1 --- OpenWorkspaceAction.java 13 Dec 2003 21:29:34 -0000 1.2 *************** *** 1,41 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.action.file; ! ! import java.util.ResourceBundle; ! ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class OpenWorkspaceAction extends CommandAction ! { ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); ! ! ! /** ! * Constructor for the CopyAction object ! * ! * @param command Description of Parameter ! */ ! public OpenWorkspaceAction(Command command) ! { ! super(command, resources, "action.file.open.workspace"); ! this.setMenu("action.file"); ! this.setToolBar(true); ! this.setSmallIcon("/toolbarButtonGraphics/general/Open16.gif"); ! this.setIcon("/toolbarButtonGraphics/general/Open24.gif"); ! } ! } ! --- 1,41 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.action.file; ! ! import java.util.ResourceBundle; ! ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class OpenWorkspaceAction extends CommandAction ! { ! /** Resource Bundle */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); ! ! ! /** ! * Constructor for the CopyAction object ! * ! * @param command Description of Parameter ! */ ! public OpenWorkspaceAction(Command command) ! { ! super(command, resources, "action.file.open.workspace"); ! this.setMenu("action.file"); ! this.setToolBar(true); ! this.setSmallIcon("/toolbarButtonGraphics/general/Open16.gif"); ! this.setIcon("/toolbarButtonGraphics/general/Open24.gif"); ! } ! } ! Index: PrintAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/PrintAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PrintAction.java 15 Sep 2003 22:37:13 -0000 1.7 --- PrintAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 21,25 **** public class PrintAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class PrintAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: SaveAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/SaveAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SaveAction.java 15 Sep 2003 22:37:13 -0000 1.8 --- SaveAction.java 13 Dec 2003 21:29:34 -0000 1.9 *************** *** 21,25 **** public class SaveAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class SaveAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: SaveAsAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/SaveAsAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SaveAsAction.java 15 Sep 2003 22:37:13 -0000 1.7 --- SaveAsAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 21,25 **** public class SaveAsAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class SaveAsAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: SaveAsWorkspaceAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/SaveAsWorkspaceAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SaveAsWorkspaceAction.java 27 Nov 2003 00:51:44 -0000 1.1 --- SaveAsWorkspaceAction.java 13 Dec 2003 21:29:34 -0000 1.2 *************** *** 1,38 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.action.file; ! ! import java.util.ResourceBundle; ! ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class SaveAsWorkspaceAction extends CommandAction ! { ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); ! ! ! /** ! * Constructor for the CopyAction object ! * ! * @param command Description of Parameter ! */ ! public SaveAsWorkspaceAction(Command command) ! { ! super(command, resources, "action.file.save.workspace.as"); ! this.setMenu("action.file"); ! } ! } ! --- 1,38 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.action.file; ! ! import java.util.ResourceBundle; ! ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class SaveAsWorkspaceAction extends CommandAction ! { ! /** Resource Bundle */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); ! ! ! /** ! * Constructor for the CopyAction object ! * ! * @param command Description of Parameter ! */ ! public SaveAsWorkspaceAction(Command command) ! { ! super(command, resources, "action.file.save.workspace.as"); ! this.setMenu("action.file"); ! } ! } ! Index: SaveWorkspaceAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file/SaveWorkspaceAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SaveWorkspaceAction.java 27 Nov 2003 00:51:44 -0000 1.1 --- SaveWorkspaceAction.java 13 Dec 2003 21:29:34 -0000 1.2 *************** *** 1,41 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.action.file; ! ! import java.util.ResourceBundle; ! ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class SaveWorkspaceAction extends CommandAction ! { ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); ! ! ! /** ! * Constructor for the CopyAction object ! * ! * @param command Description of Parameter ! */ ! public SaveWorkspaceAction(Command command) ! { ! super(command, resources, "action.file.save.workspace"); ! this.setMenu("action.file"); ! this.setToolBar(true); ! this.setSmallIcon("/toolbarButtonGraphics/general/Save16.gif"); ! this.setIcon("/toolbarButtonGraphics/general/Save24.gif"); ! } ! } ! --- 1,41 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.action.file; ! ! import java.util.ResourceBundle; ! ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class SaveWorkspaceAction extends CommandAction ! { ! /** Resource Bundle */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); ! ! ! /** ! * Constructor for the CopyAction object ! * ! * @param command Description of Parameter ! */ ! public SaveWorkspaceAction(Command command) ! { ! super(command, resources, "action.file.save.workspace"); ! this.setMenu("action.file"); ! this.setToolBar(true); ! this.setSmallIcon("/toolbarButtonGraphics/general/Save16.gif"); ! this.setIcon("/toolbarButtonGraphics/general/Save24.gif"); ! } ! } ! |
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/window In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/action/window Modified Files: CascadeAction.java CloseAction.java CloseAllAction.java InternalFrameAction.java TileAction.java Log Message: Add more javadocs. Add package.html files. Index: CascadeAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/window/CascadeAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CascadeAction.java 15 Sep 2003 22:37:13 -0000 1.8 --- CascadeAction.java 13 Dec 2003 21:29:34 -0000 1.9 *************** *** 21,25 **** public class CascadeAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class CascadeAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: CloseAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/window/CloseAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CloseAction.java 15 Sep 2003 22:37:13 -0000 1.7 --- CloseAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 21,25 **** public class CloseAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class CloseAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: CloseAllAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/window/CloseAllAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CloseAllAction.java 15 Sep 2003 22:37:13 -0000 1.8 --- CloseAllAction.java 13 Dec 2003 21:29:34 -0000 1.9 *************** *** 22,26 **** public class CloseAllAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 22,26 ---- public class CloseAllAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: InternalFrameAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/window/InternalFrameAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** InternalFrameAction.java 15 Sep 2003 22:37:13 -0000 1.7 --- InternalFrameAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 24,28 **** public class InternalFrameAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 24,28 ---- public class InternalFrameAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: TileAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/window/TileAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TileAction.java 15 Sep 2003 22:37:13 -0000 1.8 --- TileAction.java 13 Dec 2003 21:29:34 -0000 1.9 *************** *** 21,25 **** public class TileAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class TileAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); |
From: <let...@us...> - 2003-12-14 10:50:02
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/editor Modified Files: ArrayEditor.java ClassEditor.java CollectionEditor.java DateTimeEditor.java GenericEditor.java IteratorEditor.java ListEditor.java NumberEditor.java ObjectNameEditor.java URLEditor.java Log Message: Add more javadocs. Add package.html files. Index: ArrayEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/ArrayEditor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ArrayEditor.java 15 Sep 2003 22:37:13 -0000 1.6 --- ArrayEditor.java 13 Dec 2003 21:29:34 -0000 1.7 *************** *** 1,139 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.awt.Component; ! import java.awt.GridLayout; ! import java.beans.PropertyChangeEvent; ! import java.beans.PropertyChangeListener; ! import java.beans.PropertyEditor; ! ! import javax.swing.JLabel; ! import javax.swing.JPanel; ! ! import org.ejtools.beans.CustomPropertyEditorManager; ! ! import com.dreambean.awt.GenericPropertyCustomizer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class ArrayEditor extends GenericEditor ! { ! /** Description of the Field */ ! protected Object[] array = new Object[0]; ! /** Description of the Field */ ! protected Class clazz = null; ! /** Description of the Field */ ! protected JPanel panel = null; ! ! ! /** ! * Constructor for ArrayEditor. ! * ! * @param clazz Description of the Parameter ! */ ! public ArrayEditor(Class clazz) ! { ! this.clazz = clazz; ! this.panel = new JPanel(); ! } ! ! ! /** ! * @return The customEditor value ! */ ! public Component getCustomEditor() ! { ! return this.panel; ! } ! ! ! /** ! * @param value The new value value ! */ ! public void setValue(Object value) ! { ! super.setValue(value); ! if (this.value == null) ! { ! return; ! } ! this.array = (Object[]) this.value; ! this.buildPanel(); ! } ! ! ! /** ! * @return Description of the Return Value ! */ ! public boolean supportsCustomEditor() ! { ! return true; ! } ! ! ! /** Description of the Method */ ! private void buildPanel() ! { ! this.panel.removeAll(); ! ! PropertyEditor editor = CustomPropertyEditorManager.findEditor(this.clazz); ! if (editor == null) ! { ! editor = CustomPropertyEditorManager.findEditor(String.class); ! } ! ! this.panel = new JPanel(new GridLayout(this.array.length, 1)); ! for (int i = 0; i < this.array.length; i++) ! { ! try ! { ! PropertyEditor peInstance = (PropertyEditor) editor.getClass().newInstance(); ! peInstance.setValue(array[i]); ! ! Object component; ! ! if (peInstance.supportsCustomEditor()) ! { ! component = peInstance.getCustomEditor(); ! } ! else ! { ! String as[] = peInstance.getTags(); ! if (as != null) ! { ! component = new GenericPropertyCustomizer(peInstance, as); ! } ! else ! { ! final JLabel label = new JLabel(peInstance.getAsText()); ! final PropertyEditor pcEditor = peInstance; ! component = label; ! pcEditor.addPropertyChangeListener( ! new PropertyChangeListener() ! { ! public void propertyChange(PropertyChangeEvent evt) ! { ! label.setText(pcEditor.getAsText()); ! } ! }); ! } ! } ! this.panel.add((Component) component); ! } ! catch (Exception exception) ! { ! exception.printStackTrace(); ! } ! } ! ! this.panel.validate(); ! this.panel.repaint(); ! } ! } --- 1,139 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.awt.Component; ! import java.awt.GridLayout; ! import java.beans.PropertyChangeEvent; ! import java.beans.PropertyChangeListener; ! import java.beans.PropertyEditor; ! ! import javax.swing.JLabel; ! import javax.swing.JPanel; ! ! import org.ejtools.beans.CustomPropertyEditorManager; ! ! import com.dreambean.awt.GenericPropertyCustomizer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class ArrayEditor extends GenericEditor ! { ! /** Description of the Field */ ! protected Object[] array = new Object[0]; ! /** Description of the Field */ ! protected Class clazz = null; ! /** Description of the Field */ ! protected JPanel panel = null; ! ! ! /** ! * Constructor for ArrayEditor. ! * ! * @param clazz Description of the Parameter ! */ ! public ArrayEditor(Class clazz) ! { ! this.clazz = clazz; ! this.panel = new JPanel(); ! } ! ! ! /** ! * @return The customEditor value ! */ ! public Component getCustomEditor() ! { ! return this.panel; ! } ! ! ! /** ! * @param value The new value value ! */ ! public void setValue(Object value) ! { ! super.setValue(value); ! if (this.value == null) ! { ! return; ! } ! this.array = (Object[]) this.value; ! this.buildPanel(); ! } ! ! ! /** ! * @return Description of the Return Value ! */ ! public boolean supportsCustomEditor() ! { ! return true; ! } ! ! ! /** Description of the Method */ ! private void buildPanel() ! { ! this.panel.removeAll(); ! ! PropertyEditor editor = CustomPropertyEditorManager.findEditor(this.clazz); ! if (editor == null) ! { ! editor = CustomPropertyEditorManager.findEditor(String.class); ! } ! ! this.panel = new JPanel(new GridLayout(this.array.length, 1)); ! for (int i = 0; i < this.array.length; i++) ! { ! try ! { ! PropertyEditor peInstance = (PropertyEditor) editor.getClass().newInstance(); ! peInstance.setValue(array[i]); ! ! Object component; ! ! if (peInstance.supportsCustomEditor()) ! { ! component = peInstance.getCustomEditor(); ! } ! else ! { ! String as[] = peInstance.getTags(); ! if (as != null) ! { ! component = new GenericPropertyCustomizer(peInstance, as); ! } ! else ! { ! final JLabel label = new JLabel(peInstance.getAsText()); ! final PropertyEditor pcEditor = peInstance; ! component = label; ! pcEditor.addPropertyChangeListener( ! new PropertyChangeListener() ! { ! public void propertyChange(PropertyChangeEvent evt) ! { ! label.setText(pcEditor.getAsText()); ! } ! }); ! } ! } ! this.panel.add((Component) component); ! } ! catch (Exception exception) ! { ! exception.printStackTrace(); ! } ! } ! ! this.panel.validate(); ! this.panel.repaint(); ! } ! } Index: ClassEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/ClassEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ClassEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- ClassEditor.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,62 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ClassEditor extends GenericEditor ! { ! /** Constructor */ ! public ClassEditor() ! { ! this.value = Class.class; ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value ! */ ! public String getAsText() ! { ! if (this.value != null) ! { ! return ((Class) this.value).getName(); ! } ! else ! { ! return null; ! } ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value ! */ ! public void setAsText(String s) ! { ! try ! { ! this.value = Thread.currentThread().getContextClassLoader().loadClass(s); ! } ! catch (Exception e) ! { ! } ! this.firePropertyChange(); ! } ! } ! --- 1,62 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ClassEditor extends GenericEditor ! { ! /** Constructor */ ! public ClassEditor() ! { ! this.value = Class.class; ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value ! */ ! public String getAsText() ! { ! if (this.value != null) ! { ! return ((Class) this.value).getName(); ! } ! else ! { ! return null; ! } ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value ! */ ! public void setAsText(String s) ! { ! try ! { ! this.value = Thread.currentThread().getContextClassLoader().loadClass(s); ! } ! catch (Exception e) ! { ! } ! this.firePropertyChange(); ! } ! } ! Index: CollectionEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/CollectionEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CollectionEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- CollectionEditor.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,68 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.StringTokenizer; ! import java.util.Vector; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Swing editor to complete ! */ ! public class CollectionEditor extends GenericEditor ! { ! /** Constructor for the PropertiesEditor object */ ! public CollectionEditor() ! { ! this.value = new Vector(); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value of asText attribute ! */ ! public String getAsText() ! { ! String result = ""; ! Iterator iterator = ((Collection) this.value).iterator(); ! while (iterator.hasNext()) ! { ! result = result + iterator.next(); ! if (iterator.hasNext()) ! { ! result = result + ","; ! } ! } ! return result; ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value for asText attribute ! */ ! public void setAsText(String s) ! { ! StringTokenizer st = new StringTokenizer(s, ","); ! this.value = new Vector(); ! while (st.hasMoreTokens()) ! { ! ((Collection) this.value).add(st.nextToken()); ! } ! this.firePropertyChange(); ! } ! ! } --- 1,68 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.StringTokenizer; ! import java.util.Vector; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Swing editor to complete ! */ ! public class CollectionEditor extends GenericEditor ! { ! /** Constructor for the PropertiesEditor object */ ! public CollectionEditor() ! { ! this.value = new Vector(); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value of asText attribute ! */ ! public String getAsText() ! { ! String result = ""; ! Iterator iterator = ((Collection) this.value).iterator(); ! while (iterator.hasNext()) ! { ! result = result + iterator.next(); ! if (iterator.hasNext()) ! { ! result = result + ","; ! } ! } ! return result; ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value for asText attribute ! */ ! public void setAsText(String s) ! { ! StringTokenizer st = new StringTokenizer(s, ","); ! this.value = new Vector(); ! while (st.hasMoreTokens()) ! { ! ((Collection) this.value).add(st.nextToken()); ! } ! this.firePropertyChange(); ! } ! ! } Index: DateTimeEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/DateTimeEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DateTimeEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- DateTimeEditor.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,84 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.text.DateFormat; ! import java.text.ParseException; ! import java.text.SimpleDateFormat; ! import java.util.Date; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DateTimeEditor extends GenericEditor ! { ! /** Description of the Field */ ! protected DateFormat fmts[]; ! ! ! /** Constructor for the DateEditor object */ ! public DateTimeEditor() ! { ! fmts = new DateFormat[5]; ! fmts[0] = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); ! fmts[1] = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); ! fmts[2] = new SimpleDateFormat("yyyy-MM-dd HH:mm"); ! fmts[3] = new SimpleDateFormat("yyMMdd HH:mm:ss"); ! fmts[4] = new SimpleDateFormat("yyMMdd HH:mm"); ! } ! ! ! /** ! * Gets the asText attribute of the DateEditor object ! * ! * @return The asText value ! */ ! public String getAsText() ! { ! if (this.value != null) ! { ! return this.fmts[0].format((Date) this.value); ! } ! else ! { ! return ""; ! } ! } ! ! ! /** ! * Sets the asText attribute of the DateEditor object ! * ! * @param s The new asText value ! */ ! public void setAsText(String s) ! { ! if (s.equals("")) ! { ! this.value = null; ! return; ! } ! for (int i = 0; i < fmts.length; i++) ! { ! try ! { ! this.value = fmts[i].parse(s); ! this.firePropertyChange(); ! return; ! } ! catch (ParseException pe) ! { ! // Do nothing ! } ! } ! } ! } ! --- 1,84 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.text.DateFormat; ! import java.text.ParseException; ! import java.text.SimpleDateFormat; ! import java.util.Date; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DateTimeEditor extends GenericEditor ! { ! /** Description of the Field */ ! protected DateFormat fmts[]; ! ! ! /** Constructor for the DateEditor object */ ! public DateTimeEditor() ! { ! fmts = new DateFormat[5]; ! fmts[0] = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); ! fmts[1] = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); ! fmts[2] = new SimpleDateFormat("yyyy-MM-dd HH:mm"); ! fmts[3] = new SimpleDateFormat("yyMMdd HH:mm:ss"); ! fmts[4] = new SimpleDateFormat("yyMMdd HH:mm"); ! } ! ! ! /** ! * Gets the asText attribute of the DateEditor object ! * ! * @return The asText value ! */ ! public String getAsText() ! { ! if (this.value != null) ! { ! return this.fmts[0].format((Date) this.value); ! } ! else ! { ! return ""; ! } ! } ! ! ! /** ! * Sets the asText attribute of the DateEditor object ! * ! * @param s The new asText value ! */ ! public void setAsText(String s) ! { ! if (s.equals("")) ! { ! this.value = null; ! return; ! } ! for (int i = 0; i < fmts.length; i++) ! { ! try ! { ! this.value = fmts[i].parse(s); ! this.firePropertyChange(); ! return; ! } ! catch (ParseException pe) ! { ! // Do nothing ! } ! } ! } ! } ! Index: GenericEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/GenericEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GenericEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- GenericEditor.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,53 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.beans.PropertyEditorSupport; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public abstract class GenericEditor extends PropertyEditorSupport ! { ! /** Description of the Field */ ! protected Object value = null; ! ! ! /** Constructor for the PropertiesEditor object */ ! public GenericEditor() { } ! ! ! /** ! * Gets the value attribute of the FileEditor object ! * ! * @return The value value ! */ ! public Object getValue() ! { ! return this.value; ! } ! ! ! /** ! * Setter for the value attribute ! * ! * @param object The new value value ! */ ! public void setValue(Object object) ! { ! if (object == null) ! { ! return; ! } ! this.value = object; ! this.firePropertyChange(); ! } ! } --- 1,53 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.beans.PropertyEditorSupport; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public abstract class GenericEditor extends PropertyEditorSupport ! { ! /** Description of the Field */ ! protected Object value = null; ! ! ! /** Constructor for the PropertiesEditor object */ ! public GenericEditor() { } ! ! ! /** ! * Gets the value attribute of the FileEditor object ! * ! * @return The value value ! */ ! public Object getValue() ! { ! return this.value; ! } ! ! ! /** ! * Setter for the value attribute ! * ! * @param object The new value value ! */ ! public void setValue(Object object) ! { ! if (object == null) ! { ! return; ! } ! this.value = object; ! this.firePropertyChange(); ! } ! } Index: IteratorEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/IteratorEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IteratorEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- IteratorEditor.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,67 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.util.Iterator; ! import java.util.StringTokenizer; ! import java.util.Vector; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Swing editor to complete ! */ ! public class IteratorEditor extends GenericEditor ! { ! /** Constructor for the PropertiesEditor object */ ! public IteratorEditor() ! { ! this.value = (new Vector()).iterator(); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value of asText attribute ! */ ! public String getAsText() ! { ! String result = ""; ! Iterator iterator = (Iterator) this.value; ! while (iterator.hasNext()) ! { ! result = result + iterator.next(); ! if (iterator.hasNext()) ! { ! result = result + ","; ! } ! } ! return result; ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value for asText attribute ! */ ! public void setAsText(String s) ! { ! StringTokenizer st = new StringTokenizer(s, ","); ! Vector parsed = new Vector(); ! while (st.hasMoreTokens()) ! { ! parsed.add(st.nextToken()); ! } ! this.value = parsed.iterator(); ! this.firePropertyChange(); ! } ! } --- 1,67 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.util.Iterator; ! import java.util.StringTokenizer; ! import java.util.Vector; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Swing editor to complete ! */ ! public class IteratorEditor extends GenericEditor ! { ! /** Constructor for the PropertiesEditor object */ ! public IteratorEditor() ! { ! this.value = (new Vector()).iterator(); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value of asText attribute ! */ ! public String getAsText() ! { ! String result = ""; ! Iterator iterator = (Iterator) this.value; ! while (iterator.hasNext()) ! { ! result = result + iterator.next(); ! if (iterator.hasNext()) ! { ! result = result + ","; ! } ! } ! return result; ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value for asText attribute ! */ ! public void setAsText(String s) ! { ! StringTokenizer st = new StringTokenizer(s, ","); ! Vector parsed = new Vector(); ! while (st.hasMoreTokens()) ! { ! parsed.add(st.nextToken()); ! } ! this.value = parsed.iterator(); ! this.firePropertyChange(); ! } ! } Index: ListEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/ListEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ListEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- ListEditor.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,20 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Swing editor to complete ! */ ! public class ListEditor extends GenericEditor ! { ! } --- 1,20 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Swing editor to complete ! */ ! public class ListEditor extends GenericEditor ! { ! } Index: NumberEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/NumberEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NumberEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- NumberEditor.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,87 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class NumberEditor extends GenericEditor ! { ! /** Description of the Field */ ! protected Class clazz = Number.class; ! ! ! /** Constructor */ ! public NumberEditor() ! { ! this.value = new Integer(0); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value ! */ ! public String getAsText() ! { ! return value.toString(); ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value ! */ ! public void setAsText(String s) ! { ! if (this.clazz.equals(Integer.class)) ! { ! this.value = new Integer(s); ! } ! else if (this.clazz.equals(Float.class)) ! { ! this.value = new Float(s); ! } ! else if (this.clazz.equals(Double.class)) ! { ! this.value = new Double(s); ! } ! else if (this.clazz.equals(Byte.class)) ! { ! this.value = new Byte(s); ! } ! else if (this.clazz.equals(Short.class)) ! { ! this.value = new Short(s); ! } ! else if (this.clazz.equals(Long.class)) ! { ! this.value = new Long(s); ! } ! this.firePropertyChange(); ! } ! ! ! /** ! * Setter for the value attribute ! * ! * @param object The new value value ! */ ! public void setValue(Object object) ! { ! super.setValue(object); ! this.clazz = object.getClass(); ! } ! } ! --- 1,87 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class NumberEditor extends GenericEditor ! { ! /** Description of the Field */ ! protected Class clazz = Number.class; ! ! ! /** Constructor */ ! public NumberEditor() ! { ! this.value = new Integer(0); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value ! */ ! public String getAsText() ! { ! return value.toString(); ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value ! */ ! public void setAsText(String s) ! { ! if (this.clazz.equals(Integer.class)) ! { ! this.value = new Integer(s); ! } ! else if (this.clazz.equals(Float.class)) ! { ! this.value = new Float(s); ! } ! else if (this.clazz.equals(Double.class)) ! { ! this.value = new Double(s); ! } ! else if (this.clazz.equals(Byte.class)) ! { ! this.value = new Byte(s); ! } ! else if (this.clazz.equals(Short.class)) ! { ! this.value = new Short(s); ! } ! else if (this.clazz.equals(Long.class)) ! { ! this.value = new Long(s); ! } ! this.firePropertyChange(); ! } ! ! ! /** ! * Setter for the value attribute ! * ! * @param object The new value value ! */ ! public void setValue(Object object) ! { ! super.setValue(object); ! this.clazz = object.getClass(); ! } ! } ! Index: ObjectNameEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/ObjectNameEditor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ObjectNameEditor.java 15 Sep 2003 22:37:13 -0000 1.6 --- ObjectNameEditor.java 13 Dec 2003 21:29:34 -0000 1.7 *************** *** 1,175 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.awt.Component; ! import java.awt.Container; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.awt.event.FocusAdapter; ! import java.awt.event.FocusEvent; ! import java.util.ResourceBundle; ! ! import javax.management.ObjectName; ! import javax.swing.JButton; ! import javax.swing.JPanel; ! import javax.swing.JTextField; ! import javax.swing.SwingUtilities; ! ! import org.ejtools.adwt.util.ObjectSearcher; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ObjectNameEditor extends GenericEditor ! { ! /** Description of the Field */ ! protected JButton button; ! /** Description of the Field */ ! protected Container panel; ! /** Description of the Field */ ! protected JTextField text; ! /** Description of the Field */ ! private final static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.editor.Resources"); ! ! ! /** Constructor */ ! public ObjectNameEditor() ! { ! this.text = new JTextField(30); ! ! // Update value when edited ! this.text.addFocusListener( ! new FocusAdapter() ! { ! public void focusLost(FocusEvent e) ! { ! setAsText(text.getText()); ! } ! } ! ); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value ! */ ! public String getAsText() ! { ! if (this.value != null) ! { ! return ((ObjectName) this.value).getCanonicalName(); ! } ! return ""; ! } ! ! ! /** ! * Gets the customEditor attribute of the ObjectNameEditor object ! * ! * @return The customEditor value ! */ ! public Component getCustomEditor() ! { ! if (Boolean.getBoolean("ejtools.objectname.hyperlink")) ! { ! if (this.panel == null) ! { ! GridBagConstraints gridbagconstraints = new GridBagConstraints(); ! ! this.panel = new JPanel(); ! this.panel.setLayout(new GridBagLayout()); ! this.button = new JButton(resources.getString("ObjectNameEditor.button.view")); ! ! gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! this.panel.add(button, gridbagconstraints); ! ! gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! gridbagconstraints.weightx = 1.0; ! gridbagconstraints.fill = GridBagConstraints.HORIZONTAL; ! this.panel.add(text, gridbagconstraints); ! ! this.button.addActionListener( ! new ActionListener() ! { ! /** ! * @param e Event action ! */ ! public void actionPerformed(ActionEvent e) ! { ! ObjectSearcher finder = (ObjectSearcher) SwingUtilities.getAncestorOfClass(ObjectSearcher.class, ObjectNameEditor.this.panel); ! if ((finder != null) && (ObjectNameEditor.this.value != null)) ! { ! finder.find(ObjectNameEditor.this.getAsText()); ! } ! } ! } ! ); ! } ! return this.panel; ! } ! else ! { ! return this.text; ! } ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value ! */ ! public void setAsText(String s) ! { ! try ! { ! this.value = new ObjectName(s); ! } ! catch (Exception e) ! { ! this.value = null; ! } ! this.text.setText(this.getAsText()); ! this.firePropertyChange(); ! } ! ! ! /** ! * Setter for the value attribute ! * ! * @param object The new value value ! */ ! public void setValue(Object object) ! { ! super.setValue(object); ! if (this.value != null) ! { ! this.text.setText(this.getAsText()); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public boolean supportsCustomEditor() ! { ! return true; ! } ! } ! --- 1,175 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.awt.Component; ! import java.awt.Container; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.awt.event.FocusAdapter; ! import java.awt.event.FocusEvent; ! import java.util.ResourceBundle; ! ! import javax.management.ObjectName; ! import javax.swing.JButton; ! import javax.swing.JPanel; ! import javax.swing.JTextField; ! import javax.swing.SwingUtilities; ! ! import org.ejtools.adwt.util.ObjectSearcher; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ObjectNameEditor extends GenericEditor ! { ! /** Description of the Field */ ! protected JButton button; ! /** Description of the Field */ ! protected Container panel; ! /** Description of the Field */ ! protected JTextField text; ! /** Description of the Field */ ! private final static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.editor.Resources"); ! ! ! /** Constructor */ ! public ObjectNameEditor() ! { ! this.text = new JTextField(30); ! ! // Update value when edited ! this.text.addFocusListener( ! new FocusAdapter() ! { ! public void focusLost(FocusEvent e) ! { ! setAsText(text.getText()); ! } ! } ! ); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value ! */ ! public String getAsText() ! { ! if (this.value != null) ! { ! return ((ObjectName) this.value).getCanonicalName(); ! } ! return ""; ! } ! ! ! /** ! * Gets the customEditor attribute of the ObjectNameEditor object ! * ! * @return The customEditor value ! */ ! public Component getCustomEditor() ! { ! if (Boolean.getBoolean("ejtools.objectname.hyperlink")) ! { ! if (this.panel == null) ! { ! GridBagConstraints gridbagconstraints = new GridBagConstraints(); ! ! this.panel = new JPanel(); ! this.panel.setLayout(new GridBagLayout()); ! this.button = new JButton(resources.getString("ObjectNameEditor.button.view")); ! ! gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! this.panel.add(button, gridbagconstraints); ! ! gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! gridbagconstraints.weightx = 1.0; ! gridbagconstraints.fill = GridBagConstraints.HORIZONTAL; ! this.panel.add(text, gridbagconstraints); ! ! this.button.addActionListener( ! new ActionListener() ! { ! /** ! * @param e Event action ! */ ! public void actionPerformed(ActionEvent e) ! { ! ObjectSearcher finder = (ObjectSearcher) SwingUtilities.getAncestorOfClass(ObjectSearcher.class, ObjectNameEditor.this.panel); ! if ((finder != null) && (ObjectNameEditor.this.value != null)) ! { ! finder.find(ObjectNameEditor.this.getAsText()); ! } ! } ! } ! ); ! } ! return this.panel; ! } ! else ! { ! return this.text; ! } ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value ! */ ! public void setAsText(String s) ! { ! try ! { ! this.value = new ObjectName(s); ! } ! catch (Exception e) ! { ! this.value = null; ! } ! this.text.setText(this.getAsText()); ! this.firePropertyChange(); ! } ! ! ! /** ! * Setter for the value attribute ! * ! * @param object The new value value ! */ ! public void setValue(Object object) ! { ! super.setValue(object); ! if (this.value != null) ! { ! this.text.setText(this.getAsText()); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public boolean supportsCustomEditor() ! { ! return true; ! } ! } ! Index: URLEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/URLEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** URLEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- URLEditor.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,59 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.net.URL; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class URLEditor extends GenericEditor ! { ! /** Constructor */ ! public URLEditor() { } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value ! */ ! public String getAsText() ! { ! if (this.value != null) ! { ! return value.toString(); ! } ! else ! { ! return null; ! } ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value ! */ ! public void setAsText(String s) ! { ! try ! { ! value = new URL(s); ! } ! catch (Exception e) ! { ! } ! this.firePropertyChange(); ! } ! } ! --- 1,59 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.net.URL; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class URLEditor extends GenericEditor ! { ! /** Constructor */ ! public URLEditor() { } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value ! */ ! public String getAsText() ! { ! if (this.value != null) ! { ! return value.toString(); ! } ! else ! { ! return null; ! } ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value ! */ ! public void setAsText(String s) ! { ! try ! { ! value = new URL(s); ! } ! catch (Exception e) ! { ! } ! this.firePropertyChange(); ! } ! } ! |
From: <let...@us...> - 2003-12-14 10:50:01
|
Update of /cvsroot/ejtools/libraries/adwt/src/test/test/adwt/action In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/test/test/adwt/action Modified Files: ActionTest.java Added Files: FR_fr_ActionTest.java US_en_ActionTest.java Log Message: Add more javadocs. Add package.html files. --- NEW FILE: FR_fr_ActionTest.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package test.adwt.action; import java.util.Locale; /** * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public class FR_fr_ActionTest extends ActionTest { /** Constructor for the ActionTest object */ public FR_fr_ActionTest() { super(); } /** * Constructor for the ActionTest object * * @param name Description of the Parameter */ public FR_fr_ActionTest(String name) { super(name); } /** A unit test for JUnit */ public void testInstantiation() { Locale locale = new Locale("fr", "FR"); this.doTestInstantiation(locale); } } --- NEW FILE: US_en_ActionTest.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package test.adwt.action; import java.util.Locale; /** * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public class US_en_ActionTest extends ActionTest { /** Constructor for the ActionTest object */ public US_en_ActionTest() { super(); } /** * Constructor for the ActionTest object * * @param name Description of the Parameter */ public US_en_ActionTest(String name) { super(name); } /** A unit test for JUnit */ public void testInstantiation() { Locale locale = new Locale("", ""); this.doTestInstantiation(locale); } } Index: ActionTest.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/test/test/adwt/action/ActionTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ActionTest.java 27 Nov 2003 00:51:45 -0000 1.3 --- ActionTest.java 13 Dec 2003 21:29:35 -0000 1.4 *************** *** 7,10 **** --- 7,16 ---- package test.adwt.action; + import java.awt.event.ActionEvent; + import java.util.Locale; + + import javax.swing.JMenuItem; + import javax.swing.JRadioButtonMenuItem; + import org.ejtools.adwt.action.Command; import org.ejtools.adwt.action.CommandAction; *************** *** 30,33 **** --- 36,41 ---- import org.ejtools.adwt.action.help.HelpOnLineAction; import org.ejtools.adwt.action.help.TOTDAction; + import org.ejtools.adwt.action.tools.ExportAction; + import org.ejtools.adwt.action.tools.ImportAction; import org.ejtools.adwt.action.view.ShowConsoleAction; import org.ejtools.adwt.action.window.CascadeAction; *************** *** 36,39 **** --- 44,48 ---- import org.ejtools.adwt.action.window.InternalFrameAction; import org.ejtools.adwt.action.window.TileAction; + import org.ejtools.adwt.service.MenuBarService; import junit.framework.TestCase; *************** *** 45,49 **** public class ActionTest extends TestCase { ! /**Constructor for the ActionTest object */ public ActionTest() { --- 54,62 ---- public class ActionTest extends TestCase { ! /** Description of the Field */ ! protected int value = 0; ! ! ! /** Constructor for the ActionTest object */ public ActionTest() { *************** *** 53,57 **** /** ! *Constructor for the ActionTest object * * @param name Description of the Parameter --- 66,70 ---- /** ! * Constructor for the ActionTest object * * @param name Description of the Parameter *************** *** 64,70 **** /** A unit test for JUnit */ ! public void testInstantiation() { CommandAction action = null; Command command = new Command() --- 77,124 ---- /** A unit test for JUnit */ ! public void testCommandAction() { CommandAction action = null; + CommandAction childAction = null; + + Command command = + new Command() + { + public void execute() + { + value = 99; + } + }; + + action = new NewAction(command); + childAction = new NewAction(command); + + assertEquals("Must contains no child", action.size(), 0); + action.add(childAction); + assertEquals("Must contains one child", action.size(), 1); + action.remove(childAction); + assertEquals("Must contains no child", action.size(), 0); + + assertEquals("Values must be equal", value, 0); + action.actionPerformed(new ActionEvent(this, 0, "TEST")); + assertEquals("Values must be equal", value, 99); + + assertEquals("ToolBar presence must be the same", action.getToolBar(), true); + assertEquals("Menu must be the same", action.getMenu(), "action.file"); + assertEquals("Menu layout must be the same", action.getMenuLayout(), MenuBarService.NO_LAYOUT); + assertEquals("Item classes must be the same", action.getMenuItem().getClass(), JMenuItem.class); + } + + + /** + * Description of the Method + * + * @param locale Description of the Parameter + */ + protected void doTestInstantiation(Locale locale) + { + Locale.setDefault(locale); + + CommandAction action = null; Command command = new Command() *************** *** 79,144 **** action = new RefreshAction(command); assertNotNull("Action must be not null", action); // Package org.ejtools.adwt.action.edit action = new CopyAction(command); assertNotNull("Action must be not null", action); action = new CutAction(command); assertNotNull("Action must be not null", action); action = new DeleteAction(command); assertNotNull("Action must be not null", action); action = new DeselectAllAction(command); assertNotNull("Action must be not null", action); action = new PasteAction(command); assertNotNull("Action must be not null", action); action = new SelectAllAction(command); assertNotNull("Action must be not null", action); // Package org.ejtools.adwt.action.file action = new ExitAction(command); assertNotNull("Action must be not null", action); action = new FileHistoryAction(command); assertNotNull("Action must be not null", action); action = new FileHistoryActionTop(command); assertNotNull("Action must be not null", action); action = new NewAction(command); assertNotNull("Action must be not null", action); action = new OpenAction(command); assertNotNull("Action must be not null", action); action = new PrintAction(command); assertNotNull("Action must be not null", action); action = new SaveAction(command); assertNotNull("Action must be not null", action); action = new SaveAsAction(command); assertNotNull("Action must be not null", action); ! action = new OpenWorkspaceAction(command); assertNotNull("Action must be not null", action); action = new SaveWorkspaceAction(command); assertNotNull("Action must be not null", action); ! action = new SaveAsWorkspaceAction(command); ! assertNotNull("Action must be not null", action); // Package org.ejtools.adwt.action.help action = new AboutAction(command); assertNotNull("Action must be not null", action); action = new HelpOnLineAction(command); assertNotNull("Action must be not null", action); action = new TOTDAction(command); assertNotNull("Action must be not null", action); // Package org.ejtools.adwt.action.view action = new ShowConsoleAction(command); assertNotNull("Action must be not null", action); // Package org.ejtools.adwt.action.help action = new CascadeAction(command); assertNotNull("Action must be not null", action); action = new CloseAction(command); assertNotNull("Action must be not null", action); action = new CloseAllAction(command); assertNotNull("Action must be not null", action); action = new InternalFrameAction(command); assertNotNull("Action must be not null", action); action = new TileAction(command); assertNotNull("Action must be not null", action); } } --- 133,235 ---- action = new RefreshAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); // Package org.ejtools.adwt.action.edit action = new CopyAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new CutAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new DeleteAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new DeselectAllAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new PasteAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new SelectAllAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); // Package org.ejtools.adwt.action.file action = new ExitAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new FileHistoryAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new FileHistoryActionTop(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new NewAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new OpenAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); + action = new OpenWorkspaceAction(command); + assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new PrintAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new SaveAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new SaveAsAction(command); assertNotNull("Action must be not null", action); ! assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); ! action = new SaveAsWorkspaceAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new SaveWorkspaceAction(command); assertNotNull("Action must be not null", action); ! assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); // Package org.ejtools.adwt.action.help action = new AboutAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new HelpOnLineAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new TOTDAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); + + // Package org.ejtools.adwt.action.tools + action = new ExportAction(command); + assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); + action = new ImportAction(command); + assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); // Package org.ejtools.adwt.action.view action = new ShowConsoleAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); // Package org.ejtools.adwt.action.help action = new CascadeAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new CloseAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new CloseAllAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); action = new InternalFrameAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); + assertEquals("Action must have a JRadioButtonMenuItem item", action.getMenuItem().getClass(), JRadioButtonMenuItem.class); + assertEquals("Action must have a JRadioButtonMenuItem item", action.getMenuItem().getClass(), JRadioButtonMenuItem.class); action = new TileAction(command); assertNotNull("Action must be not null", action); + assertEquals("Locale must be the same", action.getResourceBundle().getLocale(), locale); } } |
From: <let...@us...> - 2003-12-14 10:49:51
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax In directory sc8-pr-cvs1:/tmp/cvs-serv3310/src/main/javax Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax added to the repository |
From: <let...@us...> - 2003-12-14 10:49:50
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi/factories In directory sc8-pr-cvs1:/tmp/cvs-serv4179/src/main/javax/enterprise/deploy/spi/factories Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi/factories added to the repository |
From: <let...@us...> - 2003-12-14 10:42:56
|
Update of /cvsroot/ejtools/thirdparty/sourceforge/jrefactory In directory sc8-pr-cvs1:/tmp/cvs-serv29834/sourceforge/jrefactory Modified Files: LICENSE VERSION Log Message: Add licenses for each used library. Index: LICENSE =================================================================== RCS file: /cvsroot/ejtools/thirdparty/sourceforge/jrefactory/LICENSE,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LICENSE 5 Apr 2003 13:18:31 -0000 1.3 --- LICENSE 13 Dec 2003 20:48:27 -0000 1.4 *************** *** 1,48 **** ! /* ! * ============================================================================ ! * The Apache Software License, Version 1.1 ! * ============================================================================ ! * ! * Copyright (C) 1999 The Apache Software Foundation. All rights reserved. ! * ! * Redistribution and use in source and binary forms, with or without modifica- ! * tion, are permitted provided that the following conditions are met: ! * ! * 1. Redistributions of source code must retain the above copyright notice, ! * this list of conditions and the following disclaimer. ! * ! * 2. Redistributions in binary form must reproduce the above copyright notice, ! * this list of conditions and the following disclaimer in the documentation ! * and/or other materials provided with the distribution. ! * ! * 3. The end-user documentation included with the redistribution, if any, must ! * include the following acknowledgment: "This product includes software ! * developed by the Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, if ! * and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Ant" and "Apache Software Foundation" must not be used to ! * endorse or promote products derived from this software without prior ! * written permission. For written permission, please contact ! * ap...@ap.... ! * ! * 5. Products derived from this software may not be called "Apache", nor may ! * "Apache" appear in their name, without prior written permission of the ! * Apache Software Foundation. ! * ! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, ! * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ! * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ! * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, ! * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- ! * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS ! * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ! * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ! * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ! * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! * ! * This software consists of voluntary contributions made by many individuals ! * on behalf of the Apache Software Foundation. For more information on the ! * Apache Software Foundation, please see <http://www.apache.org/>. ! * ! */ --- 1,48 ---- ! /* ! * ============================================================================ ! * The Apache Software License, Version 1.1 ! * ============================================================================ ! * ! * Copyright (C) 1999 The Apache Software Foundation. All rights reserved. ! * ! * Redistribution and use in source and binary forms, with or without modifica- ! * tion, are permitted provided that the following conditions are met: ! * ! * 1. Redistributions of source code must retain the above copyright notice, ! * this list of conditions and the following disclaimer. ! * ! * 2. Redistributions in binary form must reproduce the above copyright notice, ! * this list of conditions and the following disclaimer in the documentation ! * and/or other materials provided with the distribution. ! * ! * 3. The end-user documentation included with the redistribution, if any, must ! * include the following acknowledgment: "This product includes software ! * developed by the Apache Software Foundation (http://www.apache.org/)." ! * Alternately, this acknowledgment may appear in the software itself, if ! * and wherever such third-party acknowledgments normally appear. ! * ! * 4. The names "Ant" and "Apache Software Foundation" must not be used to ! * endorse or promote products derived from this software without prior ! * written permission. For written permission, please contact ! * ap...@ap.... ! * ! * 5. Products derived from this software may not be called "Apache", nor may ! * "Apache" appear in their name, without prior written permission of the ! * Apache Software Foundation. ! * ! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, ! * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ! * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ! * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, ! * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- ! * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS ! * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ! * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ! * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ! * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! * ! * This software consists of voluntary contributions made by many individuals ! * on behalf of the Apache Software Foundation. For more information on the ! * Apache Software Foundation, please see <http://www.apache.org/>. ! * ! */ Index: VERSION =================================================================== RCS file: /cvsroot/ejtools/thirdparty/sourceforge/jrefactory/VERSION,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VERSION 5 Apr 2003 13:18:31 -0000 1.4 --- VERSION 13 Dec 2003 20:48:27 -0000 1.5 *************** *** 1 **** ! 2.6.37 --- 1 ---- ! 2.6.37 |
From: <let...@us...> - 2003-12-14 10:42:55
|
Update of /cvsroot/ejtools/xdocs/templates In directory sc8-pr-cvs1:/tmp/cvs-serv2776/templates Modified Files: index.xml navigation.xml Added Files: download.xml Log Message: More fun on the website : - sublink for library - download page - correct links --- NEW FILE: download.xml --- <?xml version="1.0" encoding="ISO-8859-1"?> <!-- # ================================================================================ # EJTools, the Enterprise Java Tools # # Distributable under LGPL license. # See terms of license at gnu.org. # # $Revision: 1.1 $ # ================================================================================ --> <document> <properties> <title>Download</title> </properties> <body> <section name="Download"> <p>You can download the EJTools suite from the <a href="http://sourceforge.net/project/showfiles.php?group_id=49088">Sourceforge download pages</a>.</p> <p>Here is the current status of the EJTools suite :</p> <center> <table width="90%"> <tr> <th width="75%">Application</th> <th width="25%">Current Release</th> </tr> #foreach ($reactorProject in $reactorApplicationsProjects) <tr> <td> <a href="${reactorProject.url}/index.html">${reactorProject.name}</a> </td> <td>${reactorProject.currentVersion}</td> </tr> #end </table> </center> </section> <section name="Source Snapshot"> <p>A nightly snapshot of the code base is available for download <a href="/snapshot.tar.gz">here</a>.</p> </section> </body> </document> Index: index.xml =================================================================== RCS file: /cvsroot/ejtools/xdocs/templates/index.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.xml 6 Aug 2003 12:36:32 -0000 1.4 --- index.xml 13 Dec 2003 20:54:07 -0000 1.5 *************** *** 11,50 **** --> <document> ! <properties> ! <title>Front Page</title> ! </properties> ! <body> ! <section name="What is EJTools ?"> ! <p>EJTools is a collection of WEB-based and GUI-based tools related to the J2EE platform, and especially the JBoss J2EE Server. This includes a JNDI space browser, a JMX browser, a management application (related to JSR77 from SUN), a deployment application (related to JSR88 from SUN), and others.</p> ! <p>The EJTools project purpose is to provide cutting-edge tools to J2EE developpers and administrators. This project is closely related to JBoss Server, because it is free and very cool to test J2EE applications with.</p> ! <p>The EJTools suite is composed of the following tools :<ul> ! <li>JMX Browser : a tool which allows to view and interact with the JMX space in a J2EE Server.</li> ! <li>JNDI Browser : a tool which allows to view and interact with the JNDI userspace.</li> ! <li>Management Tool : a tool which allows to view and interact with a JSR77 compliant J2EE server.</li> ! <li>Deployment Tool : an client implementation of the JSR88 API (not available).</li> ! </ul> ! </p> ! </section> ! <section name="Download"> ! <p>You can download the EJTools suite from the <a href="http://sourceforge.net/project/showfiles.php?group_id=49088">Sourceforge download pages</a>.</p> ! <p>A nightly snapshot of the code base is available <a href="/snapshot.tar.gz">here</a>.</p> ! <p>Here is the current status of the EJTools suite :</p> ! <center> ! <table width="75%"> ! <tr> ! <th width="75%">Application</th> ! <th width="25%">Current Release</th> ! </tr> #foreach ($reactorProject in $reactorApplicationsProjects) <tr> ! <td> ! <a href="${reactorProject.url}/index.html">${reactorProject.name}</a> ! </td> ! <td>${reactorProject.currentVersion}</td> ! </tr> #end </table> ! </center> ! </section> ! </body> </document> --- 11,47 ---- --> <document> ! <properties> ! <title>Front Page</title> ! </properties> ! <body> ! <section name="What is EJTools ?"> ! <p>EJTools is a collection of WEB-based and GUI-based tools related to the J2EE platform, and especially the JBoss J2EE Server. This includes a JNDI space browser, a JMX browser, a management application (related to JSR77 from SUN), a deployment application (related to JSR88 from SUN), and others.</p> ! <p>The EJTools project purpose is to provide cutting-edge tools to J2EE developpers and administrators. This project is closely related to JBoss Server, because it is free and very cool to test J2EE applications with.</p> ! <p>The EJTools suite is composed of the following tools :</p> ! <!-- ! <ul> ! <li>JMX Browser : a tool which allows to view and interact with the JMX space in a J2EE Server.</li> ! <li>JNDI Browser : a tool which allows to view and interact with the JNDI userspace.</li> ! <li>Management Tool : a tool which allows to view and interact with a JSR77 compliant J2EE server.</li> ! <li>Deployment Tool : an client implementation of the JSR88 API (not available).</li> ! </ul> ! --> ! <center> ! <table width="90%"> ! <tr> ! <th width="30%">Application</th> ! <th width="70%">Description</th> ! </tr> #foreach ($reactorProject in $reactorApplicationsProjects) <tr> ! <td> ! <a href="${reactorProject.url}/index.html">${reactorProject.name}</a> ! </td> ! <td>${reactorProject.description}</td> ! </tr> #end </table> ! </center> ! </section> ! </body> </document> Index: navigation.xml =================================================================== RCS file: /cvsroot/ejtools/xdocs/templates/navigation.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** navigation.xml 15 Sep 2003 21:17:25 -0000 1.4 --- navigation.xml 13 Dec 2003 20:54:07 -0000 1.5 *************** *** 11,46 **** --> <project name="EJTools : the Enterprise Java Tools"> ! <title>EJTools : the Enterprise Java Tools</title> ! <body> ! <links> ! <!--item name="Home Page" href="${pom.organization.url}"/--> ! <item name="SourceForge Project Page" href="${pom.url}"/> ! <item name="Browse CVS" href="${pom.repository.url}"/> ! <item name="Report an Issue" href="${pom.issueTrackingUrl}"/> ! </links> ! <menu name="Overview"> ! <item name="Front Page" href="/index.html"/> ! <item name="News and Status" href="/status.html"/> ! <item name="Look & Feel" href="/look_and_feel.html"/> ! <item name="License" href="/license.html"/> ! </menu> ! <menu name="Applications"> #foreach ($reactorProject in $reactorApplicationsProjects) <item name="$reactorProject.name" href="${reactorProject.url}/index.html" collapse="true"> ! <item name="Details" href="${reactorProject.url}/details.html"/> ! <item name="FAQs" href="${reactorProject.url}/faq.html"/> ! <item name="Screenshots" href="${reactorProject.url}/screenshots.html"/> ! </item> #end </menu> ! <menu name="Libraries"> #foreach ($reactorProject in $reactorLibrariesProjects) ! <item name="$reactorProject.name" href="${reactorProject.url}/index.html"/> #end </menu> ! <menu name="Developer Resources"> ! <item name="Developer Guide" href="/development/index.html"/> ! <item name="Project Layout" href="/development/layout.html"/> ! </menu> ! </body> </project> --- 11,72 ---- --> <project name="EJTools : the Enterprise Java Tools"> ! <title>EJTools : the Enterprise Java Tools</title> ! <body> ! <links> ! <!--item name="Home Page" href="${pom.organization.url}"/--> ! <item name="SourceForge Project Page" href="${pom.url}"/> ! <item name="Browse CVS" href="${pom.repository.url}"/> ! <item name="Report an Issue" href="${pom.issueTrackingUrl}"/> ! </links> ! <menu name="Overview"> ! <item name="Front Page" href="/index.html"/> ! <item name="Download" href="/download.html"/> ! <item name="News and Status" href="/status.html"/> ! <item name="License" href="/license.html"/> ! </menu> ! <menu name="Applications"> #foreach ($reactorProject in $reactorApplicationsProjects) <item name="$reactorProject.name" href="${reactorProject.url}/index.html" collapse="true"> ! <item name="Details" href="${reactorProject.url}/details.html"/> ! <item name="Screenshots" href="${reactorProject.url}/screenshots.html"/> ! <item name="FAQs" href="${reactorProject.url}/faq.html"/> ! <!-- ! <item name="Manual" href="${reactorProject.url}/manual.html"/> ! --> ! </item> #end </menu> ! <menu name="Libraries"> #foreach ($reactorProject in $reactorLibrariesProjects) ! <item name="$reactorProject.name" href="${reactorProject.url}/index.html" collapse="true"> ! #set ( $apidocs = "${reactorProject.id}.apidocs" ) ! #set ( $junit = "${reactorProject.id}.junit" ) ! #if ( $context.getVariable( $apidocs ) == 'present' ) ! <!-- $context.getVariable( 'maven.ejtools.doc.apidocs' ) --> ! #if ( $context.getVariable( 'ejtools.doc.apidocs' ) == 'true' ) ! <item name="Javadocs" href="${reactorProject.url}/apidocs/index.html"/> ! #end ! <!-- $context.getVariable( 'maven.ejtools.doc.xref' ) --> ! #if ( $context.getVariable( 'ejtools.doc.xref' ) == 'true' ) ! <item name="Sources" href="${reactorProject.url}/xref/index.html"/> ! #end ! #end ! #if ( $context.getVariable( $junit ) == 'present' ) ! <!-- $context.getVariable( 'maven.ejtools.doc.junit' ) --> ! #if ( $context.getVariable( 'ejtools.doc.junit' ) == 'true' ) ! <item name="Test Reports" href="${reactorProject.url}/junit-report.html"/> ! #end ! <!-- $context.getVariable( 'maven.ejtools.doc.clover' ) --> ! #if ( $context.getVariable( 'ejtools.doc.clover' ) == 'true' ) ! <item name="Test Coverage" href="${reactorProject.url}/clover/index.html"/> ! #end ! #end ! </item> #end </menu> ! <menu name="Developer Resources"> ! <item name="Developer Guide" href="/development/index.html"/> ! <item name="Project Layout" href="/development/layout.html"/> ! </menu> ! </body> </project> |
From: <let...@us...> - 2003-12-14 10:42:54
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/view In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/action/view Modified Files: ShowConsoleAction.java Log Message: Add more javadocs. Add package.html files. Index: ShowConsoleAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/view/ShowConsoleAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ShowConsoleAction.java 15 Sep 2003 22:37:13 -0000 1.4 --- ShowConsoleAction.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 21,25 **** public class ShowConsoleAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class ShowConsoleAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); |
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/service Modified Files: AboutService.java AboutServiceProvider.java BeanContextInternalFrame.java ConsoleService.java ConsoleServiceInternalFrame.java ConsoleServiceProvider.java FrameService.java FrameServiceProvider.java MDIFrameService.java MDIFrameServiceProvider.java MenuBarServiceProvider.java PreferencesService.java SDIFrameService.java SDIFrameServiceProvider.java StatusBarService.java StatusBarServiceProvider.java ToolBarService.java Log Message: Add more javadocs. Add package.html files. Index: AboutService.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/AboutService.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AboutService.java 15 Sep 2003 22:37:14 -0000 1.4 --- AboutService.java 13 Dec 2003 21:29:35 -0000 1.5 *************** *** 1,34 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.Container; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface AboutService ! { ! /** ! * Description of the Method ! * ! * @return The value of panel attribute ! */ ! public Container getPanel(); ! ! ! /** ! * Getter for the title attribute ! * ! * @return The value of title attribute ! */ ! public String getTitle(); ! } --- 1,34 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.Container; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface AboutService ! { ! /** ! * Description of the Method ! * ! * @return The value of panel attribute ! */ ! public Container getPanel(); ! ! ! /** ! * Getter for the title attribute ! * ! * @return The value of title attribute ! */ ! public String getTitle(); ! } Index: AboutServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/AboutServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AboutServiceProvider.java 15 Sep 2003 22:37:14 -0000 1.4 --- AboutServiceProvider.java 13 Dec 2003 21:29:35 -0000 1.5 *************** *** 1,208 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.BorderLayout; ! import java.awt.Color; ! import java.awt.Container; ! import java.awt.GridLayout; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.JFrame; ! import javax.swing.JLabel; ! import javax.swing.JOptionPane; ! import javax.swing.JPanel; ! import javax.swing.SwingConstants; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.help.AboutAction; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo I18N to complete ! */ ! public class AboutServiceProvider extends CustomBeanContextServiceProvider implements AboutService ! { ! /** Description of the Field */ ! protected JPanel panel = null; ! /** Description of the Field */ ! protected AboutService service = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(AboutServiceProvider.class); ! ! ! /** Constructor for the AboutServiceProvider object */ ! public AboutServiceProvider() ! { ! this.service = this; ! } ! ! ! /** ! * Constructor for the AboutServiceProvider object ! * ! * @param service Description of Parameter ! */ ! public AboutServiceProvider(AboutService service) ! { ! this.service = service; ! } ! ! ! /** ! * Gets the currentServiceSelectors attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param serviceClass Description of Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return (new Vector().iterator()); ! } ! ! ! /** ! * Gets the panel attribute of the AboutServiceProvider object ! * ! * @return The panel value ! */ ! public Container getPanel() ! { ! if (this.panel == null) ! { ! this.createPanel(); ! } ! return this.panel; ! } ! ! ! /** ! * Gets the service attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return this.service; ! } ! ! ! /** ! * Getter for the title attribute ! * ! * @return The value of title attribute ! * @todo I18N ! */ ! public String getTitle() ! { ! return "About Service"; ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param service Description of Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * Description of the Method ! * ! * @todo I18N ! */ ! protected void createPanel() ! { ! this.panel = new JPanel(new BorderLayout()); ! ! // North part ! this.panel.add("North", new JLabel("Insert your logo here")); ! ! // Center part ! this.panel.add("Center", new JLabel("This is the default AboutService")); ! ! // South part ! JPanel info = new JPanel(new GridLayout(2, 1)); ! JLabel java = new JLabel("Java version:" + System.getProperty("java.version"), SwingConstants.CENTER); ! java.setForeground(Color.black); ! info.add(java); ! JLabel vm = new JLabel("VM:" + System.getProperty("java.vm.name") + ", " + System.getProperty("java.vm.version"), SwingConstants.CENTER); ! vm.setForeground(Color.black); ! info.add(vm); ! this.panel.add("South", info); ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{AboutService.class}; ! } ! ! ! /** */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! // Add the About button ! this.add(new AboutAction( ! new Command() ! { ! public void execute() ! { ! AboutServiceProvider.this.show(); ! } ! } ! )); ! ! logger.debug("AboutService added"); ! } ! ! ! /** Description of the Method */ ! protected void show() ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! ! if (context.hasService(FrameService.class)) ! { ! logger.debug("Using service FrameService..."); ! try ! { ! FrameService fservice = (FrameService) context.getService(this, this, FrameService.class, this, this); ! JFrame frame = (JFrame) fservice.getContainer(); ! // I18N Todo ! JOptionPane.showMessageDialog(frame, service.getPanel(), service.getTitle(), JOptionPane.PLAIN_MESSAGE); ! context.releaseService(this, this, FrameService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation ofgetBeanContext() service FrameService (" + e.getMessage() + ")"); ! } ! } ! } ! } ! --- 1,208 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.BorderLayout; ! import java.awt.Color; ! import java.awt.Container; ! import java.awt.GridLayout; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.JFrame; ! import javax.swing.JLabel; ! import javax.swing.JOptionPane; ! import javax.swing.JPanel; ! import javax.swing.SwingConstants; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.help.AboutAction; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo I18N to complete ! */ ! public class AboutServiceProvider extends CustomBeanContextServiceProvider implements AboutService ! { ! /** Description of the Field */ ! protected JPanel panel = null; ! /** Description of the Field */ ! protected AboutService service = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(AboutServiceProvider.class); ! ! ! /** Constructor for the AboutServiceProvider object */ ! public AboutServiceProvider() ! { ! this.service = this; ! } ! ! ! /** ! * Constructor for the AboutServiceProvider object ! * ! * @param service Description of Parameter ! */ ! public AboutServiceProvider(AboutService service) ! { ! this.service = service; ! } ! ! ! /** ! * Gets the currentServiceSelectors attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param serviceClass Description of Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return (new Vector().iterator()); ! } ! ! ! /** ! * Gets the panel attribute of the AboutServiceProvider object ! * ! * @return The panel value ! */ ! public Container getPanel() ! { ! if (this.panel == null) ! { ! this.createPanel(); ! } ! return this.panel; ! } ! ! ! /** ! * Gets the service attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return this.service; ! } ! ! ! /** ! * Getter for the title attribute ! * ! * @return The value of title attribute ! * @todo I18N ! */ ! public String getTitle() ! { ! return "About Service"; ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param service Description of Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * Description of the Method ! * ! * @todo I18N ! */ ! protected void createPanel() ! { ! this.panel = new JPanel(new BorderLayout()); ! ! // North part ! this.panel.add("North", new JLabel("Insert your logo here")); ! ! // Center part ! this.panel.add("Center", new JLabel("This is the default AboutService")); ! ! // South part ! JPanel info = new JPanel(new GridLayout(2, 1)); ! JLabel java = new JLabel("Java version:" + System.getProperty("java.version"), SwingConstants.CENTER); ! java.setForeground(Color.black); ! info.add(java); ! JLabel vm = new JLabel("VM:" + System.getProperty("java.vm.name") + ", " + System.getProperty("java.vm.version"), SwingConstants.CENTER); ! vm.setForeground(Color.black); ! info.add(vm); ! this.panel.add("South", info); ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{AboutService.class}; ! } ! ! ! /** */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! // Add the About button ! this.add(new AboutAction( ! new Command() ! { ! public void execute() ! { ! AboutServiceProvider.this.show(); ! } ! } ! )); ! ! logger.debug("AboutService added"); ! } ! ! ! /** Description of the Method */ ! protected void show() ! { ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! ! if (context.hasService(FrameService.class)) ! { ! logger.debug("Using service FrameService..."); ! try ! { ! FrameService fservice = (FrameService) context.getService(this, this, FrameService.class, this, this); ! JFrame frame = (JFrame) fservice.getContainer(); ! // I18N Todo ! JOptionPane.showMessageDialog(frame, service.getPanel(), service.getTitle(), JOptionPane.PLAIN_MESSAGE); ! context.releaseService(this, this, FrameService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation ofgetBeanContext() service FrameService (" + e.getMessage() + ")"); ! } ! } ! } ! } ! Index: BeanContextInternalFrame.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/BeanContextInternalFrame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BeanContextInternalFrame.java 15 Sep 2003 22:37:14 -0000 1.5 --- BeanContextInternalFrame.java 13 Dec 2003 21:29:35 -0000 1.6 *************** *** 1,271 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.Component; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextServices; ! ! import javax.swing.Action; ! import javax.swing.JInternalFrame; ! import javax.swing.event.InternalFrameEvent; ! import javax.swing.event.InternalFrameListener; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! import org.ejtools.adwt.action.window.InternalFrameAction; ! import org.ejtools.beans.beancontext.CustomBeanContextServicesSupport; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class BeanContextInternalFrame extends CustomBeanContextServicesSupport implements InternalFrameListener ! { ! /** Description of the Field */ ! protected CommandAction action; ! /** Description of the Field */ ! protected JInternalFrame frame; ! /** Description of the Field */ ! protected MDIFrameService service; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(BeanContextInternalFrame.class); ! ! ! /** Constructor for the BeanContextInternalFrame object */ ! public BeanContextInternalFrame() ! { ! super(); ! ! this.frame = new JInternalFrame("", true, true, true, true); ! this.frame.addInternalFrameListener(this); ! ! this.action = new InternalFrameAction( ! new Command() ! { ! public void execute() ! { ! BeanContextInternalFrame.this.activate(); ! } ! }); ! } ! ! ! /** Description of the Method */ ! public void activate() ! { ! try ! { ! if (this.service != null) ! { ! this.service.activate(this); ! } ! if (this.action != null) ! { ! this.action.getMenuItem().setSelected(true); ! } ! } ! catch (Exception e) ! { ! // Do nothing ! } ! } ! ! ! /** Description of the Method */ ! public void close() ! { ! this.frame.doDefaultCloseAction(); ! } ! ! ! /** ! * Gets the action attribute of the BeanContextInternalFrame object ! * ! * @return The action value ! */ ! public CommandAction getAction() ! { ! return this.action; ! } ! ! ! /** ! * Gets the component attribute of the BeanContextInternalFrame object ! * ! * @return The component value ! */ ! public Component getComponent() ! { ! return this.frame; ! } ! ! ! /** ! * Gets the title attribute of the BeanContextInternalFrame object ! * ! * @return The title value ! */ ! public String getTitle() ! { ! return this.frame.getTitle(); ! } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameActivated(InternalFrameEvent event) ! { ! this.activate(); ! } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameClosed(InternalFrameEvent event) ! { ! BeanContext context = this.getBeanContext(); ! if (context != null) ! { ! context.remove(this); ! } ! } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameClosing(InternalFrameEvent event) { } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameDeactivated(InternalFrameEvent event) { } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameDeiconified(InternalFrameEvent event) { } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameIconified(InternalFrameEvent event) { } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameOpened(InternalFrameEvent event) { } ! ! ! /** ! * Sets the title attribute of the BeanContextInternalFrame object ! * ! * @param title The new title value ! */ ! public void setTitle(String title) ! { ! this.frame.setTitle(title); ! this.action.putValue(Action.NAME, title); ! } ! ! ! /** Description of the Method */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! logger.debug("In initializeBeanContextResources"); ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! this.useServices(context); ! ! if (this.service != null) ! { ! this.service.register(this); ! } ! ! context.add(action); ! ! this.activate(); ! } ! ! ! /** Description of the Method */ ! protected void releaseBeanContextResources() ! { ! logger.debug("In releaseBeanContextResources"); ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! ! if (this.service != null) ! { ! this.service.unregister(this); ! } ! ! context.remove(action); ! this.releaseServices(context); ! ! super.releaseBeanContextResources(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! protected void releaseServices(BeanContextServices context) ! { ! if (context.hasService(MDIFrameService.class)) ! { ! logger.debug("Using service MDIFrameService..."); ! try ! { ! context.releaseService(this, this, MDIFrameService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service MDIFrameService (" + e.getMessage() + ")"); ! e.printStackTrace(); ! } ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! protected void useServices(BeanContextServices context) ! { ! if (context.hasService(MDIFrameService.class)) ! { ! logger.debug("Using service MDIFrameService..."); ! try ! { ! this.service = (MDIFrameService) context.getService(this, this, MDIFrameService.class, this.frame, this); ! logger.debug("Service MDIFrameService registered"); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service MDIFrameService (" + e.getMessage() + ")"); ! e.printStackTrace(); ! } ! } ! } ! ! } --- 1,271 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.Component; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextServices; ! ! import javax.swing.Action; ! import javax.swing.JInternalFrame; ! import javax.swing.event.InternalFrameEvent; ! import javax.swing.event.InternalFrameListener; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! import org.ejtools.adwt.action.window.InternalFrameAction; ! import org.ejtools.beans.beancontext.CustomBeanContextServicesSupport; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class BeanContextInternalFrame extends CustomBeanContextServicesSupport implements InternalFrameListener ! { ! /** Description of the Field */ ! protected CommandAction action; ! /** Description of the Field */ ! protected JInternalFrame frame; ! /** Description of the Field */ ! protected MDIFrameService service; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(BeanContextInternalFrame.class); ! ! ! /** Constructor for the BeanContextInternalFrame object */ ! public BeanContextInternalFrame() ! { ! super(); ! ! this.frame = new JInternalFrame("", true, true, true, true); ! this.frame.addInternalFrameListener(this); ! ! this.action = new InternalFrameAction( ! new Command() ! { ! public void execute() ! { ! BeanContextInternalFrame.this.activate(); ! } ! }); ! } ! ! ! /** Description of the Method */ ! public void activate() ! { ! try ! { ! if (this.service != null) ! { ! this.service.activate(this); ! } ! if (this.action != null) ! { ! this.action.getMenuItem().setSelected(true); ! } ! } ! catch (Exception e) ! { ! // Do nothing ! } ! } ! ! ! /** Description of the Method */ ! public void close() ! { ! this.frame.doDefaultCloseAction(); ! } ! ! ! /** ! * Gets the action attribute of the BeanContextInternalFrame object ! * ! * @return The action value ! */ ! public CommandAction getAction() ! { ! return this.action; ! } ! ! ! /** ! * Gets the component attribute of the BeanContextInternalFrame object ! * ! * @return The component value ! */ ! public Component getComponent() ! { ! return this.frame; ! } ! ! ! /** ! * Gets the title attribute of the BeanContextInternalFrame object ! * ! * @return The title value ! */ ! public String getTitle() ! { ! return this.frame.getTitle(); ! } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameActivated(InternalFrameEvent event) ! { ! this.activate(); ! } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameClosed(InternalFrameEvent event) ! { ! BeanContext context = this.getBeanContext(); ! if (context != null) ! { ! context.remove(this); ! } ! } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameClosing(InternalFrameEvent event) { } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameDeactivated(InternalFrameEvent event) { } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameDeiconified(InternalFrameEvent event) { } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameIconified(InternalFrameEvent event) { } ! ! ! /** ! * @param event Description of the Parameter ! */ ! public void internalFrameOpened(InternalFrameEvent event) { } ! ! ! /** ! * Sets the title attribute of the BeanContextInternalFrame object ! * ! * @param title The new title value ! */ ! public void setTitle(String title) ! { ! this.frame.setTitle(title); ! this.action.putValue(Action.NAME, title); ! } ! ! ! /** Description of the Method */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! logger.debug("In initializeBeanContextResources"); ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! this.useServices(context); ! ! if (this.service != null) ! { ! this.service.register(this); ! } ! ! context.add(action); ! ! this.activate(); ! } ! ! ! /** Description of the Method */ ! protected void releaseBeanContextResources() ! { ! logger.debug("In releaseBeanContextResources"); ! BeanContextServices context = (BeanContextServices) getBeanContext(); ! ! if (this.service != null) ! { ! this.service.unregister(this); ! } ! ! context.remove(action); ! this.releaseServices(context); ! ! super.releaseBeanContextResources(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! protected void releaseServices(BeanContextServices context) ! { ! if (context.hasService(MDIFrameService.class)) ! { ! logger.debug("Using service MDIFrameService..."); ! try ! { ! context.releaseService(this, this, MDIFrameService.class); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service MDIFrameService (" + e.getMessage() + ")"); ! e.printStackTrace(); ! } ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! */ ! protected void useServices(BeanContextServices context) ! { ! if (context.hasService(MDIFrameService.class)) ! { ! logger.debug("Using service MDIFrameService..."); ! try ! { ! this.service = (MDIFrameService) context.getService(this, this, MDIFrameService.class, this.frame, this); ! logger.debug("Service MDIFrameService registered"); ! } ! catch (Exception e) ! { ! logger.error("Error during utilisation of service MDIFrameService (" + e.getMessage() + ")"); ! e.printStackTrace(); ! } ! } ! } ! ! } Index: ConsoleService.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/ConsoleService.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConsoleService.java 15 Sep 2003 22:37:14 -0000 1.4 --- ConsoleService.java 13 Dec 2003 21:29:35 -0000 1.5 *************** *** 1,42 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface ConsoleService ! { ! /** ! * Description of the Method ! * ! * @param message Description of the Parameter ! */ ! public void append(String message); ! ! ! /** Description of the Method */ ! public void delete(); ! ! ! /** Description of the Method */ ! public void copy(); ! ! ! /** Description of the Method */ ! public void cut(); ! ! ! /** Description of the Method */ ! public void show(); ! ! ! /** Description of the Method */ ! public void hide(); ! } --- 1,42 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface ConsoleService ! { ! /** ! * Description of the Method ! * ! * @param message Description of the Parameter ! */ ! public void append(String message); ! ! ! /** Description of the Method */ ! public void delete(); ! ! ! /** Description of the Method */ ! public void copy(); ! ! ! /** Description of the Method */ ! public void cut(); ! ! ! /** Description of the Method */ ! public void show(); ! ! ! /** Description of the Method */ ! public void hide(); ! } Index: ConsoleServiceInternalFrame.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/ConsoleServiceInternalFrame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConsoleServiceInternalFrame.java 15 Sep 2003 22:37:14 -0000 1.5 --- ConsoleServiceInternalFrame.java 13 Dec 2003 21:29:35 -0000 1.6 *************** *** 1,146 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.BorderLayout; ! import java.beans.beancontext.BeanContext; ! import java.util.ResourceBundle; ! ! import javax.swing.JMenuBar; ! import javax.swing.JScrollPane; ! import javax.swing.JTextArea; ! ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.edit.CopyAction; ! import org.ejtools.adwt.action.edit.CutAction; ! import org.ejtools.adwt.action.edit.DeleteAction; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class ConsoleServiceInternalFrame extends BeanContextInternalFrame implements ConsoleService ! { ! /** Description of the Field */ ! protected BeanContext context = null; ! /** Description of the Field */ ! protected MenuBarServiceProvider menubarProvider; ! /** Description of the Field */ ! protected JTextArea textarea = null; ! /** Description of the Field */ ! protected ToolBarServiceProvider toolbarProvider; ! /** Description of the Field */ ! private final static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.service.ConsoleService"); ! ! ! /** ! * Constructor for ConsoleServiceInternalFrame. ! * ! * @param context Description of the Parameter ! */ ! public ConsoleServiceInternalFrame(BeanContext context) ! { ! super(); ! this.context = context; ! this.textarea = new JTextArea(); ! ! this.menubarProvider = new MenuBarServiceProvider(); ! this.toolbarProvider = new ToolBarServiceProvider(); ! ! this.add(this.toolbarProvider); ! this.add(this.menubarProvider); ! ! this.add(new CutAction( ! new Command() ! { ! /** */ ! public void execute() ! { ! ConsoleServiceInternalFrame.this.cut(); ! } ! })); ! ! this.add(new CopyAction( ! new Command() ! { ! /** */ ! public void execute() ! { ! ConsoleServiceInternalFrame.this.copy(); ! } ! })); ! ! this.add(new DeleteAction( ! new Command() ! { ! /** */ ! public void execute() ! { ! ConsoleServiceInternalFrame.this.delete(); ! } ! })); ! ! this.frame.setJMenuBar((JMenuBar) this.menubarProvider.getContainer()); ! this.frame.getContentPane().add(BorderLayout.NORTH, this.toolbarProvider.getContainer()); ! this.frame.getContentPane().add(BorderLayout.CENTER, new JScrollPane(this.textarea)); ! ! this.setTitle(resources.getString("frame.title")); ! } ! ! ! /** ! * @param message Description of the Parameter ! */ ! public void append(String message) ! { ! this.textarea.append(message); ! this.textarea.append("\n"); ! this.show(); ! } ! ! ! /** */ ! public void copy() ! { ! this.textarea.copy(); ! } ! ! ! /** */ ! public void cut() ! { ! this.textarea.cut(); ! } ! ! ! /** */ ! public void delete() ! { ! this.textarea.setText(""); ! } ! ! ! /** */ ! public void hide() ! { ! if (this.context.contains(this)) ! { ! this.close(); ! } ! } ! ! ! /** */ ! public void show() ! { ! if (!this.context.contains(this)) ! { ! this.context.add(this); ! } ! this.activate(); ! } ! } --- 1,146 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.BorderLayout; ! import java.beans.beancontext.BeanContext; ! import java.util.ResourceBundle; ! ! import javax.swing.JMenuBar; ! import javax.swing.JScrollPane; ! import javax.swing.JTextArea; ! ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.edit.CopyAction; ! import org.ejtools.adwt.action.edit.CutAction; ! import org.ejtools.adwt.action.edit.DeleteAction; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class ConsoleServiceInternalFrame extends BeanContextInternalFrame implements ConsoleService ! { ! /** Description of the Field */ ! protected BeanContext context = null; ! /** Description of the Field */ ! protected MenuBarServiceProvider menubarProvider; ! /** Description of the Field */ ! protected JTextArea textarea = null; ! /** Description of the Field */ ! protected ToolBarServiceProvider toolbarProvider; ! /** Description of the Field */ ! private final static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.service.ConsoleService"); ! ! ! /** ! * Constructor for ConsoleServiceInternalFrame. ! * ! * @param context Description of the Parameter ! */ ! public ConsoleServiceInternalFrame(BeanContext context) ! { ! super(); ! this.context = context; ! this.textarea = new JTextArea(); ! ! this.menubarProvider = new MenuBarServiceProvider(); ! this.toolbarProvider = new ToolBarServiceProvider(); ! ! this.add(this.toolbarProvider); ! this.add(this.menubarProvider); ! ! this.add(new CutAction( ! new Command() ! { ! /** */ ! public void execute() ! { ! ConsoleServiceInternalFrame.this.cut(); ! } ! })); ! ! this.add(new CopyAction( ! new Command() ! { ! /** */ ! public void execute() ! { ! ConsoleServiceInternalFrame.this.copy(); ! } ! })); ! ! this.add(new DeleteAction( ! new Command() ! { ! /** */ ! public void execute() ! { ! ConsoleServiceInternalFrame.this.delete(); ! } ! })); ! ! this.frame.setJMenuBar((JMenuBar) this.menubarProvider.getContainer()); ! this.frame.getContentPane().add(BorderLayout.NORTH, this.toolbarProvider.getContainer()); ! this.frame.getContentPane().add(BorderLayout.CENTER, new JScrollPane(this.textarea)); ! ! this.setTitle(resources.getString("frame.title")); ! } ! ! ! /** ! * @param message Description of the Parameter ! */ ! public void append(String message) ! { ! this.textarea.append(message); ! this.textarea.append("\n"); ! this.show(); ! } ! ! ! /** */ ! public void copy() ! { ! this.textarea.copy(); ! } ! ! ! /** */ ! public void cut() ! { ! this.textarea.cut(); ! } ! ! ! /** */ ! public void delete() ! { ! this.textarea.setText(""); ! } ! ! ! /** */ ! public void hide() ! { ! if (this.context.contains(this)) ! { ! this.close(); ! } ! } ! ! ! /** */ ! public void show() ! { ! if (!this.context.contains(this)) ! { ! this.context.add(this); ! } ! this.activate(); ! } ! } Index: ConsoleServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/ConsoleServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConsoleServiceProvider.java 15 Sep 2003 22:37:14 -0000 1.4 --- ConsoleServiceProvider.java 13 Dec 2003 21:29:35 -0000 1.5 *************** *** 1,117 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.view.ShowConsoleAction; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo I18N to complete ! */ ! public class ConsoleServiceProvider extends CustomBeanContextServiceProvider ! { ! /** Description of the Field */ ! protected ConsoleService service = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ConsoleServiceProvider.class); ! ! ! /** Constructor for the AboutServiceProvider object */ ! public ConsoleServiceProvider() ! { ! super(); ! } ! ! ! /** ! * Gets the currentServiceSelectors attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return (new Vector().iterator()); ! } ! ! ! /** ! * Gets the service attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @param serviceSelector Description of the Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return this.service; ! } ! ! ! /** ! * Returns the service. ! * ! * @return ConsoleService ! */ ! public ConsoleService getService() ! { ! return service; ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param service Description of the Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{ConsoleService.class}; ! } ! ! ! /** */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! this.service = new ConsoleServiceInternalFrame(this.getBeanContext()); ! ! this.add(new ShowConsoleAction( ! new Command() ! { ! public void execute() ! { ! ConsoleServiceProvider.this.service.show(); ! } ! } ! )); ! ! logger.debug("Console Service installed"); ! } ! } --- 1,117 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.view.ShowConsoleAction; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo I18N to complete ! */ ! public class ConsoleServiceProvider extends CustomBeanContextServiceProvider ! { ! /** Description of the Field */ ! protected ConsoleService service = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ConsoleServiceProvider.class); ! ! ! /** Constructor for the AboutServiceProvider object */ ! public ConsoleServiceProvider() ! { ! super(); ! } ! ! ! /** ! * Gets the currentServiceSelectors attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return (new Vector().iterator()); ! } ! ! ! /** ! * Gets the service attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @param serviceSelector Description of the Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return this.service; ! } ! ! ! /** ! * Returns the service. ! * ! * @return ConsoleService ! */ ! public ConsoleService getService() ! { ! return service; ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param service Description of the Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{ConsoleService.class}; ! } ! ! ! /** */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! this.service = new ConsoleServiceInternalFrame(this.getBeanContext()); ! ! this.add(new ShowConsoleAction( ! new Command() ! { ! public void execute() ! { ! ConsoleServiceProvider.this.service.show(); ! } ! } ! )); ! ! logger.debug("Console Service installed"); ! } ! } Index: FrameService.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/FrameService.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FrameService.java 15 Sep 2003 22:37:14 -0000 1.4 --- FrameService.java 13 Dec 2003 21:29:35 -0000 1.5 *************** *** 1,50 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.event.WindowListener; ! import java.beans.beancontext.BeanContextContainerProxy; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface FrameService extends BeanContextContainerProxy, MenuBarService.Listener ! { ! /** Description of the Field */ ! public final static int MDI = 0; ! /** Description of the Field */ ! public final static int SDI = 1; ! ! ! /** ! * Setter for the title attribute ! * ! * @param title The new value ! */ ! public void setTitle(String title); ! ! ! /** ! * Adds a feature to the WindowListener attribute of the FrameService object ! * ! * @param l The feature to be added to the WindowListener attribute ! */ ! public void addWindowListener(WindowListener l); ! ! ! /** ! * Description of the Method ! * ! * @param l Description of Parameter ! */ ! public void removeWindowListener(WindowListener l); ! } ! --- 1,50 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.event.WindowListener; ! import java.beans.beancontext.BeanContextContainerProxy; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface FrameService extends BeanContextContainerProxy, MenuBarService.Listener ! { ! /** Description of the Field */ ! public final static int MDI = 0; ! /** Description of the Field */ ! public final static int SDI = 1; ! ! ! /** ! * Setter for the title attribute ! * ! * @param title The new value ! */ ! public void setTitle(String title); ! ! ! /** ! * Adds a feature to the WindowListener attribute of the FrameService object ! * ! * @param l The feature to be added to the WindowListener attribute ! */ ! public void addWindowListener(WindowListener l); ! ! ! /** ! * Description of the Method ! * ! * @param l Description of Parameter ! */ ! public void removeWindowListener(WindowListener l); ! } ! Index: FrameServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/FrameServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FrameServiceProvider.java 15 Sep 2003 22:37:14 -0000 1.4 --- FrameServiceProvider.java 13 Dec 2003 21:29:35 -0000 1.5 *************** *** 14,17 **** --- 14,18 ---- import java.util.Vector; + import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JMenuBar; *************** *** 144,147 **** --- 145,161 ---- this.frame.setJMenuBar(menuBar); this.frame.setVisible(true); + } + + + /** Description of the Method */ + protected void initializeBeanContextResources() + { + super.initializeBeanContextResources(); + + ImageIcon icon = new ImageIcon(this.getClass().getResource("/frameGraphics/ejtools.gif")); + if (icon != null) + { + this.frame.setIconImage(icon.getImage()); + } } Index: MDIFrameService.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/MDIFrameService.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MDIFrameService.java 15 Sep 2003 22:37:14 -0000 1.4 --- MDIFrameService.java 13 Dec 2003 21:29:35 -0000 1.5 *************** *** 1,42 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface MDIFrameService extends FrameService ! { ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void register(BeanContextInternalFrame frame); ! ! ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void unregister(BeanContextInternalFrame frame); ! ! ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void activate(BeanContextInternalFrame frame); ! } ! --- 1,42 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface MDIFrameService extends FrameService ! { ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void register(BeanContextInternalFrame frame); ! ! ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void unregister(BeanContextInternalFrame frame); ! ! ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void activate(BeanContextInternalFrame frame); ! } ! Index: MDIFrameServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/MDIFrameServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MDIFrameServiceProvider.java 15 Sep 2003 22:37:14 -0000 1.4 --- MDIFrameServiceProvider.java 13 Dec 2003 21:29:35 -0000 1.5 *************** *** 1,222 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.BorderLayout; ! import java.awt.Dimension; ! import java.awt.Toolkit; ! import java.beans.PropertyVetoException; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.ButtonGroup; ! import javax.swing.JInternalFrame; ! import javax.swing.WindowConstants; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.window.CascadeAction; ! import org.ejtools.adwt.action.window.CloseAction; ! import org.ejtools.adwt.action.window.CloseAllAction; ! import org.ejtools.adwt.action.window.TileAction; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class MDIFrameServiceProvider extends FrameServiceProvider implements MDIFrameService ! { ! /** Description of the Field */ ! protected MDIDesktopPane desktop = new MDIDesktopPane(); ! /** Description of the Field */ ! protected Vector frames = new Vector(); ! /** Description of the Field */ ! protected ButtonGroup group = new ButtonGroup(); ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(MDIFrameServiceProvider.class); ! ! ! /** Constructor for the FrameServiceProvider object */ ! public MDIFrameServiceProvider() ! { ! super(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void activate(BeanContextInternalFrame frame) ! { ! try ! { ! JInternalFrame internalFrame = (JInternalFrame) frame.getComponent(); ! internalFrame.setSelected(true); ! this.desktop.getDesktopManager().activateFrame(internalFrame); ! } ! catch (PropertyVetoException e) ! { ! } ! } ! ! ! /** ! * Gets the activated attribute of the FrameServiceProvider object ! * ! * @return The activated value ! */ ! public BeanContextInternalFrame getActivated() ! { ! Iterator it = frames.iterator(); ! while (it.hasNext()) ! { ! BeanContextInternalFrame frame = (BeanContextInternalFrame) it.next(); ! if (this.isActivated(frame)) ! { ! return frame; ! } ! } ! return null; ! } ! ! ! /** ! * Gets the activated attribute of the FrameServiceProvider object ! * ! * @param frame Description of Parameter ! * @return The activated value ! */ ! public boolean isActivated(BeanContextInternalFrame frame) ! { ! JInternalFrame selected = this.desktop.getSelectedFrame(); ! JInternalFrame internalFrame = (JInternalFrame) frame.getComponent(); ! return selected.equals(internalFrame); ! } ! ! ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void register(BeanContextInternalFrame frame) ! { ! JInternalFrame internalFrame = (JInternalFrame) frame.getComponent(); ! this.frames.add(frame); ! this.desktop.add(internalFrame); ! this.group.add(frame.getAction().getMenuItem()); ! } ! ! ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void unregister(BeanContextInternalFrame frame) ! { ! JInternalFrame internalFrame = (JInternalFrame) frame.getComponent(); ! this.group.remove(frame.getAction().getMenuItem()); ! this.desktop.remove(internalFrame); ! this.frames.remove(frame); ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{FrameService.class, MDIFrameService.class}; ! } ! ! ! /** Description of the Method */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! BeanContextServices context = (BeanContextServices) this.getBeanContext(); ! ! this.frame.setSize(new Dimension(700, 500)); ! ! this.scrollPane.getViewport().add(desktop); ! this.frame.getContentPane().add(BorderLayout.CENTER, scrollPane); ! ! Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); ! this.frame.setLocation(screen.width / 2 - frame.getSize().width / 2, screen.height / 2 - frame.getSize().height / 2); ! this.frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); ! ! this.add(new CascadeAction( ! new Command() ! { ! public void execute() ! { ! MDIFrameServiceProvider.this.desktop.cascadeFrames(); ! } ! } ! )); ! ! this.add(new TileAction( ! new Command() ! { ! public void execute() ! { ! MDIFrameServiceProvider.this.desktop.tileFrames(); ! } ! } ! )); ! ! this.add(new CloseAction( ! new Command() ! { ! public void execute() ! { ! BeanContextInternalFrame frame = MDIFrameServiceProvider.this.getActivated(); ! if (frame != null) ! { ! frame.close(); ! } ! } ! } ! )); ! ! this.add(new CloseAllAction( ! new Command() ! { ! public void execute() ! { ! while (!MDIFrameServiceProvider.this.frames.isEmpty()) ! { ! BeanContextInternalFrame frame = (BeanContextInternalFrame) MDIFrameServiceProvider.this.frames.lastElement(); ! frame.close(); ! } ! } ! } ! )); ! ! this.useServices(context); ! this.frame.setVisible(true); ! ! logger.debug("MDIFrameService added"); ! } ! ! ! /** */ ! protected void releaseBeanContextResources() ! { ! super.releaseBeanContextResources(); ! ! logger.debug("MDIFrameService removed"); ! } ! } --- 1,222 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.BorderLayout; ! import java.awt.Dimension; ! import java.awt.Toolkit; ! import java.beans.PropertyVetoException; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.ButtonGroup; ! import javax.swing.JInternalFrame; ! import javax.swing.WindowConstants; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.window.CascadeAction; ! import org.ejtools.adwt.action.window.CloseAction; ! import org.ejtools.adwt.action.window.CloseAllAction; ! import org.ejtools.adwt.action.window.TileAction; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class MDIFrameServiceProvider extends FrameServiceProvider implements MDIFrameService ! { ! /** Description of the Field */ ! protected MDIDesktopPane desktop = new MDIDesktopPane(); ! /** Description of the Field */ ! protected Vector frames = new Vector(); ! /** Description of the Field */ ! protected ButtonGroup group = new ButtonGroup(); ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(MDIFrameServiceProvider.class); ! ! ! /** Constructor for the FrameServiceProvider object */ ! public MDIFrameServiceProvider() ! { ! super(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param frame Description of Parameter ! */ ! public void activate(BeanContextInternalFrame frame) ! { ! try ! { ! JInternalFrame internalFrame = (JInternalFrame) frame.getComponent(); ! internalFrame.setSelected(true); ! this.desktop.getDesktopManager().activateFram... [truncated message content] |
From: <let...@us...> - 2003-12-14 10:42:47
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/util In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/util Modified Files: DefaultObjectIndexer.java DefaultObjectRenderer.java ObjectIndexer.java ObjectRenderer.java ObjectSearcher.java ObjectWrapper.java SearchableTreeModel.java Log Message: Add more javadocs. Add package.html files. Index: DefaultObjectIndexer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/util/DefaultObjectIndexer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DefaultObjectIndexer.java 15 Sep 2003 22:37:14 -0000 1.2 --- DefaultObjectIndexer.java 13 Dec 2003 21:29:35 -0000 1.3 *************** *** 1,17 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import java.util.Hashtable; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class DefaultObjectIndexer extends Hashtable implements ObjectIndexer ! { ! } --- 1,17 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import java.util.Hashtable; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class DefaultObjectIndexer extends Hashtable implements ObjectIndexer ! { ! } Index: DefaultObjectRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/util/DefaultObjectRenderer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DefaultObjectRenderer.java 15 Sep 2003 22:37:14 -0000 1.2 --- DefaultObjectRenderer.java 13 Dec 2003 21:29:35 -0000 1.3 *************** *** 1,119 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import java.awt.Image; ! import java.awt.Toolkit; ! import java.awt.image.ImageProducer; ! import java.io.IOException; ! import java.net.URL; ! import java.security.AccessController; ! import java.security.PrivilegedAction; ! import java.util.Hashtable; ! import java.util.Map; ! ! import javax.swing.Icon; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class DefaultObjectRenderer implements ObjectRenderer ! { ! /** Description of the Field */ ! protected Map objects = new Hashtable(); ! ! ! /** ! * Gets the icon attribute of the DefaultObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The icon value ! */ ! public Icon getIcon(Object o) ! { ! return this.getObjectWrapper(o).getIcon(); ! } ! ! ! /** ! * Gets the label attribute of the DefaultObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The label value ! */ ! public String getLabel(Object o) ! { ! return this.getObjectWrapper(o).toString(); ! } ! ! ! /** ! * Gets the objectWrapper attribute of the DefaultObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The objectWrapper value ! */ ! protected ObjectWrapper getObjectWrapper(Object o) ! { ! ObjectWrapper wrapper = (ObjectWrapper) this.objects.get(o); ! if (wrapper == null) ! { ! wrapper = new ObjectWrapper(o); ! this.objects.put(o, wrapper); ! } ! return wrapper; ! } ! ! ! /** ! * Description of the Method ! * ! * @param resourceName Description of the Parameter ! * @return Description of the Return Value ! */ ! protected static Image loadImage(final String resourceName) ! { ! try ! { ! final Class c = DefaultObjectRenderer.class; ! ImageProducer ip = (ImageProducer) AccessController.doPrivileged( ! new PrivilegedAction() ! { ! public Object run() ! { ! URL url; ! if ((url = c.getResource(resourceName)) == null) ! { ! return null; ! } ! else ! { ! try ! { ! return url.getContent(); ! } ! catch (IOException ioe) ! { ! return null; ! } ! } ! } ! }); ! if (ip == null) ! { ! return null; ! } ! Toolkit tk = Toolkit.getDefaultToolkit(); ! return tk.createImage(ip); ! } ! catch (Exception ex) ! { ! return null; ! } ! } ! } --- 1,119 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import java.awt.Image; ! import java.awt.Toolkit; ! import java.awt.image.ImageProducer; ! import java.io.IOException; ! import java.net.URL; ! import java.security.AccessController; ! import java.security.PrivilegedAction; ! import java.util.Hashtable; ! import java.util.Map; ! ! import javax.swing.Icon; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class DefaultObjectRenderer implements ObjectRenderer ! { ! /** Description of the Field */ ! protected Map objects = new Hashtable(); ! ! ! /** ! * Gets the icon attribute of the DefaultObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The icon value ! */ ! public Icon getIcon(Object o) ! { ! return this.getObjectWrapper(o).getIcon(); ! } ! ! ! /** ! * Gets the label attribute of the DefaultObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The label value ! */ ! public String getLabel(Object o) ! { ! return this.getObjectWrapper(o).toString(); ! } ! ! ! /** ! * Gets the objectWrapper attribute of the DefaultObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The objectWrapper value ! */ ! protected ObjectWrapper getObjectWrapper(Object o) ! { ! ObjectWrapper wrapper = (ObjectWrapper) this.objects.get(o); ! if (wrapper == null) ! { ! wrapper = new ObjectWrapper(o); ! this.objects.put(o, wrapper); ! } ! return wrapper; ! } ! ! ! /** ! * Description of the Method ! * ! * @param resourceName Description of the Parameter ! * @return Description of the Return Value ! */ ! protected static Image loadImage(final String resourceName) ! { ! try ! { ! final Class c = DefaultObjectRenderer.class; ! ImageProducer ip = (ImageProducer) AccessController.doPrivileged( ! new PrivilegedAction() ! { ! public Object run() ! { ! URL url; ! if ((url = c.getResource(resourceName)) == null) ! { ! return null; ! } ! else ! { ! try ! { ! return url.getContent(); ! } ! catch (IOException ioe) ! { ! return null; ! } ! } ! } ! }); ! if (ip == null) ! { ! return null; ! } ! Toolkit tk = Toolkit.getDefaultToolkit(); ! return tk.createImage(ip); ! } ! catch (Exception ex) ! { ! return null; ! } ! } ! } Index: ObjectIndexer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/util/ObjectIndexer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectIndexer.java 15 Sep 2003 22:37:14 -0000 1.2 --- ObjectIndexer.java 13 Dec 2003 21:29:35 -0000 1.3 *************** *** 1,42 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface ObjectIndexer ! { ! /** ! * Description of the Method ! * ! * @param key Description of the Parameter ! * @param value Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object put(Object key, Object value); ! ! ! /** ! * Description of the Method ! * ! * @param key Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object remove(Object key); ! ! ! /** ! * Description of the Method ! * ! * @param key Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object get(Object key); ! } --- 1,42 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface ObjectIndexer ! { ! /** ! * Description of the Method ! * ! * @param key Description of the Parameter ! * @param value Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object put(Object key, Object value); ! ! ! /** ! * Description of the Method ! * ! * @param key Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object remove(Object key); ! ! ! /** ! * Description of the Method ! * ! * @param key Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object get(Object key); ! } Index: ObjectRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/util/ObjectRenderer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectRenderer.java 15 Sep 2003 22:37:14 -0000 1.2 --- ObjectRenderer.java 13 Dec 2003 21:29:35 -0000 1.3 *************** *** 1,33 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import javax.swing.Icon; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface ObjectRenderer ! { ! /** ! * Gets the icon attribute of the ObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The icon value ! */ ! public Icon getIcon(Object o); ! ! ! /** ! * Gets the label attribute of the ObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The label value ! */ ! public String getLabel(Object o); ! } --- 1,33 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import javax.swing.Icon; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface ObjectRenderer ! { ! /** ! * Gets the icon attribute of the ObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The icon value ! */ ! public Icon getIcon(Object o); ! ! ! /** ! * Gets the label attribute of the ObjectRenderer object ! * ! * @param o Description of the Parameter ! * @return The label value ! */ ! public String getLabel(Object o); ! } Index: ObjectSearcher.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/util/ObjectSearcher.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ObjectSearcher.java 15 Sep 2003 22:37:14 -0000 1.1 --- ObjectSearcher.java 13 Dec 2003 21:29:35 -0000 1.2 *************** *** 1,31 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface ObjectSearcher ! { ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object find(Object o); ! ! ! /** ! * Sets the indexer attribute of the ObjectSearcher object ! * ! * @param indexer The new indexer value ! */ ! public void setIndexer(ObjectIndexer indexer); ! } --- 1,31 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface ObjectSearcher ! { ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object find(Object o); ! ! ! /** ! * Sets the indexer attribute of the ObjectSearcher object ! * ! * @param indexer The new indexer value ! */ ! public void setIndexer(ObjectIndexer indexer); ! } Index: ObjectWrapper.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/util/ObjectWrapper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ObjectWrapper.java 15 Sep 2003 22:37:14 -0000 1.2 --- ObjectWrapper.java 13 Dec 2003 21:29:35 -0000 1.3 *************** *** 1,120 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import java.awt.Component; ! import java.beans.BeanInfo; ! import java.beans.Introspector; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextContainerProxy; ! import java.lang.reflect.Method; ! ! import javax.swing.Icon; ! import javax.swing.ImageIcon; ! import javax.swing.JLabel; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class ObjectWrapper implements BeanContextChildComponentProxy ! { ! /** Description of the Field */ ! private Icon icon; ! /** Description of the Field */ ! private Object object; ! /** Description of the Field */ ! private String text; ! ! ! /** ! * Constructor for the ContextNode object ! * ! * @param object Description of the Parameter ! */ ! public ObjectWrapper(Object object) ! { ! this.object = object; ! try ! { ! BeanInfo beaninfo = Introspector.getBeanInfo(this.object.getClass()); ! if (beaninfo.getIcon(BeanInfo.ICON_COLOR_16x16) != null) ! { ! this.icon = new ImageIcon(beaninfo.getIcon(BeanInfo.ICON_COLOR_16x16)); ! } ! ! Method method = this.object.getClass().getMethod("toString", new Class[0]); ! if (method.getDeclaringClass().equals(Object.class)) ! { ! this.text = beaninfo.getBeanDescriptor().getDisplayName(); ! } ! } ! catch (Exception exception) ! { ! exception.printStackTrace(); ! } ! } ! ! ! /** ! * Gets the Component attribute of the ContextNode object ! * ! * @return The Component value ! */ ! public Component getComponent() ! { ! if (this.object instanceof Component) ! { ! return (Component) this.object; ! } ! if (this.object instanceof BeanContextContainerProxy) ! { ! return ((BeanContextContainerProxy) this.object).getContainer(); ! } ! if (this.object instanceof BeanContextChildComponentProxy) ! { ! return ((BeanContextChildComponentProxy) this.object).getComponent(); ! } ! else ! { ! return new JLabel("No GUI available for this service", 0); ! } ! } ! ! ! /** ! * Returns the icon. ! * ! * @return Icon ! */ ! public Icon getIcon() ! { ! return this.icon; ! } ! ! ! /** ! * Gets the UserObject attribute of the ContextNode object ! * ! * @return The UserObject value ! */ ! public Object getUserObject() ! { ! return this.object; ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public String toString() ! { ! return this.text != null ? this.text : this.object.toString(); ! } ! } --- 1,120 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import java.awt.Component; ! import java.beans.BeanInfo; ! import java.beans.Introspector; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextContainerProxy; ! import java.lang.reflect.Method; ! ! import javax.swing.Icon; ! import javax.swing.ImageIcon; ! import javax.swing.JLabel; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class ObjectWrapper implements BeanContextChildComponentProxy ! { ! /** Description of the Field */ ! private Icon icon; ! /** Description of the Field */ ! private Object object; ! /** Description of the Field */ ! private String text; ! ! ! /** ! * Constructor for the ContextNode object ! * ! * @param object Description of the Parameter ! */ ! public ObjectWrapper(Object object) ! { ! this.object = object; ! try ! { ! BeanInfo beaninfo = Introspector.getBeanInfo(this.object.getClass()); ! if (beaninfo.getIcon(BeanInfo.ICON_COLOR_16x16) != null) ! { ! this.icon = new ImageIcon(beaninfo.getIcon(BeanInfo.ICON_COLOR_16x16)); ! } ! ! Method method = this.object.getClass().getMethod("toString", new Class[0]); ! if (method.getDeclaringClass().equals(Object.class)) ! { ! this.text = beaninfo.getBeanDescriptor().getDisplayName(); ! } ! } ! catch (Exception exception) ! { ! exception.printStackTrace(); ! } ! } ! ! ! /** ! * Gets the Component attribute of the ContextNode object ! * ! * @return The Component value ! */ ! public Component getComponent() ! { ! if (this.object instanceof Component) ! { ! return (Component) this.object; ! } ! if (this.object instanceof BeanContextContainerProxy) ! { ! return ((BeanContextContainerProxy) this.object).getContainer(); ! } ! if (this.object instanceof BeanContextChildComponentProxy) ! { ! return ((BeanContextChildComponentProxy) this.object).getComponent(); ! } ! else ! { ! return new JLabel("No GUI available for this service", 0); ! } ! } ! ! ! /** ! * Returns the icon. ! * ! * @return Icon ! */ ! public Icon getIcon() ! { ! return this.icon; ! } ! ! ! /** ! * Gets the UserObject attribute of the ContextNode object ! * ! * @return The UserObject value ! */ ! public Object getUserObject() ! { ! return this.object; ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public String toString() ! { ! return this.text != null ? this.text : this.object.toString(); ! } ! } Index: SearchableTreeModel.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/util/SearchableTreeModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SearchableTreeModel.java 15 Sep 2003 22:37:14 -0000 1.1 --- SearchableTreeModel.java 13 Dec 2003 21:29:35 -0000 1.2 *************** *** 1,19 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import javax.swing.tree.TreeModel; ! ! /** ! * Description of the Interface ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface SearchableTreeModel extends TreeModel, ObjectSearcher ! { ! } --- 1,19 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.util; ! ! import javax.swing.tree.TreeModel; ! ! /** ! * Description of the Interface ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface SearchableTreeModel extends TreeModel, ObjectSearcher ! { ! } |
From: <let...@us...> - 2003-12-14 10:42:46
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/help In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt/action/help Modified Files: AboutAction.java HelpOnLineAction.java TOTDAction.java Log Message: Add more javadocs. Add package.html files. Index: AboutAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/help/AboutAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AboutAction.java 15 Sep 2003 22:37:13 -0000 1.7 --- AboutAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 21,25 **** public class AboutAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class AboutAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: HelpOnLineAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/help/HelpOnLineAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** HelpOnLineAction.java 15 Sep 2003 22:37:13 -0000 1.7 --- HelpOnLineAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 21,25 **** public class HelpOnLineAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class HelpOnLineAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); Index: TOTDAction.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/help/TOTDAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TOTDAction.java 15 Sep 2003 22:37:13 -0000 1.7 --- TOTDAction.java 13 Dec 2003 21:29:34 -0000 1.8 *************** *** 21,25 **** public class TOTDAction extends CommandAction { ! /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); --- 21,25 ---- public class TOTDAction extends CommandAction { ! /** Resource Bundle */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); |
From: <let...@us...> - 2003-12-14 10:42:46
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt In directory sc8-pr-cvs1:/tmp/cvs-serv19233/adwt/src/main/org/ejtools/adwt Modified Files: AwtToolkit.java BeanContextList.java BeanContextListModel.java BeanContextListPanel.java BeanContextTree.java BeanContextTreeModel.java BeanContextTreePanel.java GenericMethodDialog.java LookAndFeelUtil.java Log Message: Add more javadocs. Add package.html files. Index: AwtToolkit.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/AwtToolkit.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AwtToolkit.java 15 Sep 2003 22:37:12 -0000 1.4 --- AwtToolkit.java 13 Dec 2003 21:29:33 -0000 1.5 *************** *** 1,33 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Color; ! import java.awt.Font; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class AwtToolkit ! { ! /** Description of the Field */ ! public static Color DARK_BLUE = new Color(0, 0, 144); ! /** Description of the Field */ ! public static Color DARK_RED = new Color(144, 0, 0); ! ! /** Description of the Field */ ! public static Font FONT = new Font("SansSerif", Font.BOLD, 10); ! ! ! /** Constructor for AwtToolkit. */ ! private AwtToolkit() ! { ! super(); ! } ! } --- 1,33 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Color; ! import java.awt.Font; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class AwtToolkit ! { ! /** Description of the Field */ ! public static Color DARK_BLUE = new Color(0, 0, 144); ! /** Description of the Field */ ! public static Color DARK_RED = new Color(144, 0, 0); ! ! /** Description of the Field */ ! public static Font FONT = new Font("SansSerif", Font.BOLD, 10); ! ! ! /** Constructor for AwtToolkit. */ ! private AwtToolkit() ! { ! super(); ! } ! } Index: BeanContextList.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/BeanContextList.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeanContextList.java 15 Sep 2003 22:37:12 -0000 1.1 --- BeanContextList.java 13 Dec 2003 21:29:33 -0000 1.2 *************** *** 1,29 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import javax.swing.JList; ! import javax.swing.ListModel; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextList extends JList ! { ! /** ! * Constructor for the BeanContextList object ! * ! * @param dataModel Description of the Parameter ! */ ! public BeanContextList(ListModel dataModel) ! { ! super(dataModel); ! } ! } --- 1,29 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import javax.swing.JList; ! import javax.swing.ListModel; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextList extends JList ! { ! /** ! * Constructor for the BeanContextList object ! * ! * @param dataModel Description of the Parameter ! */ ! public BeanContextList(ListModel dataModel) ! { ! super(dataModel); ! } ! } Index: BeanContextListModel.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/BeanContextListModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeanContextListModel.java 15 Sep 2003 22:37:12 -0000 1.1 --- BeanContextListModel.java 13 Dec 2003 21:29:34 -0000 1.2 *************** *** 1,144 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextMembershipEvent; ! import java.beans.beancontext.BeanContextMembershipListener; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.ListModel; ! import javax.swing.event.ListDataEvent; ! import javax.swing.event.ListDataListener; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextListModel implements ListModel, BeanContextMembershipListener ! { ! /** Description of the Field */ ! protected Collection listeners = new Vector(); ! /** Description of the Field */ ! protected BeanContext root; ! ! ! /** ! * Constructor for the BeanContextListModel object ! * ! * @param root Description of the Parameter ! */ ! public BeanContextListModel(BeanContext root) ! { ! this.root = root; ! this.root.addBeanContextMembershipListener(this); ! } ! ! ! /** ! * Adds a feature to the ListDataListener attribute of the ! * BeanContextListModel object ! * ! * @param l The feature to be added to the ListDataListener attribute ! */ ! public void addListDataListener(ListDataListener l) ! { ! this.listeners.add(l); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcme Description of the Parameter ! */ ! public void childrenAdded(BeanContextMembershipEvent bcme) ! { ! this.fireContentsChanged(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcme Description of the Parameter ! */ ! public void childrenRemoved(BeanContextMembershipEvent bcme) ! { ! this.fireContentsChanged(); ! } ! ! ! /** ! * Gets the elementAt attribute of the BeanContextListModel object ! * ! * @param index Description of the Parameter ! * @return The elementAt value ! */ ! public Object getElementAt(int index) ! { ! int i = 0; ! Object result = null; ! for (Iterator it = this.root.iterator(); it.hasNext(); i++) ! { ! result = it.next(); ! if (i == index) ! { ! break; ! } ! result = null; ! } ! return result; ! } ! ! ! /** ! * Gets the size attribute of the BeanContextListModel object ! * ! * @return The size value ! */ ! public int getSize() ! { ! return root.size(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param l Description of the Parameter ! */ ! public void removeListDataListener(ListDataListener l) ! { ! this.listeners.remove(l); ! } ! ! ! /** Description of the Method */ ! protected void fireContentsChanged() ! { ! ListDataEvent event = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, this.root.size()); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! ListDataListener listener = (ListDataListener) copy[i]; ! listener.contentsChanged(event); ! } ! } ! ! ! /** Description of the Method */ ! protected void fireIntervalAdded() { } ! ! ! /** Description of the Method */ ! protected void fireIntervalRemoved() { } ! } --- 1,144 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextMembershipEvent; ! import java.beans.beancontext.BeanContextMembershipListener; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.ListModel; ! import javax.swing.event.ListDataEvent; ! import javax.swing.event.ListDataListener; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextListModel implements ListModel, BeanContextMembershipListener ! { ! /** Description of the Field */ ! protected Collection listeners = new Vector(); ! /** Description of the Field */ ! protected BeanContext root; ! ! ! /** ! * Constructor for the BeanContextListModel object ! * ! * @param root Description of the Parameter ! */ ! public BeanContextListModel(BeanContext root) ! { ! this.root = root; ! this.root.addBeanContextMembershipListener(this); ! } ! ! ! /** ! * Adds a feature to the ListDataListener attribute of the ! * BeanContextListModel object ! * ! * @param l The feature to be added to the ListDataListener attribute ! */ ! public void addListDataListener(ListDataListener l) ! { ! this.listeners.add(l); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcme Description of the Parameter ! */ ! public void childrenAdded(BeanContextMembershipEvent bcme) ! { ! this.fireContentsChanged(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcme Description of the Parameter ! */ ! public void childrenRemoved(BeanContextMembershipEvent bcme) ! { ! this.fireContentsChanged(); ! } ! ! ! /** ! * Gets the elementAt attribute of the BeanContextListModel object ! * ! * @param index Description of the Parameter ! * @return The elementAt value ! */ ! public Object getElementAt(int index) ! { ! int i = 0; ! Object result = null; ! for (Iterator it = this.root.iterator(); it.hasNext(); i++) ! { ! result = it.next(); ! if (i == index) ! { ! break; ! } ! result = null; ! } ! return result; ! } ! ! ! /** ! * Gets the size attribute of the BeanContextListModel object ! * ! * @return The size value ! */ ! public int getSize() ! { ! return root.size(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param l Description of the Parameter ! */ ! public void removeListDataListener(ListDataListener l) ! { ! this.listeners.remove(l); ! } ! ! ! /** Description of the Method */ ! protected void fireContentsChanged() ! { ! ListDataEvent event = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, this.root.size()); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! ListDataListener listener = (ListDataListener) copy[i]; ! listener.contentsChanged(event); ! } ! } ! ! ! /** Description of the Method */ ! protected void fireIntervalAdded() { } ! ! ! /** Description of the Method */ ! protected void fireIntervalRemoved() { } ! } Index: BeanContextListPanel.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/BeanContextListPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BeanContextListPanel.java 15 Sep 2003 22:37:12 -0000 1.4 --- BeanContextListPanel.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,143 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Dimension; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextContainerProxy; ! ! import javax.swing.BorderFactory; ! import javax.swing.JLabel; ! import javax.swing.JList; ! import javax.swing.JPanel; ! import javax.swing.JScrollPane; ! import javax.swing.JSplitPane; ! import javax.swing.ListModel; ! import javax.swing.SwingUtilities; ! import javax.swing.event.ListDataEvent; ! import javax.swing.event.ListDataListener; ! import javax.swing.event.ListSelectionEvent; ! import javax.swing.event.ListSelectionListener; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextListPanel extends JSplitPane ! { ! /** Description of the Field */ ! protected JList list; ! ! ! /** ! * Constructor for the BeanContextListPanel object ! * ! * @param beancontext Description of Parameter ! */ ! public BeanContextListPanel(BeanContext beancontext) ! { ! this(beancontext, null); ! } ! ! ! /** ! * Constructor for the BeanContextListPanel object ! * ! * @param beancontext Description of Parameter ! * @param s Description of Parameter ! */ ! public BeanContextListPanel(BeanContext beancontext, String s) ! { ! super(1); ! if (s != null) ! { ! setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), s)); ! } ! list = new BeanContextListView(beancontext); ! JScrollPane jscrollpane = new JScrollPane(list); ! jscrollpane.setMinimumSize(new Dimension(200, 300)); ! jscrollpane.setPreferredSize(new Dimension(200, 300)); ! final JPanel dummyMsg = new JPanel(); ! dummyMsg.add(new JLabel("", 0)); ! setLeftComponent(jscrollpane); ! setRightComponent(dummyMsg); ! list.addListSelectionListener( ! new ListSelectionListener() ! { ! ! public void valueChanged(ListSelectionEvent e) ! { ! if (e.getValueIsAdjusting()) ! { ! return; ! } ! final int index = list.getSelectedIndex(); ! final ListModel model = list.getModel(); ! SwingUtilities.invokeLater( ! new Runnable() ! { ! ! public void run() ! { ! try ! { ! Object obj = ((BeanContextListView.ContextElement) model.getElementAt(index)).getUserObject(); ! if (obj instanceof BeanContextChildComponentProxy) ! { ! BeanContextChildComponentProxy beancontextchildcomponentproxy = (BeanContextChildComponentProxy) obj; ! setRightComponent(beancontextchildcomponentproxy.getComponent()); ! } ! else ! if (obj instanceof BeanContextContainerProxy) ! { ! BeanContextContainerProxy beancontextcontainerproxy = (BeanContextContainerProxy) obj; ! setRightComponent(beancontextcontainerproxy.getContainer()); ! } ! validate(); ! } ! catch (Exception _ex) ! { ! } ! } ! ! }); ! } ! ! }); ! list.getModel().addListDataListener( ! new ListDataListener() ! { ! ! public void contentsChanged(ListDataEvent e) ! { ! list.clearSelection(); ! setRightComponent(dummyMsg); ! validate(); ! } ! ! ! public void intervalAdded(ListDataEvent e) ! { ! list.clearSelection(); ! setRightComponent(dummyMsg); ! validate(); ! } ! ! ! public void intervalRemoved(ListDataEvent e) ! { ! list.clearSelection(); ! setRightComponent(dummyMsg); ! validate(); ! } ! }); ! } ! } ! --- 1,143 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Dimension; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextContainerProxy; ! ! import javax.swing.BorderFactory; ! import javax.swing.JLabel; ! import javax.swing.JList; ! import javax.swing.JPanel; ! import javax.swing.JScrollPane; ! import javax.swing.JSplitPane; ! import javax.swing.ListModel; ! import javax.swing.SwingUtilities; ! import javax.swing.event.ListDataEvent; ! import javax.swing.event.ListDataListener; ! import javax.swing.event.ListSelectionEvent; ! import javax.swing.event.ListSelectionListener; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextListPanel extends JSplitPane ! { ! /** Description of the Field */ ! protected JList list; ! ! ! /** ! * Constructor for the BeanContextListPanel object ! * ! * @param beancontext Description of Parameter ! */ ! public BeanContextListPanel(BeanContext beancontext) ! { ! this(beancontext, null); ! } ! ! ! /** ! * Constructor for the BeanContextListPanel object ! * ! * @param beancontext Description of Parameter ! * @param s Description of Parameter ! */ ! public BeanContextListPanel(BeanContext beancontext, String s) ! { ! super(1); ! if (s != null) ! { ! setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), s)); ! } ! list = new BeanContextListView(beancontext); ! JScrollPane jscrollpane = new JScrollPane(list); ! jscrollpane.setMinimumSize(new Dimension(200, 300)); ! jscrollpane.setPreferredSize(new Dimension(200, 300)); ! final JPanel dummyMsg = new JPanel(); ! dummyMsg.add(new JLabel("", 0)); ! setLeftComponent(jscrollpane); ! setRightComponent(dummyMsg); ! list.addListSelectionListener( ! new ListSelectionListener() ! { ! ! public void valueChanged(ListSelectionEvent e) ! { ! if (e.getValueIsAdjusting()) ! { ! return; ! } ! final int index = list.getSelectedIndex(); ! final ListModel model = list.getModel(); ! SwingUtilities.invokeLater( ! new Runnable() ! { ! ! public void run() ! { ! try ! { ! Object obj = ((BeanContextListView.ContextElement) model.getElementAt(index)).getUserObject(); ! if (obj instanceof BeanContextChildComponentProxy) ! { ! BeanContextChildComponentProxy beancontextchildcomponentproxy = (BeanContextChildComponentProxy) obj; ! setRightComponent(beancontextchildcomponentproxy.getComponent()); ! } ! else ! if (obj instanceof BeanContextContainerProxy) ! { ! BeanContextContainerProxy beancontextcontainerproxy = (BeanContextContainerProxy) obj; ! setRightComponent(beancontextcontainerproxy.getContainer()); ! } ! validate(); ! } ! catch (Exception _ex) ! { ! } ! } ! ! }); ! } ! ! }); ! list.getModel().addListDataListener( ! new ListDataListener() ! { ! ! public void contentsChanged(ListDataEvent e) ! { ! list.clearSelection(); ! setRightComponent(dummyMsg); ! validate(); ! } ! ! ! public void intervalAdded(ListDataEvent e) ! { ! list.clearSelection(); ! setRightComponent(dummyMsg); ! validate(); ! } ! ! ! public void intervalRemoved(ListDataEvent e) ! { ! list.clearSelection(); ! setRightComponent(dummyMsg); ! validate(); ! } ! }); ! } ! } ! Index: BeanContextTree.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/BeanContextTree.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeanContextTree.java 15 Sep 2003 22:37:12 -0000 1.1 --- BeanContextTree.java 13 Dec 2003 21:29:34 -0000 1.2 *************** *** 1,137 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Component; ! ! import javax.swing.Icon; ! import javax.swing.JTree; ! import javax.swing.tree.DefaultTreeCellRenderer; ! import javax.swing.tree.TreePath; ! ! import org.ejtools.adwt.util.DefaultObjectRenderer; ! import org.ejtools.adwt.util.ObjectIndexer; ! import org.ejtools.adwt.util.ObjectRenderer; ! import org.ejtools.adwt.util.ObjectSearcher; ! import org.ejtools.adwt.util.SearchableTreeModel; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextTree extends JTree implements ObjectSearcher ! { ! /** Description of the Field */ ! protected ObjectRenderer renderer = new DefaultObjectRenderer(); ! ! ! /** ! * Constructor for the BeanContextTree object ! * ! * @param newModel Description of the Parameter ! */ ! public BeanContextTree(SearchableTreeModel newModel) ! { ! super(newModel); ! ! this.setShowsRootHandles(true); ! this.setExpandsSelectedPaths(true); ! this.putClientProperty("JTree.lineStyle", "Angled"); ! ! this.setCellRenderer( ! new DefaultTreeCellRenderer() ! { ! public Component getTreeCellRendererComponent(JTree jtree, Object obj, boolean flag, boolean flag1, boolean flag2, int i, boolean flag3) ! { ! try ! { ! Icon leafIcon = null; ! Icon openIcon = null; ! Icon closedIcon = null; ! ! Icon newIcon = BeanContextTree.this.renderer.getIcon(obj); ! ! if (newIcon != null) ! { ! leafIcon = this.getLeafIcon(); ! openIcon = this.getOpenIcon(); ! closedIcon = this.getClosedIcon(); ! this.setLeafIcon(newIcon); ! this.setOpenIcon(newIcon); ! this.setClosedIcon(newIcon); ! } ! ! super.getTreeCellRendererComponent(jtree, obj, flag, flag1, flag2, i, flag3); ! ! if (newIcon != null) ! { ! this.setLeafIcon(leafIcon); ! this.setOpenIcon(openIcon); ! this.setClosedIcon(closedIcon); ! } ! ! return this; ! } ! catch (Exception e) ! { ! return super.getTreeCellRendererComponent(jtree, obj, flag, flag1, flag2, i, flag3); ! } ! } ! }); ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object find(Object o) ! { ! Object r = ((SearchableTreeModel) this.getModel()).find(o); ! if (r != null) ! { ! Object[] paths = (Object[]) r; ! TreePath path = new TreePath(paths); ! this.setSelectionPath(path); ! } ! return null; ! } ! ! ! /** Description of the Method */ ! public void selectRoot() ! { ! TreePath path = new TreePath(this.getModel().getRoot()); ! this.setSelectionPath(path); ! } ! ! ! /** ! * Sets the indexer attribute of the BeanContextTree object ! * ! * @param indexer The new indexer value ! */ ! public void setIndexer(ObjectIndexer indexer) ! { ! ((SearchableTreeModel) this.getModel()).setIndexer(indexer); ! } ! ! ! /** ! * Sets the renderer attribute of the BeanContextTree object ! * ! * @param renderer The new renderer value ! */ ! public void setRenderer(ObjectRenderer renderer) ! { ! this.renderer = renderer; ! } ! } --- 1,137 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Component; ! ! import javax.swing.Icon; ! import javax.swing.JTree; ! import javax.swing.tree.DefaultTreeCellRenderer; ! import javax.swing.tree.TreePath; ! ! import org.ejtools.adwt.util.DefaultObjectRenderer; ! import org.ejtools.adwt.util.ObjectIndexer; ! import org.ejtools.adwt.util.ObjectRenderer; ! import org.ejtools.adwt.util.ObjectSearcher; ! import org.ejtools.adwt.util.SearchableTreeModel; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextTree extends JTree implements ObjectSearcher ! { ! /** Description of the Field */ ! protected ObjectRenderer renderer = new DefaultObjectRenderer(); ! ! ! /** ! * Constructor for the BeanContextTree object ! * ! * @param newModel Description of the Parameter ! */ ! public BeanContextTree(SearchableTreeModel newModel) ! { ! super(newModel); ! ! this.setShowsRootHandles(true); ! this.setExpandsSelectedPaths(true); ! this.putClientProperty("JTree.lineStyle", "Angled"); ! ! this.setCellRenderer( ! new DefaultTreeCellRenderer() ! { ! public Component getTreeCellRendererComponent(JTree jtree, Object obj, boolean flag, boolean flag1, boolean flag2, int i, boolean flag3) ! { ! try ! { ! Icon leafIcon = null; ! Icon openIcon = null; ! Icon closedIcon = null; ! ! Icon newIcon = BeanContextTree.this.renderer.getIcon(obj); ! ! if (newIcon != null) ! { ! leafIcon = this.getLeafIcon(); ! openIcon = this.getOpenIcon(); ! closedIcon = this.getClosedIcon(); ! this.setLeafIcon(newIcon); ! this.setOpenIcon(newIcon); ! this.setClosedIcon(newIcon); ! } ! ! super.getTreeCellRendererComponent(jtree, obj, flag, flag1, flag2, i, flag3); ! ! if (newIcon != null) ! { ! this.setLeafIcon(leafIcon); ! this.setOpenIcon(openIcon); ! this.setClosedIcon(closedIcon); ! } ! ! return this; ! } ! catch (Exception e) ! { ! return super.getTreeCellRendererComponent(jtree, obj, flag, flag1, flag2, i, flag3); ! } ! } ! }); ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object find(Object o) ! { ! Object r = ((SearchableTreeModel) this.getModel()).find(o); ! if (r != null) ! { ! Object[] paths = (Object[]) r; ! TreePath path = new TreePath(paths); ! this.setSelectionPath(path); ! } ! return null; ! } ! ! ! /** Description of the Method */ ! public void selectRoot() ! { ! TreePath path = new TreePath(this.getModel().getRoot()); ! this.setSelectionPath(path); ! } ! ! ! /** ! * Sets the indexer attribute of the BeanContextTree object ! * ! * @param indexer The new indexer value ! */ ! public void setIndexer(ObjectIndexer indexer) ! { ! ((SearchableTreeModel) this.getModel()).setIndexer(indexer); ! } ! ! ! /** ! * Sets the renderer attribute of the BeanContextTree object ! * ! * @param renderer The new renderer value ! */ ! public void setRenderer(ObjectRenderer renderer) ! { ! this.renderer = renderer; ! } ! } Index: BeanContextTreeModel.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/BeanContextTreeModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeanContextTreeModel.java 15 Sep 2003 22:37:12 -0000 1.1 --- BeanContextTreeModel.java 13 Dec 2003 21:29:34 -0000 1.2 *************** *** 1,321 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextMembershipEvent; ! import java.beans.beancontext.BeanContextMembershipListener; ! import java.util.ArrayList; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.event.TreeModelEvent; ! import javax.swing.event.TreeModelListener; ! import javax.swing.tree.TreePath; ! ! import org.ejtools.adwt.util.DefaultObjectIndexer; ! import org.ejtools.adwt.util.ObjectIndexer; ! import org.ejtools.adwt.util.SearchableTreeModel; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextTreeModel implements SearchableTreeModel, BeanContextMembershipListener ! { ! /** Description of the Field */ ! protected Collection contexts = new Vector(); ! /** Description of the Field */ ! protected ObjectIndexer indexer = new DefaultObjectIndexer(); ! /** Description of the Field */ ! protected Collection listeners = new Vector(); ! /** Root of the tree. */ ! protected BeanContext root; ! ! ! /** ! * Constructor for the BeanContextTreeModel object ! * ! * @param root Description of the Parameter ! */ ! public BeanContextTreeModel(BeanContext root) ! { ! this.root = root; ! this.root.addBeanContextMembershipListener(this); ! } ! ! ! /** ! * Adds a feature to the TreeModelListener attribute of the ! * BeanContextTreeModel object ! * ! * @param tml The feature to be added to the TreeModelListener attribute ! */ ! public void addTreeModelListener(TreeModelListener tml) ! { ! this.listeners.add(tml); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcme Description of the Parameter ! */ ! public void childrenAdded(BeanContextMembershipEvent bcme) ! { ! for (Iterator it = bcme.iterator(); it.hasNext(); ) ! { ! Object o = it.next(); ! if (o instanceof BeanContext) ! { ! BeanContext context = (BeanContext) o; ! if (!contexts.contains(context)) ! { ! contexts.add(context); ! context.addBeanContextMembershipListener(this); ! } ! } ! this.indexer.put(o, computePath(bcme.getBeanContext(), o)); ! } ! this.fireTreeStructureChanged(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcme Description of the Parameter ! */ ! public void childrenRemoved(BeanContextMembershipEvent bcme) ! { ! for (Iterator it = bcme.iterator(); it.hasNext(); ) ! { ! Object o = it.next(); ! if (o instanceof BeanContext) ! { ! BeanContext context = (BeanContext) o; ! if (contexts.contains(context)) ! { ! context.removeBeanContextMembershipListener(this); ! contexts.remove(context); ! } ! } ! this.indexer.remove(o); ! } ! this.fireTreeStructureChanged(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object find(Object o) ! { ! return this.indexer.get(o); ! } ! ! ! /** ! * Gets the child attribute of the BeanContextTreeModel object ! * ! * @param parent Description of the Parameter ! * @param index Description of the Parameter ! * @return The child value ! */ ! public Object getChild(Object parent, int index) ! { ! Collection c = (Collection) parent; ! int i = 0; ! Object result = null; ! for (Iterator it = c.iterator(); it.hasNext(); i++) ! { ! result = it.next(); ! if (i == index) ! { ! break; ! } ! result = null; ! } ! return result; ! } ! ! ! /** ! * Gets the childCount attribute of the BeanContextTreeModel object ! * ! * @param parent Description of the Parameter ! * @return The childCount value ! */ ! public int getChildCount(Object parent) ! { ! Collection c = (Collection) parent; ! return c.size(); ! } ! ! ! /** ! * Gets the indexOfChild attribute of the BeanContextTreeModel object ! * ! * @param parent Description of the Parameter ! * @param child Description of the Parameter ! * @return The indexOfChild value ! */ ! public int getIndexOfChild(Object parent, Object child) ! { ! Collection c = (Collection) parent; ! int i = 0; ! int index = -1; ! for (Iterator it = c.iterator(); it.hasNext(); i++) ! { ! if (it.next().equals(child)) ! { ! index = i; ! break; ! } ! } ! return index; ! } ! ! ! /** ! * Gets the root attribute of the BeanContextTreeModel object ! * ! * @return The root value ! */ ! public Object getRoot() ! { ! return this.root; ! } ! ! ! /** ! * Gets the leaf attribute of the BeanContextTreeModel object ! * ! * @param node Description of the Parameter ! * @return The leaf value ! */ ! public boolean isLeaf(Object node) ! { ! Collection c = (Collection) node; ! return (c.size() == 0); ! } ! ! ! /** ! * Description of the Method ! * ! * @param tml Description of the Parameter ! */ ! public void removeTreeModelListener(TreeModelListener tml) ! { ! this.listeners.remove(tml); ! } ! ! ! /** ! * Sets the indexer attribute of the BeanContextTreeModel object ! * ! * @param indexer The new indexer value ! */ ! public void setIndexer(ObjectIndexer indexer) ! { ! this.indexer = indexer; ! } ! ! ! /** ! * Description of the Method ! * ! * @param path Description of the Parameter ! * @param newValue Description of the Parameter ! */ ! public void valueForPathChanged(TreePath path, Object newValue) ! { ! throw new UnsupportedOperationException("Not yet implemented"); ! } ! ! ! /** ! * Description of the Method ! * ! * @param parent Description of the Parameter ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! protected Object[] computePath(BeanContext parent, Object o) ! { ! ArrayList paths = new ArrayList(); ! BeanContext current = parent; ! paths.add(parent); ! paths.add(o); ! while (this.root.equals(current.getBeanContext())) ! { ! current = current.getBeanContext(); ! paths.add(0, current); ! } ! return paths.toArray(); ! } ! ! ! /** Description of the Method */ ! protected void fireTreeNodesChanged() ! { ! TreeModelEvent event = new TreeModelEvent(this, new TreePath(this.root)); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! TreeModelListener listener = (TreeModelListener) copy[i]; ! listener.treeNodesChanged(event); ! } ! } ! ! ! /** Description of the Method */ ! protected void fireTreeNodesInserted() ! { ! TreeModelEvent event = new TreeModelEvent(this, new TreePath(this.root)); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! TreeModelListener listener = (TreeModelListener) copy[i]; ! listener.treeNodesInserted(event); ! } ! } ! ! ! /** Description of the Method */ ! protected void fireTreeNodesRemoved() ! { ! TreeModelEvent event = new TreeModelEvent(this, new TreePath(this.root)); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! TreeModelListener listener = (TreeModelListener) copy[i]; ! listener.treeNodesRemoved(event); ! } ! } ! ! ! /** Description of the Method */ ! protected void fireTreeStructureChanged() ! { ! TreeModelEvent event = new TreeModelEvent(this, new TreePath(this.root)); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! TreeModelListener listener = (TreeModelListener) copy[i]; ! listener.treeStructureChanged(event); ! } ! } ! } --- 1,321 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextMembershipEvent; ! import java.beans.beancontext.BeanContextMembershipListener; ! import java.util.ArrayList; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.event.TreeModelEvent; ! import javax.swing.event.TreeModelListener; ! import javax.swing.tree.TreePath; ! ! import org.ejtools.adwt.util.DefaultObjectIndexer; ! import org.ejtools.adwt.util.ObjectIndexer; ! import org.ejtools.adwt.util.SearchableTreeModel; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextTreeModel implements SearchableTreeModel, BeanContextMembershipListener ! { ! /** Description of the Field */ ! protected Collection contexts = new Vector(); ! /** Description of the Field */ ! protected ObjectIndexer indexer = new DefaultObjectIndexer(); ! /** Description of the Field */ ! protected Collection listeners = new Vector(); ! /** Root of the tree. */ ! protected BeanContext root; ! ! ! /** ! * Constructor for the BeanContextTreeModel object ! * ! * @param root Description of the Parameter ! */ ! public BeanContextTreeModel(BeanContext root) ! { ! this.root = root; ! this.root.addBeanContextMembershipListener(this); ! } ! ! ! /** ! * Adds a feature to the TreeModelListener attribute of the ! * BeanContextTreeModel object ! * ! * @param tml The feature to be added to the TreeModelListener attribute ! */ ! public void addTreeModelListener(TreeModelListener tml) ! { ! this.listeners.add(tml); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcme Description of the Parameter ! */ ! public void childrenAdded(BeanContextMembershipEvent bcme) ! { ! for (Iterator it = bcme.iterator(); it.hasNext(); ) ! { ! Object o = it.next(); ! if (o instanceof BeanContext) ! { ! BeanContext context = (BeanContext) o; ! if (!contexts.contains(context)) ! { ! contexts.add(context); ! context.addBeanContextMembershipListener(this); ! } ! } ! this.indexer.put(o, computePath(bcme.getBeanContext(), o)); ! } ! this.fireTreeStructureChanged(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcme Description of the Parameter ! */ ! public void childrenRemoved(BeanContextMembershipEvent bcme) ! { ! for (Iterator it = bcme.iterator(); it.hasNext(); ) ! { ! Object o = it.next(); ! if (o instanceof BeanContext) ! { ! BeanContext context = (BeanContext) o; ! if (contexts.contains(context)) ! { ! context.removeBeanContextMembershipListener(this); ! contexts.remove(context); ! } ! } ! this.indexer.remove(o); ! } ! this.fireTreeStructureChanged(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object find(Object o) ! { ! return this.indexer.get(o); ! } ! ! ! /** ! * Gets the child attribute of the BeanContextTreeModel object ! * ! * @param parent Description of the Parameter ! * @param index Description of the Parameter ! * @return The child value ! */ ! public Object getChild(Object parent, int index) ! { ! Collection c = (Collection) parent; ! int i = 0; ! Object result = null; ! for (Iterator it = c.iterator(); it.hasNext(); i++) ! { ! result = it.next(); ! if (i == index) ! { ! break; ! } ! result = null; ! } ! return result; ! } ! ! ! /** ! * Gets the childCount attribute of the BeanContextTreeModel object ! * ! * @param parent Description of the Parameter ! * @return The childCount value ! */ ! public int getChildCount(Object parent) ! { ! Collection c = (Collection) parent; ! return c.size(); ! } ! ! ! /** ! * Gets the indexOfChild attribute of the BeanContextTreeModel object ! * ! * @param parent Description of the Parameter ! * @param child Description of the Parameter ! * @return The indexOfChild value ! */ ! public int getIndexOfChild(Object parent, Object child) ! { ! Collection c = (Collection) parent; ! int i = 0; ! int index = -1; ! for (Iterator it = c.iterator(); it.hasNext(); i++) ! { ! if (it.next().equals(child)) ! { ! index = i; ! break; ! } ! } ! return index; ! } ! ! ! /** ! * Gets the root attribute of the BeanContextTreeModel object ! * ! * @return The root value ! */ ! public Object getRoot() ! { ! return this.root; ! } ! ! ! /** ! * Gets the leaf attribute of the BeanContextTreeModel object ! * ! * @param node Description of the Parameter ! * @return The leaf value ! */ ! public boolean isLeaf(Object node) ! { ! Collection c = (Collection) node; ! return (c.size() == 0); ! } ! ! ! /** ! * Description of the Method ! * ! * @param tml Description of the Parameter ! */ ! public void removeTreeModelListener(TreeModelListener tml) ! { ! this.listeners.remove(tml); ! } ! ! ! /** ! * Sets the indexer attribute of the BeanContextTreeModel object ! * ! * @param indexer The new indexer value ! */ ! public void setIndexer(ObjectIndexer indexer) ! { ! this.indexer = indexer; ! } ! ! ! /** ! * Description of the Method ! * ! * @param path Description of the Parameter ! * @param newValue Description of the Parameter ! */ ! public void valueForPathChanged(TreePath path, Object newValue) ! { ! throw new UnsupportedOperationException("Not yet implemented"); ! } ! ! ! /** ! * Description of the Method ! * ! * @param parent Description of the Parameter ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! protected Object[] computePath(BeanContext parent, Object o) ! { ! ArrayList paths = new ArrayList(); ! BeanContext current = parent; ! paths.add(parent); ! paths.add(o); ! while (this.root.equals(current.getBeanContext())) ! { ! current = current.getBeanContext(); ! paths.add(0, current); ! } ! return paths.toArray(); ! } ! ! ! /** Description of the Method */ ! protected void fireTreeNodesChanged() ! { ! TreeModelEvent event = new TreeModelEvent(this, new TreePath(this.root)); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! TreeModelListener listener = (TreeModelListener) copy[i]; ! listener.treeNodesChanged(event); ! } ! } ! ! ! /** Description of the Method */ ! protected void fireTreeNodesInserted() ! { ! TreeModelEvent event = new TreeModelEvent(this, new TreePath(this.root)); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! TreeModelListener listener = (TreeModelListener) copy[i]; ! listener.treeNodesInserted(event); ! } ! } ! ! ! /** Description of the Method */ ! protected void fireTreeNodesRemoved() ! { ! TreeModelEvent event = new TreeModelEvent(this, new TreePath(this.root)); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! TreeModelListener listener = (TreeModelListener) copy[i]; ! listener.treeNodesRemoved(event); ! } ! } ! ! ! /** Description of the Method */ ! protected void fireTreeStructureChanged() ! { ! TreeModelEvent event = new TreeModelEvent(this, new TreePath(this.root)); ! Object[] copy = this.listeners.toArray(); ! for (int i = 0; i < copy.length; i++) ! { ! TreeModelListener listener = (TreeModelListener) copy[i]; ! listener.treeStructureChanged(event); ! } ! } ! } Index: BeanContextTreePanel.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/BeanContextTreePanel.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** BeanContextTreePanel.java 15 Sep 2003 22:37:12 -0000 1.8 --- BeanContextTreePanel.java 13 Dec 2003 21:29:34 -0000 1.9 *************** *** 1,165 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Dimension; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextContainerProxy; ! ! import javax.swing.BorderFactory; ! import javax.swing.JLabel; ! import javax.swing.JPanel; ! import javax.swing.JScrollPane; ! import javax.swing.JSplitPane; ! import javax.swing.SwingUtilities; ! import javax.swing.event.TreeModelEvent; ! import javax.swing.event.TreeSelectionEvent; ! import javax.swing.event.TreeSelectionListener; ! import javax.swing.tree.TreePath; ! ! import org.apache.log4j.lf5.viewer.categoryexplorer.TreeModelAdapter; ! import org.ejtools.adwt.util.ObjectIndexer; ! import org.ejtools.adwt.util.ObjectRenderer; ! import org.ejtools.adwt.util.ObjectSearcher; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class BeanContextTreePanel extends JSplitPane implements ObjectSearcher ! { ! /** Description of the Field */ ! protected BeanContextTree tree; ! ! ! /** ! * Constructor for the BeanContextPanel object ! * ! * @param beancontext Description of Parameter ! */ ! public BeanContextTreePanel(BeanContext beancontext) ! { ! this(beancontext, null); ! } ! ! ! /** ! * Constructor for the BeanContextPanel object ! * ! * @param beancontext Description of Parameter ! * @param title Description of the Parameter ! */ ! public BeanContextTreePanel(BeanContext beancontext, String title) ! { ! super(JSplitPane.HORIZONTAL_SPLIT); ! if (title != null) ! { ! this.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), title)); ! } ! BeanContextTreeModel model = new BeanContextTreeModel(beancontext); ! this.tree = new BeanContextTree(model); ! ! JScrollPane jscrollpane = new JScrollPane(tree); ! jscrollpane.setMinimumSize(new Dimension(200, 200)); ! jscrollpane.setPreferredSize(new Dimension(300, 400)); ! ! final JPanel dummyMsg = new JPanel(); ! dummyMsg.add(new JLabel("")); ! ! this.setLeftComponent(jscrollpane); ! this.setRightComponent(dummyMsg); ! ! this.tree.addTreeSelectionListener( ! new TreeSelectionListener() ! { ! public void valueChanged(TreeSelectionEvent treeselectionevent) ! { ! final TreePath selPath = treeselectionevent.getNewLeadSelectionPath(); ! SwingUtilities.invokeLater( ! new Runnable() ! { ! public void run() ! { ! try ! { ! Object obj = selPath.getLastPathComponent(); ! if (obj instanceof BeanContextChildComponentProxy) ! { ! BeanContextChildComponentProxy beancontextchildcomponentproxy = (BeanContextChildComponentProxy) obj; ! BeanContextTreePanel.this.setRightComponent(beancontextchildcomponentproxy.getComponent()); ! } ! else if (obj instanceof BeanContextContainerProxy) ! { ! BeanContextContainerProxy beancontextcontainerproxy = (BeanContextContainerProxy) obj; ! BeanContextTreePanel.this.setRightComponent(beancontextcontainerproxy.getContainer()); ! } ! BeanContextTreePanel.this.validate(); ! } ! catch (Exception e) ! { ! // Ignore it ! } ! } ! }); ! } ! }); ! ! this.tree.getModel().addTreeModelListener( ! new TreeModelAdapter() ! { ! public void treeNodesRemoved(TreeModelEvent treemodelevent) ! { ! BeanContextTreePanel.this.selectRoot(); ! } ! }); ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object find(Object o) ! { ! return this.tree.find(o); ! } ! ! ! /** Description of the Method */ ! public void selectRoot() ! { ! this.tree.selectRoot(); ! } ! ! ! /** ! * Sets the indexer attribute of the BeanContextTreePanel2 object ! * ! * @param indexer The new indexer value ! */ ! public void setIndexer(ObjectIndexer indexer) ! { ! this.tree.setIndexer(indexer); ! } ! ! ! /** ! * Sets the renderer attribute of the BeanContextTreePanel object ! * ! * @param renderer The new renderer value ! */ ! public void setRenderer(ObjectRenderer renderer) ! { ! this.tree.setRenderer(renderer); ! } ! } --- 1,165 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Dimension; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextContainerProxy; ! ! import javax.swing.BorderFactory; ! import javax.swing.JLabel; ! import javax.swing.JPanel; ! import javax.swing.JScrollPane; ! import javax.swing.JSplitPane; ! import javax.swing.SwingUtilities; ! import javax.swing.event.TreeModelEvent; ! import javax.swing.event.TreeSelectionEvent; ! import javax.swing.event.TreeSelectionListener; ! import javax.swing.tree.TreePath; ! ! import org.apache.log4j.lf5.viewer.categoryexplorer.TreeModelAdapter; ! import org.ejtools.adwt.util.ObjectIndexer; ! import org.ejtools.adwt.util.ObjectRenderer; ! import org.ejtools.adwt.util.ObjectSearcher; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class BeanContextTreePanel extends JSplitPane implements ObjectSearcher ! { ! /** Description of the Field */ ! protected BeanContextTree tree; ! ! ! /** ! * Constructor for the BeanContextPanel object ! * ! * @param beancontext Description of Parameter ! */ ! public BeanContextTreePanel(BeanContext beancontext) ! { ! this(beancontext, null); ! } ! ! ! /** ! * Constructor for the BeanContextPanel object ! * ! * @param beancontext Description of Parameter ! * @param title Description of the Parameter ! */ ! public BeanContextTreePanel(BeanContext beancontext, String title) ! { ! super(JSplitPane.HORIZONTAL_SPLIT); ! if (title != null) ! { ! this.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), title)); ! } ! BeanContextTreeModel model = new BeanContextTreeModel(beancontext); ! this.tree = new BeanContextTree(model); ! ! JScrollPane jscrollpane = new JScrollPane(tree); ! jscrollpane.setMinimumSize(new Dimension(200, 200)); ! jscrollpane.setPreferredSize(new Dimension(300, 400)); ! ! final JPanel dummyMsg = new JPanel(); ! dummyMsg.add(new JLabel("")); ! ! this.setLeftComponent(jscrollpane); ! this.setRightComponent(dummyMsg); ! ! this.tree.addTreeSelectionListener( ! new TreeSelectionListener() ! { ! public void valueChanged(TreeSelectionEvent treeselectionevent) ! { ! final TreePath selPath = treeselectionevent.getNewLeadSelectionPath(); ! SwingUtilities.invokeLater( ! new Runnable() ! { ! public void run() ! { ! try ! { ! Object obj = selPath.getLastPathComponent(); ! if (obj instanceof BeanContextChildComponentProxy) ! { ! BeanContextChildComponentProxy beancontextchildcomponentproxy = (BeanContextChildComponentProxy) obj; ! BeanContextTreePanel.this.setRightComponent(beancontextchildcomponentproxy.getComponent()); ! } ! else if (obj instanceof BeanContextContainerProxy) ! { ! BeanContextContainerProxy beancontextcontainerproxy = (BeanContextContainerProxy) obj; ! BeanContextTreePanel.this.setRightComponent(beancontextcontainerproxy.getContainer()); ! } ! BeanContextTreePanel.this.validate(); ! } ! catch (Exception e) ! { ! // Ignore it ! } ! } ! }); ! } ! }); ! ! this.tree.getModel().addTreeModelListener( ! new TreeModelAdapter() ! { ! public void treeNodesRemoved(TreeModelEvent treemodelevent) ! { ! BeanContextTreePanel.this.selectRoot(); ! } ! }); ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object find(Object o) ! { ! return this.tree.find(o); ! } ! ! ! /** Description of the Method */ ! public void selectRoot() ! { ! this.tree.selectRoot(); ! } ! ! ! /** ! * Sets the indexer attribute of the BeanContextTreePanel2 object ! * ! * @param indexer The new indexer value ! */ ! public void setIndexer(ObjectIndexer indexer) ! { ! this.tree.setIndexer(indexer); ! } ! ! ! /** ! * Sets the renderer attribute of the BeanContextTreePanel object ! * ! * @param renderer The new renderer value ! */ ! public void setRenderer(ObjectRenderer renderer) ! { ! this.tree.setRenderer(renderer); ! } ! } Index: GenericMethodDialog.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/GenericMethodDialog.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GenericMethodDialog.java 15 Sep 2003 22:37:12 -0000 1.4 --- GenericMethodDialog.java 13 Dec 2003 21:29:34 -0000 1.5 *************** *** 1,225 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Component; ! import java.awt.Dimension; ! import java.awt.Frame; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.Insets; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.beans.MethodDescriptor; ! import java.beans.ParameterDescriptor; ! import java.beans.PropertyEditor; ! import java.beans.PropertyEditorManager; ! import java.lang.reflect.InvocationTargetException; ! import java.util.Vector; ! ! import javax.swing.JButton; ! import javax.swing.JDialog; ! import javax.swing.JLabel; ! import javax.swing.JOptionPane; ! import javax.swing.JPanel; ! ! import com.dreambean.awt.GenericPropertyCustomizer; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GenericMethodDialog extends JDialog ! implements ActionListener ! { ! /** Description of the Field */ ! protected Vector editors; ! /** Description of the Field */ ! protected MethodDescriptor md; ! /** Description of the Field */ ! protected Object obj; ! ! ! /** Constructor for GenericMethodDialog. */ ! public GenericMethodDialog() ! { ! super(); ! } ! ! ! /** ! *Constructor for the GenericMethodDialog object ! * ! * @param obj1 Description of the Parameter ! * @param methoddescriptor Description of the Parameter ! * @param frame Description of the Parameter ! */ ! public GenericMethodDialog(Object obj1, MethodDescriptor methoddescriptor, F... [truncated message content] |
From: <let...@us...> - 2003-12-14 10:42:42
|
Update of /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common/src/main/org/ejtools/archive Modified Files: Archive.java Entry.java JarArchive.java JarEntry.java Added Files: package.html Log Message: Add more javadocs. Add package.html files. --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> Provides a simple API to read/write/browse archive (nested or not). </body> </html> Index: Archive.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/Archive.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Archive.java 15 Sep 2003 23:14:31 -0000 1.1 --- Archive.java 13 Dec 2003 21:27:48 -0000 1.2 *************** *** 11,14 **** --- 11,16 ---- /** + * Interface that defines an archive. Note that an archive can also be an archive entry. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 17,21 **** { /** ! * Gets the parent attribute of the Archive object * * @return The parent value --- 19,23 ---- { /** ! * Return the parent archive of this archive * * @return The parent value *************** *** 25,31 **** /** ! * Gets the nested attribute of the Archive object * ! * @return The nested value */ public boolean isNested(); --- 27,33 ---- /** ! * Returns whether or not this archive is nested in an other archive * ! * @return True if it is nested */ public boolean isNested(); *************** *** 33,39 **** /** ! * Gets the entries attribute of the Archive object * ! * @return The entries value */ public Enumeration getEntries(); --- 35,41 ---- /** ! * Returns an enumeration of entries contained in this archive * ! * @return The entries enumeration */ public Enumeration getEntries(); *************** *** 41,47 **** /** ! * Description of the Method * ! * @return Description of the Return Value */ public Iterator iterator(); --- 43,49 ---- /** ! * Return an Iterator of the entries contained in this archive * ! * @return The entries Iterator */ public Iterator iterator(); *************** *** 49,55 **** /** ! * Adds a feature to the Entry attribute of the Archive object * ! * @param entry The feature to be added to the Entry attribute */ public void addEntry(Entry entry); --- 51,57 ---- /** ! * Adds an entry to this archive * ! * @param entry The archive entry to be added */ public void addEntry(Entry entry); *************** *** 57,63 **** /** ! * Description of the Method * ! * @param uri Description of the Parameter */ public void removeEntry(String uri); --- 59,65 ---- /** ! * Removes an entry from this archive * ! * @param uri The archive entry to be removed */ public void removeEntry(String uri); *************** *** 65,71 **** /** ! * Description of the Method * ! * @param entry Description of the Parameter */ public void removeEntry(Entry entry); --- 67,73 ---- /** ! * Removes an entry from this archive * ! * @param entry The archive entry to be removed */ public void removeEntry(Entry entry); *************** *** 73,80 **** /** ! * Gets the entry attribute of the Archive object * ! * @param uri Description of the Parameter ! * @return The entry value */ public Entry getEntry(String uri); --- 75,82 ---- /** ! * Returns the archive entry designated by this URI * ! * @param uri The URI of the entry ! * @return The archiev entry if exists */ public Entry getEntry(String uri); *************** *** 82,88 **** /** ! * Gets the manifest attribute of the Archive object * ! * @return The manifest value */ public Entry getManifest(); --- 84,90 ---- /** ! * Returns the manifest entry of this archive * ! * @return The manifest entry */ public Entry getManifest(); Index: Entry.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/Entry.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Entry.java 15 Sep 2003 23:14:31 -0000 1.1 --- Entry.java 13 Dec 2003 21:27:48 -0000 1.2 *************** *** 12,15 **** --- 12,17 ---- /** + * Interface that defines an archive entry. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 18,24 **** { /** ! * Description of the Method * ! * @param visitor Description of the Parameter */ public void accept(Reader visitor); --- 20,26 ---- { /** ! * Visitor Pattern method to accept a Reader visitor * ! * @param visitor The reader visitor */ public void accept(Reader visitor); *************** *** 26,32 **** /** ! * Description of the Method * ! * @param visitor Description of the Parameter */ public void accept(Writer visitor); --- 28,34 ---- /** ! * Visitor Pattern method to accept a Writer visitor * ! * @param visitor The writer visitor */ public void accept(Writer visitor); *************** *** 34,40 **** /** ! * Adds a feature to the To attribute of the Entry object * ! * @param archive The feature to be added to the To attribute */ public void addTo(Archive archive); --- 36,42 ---- /** ! * Adds this entry to an archive * ! * @param archive The archive to be added to */ public void addTo(Archive archive); *************** *** 42,48 **** /** ! * Gets the archive attribute of the ArchiveEntry object * ! * @return The archive value */ public boolean isArchive(); --- 44,50 ---- /** ! * Is this entry an archive ? * ! * @return True if this entry is an archive */ public boolean isArchive(); *************** *** 50,56 **** /** ! * Gets the uRI attribute of the ArchiveEntry object * ! * @return The uRI value */ public String getURI(); --- 52,58 ---- /** ! * Return the absolute URI of this entry * ! * @return The URI */ public String getURI(); *************** *** 58,64 **** /** ! * Sets the uRI attribute of the Entry object * ! * @param uri The new uRI value */ public void setURI(String uri); --- 60,66 ---- /** ! * Sets the URI of this entry * ! * @param uri The new URI */ public void setURI(String uri); *************** *** 66,72 **** /** ! * Sets the content attribute of the ArchiveEntry object * ! * @param content The new content value */ public void setContent(byte[] content); --- 68,74 ---- /** ! * Sets the content of this entry * ! * @param content The new content */ public void setContent(byte[] content); *************** *** 74,80 **** /** ! * Gets the content attribute of the ArchiveEntry object * ! * @return The content value */ public byte[] getContent(); --- 76,82 ---- /** ! * Returns the content of this entry * ! * @return The content */ public byte[] getContent(); Index: JarArchive.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/JarArchive.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JarArchive.java 15 Sep 2003 23:14:31 -0000 1.1 --- JarArchive.java 13 Dec 2003 21:27:48 -0000 1.2 *************** *** 17,20 **** --- 17,22 ---- /** + * Implementation for a Jar based archive. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 29,35 **** /** ! *Constructor for the JarArchive object * ! * @param uri Description of the Parameter */ public JarArchive(String uri) --- 31,37 ---- /** ! * Constructor for the JarArchive object * ! * @param uri The URI of the archive */ public JarArchive(String uri) *************** *** 40,48 **** /** ! * Description of the Method * ! * @param visitor Description of the Parameter */ ! public void accept(Reader visitor) { visitor.visit(this); --- 42,50 ---- /** ! * Visitor Pattern method to accept a Writer visitor * ! * @param visitor The writer visitor */ ! public void accept(Writer visitor) { visitor.visit(this); *************** *** 51,59 **** /** ! * Description of the Method * ! * @param visitor Description of the Parameter */ ! public void accept(Writer visitor) { visitor.visit(this); --- 53,61 ---- /** ! * Visitor Pattern method to accept a Reader visitor * ! * @param visitor The reader visitor */ ! public void accept(Reader visitor) { visitor.visit(this); *************** *** 62,68 **** /** ! * Adds a feature to the Entry attribute of the JarArchive object * ! * @param entry The feature to be added to the Entry attribute */ public void addEntry(Entry entry) --- 64,70 ---- /** ! * Adds an entry to this archive * ! * @param entry The archive entry to be added */ public void addEntry(Entry entry) *************** *** 85,91 **** /** ! * Gets the entries attribute of the JarArchive object * ! * @return The entries value */ public Enumeration getEntries() --- 87,93 ---- /** ! * Returns an enumeration of entries contained in this archive * ! * @return The entries enumeration */ public Enumeration getEntries() *************** *** 96,103 **** /** ! * Gets the entry attribute of the JarArchive object * ! * @param uri Description of the Parameter ! * @return The entry value */ public Entry getEntry(String uri) --- 98,105 ---- /** ! * Returns the archive entry designated by this URI * ! * @param uri The URI of the entry ! * @return The archiev entry if exists */ public Entry getEntry(String uri) *************** *** 108,114 **** /** ! * Gets the manifest attribute of the JarArchive object * ! * @return The manifest value */ public Entry getManifest() --- 110,116 ---- /** ! * Returns the manifest entry of this archive * ! * @return The manifest entry */ public Entry getManifest() *************** *** 119,123 **** /** ! * Gets the parent attribute of the JarArchive object * * @return The parent value --- 121,125 ---- /** ! * Return the parent archive of this archive * * @return The parent value *************** *** 130,137 **** /** ! * Gets the archive attribute of the JarArchiveEntry object * ! * @return The archive value ! * @see test.archive.ArchiveEntry#isArchive() */ public boolean isArchive() --- 132,138 ---- /** ! * Always returns true as it is an archive * ! * @return Always true */ public boolean isArchive() *************** *** 142,148 **** /** ! * Gets the nested attribute of the JarArchive object * ! * @return The nested value */ public boolean isNested() --- 143,149 ---- /** ! * Returns whether or not this archive is nested in an other archive * ! * @return True if it is nested */ public boolean isNested() *************** *** 153,159 **** /** ! * Description of the Method * ! * @return Description of the Return Value */ public Iterator iterator() --- 154,160 ---- /** ! * Return an Iterator of the entries contained in this archive * ! * @return The entries Iterator */ public Iterator iterator() *************** *** 164,170 **** /** ! * Description of the Method * ! * @param uri Description of the Parameter */ public void removeEntry(String uri) --- 165,171 ---- /** ! * Removes an entry from this archive * ! * @param uri The archive entry to be removed */ public void removeEntry(String uri) *************** *** 175,181 **** /** ! * Description of the Method * ! * @param entry Description of the Parameter */ public void removeEntry(Entry entry) --- 176,182 ---- /** ! * Removes an entry from this archive * ! * @param entry The archive entry to be removed */ public void removeEntry(Entry entry) Index: JarEntry.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/JarEntry.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JarEntry.java 15 Sep 2003 23:14:31 -0000 1.1 --- JarEntry.java 13 Dec 2003 21:27:48 -0000 1.2 *************** *** 11,14 **** --- 11,16 ---- /** + * Implementation for a Jar based entry. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 16,29 **** public class JarEntry implements Entry { ! /** Description of the Field */ private byte[] content; ! /** Description of the Field */ private String uri = ""; /** ! *Constructor for the JarEntry object * ! * @param uri Description of the Parameter */ public JarEntry(String uri) --- 18,31 ---- public class JarEntry implements Entry { ! /** The binary content */ private byte[] content; ! /** The absolute URI */ private String uri = ""; /** ! * Constructor for the JarEntry object * ! * @param uri The URI of the entry */ public JarEntry(String uri) *************** *** 34,40 **** /** ! * Description of the Method * ! * @param visitor Description of the Parameter */ public void accept(Writer visitor) --- 36,42 ---- /** ! * Visitor Pattern method to accept a Writer visitor * ! * @param visitor The writer visitor */ public void accept(Writer visitor) *************** *** 45,51 **** /** ! * Description of the Method * ! * @param visitor Description of the Parameter */ public void accept(Reader visitor) --- 47,53 ---- /** ! * Visitor Pattern method to accept a Reader visitor * ! * @param visitor The reader visitor */ public void accept(Reader visitor) *************** *** 56,62 **** /** ! * Adds a feature to the To attribute of the JarArchiveEntry object * ! * @param archive The feature to be added to the To attribute */ public void addTo(Archive archive) --- 58,64 ---- /** ! * Adds this entry to an archive * ! * @param archive The archive to be added to */ public void addTo(Archive archive) *************** *** 67,73 **** /** ! * Gets the content attribute of the JarArchiveEntry object * ! * @return The content value */ public byte[] getContent() --- 69,75 ---- /** ! * Returns the content of this entry * ! * @return The content */ public byte[] getContent() *************** *** 78,85 **** /** ! * Gets the uRI attribute of the JarArchiveEntry object * ! * @return The uRI value ! * @see test.archive.ArchiveEntry#getURI() */ public String getURI() --- 80,86 ---- /** ! * Return the absolute URI of this entry * ! * @return The URI */ public String getURI() *************** *** 90,97 **** /** ! * Gets the archive attribute of the JarArchiveEntry object * ! * @return The archive value ! * @see test.archive.ArchiveEntry#isArchive() */ public boolean isArchive() --- 91,97 ---- /** ! * Always returns false as it is not an archive * ! * @return Always false */ public boolean isArchive() *************** *** 102,108 **** /** ! * Sets the content attribute of the JarArchiveEntry object * ! * @param content The new content value */ public void setContent(byte[] content) --- 102,108 ---- /** ! * Sets the content of this entry * ! * @param content The new content */ public void setContent(byte[] content) *************** *** 113,119 **** /** ! * Sets the uRI attribute of the JarEntry object * ! * @param uri The new uRI value */ public void setURI(String uri) --- 113,119 ---- /** ! * Sets the URI of this entry * ! * @param uri The new URI */ public void setURI(String uri) |
From: <let...@us...> - 2003-12-14 10:42:41
|
Update of /cvsroot/ejtools/libraries/common In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common Modified Files: .classpath project.xml Log Message: Add more javadocs. Add package.html files. Index: .classpath =================================================================== RCS file: /cvsroot/ejtools/libraries/common/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .classpath 15 Sep 2003 22:23:44 -0000 1.1 --- .classpath 13 Dec 2003 21:27:48 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- <classpath> <classpathentry kind="src" path="src/main"/> + <classpathentry kind="src" path="src/resources"/> <classpathentry kind="src" path="src/test"/> <classpathentry kind="src" path="/ejtools-thirdparty"/> *************** *** 8,15 **** <classpathentry kind="var" path="MAVEN_REPO/log4j/jars/log4j-1.2.8.jar"/> <classpathentry kind="var" path="MAVEN_REPO/mx4j/jars/mx4j-jmx-1.1.1.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/xalan/jars/xalan-2.4.1.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/xerces/jars/xerces-2.4.0.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/xml-apis/jars/xml-apis-1.0.b2.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/sun/jars/j2ee-1.4.0.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --- 9,12 ---- Index: project.xml =================================================================== RCS file: /cvsroot/ejtools/libraries/common/project.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** project.xml 8 Mar 2003 20:52:12 -0000 1.2 --- project.xml 13 Dec 2003 21:27:48 -0000 1.3 *************** *** 19,47 **** <dependencies> <dependency> - <id>log4j</id> - <version>1.2.7</version> - </dependency> - <dependency> <id>mx4j</id> <artifactId>mx4j-jmx</artifactId> ! <version>1.1</version> ! </dependency> ! <dependency> ! <id>xalan</id> ! <version>2.4.1</version> ! </dependency> ! <dependency> ! <id>xerces</id> ! <version>2.3.0</version> ! </dependency> ! <dependency> ! <id>xml-apis</id> ! <version>1.0.b2</version> ! </dependency> ! <!-- Local dependencies --> ! <dependency> ! <id>sun</id> ! <artifactId>j2ee</artifactId> ! <version>1.3.1</version> </dependency> </dependencies> --- 19,25 ---- <dependencies> <dependency> <id>mx4j</id> <artifactId>mx4j-jmx</artifactId> ! <version>1.1.1</version> </dependency> </dependencies> |
Update of /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/service In directory sc8-pr-cvs1:/tmp/cvs-serv18699/graph/src/main/org/ejtools/graph/service Modified Files: GraphConsumer.java GraphConsumerMediator.java GraphConsumerSelector.java GraphProducer.java GraphService.java GraphServiceProvider.java Log Message: Add more javadocs. Adjust text export. Index: GraphConsumer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/service/GraphConsumer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphConsumer.java 15 Sep 2003 22:11:22 -0000 1.4 --- GraphConsumer.java 13 Dec 2003 21:26:47 -0000 1.5 *************** *** 1,47 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface GraphConsumer ! { ! /** ! * Adds a feature to the GraphProducer attribute of the GraphService object ! * ! * @param producer The feature to be added to the GraphProducer attribute ! */ ! public void addGraphProducer(GraphProducer producer); ! ! ! /** ! * Description of the Method ! * ! * @param producer Description of the Parameter ! */ ! public void removeGraphProducer(GraphProducer producer); ! ! ! /** ! * Description of the Method ! * ! * @param producer Description of the Parameter ! * @return Description of the Return Value ! */ ! public boolean containsGraphProducer(GraphProducer producer); ! ! ! /** ! * Sets the consomptionDelay attribute of the GraphConsumer object ! * ! * @param value The new consomptionDelay value ! */ ! public void setDelay(long value); ! } --- 1,47 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface GraphConsumer ! { ! /** ! * Adds a feature to the GraphProducer attribute of the GraphService object ! * ! * @param producer The feature to be added to the GraphProducer attribute ! */ ! public void addGraphProducer(GraphProducer producer); ! ! ! /** ! * Description of the Method ! * ! * @param producer Description of the Parameter ! */ ! public void removeGraphProducer(GraphProducer producer); ! ! ! /** ! * Description of the Method ! * ! * @param producer Description of the Parameter ! * @return Description of the Return Value ! */ ! public boolean containsGraphProducer(GraphProducer producer); ! ! ! /** ! * Sets the consomptionDelay attribute of the GraphConsumer object ! * ! * @param value The new consomptionDelay value ! */ ! public void setDelay(long value); ! } Index: GraphConsumerMediator.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/service/GraphConsumerMediator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GraphConsumerMediator.java 15 Sep 2003 22:11:22 -0000 1.3 --- GraphConsumerMediator.java 13 Dec 2003 21:26:47 -0000 1.4 *************** *** 1,22 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface GraphConsumerMediator ! { ! /** ! * Gets the graphConsumers attribute of the GraphMediator object ! * ! * @return The graphConsumers value ! */ ! public GraphConsumer[] getGraphConsumers(); ! } --- 1,22 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface GraphConsumerMediator ! { ! /** ! * Gets the graphConsumers attribute of the GraphMediator object ! * ! * @return The graphConsumers value ! */ ! public GraphConsumer[] getGraphConsumers(); ! } Index: GraphConsumerSelector.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/service/GraphConsumerSelector.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphConsumerSelector.java 15 Sep 2003 22:11:22 -0000 1.4 --- GraphConsumerSelector.java 13 Dec 2003 21:26:47 -0000 1.5 *************** *** 1,96 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! import java.util.Arrays; ! import java.util.List; ! import java.util.ResourceBundle; ! ! import org.ejtools.graph.dialog.SelectGraphDialog; ! import org.ejtools.graph.frame.GraphInternalFrame; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public abstract class GraphConsumerSelector ! { ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.graph.GraphService"); ! ! ! /** ! * Description of the Method ! * ! * @param mediator Description of the Parameter ! * @param name Description of the Parameter ! * @return Description of the Return Value ! */ ! public static GraphConsumer select(GraphConsumerMediator mediator, String name) ! { ! GraphConsumer[] consumers = mediator.getGraphConsumers(); ! GraphConsumer consumer = null; ! ! for (int i = 0; i < consumers.length; i++) ! { ! GraphConsumer gc = consumers[i]; ! if (gc.toString().equals(name)) ! { ! consumer = gc; ! } ! } ! ! if (consumer == null) ! { ! GraphInternalFrame frame = new GraphInternalFrame(); ! frame.setName(name); ! consumer = frame; ! } ! ! return consumer; ! } ! ! ! /** ! * @param mediator Description of the Parameter ! * @return Description of the Return Value ! */ ! public static GraphConsumer selectWithDialog(GraphConsumerMediator mediator) ! { ! GraphConsumer[] consumers = mediator.getGraphConsumers(); ! List choices = Arrays.asList(consumers); ! Object initial = resources.getString("graph.text.untitled"); ! if (choices.size() > 0) ! { ! initial = choices.get(0); ! } ! SelectGraphDialog dialog = new SelectGraphDialog(null, choices.toArray(), initial); ! dialog.show(); ! Object selectedValue = dialog.getSelectedValue(); ! ! if (selectedValue == null) ! { ! return null; ! } ! ! int idx = choices.indexOf(selectedValue); ! GraphConsumer consumer = null; ! if (idx < 0) ! { ! GraphInternalFrame frame = new GraphInternalFrame(); ! frame.setName("" + selectedValue); ! consumer = frame; ! } ! else ! { ! consumer = (GraphConsumer) choices.get(idx); ! } ! return consumer; ! } ! } --- 1,96 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! import java.util.Arrays; ! import java.util.List; ! import java.util.ResourceBundle; ! ! import org.ejtools.graph.dialog.SelectGraphDialog; ! import org.ejtools.graph.frame.GraphInternalFrame; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public abstract class GraphConsumerSelector ! { ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.graph.GraphService"); ! ! ! /** ! * Description of the Method ! * ! * @param mediator Description of the Parameter ! * @param name Description of the Parameter ! * @return Description of the Return Value ! */ ! public static GraphConsumer select(GraphConsumerMediator mediator, String name) ! { ! GraphConsumer[] consumers = mediator.getGraphConsumers(); ! GraphConsumer consumer = null; ! ! for (int i = 0; i < consumers.length; i++) ! { ! GraphConsumer gc = consumers[i]; ! if (gc.toString().equals(name)) ! { ! consumer = gc; ! } ! } ! ! if (consumer == null) ! { ! GraphInternalFrame frame = new GraphInternalFrame(); ! frame.setName(name); ! consumer = frame; ! } ! ! return consumer; ! } ! ! ! /** ! * @param mediator Description of the Parameter ! * @return Description of the Return Value ! */ ! public static GraphConsumer selectWithDialog(GraphConsumerMediator mediator) ! { ! GraphConsumer[] consumers = mediator.getGraphConsumers(); ! List choices = Arrays.asList(consumers); ! Object initial = resources.getString("graph.text.untitled"); ! if (choices.size() > 0) ! { ! initial = choices.get(0); ! } ! SelectGraphDialog dialog = new SelectGraphDialog(null, choices.toArray(), initial); ! dialog.show(); ! Object selectedValue = dialog.getSelectedValue(); ! ! if (selectedValue == null) ! { ! return null; ! } ! ! int idx = choices.indexOf(selectedValue); ! GraphConsumer consumer = null; ! if (idx < 0) ! { ! GraphInternalFrame frame = new GraphInternalFrame(); ! frame.setName("" + selectedValue); ! consumer = frame; ! } ! else ! { ! consumer = (GraphConsumer) choices.get(idx); ! } ! return consumer; ! } ! } Index: GraphProducer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/service/GraphProducer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphProducer.java 15 Sep 2003 22:11:22 -0000 1.4 --- GraphProducer.java 13 Dec 2003 21:26:47 -0000 1.5 *************** *** 1,30 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface GraphProducer ! { ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public double produce(); ! ! ! /** ! * Gets the graphProducerId attribute of the GraphProducer object ! * ! * @return The graphProducerId value ! */ ! public String getGraphProducerId(); ! } --- 1,30 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface GraphProducer ! { ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public double produce(); ! ! ! /** ! * Gets the graphProducerId attribute of the GraphProducer object ! * ! * @return The graphProducerId value ! */ ! public String getGraphProducerId(); ! } Index: GraphService.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/service/GraphService.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphService.java 15 Sep 2003 22:11:22 -0000 1.4 --- GraphService.java 13 Dec 2003 21:26:47 -0000 1.5 *************** *** 1,47 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface GraphService extends GraphConsumerMediator ! { ! /** ! * Adds a feature to the GraphProducer attribute of the GraphService object ! * ! * @param producer The feature to be added to the GraphProducer attribute ! * @param consumer The feature to be added to the GraphProducer attribute ! */ ! public void addGraphProducer(GraphConsumer consumer, GraphProducer producer); ! ! ! /** ! * Description of the Method ! * ! * @param producer Description of the Parameter ! */ ! public void removeGraphProducer(GraphProducer producer); ! ! ! /** ! * Adds a feature to the GraphConsumer attribute of the GraphService object ! * ! * @param consumer The feature to be added to the GraphConsumer attribute ! */ ! public void addGraphConsumer(GraphConsumer consumer); ! ! ! /** ! * Description of the Method ! * ! * @param consumer Description of the Parameter ! */ ! public void removeGraphConsumer(GraphConsumer consumer); ! } --- 1,47 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public interface GraphService extends GraphConsumerMediator ! { ! /** ! * Adds a feature to the GraphProducer attribute of the GraphService object ! * ! * @param producer The feature to be added to the GraphProducer attribute ! * @param consumer The feature to be added to the GraphProducer attribute ! */ ! public void addGraphProducer(GraphConsumer consumer, GraphProducer producer); ! ! ! /** ! * Description of the Method ! * ! * @param producer Description of the Parameter ! */ ! public void removeGraphProducer(GraphProducer producer); ! ! ! /** ! * Adds a feature to the GraphConsumer attribute of the GraphService object ! * ! * @param consumer The feature to be added to the GraphConsumer attribute ! */ ! public void addGraphConsumer(GraphConsumer consumer); ! ! ! /** ! * Description of the Method ! * ! * @param consumer Description of the Parameter ! */ ! public void removeGraphConsumer(GraphConsumer consumer); ! } Index: GraphServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/service/GraphServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphServiceProvider.java 15 Sep 2003 22:11:22 -0000 1.4 --- GraphServiceProvider.java 13 Dec 2003 21:26:47 -0000 1.5 *************** *** 1,171 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.Sort; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GraphServiceProvider extends CustomBeanContextServiceProvider implements GraphService ! { ! /** Description of the Field */ ! protected GraphService service = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(GraphServiceProvider.class); ! ! ! /** Constructor for GraphServiceProvider. */ ! public GraphServiceProvider() ! { ! this.service = this; ! } ! ! ! /** ! * @param consumer The feature to be added to the GraphConsumer attribute ! */ ! public void addGraphConsumer(GraphConsumer consumer) ! { ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! parent.add(consumer); ! logger.debug("GraphConsumer added"); ! } ! } ! ! ! /** ! * @param consumer The feature to be added to the GraphProducer attribute ! * @param producer The feature to be added to the GraphProducer attribute ! */ ! public void addGraphProducer(GraphConsumer consumer, GraphProducer producer) ! { ! if (!this.containsGraphConsumer(consumer)) ! { ! this.addGraphConsumer(consumer); ! } ! consumer.addGraphProducer(producer); ! } ! ! ! /** ! * Description of the Method ! * ! * @param consumer Description of the Parameter ! * @return Description of the Return Value ! */ ! public boolean containsGraphConsumer(GraphConsumer consumer) ! { ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! return parent.contains(consumer); ! } ! return false; ! } ! ! ! /** ! * @param bcs Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return (new Vector()).iterator(); ! } ! ! ! /** ! * @return The graphConsumers value ! */ ! public GraphConsumer[] getGraphConsumers() ! { ! Vector result = new Vector(); ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! for (Iterator iterator = Sort.getChildrenByClass(parent.iterator(), GraphConsumer.class); iterator.hasNext(); ) ! { ! GraphConsumer consumer = (GraphConsumer) iterator.next(); ! result.add(consumer); ! } ! } ! return (GraphConsumer[]) result.toArray(new GraphConsumer[0]); ! } ! ! ! /** ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @param serviceSelector Description of the Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return this.service; ! } ! ! ! /** ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param service Description of the Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * @param consumer Description of the Parameter ! */ ! public void removeGraphConsumer(GraphConsumer consumer) ! { ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! parent.remove(consumer); ! logger.debug("GraphConsumer removed"); ! } ! } ! ! ! /** ! * @param producer Description of the Parameter ! */ ! public void removeGraphProducer(GraphProducer producer) ! { ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! for (Iterator iterator = Sort.getChildrenByClass(parent.iterator(), GraphConsumer.class); iterator.hasNext(); ) ! { ! GraphConsumer consumer = (GraphConsumer) iterator.next(); ! consumer.removeGraphProducer(producer); ! } ! } ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{GraphService.class}; ! } ! } --- 1,171 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.service; ! ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Iterator; ! import java.util.Vector; ! ! import org.apache.log4j.Logger; ! import org.ejtools.beans.Sort; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GraphServiceProvider extends CustomBeanContextServiceProvider implements GraphService ! { ! /** Description of the Field */ ! protected GraphService service = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(GraphServiceProvider.class); ! ! ! /** Constructor for GraphServiceProvider. */ ! public GraphServiceProvider() ! { ! this.service = this; ! } ! ! ! /** ! * @param consumer The feature to be added to the GraphConsumer attribute ! */ ! public void addGraphConsumer(GraphConsumer consumer) ! { ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! parent.add(consumer); ! logger.debug("GraphConsumer added"); ! } ! } ! ! ! /** ! * @param consumer The feature to be added to the GraphProducer attribute ! * @param producer The feature to be added to the GraphProducer attribute ! */ ! public void addGraphProducer(GraphConsumer consumer, GraphProducer producer) ! { ! if (!this.containsGraphConsumer(consumer)) ! { ! this.addGraphConsumer(consumer); ! } ! consumer.addGraphProducer(producer); ! } ! ! ! /** ! * Description of the Method ! * ! * @param consumer Description of the Parameter ! * @return Description of the Return Value ! */ ! public boolean containsGraphConsumer(GraphConsumer consumer) ! { ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! return parent.contains(consumer); ! } ! return false; ! } ! ! ! /** ! * @param bcs Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return (new Vector()).iterator(); ! } ! ! ! /** ! * @return The graphConsumers value ! */ ! public GraphConsumer[] getGraphConsumers() ! { ! Vector result = new Vector(); ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! for (Iterator iterator = Sort.getChildrenByClass(parent.iterator(), GraphConsumer.class); iterator.hasNext(); ) ! { ! GraphConsumer consumer = (GraphConsumer) iterator.next(); ! result.add(consumer); ! } ! } ! return (GraphConsumer[]) result.toArray(new GraphConsumer[0]); ! } ! ! ! /** ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param serviceClass Description of the Parameter ! * @param serviceSelector Description of the Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return this.service; ! } ! ! ! /** ! * @param bcs Description of the Parameter ! * @param requestor Description of the Parameter ! * @param service Description of the Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * @param consumer Description of the Parameter ! */ ! public void removeGraphConsumer(GraphConsumer consumer) ! { ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! parent.remove(consumer); ! logger.debug("GraphConsumer removed"); ! } ! } ! ! ! /** ! * @param producer Description of the Parameter ! */ ! public void removeGraphProducer(GraphProducer producer) ! { ! BeanContext parent = this.getBeanContext(); ! if (parent != null) ! { ! for (Iterator iterator = Sort.getChildrenByClass(parent.iterator(), GraphConsumer.class); iterator.hasNext(); ) ! { ! GraphConsumer consumer = (GraphConsumer) iterator.next(); ! consumer.removeGraphProducer(producer); ! } ! } ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{GraphService.class}; ! } ! } |
Update of /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph In directory sc8-pr-cvs1:/tmp/cvs-serv18699/graph/src/main/org/ejtools/graph Modified Files: Axis.java CompositeTrack.java DefaultGraphElement.java GraphElement.java GraphRenderer.java LabelElement.java Range.java Test.java Log Message: Add more javadocs. Adjust text export. Index: Axis.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/Axis.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Axis.java 15 Sep 2003 22:11:22 -0000 1.7 --- Axis.java 13 Dec 2003 21:26:46 -0000 1.8 *************** *** 1,173 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Dimension; ! import java.awt.Font; ! import java.text.DateFormat; ! import java.text.DecimalFormat; ! import java.text.Format; ! import java.text.NumberFormat; ! import java.util.Date; ! ! import org.ejtools.graph.renderer.AbstractGraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public abstract class Axis extends AbstractGraphRenderer ! { ! /** Description of the Field */ ! protected Dimension dimension = null; ! /** Description of the Field */ ! protected Format format = new DecimalFormat("0"); ! /** Description of the Field */ ! protected int orientation; ! /** Description of the Field */ ! protected int position; ! /** Description of the Field */ ! protected Range range = new Range(0.0d, 1.0d); ! /** Description of the Field */ ! protected static Font FONT = new Font("Courrier", Font.PLAIN, 10); ! /** Description of the Field */ ! public final static int BOTTOM = 4; ! /** Description of the Field */ ! public final static int HORIZONTAL = 0; ! /** Description of the Field */ ! public final static int LEFT = 2; ! /** Description of the Field */ ! public final static int RIGHT = 3; ! /** Description of the Field */ ! public final static int TOP = 5; ! /** Description of the Field */ ! public final static int VERTICAL = 1; ! ! ! /** Constructor for Axis. */ ! public Axis() { } ! ! ! /** ! * Returns the format. ! * ! * @return Format ! */ ! public Format getFormat() ! { ! return format; ! } ! ! ! /** ! * Gets the formated attribute of the Axis object ! * ! * @param value Description of the Parameter ! * @return The formated value ! */ ! public String getFormated(double value) ! { ! if (this.format instanceof NumberFormat) ! { ! return ((NumberFormat) this.format).format(value); ! } ! if (this.format instanceof DateFormat) ! { ! return ((DateFormat) this.format).format(new Date((long) value)); ! } ! return null; ! } ! ! ! /** ! * @return The minimumSize value ! */ ! public Dimension getMinimumSize() ! { ! if (this.dimension == null) ! { ! this.dimension = new Dimension(FONT.getSize() * 2, FONT.getSize() * 2); ! } ! return dimension; ! } ! ! ! /** ! * Returns the orientation. ! * ! * @return int ! */ ! public int getOrientation() ! { ! return orientation; ! } ! ! ! /** ! * Returns the position. ! * ! * @return int ! */ ! public int getPosition() ! { ! return position; ! } ! ! ! /** ! * @return The preferredSize value ! */ ! public Dimension getPreferredSize() ! { ! return this.getMinimumSize(); ! } ! ! ! /** ! * Returns the range. ! * ! * @return Range ! */ ! public Range getRange() ! { ! return range; ! } ! ! ! /** ! * Sets the format. ! * ! * @param format The format to set ! */ ! public void setFormat(Format format) ! { ! this.format = format; ! } ! ! ! /** ! * Sets the position. ! * ! * @param position The position to set ! */ ! public void setPosition(int position) ! { ! this.position = position; ! } ! ! ! /** ! * Sets the range. ! * ! * @param range The new range value ! */ ! public void setRange(Range range) ! { ! this.range = range; ! } ! } --- 1,173 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Dimension; ! import java.awt.Font; ! import java.text.DateFormat; ! import java.text.DecimalFormat; ! import java.text.Format; ! import java.text.NumberFormat; ! import java.util.Date; ! ! import org.ejtools.graph.renderer.AbstractGraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public abstract class Axis extends AbstractGraphRenderer ! { ! /** Description of the Field */ ! protected Dimension dimension = null; ! /** Description of the Field */ ! protected Format format = new DecimalFormat("0"); ! /** Description of the Field */ ! protected int orientation; ! /** Description of the Field */ ! protected int position; ! /** Description of the Field */ ! protected Range range = new Range(0.0d, 1.0d); ! /** Description of the Field */ ! protected static Font FONT = new Font("Courrier", Font.PLAIN, 10); ! /** Description of the Field */ ! public final static int BOTTOM = 4; ! /** Description of the Field */ ! public final static int HORIZONTAL = 0; ! /** Description of the Field */ ! public final static int LEFT = 2; ! /** Description of the Field */ ! public final static int RIGHT = 3; ! /** Description of the Field */ ! public final static int TOP = 5; ! /** Description of the Field */ ! public final static int VERTICAL = 1; ! ! ! /** Constructor for Axis. */ ! public Axis() { } ! ! ! /** ! * Returns the format. ! * ! * @return Format ! */ ! public Format getFormat() ! { ! return format; ! } ! ! ! /** ! * Gets the formated attribute of the Axis object ! * ! * @param value Description of the Parameter ! * @return The formated value ! */ ! public String getFormated(double value) ! { ! if (this.format instanceof NumberFormat) ! { ! return ((NumberFormat) this.format).format(value); ! } ! if (this.format instanceof DateFormat) ! { ! return ((DateFormat) this.format).format(new Date((long) value)); ! } ! return null; ! } ! ! ! /** ! * @return The minimumSize value ! */ ! public Dimension getMinimumSize() ! { ! if (this.dimension == null) ! { ! this.dimension = new Dimension(FONT.getSize() * 2, FONT.getSize() * 2); ! } ! return dimension; ! } ! ! ! /** ! * Returns the orientation. ! * ! * @return int ! */ ! public int getOrientation() ! { ! return orientation; ! } ! ! ! /** ! * Returns the position. ! * ! * @return int ! */ ! public int getPosition() ! { ! return position; ! } ! ! ! /** ! * @return The preferredSize value ! */ ! public Dimension getPreferredSize() ! { ! return this.getMinimumSize(); ! } ! ! ! /** ! * Returns the range. ! * ! * @return Range ! */ ! public Range getRange() ! { ! return range; ! } ! ! ! /** ! * Sets the format. ! * ! * @param format The format to set ! */ ! public void setFormat(Format format) ! { ! this.format = format; ! } ! ! ! /** ! * Sets the position. ! * ! * @param position The position to set ! */ ! public void setPosition(int position) ! { ! this.position = position; ! } ! ! ! /** ! * Sets the range. ! * ! * @param range The new range value ! */ ! public void setRange(Range range) ! { ! this.range = range; ! } ! } Index: CompositeTrack.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/CompositeTrack.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CompositeTrack.java 15 Sep 2003 22:11:22 -0000 1.7 --- CompositeTrack.java 13 Dec 2003 21:26:46 -0000 1.8 *************** *** 1,155 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Color; ! import java.awt.Graphics; ! import java.awt.GridLayout; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.JComponent; ! import javax.swing.JPanel; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class CompositeTrack implements GraphElement, LabelElement ! { ! /** Description of the Field */ ! protected JPanel component; ! /** Description of the Field */ ! protected GridLayout layout; ! /** Description of the Field */ ! protected Collection tracks = new Vector(); ! ! ! /** Constructor for the Track object */ ! public CompositeTrack() ! { ! this.layout = new GridLayout(1, 1, 1, 1); ! this.component = new JPanel(this.layout); ! } ! ! ! /** ! * Adds a feature to the Track attribute of the CompositeTrack object ! * ! * @param t The feature to be added to the Track attribute ! */ ! public void addTrack(Track t) ! { ! this.tracks.add(t); ! this.layout.setRows(this.tracks.size()); ! this.component.add(t.getComponent()); ! } ! ! ! /** Description of the Method */ ! public void clear() ! { ! synchronized (this.tracks) ! { ! for (Iterator it = this.tracks.iterator(); it.hasNext(); ) ! { ! ((Track) it.next()).clear(); ! } ! } ! } ! ! ! /** ! * @param graphics Description of the Parameter ! * @param scaleX Description of the Parameter ! * @param offsetX Description of the Parameter ! * @param scaleY Description of the Parameter ! * @param offsetY Description of the Parameter ! */ ! public void draw(Graphics graphics, double scaleX, double offsetX, double scaleY, double offsetY) ! { ! synchronized (this.tracks) ! { ! for (Iterator it = this.tracks.iterator(); it.hasNext(); ) ! { ! ((GraphElement) it.next()).draw(graphics, scaleX, offsetX, scaleY, offsetY); ! } ! } ! } ! ! ! /** ! * @return The color value ! */ ! public Color getColor() ! { ! return Color.black; ! } ! ! ! /** ! * @return The component value ! */ ! public JComponent getComponent() ! { ! return this.component; ! } ! ! ! /** ! * @return The xRange value ! */ ! public Range getXRange() ! { ! synchronized (this.tracks) ! { ! Range result = new Range(Double.MAX_VALUE, Double.MIN_VALUE); ! for (Iterator it = this.tracks.iterator(); it.hasNext(); ) ! { ! result = result.compose(((GraphElement) it.next()).getXRange()); ! } ! return result; ! } ! } ! ! ! /** ! * @return The yRange value ! */ ! public Range getYRange() ! { ! synchronized (this.tracks) ! { ! Range result = new Range(Double.MAX_VALUE, Double.MIN_VALUE); ! for (Iterator it = this.tracks.iterator(); it.hasNext(); ) ! { ! result = result.compose(((GraphElement) it.next()).getYRange()); ! } ! return result; ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param t Description of the Parameter ! */ ! public void removeTrack(Track t) ! { ! if (this.tracks.contains(t)) ! { ! this.component.remove(t.getComponent()); ! this.tracks.remove(t); ! this.layout.setRows(this.tracks.size()); ! } ! } ! } --- 1,155 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Color; ! import java.awt.Graphics; ! import java.awt.GridLayout; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.JComponent; ! import javax.swing.JPanel; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class CompositeTrack implements GraphElement, LabelElement ! { ! /** Description of the Field */ ! protected JPanel component; ! /** Description of the Field */ ! protected GridLayout layout; ! /** Description of the Field */ ! protected Collection tracks = new Vector(); ! ! ! /** Constructor for the Track object */ ! public CompositeTrack() ! { ! this.layout = new GridLayout(1, 1, 1, 1); ! this.component = new JPanel(this.layout); ! } ! ! ! /** ! * Adds a feature to the Track attribute of the CompositeTrack object ! * ! * @param t The feature to be added to the Track attribute ! */ ! public void addTrack(Track t) ! { ! this.tracks.add(t); ! this.layout.setRows(this.tracks.size()); ! this.component.add(t.getComponent()); ! } ! ! ! /** Description of the Method */ ! public void clear() ! { ! synchronized (this.tracks) ! { ! for (Iterator it = this.tracks.iterator(); it.hasNext(); ) ! { ! ((Track) it.next()).clear(); ! } ! } ! } ! ! ! /** ! * @param graphics Description of the Parameter ! * @param scaleX Description of the Parameter ! * @param offsetX Description of the Parameter ! * @param scaleY Description of the Parameter ! * @param offsetY Description of the Parameter ! */ ! public void draw(Graphics graphics, double scaleX, double offsetX, double scaleY, double offsetY) ! { ! synchronized (this.tracks) ! { ! for (Iterator it = this.tracks.iterator(); it.hasNext(); ) ! { ! ((GraphElement) it.next()).draw(graphics, scaleX, offsetX, scaleY, offsetY); ! } ! } ! } ! ! ! /** ! * @return The color value ! */ ! public Color getColor() ! { ! return Color.black; ! } ! ! ! /** ! * @return The component value ! */ ! public JComponent getComponent() ! { ! return this.component; ! } ! ! ! /** ! * @return The xRange value ! */ ! public Range getXRange() ! { ! synchronized (this.tracks) ! { ! Range result = new Range(Double.MAX_VALUE, Double.MIN_VALUE); ! for (Iterator it = this.tracks.iterator(); it.hasNext(); ) ! { ! result = result.compose(((GraphElement) it.next()).getXRange()); ! } ! return result; ! } ! } ! ! ! /** ! * @return The yRange value ! */ ! public Range getYRange() ! { ! synchronized (this.tracks) ! { ! Range result = new Range(Double.MAX_VALUE, Double.MIN_VALUE); ! for (Iterator it = this.tracks.iterator(); it.hasNext(); ) ! { ! result = result.compose(((GraphElement) it.next()).getYRange()); ! } ! return result; ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param t Description of the Parameter ! */ ! public void removeTrack(Track t) ! { ! if (this.tracks.contains(t)) ! { ! this.component.remove(t.getComponent()); ! this.tracks.remove(t); ! this.layout.setRows(this.tracks.size()); ! } ! } ! } Index: DefaultGraphElement.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/DefaultGraphElement.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DefaultGraphElement.java 15 Sep 2003 22:11:22 -0000 1.7 --- DefaultGraphElement.java 13 Dec 2003 21:26:46 -0000 1.8 *************** *** 1,64 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Color; ! import java.awt.Graphics; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DefaultGraphElement implements GraphElement ! { ! /** Description of the Field */ ! protected Range xr = new Range(0.0d, 1.0d); ! /** Description of the Field */ ! protected Range yr = new Range(0.0d, 1.0d); ! ! ! /** Constructor for DefaultElement. */ ! public DefaultGraphElement() { } ! ! ! /** ! * @param graphics Description of the Parameter ! * @param scaleX Description of the Parameter ! * @param offsetX Description of the Parameter ! * @param scaleY Description of the Parameter ! * @param offsetY Description of the Parameter ! */ ! public void draw(Graphics graphics, double scaleX, double offsetX, double scaleY, double offsetY) { } ! ! ! /** ! * @return The color value ! */ ! public Color getColor() ! { ! return Color.black; ! } ! ! ! /** ! * @return The xRange value ! */ ! public Range getXRange() ! { ! return this.xr; ! } ! ! ! /** ! * @return The yRange value ! */ ! public Range getYRange() ! { ! return this.yr; ! } ! } --- 1,64 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Color; ! import java.awt.Graphics; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DefaultGraphElement implements GraphElement ! { ! /** Description of the Field */ ! protected Range xr = new Range(0.0d, 1.0d); ! /** Description of the Field */ ! protected Range yr = new Range(0.0d, 1.0d); ! ! ! /** Constructor for DefaultElement. */ ! public DefaultGraphElement() { } ! ! ! /** ! * @param graphics Description of the Parameter ! * @param scaleX Description of the Parameter ! * @param offsetX Description of the Parameter ! * @param scaleY Description of the Parameter ! * @param offsetY Description of the Parameter ! */ ! public void draw(Graphics graphics, double scaleX, double offsetX, double scaleY, double offsetY) { } ! ! ! /** ! * @return The color value ! */ ! public Color getColor() ! { ! return Color.black; ! } ! ! ! /** ! * @return The xRange value ! */ ! public Range getXRange() ! { ! return this.xr; ! } ! ! ! /** ! * @return The yRange value ! */ ! public Range getYRange() ! { ! return this.yr; ! } ! } Index: GraphElement.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/GraphElement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GraphElement.java 15 Sep 2003 22:11:22 -0000 1.6 --- GraphElement.java 13 Dec 2003 21:26:46 -0000 1.7 *************** *** 1,53 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Color; ! import java.awt.Graphics; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface GraphElement ! { ! /** ! * Gets the xRange attribute of the GraphModel object ! * ! * @return The xRange value ! */ ! public Range getXRange(); ! ! ! /** ! * Gets the color attribute of the Element object ! * ! * @return The color value ! */ ! public Color getColor(); ! ! ! /** ! * Description of the Method ! * ! * @param graphics Description of the Parameter ! * @param scaleX Description of the Parameter ! * @param offsetX Description of the Parameter ! * @param scaleY Description of the Parameter ! * @param offsetY Description of the Parameter ! */ ! public void draw(Graphics graphics, double scaleX, double offsetX, double scaleY, double offsetY); ! ! ! /** ! * Gets the yRange attribute of the GraphModel object ! * ! * @return The yRange value ! */ ! public Range getYRange(); ! } --- 1,53 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Color; ! import java.awt.Graphics; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface GraphElement ! { ! /** ! * Gets the xRange attribute of the GraphModel object ! * ! * @return The xRange value ! */ ! public Range getXRange(); ! ! ! /** ! * Gets the color attribute of the Element object ! * ! * @return The color value ! */ ! public Color getColor(); ! ! ! /** ! * Description of the Method ! * ! * @param graphics Description of the Parameter ! * @param scaleX Description of the Parameter ! * @param offsetX Description of the Parameter ! * @param scaleY Description of the Parameter ! * @param offsetY Description of the Parameter ! */ ! public void draw(Graphics graphics, double scaleX, double offsetX, double scaleY, double offsetY); ! ! ! /** ! * Gets the yRange attribute of the GraphModel object ! * ! * @return The yRange value ! */ ! public Range getYRange(); ! } Index: GraphRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/GraphRenderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GraphRenderer.java 15 Sep 2003 22:11:22 -0000 1.6 --- GraphRenderer.java 13 Dec 2003 21:26:46 -0000 1.7 *************** *** 1,69 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! ! /** ! * Description of the Interface ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface GraphRenderer ! { ! /** Description of the Field */ ! public final static int ALIGN_LEFT = 0; ! /** Description of the Field */ ! public final static int ALIGN_RIGHT = 1; ! /** Description of the Field */ ! public final static int JUSTIFIED = 3; ! /** Description of the Field */ ! public final static int SMOOTH = 10; ! /** Description of the Field */ ! public final static int BOUNDED = 11; ! ! ! /** ! * Sets the graphElement attribute of the GraphRenderer object ! * ! * @param element The new graphElement value ! */ ! public void setGraphElement(GraphElement element); ! ! ! /** ! * Sets the display attribute of the GraphRenderer object ! * ! * @param type The new display value ! */ ! public void setHorizontalScaling(int type); ! ! ! /** ! * Sets the horizontalScale attribute of the GraphRenderer object ! * ! * @param multiplier The new horizontalScale value ! */ ! public void setHorizontalScale(double multiplier); ! ! ! /** ! * Sets the verticalScale attribute of the GraphRenderer object ! * ! * @param multiplier The new verticalScale value ! */ ! public void setVerticalScale(double multiplier); ! ! ! /** ! * Sets the verticalDisplay attribute of the GraphRenderer object ! * ! * @param type The new verticalDisplay value ! */ ! public void setVerticalScaling(int type); ! } --- 1,69 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! ! /** ! * Description of the Interface ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface GraphRenderer ! { ! /** Description of the Field */ ! public final static int ALIGN_LEFT = 0; ! /** Description of the Field */ ! public final static int ALIGN_RIGHT = 1; ! /** Description of the Field */ ! public final static int JUSTIFIED = 3; ! /** Description of the Field */ ! public final static int SMOOTH = 10; ! /** Description of the Field */ ! public final static int BOUNDED = 11; ! ! ! /** ! * Sets the graphElement attribute of the GraphRenderer object ! * ! * @param element The new graphElement value ! */ ! public void setGraphElement(GraphElement element); ! ! ! /** ! * Sets the display attribute of the GraphRenderer object ! * ! * @param type The new display value ! */ ! public void setHorizontalScaling(int type); ! ! ! /** ! * Sets the horizontalScale attribute of the GraphRenderer object ! * ! * @param multiplier The new horizontalScale value ! */ ! public void setHorizontalScale(double multiplier); ! ! ! /** ! * Sets the verticalScale attribute of the GraphRenderer object ! * ! * @param multiplier The new verticalScale value ! */ ! public void setVerticalScale(double multiplier); ! ! ! /** ! * Sets the verticalDisplay attribute of the GraphRenderer object ! * ! * @param type The new verticalDisplay value ! */ ! public void setVerticalScaling(int type); ! } Index: LabelElement.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/LabelElement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LabelElement.java 15 Sep 2003 22:11:22 -0000 1.6 --- LabelElement.java 13 Dec 2003 21:26:46 -0000 1.7 *************** *** 1,24 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import javax.swing.JComponent; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface LabelElement ! { ! /** ! * Gets the component attribute of the LabelElement object ! * ! * @return The component value ! */ ! public JComponent getComponent(); ! } --- 1,24 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import javax.swing.JComponent; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface LabelElement ! { ! /** ! * Gets the component attribute of the LabelElement object ! * ! * @return The component value ! */ ! public JComponent getComponent(); ! } Index: Range.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/Range.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Range.java 15 Sep 2003 22:11:22 -0000 1.6 --- Range.java 13 Dec 2003 21:26:46 -0000 1.7 *************** *** 1,122 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class Range ! { ! /** Description of the Field */ ! protected double max = 0.0f; ! /** Description of the Field */ ! protected double min = 0.0f; ! /** Description of the Field */ ! public final static int X_AXIS = 0; ! /** Description of the Field */ ! public final static int Y_AXIS = 1; ! ! ! /** ! *Constructor for the Range object ! * ! * @param min Description of the Parameter ! * @param max Description of the Parameter ! */ ! public Range(double min, double max) ! { ! this.min = (double) min; ! this.max = (double) max; ! } ! ! ! /** ! * Description of the Method ! * ! * @param range Description of the Parameter ! * @return Description of the Return Value ! */ ! public Range compose(Range range) ! { ! double nmin = Math.min(this.min, range.min); ! double nmax = Math.max(this.max, range.max); ! ! return new Range(nmin, nmax); ! } ! ! ! /** ! * Gets the max attribute of the Range object ! * ! * @return The max value ! */ ! public double getMax() ! { ! return this.max; ! } ! ! ! /** ! * Gets the min attribute of the Range object ! * ! * @return The min value ! */ ! public double getMin() ! { ! return this.min; ! } ! ! ! /** ! * Description of the Method ! * ! * @param value Description of the Parameter ! */ ! public synchronized void put(double value) ! { ! this.min = Math.min(this.min, value); ! this.max = Math.max(this.max, value); ! } ! ! ! /** ! * Sets the max. ! * ! * @param max The max to set ! */ ! public void setMax(double max) ! { ! this.max = max; ! } ! ! ! /** ! * Sets the min. ! * ! * @param min The min to set ! */ ! public void setMin(double min) ! { ! this.min = min; ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public String toString() ! { ! return "[" + getMin() + " to " + getMax() + "]"; ! } ! } --- 1,122 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class Range ! { ! /** Description of the Field */ ! protected double max = 0.0f; ! /** Description of the Field */ ! protected double min = 0.0f; ! /** Description of the Field */ ! public final static int X_AXIS = 0; ! /** Description of the Field */ ! public final static int Y_AXIS = 1; ! ! ! /** ! *Constructor for the Range object ! * ! * @param min Description of the Parameter ! * @param max Description of the Parameter ! */ ! public Range(double min, double max) ! { ! this.min = (double) min; ! this.max = (double) max; ! } ! ! ! /** ! * Description of the Method ! * ! * @param range Description of the Parameter ! * @return Description of the Return Value ! */ ! public Range compose(Range range) ! { ! double nmin = Math.min(this.min, range.min); ! double nmax = Math.max(this.max, range.max); ! ! return new Range(nmin, nmax); ! } ! ! ! /** ! * Gets the max attribute of the Range object ! * ! * @return The max value ! */ ! public double getMax() ! { ! return this.max; ! } ! ! ! /** ! * Gets the min attribute of the Range object ! * ! * @return The min value ! */ ! public double getMin() ! { ! return this.min; ! } ! ! ! /** ! * Description of the Method ! * ! * @param value Description of the Parameter ! */ ! public synchronized void put(double value) ! { ! this.min = Math.min(this.min, value); ! this.max = Math.max(this.max, value); ! } ! ! ! /** ! * Sets the max. ! * ! * @param max The max to set ! */ ! public void setMax(double max) ! { ! this.max = max; ! } ! ! ! /** ! * Sets the min. ! * ! * @param min The min to set ! */ ! public void setMin(double min) ! { ! this.min = min; ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public String toString() ! { ! return "[" + getMin() + " to " + getMax() + "]"; ! } ! } Index: Test.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/Test.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Test.java 15 Sep 2003 22:11:22 -0000 1.6 --- Test.java 13 Dec 2003 21:26:46 -0000 1.7 *************** *** 1,128 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.BorderLayout; ! import java.awt.Color; ! ! import javax.swing.JFrame; ! ! import org.ejtools.graph.renderer.TriAxisLayoutRenderer; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class Test ! { ! /** Constructor for Test. */ ! public Test() ! { ! super(); ! } ! ! ! /** ! * The main program for the Test class ! * ! * @param args The command line arguments ! * @exception Exception Description of the Exception ! */ ! public static void main(String[] args) ! throws Exception ! { ! Track t1 = new Track("Toto"); ! t1.setColor(Color.blue); ! Track t2 = new Track("Tata"); ! t2.setColor(Color.red); ! ! CompositeTrack ct = new CompositeTrack(); ! ct.addTrack(t1); ! ct.addTrack(t2); ! ! TriAxisLayoutRenderer cg = new TriAxisLayoutRenderer(); ! cg.setGraphElement(ct); ! ! // BorderGraph cg = new BorderGraph(); ! // cg.setGraphElement(t1); ! ! // Renderer rd = new DefaultRenderer(); ! // Renderer rd = new GridRenderer(new SimpleDateFormat("HH:mm:ss.SSS"), new DecimalFormat("0")); ! // cg.addRenderer(rd, BorderLayout.CENTER); ! // Axis axis = new HorizontalAxis(new SimpleDateFormat("HH:mm:ss.SSS"), Axis.BOTTOM); ! // cg.addRenderer(axis, BorderLayout.SOUTH); ! // axis = new VerticalAxis(new DecimalFormat("0"), Axis.LEFT); ! // cg.addRenderer(axis, BorderLayout.WEST); ! // axis = new VerticalAxis(new DecimalFormat("0"), Axis.RIGHT); ! // cg.addRenderer(axis, BorderLayout.EAST); ! ! /* ! * GridBagGraph cg = new GridBagGraph(); ! * cg.setGraphElement(ct); ! * GridBagConstraints constraints = new GridBagConstraints(); ! * / Renderer rd = new DefaultRenderer(); ! * Renderer rd = new GridRenderer(new SimpleDateFormat("HH:mm:ss.SSS"), new DecimalFormat("0")); ! * constraints.gridx = 1; ! * constraints.gridy = 0; ! * constraints.fill = GridBagConstraints.BOTH; ! * constraints.weightx = 1.0; ! * constraints.weighty = 1.0; ! * cg.addRenderer(rd, constraints); ! * Axis axis = new HorizontalAxis(new SimpleDateFormat("HH:mm:ss.SSS"), Axis.BOTTOM); ! * constraints.gridx = 1; ! * constraints.gridy = 1; ! * constraints.fill = GridBagConstraints.HORIZONTAL; ! * constraints.weightx = 0.0; ! * constraints.weighty = 0.0; ! * cg.addRenderer(axis, constraints); ! * axis = new VerticalAxis(new DecimalFormat("0"), Axis.LEFT); ! * constraints.gridx = 0; ! * constraints.gridy = 0; ! * constraints.fill = GridBagConstraints.VERTICAL; ! * constraints.weightx = 0.0; ! * constraints.weighty = 0.0; ! * cg.addRenderer(axis, constraints); ! * axis = new VerticalAxis(new DecimalFormat("0"), Axis.RIGHT); ! * constraints.gridx = 2; ! * constraints.gridy = 0; ! * constraints.fill = GridBagConstraints.VERTICAL; ! * constraints.weightx = 0.0; ! * constraints.weighty = 0.0; ! * cg.addRenderer(axis, constraints); ! */ ! cg.setVisible(true); ! ! JFrame frame = new JFrame("Test"); ! frame.getContentPane().setLayout(new BorderLayout()); ! frame.getContentPane().add(cg, BorderLayout.CENTER); ! frame.setSize(600, 400); ! ! frame.show(); ! ! double i = 0; ! double scale = 1.0d; ! while (i < 50) ! { ! System.out.println(i); ! t1.addValue(Math.cos(i * 10 * Math.PI / 180) * 20); ! t2.addValue(Math.sin(i * 10 * Math.PI / 180) * 20); ! Thread.sleep(200); ! cg.repaint(); ! i++; ! if ((i % 20) == 0) ! { ! scale = scale / 1.5; ! cg.setHorizontalScale(scale); ! } ! } ! ! System.exit(0); ! } ! } --- 1,128 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.BorderLayout; ! import java.awt.Color; ! ! import javax.swing.JFrame; ! ! import org.ejtools.graph.renderer.TriAxisLayoutRenderer; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class Test ! { ! /** Constructor for Test. */ ! public Test() ! { ! super(); ! } ! ! ! /** ! * The main program for the Test class ! * ! * @param args The command line arguments ! * @exception Exception Description of the Exception ! */ ! public static void main(String[] args) ! throws Exception ! { ! Track t1 = new Track("Toto"); ! t1.setColor(Color.blue); ! Track t2 = new Track("Tata"); ! t2.setColor(Color.red); ! ! CompositeTrack ct = new CompositeTrack(); ! ct.addTrack(t1); ! ct.addTrack(t2); ! ! TriAxisLayoutRenderer cg = new TriAxisLayoutRenderer(); ! cg.setGraphElement(ct); ! ! // BorderGraph cg = new BorderGraph(); ! // cg.setGraphElement(t1); ! ! // Renderer rd = new DefaultRenderer(); ! // Renderer rd = new GridRenderer(new SimpleDateFormat("HH:mm:ss.SSS"), new DecimalFormat("0")); ! // cg.addRenderer(rd, BorderLayout.CENTER); ! // Axis axis = new HorizontalAxis(new SimpleDateFormat("HH:mm:ss.SSS"), Axis.BOTTOM); ! // cg.addRenderer(axis, BorderLayout.SOUTH); ! // axis = new VerticalAxis(new DecimalFormat("0"), Axis.LEFT); ! // cg.addRenderer(axis, BorderLayout.WEST); ! // axis = new VerticalAxis(new DecimalFormat("0"), Axis.RIGHT); ! // cg.addRenderer(axis, BorderLayout.EAST); ! ! /* ! * GridBagGraph cg = new GridBagGraph(); ! * cg.setGraphElement(ct); ! * GridBagConstraints constraints = new GridBagConstraints(); ! * / Renderer rd = new DefaultRenderer(); ! * Renderer rd = new GridRenderer(new SimpleDateFormat("HH:mm:ss.SSS"), new DecimalFormat("0")); ! * constraints.gridx = 1; ! * constraints.gridy = 0; ! * constraints.fill = GridBagConstraints.BOTH; ! * constraints.weightx = 1.0; ! * constraints.weighty = 1.0; ! * cg.addRenderer(rd, constraints); ! * Axis axis = new HorizontalAxis(new SimpleDateFormat("HH:mm:ss.SSS"), Axis.BOTTOM); ! * constraints.gridx = 1; ! * constraints.gridy = 1; ! * constraints.fill = GridBagConstraints.HORIZONTAL; ! * constraints.weightx = 0.0; ! * constraints.weighty = 0.0; ! * cg.addRenderer(axis, constraints); ! * axis = new VerticalAxis(new DecimalFormat("0"), Axis.LEFT); ! * constraints.gridx = 0; ! * constraints.gridy = 0; ! * constraints.fill = GridBagConstraints.VERTICAL; ! * constraints.weightx = 0.0; ! * constraints.weighty = 0.0; ! * cg.addRenderer(axis, constraints); ! * axis = new VerticalAxis(new DecimalFormat("0"), Axis.RIGHT); ! * constraints.gridx = 2; ! * constraints.gridy = 0; ! * constraints.fill = GridBagConstraints.VERTICAL; ! * constraints.weightx = 0.0; ! * constraints.weighty = 0.0; ! * cg.addRenderer(axis, constraints); ! */ ! cg.setVisible(true); ! ! JFrame frame = new JFrame("Test"); ! frame.getContentPane().setLayout(new BorderLayout()); ! frame.getContentPane().add(cg, BorderLayout.CENTER); ! frame.setSize(600, 400); ! ! frame.show(); ! ! double i = 0; ! double scale = 1.0d; ! while (i < 50) ! { ! System.out.println(i); ! t1.addValue(Math.cos(i * 10 * Math.PI / 180) * 20); ! t2.addValue(Math.sin(i * 10 * Math.PI / 180) * 20); ! Thread.sleep(200); ! cg.repaint(); ! i++; ! if ((i % 20) == 0) ! { ! scale = scale / 1.5; ! cg.setHorizontalScale(scale); ! } ! } ! ! System.exit(0); ! } ! } |
From: <let...@us...> - 2003-12-14 10:42:38
|
Update of /cvsroot/ejtools/libraries/j2ee.icons/src/resources/frameGraphics In directory sc8-pr-cvs1:/tmp/cvs-serv18576/j2ee.icons/src/resources/frameGraphics Added Files: ejtools.gif Log Message: Add frame icon and new JTA one. --- NEW FILE: ejtools.gif --- (This appears to be a binary file; contents omitted.) |