ejtools-cvs Mailing List for EJTools (Page 2)
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:58
|
Update of /cvsroot/ejtools/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv2776 Removed Files: look_and_feel.xml Log Message: More fun on the website : - sublink for library - download page - correct links --- look_and_feel.xml DELETED --- |
From: <let...@us...> - 2003-12-14 10:50:58
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv2986/xdocs Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/xdocs added to the repository |
From: <let...@us...> - 2003-12-14 10:50:56
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main In directory sc8-pr-cvs1:/tmp/cvs-serv3248/src/main Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/src/main added to the repository |
From: <let...@us...> - 2003-12-14 10:50:55
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise In directory sc8-pr-cvs1:/tmp/cvs-serv3348/src/main/javax/enterprise Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise added to the repository |
From: <let...@us...> - 2003-12-14 10:50:55
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi In directory sc8-pr-cvs1:/tmp/cvs-serv4074/src/main/javax/enterprise/deploy/spi Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi added to the repository |
From: <let...@us...> - 2003-12-14 10:50:55
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi/exceptions In directory sc8-pr-cvs1:/tmp/cvs-serv4179/src/main/javax/enterprise/deploy/spi/exceptions Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi/exceptions added to the repository |
From: <let...@us...> - 2003-12-14 10:50:54
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/test/test/enterprise/deploy/spi In directory sc8-pr-cvs1:/tmp/cvs-serv4508/src/test/test/enterprise/deploy/spi Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/src/test/test/enterprise/deploy/spi added to the repository |
From: <let...@us...> - 2003-12-14 10:50:54
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi/status In directory sc8-pr-cvs1:/tmp/cvs-serv4179/src/main/javax/enterprise/deploy/spi/status Log Message: Directory /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi/status added to the repository |
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi/exceptions In directory sc8-pr-cvs1:/tmp/cvs-serv4692/src/main/javax/enterprise/deploy/spi/exceptions Added Files: BeanNotFoundException.java ClientExecuteException.java ConfigurationException.java DConfigBeanVersionUnsupportedException.java DeploymentManagerCreationException.java InvalidModuleException.java OperationUnsupportedException.java TargetException.java package.html Log Message: Add up-to-date implementation for the JSR 88. No need for the Sun one. --- NEW FILE: BeanNotFoundException.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.exceptions; /** * This exception is to report that the bean is not a child of the parent bean. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class BeanNotFoundException extends Exception { /** * Creates an new <code>BeanNotFoundException</code> object. * * @param s a string indicating what was wrong with the Bean. */ public BeanNotFoundException(String s) { super(s); } } --- NEW FILE: ClientExecuteException.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.exceptions; /** * This exception reports errors in setting up an application client for execution. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class ClientExecuteException extends Exception { /** Creates new <code>ClientExecuteException</code> without detail message. */ public ClientExecuteException() { super(); } /** * Constructs an <code>ClientExecuteException</code> with the specified detail * message. * * @param msg the detail message. */ public ClientExecuteException(String msg) { super(msg); } } --- NEW FILE: ConfigurationException.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.exceptions; /** * This exception reports errors in generating a configuration bean. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class ConfigurationException extends Exception { /** Creates new <code>ConfigurationException</code> without detail message. */ public ConfigurationException() { super(); } /** * Constructs an <code>ConfigurationException</code> with the specified detail * message. * * @param msg the detail message. */ public ConfigurationException(String msg) { super(msg); } /** * Constructor for the ConfigurationException object * * @param cause Description of the Parameter */ public ConfigurationException(Throwable cause) { super(cause); } /** * Constructor for the ConfigurationException object * * @param message Description of the Parameter * @param cause Description of the Parameter */ public ConfigurationException(String message, Throwable cause) { super(message, cause); } } --- NEW FILE: DConfigBeanVersionUnsupportedException.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.exceptions; /** * This exception is to report that there is no support for the DConfigBean version * requested. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class DConfigBeanVersionUnsupportedException extends Exception { /** * Creates an new <code>DConfigBeanVersionUnsupportedException</code> object. * * @param s a string indicating what was wrong with the version request. */ public DConfigBeanVersionUnsupportedException(String s) { super(s); } } --- NEW FILE: DeploymentManagerCreationException.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.exceptions; /** * This exception is to report problems in returning a DeploymentManager object cause * by such things as server down, unable to authenticate and the like. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class DeploymentManagerCreationException extends Exception { /** * Creates an new <code>DeploymentManagerCreationException</code> object. * * @param s a string providing more information about the problem. */ public DeploymentManagerCreationException(String s) { super(s); } } --- NEW FILE: InvalidModuleException.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.exceptions; /** * This exception is to report an invalid J2EE deployment module type. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class InvalidModuleException extends Exception { /** * Creates an new <code>InvalidModuleException</code> object. * * @param s a string indicating what was wrong with the module type. */ public InvalidModuleException(String s) { super(s); } } --- NEW FILE: OperationUnsupportedException.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.exceptions; /** * This exception is to report that the method called is not supported by this implementation. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class OperationUnsupportedException extends Exception { /** * Creates an new <code>OperationUnsupportedException</code> object. * * @param s a string indicating what was wrong with the operation. */ public OperationUnsupportedException(String s) { super(s); } } --- NEW FILE: TargetException.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.exceptions; /** * This exception is to report bad target designators. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class TargetException extends Exception { /** * Creates an new <code>TargetException</code> object. * * @param s a string indicating what was wrong with the target. */ public TargetException(String s) { super(s); } } --- 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 J2EE Product Vendor deployment exception implementation classes. <h2>Package Specification</h2> <ul> <li><a href="http://jcp.org/jsr/detail/88.jsp">JSR 88, J2EE Application Deployment</a></li> </ul> <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> <li><a href="http://java.sun.com/j2ee/tools">J2EE Tools</a></li> </ul> </body> </html> |
From: <let...@us...> - 2003-12-14 10:50:53
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment In directory sc8-pr-cvs1:/tmp/cvs-serv4692 Added Files: .classpath .cvsignore .project project.properties project.xml Log Message: Add up-to-date implementation for the JSR 88. No need for the Sun one. --- NEW FILE: .classpath --- <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src/main"/> <classpathentry kind="src" path="src/test"/> <classpathentry kind="src" path="/ejtools-thirdparty"/> <classpathentry kind="var" path="JRE_LIB" sourcepath="JDK_SRC"/> <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> <classpathentry kind="var" path="MAVEN_REPO/mx4j/jars/mx4j-jmx-1.1.1.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --- NEW FILE: .cvsignore --- bin dist output target --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>ejtools-libraries-deployment</name> <comment></comment> <projects> <project>ejtools-thirdparty</project> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> --- NEW FILE: project.properties --- # ================================================================================ # EJTools, the Enterprise Java Tools # # Distributable under LGPL license. # See terms of license at gnu.org. # # $Revision: 1.1 $ # ================================================================================ maven.repo.remote=file:${basedir}/../../thirdparty,http://www.ibiblio.org/maven --- NEW FILE: project.xml --- <?xml version="1.0" encoding="UTF-8"?> <!-- # ================================================================================ # EJTools, the Enterprise Java Tools # # Distributable under LGPL license. # See terms of license at gnu.org. # # $Revision: 1.1 $ # ================================================================================ --> <project> <extend>${basedir}/../../project.xml</extend> <id>ejtools-j2ee-deployment</id> <groupId>ejtools</groupId> <name>J2EE Deployment</name> <currentVersion>1.0.0</currentVersion> <url>/libraries/j2ee.deployment</url> <package>org.ejtools,javax</package> <dependencies> <dependency> <id>mx4j</id> <artifactId>mx4j-jmx</artifactId> <version>1.1.1</version> </dependency> </dependencies> </project> |
From: <let...@us...> - 2003-12-14 10:50:53
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/spi/status In directory sc8-pr-cvs1:/tmp/cvs-serv4692/src/main/javax/enterprise/deploy/spi/status Added Files: ClientConfiguration.java DeploymentStatus.java ProgressEvent.java ProgressListener.java ProgressObject.java package.html Log Message: Add up-to-date implementation for the JSR 88. No need for the Sun one. --- NEW FILE: ClientConfiguration.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.status; import java.io.Serializable; import javax.enterprise.deploy.spi.exceptions.ClientExecuteException; /** * The ClientConfiguration object installs, configures and executes an Application * Client. This class resolves the settings for installing and running the application * client. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public interface ClientConfiguration extends Serializable { /** * This method performs an exec and starts the application client running in another * process. * * @exception ClientExecuteException when the configuration is incomplete. */ public void execute() throws ClientExecuteException; } --- NEW FILE: DeploymentStatus.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.status; import javax.enterprise.deploy.shared.ActionType; import javax.enterprise.deploy.shared.CommandType; import javax.enterprise.deploy.shared.StateType; /** * The DeploymentStatus interface provides information about the progress status * of a deployment action. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public interface DeploymentStatus { /** * Retrieve the StateType value. * * @return the StateType object */ public StateType getState(); /** * Retrieve the deployment CommandType of this event. * * @return the CommandType Object */ public CommandType getCommand(); /** * Retrieve the deployment ActionType for this event. * * @return the ActionType Object */ public ActionType getAction(); /** * Retrieve any additional information about the status of this event. * * @return the message text */ public String getMessage(); /** * A convience method to report if the operation is in the completed state. * * @return true if this command has completed successfully */ public boolean isCompleted(); /** * A convience method to report if the operation is in the failed state. * * @return true if this command has failed */ public boolean isFailed(); /** * A convience method to report if the operation is in the running state. * * @return true if this command is still running */ public boolean isRunning(); } --- NEW FILE: ProgressEvent.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.status; import java.util.EventObject; import javax.enterprise.deploy.spi.TargetModuleID; /** * An event which indicates that a deployment status change has occurred. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class ProgressEvent extends EventObject { private DeploymentStatus status; private TargetModuleID target; /** * Creates a new object representing a deployment progress event. * * @param source the object on which the Event initially occurred. * @param target Description of the Parameter * @param status Description of the Parameter */ public ProgressEvent(Object source, TargetModuleID target, DeploymentStatus status) { super(source); this.target = target; this.status = status; } /** * Retrieve the status information. * * @return the object containing the status information. */ public DeploymentStatus getDeploymentStatus() { return this.status; } /** * Retrieve the TargetModuleID for this event * * @return the object containing the TargetModuleID */ public TargetModuleID getTargetModuleID() { return this.target; } } --- NEW FILE: ProgressListener.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.status; import java.util.EventListener; /** * The listener interface for receiving deployment progress events. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public interface ProgressListener extends EventListener { /** * Invoked when a deployment progress event occurs. * * @param event the progress status event. */ public void handleProgressEvent(ProgressEvent event); } --- NEW FILE: ProgressObject.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.spi.status; import javax.enterprise.deploy.spi.TargetModuleID; import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException; /** * The ProgressObject interface tracks and reports the progress of the deployment * activities, distribute, start, stop, undeploy. <p> * * This class has an optional cancel method. The support of the cancel function can * be tested by the isCancelSupported method.</p> <p> * * The ProgressObject structure allows the user the option of polling for status * or to provide a callback.</p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public interface ProgressObject { /** * Retrieve the status of this activity. * * @return An object containing the status information. */ public DeploymentStatus getDeploymentStatus(); /** * Retrieve the list of TargetModuleIDs successfully processed or created by the * associated DeploymentManager operation. * * @return a list of TargetModuleIDs. */ public TargetModuleID[] getResultTargetModuleIDs(); /** * Return the ClientConfiguration object associated with the TargetModuleID. * * @param id The Target ID * @return ClientConfiguration for a given TargetModuleID or null if none exists. */ public ClientConfiguration getClientConfiguration(TargetModuleID id); /** * Tests whether the vendor supports a cancel opertation for deployment activities. * * @return true if canceling an activity is supported by this platform. */ public boolean isCancelSupported(); /** * (optional) A cancel request on an in-process operation stops all further processing * of the operation and returns the environment to it original state before the * operation was executed. An operation that has run to completion cannot be cancelled. * * @exception OperationUnsupportedException this optional command is not supported * by this implementation. */ public void cancel() throws OperationUnsupportedException; /** * Tests whether the vendor supports a stop opertation for deployment activities. * * @return true if canceling an activity is supported by this platform. */ public boolean isStopSupported(); /** * (optional) A stop request on an in-process operation allows the operation on * the current TargetModuleID to run to completion but does not process any of * the remaining unprocessed TargetModuleID objects. The processed TargetModuleIDs * must be returned by the method getResultTargetModuleIDs. * * @exception OperationUnsupportedException this optional command is not supported * by this implementation. */ public void stop() throws OperationUnsupportedException; /** * Add a listener to receive Progress events on deployment actions. * * @param pol the listener to receive events */ public void addProgressListener(ProgressListener pol); /** * Remove a ProgressObject listener. * * @param pol the listener being removed */ public void removeProgressListener(ProgressListener pol); } --- 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 J2EE Product Vendor deployment status implementation classes. <h2>Package Specification</h2> <ul> <li><a href="http://jcp.org/jsr/detail/88.jsp">JSR 88, J2EE Application Deployment</a></li> </ul> <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> <li><a href="http://java.sun.com/j2ee/tools">J2EE Tools</a></li> </ul> </body> </html> |
From: <let...@us...> - 2003-12-14 10:50:52
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/test/test/enterprise/deploy/shared In directory sc8-pr-cvs1:/tmp/cvs-serv4692/src/test/test/enterprise/deploy/shared Added Files: TypeTest.java Log Message: Add up-to-date implementation for the JSR 88. No need for the Sun one. --- NEW FILE: TypeTest.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package test.enterprise.deploy.shared; import javax.enterprise.deploy.shared.ActionType; import javax.enterprise.deploy.shared.CommandType; import javax.enterprise.deploy.shared.DConfigBeanVersionType; import javax.enterprise.deploy.shared.ModuleType; import javax.enterprise.deploy.shared.StateType; import junit.framework.TestCase; /** * @author letiemble * @version $Revision: 1.1 $ */ public class TypeTest extends TestCase { /** Constructor for the TypeTest object */ public TypeTest() { super(); } /** * Constructor for the TypeTest object * * @param name Description of the Parameter */ public TypeTest(String name) { super(name); } /** A unit test for JUnit */ public void testActionType() { assertEquals("ActionType.EXECUTE value is not correct", ActionType.EXECUTE, ActionType.getActionType(0)); assertEquals("ActionType.EXECUTE value is not correct", ActionType.EXECUTE.getValue(), 0); assertEquals("ActionType.EXECUTE string is not correct", ActionType.EXECUTE.toString(), "execute"); assertEquals("ActionType.CANCEL value is not correct", ActionType.CANCEL, ActionType.getActionType(1)); assertEquals("ActionType.CANCEL value is not correct", ActionType.CANCEL.getValue(), 1); assertEquals("ActionType.CANCEL string is not correct", ActionType.CANCEL.toString(), "cancel"); assertEquals("ActionType.STOP value is not correct", ActionType.STOP, ActionType.getActionType(2)); assertEquals("ActionType.STOP value is not correct", ActionType.STOP.getValue(), 2); assertEquals("ActionType.STOP string is not correct", ActionType.STOP.toString(), "stop"); } /** A unit test for JUnit */ public void testDConfigBeanVersionType() { assertEquals("DConfigBeanVersionType.V1_3 value is not correct", DConfigBeanVersionType.V1_3, DConfigBeanVersionType.getDConfigBeanVersionType(0)); assertEquals("DConfigBeanVersionType.V1_3 value is not correct", DConfigBeanVersionType.V1_3.getValue(), 0); assertEquals("DConfigBeanVersionType.V1_3 string is not correct", DConfigBeanVersionType.V1_3.toString(), "V1_3"); assertEquals("DConfigBeanVersionType.V1_3_1 value is not correct", DConfigBeanVersionType.V1_3_1, DConfigBeanVersionType.getDConfigBeanVersionType(1)); assertEquals("DConfigBeanVersionType.V1_3_1 value is not correct", DConfigBeanVersionType.V1_3_1.getValue(), 1); assertEquals("DConfigBeanVersionType.V1_3_1 string is not correct", DConfigBeanVersionType.V1_3_1.toString(), "V1_3_1"); assertEquals("DConfigBeanVersionType.V1_4 value is not correct", DConfigBeanVersionType.V1_4, DConfigBeanVersionType.getDConfigBeanVersionType(2)); assertEquals("DConfigBeanVersionType.V1_4 value is not correct", DConfigBeanVersionType.V1_4.getValue(), 2); assertEquals("DConfigBeanVersionType.V1_4 string is not correct", DConfigBeanVersionType.V1_4.toString(), "V1_4"); } /** A unit test for JUnit */ public void testModuleType() { assertEquals("ModuleType.EAR value is not correct", ModuleType.EAR, ModuleType.getModuleType(0)); assertEquals("ModuleType.EAR value is not correct", ModuleType.EAR.getValue(), 0); assertEquals("ModuleType.EAR string is not correct", ModuleType.EAR.toString(), "EAR"); assertEquals("ModuleType.EAR extension is not correct", ModuleType.EAR.getModuleExtension(), "ear"); assertEquals("ModuleType.EJB value is not correct", ModuleType.EJB, ModuleType.getModuleType(1)); assertEquals("ModuleType.EJB value is not correct", ModuleType.EJB.getValue(), 1); assertEquals("ModuleType.EJB string is not correct", ModuleType.EJB.toString(), "EJB"); assertEquals("ModuleType.EJB extension is not correct", ModuleType.EJB.getModuleExtension(), "jar"); assertEquals("ModuleType.CAR value is not correct", ModuleType.CAR, ModuleType.getModuleType(2)); assertEquals("ModuleType.CAR value is not correct", ModuleType.CAR.getValue(), 2); assertEquals("ModuleType.CAR string is not correct", ModuleType.CAR.toString(), "CAR"); assertEquals("ModuleType.CAR extension is not correct", ModuleType.CAR.getModuleExtension(), "car"); assertEquals("ModuleType.RAR value is not correct", ModuleType.RAR, ModuleType.getModuleType(3)); assertEquals("ModuleType.RAR value is not correct", ModuleType.RAR.getValue(), 3); assertEquals("ModuleType.RAR string is not correct", ModuleType.RAR.toString(), "RAR"); assertEquals("ModuleType.RAR extension is not correct", ModuleType.RAR.getModuleExtension(), "rar"); assertEquals("ModuleType.WAR value is not correct", ModuleType.WAR, ModuleType.getModuleType(4)); assertEquals("ModuleType.WAR value is not correct", ModuleType.WAR.getValue(), 4); assertEquals("ModuleType.WAR string is not correct", ModuleType.WAR.toString(), "WAR"); assertEquals("ModuleType.WAR extension is not correct", ModuleType.WAR.getModuleExtension(), "war"); } /** A unit test for JUnit */ public void testStateType() { assertEquals("StateType.RUNNING value is not correct", StateType.RUNNING, StateType.getModuleType(0)); assertEquals("StateType.RUNNING value is not correct", StateType.RUNNING.getValue(), 0); assertEquals("StateType.RUNNING string is not correct", StateType.RUNNING.toString(), "running"); assertEquals("StateType.COMPLETED value is not correct", StateType.COMPLETED, StateType.getModuleType(1)); assertEquals("StateType.COMPLETED value is not correct", StateType.COMPLETED.getValue(), 1); assertEquals("StateType.COMPLETED string is not correct", StateType.COMPLETED.toString(), "completed"); assertEquals("StateType.FAILED value is not correct", StateType.FAILED, StateType.getModuleType(2)); assertEquals("StateType.FAILED value is not correct", StateType.FAILED.getValue(), 2); assertEquals("StateType.FAILED string is not correct", StateType.FAILED.toString(), "failed"); assertEquals("StateType.RELEASED value is not correct", StateType.RELEASED, StateType.getModuleType(3)); assertEquals("StateType.RELEASED value is not correct", StateType.RELEASED.getValue(), 3); assertEquals("StateType.RELEASED string is not correct", StateType.RELEASED.toString(), "released"); } /** A unit test for JUnit */ public void testcCommandType() { assertEquals("CommandType.DISTRIBUTE value is not correct", CommandType.DISTRIBUTE, CommandType.getCommandType(0)); assertEquals("CommandType.DISTRIBUTE value is not correct", CommandType.DISTRIBUTE.getValue(), 0); assertEquals("CommandType.DISTRIBUTE string is not correct", CommandType.DISTRIBUTE.toString(), "distribute"); assertEquals("CommandType.START value is not correct", CommandType.START, CommandType.getCommandType(1)); assertEquals("CommandType.START value is not correct", CommandType.START.getValue(), 1); assertEquals("CommandType.START string is not correct", CommandType.START.toString(), "start"); assertEquals("CommandType.STOP value is not correct", CommandType.STOP, CommandType.getCommandType(2)); assertEquals("CommandType.STOP value is not correct", CommandType.STOP.getValue(), 2); assertEquals("CommandType.STOP string is not correct", CommandType.STOP.toString(), "stop"); assertEquals("CommandType.UNDEPLOY value is not correct", CommandType.UNDEPLOY, CommandType.getCommandType(3)); assertEquals("CommandType.UNDEPLOY value is not correct", CommandType.UNDEPLOY.getValue(), 3); assertEquals("CommandType.UNDEPLOY string is not correct", CommandType.UNDEPLOY.toString(), "undeploy"); assertEquals("CommandType.REDEPLOY value is not correct", CommandType.REDEPLOY, CommandType.getCommandType(4)); assertEquals("CommandType.REDEPLOY value is not correct", CommandType.REDEPLOY.getValue(), 4); assertEquals("CommandType.REDEPLOY string is not correct", CommandType.REDEPLOY.toString(), "redeploy"); } } |
From: <let...@us...> - 2003-12-14 10:50:52
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/test/test/enterprise/deploy/shared/factories In directory sc8-pr-cvs1:/tmp/cvs-serv4692/src/test/test/enterprise/deploy/shared/factories Added Files: DeploymentFactoryManagerTest.java Log Message: Add up-to-date implementation for the JSR 88. No need for the Sun one. --- NEW FILE: DeploymentFactoryManagerTest.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package test.enterprise.deploy.shared.factories; import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager; import javax.enterprise.deploy.spi.DeploymentManager; import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException; import javax.enterprise.deploy.spi.factories.DeploymentFactory; import junit.framework.TestCase; import test.enterprise.deploy.spi.factories.AdvancedDeploymentFactory; import test.enterprise.deploy.spi.factories.BasicDeploymentFactory; /** * @author letiemble * @version $Revision: 1.1 $ */ public class DeploymentFactoryManagerTest extends TestCase { /** Description of the Field */ protected DeploymentFactoryManager manager; /** Constructor for the TypeTest object */ public DeploymentFactoryManagerTest() { super(); } /** * Constructor for the TypeTest object * * @param name Description of the Parameter */ public DeploymentFactoryManagerTest(String name) { super(name); } /** A unit test for JUnit */ public void testNoFactory() { DeploymentFactory[] factories = manager.getDeploymentFactories(); assertEquals("No factory must be found", factories.length, 0); } /** A unit test for JUnit */ public void testWithFactories() { BasicDeploymentFactory factory1 = new BasicDeploymentFactory(); AdvancedDeploymentFactory factory2 = new AdvancedDeploymentFactory(); manager.registerDeploymentFactory(factory1); assertEquals("One factory must be found", manager.getDeploymentFactories().length, 1); manager.registerDeploymentFactory(factory1); assertEquals("One factory must be found", manager.getDeploymentFactories().length, 1); manager.registerDeploymentFactory(factory2); assertEquals("Two factories must be found", manager.getDeploymentFactories().length, 2); DeploymentManager dmanager; try{ dmanager = manager.getDeploymentManager(BasicDeploymentFactory.URI + "//localhost:6969", null, null); assertNotNull("DeploymentManager cannot be null", dmanager); dmanager = manager.getDisconnectedDeploymentManager(BasicDeploymentFactory.URI + "//localhost:6969"); assertNotNull("DeploymentManager cannot be null", dmanager); dmanager = manager.getDeploymentManager(AdvancedDeploymentFactory.URI + "//localhost:6969", null, null); assertNotNull("DeploymentManager cannot be null", dmanager); dmanager = manager.getDisconnectedDeploymentManager(AdvancedDeploymentFactory.URI + "//localhost:6969"); assertNotNull("DeploymentManager cannot be null", dmanager); }catch(DeploymentManagerCreationException dmce){ fail("Creation shoud be successfull"); } } /** * The JUnit setup method * * @exception Exception Description of the Exception */ protected void setUp() throws Exception { this.manager = DeploymentFactoryManager.getInstance(); } /** * The teardown method for JUnit * * @exception Exception Description of the Exception */ protected void tearDown() throws Exception { this.manager = null; } } |
From: <let...@us...> - 2003-12-14 10:50:51
|
Update of /cvsroot/ejtools/libraries/j2ee.management/xdocs In directory sc8-pr-cvs1:/tmp/cvs-serv5233/xdocs Log Message: Directory /cvsroot/ejtools/libraries/j2ee.management/xdocs added to the repository |
From: <let...@us...> - 2003-12-14 10:50:48
|
Update of /cvsroot/ejtools/libraries/j2ee.management/src/main/javax In directory sc8-pr-cvs1:/tmp/cvs-serv6606/src/main/javax Log Message: Directory /cvsroot/ejtools/libraries/j2ee.management/src/main/javax added to the repository |
Update of /cvsroot/ejtools/libraries/j2ee.management/src/main/javax/management/j2ee In directory sc8-pr-cvs1:/tmp/cvs-serv9476/src/main/javax/management/j2ee Added Files: ListenerRegistration.java Management.java ManagementHome.java package.html Log Message: Add up-to-date JSR77 implementation. Can skip the Sun one. --- NEW FILE: ListenerRegistration.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee; import java.io.Serializable; import java.rmi.RemoteException; import javax.management.InstanceNotFoundException; import javax.management.ListenerNotFoundException; import javax.management.NotificationFilter; import javax.management.NotificationListener; import javax.management.ObjectName; /** * Provides the methods to add and remove event listeners to the MEJB component. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface ListenerRegistration extends Serializable { /** * Add a listener to a registered managed object. * * @param name The name of the managed object on which * the listener should be added. * @param listener The listener object which will handle * the events emitted by the registered managed object. * @param filter The filter object. If filter is null, * no filtering will be performed before handling events. * @param handback An opaque object to be sent back to the * listener when a notification is emitted which helps the listener to associate * information regarding the MBean emitter. This object cannot be used by * the Notification broadcaster object. It should be resent unchanged with * the notification to the listener. * @exception InstanceNotFoundException The managed object name provided does * not match any of the registered managed objects. * @exception RemoteException a communication exception occurred during * the execution of a remote method call. */ public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, RemoteException; /** * Enables to remove a listener from a registered managed object. * * @param name The name of the managed object on which * the listener should be removed. * @param listener The listener object which will handle * the events emitted by the registered managed object. This method will * remove all the information related to this listener. * @exception InstanceNotFoundException The managed object name provided does * not match any of the registered managed objects. * @exception ListenerNotFoundException The listener is not registered in the * managed object. * @exception RemoteException A communication exception occurred during * the execution of a remote method call. */ public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException, RemoteException; } --- NEW FILE: Management.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee; import java.rmi.RemoteException; import java.util.Set; import javax.ejb.EJBObject; import javax.management.Attribute; import javax.management.AttributeList; import javax.management.AttributeNotFoundException; import javax.management.InstanceNotFoundException; import javax.management.IntrospectionException; import javax.management.InvalidAttributeValueException; import javax.management.MBeanException; import javax.management.MBeanInfo; import javax.management.ObjectName; import javax.management.QueryExp; import javax.management.ReflectionException; /** * The Management interface provides the APIs to navigate and manipulate managed * objects. <p> * * The Management EJB component must implement this interface as its remote interface. * </p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface Management extends EJBObject { /** * Description of the Method * * @param objectname Description of the Parameter * @param queryexp Description of the Parameter * @return Description of the Return Value * @exception RemoteException Description of the Exception */ public Set queryNames(ObjectName objectname, QueryExp queryexp) throws RemoteException; /** * Gets the registered attribute of the Management object * * @param objectname Description of the Parameter * @return The registered value * @exception RemoteException Description of the Exception */ public boolean isRegistered(ObjectName objectname) throws RemoteException; /** * Gets the mBeanCount attribute of the Management object * * @return The mBeanCount value * @exception RemoteException Description of the Exception */ public Integer getMBeanCount() throws RemoteException; /** * Gets the mBeanInfo attribute of the Management object * * @param objectname Description of the Parameter * @return The mBeanInfo value * @exception IntrospectionException Description of the Exception * @exception InstanceNotFoundException Description of the Exception * @exception ReflectionException Description of the Exception * @exception RemoteException Description of the Exception */ public MBeanInfo getMBeanInfo(ObjectName objectname) throws IntrospectionException, InstanceNotFoundException, ReflectionException, RemoteException; /** * Gets the value of a specific attribute of a named managed object. The managed * object is identified by its object name. * * @param objectname Description of the Parameter * @param s Description of the Parameter * @return The attribute value * @exception MBeanException Description of the Exception * @exception AttributeNotFoundException Description of the Exception * @exception InstanceNotFoundException Description of the Exception * @exception ReflectionException Description of the Exception * @exception RemoteException Description of the Exception */ public Object getAttribute(ObjectName objectname, String s) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException, RemoteException; /** * Gets the attributes attribute of the Management object * * @param objectname Description of the Parameter * @param as Description of the Parameter * @return The attributes value * @exception InstanceNotFoundException Description of the Exception * @exception ReflectionException Description of the Exception * @exception RemoteException Description of the Exception */ public AttributeList getAttributes(ObjectName objectname, String as[]) throws InstanceNotFoundException, ReflectionException, RemoteException; /** * Sets the attribute attribute of the Management object * * @param objectname The new attribute value * @param attribute The new attribute value * @exception InstanceNotFoundException Description of the Exception * @exception AttributeNotFoundException Description of the Exception * @exception InvalidAttributeValueException Description of the Exception * @exception MBeanException Description of the Exception * @exception ReflectionException Description of the Exception * @exception RemoteException Description of the Exception */ public void setAttribute(ObjectName objectname, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, RemoteException; /** * Sets the attributes attribute of the Management object * * @param objectname The new attributes value * @param attributelist The new attributes value * @return Description of the Return Value * @exception InstanceNotFoundException Description of the Exception * @exception ReflectionException Description of the Exception * @exception RemoteException Description of the Exception */ public AttributeList setAttributes(ObjectName objectname, AttributeList attributelist) throws InstanceNotFoundException, ReflectionException, RemoteException; /** * Description of the Method * * @param objectname Description of the Parameter * @param s Description of the Parameter * @param aobj Description of the Parameter * @param as Description of the Parameter * @return Description of the Return Value * @exception InstanceNotFoundException Description of the Exception * @exception MBeanException Description of the Exception * @exception ReflectionException Description of the Exception * @exception RemoteException Description of the Exception */ public Object invoke(ObjectName objectname, String s, Object aobj[], String as[]) throws InstanceNotFoundException, MBeanException, ReflectionException, RemoteException; /** * Gets the defaultDomain attribute of the Management object * * @return The defaultDomain value * @exception RemoteException Description of the Exception */ public String getDefaultDomain() throws RemoteException; /** * Gets the listenerRegistry attribute of the Management object * * @return The listenerRegistry value * @exception RemoteException Description of the Exception */ public ListenerRegistration getListenerRegistry() throws RemoteException; } --- NEW FILE: ManagementHome.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee; import java.rmi.RemoteException; import javax.ejb.CreateException; import javax.ejb.EJBHome; /** * The required home interface for the Management EJB component. <p> * * The interface may be extended by a proprietary interface to include additional * create methods that take initialization arguments.</p> <p> * * A J2EE client must be able to create a compliant session object using the specified * create method which takes no arguments.</p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface ManagementHome extends EJBHome { /** * Creates an MEJB session object which provides access to the J2EE Management * Model. * * @return An session object which implements <code>javax.management.j2ee.Management</code> * . * @exception CreateException indicates a failure to create an EJB Object. * @exception RemoteException a communication exception occurred during the execution * of a remote method call. */ public Management create() throws CreateException, RemoteException; } --- 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 MEJB releated classes and interfaces. <p> The J2EE Management EJB component (MEJB) provides interoperable access to the J2EE Management Model from any J2EE component on all platforms that implement the J2EE Management specification. The MEJB component incorporates the Java Management Extensions (JMX) API, a standard framework for Java object instrumentation.</p> <p>The MEJB component exposes the managed objects on any J2EE platform as JMX manageable resources as defined by the Java Management Extensions Instrumentation and Agent Specification (JSR003). The MEJB component provides local and remote access of the platform's manageable resources through the EJB interoperability protocol.</p> <h2>Package Specification</h2> <ul> <li><a href="http://jcp.org/jsr/detail/77.jsp">JSR 77, J2EE Management</a></li> </ul> <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> <li><a href="http://java.sun.com/j2ee/tools">J2EE Tools</a></li> </ul> </body> </html> |
Update of /cvsroot/ejtools/libraries/j2ee.management/src/main/javax/management/j2ee/statistics In directory sc8-pr-cvs1:/tmp/cvs-serv9476/src/main/javax/management/j2ee/statistics Added Files: BoundaryStatistic.java BoundedRangeStatistic.java CountStatistic.java EJBStats.java EntityBeanStats.java JCAConnectionPoolStats.java JCAConnectionStats.java JCAStats.java JDBCConnectionPoolStats.java JDBCConnectionStats.java JDBCStats.java JMSConnectionStats.java JMSConsumerStats.java JMSEndpointStats.java JMSProducerStats.java JMSSessionStats.java JMSStats.java JTAStats.java JVMStats.java JavaMailStats.java MessageDrivenBeanStats.java RangeStatistic.java ServletStats.java SessionBeanStats.java StatefulSessionBeanStats.java StatelessSessionBeanStats.java Statistic.java Stats.java TimeStatistic.java URLStats.java package.html Log Message: Add up-to-date JSR77 implementation. Can skip the Sun one. --- NEW FILE: BoundaryStatistic.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The BoundaryStatistic interface specifies standard measurements of the upper and * lower limits of the value of an attribute. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface BoundaryStatistic extends Statistic { /** * Returns the upper limit of the value of this attribute. * * @return The upper bound value */ public long getUpperBound(); /** * Returns the lower limit of the value of this attribute. * * @return The lower bound value */ public long getLowerBound(); } --- NEW FILE: BoundedRangeStatistic.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The BoundedRangeStatistic interface extends the RangeStatistic and BoundaryStatistic * interfaces and provides standard measurements of a range that has fixed limits. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface BoundedRangeStatistic extends BoundaryStatistic, RangeStatistic { } --- NEW FILE: CountStatistic.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The CountStatistic interface specifies standard count measurements. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface CountStatistic extends Statistic { /** * Returns the count since the measurement started. * * @return The count value */ public long getCount(); } --- NEW FILE: EJBStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The EJBStats interface specifies statistics provided by all EJB component types. * <p align="center"> * * <img src="../../../../../images/stats-ejb.png" alt="EJB Stats Class Diagram"/> * </p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface EJBStats extends Stats { /** * Returns the number of times the beans create method was called. * * @return The create count */ public CountStatistic getCreateCount(); /** * Returns the number of times the beans remove method was called. * * @return The remove count */ public CountStatistic getRemoveCount(); } --- NEW FILE: EntityBeanStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies statistics provided by entity beans. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface EntityBeanStats extends EJBStats { /** * Returns the number of bean instances in the ready state. * * @return The ready count */ public RangeStatistic getReadyCount(); /** * Returns the number of bean instances in the pooled state. * * @return The pooled count */ public RangeStatistic getPooledCount(); } --- NEW FILE: JCAConnectionPoolStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The JCAConnectionPoolStats interface specifies the statistics provided by a JCA * connection pool. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JCAConnectionPoolStats extends JCAConnectionStats { /** * Returns the number of connections closed. * * @return The close count */ public CountStatistic getCloseCount(); /** * Returns the number of connections created. * * @return The create count */ public CountStatistic getCreateCount(); /** * Returns the number of free connections in the pool. * * @return The free pool size */ public BoundedRangeStatistic getFreePoolSize(); /** * Returns the size of the connection pool. * * @return The pool size */ public BoundedRangeStatistic getPoolSize(); /** * Returns the number of threads waiting for a connection. * * @return The waiting thread count */ public RangeStatistic getWaitingThreadCount(); } --- NEW FILE: JCAConnectionStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; import javax.management.ObjectName; /** * The JCAConnectionStats interface specifies the statistics provided by a JCA connection. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JCAConnectionStats extends Stats { /** * Returns the JCAConnectionFactory OBJECT_NAME of the managed object that identifies * the connectors connection factory for this connection. * * @return The connection factory */ public ObjectName getConnectionFactory(); /** * Returns the JCAManagedConnectionFactory OBJECT_NAME of the managed object that * identifies the connectors managed connection factory for this connection. * * @return The managed connection factory */ public ObjectName getManagedConnectionFactory(); /** * Returns time spent waiting for a connection to be available. * * @return The wait time */ public TimeStatistic getWaitTime(); /** * Returns the time spent using a connection. * * @return The use time */ public TimeStatistic getUseTime(); } --- NEW FILE: JCAStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The JCAStats interface specifies the statistics provided by a JCA resource. <p align="center"> * * <img src="../../../../../images/stats-jca.png" alt="JCA Stats Class Diagram"/> * </p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JCAStats extends Stats { /** * Returns a list of JCAConnectionStats that provide statistics about the non-pooled * connections associated with the referencing JCA resource statistics. * * @return The connections stats */ public JCAConnectionStats[] getConnections(); /** * Returns a a list of JCAConnectionPoolStats that provide statistics about the * connection pools associated with the referencing JCA resource statistics. * * @return The connection pools stats */ public JCAConnectionPoolStats[] getConnectionPools(); } --- NEW FILE: JDBCConnectionPoolStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a JDBC connection pool. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JDBCConnectionPoolStats extends JDBCConnectionStats { /** * Returns the number of connections created. * * @return The create count */ public CountStatistic getCreateCount(); /** * Returns the number of connections closed. * * @return The close count */ public CountStatistic getCloseCount(); /** * Returns the size of the connection pool. * * @return The pool size */ public BoundedRangeStatistic getPoolSize(); /** * Returns the number of free connections in the pool. * * @return The free pool size */ public BoundedRangeStatistic getFreePoolSize(); /** * Returns the number of threads waiting for a connection. * * @return The waiting thread count */ public RangeStatistic getWaitingThreadCount(); } --- NEW FILE: JDBCConnectionStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; import javax.management.ObjectName; /** * Specifies the statistics provided by a JDBC connection. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JDBCConnectionStats extends Stats { /** * Returns the name of the managed object that identifies the JDBC data source * for this connection. * * @return The jdbc data source */ public ObjectName getJdbcDataSource(); /** * Returns the time spent waiting for a connection to be available. * * @return The wait time */ public TimeStatistic getWaitTime(); /** * Returns the time spent using a connection. * * @return The use time */ public TimeStatistic getUseTime(); } --- NEW FILE: JDBCStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The JDBCStats type specifies the statistics provided by a JDBC resource. <p align="center"> * * <img src="../../../../../images/stats-jdbc.png" alt="JDBC Stats Class Diagram"/> * </p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JDBCStats extends Stats { /** * Returns a list of JDBCConnectionStats that provide statistics about the non-pooled * connections associated with the referencing JDBC resource statistics. * * @return The connections stats */ public JDBCConnectionStats[] getConnections(); /** * Returns a list of JDBCConnectionPoolStats that provide statistics about the * connection pools associated with the referencing JDBC resource statistics. * * @return The connection pools stats */ public JDBCConnectionPoolStats[] getConnectionPools(); } --- NEW FILE: JMSConnectionStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a JMS connection. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JMSConnectionStats extends Stats { /** * Returns a list of JMSSessionStats that provide statistics about the sessions * associated with the referencing JMSConnectionStats. * * @return The sessions stats */ public JMSSessionStats[] getSessions(); /** * Returns the transactional state of this JMS connection. If true, indicates * that this JMS connection is transactional. * * @return The transactional state */ public boolean isTransactional(); } --- NEW FILE: JMSConsumerStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a JMS message consumer. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JMSConsumerStats extends JMSEndpointStats { /** * Returns a string that encapsulates the identity of a message origin. * * @return The origin */ public String getOrigin(); } --- NEW FILE: JMSEndpointStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the base interface for the statistics provided by a JMS message producer * or a JMS message consumer. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JMSEndpointStats extends Stats { /** * Returns the number of messages sent or received. * * @return The message count */ public CountStatistic getMessageCount(); /** * Returns the number of pending messages. * * @return The pending message count */ public CountStatistic getPendingMessageCount(); /** * Returns the number of messages that expired before delivery. * * @return The expired message count */ public CountStatistic getExpiredMessageCount(); /** * Returns the time spent by a message before being delivered. * * @return The message wait time */ public TimeStatistic getMessageWaitTime(); } --- NEW FILE: JMSProducerStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a JMS message producer. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JMSProducerStats extends JMSEndpointStats { /** * Returns a string that encapsulates the identity of a message destination. * * @return The destination */ public String getDestination(); } --- NEW FILE: JMSSessionStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a JMS session. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JMSSessionStats extends Stats { /** * Returns a list of JMSProducerStats that provide statistics about the message * producers associated with the referencing JMS session statistics. * * @return The producers stats */ public JMSProducerStats[] getProducers(); /** * Returns a list of JMSConsumerStats that provide statistics about the message * consumers associated with the referencing JMS session statistics. * * @return The consumers stats */ public JMSConsumerStats[] getConsumers(); /** * Returns the number of messages exchanged. * * @return The message count */ public CountStatistic getMessageCount(); /** * Returns the number of pending messages. * * @return The pending message count */ public CountStatistic getPendingMessageCount(); /** * Returns the number of expired messages. * * @return The expired message count */ public CountStatistic getExpiredMessageCount(); /** * Returns the time spent by a message before being delivered. * * @return The message wait time */ public TimeStatistic getMessageWaitTime(); /** * Returns the number of durable subscriptions. * * @return The durable subscription count */ public CountStatistic getDurableSubscriptionCount(); } --- NEW FILE: JMSStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The JMSStats interface specifies the statistics provided by a JMS resource. <p align="center"> * * <img src="../../../../../images/stats-jms.png" alt="JMS Stats Class Diagram"/> * </p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JMSStats extends Stats { /** * Returns a list of JMSConnectionStats that provide statistics about the connections * associated with the referencing JMS resource. * * @return The connections stats */ public JMSConnectionStats[] getConnections(); } --- NEW FILE: JTAStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a JTA resource. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JTAStats extends Stats { /** * Returns the number of active transactions. * * @return The active count */ public CountStatistic getActiveCount(); /** * Returns the number of committed transactions. * * @return The committed count */ public CountStatistic getCommittedCount(); /** * Returns the number of rolled-back transactions. * * @return The rolledback count */ public CountStatistic getRolledbackCount(); } --- NEW FILE: JVMStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a Java VM. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JVMStats extends Stats { /** * Returns the amount of time the JVM has been running. * * @return The up time */ public CountStatistic getUpTime(); /** * Returns the size of the JVMs heap. * * @return The heap size */ public BoundedRangeStatistic getHeapSize(); } --- NEW FILE: JavaMailStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a JavaMail resource. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface JavaMailStats extends Stats { /** * Returns the number of mail messages sent. * * @return The sent mail count */ public CountStatistic getSentMailCount(); } --- NEW FILE: MessageDrivenBeanStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a message driven bean. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface MessageDrivenBeanStats extends EJBStats { /** * Returns the number of messages received. * * @return The message count */ public CountStatistic getMessageCount(); } --- NEW FILE: RangeStatistic.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies standard measurements of the lowest and highest values an attribute * has held as well as its current value. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface RangeStatistic extends Statistic { /** * Returns the highest value this attribute has held since the beginning of the * measurement. * * @return The high water mark value */ public long getHighWaterMark(); /** * Returns the lowest value this attribute has held since the beginning of the * measurement. * * @return The low water mark value */ public long getLowWaterMark(); /** * Returns the current value of this attribute. * * @return The current value */ public long getCurrent(); } --- NEW FILE: ServletStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a Servlet component. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface ServletStats extends Stats { /** * Returns the execution time of the servlets service method. * * @return The serviceTime value */ public TimeStatistic getServiceTime(); } --- NEW FILE: SessionBeanStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by session beans of both stateful and stateless * types. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface SessionBeanStats extends EJBStats { /** * Returns the number of beans in the method-ready state. * * @return The method ready count */ public RangeStatistic getMethodReadyCount(); } --- NEW FILE: StatefulSessionBeanStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a stateful session bean. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface StatefulSessionBeanStats extends SessionBeanStats { /** * Returns the number of beans that are in the passivated state. * * @return The passive count */ public RangeStatistic getPassiveCount(); } --- NEW FILE: StatelessSessionBeanStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a stateless session bean. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface StatelessSessionBeanStats extends SessionBeanStats { } --- NEW FILE: Statistic.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The Statistic interface and its subinterfaces specify the required accessors which * provide the performance data described by the specific attributes in the Stats * interfaces. The Statistic subinterfaces specify accessors which provide statistical * data about count, time, and both bounded and unbounded ranges. <p align="center"> * * <img src="../../../../../images/statistics-overview.png" alt="Statistics Class * Diagram"/></p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface Statistic { /** * Returns the name of this Statistic. The name must always correspond to the * name of the Stats accessor that is providing the data for this statistic. * * @return The name value */ public String getName(); /** * Returns the unit of measurement for this Statistic. Valid values for TimeStatistic * measurements are "HOUR", "MINUTE", "SECOND", "MILLISECOND", "MICROSECOND" and * "NANOSECOND". * * @return The unit */ public String getUnit(); /** * Returns a human-readable description of the Statistic. * * @return The description */ public String getDescription(); /** * Returns the time the first measurment was taken represented as a long, whose * value is the number of milliseconds since "January 1, 1970, 00:00:00". * * @return The start time value */ public long getStartTime(); /** * Returns the time the most recent measurment was taken represented as a long, * whose value is the number of milliseconds since "January 1, 1970, 00:00:00". * * @return The last sample time value */ public long getLastSampleTime(); } --- NEW FILE: Stats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * The Stats interface and its subinterfaces specify performance data accessors for * each of the specific managed object types. <p> * * The data required by the interfaces is commonly available on all platform implementations. * Managed objects that support statistics are permitted to provide support for a * subset of the accessors in the Stats interfaces. Managed objects indicate which * of the specified accessors return valid data by including only the names of the * supported statistics in the statisticNames list. The data provided by a supported * statistic must be exactly as specified by the corresponding Stats interface. The * Stats interfaces may be extended to provide vendor specific performance statistics. * Vendor specific perfomance statistics must implement or extend one of the standard * Statistics interfaces.</p> * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface Stats { /** * Gets a Statistic by name. * * @param statisticName The statistic name * @return The Statistic */ public Statistic getStatistic(String statisticName); /** * Returns a list of the names of the attributes from the specific Stats interface * that this object supports. Attributes named in the list must correspond to * the names of operations in the Stats interface that will return Statistics * object of the appropriate type which contains valid data. Each operation in * a Stats interface is an accessor which follows the pattern getAttributeName. * The AttributeName portion of the operation name is the value that is returned * as the name in the StatisticNames list. <p> * * The value of attributes whose names are not included in the StatisticNames * list is undefined and must be considered invalid. For each attribute name in * the StatisticNames list that returns a Statistic there must be one Statistic * object with the same name in the statistics list.</p> * * @return The statistic names */ public String[] getStatisticNames(); /** * Returns a list of all the Statistic objects supported by this Stats object. * * @return An array of Statistics */ public Statistic[] getStatistics(); } --- NEW FILE: TimeStatistic.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies standard timing measurements for a given operation. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface TimeStatistic extends Statistic { /** * Returns the number of times the operation was invoked since the beginning of * this measurement. * * @return The count value */ public long getCount(); /** * Returns the maximum amount of time taken to complete one invocation of this * operation since the beginning of this measurement. * * @return The max time value */ public long getMaxTime(); /** * Returns the minimum amount of time taken to complete one invocation of this * operation since the beginning of this measurement. * * @return The min time value */ public long getMinTime(); /** * Returns the sum total of time taken to complete every invocation of this operation * since the beginning of this measurement. Dividing totalTime by count will give * you the average execution time for this operation. * * @return The total time value */ public long getTotalTime(); } --- NEW FILE: URLStats.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.management.j2ee.statistics; /** * Specifies the statistics provided by a URL resource. * * @author Laurent Etiemble * @version $Revision: 1.1 $ */ public interface URLStats extends Stats { } --- 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 statistics releated classes and interfaces. <p> The Performance Data Framework consists of the StatisticsProvider model, which any managed object may implement, the Stats interfaces, which specify standard performance attribute semantics for each managed object type, and the Statistic interfaces which provide specific interfaces for representing the common performance data types.</p> <h2>Package Specification</h2> <ul> <li><a href="http://jcp.org/jsr/detail/77.jsp">JSR 77, J2EE Management</a></li> </ul> <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> <li><a href="http://java.sun.com/j2ee/tools">J2EE Tools</a></li> </ul> </body> </html> |
From: <let...@us...> - 2003-12-14 10:50:28
|
Update of /cvsroot/ejtools/libraries/common/src/test/test/jmx In directory sc8-pr-cvs1:/tmp/cvs-serv11911/common/src/test/test/jmx Log Message: Directory /cvsroot/ejtools/libraries/common/src/test/test/jmx added to the repository |
From: <let...@us...> - 2003-12-14 10:50:27
|
Update of /cvsroot/ejtools/libraries/common/src/test/test/util/state In directory sc8-pr-cvs1:/tmp/cvs-serv11951/common/src/test/test/util/state Log Message: Directory /cvsroot/ejtools/libraries/common/src/test/test/util/state added to the repository |
From: <let...@us...> - 2003-12-14 10:50:14
|
Update of /cvsroot/ejtools/libraries/taglib In directory sc8-pr-cvs1:/tmp/cvs-serv18305/taglib Modified Files: .classpath project.xml Log Message: Add more javadocs. Add package.html files. Index: .classpath =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .classpath 15 Sep 2003 21:58:25 -0000 1.1 --- .classpath 13 Dec 2003 21:24:50 -0000 1.2 *************** *** 5,10 **** <classpathentry kind="src" path="/ejtools-thirdparty"/> <classpathentry kind="var" path="JRE_LIB" sourcepath="JDK_SRC"/> <classpathentry kind="var" path="MAVEN_REPO/struts/jars/struts-1.0.2.jar"/> - <classpathentry kind="var" path="MAVEN_REPO/sun/jars/j2ee-1.4.0.jar"/> <classpathentry kind="output" path="bin"/> </classpath> --- 5,10 ---- <classpathentry kind="src" path="/ejtools-thirdparty"/> <classpathentry kind="var" path="JRE_LIB" sourcepath="JDK_SRC"/> + <classpathentry kind="var" path="MAVEN_REPO/servletapi/jars/servletapi-2.3.jar"/> <classpathentry kind="var" path="MAVEN_REPO/struts/jars/struts-1.0.2.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Index: project.xml =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/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:14 -0000 1.2 --- project.xml 13 Dec 2003 21:24:50 -0000 1.3 *************** *** 19,24 **** <dependencies> <dependency> ! <id>log4j</id> ! <version>1.2.7</version> </dependency> <dependency> --- 19,24 ---- <dependencies> <dependency> ! <id>servletapi</id> ! <version>2.3</version> </dependency> <dependency> *************** *** 31,40 **** <groupId>ejtools</groupId> <version>1.0.0</version> - </dependency> - <!-- Local dependencies --> - <dependency> - <id>sun</id> - <artifactId>j2ee</artifactId> - <version>1.3.1</version> </dependency> </dependencies> --- 31,34 ---- |
From: <let...@us...> - 2003-12-14 10:50:13
|
Update of /cvsroot/ejtools/libraries/j2ee.icons/src/resources/toolbarButtonGraphics/development In directory sc8-pr-cvs1:/tmp/cvs-serv18576/j2ee.icons/src/resources/toolbarButtonGraphics/development Modified Files: JTAResource16.gif Log Message: Add frame icon and new JTA one. Index: JTAResource16.gif =================================================================== RCS file: /cvsroot/ejtools/libraries/j2ee.icons/src/resources/toolbarButtonGraphics/development/JTAResource16.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs2KVQP0 and /tmp/cvsELcRtR differ |
From: <let...@us...> - 2003-12-14 10:50:11
|
Update of /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/frame In directory sc8-pr-cvs1:/tmp/cvs-serv18699/graph/src/main/org/ejtools/graph/frame Modified Files: GraphInternalFrame.java Log Message: Add more javadocs. Adjust text export. Index: GraphInternalFrame.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/frame/GraphInternalFrame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GraphInternalFrame.java 27 Nov 2003 00:53:32 -0000 1.5 --- GraphInternalFrame.java 13 Dec 2003 21:26:47 -0000 1.6 *************** *** 16,19 **** --- 16,20 ---- import java.util.TimerTask; + import javax.swing.JFileChooser; import javax.swing.JMenuBar; import javax.swing.JPanel; *************** *** 35,40 **** import org.ejtools.graph.service.GraphConsumer; import org.ejtools.graph.service.GraphProducer; ! import org.ejtools.util.export.CSVTools; ! import org.ejtools.util.export.PNGTools; /** --- 36,42 ---- import org.ejtools.graph.service.GraphConsumer; import org.ejtools.graph.service.GraphProducer; ! import org.ejtools.util.FileTools; ! import org.ejtools.util.export.CSVFileTools; ! import org.ejtools.util.export.PNGFileTools; /** *************** *** 123,130 **** { StringBuffer buffer = GraphInternalFrame.this.composite.getPointsAsText(); ! File file = CSVTools.selectCSVFile(); if (file != null) { ! CSVTools.exportAsCVS(buffer, file); } } --- 125,132 ---- { StringBuffer buffer = GraphInternalFrame.this.composite.getPointsAsText(); ! File file = FileTools.selectFile(resources.getString("file.dialog.title.export.csv"), resources.getString("file.dialog.button.export.csv"), JFileChooser.SAVE_DIALOG, CSVFileTools.CSV_FILE_FILTER); if (file != null) { ! CSVFileTools.exportAsCVS(buffer, file); } } *************** *** 136,144 **** public void execute() { ! BufferedImage image = PNGTools.paintAsPNG(GraphInternalFrame.this.printArea); ! File file = PNGTools.selectPNGFile(); if (file != null) { ! PNGTools.exportAsPNG(image, file); } } --- 138,146 ---- public void execute() { ! BufferedImage image = PNGFileTools.paintAsPNG(GraphInternalFrame.this.printArea); ! File file = FileTools.selectFile(resources.getString("file.dialog.title.export.png"), resources.getString("file.dialog.button.export.png"), JFileChooser.SAVE_DIALOG, PNGFileTools.PNG_FILE_FILTER); if (file != null) { ! PNGFileTools.exportAsPNG(image, file); } } |
From: <let...@us...> - 2003-12-14 10:50:10
|
Update of /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/editor In directory sc8-pr-cvs1:/tmp/cvs-serv18699/graph/src/main/org/ejtools/graph/editor Modified Files: GraphDelayEditor.java GraphScaleEditor.java Log Message: Add more javadocs. Adjust text export. Index: GraphDelayEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/editor/GraphDelayEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphDelayEditor.java 15 Sep 2003 22:11:22 -0000 1.4 --- GraphDelayEditor.java 13 Dec 2003 21:26:47 -0000 1.5 *************** *** 1,39 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.editor; ! ! import com.dreambean.awt.editors.TagsEditor; ! ! /** ! * Custom editor for the graph refresh rate. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GraphDelayEditor extends TagsEditor ! { ! /** Constructor for the SearchTypeEditor object */ ! public GraphDelayEditor() ! { ! super(new String[]{ ! "1.0 sec", ! "2.5 sec", ! "5 sec", ! "10 sec", ! "1 min", ! "5 min"}, ! new Object[]{ ! new Long(1000), ! new Long(2500), ! new Long(5000), ! new Long(10000), ! new Long(60000), ! new Long(300000) ! }); ! } ! } ! --- 1,39 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.editor; ! ! import com.dreambean.awt.editors.TagsEditor; ! ! /** ! * Custom editor for the graph refresh rate. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GraphDelayEditor extends TagsEditor ! { ! /** Constructor for the SearchTypeEditor object */ ! public GraphDelayEditor() ! { ! super(new String[]{ ! "1.0 sec", ! "2.5 sec", ! "5 sec", ! "10 sec", ! "1 min", ! "5 min"}, ! new Object[]{ ! new Long(1000), ! new Long(2500), ! new Long(5000), ! new Long(10000), ! new Long(60000), ! new Long(300000) ! }); ! } ! } ! Index: GraphScaleEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/editor/GraphScaleEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphScaleEditor.java 15 Sep 2003 22:11:22 -0000 1.4 --- GraphScaleEditor.java 13 Dec 2003 21:26:47 -0000 1.5 *************** *** 1,41 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.editor; ! ! import com.dreambean.awt.editors.TagsEditor; ! ! /** ! * Custom editor for the graph scale. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GraphScaleEditor extends TagsEditor ! { ! /** Constructor for the SearchTypeEditor object */ ! public GraphScaleEditor() ! { ! super(new String[]{ ! "0.1 sec/pixel", ! "0.5 sec/pixel", ! "1.0 sec/pixel", ! "5.0 sec/pixel", ! "10 sec/pixel", ! "1 min/pixel", ! "5 min/pixel"}, ! new Object[]{ ! new Double(1.0d / 100), ! new Double(1.0d / 500), ! new Double(1.0d / 1000), ! new Double(1.0d / 5000), ! new Double(1.0d / 10000), ! new Double(1.0d / 60000), ! new Double(1.0d / 300000) ! }); ! } ! } ! --- 1,41 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.editor; ! ! import com.dreambean.awt.editors.TagsEditor; ! ! /** ! * Custom editor for the graph scale. ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GraphScaleEditor extends TagsEditor ! { ! /** Constructor for the SearchTypeEditor object */ ! public GraphScaleEditor() ! { ! super(new String[]{ ! "0.1 sec/pixel", ! "0.5 sec/pixel", ! "1.0 sec/pixel", ! "5.0 sec/pixel", ! "10 sec/pixel", ! "1 min/pixel", ! "5 min/pixel"}, ! new Object[]{ ! new Double(1.0d / 100), ! new Double(1.0d / 500), ! new Double(1.0d / 1000), ! new Double(1.0d / 5000), ! new Double(1.0d / 10000), ! new Double(1.0d / 60000), ! new Double(1.0d / 300000) ! }); ! } ! } ! |
From: <let...@us...> - 2003-12-14 10:50:09
|
Update of /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer In directory sc8-pr-cvs1:/tmp/cvs-serv18699/graph/src/main/org/ejtools/graph/renderer Modified Files: AbstractGraphRenderer.java BorderLayoutRenderer.java DefaultGraphRenderer.java GridBagLayoutRenderer.java GridGraphRenderer.java HorizontalAxis.java JPanelGraphRenderer.java TriAxisLayoutRenderer.java VerticalAxis.java Log Message: Add more javadocs. Adjust text export. Index: AbstractGraphRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/AbstractGraphRenderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractGraphRenderer.java 15 Sep 2003 22:11:22 -0000 1.6 --- AbstractGraphRenderer.java 13 Dec 2003 21:26:47 -0000 1.7 *************** *** 1,88 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Graphics; ! ! import javax.swing.JComponent; ! ! import org.ejtools.graph.GraphElement; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public abstract class AbstractGraphRenderer extends JComponent implements GraphRenderer ! { ! /** Description of the Field */ ! protected GraphElement element = null; ! /** Description of the Field */ ! protected double horizontalScale = 1.0d; ! /** Description of the Field */ ! protected int horizontalScaling = ALIGN_RIGHT; ! /** Description of the Field */ ! protected double verticalScale = 1.0d; ! /** Description of the Field */ ! protected int verticalScaling = BOUNDED; ! ! ! /** Constructor for TrackRenderer. */ ! public AbstractGraphRenderer() ! { ! super(); ! } ! ! ! /** ! * @param element The new graphElement value ! */ ! public void setGraphElement(GraphElement element) ! { ! this.element = element; ! } ! ! ! /** ! * @param multiplier The new horizontalScale value ! */ ! public void setHorizontalScale(double multiplier) ! { ! this.horizontalScale = multiplier; ! } ! ! ! /** ! * @param type The new horizontalScaling value ! */ ! public void setHorizontalScaling(int type) ! { ! this.horizontalScaling = type; ! } ! ! ! /** ! * @param multiplier The new verticalScale value ! */ ! public void setVerticalScale(double multiplier) ! { ! this.verticalScale = multiplier; ! } ! ! ! /** ! * @param type The new verticalScaling value ! */ ! public void setVerticalScaling(int type) { } ! ! ! /** ! * @param graphics Description of the Parameter ! */ ! protected abstract void paintComponent(Graphics graphics); ! } --- 1,88 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Graphics; ! ! import javax.swing.JComponent; ! ! import org.ejtools.graph.GraphElement; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public abstract class AbstractGraphRenderer extends JComponent implements GraphRenderer ! { ! /** Description of the Field */ ! protected GraphElement element = null; ! /** Description of the Field */ ! protected double horizontalScale = 1.0d; ! /** Description of the Field */ ! protected int horizontalScaling = ALIGN_RIGHT; ! /** Description of the Field */ ! protected double verticalScale = 1.0d; ! /** Description of the Field */ ! protected int verticalScaling = BOUNDED; ! ! ! /** Constructor for TrackRenderer. */ ! public AbstractGraphRenderer() ! { ! super(); ! } ! ! ! /** ! * @param element The new graphElement value ! */ ! public void setGraphElement(GraphElement element) ! { ! this.element = element; ! } ! ! ! /** ! * @param multiplier The new horizontalScale value ! */ ! public void setHorizontalScale(double multiplier) ! { ! this.horizontalScale = multiplier; ! } ! ! ! /** ! * @param type The new horizontalScaling value ! */ ! public void setHorizontalScaling(int type) ! { ! this.horizontalScaling = type; ! } ! ! ! /** ! * @param multiplier The new verticalScale value ! */ ! public void setVerticalScale(double multiplier) ! { ! this.verticalScale = multiplier; ! } ! ! ! /** ! * @param type The new verticalScaling value ! */ ! public void setVerticalScaling(int type) { } ! ! ! /** ! * @param graphics Description of the Parameter ! */ ! protected abstract void paintComponent(Graphics graphics); ! } Index: BorderLayoutRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/BorderLayoutRenderer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BorderLayoutRenderer.java 15 Sep 2003 22:11:22 -0000 1.5 --- BorderLayoutRenderer.java 13 Dec 2003 21:26:47 -0000 1.6 *************** *** 1,44 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.BorderLayout; ! ! import javax.swing.JComponent; ! ! import org.ejtools.graph.DefaultGraphElement; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class BorderLayoutRenderer extends JPanelGraphRenderer ! { ! /** Constructor for Graph. */ ! public BorderLayoutRenderer() ! { ! super(new BorderLayout()); ! this.element = new DefaultGraphElement(); ! } ! ! ! /** ! * Sets the renderer attribute of the Graph object ! * ! * @param renderer The new renderer value ! * @param position The feature to be added to the Renderer attribute ! */ ! public void addRenderer(GraphRenderer renderer, String position) ! { ! renderer.setGraphElement(this.element); ! this.renderers.add(renderer); ! this.add((JComponent) renderer, position); ! } ! ! } --- 1,44 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.BorderLayout; ! ! import javax.swing.JComponent; ! ! import org.ejtools.graph.DefaultGraphElement; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class BorderLayoutRenderer extends JPanelGraphRenderer ! { ! /** Constructor for Graph. */ ! public BorderLayoutRenderer() ! { ! super(new BorderLayout()); ! this.element = new DefaultGraphElement(); ! } ! ! ! /** ! * Sets the renderer attribute of the Graph object ! * ! * @param renderer The new renderer value ! * @param position The feature to be added to the Renderer attribute ! */ ! public void addRenderer(GraphRenderer renderer, String position) ! { ! renderer.setGraphElement(this.element); ! this.renderers.add(renderer); ! this.add((JComponent) renderer, position); ! } ! ! } Index: DefaultGraphRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/DefaultGraphRenderer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DefaultGraphRenderer.java 15 Sep 2003 22:11:22 -0000 1.7 --- DefaultGraphRenderer.java 13 Dec 2003 21:26:47 -0000 1.8 *************** *** 1,62 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Graphics; ! import java.awt.Insets; ! ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DefaultGraphRenderer extends AbstractGraphRenderer ! { ! /** Constructor for TrackRenderer. */ ! public DefaultGraphRenderer() ! { ! super(); ! } ! ! ! /** ! * @param graphics Description of the Parameter ! */ ! protected void paintComponent(Graphics graphics) ! { ! double minX = element.getXRange().getMin(); ! double maxX = element.getXRange().getMax(); ! double minY = element.getYRange().getMin(); ! double maxY = element.getYRange().getMax(); ! ! Insets insets = this.getInsets(); ! int x = insets.left; ! int y = insets.top; ! double width = (double) this.getWidth() - 1 - insets.left - insets.right; ! double height = (double) this.getHeight() - 1 - insets.top - insets.bottom; ! ! double scaleX = width / (maxX - minX); ! double scaleY = -height / (maxY - minY); ! double offsetX = x - scaleX * minX; ! double offsetY = y - scaleY * maxY; ! ! if (this.horizontalScaling == GraphRenderer.ALIGN_LEFT) ! { ! scaleX = 1.0d; ! offsetX = -minX; ! } ! if (this.horizontalScaling == GraphRenderer.ALIGN_RIGHT) ! { ! scaleX = 1.0d; ! offsetX = width - maxX; ! } ! ! this.element.draw(graphics, scaleX, offsetX, scaleY, offsetY); ! } ! } --- 1,62 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Graphics; ! import java.awt.Insets; ! ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DefaultGraphRenderer extends AbstractGraphRenderer ! { ! /** Constructor for TrackRenderer. */ ! public DefaultGraphRenderer() ! { ! super(); ! } ! ! ! /** ! * @param graphics Description of the Parameter ! */ ! protected void paintComponent(Graphics graphics) ! { ! double minX = element.getXRange().getMin(); ! double maxX = element.getXRange().getMax(); ! double minY = element.getYRange().getMin(); ! double maxY = element.getYRange().getMax(); ! ! Insets insets = this.getInsets(); ! int x = insets.left; ! int y = insets.top; ! double width = (double) this.getWidth() - 1 - insets.left - insets.right; ! double height = (double) this.getHeight() - 1 - insets.top - insets.bottom; ! ! double scaleX = width / (maxX - minX); ! double scaleY = -height / (maxY - minY); ! double offsetX = x - scaleX * minX; ! double offsetY = y - scaleY * maxY; ! ! if (this.horizontalScaling == GraphRenderer.ALIGN_LEFT) ! { ! scaleX = 1.0d; ! offsetX = -minX; ! } ! if (this.horizontalScaling == GraphRenderer.ALIGN_RIGHT) ! { ! scaleX = 1.0d; ! offsetX = width - maxX; ! } ! ! this.element.draw(graphics, scaleX, offsetX, scaleY, offsetY); ! } ! } Index: GridBagLayoutRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/GridBagLayoutRenderer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** GridBagLayoutRenderer.java 15 Sep 2003 22:11:22 -0000 1.5 --- GridBagLayoutRenderer.java 13 Dec 2003 21:26:47 -0000 1.6 *************** *** 1,43 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! ! import javax.swing.JComponent; ! ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class GridBagLayoutRenderer extends JPanelGraphRenderer ! { ! /** Constructor for Graph. */ ! public GridBagLayoutRenderer() ! { ! super(new GridBagLayout()); ! } ! ! ! /** ! * Sets the renderer attribute of the Graph object ! * ! * @param renderer The new renderer value ! * @param constraints The feature to be added to the Renderer attribute ! */ ! public void addRenderer(GraphRenderer renderer, GridBagConstraints constraints) ! { ! renderer.setGraphElement(this.element); ! this.renderers.add(renderer); ! this.add((JComponent) renderer, constraints); ! } ! ! } --- 1,43 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! ! import javax.swing.JComponent; ! ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class GridBagLayoutRenderer extends JPanelGraphRenderer ! { ! /** Constructor for Graph. */ ! public GridBagLayoutRenderer() ! { ! super(new GridBagLayout()); ! } ! ! ! /** ! * Sets the renderer attribute of the Graph object ! * ! * @param renderer The new renderer value ! * @param constraints The feature to be added to the Renderer attribute ! */ ! public void addRenderer(GraphRenderer renderer, GridBagConstraints constraints) ! { ! renderer.setGraphElement(this.element); ! this.renderers.add(renderer); ! this.add((JComponent) renderer, constraints); ! } ! ! } Index: GridGraphRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/GridGraphRenderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GridGraphRenderer.java 15 Sep 2003 22:11:22 -0000 1.6 --- GridGraphRenderer.java 13 Dec 2003 21:26:47 -0000 1.7 *************** *** 1,137 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Color; ! import java.awt.FontMetrics; ! import java.awt.Graphics; ! import java.awt.Insets; ! import java.awt.geom.Rectangle2D; ! import java.text.Format; ! ! import org.ejtools.graph.Axis; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class GridGraphRenderer extends Axis ! { ! /** Description of the Field */ ! protected Format horizontalFormat = null; ! /** Description of the Field */ ! protected Format verticalFormat = null; ! ! ! /** ! *Constructor for the GridRenderer object ! * ! * @param horizontalFormat Description of the Parameter ! * @param verticalFormat Description of the Parameter ! */ ! public GridGraphRenderer(Format horizontalFormat, Format verticalFormat) ! { ! this.format = horizontalFormat; ! this.horizontalFormat = horizontalFormat; ! this.verticalFormat = verticalFormat; ! } ! ! ! /** ! * @param graphics Description of the Parameter ! */ ! protected void paintComponent(Graphics graphics) ! { ! double multiplier = 0.0d; ! ! graphics.setFont(FONT); ! FontMetrics metrics = graphics.getFontMetrics(); ! graphics.setColor(Color.lightGray); ! ! double minX = element.getXRange().getMin(); ! double maxX = element.getXRange().getMax(); ! double minY = element.getYRange().getMin(); ! double maxY = element.getYRange().getMax(); ! ! Insets insets = this.getInsets(); ! int x = insets.left; ! int y = insets.top; ! double width = (double) this.getWidth() - 1 - insets.left - insets.right; ! double height = (double) this.getHeight() - 1 - insets.top - insets.bottom; ! ! double scaleX = width / (maxX - minX); ! double scaleY = -height / (maxY - minY); ! double offsetX = x - scaleX * minX; ! double offsetY = y - scaleY * maxY; ! ! if (this.horizontalScaling == GraphRenderer.ALIGN_LEFT) ! { ! scaleX = 1.0d; ! offsetX = -minX; ! } ! if (this.horizontalScaling == GraphRenderer.ALIGN_RIGHT) ! { ! scaleX = 1.0d * this.horizontalScale; ! offsetX = width - maxX * this.horizontalScale; ! } ! ! // Render horizontal lines ! minX = (x - offsetX) / scaleX; ! this.format = this.horizontalFormat; ! ! String minText = this.getFormated(minX); ! Rectangle2D minBounds = metrics.getStringBounds(minText, graphics); ! String maxText = this.getFormated(maxX); ! Rectangle2D maxBounds = metrics.getStringBounds(maxText, graphics); ! ! // Horizontal drawing ! double bound = Math.max(minBounds.getWidth() * 4.0d, maxBounds.getWidth() * 4.0d); ! ! // Specified the number of lines ! int ticks = 1; ! while ((width / ticks) > bound) ! { ! ticks = ticks * 2; ! } ! ! // Draw the divisions ! multiplier = width / ticks / 2; ! for (int i = 0; i <= (2 * ticks); i++) ! { ! graphics.drawLine((int) (i * multiplier), 0, (int) (i * multiplier), (int) height); ! } ! ! // Render horizontal lines ! this.format = this.verticalFormat; ! ! minText = this.getFormated(minY); ! minBounds = metrics.getStringBounds(minText, graphics); ! maxText = this.getFormated(maxY); ! maxBounds = metrics.getStringBounds(maxText, graphics); ! ! // Vertical drawing ! bound = Math.max(minBounds.getHeight() * 4.0d, maxBounds.getHeight() * 4.0d); ! ! // Specified the number of texts ! ticks = 1; ! while ((height / ticks) > bound) ! { ! ticks = ticks * 2; ! } ! ! // Draw the divisions ! multiplier = height / ticks / 2; ! for (int i = 0; i <= (2 * ticks); i++) ! { ! graphics.drawLine(0, (int) (i * multiplier), (int) width, (int) (i * multiplier)); ! } ! ! this.element.draw(graphics, scaleX, offsetX, scaleY, offsetY); ! } ! } --- 1,137 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Color; ! import java.awt.FontMetrics; ! import java.awt.Graphics; ! import java.awt.Insets; ! import java.awt.geom.Rectangle2D; ! import java.text.Format; ! ! import org.ejtools.graph.Axis; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class GridGraphRenderer extends Axis ! { ! /** Description of the Field */ ! protected Format horizontalFormat = null; ! /** Description of the Field */ ! protected Format verticalFormat = null; ! ! ! /** ! *Constructor for the GridRenderer object ! * ! * @param horizontalFormat Description of the Parameter ! * @param verticalFormat Description of the Parameter ! */ ! public GridGraphRenderer(Format horizontalFormat, Format verticalFormat) ! { ! this.format = horizontalFormat; ! this.horizontalFormat = horizontalFormat; ! this.verticalFormat = verticalFormat; ! } ! ! ! /** ! * @param graphics Description of the Parameter ! */ ! protected void paintComponent(Graphics graphics) ! { ! double multiplier = 0.0d; ! ! graphics.setFont(FONT); ! FontMetrics metrics = graphics.getFontMetrics(); ! graphics.setColor(Color.lightGray); ! ! double minX = element.getXRange().getMin(); ! double maxX = element.getXRange().getMax(); ! double minY = element.getYRange().getMin(); ! double maxY = element.getYRange().getMax(); ! ! Insets insets = this.getInsets(); ! int x = insets.left; ! int y = insets.top; ! double width = (double) this.getWidth() - 1 - insets.left - insets.right; ! double height = (double) this.getHeight() - 1 - insets.top - insets.bottom; ! ! double scaleX = width / (maxX - minX); ! double scaleY = -height / (maxY - minY); ! double offsetX = x - scaleX * minX; ! double offsetY = y - scaleY * maxY; ! ! if (this.horizontalScaling == GraphRenderer.ALIGN_LEFT) ! { ! scaleX = 1.0d; ! offsetX = -minX; ! } ! if (this.horizontalScaling == GraphRenderer.ALIGN_RIGHT) ! { ! scaleX = 1.0d * this.horizontalScale; ! offsetX = width - maxX * this.horizontalScale; ! } ! ! // Render horizontal lines ! minX = (x - offsetX) / scaleX; ! this.format = this.horizontalFormat; ! ! String minText = this.getFormated(minX); ! Rectangle2D minBounds = metrics.getStringBounds(minText, graphics); ! String maxText = this.getFormated(maxX); ! Rectangle2D maxBounds = metrics.getStringBounds(maxText, graphics); ! ! // Horizontal drawing ! double bound = Math.max(minBounds.getWidth() * 4.0d, maxBounds.getWidth() * 4.0d); ! ! // Specified the number of lines ! int ticks = 1; ! while ((width / ticks) > bound) ! { ! ticks = ticks * 2; ! } ! ! // Draw the divisions ! multiplier = width / ticks / 2; ! for (int i = 0; i <= (2 * ticks); i++) ! { ! graphics.drawLine((int) (i * multiplier), 0, (int) (i * multiplier), (int) height); ! } ! ! // Render horizontal lines ! this.format = this.verticalFormat; ! ! minText = this.getFormated(minY); ! minBounds = metrics.getStringBounds(minText, graphics); ! maxText = this.getFormated(maxY); ! maxBounds = metrics.getStringBounds(maxText, graphics); ! ! // Vertical drawing ! bound = Math.max(minBounds.getHeight() * 4.0d, maxBounds.getHeight() * 4.0d); ! ! // Specified the number of texts ! ticks = 1; ! while ((height / ticks) > bound) ! { ! ticks = ticks * 2; ! } ! ! // Draw the divisions ! multiplier = height / ticks / 2; ! for (int i = 0; i <= (2 * ticks); i++) ! { ! graphics.drawLine(0, (int) (i * multiplier), (int) width, (int) (i * multiplier)); ! } ! ! this.element.draw(graphics, scaleX, offsetX, scaleY, offsetY); ! } ! } Index: HorizontalAxis.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/HorizontalAxis.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HorizontalAxis.java 15 Sep 2003 22:11:22 -0000 1.6 --- HorizontalAxis.java 13 Dec 2003 21:26:47 -0000 1.7 *************** *** 1,130 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Color; ! import java.awt.FontMetrics; ! import java.awt.Graphics; ! import java.awt.Insets; ! import java.awt.geom.Rectangle2D; ! import java.text.Format; ! ! import org.ejtools.graph.Axis; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class HorizontalAxis extends Axis ! { ! /** ! * Constructor for VerticalAxis. ! * ! * @param format Description of the Parameter ! * @param position Description of the Parameter ! */ ! public HorizontalAxis(Format format, int position) ! { ! this.format = format; ! this.orientation = HORIZONTAL; ! this.position = position; ! } ! ! ! /** ! * Description of the Method ! * ! * @param graphics Description of the Parameter ! */ ! public void paintComponent(Graphics graphics) ! { ! String display; ! double multiplier = 0.0d; ! ! graphics.setFont(FONT); ! FontMetrics metrics = graphics.getFontMetrics(); ! ! Insets insets = this.getInsets(); ! int x = insets.left; ! // int y = insets.top; ! double width = (double) this.getWidth() - 1 - insets.left - insets.right; ! double height = (double) this.getHeight() - 1 - insets.top - insets.bottom; ! ! double min = element.getXRange().getMin(); ! double max = element.getXRange().getMax(); ! ! double scaleX = width / (max - min); ! double offsetX = x - scaleX * min; ! ! if (this.horizontalScaling == GraphRenderer.ALIGN_LEFT) ! { ! scaleX = 1.0d; ! offsetX = -min; ! } ! if (this.horizontalScaling == GraphRenderer.ALIGN_RIGHT) ! { ! scaleX = 1.0d * this.horizontalScale; ! offsetX = width - max * this.horizontalScale; ! } ! ! min = (x - offsetX) / scaleX; ! ! String minText = this.getFormated(min); ! Rectangle2D minBounds = metrics.getStringBounds(minText, graphics); ! String maxText = this.getFormated(max); ! Rectangle2D maxBounds = metrics.getStringBounds(maxText, graphics); ! ! // Horizontal drawing ! double bound = Math.max(minBounds.getWidth() * 4.0d, maxBounds.getWidth() * 4.0d); ! ! // Specified the number of texts ! int ticks = 1; ! while ((width / ticks) > bound) ! { ! ticks = ticks * 2; ! } ! ! // Draw the baseline ! graphics.drawLine(0, 0, (int) width, 0); ! ! // Draw the divisions ! multiplier = width / ticks / 2; ! graphics.setColor(Color.black); ! for (int i = 0; i <= (2 * ticks); i++) ! { ! int j = (int) (i * multiplier); ! graphics.drawLine(j, 0, j, FONT.getSize() / 2); ! } ! ! // Draw the ticks ! multiplier = width / ticks; ! ! // Draw first tick ! graphics.drawLine(0, 0, 0, FONT.getSize() - metrics.getDescent()); ! graphics.drawString(minText, 0, (int) (height - metrics.getDescent())); ! ! // Draw others ticks ! for (int i = 1; i < ticks; i++) ! { ! int j = (int) (i * multiplier); ! graphics.drawLine(j, 0, j, FONT.getSize() - metrics.getDescent()); ! ! display = this.getFormated(min + i * (max - min) / ticks); ! Rectangle2D middleBounds = metrics.getStringBounds(display, graphics); ! ! j = j - (int) (middleBounds.getWidth() / 2); ! ! graphics.drawString(display, j, (int) (height - metrics.getDescent())); ! } ! ! // Draw last tick ! graphics.drawLine((int) width, 0, (int) width, FONT.getSize() - metrics.getDescent()); ! graphics.drawString(maxText, (int) (width - maxBounds.getWidth()), (int) (height - metrics.getDescent())); ! } ! } --- 1,130 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Color; ! import java.awt.FontMetrics; ! import java.awt.Graphics; ! import java.awt.Insets; ! import java.awt.geom.Rectangle2D; ! import java.text.Format; ! ! import org.ejtools.graph.Axis; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class HorizontalAxis extends Axis ! { ! /** ! * Constructor for VerticalAxis. ! * ! * @param format Description of the Parameter ! * @param position Description of the Parameter ! */ ! public HorizontalAxis(Format format, int position) ! { ! this.format = format; ! this.orientation = HORIZONTAL; ! this.position = position; ! } ! ! ! /** ! * Description of the Method ! * ! * @param graphics Description of the Parameter ! */ ! public void paintComponent(Graphics graphics) ! { ! String display; ! double multiplier = 0.0d; ! ! graphics.setFont(FONT); ! FontMetrics metrics = graphics.getFontMetrics(); ! ! Insets insets = this.getInsets(); ! int x = insets.left; ! // int y = insets.top; ! double width = (double) this.getWidth() - 1 - insets.left - insets.right; ! double height = (double) this.getHeight() - 1 - insets.top - insets.bottom; ! ! double min = element.getXRange().getMin(); ! double max = element.getXRange().getMax(); ! ! double scaleX = width / (max - min); ! double offsetX = x - scaleX * min; ! ! if (this.horizontalScaling == GraphRenderer.ALIGN_LEFT) ! { ! scaleX = 1.0d; ! offsetX = -min; ! } ! if (this.horizontalScaling == GraphRenderer.ALIGN_RIGHT) ! { ! scaleX = 1.0d * this.horizontalScale; ! offsetX = width - max * this.horizontalScale; ! } ! ! min = (x - offsetX) / scaleX; ! ! String minText = this.getFormated(min); ! Rectangle2D minBounds = metrics.getStringBounds(minText, graphics); ! String maxText = this.getFormated(max); ! Rectangle2D maxBounds = metrics.getStringBounds(maxText, graphics); ! ! // Horizontal drawing ! double bound = Math.max(minBounds.getWidth() * 4.0d, maxBounds.getWidth() * 4.0d); ! ! // Specified the number of texts ! int ticks = 1; ! while ((width / ticks) > bound) ! { ! ticks = ticks * 2; ! } ! ! // Draw the baseline ! graphics.drawLine(0, 0, (int) width, 0); ! ! // Draw the divisions ! multiplier = width / ticks / 2; ! graphics.setColor(Color.black); ! for (int i = 0; i <= (2 * ticks); i++) ! { ! int j = (int) (i * multiplier); ! graphics.drawLine(j, 0, j, FONT.getSize() / 2); ! } ! ! // Draw the ticks ! multiplier = width / ticks; ! ! // Draw first tick ! graphics.drawLine(0, 0, 0, FONT.getSize() - metrics.getDescent()); ! graphics.drawString(minText, 0, (int) (height - metrics.getDescent())); ! ! // Draw others ticks ! for (int i = 1; i < ticks; i++) ! { ! int j = (int) (i * multiplier); ! graphics.drawLine(j, 0, j, FONT.getSize() - metrics.getDescent()); ! ! display = this.getFormated(min + i * (max - min) / ticks); ! Rectangle2D middleBounds = metrics.getStringBounds(display, graphics); ! ! j = j - (int) (middleBounds.getWidth() / 2); ! ! graphics.drawString(display, j, (int) (height - metrics.getDescent())); ! } ! ! // Draw last tick ! graphics.drawLine((int) width, 0, (int) width, FONT.getSize() - metrics.getDescent()); ! graphics.drawString(maxText, (int) (width - maxBounds.getWidth()), (int) (height - metrics.getDescent())); ! } ! } Index: JPanelGraphRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/JPanelGraphRenderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** JPanelGraphRenderer.java 15 Sep 2003 22:11:22 -0000 1.6 --- JPanelGraphRenderer.java 13 Dec 2003 21:26:47 -0000 1.7 *************** *** 1,125 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.BorderLayout; ! import java.awt.LayoutManager; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.JComponent; ! import javax.swing.JPanel; ! ! import org.ejtools.graph.DefaultGraphElement; ! import org.ejtools.graph.GraphElement; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class JPanelGraphRenderer extends JPanel implements GraphRenderer ! { ! /** Description of the Field */ ! protected GraphElement element = null; ! /** Description of the Field */ ! protected Vector renderers = new Vector(); ! ! ! /** ! * Constructor for JPanelGraph. ! * ! * @param layout ! */ ! public JPanelGraphRenderer(LayoutManager layout) ! { ! super(layout); ! this.element = new DefaultGraphElement(); ! } ! ! ! /** Constructor for Graph. */ ! public JPanelGraphRenderer() ! { ! this(new BorderLayout()); ! } ! ! ! /** ! * Sets the renderer attribute of the Graph object ! * ! * @param renderer The new renderer value ! */ ! public void addRenderer(GraphRenderer renderer) ! { ! renderer.setGraphElement(this.element); ! this.renderers.add(renderer); ! this.add((JComponent) renderer); ! } ! ! ! /** ! * @param element The new graphElement value ! */ ! public void setGraphElement(GraphElement element) ! { ! this.element = element; ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setGraphElement(this.element); ! } ! } ! ! ! /** ! * @param multiplier The new horizontalScale value ! */ ! public void setHorizontalScale(double multiplier) ! { ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setHorizontalScale(multiplier); ! } ! } ! ! ! /** ! * @param type The new horizontalScaling value ! */ ! public void setHorizontalScaling(int type) ! { ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setHorizontalScaling(type); ! } ! } ! ! ! /** ! * @param multiplier The new verticalScale value ! */ ! public void setVerticalScale(double multiplier) ! { ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setVerticalScale(multiplier); ! } ! } ! ! ! /** ! * @param type The new verticalScaling value ! */ ! public void setVerticalScaling(int type) ! { ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setVerticalScaling(type); ! } ! } ! } --- 1,125 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.BorderLayout; ! import java.awt.LayoutManager; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.JComponent; ! import javax.swing.JPanel; ! ! import org.ejtools.graph.DefaultGraphElement; ! import org.ejtools.graph.GraphElement; ! import org.ejtools.graph.GraphRenderer; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class JPanelGraphRenderer extends JPanel implements GraphRenderer ! { ! /** Description of the Field */ ! protected GraphElement element = null; ! /** Description of the Field */ ! protected Vector renderers = new Vector(); ! ! ! /** ! * Constructor for JPanelGraph. ! * ! * @param layout ! */ ! public JPanelGraphRenderer(LayoutManager layout) ! { ! super(layout); ! this.element = new DefaultGraphElement(); ! } ! ! ! /** Constructor for Graph. */ ! public JPanelGraphRenderer() ! { ! this(new BorderLayout()); ! } ! ! ! /** ! * Sets the renderer attribute of the Graph object ! * ! * @param renderer The new renderer value ! */ ! public void addRenderer(GraphRenderer renderer) ! { ! renderer.setGraphElement(this.element); ! this.renderers.add(renderer); ! this.add((JComponent) renderer); ! } ! ! ! /** ! * @param element The new graphElement value ! */ ! public void setGraphElement(GraphElement element) ! { ! this.element = element; ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setGraphElement(this.element); ! } ! } ! ! ! /** ! * @param multiplier The new horizontalScale value ! */ ! public void setHorizontalScale(double multiplier) ! { ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setHorizontalScale(multiplier); ! } ! } ! ! ! /** ! * @param type The new horizontalScaling value ! */ ! public void setHorizontalScaling(int type) ! { ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setHorizontalScaling(type); ! } ! } ! ! ! /** ! * @param multiplier The new verticalScale value ! */ ! public void setVerticalScale(double multiplier) ! { ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setVerticalScale(multiplier); ! } ! } ! ! ! /** ! * @param type The new verticalScaling value ! */ ! public void setVerticalScaling(int type) ! { ! for (Iterator it = this.renderers.iterator(); it.hasNext(); ) ! { ! ((GraphRenderer) it.next()).setVerticalScaling(type); ! } ! } ! } Index: TriAxisLayoutRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/TriAxisLayoutRenderer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TriAxisLayoutRenderer.java 15 Sep 2003 22:11:22 -0000 1.7 --- TriAxisLayoutRenderer.java 13 Dec 2003 21:26:47 -0000 1.8 *************** *** 1,89 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.GridBagConstraints; ! import java.text.DecimalFormat; ! import java.text.SimpleDateFormat; ! ! import javax.swing.JComponent; ! ! import org.ejtools.graph.Axis; ! import org.ejtools.graph.GraphElement; ! import org.ejtools.graph.GraphRenderer; ! import org.ejtools.graph.LabelElement; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class TriAxisLayoutRenderer extends GridBagLayoutRenderer ! { ! /** Constructor for TriAxisGraph. */ ! public TriAxisLayoutRenderer() ! { ! super(); ! ! GridBagConstraints constraints = new GridBagConstraints(); ! ! GraphRenderer rd = new GridGraphRenderer(new SimpleDateFormat("HH:mm:ss"), new DecimalFormat("0")); ! constraints.gridx = 1; ! constraints.gridy = 1; ! constraints.fill = GridBagConstraints.BOTH; ! constraints.weightx = 1.0; ! constraints.weighty = 1.0; ! this.addRenderer(rd, constraints); ! ! Axis axis = new HorizontalAxis(new SimpleDateFormat("HH:mm:ss"), Axis.BOTTOM); ! constraints.gridx = 1; ! constraints.gridy = 2; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! constraints.weightx = 0.0; ! constraints.weighty = 0.0; ! this.addRenderer(axis, constraints); ! ! axis = new VerticalAxis(new DecimalFormat("0"), Axis.LEFT); ! constraints.gridx = 0; ! constraints.gridy = 1; ! constraints.fill = GridBagConstraints.VERTICAL; ! constraints.weightx = 0.0; ! constraints.weighty = 0.0; ! this.addRenderer(axis, constraints); ! ! axis = new VerticalAxis(new DecimalFormat("0"), Axis.RIGHT); ! constraints.gridx = 2; ! constraints.gridy = 1; ! constraints.fill = GridBagConstraints.VERTICAL; ! constraints.weightx = 0.0; ! constraints.weighty = 0.0; ! this.addRenderer(axis, constraints); ! } ! ! ! /** ! * @param element The new graphElement value ! */ ! public void setGraphElement(GraphElement element) ! { ! super.setGraphElement(element); ! ! if (element instanceof LabelElement) ! { ! JComponent component = ((LabelElement) this.element).getComponent(); ! ! GridBagConstraints constraints = new GridBagConstraints(); ! constraints.gridx = 0; ! constraints.gridy = 0; ! constraints.gridwidth = 3; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! constraints.weightx = 0.0; ! constraints.weighty = 0.0; ! this.add(component, constraints); ! } ! } ! } --- 1,89 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.GridBagConstraints; ! import java.text.DecimalFormat; ! import java.text.SimpleDateFormat; ! ! import javax.swing.JComponent; ! ! import org.ejtools.graph.Axis; ! import org.ejtools.graph.GraphElement; ! import org.ejtools.graph.GraphRenderer; ! import org.ejtools.graph.LabelElement; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class TriAxisLayoutRenderer extends GridBagLayoutRenderer ! { ! /** Constructor for TriAxisGraph. */ ! public TriAxisLayoutRenderer() ! { ! super(); ! ! GridBagConstraints constraints = new GridBagConstraints(); ! ! GraphRenderer rd = new GridGraphRenderer(new SimpleDateFormat("HH:mm:ss"), new DecimalFormat("0")); ! constraints.gridx = 1; ! constraints.gridy = 1; ! constraints.fill = GridBagConstraints.BOTH; ! constraints.weightx = 1.0; ! constraints.weighty = 1.0; ! this.addRenderer(rd, constraints); ! ! Axis axis = new HorizontalAxis(new SimpleDateFormat("HH:mm:ss"), Axis.BOTTOM); ! constraints.gridx = 1; ! constraints.gridy = 2; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! constraints.weightx = 0.0; ! constraints.weighty = 0.0; ! this.addRenderer(axis, constraints); ! ! axis = new VerticalAxis(new DecimalFormat("0"), Axis.LEFT); ! constraints.gridx = 0; ! constraints.gridy = 1; ! constraints.fill = GridBagConstraints.VERTICAL; ! constraints.weightx = 0.0; ! constraints.weighty = 0.0; ! this.addRenderer(axis, constraints); ! ! axis = new VerticalAxis(new DecimalFormat("0"), Axis.RIGHT); ! constraints.gridx = 2; ! constraints.gridy = 1; ! constraints.fill = GridBagConstraints.VERTICAL; ! constraints.weightx = 0.0; ! constraints.weighty = 0.0; ! this.addRenderer(axis, constraints); ! } ! ! ! /** ! * @param element The new graphElement value ! */ ! public void setGraphElement(GraphElement element) ! { ! super.setGraphElement(element); ! ! if (element instanceof LabelElement) ! { ! JComponent component = ((LabelElement) this.element).getComponent(); ! ! GridBagConstraints constraints = new GridBagConstraints(); ! constraints.gridx = 0; ! constraints.gridy = 0; ! constraints.gridwidth = 3; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! constraints.weightx = 0.0; ! constraints.weighty = 0.0; ! this.add(component, constraints); ! } ! } ! } Index: VerticalAxis.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/renderer/VerticalAxis.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** VerticalAxis.java 15 Sep 2003 22:11:22 -0000 1.6 --- VerticalAxis.java 13 Dec 2003 21:26:47 -0000 1.7 *************** *** 1,159 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Color; ! import java.awt.Dimension; ! import java.awt.FontMetrics; ! import java.awt.Graphics; ! import java.awt.Insets; ! import java.awt.geom.Rectangle2D; ! import java.text.Format; ! ! import org.ejtools.graph.Axis; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class VerticalAxis extends Axis ! { ! /** ! * Constructor for VerticalAxis. ! * ! * @param format Description of the Parameter ! * @param position Description of the Parameter ! */ ! public VerticalAxis(Format format, int position) ! { ! this.format = format; ! this.orientation = VERTICAL; ! this.position = position; ! } ! ! ! /** ! * Description of the Method ! * ! * @param graphics Description of the Parameter ! */ ! public void paintComponent(Graphics graphics) ! { ! String display; ! double multiplier = 0.0d; ! int base; ! int small; ! int middle; ! int correction; ! ! graphics.setFont(FONT); ! FontMetrics metrics = graphics.getFontMetrics(); ! ! Insets insets = this.getInsets(); ! // int x = this.getX() + insets.left; ! // int y = this.getY() + insets.top; ! // double width = (double) this.getWidth() - 1 - insets.left - insets.right; ! double height = (double) this.getHeight() - 1 - insets.top - insets.bottom; ! ! double min = element.getYRange().getMin(); ! double max = element.getYRange().getMax(); ! ! String minText = this.getFormated(min); ! Rectangle2D minBounds = metrics.getStringBounds(minText, graphics); ! String maxText = this.getFormated(max); ! Rectangle2D maxBounds = metrics.getStringBounds(maxText, graphics); ! ! // New dimension ! double newBound = Math.max(minBounds.getWidth(), maxBounds.getWidth()); ! this.dimension = new Dimension((int) (newBound + FONT.getSize()), this.getHeight()); ! this.revalidate(); ! ! // Vertical drawing ! double bound = Math.max(minBounds.getHeight() * 4.0d, maxBounds.getHeight() * 4.0d); ! ! // Specified the number of texts ! int ticks = 1; ! while ((height / ticks) > bound) ! { ! ticks = ticks * 2; ! } ! ! // Set parameters ! if (this.position == LEFT) ! { ! middle = (int) (newBound); ! small = middle + FONT.getSize() / 2 - 1; ! base = middle + FONT.getSize() - 1; ! } ! else ! { ! middle = FONT.getSize() - 2; ! small = FONT.getSize() / 2 - 1; ! base = 0; ! } ! ! // Draw the baseline ! graphics.drawLine(base, 0, base, (int) height); ! ! // Draw the divisions ! multiplier = height / ticks / 2; ! graphics.setColor(Color.black); ! for (int i = 0; i <= (2 * ticks); i++) ! { ! graphics.drawLine(base, (int) (i * multiplier), small, (int) (i * multiplier)); ! } ! ! // draw ticks ! multiplier = height / ticks; ! ! // Draw first tick ! graphics.drawLine(base, (int) height, middle, (int) height); ! if (this.position == LEFT) ! { ! correction = -(int) minBounds.getWidth(); ! } ! else ! { ! correction = 2; ! } ! graphics.drawString(minText, middle + correction, (int) (height - metrics.getDescent())); ! ! // Draw others ticks ! for (int i = 1; i < ticks; i++) ! { ! int j = (int) (height - i * multiplier); ! graphics.drawLine(base, j, middle, j); ! ! display = this.getFormated(min + i * (max - min) / ticks); ! Rectangle2D middleBounds = metrics.getStringBounds(display, graphics); ! ! j = j + (int) (middleBounds.getHeight() / 2); ! if (this.position == LEFT) ! { ! correction = -(int) middleBounds.getWidth(); ! } ! else ! { ! correction = 2; ! } ! graphics.drawString(display, middle + correction, j); ! } ! ! // Draw last tick ! graphics.drawLine(base, 0, middle, 0); ! if (this.position == LEFT) ! { ! correction = -(int) maxBounds.getWidth(); ! } ! else ! { ! correction = 2; ! } ! graphics.drawString(maxText, middle + correction, metrics.getAscent()); ! } ! } --- 1,159 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph.renderer; ! ! import java.awt.Color; ! import java.awt.Dimension; ! import java.awt.FontMetrics; ! import java.awt.Graphics; ! import java.awt.Insets; ! import java.awt.geom.Rectangle2D; ! import java.text.Format; ! ! import org.ejtools.graph.Axis; ! ! /** ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class VerticalAxis extends Axis ! { ! /** ! * Constructor for VerticalAxis. ! * ! * @param format Description of the Parameter ! * @param position Description of the Parameter ! */ ! public VerticalAxis(Format format, int position) ! { ! this.format = format; ! this.orientation = VERTICAL; ! this.position = position; ! } ! ! ! /** ! * Description of the Method ! * ! * @param graphics Description of the Parameter ! */ ! public void paintComponent(Graphics graphics) ! { ! String display; ! double multiplier = 0.0d; ! int base; ! int small; ! int middle; ! int correction; ! ! graphics.setFont(FONT); ! FontMetrics metrics = graphics.getFontMetrics(); ! ! Insets insets = this.getInsets(); ! // int x = this.getX() + insets.left; ! // int y = this.getY() + insets.top; ! // double width = (double) this.getWidth() - 1 - insets.left - insets.right; ! double height = (double) this.getHeight() - 1 - insets.top - insets.bottom; ! ! double min = element.getYRange().getMin(); ! double max = element.getYRange().getMax(); ! ! String minText = this.getFormated(min); ! Rectangle2D minBounds = metrics.getStringBounds(minText, graphics); ! String maxText = this.getFormated(max); ! Rectangle2D maxBounds = metrics.getStringBounds(maxText, graphics); ! ! // New dimension ! double newBound = Math.max(minBounds.getWidth(), maxBounds.getWidth()); ! this.dimension = new Dimension((int) (newBound + FONT.getSize()), this.getHeight()); ! this.revalidate(); ! ! // Vertical drawing ! double bound = Math.max(minBounds.getHeight() * 4.0d, maxBounds.getHeight() * 4.0d); ! ! // Specified the number of texts ! int ticks = 1; ! while ((height / ticks) > bound) ! { ! ticks = ticks * 2; ! } ! ! // Set parameters ! if (this.position == LEFT) ! { ! middle = (int) (newBound); ! small = middle + FONT.getSize() / 2 - 1; ! base = middle + FONT.getSize() - 1; ! } ! else ! { ! middle = FONT.getSize() - 2; ! small = FONT.getSize() / 2 - 1; ! base = 0; ! } ! ! // Draw the baseline ! graphics.drawLine(base, 0, base, (int) height); ! ! // Draw the divisions ! multiplier = height / ticks / 2; ! graphics.setColor(Color.black); ! for (int i = 0; i <= (2 * ticks); i++) ! { ! graphics.drawLine(base, (int) (i * multiplier), small, (int) (i * multiplier)); ! } ! ! // draw ticks ! multiplier = height / ticks; ! ! // Draw first tick ! graphics.drawLine(base, (int) height, middle, (int) height); ! if (this.position == LEFT) ! { ! correction = -(int) minBounds.getWidth(); ! } ! else ! { ! correction = 2; ! } ! graphics.drawString(minText, middle + correction, (int) (height - metrics.getDescent())); ! ! // Draw others ticks ! for (int i = 1; i < ticks; i++) ! { ! int j = (int) (height - i * multiplier); ! graphics.drawLine(base, j, middle, j); ! ! display = this.getFormated(min + i * (max - min) / ticks); ! Rectangle2D middleBounds = metrics.getStringBounds(display, graphics); ! ! j = j + (int) (middleBounds.getHeight() / 2); ! if (this.position == LEFT) ! { ! correction = -(int) middleBounds.getWidth(); ! } ! else ! { ! correction = 2; ! } ! graphics.drawString(display, middle + correction, j); ! } ! ! // Draw last tick ! graphics.drawLine(base, 0, middle, 0); ! if (this.position == LEFT) ! { ! correction = -(int) maxBounds.getWidth(); ! } ! else ! { ! correction = 2; ! } ! graphics.drawString(maxText, middle + correction, metrics.getAscent()); ! } ! } |
From: <let...@us...> - 2003-12-14 10:50:08
|
Update of /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io In directory sc8-pr-cvs1:/tmp/cvs-serv18971/common/src/main/org/ejtools/archive/io Modified Files: ByteReader.java DirectoryWriter.java FileReader.java FileWriter.java Reader.java StreamReader.java StreamWriter.java Writer.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 the underlying read and write operation for the Archive IO system (Stream and File based). </body> </html> Index: ByteReader.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io/ByteReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ByteReader.java 15 Sep 2003 23:14:31 -0000 1.1 --- ByteReader.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 12,15 **** --- 12,17 ---- /** + * Reader implementation based on a byte array. The stream is build onto the byte array. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 18,22 **** { /** ! *Constructor for the FileMapper object * * @param content Description of the Parameter --- 20,24 ---- { /** ! * Builds a ByteReader on a byte array * * @param content Description of the Parameter Index: DirectoryWriter.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io/DirectoryWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DirectoryWriter.java 15 Sep 2003 23:14:31 -0000 1.1 --- DirectoryWriter.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 17,20 **** --- 17,22 ---- /** + * Writer implementation based on file-system directory. Each Archive will be output as a directory, and each Entry as a file. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 22,33 **** public class DirectoryWriter implements Writer { ! /** Description of the Field */ private Stack outDirs = new Stack(); /** ! *Constructor for the ArchiveWriter object * ! * @param basedir Description of the Parameter */ public DirectoryWriter(File basedir) --- 24,35 ---- public class DirectoryWriter implements Writer { ! /** Stacks of the current output directories */ private Stack outDirs = new Stack(); /** ! * Build the Writer on a directory. * ! * @param basedir The root directory */ public DirectoryWriter(File basedir) *************** *** 38,44 **** /** ! * Description of the Method * ! * @param archive Description of the Parameter */ public void visit(Archive archive) --- 40,46 ---- /** ! * Visit an archive. Each Archive will be output as a directory. * ! * @param archive The archive to visit */ public void visit(Archive archive) *************** *** 50,53 **** --- 52,56 ---- } + // For each archive, output its content for (Iterator iterator = archive.iterator(); iterator.hasNext(); ) { *************** *** 70,76 **** /** ! * Description of the Method * ! * @param entry Description of the Parameter */ public void visit(Entry entry) --- 73,79 ---- /** ! * Visit an entry. Each Entry will be output as a file. * ! * @param entry The entry to visit */ public void visit(Entry entry) *************** *** 83,86 **** --- 86,91 ---- throw new IllegalStateException("No initial uri"); } + + // Create the file and dump the content File file = new File(uri, entry.getURI()); file.getParentFile().mkdirs(); Index: FileReader.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io/FileReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileReader.java 15 Sep 2003 23:14:31 -0000 1.1 --- FileReader.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 13,16 **** --- 13,18 ---- /** + * Reader implementation based on a File. The file is transformed into a stream. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 19,25 **** { /** ! *Constructor for the FileMapper object * ! * @param file Description of the Parameter */ public FileReader(File file) --- 21,27 ---- { /** ! * Builds a FileReader on a File * ! * @param file The File to read */ public FileReader(File file) Index: FileWriter.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io/FileWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileWriter.java 15 Sep 2003 23:14:31 -0000 1.1 --- FileWriter.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 13,16 **** --- 13,18 ---- /** + * Writer implementation based on a File. The file is transformed into a stream. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 19,25 **** { /** ! *Constructor for the ArchiveWriter object * ! * @param file Description of the Parameter */ public FileWriter(File file) --- 21,27 ---- { /** ! * Builds a FileWriter on a File * ! * @param file The File to write */ public FileWriter(File file) Index: Reader.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io/Reader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Reader.java 15 Sep 2003 23:14:31 -0000 1.1 --- Reader.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 12,15 **** --- 12,17 ---- /** + * Interface that describe a Reader used to build Archive and Entry. Use the Visitor Pattern. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 18,24 **** { /** ! * Description of the Method * ! * @param archive Description of the Parameter */ public void visit(Archive archive); --- 20,26 ---- { /** ! * Visit an archive. * ! * @param archive The archive to visit */ public void visit(Archive archive); *************** *** 26,32 **** /** ! * Description of the Method * ! * @param entry Description of the Parameter */ public void visit(Entry entry); --- 28,34 ---- /** ! * Visit an entry. * ! * @param entry The entry to visit */ public void visit(Entry entry); Index: StreamReader.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io/StreamReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StreamReader.java 15 Sep 2003 23:14:31 -0000 1.1 --- StreamReader.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 21,24 **** --- 21,28 ---- /** + * Reader implementation based on stream. + * <p>Each Archive and each Entry will be created through a ZipInputStream. This classe serves as parent for derived ones.</p> + * <p>As the structure is dynamically created, the Visitor Pattern cannot be strictly followed.</p> + * * @author Laurent Etiemble * @version $Revision$ *************** *** 26,47 **** public abstract class StreamReader implements Reader { ! /** Description of the Field */ private Stack inStreams = new Stack(); /** ! * Description of the Method * ! * @param entry Description of the Parameter */ ! public void visit(Entry entry) ! { ! } /** ! * Description of the Method * ! * @param archive Description of the Parameter */ public void visit(Archive archive) --- 30,49 ---- public abstract class StreamReader implements Reader { ! /** Stacks of the current input streams */ private Stack inStreams = new Stack(); /** ! * Visit an entry. Do nothing. * ! * @param entry The entry to visit */ ! public void visit(Entry entry) { } /** ! * Visit an archive. Each Archive will be build from a ZipInputStream and populated with entries. * ! * @param archive The archive to visit */ public void visit(Archive archive) *************** *** 78,85 **** /** ! * Description of the Method * ! * @param uri Description of the Parameter ! * @return Description of the Return Value */ protected Entry createEntry(String uri) --- 80,87 ---- /** ! * Helper method to create an entry. * ! * @param uri The URI of the entry ! * @return The new Entry */ protected Entry createEntry(String uri) *************** *** 143,149 **** /** ! * Gets the stream attribute of the FileMapper object * ! * @return The stream value */ protected ZipInputStream getZipInputStream() --- 145,151 ---- /** ! * Returns the current stream * ! * @return The current stream */ protected ZipInputStream getZipInputStream() *************** *** 154,161 **** /** ! * Gets the stream attribute of the FileMapper object * ! * @return The stream value ! * @exception IOException Description of the Exception */ protected ZipInputStream popZipInputStream() --- 156,163 ---- /** ! * Pops the last entered stream * ! * @return The stream ! * @exception IOException If no stream is available */ protected ZipInputStream popZipInputStream() *************** *** 174,181 **** /** ! * Description of the Method * ! * @param stream Description of the Parameter ! * @exception IOException Description of the Exception */ protected void pushZipInputStream(ZipInputStream stream) --- 176,183 ---- /** ! * Pushes a stream onto the stack * ! * @param stream The stream ! * @exception IOException Shoud never occured */ protected void pushZipInputStream(ZipInputStream stream) Index: StreamWriter.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io/StreamWriter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StreamWriter.java 15 Sep 2003 23:14:31 -0000 1.1 --- StreamWriter.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 18,34 **** /** * @author Laurent Etiemble * @version $Revision$ */ ! public class StreamWriter implements Writer { ! /** Description of the Field */ private Stack outStreams = new Stack(); /** ! * Description of the Method * ! * @param archive Description of the Parameter */ public void visit(Archive archive) --- 18,36 ---- /** + * Writer implementation based on stream. Each Archive and each Entry will be output through a ZipOutputStream. This classe serves as parent for derived ones. + * * @author Laurent Etiemble * @version $Revision$ */ ! public abstract class StreamWriter implements Writer { ! /** Stacks of the current output streams */ private Stack outStreams = new Stack(); /** ! * Visit an archive. A new ZipOutputStream is created for each Archive. * ! * @param archive The archive to visit */ public void visit(Archive archive) *************** *** 42,45 **** --- 44,48 ---- } + // For each archive, output its content for (Iterator iterator = archive.iterator(); iterator.hasNext(); ) { *************** *** 74,80 **** /** ! * Description of the Method * ! * @param entry Description of the Parameter */ public void visit(Entry entry) --- 77,83 ---- /** ! * Visit an entry. * ! * @param entry The entry to visit */ public void visit(Entry entry) *************** *** 82,85 **** --- 85,89 ---- try { + // Gets the current stream and dump the content ZipOutputStream stream = this.getZipOutputStream(); if (stream == null) *************** *** 99,105 **** /** ! * Gets the stream attribute of the FileMapper object * ! * @return The stream value */ protected ZipOutputStream getZipOutputStream() --- 103,109 ---- /** ! * Returns the current stream * ! * @return The current stream */ protected ZipOutputStream getZipOutputStream() *************** *** 110,117 **** /** ! * Gets the stream attribute of the FileMapper object * ! * @return The stream value ! * @exception IOException Description of the Exception */ protected ZipOutputStream popZipOutputStream() --- 114,121 ---- /** ! * Pops the last entered stream * ! * @return The stream ! * @exception IOException If no stream is available */ protected ZipOutputStream popZipOutputStream() *************** *** 130,137 **** /** ! * Description of the Method * ! * @param stream Description of the Parameter ! * @exception IOException Description of the Exception */ protected void pushZipOutputStream(ZipOutputStream stream) --- 134,141 ---- /** ! * Pushes a stream onto the stack * ! * @param stream The stream ! * @exception IOException Shoud never occured */ protected void pushZipOutputStream(ZipOutputStream stream) Index: Writer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/common/src/main/org/ejtools/archive/io/Writer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Writer.java 15 Sep 2003 23:14:31 -0000 1.1 --- Writer.java 13 Dec 2003 21:27:49 -0000 1.2 *************** *** 12,15 **** --- 12,17 ---- /** + * Interface that describe a Writer used to dump the Archive and Entry. Use the Visitor Pattern. + * * @author Laurent Etiemble * @version $Revision$ *************** *** 18,24 **** { /** ! * Description of the Method * ! * @param archive Description of the Parameter */ public void visit(Archive archive); --- 20,26 ---- { /** ! * Visit an archive. * ! * @param archive The archive to visit */ public void visit(Archive archive); *************** *** 26,32 **** /** ! * Description of the Method * ! * @param entry Description of the Parameter */ public void visit(Entry entry); --- 28,34 ---- /** ! * Visit an entry. * ! * @param entry The entry to visit */ public void visit(Entry entry); |