Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1459 - in development/laboratory/planet/components/transitionmachine: . basic/src/main/net/dpml/transitionmachine/basic demo/trafficlight demo/trafficlight/src/main/net/dpml/transitionmachine/trafficlight

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: niclas AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1459 - in development/laboratory/planet/components/transitionmachine: . basic/src/main/net/dpml/transitionmachine/basic demo/trafficlight demo/trafficlight/src/main/net/dpml/transitionmachine/trafficlight
  • Date: Tue, 11 Jan 2005 06:13:25 +0100

Author: niclas
Date: Tue Jan 11 06:13:25 2005
New Revision: 1459

Modified:

development/laboratory/planet/components/transitionmachine/basic/src/main/net/dpml/transitionmachine/basic/CommandRule.java

development/laboratory/planet/components/transitionmachine/demo/trafficlight/build.xml

development/laboratory/planet/components/transitionmachine/demo/trafficlight/src/main/net/dpml/transitionmachine/trafficlight/TrafficLight.java
development/laboratory/planet/components/transitionmachine/index.xml
Log:
Fixing up some more details, and trying to get this running.

Modified:
development/laboratory/planet/components/transitionmachine/basic/src/main/net/dpml/transitionmachine/basic/CommandRule.java
==============================================================================
---
development/laboratory/planet/components/transitionmachine/basic/src/main/net/dpml/transitionmachine/basic/CommandRule.java
(original)
+++
development/laboratory/planet/components/transitionmachine/basic/src/main/net/dpml/transitionmachine/basic/CommandRule.java
Tue Jan 11 06:13:25 2005
@@ -43,18 +43,18 @@
public CommandRule( Parameters params )
throws ParameterException
{
- this( params.getParameter( "command" ),
- params.getParameterAsInteger( "priority", 100 ),
- params.getParameterAsBoolean( "ignore-case", false ));
+ m_command = params.getParameter( "command" );
+ m_priority = params.getParameterAsInteger( "priority", 100 );
+ m_ignoreCase = params.getParameterAsBoolean( "ignore-case", false );
}
-
+/* Metro doesn't allow multiple constructors...
public CommandRule( String command, int priority, boolean ignorecase )
{
m_command = command;
m_priority = priority;
m_ignoreCase = ignorecase;
}
-
+*/
/**
* Returns whether the command string corresponds to this transition
rule.
*

Modified:
development/laboratory/planet/components/transitionmachine/demo/trafficlight/build.xml
==============================================================================
---
development/laboratory/planet/components/transitionmachine/demo/trafficlight/build.xml
(original)
+++
development/laboratory/planet/components/transitionmachine/demo/trafficlight/build.xml
Tue Jan 11 06:13:25 2005
@@ -1,12 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>

-<project name="dpml-trafficlight" default="install" basedir="."
- xmlns:magic="antlib:net.dpml.magic">
+<project
+ name="dpml-trafficlight"
+ default="install"
+ basedir="."
+ xmlns:magic="antlib:net.dpml.magic"
+ xmlns:x="plugin:dpml/magic/dpml-magic-core"
+ >

<magic:import uri="artifact:template:dpml/magic/standard"/>

<target name="build" depends="standard.build" >
<x:block name="trafficlight" >
+
+ <x:component name="runner"
class="net.dpml.transitionmachine.trafficlight.demo.TrafficLight" />
+
<x:component name="machine"
class="net.dpml.transitionmachine.basic.TransitionMachineImpl" >
<x:dependencies>
<x:dependency key="red-to-green" source="transition-red-to-green"
/>
@@ -85,7 +93,7 @@

<x:component name="transition-green-to-greenyellow"
class="net.dpml.transitionmachine.basic.TransitionImpl" >
<x:dependencies>
- <x:dependency key="begin" source="state-gree" />
+ <x:dependency key="begin" source="state-green" />
<x:dependency key="end" source="state-greenyellow" />
</x:dependencies>
</x:component>

Modified:
development/laboratory/planet/components/transitionmachine/demo/trafficlight/src/main/net/dpml/transitionmachine/trafficlight/TrafficLight.java
==============================================================================
---
development/laboratory/planet/components/transitionmachine/demo/trafficlight/src/main/net/dpml/transitionmachine/trafficlight/TrafficLight.java
(original)
+++
development/laboratory/planet/components/transitionmachine/demo/trafficlight/src/main/net/dpml/transitionmachine/trafficlight/TrafficLight.java
Tue Jan 11 06:13:25 2005
@@ -57,6 +57,7 @@
private Thread m_thread;
private boolean m_run;
private State m_red;
+ private boolean m_type;

/**
* @param man ServiceManager servicing this Part.
@@ -74,6 +75,7 @@
public TrafficLight( ServiceManager man, Parameters params )
throws ServiceException
{
+ System.out.println( "Creating Trafficlight." );
m_transitionMachine = (TransitionMachine) man.lookup( "tm" );

m_internationalTransitions = new ArrayList();
@@ -104,15 +106,29 @@
// Constructor required by Serialization.
}

+ public boolean getType()
+ {
+ return m_type;
+ }
+
+ public void setType( boolean type )
+ {
+ m_transitionMachine.stop();
+ m_type = type;
+ if( type )
+ international();
+ else
+ swedish();
+ m_transitionMachine.start();
+ }
+
/**
* Sets international sequencing system.
*/
public void international()
{
- m_transitionMachine.stop();
m_transitionMachine.removeAllTransitions();
m_transitionMachine.addTransitions( m_internationalTransitions );
- m_transitionMachine.start();
}

