[Ejtools-cvs] libraries/graph/src/main/org/ejtools/graph/service GraphConsumer.java,1.4,1.5 GraphCon
Brought to you by:
letiemble
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}; ! } ! } |