/**
@@ -120,20 +136,20 @@
*/
public void swedish()
{
- m_transitionMachine.stop();
m_transitionMachine.removeAllTransitions();
m_transitionMachine.addTransitions( m_swedishTransitions );
- m_transitionMachine.start();
}

public void start()
{
+ System.out.println( "Starting Trafficlight." );
m_thread = new Thread( this );
m_thread.start();
}

public void stop()
{
+ System.out.println( "Stopping Trafficlight." );
m_run = false;
m_thread.interrupt();
}

Modified: development/laboratory/planet/components/transitionmachine/index.xml
==============================================================================
--- development/laboratory/planet/components/transitionmachine/index.xml
(original)
+++ development/laboratory/planet/components/transitionmachine/index.xml
Tue Jan 11 06:13:25 2005
@@ -24,7 +24,7 @@

<project file="module.xml">
<info>
- <group>dpml/planet/transitionmachine</group>
+ <group>dpml/transitionmachine</group>
<name>dpml-transitionmachine</name>
<version>1.0.0</version>
<status>SNAPSHOT</status>
@@ -41,18 +41,21 @@

<project basedir="api">
<info>
- <group>dpml/planet/transitionmachine</group>
+ <group>dpml/transitionmachine</group>
<name>dpml-transitionmachine-api</name>
<version>1.0.0</version>
<status>SNAPSHOT</status>
</info>
<dependencies>
</dependencies>
+ <plugins>
+ <include key="dpml-meta-tools"/>
+ </plugins>
</project>

<project basedir="basic">
<info>
- <group>dpml/planet/transitionmachine</group>
+ <group>dpml/transitionmachine</group>
<name>dpml-transitionmachine-basic</name>
<version>1.0.0</version>
<status>SNAPSHOT</status>
@@ -63,11 +66,14 @@
<include key="dpml-service-api" />
<include key="dpml-transitionmachine-api" />
</dependencies>
+ <plugins>
+ <include key="dpml-meta-tools"/>
+ </plugins>
</project>

<project basedir="demo/trafficlight">
<info>
- <group>dpml/planet/transitionmachine/demo</group>
+ <group>dpml/transitionmachine/demo</group>
<name>dpml-trafficlight</name>
<version>1.0.0</version>
<status>SNAPSHOT</status>
@@ -75,6 +81,9 @@
<dependencies>
<include key="dpml-transitionmachine-basic" />
</dependencies>
+ <plugins>
+ <include key="dpml-meta-tools"/>
+ </plugins>
</project>

</index>



  • svn commit: r1459 - in development/laboratory/planet/components/transitionmachine: . basic/src/main/net/dpml/transitionmachine/basic demo/trafficlight demo/trafficlight/src/main/net/dpml/transitionmachine/trafficlight, niclas, 01/11/2005

Archive powered by MHonArc 2.6.24.

Top of Page