OW2 Consortium mobe

Compare Revisions

Ignore whitespace Rev 2 → Rev 3

/trunk/mobe/.classpath
New file
0,0 → 1,11
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="C:/Projecten/MOBEDesigner/lib/xstream-1.0.2.jar"/>
<classpathentry kind="lib" path="C:/Projecten/MOBEDesigner/lib/xml-apis.jar"/>
<classpathentry kind="lib" path="C:/Projecten/MOBEDesigner/lib/xmlParserAPIs.jar"/>
<classpathentry kind="lib" path="C:/Projecten/MOBEDesigner/lib/xpp3_min-1.1.3.4.I.jar"/>
<classpathentry kind="lib" path="C:/Projecten/MOBEDesigner/lib/xercesImpl.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
/trunk/mobe/JHotDraw.txt
New file
0,0 → 1,3
JHotDraw is copyright 1996, 1997 by IFA Informatik and Erich Gamma.
 
It is hereby granted that this software can be used, copied, modified, anddistributed without fee provided that this copyright noticeappears in all copies.
/trunk/mobe/LICENSE.txt
New file
0,0 → 1,16
MOBE 1.3B AND MOBE Desinger 0.2B LICENSE
==============================================================================
 
MOBE 1.3B and MOBE Designer 0.2B are distributed under the Gnu General Public License, see the
LICENSE.GPL file for the full text.
 
In addition to the terms and conditions defined in the GPL, eMAXX grants you
the right to write new classes, templates, modules, widgets and installation
scripts, which are extensions on existing MOBE and MOBE Designer files and distribute these
under any license you choose, as long as these files are distributed
seperately from MOBE and MOBE Designer itself.
 
17 december 2004
Michel Veenhuis ( michel@emaxx.nl )
 
eMAXX
/trunk/mobe/xsds/business-process.xsd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/xsds/wsdl.xsd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/LICENSE.GPL
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/.project
New file
0,0 → 1,17
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MOBEDesigner</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
/trunk/mobe/MOBEDesigner.zip
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/lib/xstream-1.0.2.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/lib/xpp3_min-1.1.3.4.I.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/lib/xml-apis.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/lib/xmlParserAPIs.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/lib/xercesImpl.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/WHILE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/OTHERWISE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/WHILE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/OTHERWISE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/OTHERWISE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RRECT1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RRECT2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RRECT3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ASSIGN1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ASSIGN2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ASSIGN3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/REPLY1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/INVOKE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/REPLY2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/INVOKE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/INVOKE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CONN1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/REPLY3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CONN2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CONN3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/THROW1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/THROW2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/THROW3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/PERT1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/PERT2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/PERT3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/pspbrwse.jbf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ERASER1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CATCH1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ERASER2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SEL1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CATCH2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ERASER3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TEXT1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SEL2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CATCH3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TEXT2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SEL3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ATEXT1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TEXT3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ATEXT2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/PICK1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ATEXT3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/LINE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/PICK2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/LINE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/PICK3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/LINE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ONALARM1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TEMPLATE.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ONALARM2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TOFRONT1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ONALARM3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TOFRONT2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/HIERUP1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TOFRONT3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ELLIPSE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/HIERUP2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ELLIPSE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/HIERUP3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ELLIPSE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/URL1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/BORDDEC1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/BORDDEC2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/URL2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/BORDDEC3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/URL3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TRIANGLE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TRIANGLE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TRIANGLE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SEQUENCE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SCOPE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SEQUENCE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SCOPE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SEQUENCE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SCOPE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SCRIBBL1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SCRIBBL2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RECEIVE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SCRIBBL3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RECEIVE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RECEIVE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TEMPLAT_.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RECT1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/COMPENSATE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RECT2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/COMPENSATE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/RECT3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/COMPENSATE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TOBACK1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TOBACK2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/WAIT1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TOBACK3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/WAIT2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/WAIT3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/FLOW1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/FLOW2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/FLOW3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CASE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/DIAMOND1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/OCONN1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CASE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/DIAMOND2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/OCONN2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/CASE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/DIAMOND3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/OCONN3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ONMESSAGE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ONMESSAGE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/ONMESSAGE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/POLYGON1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/POLYGON2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TERMINATE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/POLYGON3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TERMINATE2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/TERMINATE3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/EMPTY1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/EMPTY2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/EMPTY3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SWITCH1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SWITCH2.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/SWITCH3.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/images/WHILE1.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/trunk/mobe/src/org/emaxx/bpeldesigner/AdvancedDrawApplication.java
New file
0,0 → 1,514
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner;
 
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.print.Book;
import java.awt.print.PageFormat;
import java.awt.print.PrinterException;
import java.awt.print.PrinterJob;
 
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JToolBar;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.AdvancedStandardDrawingView;
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedBringToFrontCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedCopyCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedCutCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedDeleteCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedDuplicateCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedPasteCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedRedoCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedSelectionTool;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedSendToBackCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedToggleGridCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedUndoCommand;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
import org.emaxx.bpeldesigner.bpel.util.adv.ComponentToPrint;
import org.emaxx.bpeldesigner.bpel.util.adv.XMLSerializationStorageFormat;
 
import CH.ifa.draw.application.DrawApplication;
import CH.ifa.draw.contrib.MDI_DrawApplication;
import CH.ifa.draw.contrib.MDI_InternalFrame;
import CH.ifa.draw.contrib.PolygonTool;
import CH.ifa.draw.figures.BorderTool;
import CH.ifa.draw.figures.ConnectedTextTool;
import CH.ifa.draw.figures.ElbowConnection;
import CH.ifa.draw.figures.EllipseFigure;
import CH.ifa.draw.figures.LineConnection;
import CH.ifa.draw.figures.LineFigure;
import CH.ifa.draw.figures.RectangleFigure;
import CH.ifa.draw.figures.RoundRectangleFigure;
import CH.ifa.draw.figures.ScribbleTool;
import CH.ifa.draw.figures.TextFigure;
import CH.ifa.draw.figures.TextTool;
import CH.ifa.draw.framework.Drawing;
import CH.ifa.draw.framework.DrawingEditor;
import CH.ifa.draw.framework.DrawingView;
import CH.ifa.draw.framework.Tool;
import CH.ifa.draw.standard.ConnectionTool;
import CH.ifa.draw.standard.CreationTool;
import CH.ifa.draw.standard.StandardDrawingView;
import CH.ifa.draw.standard.ToolButton;
import CH.ifa.draw.util.CommandMenu;
import CH.ifa.draw.util.Iconkit;
import CH.ifa.draw.util.StorageFormat;
import CH.ifa.draw.util.StorageFormatManager;
 
/**
* AdvancedDrawApplication is an implementation of a MDI_DrawApplication which
* shows the multiple views in a JTabbedPane
*/
public class AdvancedDrawApplication extends MDI_DrawApplication implements ChangeListener {
 
/*
* Internal fields.
*/
private JTabbedPane m_TabbedPane = new JTabbedPane(JTabbedPane.BOTTOM);
 
/**
* Starts the AdvancedDrawApplication
*
* @param args
*/
public static void main(String[] args) {
AdvancedDrawApplication window = new AdvancedDrawApplication();
 
window.open();
window.setVisible(true);
}
 
/**
* Constructs a drawing window with a default title.
*/
public AdvancedDrawApplication() {
this("AdvancedDrawApplication");
}
 
/**
* Constructs a drawing window with the given <code>title</code>.
*
* @param title The title of the application
*/
public AdvancedDrawApplication(String title) {
super(title);
 
AdvancedCommand.setDrawApp(this);
setDesktop(new JTabbedPane(JTabbedPane.BOTTOM));
getDesktop().setAlignmentX(LEFT_ALIGNMENT);
((JTabbedPane) getDesktop()).addChangeListener(this);
}
 
/**
* Prints the drawing.
*/
public void print() {
tool().deactivate();
//PrintJob l_PrintJob = getToolkit().getPrintJob(this, "Print Drawing", null);
Graphics g = this.getGraphics();
// Get a PrinterJob
PrinterJob job = PrinterJob.getPrinterJob();
// Ask user for page format (e.g., portrait/landscape)
PageFormat pf = job.pageDialog(job.defaultPage());
//job.defaultPage().
Book l_Book = new Book();
double l_height = pf.getImageableHeight();
double l_width = pf.getImageableWidth();
int totalwidth = this.view().getSize().width;
int totalheight = this.view().getSize().height;
int horizontalpages = (int) (totalwidth / l_width) + 1;
int verticalpages = (int) (totalheight / l_height) + 1;
l_Book.append(new ComponentToPrint(this.view()), pf, horizontalpages * verticalpages);
job.setPageable(l_Book);
job.printDialog();
if (!job.isCancelled()) {
try {
job.print();
} catch (PrinterException e) {
showStatus("Troubles with printing");
}
}
tool().activate();
}
 
/**
* Opens the window and initializes its contents.
*/
public void open() {
fIconkit = new Iconkit(this);
getContentPane().setLayout(new BorderLayout());
fView = createDrawingView();
 
JComponent contents = createContents((StandardDrawingView) view());
contents.setAlignmentX(LEFT_ALIGNMENT);
 
JToolBar tools = createToolPalette();
createTools(tools);
 
JPanel activePanel = new JPanel();
activePanel.setAlignmentX(LEFT_ALIGNMENT);
activePanel.setAlignmentY(TOP_ALIGNMENT);
activePanel.setLayout(new BorderLayout());
activePanel.add(tools, BorderLayout.NORTH);
activePanel.add(getTabbedPane(), BorderLayout.WEST);
activePanel.add(contents, BorderLayout.CENTER);
 
JPanel fullPanel = new JPanel();
fullPanel.setLayout(new BoxLayout(fullPanel, BoxLayout.X_AXIS));
fullPanel.add(activePanel, BorderLayout.CENTER);
 
fStatusLine = createStatusLine();
 
getContentPane().add(fullPanel, BorderLayout.CENTER);
getContentPane().add(fStatusLine, BorderLayout.SOUTH);
 
JMenuBar mb = new JMenuBar();
createMenus(mb);
setJMenuBar(mb);
 
initDrawing();
Dimension d = defaultSize();
if (d.width > mb.getPreferredSize().width) {
setSize(d.width, d.height);
} else {
setSize(mb.getPreferredSize().width, d.height);
}
addListeners();
setStorageFormatManager(createStorageFormatManager());
}
 
/**
* Factory method to create a StorageFormatManager for supported storage formats.
* Different applications might want to use different storage formats and can return
* their own format manager by overriding this method.
*/
public StorageFormatManager createStorageFormatManager() {
StorageFormatManager storageFormatManager = new StorageFormatManager();
StorageFormat l_XMLSerializationStorageFormat = new XMLSerializationStorageFormat();
storageFormatManager.addStorageFormat(l_XMLSerializationStorageFormat);
storageFormatManager.setDefaultStorageFormat(l_XMLSerializationStorageFormat);
return storageFormatManager;
}
 
/**
* Returns the TabbedPane normally at the left of the application, tabs can be added to this
* @return the TabbedPane on the left side
*/
public JTabbedPane getTabbedPane() {
return m_TabbedPane;
}
 
/**
* Sets the TabbedPane normally at the left of the application
* @param a_TabbedPane the TabbedPane on the left side
*/
public void getTabbedPane(JTabbedPane a_TabbedPane) {
m_TabbedPane = a_TabbedPane;
}
 
public StorageFormatManager getStorageFormatManager() {
return fStorageFormatManager;
}
 
public void setStorageFormatManager(StorageFormatManager a_StorageFormatManager) {
fStorageFormatManager = a_StorageFormatManager;
}
 
/**
* Gets the default size of the window.
*/
protected Dimension defaultSize() {
return new Dimension(800, 600);
}
 
/**
* Override to define the dimensions of the drawing view.
*/
protected Dimension getDrawingViewSize() {
return new Dimension(500, 500);
}
 
/**
* Factory method which can be overriden by subclasses to create an instance of their type.
*
* @return newly created application
*/
protected DrawApplication createApplication() {
return new AdvancedDrawApplication();
}
 
/**
* Factory method which creates an internal frame. Subclasses may override this method to
* provide their own implementations of MDI_InternalFrame
*/
protected MDI_InternalFrame createInternalFrame() {
return new MDI_InternalFrame("untitled", false, true, false, false);
}
 
/**
* Resets the drawing to a new empty drawing. Opens a new internal frame.
*/
public void promptNew() {
newWindow();
}
 
/**
* Set the title for the drawing. The title also appears in the internal frame title bar. A name
* is assigned when a drawing saved or a saved drawing is loaded. The file name is the drawing
* title. If the drawing has not been saved before then the drawing title is "untitled". The
* name will be put on a tab as well
*/
protected void setDrawingTitle(String newDrawingTitle) {
super.setDrawingTitle(newDrawingTitle);
JTabbedPane l_Tab = (JTabbedPane) getDesktop();
for (int i = 0; i < l_Tab.getComponentCount(); i++) {
String l_Title = ((MDI_InternalFrame) l_Tab.getComponent(i)).getTitle();
((JTabbedPane) getDesktop()).setTitleAt(i, l_Title);
}
}
 
/**
* Returns whether there are any internal frames
*/
public boolean hasInternalFrames() {
return ((JTabbedPane) getDesktop()).getTabCount() > 0;
}
 
/**
* Handles a ChangeEvent from the JTabbedPane, this method can be overridden
*/
public void stateChanged(ChangeEvent e) {
int l_Index = ((JTabbedPane) getDesktop()).getSelectedIndex();
if (!(l_Index < 0)) {
Component l_Component = ((JTabbedPane) getDesktop()).getComponentAt(l_Index);
((JTabbedPane) getDesktop()).setTitleAt(l_Index,
((MDI_InternalFrame) l_Component).getTitle());
activateFrame((MDI_InternalFrame) l_Component);
}
}
 
/**
* Creates the contents component of the application
* frame. By default the DrawingView is returned in
* a JScrollPane. Sets the TabbedPane to the right tab
*/
protected JComponent createContents(StandardDrawingView view) {
JComponent l_JComponent = super.createContents(view);
JTabbedPane l_Tab = (JTabbedPane) getDesktop();
for (int i = 0; i < l_Tab.getComponentCount(); i++) {
if (l_JComponent.equals((MDI_InternalFrame) l_Tab.getComponent(i))) {
((JTabbedPane) getDesktop()).setSelectedIndex(i);
}
}
return l_JComponent;
}
 
/**
* Activate an internal frame upon which the selected tools operate.
* The currently activated DrawgingView is backed up for later restorage.
* Updates the TabbedPane titles
*/
public void activateFrame(MDI_InternalFrame newFrame) {
super.activateFrame(newFrame);
JTabbedPane l_Tab = (JTabbedPane) getDesktop();
for (int i = 0; i < l_Tab.getComponentCount(); i++) {
if (newFrame.equals((MDI_InternalFrame) l_Tab.getComponent(i))) {
((JTabbedPane) getDesktop()).setSelectedIndex(i);
}
}
}
 
/**
* Creates the tools.
* Override this method to add additional tools.
* Call the inherited method to include the selection tool.
* @param palette the palette where the tools are added.
*/
protected void createTools(JToolBar palette) {
Tool tool = createSelectionTool();
fDefaultToolButton = createToolButton(IMAGES + "SEL", "Selection Tool", tool);
palette.add(fDefaultToolButton);
 
tool = new TextTool(view(), new TextFigure());
palette.add(createToolButton(IMAGES + "TEXT", "Text Tool", tool));
 
tool = new ConnectedTextTool(view(), new TextFigure());
palette.add(createToolButton(IMAGES + "ATEXT", "Connected Text Tool", tool));
 
tool = new CreationTool(view(), new RectangleFigure());
palette.add(createToolButton(IMAGES + "RECT", "Rectangle Tool", tool));
 
tool = new CreationTool(view(), new RoundRectangleFigure(view()));
palette.add(createToolButton(IMAGES + "RRECT", "Round Rectangle Tool", tool));
 
tool = new CreationTool(view(), new EllipseFigure());
palette.add(createToolButton(IMAGES + "ELLIPSE", "Ellipse Tool", tool));
 
tool = new CreationTool(view(), new LineFigure());
palette.add(createToolButton(IMAGES + "LINE", "Line Tool", tool));
 
tool = new ConnectionTool(view(), new LineConnection());
palette.add(createToolButton(IMAGES + "CONN", "Connection Tool", tool));
 
tool = new ConnectionTool(view(), new ElbowConnection());
palette.add(createToolButton(IMAGES + "OCONN", "Elbow Connection Tool", tool));
 
tool = new ScribbleTool(view());
palette.add(createToolButton(IMAGES + "SCRIBBL", "Scribble Tool", tool));
 
tool = new PolygonTool(view());
palette.add(createToolButton(IMAGES + "POLYGON", "Polygon Tool", tool));
 
tool = new BorderTool(view());
palette.add(createToolButton(IMAGES + "BORDDEC", "Border Tool", tool));
}
 
/**
* returns a window menu
*/
protected JMenu createWindowMenu() {
JMenu menu = new JMenu("Window");
JMenuItem mi = new JMenuItem("New View");
mi.addActionListener(new ActionListener() {
 
public void actionPerformed(ActionEvent event) {
newView();
}
});
menu.add(mi);
mi = new JMenuItem("New Window");
mi.addActionListener(new ActionListener() {
 
public void actionPerformed(ActionEvent event) {
newWindow();
}
});
menu.add(mi);
return menu;
}
 
/**
* Creates the BPEL menus.
*/
public void createMenus(JMenuBar mb) {
mb.add(createFileMenu());
mb.add(createEditMenu());
mb.add(createAttributesMenu());
mb.add(createLookAndFeelMenu());
new UndoManage(mb);
mb.add(createWindowMenu());
}
 
/**
* Handles a change of the current selection. Updates all
* menu items that are selection sensitive.
* @see DrawingEditor
*/
public void selectionChanged(DrawingView view) {
JMenuBar mb = getJMenuBar();
CommandMenu editMenu = (CommandMenu) mb.getMenu(EDIT_MENU);
editMenu.checkEnabled();
}
 
/**
* Creates the edit menu. Clients override this
* method to add additional menu items.
*/
protected JMenu createEditMenu() {
CommandMenu menu = new CommandMenu("Edit");
AdvancedStandardDrawing l_Drawing = (AdvancedStandardDrawing) drawing();
menu.add(new AdvancedCutCommand("Cut (Ctrl+X)"));
menu.add(new AdvancedCopyCommand("Copy (Ctrl+C)"));
menu.add(new AdvancedPasteCommand("Paste (Ctrl+V)"));
menu.addSeparator();
menu.add(new AdvancedDuplicateCommand("Duplicate (Ctrl+D)"));
menu.add(new AdvancedDeleteCommand("Delete (Del)"));
menu.addSeparator();
menu.add(new AdvancedSendToBackCommand("Send to Back"));
menu.add(new AdvancedBringToFrontCommand("Bring to Front"));
menu.addSeparator();
menu.add(new AdvancedToggleGridCommand("ToggleGrid Off", null));
menu.add(new AdvancedToggleGridCommand("ToggleGrid Small", new Point(10, 10)));
menu.add(new AdvancedToggleGridCommand("ToggleGrid Large", new Point(40, 40)));
menu.addSeparator();
menu.add(new AdvancedUndoCommand("Undo (Ctrl+Z)"));
menu.add(new AdvancedRedoCommand("Redo (Ctrl+Y)"));
return menu;
}
 
/**
* Creates the drawing view used in this application.
* You need to override this method to use a DrawingView
* subclass in your application. A AdvancedStandardDrawingView is returned
* @return a AdvancedStandardDrawingView
*/
protected StandardDrawingView createDrawingView() {
Dimension d = getDrawingViewSize();
return new AdvancedStandardDrawingView(this, d.width, d.height);
}
 
/**
* Creates the drawing used in this application.
* You need to override this method to use a Drawing
* subclass in your application. A AdvancedStandardDrawing is returned.
* @return a AdvancedStandardDrawing
*/
protected Drawing createDrawing() {
return new AdvancedStandardDrawing();
}
 
/**
* Create a ToolButton with a specified Dimension
* @param iconName name icon
* @param toolName name tool
* @param tool the tool
* @param d the specified Dimension
* @return
*/
public ToolButton createCustomToolButton(String iconName, String toolName, Tool tool,
Dimension d) {
return new ToolButton(this, iconName, toolName, tool, d);
}
 
/**
* Returns an AdvancedSelectionTool
* @return an AdvancedSelectionTool
*/
protected Tool createSelectionTool() {
return new AdvancedSelectionTool(view());
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/dom/FileEntityResolver.java
New file
0,0 → 1,109
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.dom;
 
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
 
/**
* The FileEntityResolver class resolves XML entities using the files stored in the folder passed to
* the constructor.
* <br><br>
* Copyright (c) 2004, eMAXX B.V.
*
* @author A.K. Boerma [AKB]
* @version $Revision: 1.1 $ $Date: 2005-01-17 12:01:01 $
*/
public class FileEntityResolver implements EntityResolver {
 
/*
* Internal fields.
*/
private transient File folder = null;
 
/**
* Constructs a FileEntityResolver with the specified <code>folder</code>. The contents of that
* folder are used to resolve requested entities.
*
* @param folder The folder to use for resolving entities.
*/
public FileEntityResolver(String folder) throws IllegalArgumentException {
File file = new File(folder);
if (file.isDirectory()) {
this.folder = file;
} else {
throw new IllegalArgumentException("Specified folder is not a folder.");
}
}
 
/**
* Returns the folder of the FileEntityResolver.
*
* @return The folder.
*/
public String getFolder() {
return folder.getName();
}
 
/**
* Sets the <code>folder</code> of the FileEntityResolver.
*
* @param folder The new folder.
*/
public void setFolder(String folder) throws IllegalArgumentException {
File file = new File(folder);
 
if (file.isDirectory()) {
this.folder = file;
} else {
throw new IllegalArgumentException("Specified folder is not a folder.");
}
}
 
/**
* Resolves the specified external entity.
*
* @param publicId The public identifier of the external entity being referenced, or
* null if none was supplied.
* @param systemId The system identifier of the external entity being referenced.
* @throws SAXException If a parse error occur.
* @throws IOException If an I/O error occurs.
*/
public InputSource resolveEntity(String publicId, String systemId) throws SAXException,
IOException {
 
try {
Matcher matcher = Pattern.compile("(.*)/([^/].*[^/])(/?)").matcher(systemId);
String fileName = (matcher.find()) ? folder + "/" + matcher.group(2) : null;
fileName = fileName + ".xsd";
return new InputSource(new FileReader(fileName));
} catch (Exception e) {
throw new IOException("Unable to access schema definition " + systemId);
}
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/CustomTableModel.java
New file
0,0 → 1,151
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import java.util.Vector;
 
import javax.swing.table.AbstractTableModel;
 
/**
* This class defines the behaviour of a Table
*/
public class CustomTableModel extends AbstractTableModel {
 
private Vector columnNames = new Vector();
private Vector data = new Vector();
 
/**
* returns the number of columns
*/
public int getColumnCount() {
return columnNames.size();
}
 
/**
* returns the number of rows in the table
*/
public int getRowCount() {
return data.size();
}
 
/**
* returns the columnname of the specified columnnumber
* @param col the columnnumber
*/
public String getColumnName(int col) {
return (String) columnNames.get(col);
}
 
/**
* gets the value at a specified cell
* @param row the row the cell is in
* @param col the column the cell is in
*/
public Object getValueAt(int row, int col) {
if (data.get(row) != null) {
return ((Vector) data.get(row)).get(col);
} else {
return null;
}
}
 
/**
* JTable uses this method to determine the default renderer/
* editor for each cell. If we didn't implement this method,
* then the last column would contain text ("true"/"false"),
* rather than a check box.
*/
public Class getColumnClass(int c) {
return getValueAt(0, c).getClass();
}
 
/**
* Returns that a cell is never editable
*/
public boolean isCellEditable(int row, int col) {
return false;
}
 
/**
* Sets the value in a specified box and updates the table
* @param value The value that needs to be set
* @param row the row that the box is in
* @param col the column that the box is in
*/
public void setValueAt(Object value, int row, int col) {
if (data.get(row) != null) {
((Vector) data.get(row)).set(col, value);
}
fireTableCellUpdated(row, col);
}
 
/**
* Add an extra column(name) and update the table
* @param a_ColumnName the columnname to be added
*/
public void addColumnName(String a_ColumnName) {
columnNames.add(a_ColumnName);
fireTableStructureChanged();
}
 
/**
* Add an extra row and update the table
* @param a_Row the row to be added
*/
public void addRow(Vector a_Row) {
if (a_Row != null) {
if (a_Row.size() == columnNames.size()) {
data.add(a_Row);
}
}
fireTableRowsInserted(data.size(), data.size());
}
 
/**
* Remove a row and update the table
* @param a_Row the row to be removed
*/
public void removeRow(Vector a_Row) {
if (data.contains(a_Row)) {
int l_Position = data.indexOf(a_Row);
data.remove(a_Row);
fireTableRowsDeleted(l_Position, l_Position);
}
}
 
/**
* Remove a row and update the table
* @param a_RowNr the rownumber to be removed
*/
public void removeRow(int a_RowNr) {
data.remove(a_RowNr);
fireTableRowsDeleted(a_RowNr, a_RowNr);
}
 
/**
* Remove all rows in the table
*/
public void removeAll() {
int l_Size = data.size();
data.removeAllElements();
fireTableRowsDeleted(0, l_Size);
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/EditPanelHolder.java
New file
0,0 → 1,69
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
/**
* This interface should be implemented by Objects whose attributes can be edited
*/
public interface EditPanelHolder {
 
/**
* Returns a String with an errormessage when the editpanel isn't conform the demands
* Should return null when there are no errors
* @return a String with an errormessage when the editpanel isn't conform the demands
* Should return null when there are no errors
*/
public String checkEditPanel();
 
/**
* After getting the CustomTable it receives as parameter, it returns an addpanel
* @param a_CustomTable the table in which the object should be put when added
* @return an addpanel
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable);
 
/**
* Saves the EditPanel, uses the parameter a_Clone to update the original
* @param a_Clone a Clone of the original which has been edited
*/
public void saveEditPanel(Object a_Clone);
 
/**
* Gets the selected EditPanel, uses the parameter a_CustomTable
* @param a_CustomTable the CustomTable in which this EditPanelholder resides
* @return the selected EditPanel
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable);
 
/**
* Gets the ShowEditPanel, uses the parameter a_ShowPanel
* @param a_ShowPanel the ShowPanel in which the edit can be viewed
* @return the ShowEditPanel
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel);
 
/**
* Gets the ShowPanel, this is used for showing an element in a tab (which isnt a list)
* @return the ShowPanel
*/
public ShowPanel getShowPanel();
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/DurationExprPanel.java
New file
0,0 → 1,66
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.DurationExpr;
 
/**
* This class is a JPanel for the DurationExpr attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information.
*/
public class DurationExprPanel extends DoublePanel {
 
JTextField m_DurationExpr = new JTextField(15);
JLabel m_Title = new JLabel();
 
public DurationExprPanel(String a_Title, boolean a_Editable) {
m_DurationExpr.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_DurationExpr);
}
 
public DurationExprPanel(DurationExpr a_DurationExpr, String a_Title, boolean a_Editable) {
setDurationExpr(a_DurationExpr);
m_DurationExpr.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_DurationExpr);
}
 
public DurationExpr getDurationExpr() {
return new DurationExpr(m_DurationExpr.getText());
}
 
public void setDurationExpr(DurationExpr a_DurationExpr) {
if (a_DurationExpr != null) {
m_DurationExpr.setText(a_DurationExpr.getDurationExpr().toString());
} else {
m_DurationExpr.setText("");
}
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/RolesPanel.java
New file
0,0 → 1,66
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.Roles;
 
/**
* This class is a JPanel for the Roles attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information.
*/
public class RolesPanel extends DoublePanel {
 
JTextField m_Roles = new JTextField(15);
JLabel m_Title = new JLabel();
 
public RolesPanel(String a_Title, boolean a_Editable) {
m_Roles.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_Roles);
}
 
public RolesPanel(Roles a_Roles, String a_Title, boolean a_Editable) {
setRoles(a_Roles);
m_Roles.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_Roles);
}
 
public Roles getRoles() {
return new Roles(m_Roles.getText());
}
 
public void setRoles(Roles a_Roles) {
if (a_Roles != null) {
m_Roles.setText(a_Roles.getRole().toString());
} else {
m_Roles.setText("");
}
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/BPStringPanel.java
New file
0,0 → 1,66
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.BPString;
 
/**
* This class is a JPanel for the BPString attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information.
*/
public class BPStringPanel extends DoublePanel {
 
JTextField m_BPString = new JTextField(15);
JLabel m_Title = new JLabel();
 
public BPStringPanel(String a_Title, boolean a_Editable) {
m_BPString.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_BPString);
}
 
public BPStringPanel(BPString a_BPString, String a_Title, boolean a_Editable) {
setBPString(a_BPString);
m_BPString.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_BPString);
}
 
public BPString getBPString() {
return new BPString(m_BPString.getText());
}
 
public void setBPString(BPString a_BPString) {
if (a_BPString != null) {
m_BPString.setText(a_BPString.getBPString().toString());
} else {
m_BPString.setText("");
}
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/ModifyShowPanel.java
New file
0,0 → 1,108
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
 
/**
* This class is used for showing a ShowPanel, it is used for BPEL-elements within other
* BPEL-elements with their own TabbedDialog
*/
public class ModifyShowPanel extends JPanel implements ActionListener {
 
private JButton m_EditButton;
private JButton m_DeleteButton;
private JDialog m_EditDialog;
private ShowPanel m_ShowPanel;
 
/**
* Creates a ModifyShowPanel
* @param a_EditDialog A EditDialog
* @param a_ShowPanel the ShowPanel (where a summary of the EditDialog is shown)
*/
public ModifyShowPanel(JDialog a_EditDialog, ShowPanel a_ShowPanel) {
super(new GridBagLayout());
m_EditDialog = a_EditDialog;
m_ShowPanel = a_ShowPanel;
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.BOTH;
l_Constraints.weighty = 0.0;
l_Constraints.weightx = 0.0;
l_Constraints.gridwidth = GridBagConstraints.RELATIVE;
m_EditButton = new JButton("Edit");
m_EditButton.addActionListener(this);
m_DeleteButton = new JButton("Clear");
m_DeleteButton.addActionListener(this);
makeComponent(this, m_EditButton, l_Gridbag, l_Constraints);
l_Constraints.gridwidth = GridBagConstraints.REMAINDER;
makeComponent(this, m_DeleteButton, l_Gridbag, l_Constraints);
}
 
/**
* Helper method to ease the layout process
* @param a_Parent the parent component
* @param a_JChild the child component
* @param a_Gridbag the type of layout used for layouting this child in the parent
* @param a_Constraints the constraints added
*/
public void makeComponent(JComponent a_Parent, JComponent a_JChild, GridBagLayout a_Gridbag,
GridBagConstraints a_Constraints) {
a_Gridbag.setConstraints(a_JChild, a_Constraints);
a_Parent.add(a_JChild);
}
 
/**
* Handles the edit and clear actions
*/
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(m_EditButton)) {
TabbedDialog l_TabbedDialog = m_ShowPanel.getEditPanelHolderClone().getShowEditPanel(
m_ShowPanel);
if (l_TabbedDialog != null) {
l_TabbedDialog.initialize();
JDialog l_JDialog = new JDialog((JFrame) null, true);
l_JDialog.setResizable(false);
l_JDialog.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
l_JDialog.getContentPane().add(l_TabbedDialog, BorderLayout.CENTER);
l_JDialog.pack();
l_JDialog.setVisible(true);
}
} else if (e.getSource().equals(m_DeleteButton)) {
TabbedDialog l_TabbedDialog = m_ShowPanel.getEditPanelHolderClone().getShowEditPanel(
m_ShowPanel);
l_TabbedDialog.initialize();
l_TabbedDialog.clearShowPanel();
}
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/Editable.java
New file
0,0 → 1,76
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
/**
* the Object which is the 'holder' of a CustomTable or ShowPanel and has methods
* to get the corresponding editdialog, adddialog etc and methods to save this
*/
public interface Editable {
 
/**
* forwards the getEditPanel to the selected item in the CustomTable
* @param a_CustomTable The CustomTable involved
* @return the editPanel for the selected item in this CustomTable
*/
public TabbedDialog getEditPanel(CustomTable a_CustomTable);
 
/**
* Save the EditPanel, this is done by updating the original with the clone (which was
* created together with the editscreen)
* @param a_TabbedDialog the TabbedDialog which needs to be saved
*/
public void saveEditPanel(TabbedDialog a_TabbedDialog);
 
/**
* Returns the EditName (Used for naming the Tabs in the property dialogs
* @return the EditName (Used for naming the Tabs in the property dialogs
*/
public String getEditName();
 
/**
* Returns the CustomTable that this Editable holds
* @return the CustomTable that this Editable holds
*/
public CustomTable getPanelTable();
 
/**
* Returns a ShowPanel. This ShowPanel is used for editing
* a tab in a properties dialog which isnt a list
* @return a ShowPanel. This ShowPanel is used for editing
* a tab in a properties dialog which isnt a list
*/
public ShowPanel getShowPanel();
 
/**
* Save the AddPanel
* @param a_TabbedDialog the TabbedDialog which needs to be saved
*/
public void saveAddPanel(TabbedDialog a_TabbedDialog);
 
/**
* Returns a AddPanel
* @param a_CustomTable The table in which the Object should be put when added.
* @return a clear AddPanel
*/
public TabbedDialog getNewPanel(CustomTable a_CustomTable);
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/Tableable.java
New file
0,0 → 1,38
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import java.util.Vector;
 
/**
* Elements that implement this interface have a table
* Besides the getRow method, they should also implement the method static Vector getColumnNames
* This method should return a Vector of Strings that should be shown in the CustomTable
*/
public interface Tableable {
 
/**
* This method should have the same size as the ColumnNames Vector
* @return a Selection of attributes of this element
*/
public Vector getRow();
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/URIPanel.java
New file
0,0 → 1,66
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.URI;
 
/**
* This class is a JPanel for the URI attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information.
*/
public class URIPanel extends DoublePanel {
 
JTextField m_URI = new JTextField(15);
JLabel m_Title = new JLabel();
 
public URIPanel(String a_Title, boolean a_Editable) {
m_URI.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_URI);
}
 
public URIPanel(URI a_URI, String a_Title, boolean a_Editable) {
setURI(a_URI);
m_URI.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_URI);
}
 
public URI getURI() {
return new URI(m_URI.getText());
}
 
public void setURI(URI a_URI) {
if (a_URI != null) {
m_URI.setText(a_URI.getURI().toString());
} else {
m_URI.setText("");
}
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/TableModifyPanel.java
New file
0,0 → 1,131
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
 
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
 
/**
* This class is a panel which consists of the add, edit and delete button,
* it listens to these buttons itself. It is used for adding, editing or deleting items
* in a CustomTable
*/
public class TableModifyPanel extends JPanel implements ActionListener {
 
private JButton m_AddButton;
private JButton m_EditButton;
private JButton m_DeleteButton;
private JDialog m_ModifyDialog;
private CustomTable m_CustomTable;
private TabbedDialog m_ModifyPanel;
 
/**
* Creates a TableModifyPanel, needs a modify dialog and a CustomTable to link to
* @param a_ModifyDialog A Dialog in which a item of the CustomTable can be modified
* @param a_CustomTable The table
*/
public TableModifyPanel(JDialog a_ModifyDialog, CustomTable a_CustomTable) {
super(new GridBagLayout());
m_ModifyDialog = a_ModifyDialog;
m_CustomTable = a_CustomTable;
m_ModifyDialog.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
this.setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.NONE;
l_Constraints.weighty = 0.0;
l_Constraints.weightx = 0.0;
l_Constraints.anchor = GridBagConstraints.LINE_END;
m_AddButton = new JButton("Add");
m_AddButton.addActionListener(this);
m_EditButton = new JButton("Edit");
m_EditButton.addActionListener(this);
m_DeleteButton = new JButton("Delete");
m_DeleteButton.addActionListener(this);
makeComponent(this, m_AddButton, l_Gridbag, l_Constraints);
makeComponent(this, m_EditButton, l_Gridbag, l_Constraints);
makeComponent(this, m_DeleteButton, l_Gridbag, l_Constraints);
}
 
public TabbedDialog getModifyPanel() {
return m_ModifyPanel;
}
 
public void setModifyPanel(TabbedDialog a_ModifyPanel) {
m_ModifyPanel = a_ModifyPanel;
if (a_ModifyPanel != null) {
m_EditButton.setEnabled(true);
m_DeleteButton.setEnabled(true);
}
return;
}
 
/**
* Helper method to ease the layout process
* @param a_Parent the parent component
* @param a_JChild the child component
* @param a_Gridbag the type of layout used for layouting this child in the parent
* @param a_Constraints the constraints added
*/
public void makeComponent(JComponent a_Parent, JComponent a_JChild, GridBagLayout a_Gridbag,
GridBagConstraints a_Constraints) {
a_Gridbag.setConstraints(a_JChild, a_Constraints);
a_Parent.add(a_JChild);
}
 
/**
* Handles the add, edit and remove actions
*/
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(m_AddButton)) {
m_ModifyPanel = m_CustomTable.getNewPanel();
if (m_ModifyPanel != null) {
m_ModifyPanel.initialize();
m_ModifyDialog.getContentPane().removeAll();
m_ModifyDialog.getContentPane().add(m_ModifyPanel);
m_ModifyDialog.setTitle(m_ModifyPanel.getTitle());
m_ModifyDialog.pack();
m_ModifyDialog.setVisible(true);
}
} else if (e.getSource().equals(m_EditButton)) {
m_ModifyPanel = m_CustomTable.getEditPanel();
if (m_ModifyPanel != null) {
m_ModifyPanel.initialize();
m_ModifyDialog.getContentPane().removeAll();
m_ModifyDialog.getContentPane().add(m_ModifyPanel);
m_ModifyDialog.pack();
m_ModifyDialog.setVisible(true);
}
} else if (e.getSource().equals(m_DeleteButton)) {
int l_Row = m_CustomTable.getSelectedRow();
m_CustomTable.removeRow(l_Row);
}
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/NCNamePanel.java
New file
0,0 → 1,71
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.NCName;
 
/**
* This class is a JPanel for the NCName attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information.
*/
public class NCNamePanel extends DoublePanel {
 
JTextField m_NCName = new JTextField(15);
JLabel m_Title = new JLabel();
 
public NCNamePanel(String a_Title, boolean a_Editable) {
m_NCName.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_NCName);
}
 
public NCNamePanel(NCName a_NCName, String a_Title, boolean a_Editable) {
setNCName(a_NCName);
m_NCName.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
JPanel l_LabelPanel = new JPanel();
l_LabelPanel.add(m_Title);
JPanel l_InputPanel = new JPanel();
l_InputPanel.add(m_NCName);
setLabelPanel(m_Title);
setInputPanel(m_NCName);
}
 
public NCName getNCName() {
return new NCName(m_NCName.getText());
}
 
public void setNCName(NCName a_NCName) {
if (a_NCName != null) {
m_NCName.setText(a_NCName.getName());
} else {
m_NCName.setText("");
}
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/QNamePanel.java
New file
0,0 → 1,138
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
 
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.NCName;
import org.emaxx.bpeldesigner.bpel.QName;
 
/**
* This class is a JPanel for the QName attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information.
*/
public class QNamePanel extends DoublePanel {
 
JTextField m_Prefix = new JTextField(15);
JTextField m_LocalPart = new JTextField(15);
JLabel m_Title;
 
public QNamePanel(String a_Title, boolean a_Editable) {
JPanel l_InputPanel = new JPanel(new GridBagLayout());
m_Prefix.setToolTipText("Prefix");
m_Prefix.setEditable(a_Editable);
m_LocalPart.setToolTipText("LocalPart");
m_LocalPart.setEditable(a_Editable);
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
l_InputPanel.setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.BOTH;
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
JPanel l_LabelPanel = new JPanel();
l_LabelPanel.add(m_Title);
l_Constraints.weightx = 1.0;
makeComponent(l_InputPanel, m_Prefix, l_Gridbag, l_Constraints);
l_Constraints.weightx = 0.0;
makeComponent(l_InputPanel, new JLabel(":"), l_Gridbag, l_Constraints);
l_Constraints.weightx = 1.0;
l_Constraints.gridwidth = GridBagConstraints.REMAINDER;
makeComponent(l_InputPanel, m_LocalPart, l_Gridbag, l_Constraints);
setLabelPanel(m_LocalPart);
setInputPanel(l_InputPanel);
}
 
public QNamePanel(QName a_QName, String a_Title, boolean a_Editable) {
setQName(a_QName);
JPanel l_InputPanel = new JPanel(new GridBagLayout());
m_Prefix.setToolTipText("Prefix");
m_Prefix.setEditable(a_Editable);
m_LocalPart.setToolTipText("LocalPart");
m_LocalPart.setEditable(a_Editable);
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
l_InputPanel.setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.BOTH;
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
l_Constraints.weightx = 1.0;
makeComponent(l_InputPanel, m_Prefix, l_Gridbag, l_Constraints);
l_Constraints.weightx = 0.0;
makeComponent(l_InputPanel, new JLabel(":"), l_Gridbag, l_Constraints);
l_Constraints.weightx = 1.0;
l_Constraints.gridwidth = GridBagConstraints.REMAINDER;
makeComponent(l_InputPanel, m_LocalPart, l_Gridbag, l_Constraints);
setLabelPanel(m_Title);
setInputPanel(l_InputPanel);
}
 
public void makeComponent(JPanel a_Parent, JComponent a_JComponent, GridBagLayout a_Gridbag,
GridBagConstraints a_Constraints) {
a_Gridbag.setConstraints(a_JComponent, a_Constraints);
a_Parent.add(a_JComponent);
}
 
public QName getQName() {
QName l_QName = new QName();
if (m_Prefix != null) {
l_QName.setPrefix(new NCName(m_Prefix.getText()));
}
l_QName.setLocalPart(new NCName(m_LocalPart.getText()));
return l_QName;
}
 
public NCName getLocalPart() {
return new NCName(m_LocalPart.getText());
}
 
public void setLocalPart(NCName a_LocalPart) {
m_LocalPart.setText(a_LocalPart.getName());
return;
}
 
public NCName getPrefix() {
return new NCName(m_Prefix.getText());
}
 
public void setPrefix(NCName a_Prefix) {
m_Prefix.setText(a_Prefix.getName());
return;
}
 
public void setQName(QName a_QName) {
if (a_QName.getPrefix() != null) {
m_Prefix.setText(a_QName.getPrefix().getName());
} else {
m_Prefix.setText("");
}
if (a_QName.getPrefix() != null) {
m_LocalPart.setText(a_QName.getLocalPart().getName());
} else {
m_LocalPart.setText("");
}
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/CustomTable.java
New file
0,0 → 1,143
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import java.awt.Dimension;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.JTable;
 
/**
* This table is used for displaying lists in the property dialogs of certain BPEL-elements
* It uses CustomTableModel which makes sure that the List has the right behaviour.
* The table can be constructed with the constructor, after that, the columnnames should be set
* and the rows should be set. Then the table should be updated.
*/
public class CustomTable extends JTable {
 
private CustomTableModel m_CustomTableModel = new CustomTableModel();
private Editable m_Editable;
private Vector m_Rows = new Vector();
 
/**
* Creates a CustomTable
* Sets the Object which is the 'holder' of the Table and has methods
* to get the corresponding editdialog, adddialog etc and methods to save this
* @param a_Editable a Editable the Object which is the 'holder' of the Table and has methods
* to get the corresponding editdialog, adddialog etc and methods to save this
*/
public CustomTable(Editable a_Editable) {
super();
setPreferredScrollableViewportSize(new Dimension(600, 120));
m_Editable = a_Editable;
setAutoscrolls(true);
setModel(m_CustomTableModel);
}
 
/**
* Sets the names of the columns
* @param a_ColumnNames Vector of Strings containing names
*/
public void addColumnNames(Vector a_ColumnNames) {
Enumeration l_Enum = a_ColumnNames.elements();
while (l_Enum.hasMoreElements()) {
Object l_Object = l_Enum.nextElement();
if (l_Object instanceof String) {
m_CustomTableModel.addColumnName((String) l_Object);
}
}
}
 
/**
* Sets the Vector of the rows
* @param a_Rows a Vector containing Vectors which contain the subselection of the object that
* needs to be shown in table
*/
public void setRows(Vector a_Rows) {
m_Rows = a_Rows;
}
 
/**
* Remove a row in the row-vector, the table will be automatically updated
* @param a_RowNr
*/
public void removeRow(int a_RowNr) {
m_CustomTableModel.removeRow(a_RowNr);
m_Rows.remove(a_RowNr);
}
 
/**
* Updating the table, uses the row-vector
*/
public void updateTable() {
m_CustomTableModel.removeAll();
Enumeration l_Enum = m_Rows.elements();
while (l_Enum.hasMoreElements()) {
Object l_Object = l_Enum.nextElement();
if (l_Object instanceof Tableable) {
m_CustomTableModel.addRow(((Tableable) l_Object).getRow());
}
}
}
 
/**
* Forwards the saveEditPanel command to the Editable that is the holder of the list of
* which the list-item was edited with the TabbedDialog parameter
* @param a_TabbedDialog The TabbedDialog which needs to be saved
*/
public void saveEditPanel(TabbedDialog a_TabbedDialog) {
m_Editable.saveEditPanel(a_TabbedDialog);
}
 
/**
* Forwards the saveAddPanel command to the Editable that is the holder of the list of
* which the list-item was edited with the TabbedDialog parameter
* @param a_TabbedDialog The TabbedDialog which needs to be saved
*/
public void saveAddPanel(TabbedDialog a_TabbedDialog) {
m_Editable.saveAddPanel(a_TabbedDialog);
}
 
/**
* Returns the Editable that is the holder of this table
* @return the Editable that is the holder of this table
*/
public Editable getEditable() {
return m_Editable;
}
 
/**
* Returns the addPanel of the listitem
* @return the addPanel of the listitem
*/
public TabbedDialog getNewPanel() {
return m_Editable.getNewPanel(this);
}
 
/**
* Returns the editPanel of the listitem
* @return the editPanel of the listitem
*/
public TabbedDialog getEditPanel() {
return m_Editable.getEditPanel(this);
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/DeadlineExprPanel.java
New file
0,0 → 1,66
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.DeadlineExpr;
 
/**
* This class is a JPanel for the DeadlineExpr attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information.
*/
public class DeadlineExprPanel extends DoublePanel {
 
JTextField m_DeadlineExpr = new JTextField(15);
JLabel m_Title = new JLabel();
 
public DeadlineExprPanel(String a_Title, boolean a_Editable) {
m_DeadlineExpr.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_DeadlineExpr);
}
 
public DeadlineExprPanel(DeadlineExpr a_DeadlineExpr, String a_Title, boolean a_Editable) {
setDeadlineExpr(a_DeadlineExpr);
m_DeadlineExpr.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_DeadlineExpr);
}
 
public DeadlineExpr getDeadlineExpr() {
return new DeadlineExpr(m_DeadlineExpr.getText());
}
 
public void setDeadlineExpr(DeadlineExpr a_DeadlineExpr) {
if (a_DeadlineExpr != null) {
m_DeadlineExpr.setText(a_DeadlineExpr.getDeadlineExpr().toString());
} else {
m_DeadlineExpr.setText("");
}
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/DoublePanel.java
New file
0,0 → 1,76
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JComponent;
 
/**
* This class is made for making the layout look straight.
* The separation of the 'label'panel and the inputpanel makes it possible to outline them separately
*/
public abstract class DoublePanel {
 
private JComponent m_InputPanel;
private JComponent m_LabelPanel;
 
public DoublePanel() {
}
 
/**
* creates the DoublePanel and specify the labelpanel and the inputpanel
* @param a_LabelPanel the labelpanel
* @param a_InputPanel the inputpanel
*/
public DoublePanel(JComponent a_LabelPanel, JComponent a_InputPanel) {
m_LabelPanel = a_LabelPanel;
m_InputPanel = a_InputPanel;
}
 
public JComponent getInputPanel() {
return m_InputPanel;
}
 
public JComponent getLabelPanel() {
return m_LabelPanel;
}
 
public void setInputPanel(JComponent a_InputPanel) {
m_InputPanel = a_InputPanel;
}
 
public void setLabelPanel(JComponent a_LabelPanel) {
m_LabelPanel = a_LabelPanel;
}
 
/**
* Returns the first panel. Can be overriden to put the label and inputpanel viceversa
*/
public JComponent getFirstPanel() {
return m_LabelPanel;
}
 
/**
* Returns the second panel. Can be overriden to put the label and inputpanel viceversa
*/
public JComponent getSecondPanel() {
return m_InputPanel;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/BooleanExprPanel.java
New file
0,0 → 1,66
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.BooleanExpr;
 
/**
* This class is a JPanel for the BooleanExpr attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information.
*/
public class BooleanExprPanel extends DoublePanel {
 
JTextField m_BooleanExpr = new JTextField(15);
JLabel m_Title = new JLabel();
 
public BooleanExprPanel(String a_Title, boolean a_Editable) {
m_BooleanExpr.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_BooleanExpr);
}
 
public BooleanExprPanel(BooleanExpr a_BooleanExpr, String a_Title, boolean a_Editable) {
setBooleanExpr(a_BooleanExpr);
m_BooleanExpr.setEditable(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_BooleanExpr);
}
 
public BooleanExpr getBooleanExpr() {
return new BooleanExpr(m_BooleanExpr.getText());
}
 
public void setBooleanExpr(BooleanExpr a_BooleanExpr) {
if (a_BooleanExpr != null) {
m_BooleanExpr.setText(a_BooleanExpr.getBooleanExpr().toString());
} else {
m_BooleanExpr.setText("");
}
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/BooleanPanel.java
New file
0,0 → 1,65
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
 
import org.emaxx.bpeldesigner.bpel.BPBoolean;
 
/**
* This class is a JPanel for the Boolean attribute in the BPEL-language
* it has the corresponding getters and setters for extracting the information and
* setting information. The Boolean value is represented by a checkbox
*/
public class BooleanPanel extends DoublePanel {
 
JCheckBox m_Boolean;
JLabel m_Title = new JLabel();
 
public BooleanPanel(BPBoolean a_Boolean, String a_Title, boolean a_Editable) {
m_Boolean = new JCheckBox();
setBoolean(a_Boolean);
m_Boolean.setEnabled(a_Editable);
m_Title = new JLabel(a_Title, SwingConstants.LEFT);
setLabelPanel(m_Title);
setInputPanel(m_Boolean);
 
}
 
public BPBoolean getBoolean() {
if (m_Boolean.isSelected()) {
return new BPBoolean("yes");
} else {
return new BPBoolean("no");
}
}
 
public void setBoolean(BPBoolean a_BPBoolean) {
if (a_BPBoolean != null) {
m_Boolean.setSelected(a_BPBoolean.booleanValue().booleanValue());
} else {
m_Boolean.setSelected(false);
}
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/ShowPanel.java
New file
0,0 → 1,259
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
 
import org.emaxx.bpeldesigner.bpel.BPBoolean;
import org.emaxx.bpeldesigner.bpel.BPString;
import org.emaxx.bpeldesigner.bpel.BooleanExpr;
import org.emaxx.bpeldesigner.bpel.DeadlineExpr;
import org.emaxx.bpeldesigner.bpel.DurationExpr;
import org.emaxx.bpeldesigner.bpel.NCName;
import org.emaxx.bpeldesigner.bpel.QName;
import org.emaxx.bpeldesigner.bpel.Roles;
import org.emaxx.bpeldesigner.bpel.URI;
 
public class ShowPanel extends JPanel {
 
private GridBagConstraints m_AttributeConstraints = new GridBagConstraints();
private GridLayout m_AttributeGrid = new GridLayout(0, 2);
private Vector m_AttributeObjects = new Vector();
private JPanel m_AttributesPanel = null;
private String m_Title = "";
private EditPanelHolder m_EditPanelHolderClone;
private EditPanelHolder m_EditPanelHolderOriginal;
private Vector m_InputPanels = new Vector();
private JPanel m_MainPanel;
private JTabbedPane m_TabbedPanel = null;
private GridBagLayout m_GridBagLayout = new GridBagLayout();
 
/**
* Creates a ShowPanel
* @param a_Title the title of the ShowPanel, used for tabname
* @param a_EditPanelHolderClone a clone of the element that needs to be edited, used for cancel-able actions
* @param a_EditPanelHolderOriginal the original element that needs to be edited, used for saving
*/
public ShowPanel(String a_Title, EditPanelHolder a_EditPanelHolderClone,
EditPanelHolder a_EditPanelHolderOriginal) {
super();
GridBagLayout l_GridBagLayout = new GridBagLayout();
GridBagConstraints l_GridBagConstraints = new GridBagConstraints();
l_GridBagConstraints.fill = GridBagConstraints.BOTH;
l_GridBagConstraints.weightx = 1;
l_GridBagConstraints.weighty = 1;
GridBagConstraints l_GridBagConstraints2 = new GridBagConstraints();
l_GridBagConstraints2.fill = GridBagConstraints.BOTH;
l_GridBagConstraints2.weightx = 1;
l_GridBagConstraints2.weighty = 1;
m_MainPanel = new JPanel(l_GridBagLayout);
l_GridBagLayout.setConstraints(m_MainPanel, l_GridBagConstraints);
m_Title = a_Title;
m_EditPanelHolderClone = a_EditPanelHolderClone;
m_EditPanelHolderOriginal = a_EditPanelHolderOriginal;
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
m_MainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.setLayout(m_GridBagLayout);
makeComponent(this, m_MainPanel, m_GridBagLayout, l_GridBagConstraints2);
}
 
public String getTitle() {
return m_Title;
}
 
public void setTitle(String a_Title) {
m_Title = a_Title;
}
 
/**
* An object with a label can be added to the ShowPanel, it creates automatically the right inputpanel
* for it and keeps data to correctly save, cancel or update the inputfields
* @param a_Object the element attribute
* @param a_Title the label
*/
public void addAttribute(Object a_Object, String a_Title) {
DoublePanel l_DoublePanel = null;
if (a_Object instanceof NCName) {
l_DoublePanel = addInputPanel(new NCNamePanel((NCName) addAttributeObject(a_Object),
a_Title, false));
} else if (a_Object instanceof QName) {
l_DoublePanel = addInputPanel(new QNamePanel((QName) addAttributeObject(a_Object),
a_Title, false));
} else if (a_Object instanceof BPBoolean) {
l_DoublePanel = addInputPanel(new BooleanPanel(
(BPBoolean) addAttributeObject(a_Object), a_Title, false));
} else if (a_Object instanceof URI) {
l_DoublePanel = addInputPanel(new URIPanel((URI) addAttributeObject(a_Object), a_Title,
false));
} else if (a_Object instanceof DeadlineExpr) {
l_DoublePanel = addInputPanel(new DeadlineExprPanel(
(DeadlineExpr) addAttributeObject(a_Object), a_Title, false));
} else if (a_Object instanceof BooleanExpr) {
l_DoublePanel = addInputPanel(new BooleanExprPanel(
(BooleanExpr) addAttributeObject(a_Object), a_Title, false));
} else if (a_Object instanceof DurationExpr) {
l_DoublePanel = addInputPanel(new DurationExprPanel(
(DurationExpr) addAttributeObject(a_Object), a_Title, false));
} else if (a_Object instanceof Roles) {
l_DoublePanel = addInputPanel(new RolesPanel((Roles) addAttributeObject(a_Object),
a_Title, false));
} else if (a_Object instanceof BPString) {
l_DoublePanel = addInputPanel(new BPStringPanel(
(BPString) addAttributeObject(a_Object), a_Title, false));
}
 
if (m_AttributesPanel == null) {
createAttributePanel();
}
if (l_DoublePanel != null) {
m_AttributesPanel.add(l_DoublePanel.getFirstPanel());
m_AttributesPanel.add(l_DoublePanel.getSecondPanel());
}
}
 
/**
* Helper method to add attribute objects, normally only used internally
* @param a_AttributeObject the attribute object to be added
* @return the same attribute object
*/
public Object addAttributeObject(Object a_AttributeObject) {
m_AttributeObjects.add(a_AttributeObject);
return a_AttributeObject;
}
 
/**
* Helper method to add input panels, normally only used internally
* @param a_InputPanel the input panel to be added
* @return the same input panel
*/
public DoublePanel addInputPanel(DoublePanel a_InputPanel) {
m_InputPanels.add(a_InputPanel);
return a_InputPanel;
}
 
/**
* Creates an empty AttributePanel
*/
public void createAttributePanel() {
m_AttributesPanel = new JPanel(m_AttributeGrid);
m_AttributesPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
}
 
/**
* Returns the element clone
* @return the element clone
*/
public EditPanelHolder getEditPanelHolderClone() {
return m_EditPanelHolderClone;
}
 
/**
* Returns the element original
* @return the element original
*/
public EditPanelHolder getEditPanelHolderOriginal() {
return m_EditPanelHolderOriginal;
}
 
/**
* Initialize the ShowPanel, should be used _after_ adding the attributes
*/
public void initialize() {
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
m_MainPanel.setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.BOTH;
l_Constraints.weighty = 0.0;
l_Constraints.weightx = 1.0;
l_Constraints.gridwidth = GridBagConstraints.REMAINDER;
m_MainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
if (m_AttributesPanel != null) {
makeComponent(m_MainPanel, m_AttributesPanel, l_Gridbag, l_Constraints);
}
l_Constraints.weighty = 1.0;
if (m_TabbedPanel != null) {
makeComponent(m_MainPanel, m_TabbedPanel, l_Gridbag, l_Constraints);
}
}
 
/**
* Helper method to ease the layout process
* @param a_Parent the parent component
* @param a_JChild the child component
* @param a_Gridbag the type of layout used for layouting this child in the parent
* @param a_Constraints the constraints added
*/
public void makeComponent(JComponent a_Parent, JComponent a_JChild, GridBagLayout a_Gridbag,
GridBagConstraints a_Constraints) {
a_Gridbag.setConstraints(a_JChild, a_Constraints);
a_Parent.add(a_JChild);
}
 
/**
* The attributepanels gets updated with a Vector of AttributeObjects
* @param a_AttributeObjects a Vector with the attribute objects with the new data
*/
public void updateShowPanel(Vector a_AttributeObjects) {
Enumeration l_EnumInputPanels = m_InputPanels.elements();
Enumeration l_EnumAttributeObjects = a_AttributeObjects.elements();
DoublePanel l_InputPanel;
while (l_EnumInputPanels.hasMoreElements()) {
l_InputPanel = (DoublePanel) l_EnumInputPanels.nextElement();
if (l_InputPanel instanceof NCNamePanel) {
NCName l_NCName = (NCName) l_EnumAttributeObjects.nextElement();
((NCNamePanel) l_InputPanel).setNCName(l_NCName);
} else if (l_InputPanel instanceof QNamePanel) {
QName l_QName = (QName) l_EnumAttributeObjects.nextElement();
((QNamePanel) l_InputPanel).setQName(l_QName);
} else if (l_InputPanel instanceof BooleanExprPanel) {
BooleanExpr l_BooleanExpr = (BooleanExpr) l_EnumAttributeObjects.nextElement();
((BooleanExprPanel) l_InputPanel).setBooleanExpr(l_BooleanExpr);
} else if (l_InputPanel instanceof DurationExprPanel) {
DurationExpr l_DurationExpr = (DurationExpr) l_EnumAttributeObjects.nextElement();
((DurationExprPanel) l_InputPanel).setDurationExpr(l_DurationExpr);
} else if (l_InputPanel instanceof DeadlineExprPanel) {
DeadlineExpr l_DeadlineExpr = (DeadlineExpr) l_EnumAttributeObjects.nextElement();
((DeadlineExprPanel) l_InputPanel).setDeadlineExpr(l_DeadlineExpr);
} else if (l_InputPanel instanceof BooleanPanel) {
BPBoolean l_Boolean = (BPBoolean) l_EnumAttributeObjects.nextElement();
((BooleanPanel) l_InputPanel).setBoolean(l_Boolean);
} else if (l_InputPanel instanceof URIPanel) {
URI l_URI = (URI) l_EnumAttributeObjects.nextElement();
((URIPanel) l_InputPanel).setURI(l_URI);
} else if (l_InputPanel instanceof RolesPanel) {
Roles l_Roles = (Roles) l_EnumAttributeObjects.nextElement();
((RolesPanel) l_InputPanel).setRoles(l_Roles);
} else if (l_InputPanel instanceof BPStringPanel) {
BPString l_BPString = (BPString) l_EnumAttributeObjects.nextElement();
((BPStringPanel) l_InputPanel).setBPString(l_BPString);
}
}
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/input/TabbedDialog.java
New file
0,0 → 1,520
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.input;
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
 
import org.emaxx.bpeldesigner.bpel.BPBoolean;
import org.emaxx.bpeldesigner.bpel.BPString;
import org.emaxx.bpeldesigner.bpel.BooleanExpr;
import org.emaxx.bpeldesigner.bpel.DeadlineExpr;
import org.emaxx.bpeldesigner.bpel.DurationExpr;
import org.emaxx.bpeldesigner.bpel.NCName;
import org.emaxx.bpeldesigner.bpel.QName;
import org.emaxx.bpeldesigner.bpel.Roles;
import org.emaxx.bpeldesigner.bpel.URI;
 
/**
* This class is meant for showing a complete properties panel of an element, it can have tabs
* In these tabs there can be an overview (ShowPanel or CustomTable) of child elements, these can have their own
* TabbedDialog
*/
public class TabbedDialog extends JScrollPane implements ActionListener {
 
private JPanel m_AcceptPanel = createAcceptPanel();
private GridBagConstraints m_AttributeConstraints = new GridBagConstraints();
private GridLayout m_AttributeGrid = new GridLayout(0, 2);
private Vector m_AttributeObjects = new Vector();
private JPanel m_AttributesPanel = null;
private JButton m_CancelButton;
private CustomTable m_CustomTable;
private ShowPanel m_ShowPanel;
private String m_Title = "";
private EditPanelHolder m_EditPanelHolderClone;
private EditPanelHolder m_EditPanelHolderOriginal;
private Vector m_InputPanels = new Vector();
private boolean m_IsNewElement;
private JPanel m_MainPanel = new JPanel(new GridBagLayout());
private JButton m_OkButton;
private JTabbedPane m_TabbedPanel = null;
 
/**
* Constructor for a TabbedDialog, this TabbedDialog
* is used for editing an element which was selected in a CustomTable
* @param a_Title Tabname
* @param a_EditPanelHolderClone The clone of the edited object
* @param a_EditPanelHolderOriginal The original object to be shown
* @param a_CustomTable The table in which this element was or should come
* @param a_isNewElement True when added to a list, false when edited
*/
public TabbedDialog(String a_Title, EditPanelHolder a_EditPanelHolderClone,
EditPanelHolder a_EditPanelHolderOriginal, CustomTable a_CustomTable, boolean a_isNewElement) {
super();
m_Title = a_Title;
m_CustomTable = a_CustomTable;
m_EditPanelHolderClone = a_EditPanelHolderClone;
m_EditPanelHolderOriginal = a_EditPanelHolderOriginal;
m_IsNewElement = a_isNewElement;
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
m_MainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.getViewport().add(m_MainPanel);
}
 
/**
* Constructor for a TabbedDialog, this TabbedDialog
* is used for editing an element which was shown in a ShowPanel
* @param a_Title Tabname
* @param a_EditPanelHolderClone The clone of the edited object
* @param a_EditPanelHolderOriginal The original object to be shown
* @param a_ShowPanel The panel in which this element was shown
*/
public TabbedDialog(String a_Title, EditPanelHolder a_EditPanelHolderClone,
EditPanelHolder a_EditPanelHolderOriginal, ShowPanel a_ShowPanel) {
super();
m_Title = a_Title;
m_ShowPanel = a_ShowPanel;
m_EditPanelHolderClone = a_EditPanelHolderClone;
m_EditPanelHolderOriginal = a_EditPanelHolderOriginal;
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
m_MainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
this.getViewport().add(m_MainPanel);
}
 
public String getTitle() {
return m_Title;
}
 
/**
* Handles the ok and cancel actions
*/
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(m_OkButton)) {
updateEditPanelHolder();
if (m_EditPanelHolderClone.checkEditPanel() != null) {
// Hier hoort in een toekomstige versie de
// errorhandling te komen
} else {
if (m_CustomTable != null) {
if (m_CustomTable.getEditable() != null) {
if (m_IsNewElement) {
m_CustomTable.saveAddPanel(this);
this.getRootPane().getParent().setVisible(false);
} else {
m_CustomTable.saveEditPanel(this);
this.getRootPane().getParent().setVisible(false);
}
m_CustomTable.updateTable();
}
} else if (m_ShowPanel != null) {
m_EditPanelHolderOriginal.saveEditPanel(m_EditPanelHolderClone);
m_ShowPanel.getEditPanelHolderOriginal().saveEditPanel(
m_EditPanelHolderOriginal);
m_ShowPanel.updateShowPanel(m_AttributeObjects);
this.getRootPane().getParent().setVisible(false);
} else {
m_EditPanelHolderOriginal.saveEditPanel(m_EditPanelHolderClone);
this.getRootPane().getParent().setVisible(false);
}
}
} else if (e.getSource().equals(m_CancelButton)) {
this.getRootPane().getParent().setVisible(false);
}
}
 
/**
* Clears the showPanel (when the clear button is pressed)
*/
public void clearShowPanel() {
Enumeration l_EnumInputPanels = m_InputPanels.elements();
Enumeration l_EnumAttributeObjects = m_AttributeObjects.elements();
DoublePanel l_InputPanel;
while (l_EnumInputPanels.hasMoreElements()) {
l_InputPanel = (DoublePanel) l_EnumInputPanels.nextElement();
if (l_InputPanel instanceof NCNamePanel) {
NCName l_NCName = new NCName();
((NCNamePanel) l_InputPanel).setNCName(l_NCName);
} else if (l_InputPanel instanceof QNamePanel) {
QName l_QName = new QName();
((QNamePanel) l_InputPanel).setQName(l_QName);
} else if (l_InputPanel instanceof BooleanExprPanel) {
BooleanExpr l_BooleanExpr = new BooleanExpr();
((BooleanExprPanel) l_InputPanel).setBooleanExpr(l_BooleanExpr);
} else if (l_InputPanel instanceof DurationExprPanel) {
DurationExpr l_DurationExpr = new DurationExpr();
((DurationExprPanel) l_InputPanel).setDurationExpr(l_DurationExpr);
} else if (l_InputPanel instanceof DeadlineExprPanel) {
DeadlineExpr l_DeadlineExpr = new DeadlineExpr();
((DeadlineExprPanel) l_InputPanel).setDeadlineExpr(l_DeadlineExpr);
} else if (l_InputPanel instanceof BooleanPanel) {
BPBoolean l_Boolean = new BPBoolean();
((BooleanPanel) l_InputPanel).setBoolean(l_Boolean);
} else if (l_InputPanel instanceof URIPanel) {
URI l_URI = new URI();
((URIPanel) l_InputPanel).setURI(l_URI);
} else if (l_InputPanel instanceof RolesPanel) {
Roles l_Roles = new Roles();
((RolesPanel) l_InputPanel).setRoles(l_Roles);
} else if (l_InputPanel instanceof BPStringPanel) {
BPString l_BPString = new BPString();
((BPStringPanel) l_InputPanel).setBPString(l_BPString);
}
}
this.updateEditPanelHolder();
m_EditPanelHolderOriginal.saveEditPanel(m_EditPanelHolderClone);
m_ShowPanel.getEditPanelHolderOriginal().saveEditPanel(m_EditPanelHolderOriginal);
m_ShowPanel.updateShowPanel(m_AttributeObjects);
}
 
/**
* An object with a label can be added to the ShowPanel, it creates automatically the right inputpanel
* for it and keeps data to correctly save, cancel or update the inputfields
* @param a_Object the element attribute
* @param a_Title the label
*/
public void addAttribute(Object a_Object, String a_Title) {
DoublePanel l_DoublePanel = null;
if (a_Object instanceof NCName) {
l_DoublePanel = addInputPanel(new NCNamePanel((NCName) addAttributeObject(a_Object),
a_Title, true));
} else if (a_Object instanceof QName) {
l_DoublePanel = addInputPanel(new QNamePanel((QName) addAttributeObject(a_Object),
a_Title, true));
} else if (a_Object instanceof BPBoolean) {
l_DoublePanel = addInputPanel(new BooleanPanel(
(BPBoolean) addAttributeObject(a_Object), a_Title, true));
} else if (a_Object instanceof URI) {
l_DoublePanel = addInputPanel(new URIPanel((URI) addAttributeObject(a_Object), a_Title,
true));
} else if (a_Object instanceof DeadlineExpr) {
l_DoublePanel = addInputPanel(new DeadlineExprPanel(
(DeadlineExpr) addAttributeObject(a_Object), a_Title, true));
} else if (a_Object instanceof BooleanExpr) {
l_DoublePanel = addInputPanel(new BooleanExprPanel(
(BooleanExpr) addAttributeObject(a_Object), a_Title, true));
} else if (a_Object instanceof DurationExpr) {
l_DoublePanel = addInputPanel(new DurationExprPanel(
(DurationExpr) addAttributeObject(a_Object), a_Title, true));
} else if (a_Object instanceof Roles) {
l_DoublePanel = addInputPanel(new RolesPanel((Roles) addAttributeObject(a_Object),
a_Title, true));
} else if (a_Object instanceof BPString) {
l_DoublePanel = addInputPanel(new BPStringPanel(
(BPString) addAttributeObject(a_Object), a_Title, true));
}
 
if (m_AttributesPanel == null) {
createAttributePanel();
 
}
if (l_DoublePanel != null) {
m_AttributesPanel.add(l_DoublePanel.getFirstPanel());
m_AttributesPanel.add(l_DoublePanel.getSecondPanel());
}
}
 
/**
* Helper method to add attribute objects, normally only used internally
* @param a_AttributeObject the attribute object to be added
* @return the same attribute object
*/
public Object addAttributeObject(Object a_AttributeObject) {
m_AttributeObjects.add(a_AttributeObject);
return a_AttributeObject;
}
 
/**
* Helper method to add input panels, normally only used internally
* @param a_InputPanel the input panel to be added
* @return the same input panel
*/
public DoublePanel addInputPanel(DoublePanel a_InputPanel) {
m_InputPanels.add(a_InputPanel);
return a_InputPanel;
}
 
/**
* This method is used for adding CustomTable tabs
* @param a_EditableObject The Editable element
*/
public void addTab(Editable a_EditableObject) {
if (m_TabbedPanel == null) {
createTabbedPanel();
}
JDialog l_JDialog = new JDialog((JFrame) null, true);
l_JDialog.setResizable(false);
CustomTable l_CustomTable;
l_CustomTable = a_EditableObject.getPanelTable();
if (l_CustomTable == null) {
m_TabbedPanel.addTab(a_EditableObject.getEditName(), initializeTab(
a_EditableObject.getShowPanel(), l_JDialog));
} else {
if (a_EditableObject.getEditPanel(l_CustomTable) != null) {
TabbedDialog l_TabbedDialog = a_EditableObject.getEditPanel(l_CustomTable);
l_TabbedDialog.initialize();
l_JDialog.getContentPane().add(l_TabbedDialog);
}
JPanel l_JPanel = initializeTableTab(l_CustomTable, l_JDialog);
m_TabbedPanel.addTab(a_EditableObject.getEditName(), l_JPanel);
}
}
 
/**
* This method is used for adding ShowPanel tabs
* @param a_EditPanelHolder the EditPanelHolder element
*/
public void addTab(EditPanelHolder a_EditPanelHolder) {
if (m_TabbedPanel == null) {
createTabbedPanel();
}
JDialog l_JDialog = new JDialog();
l_JDialog.setResizable(false);
ShowPanel l_ShowPanel = a_EditPanelHolder.getShowPanel();
if (l_ShowPanel != null) {
l_ShowPanel.initialize();
m_TabbedPanel.addTab(l_ShowPanel.getTitle(), initializeTab(l_ShowPanel, l_JDialog));
}
}
 
/**
* Returns an ok/cancelbutton JPanel, this class is the listener of these buttons
* @return an ok/cancelbutton JPanel, this class is the listener of these buttons
*/
public JPanel createAcceptPanel() {
JPanel l_AcceptPanel = new JPanel(new GridBagLayout());
l_AcceptPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
l_AcceptPanel.setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.BOTH;
l_Constraints.weighty = 0.0;
l_Constraints.weightx = 0.0;
l_Constraints.gridwidth = GridBagConstraints.RELATIVE;
m_OkButton = new JButton("Ok");
m_OkButton.addActionListener(this);
m_OkButton.setSelected(true);
makeComponent(l_AcceptPanel, m_OkButton, l_Gridbag, l_Constraints);
l_Constraints.gridwidth = GridBagConstraints.REMAINDER;
m_CancelButton = new JButton("Cancel");
m_CancelButton.addActionListener(this);
makeComponent(l_AcceptPanel, m_CancelButton, l_Gridbag, l_Constraints);
return l_AcceptPanel;
}
 
/**
* creates a new AttributePanel, for internal use
*/
public void createAttributePanel() {
m_AttributesPanel = new JPanel(m_AttributeGrid);
m_AttributesPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
}
 
/**
* creates a ModifyShowPanel
* @param a_EditDialog the dialog where the element can be modified
* @param a_ShowPanel the ShowPanel where a summary of the element is shown
* @return
*/
public JPanel createModifyPanel(JDialog a_EditDialog, ShowPanel a_ShowPanel) {
ModifyShowPanel l_ModifyPanel = new ModifyShowPanel(a_EditDialog, a_ShowPanel);
return l_ModifyPanel;
}
 
/**
* Creates a new TabbedPanel
*/
public void createTabbedPanel() {
m_TabbedPanel = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
m_TabbedPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
}
 
/**
* creates a TableModifyPanel
* @param a_EditDialog the dialog where the element can be modified
* @param a_CustomTable the ShowPanel where a list is shown where the element is a part of
* @return
*/
public JPanel createTableModifyPanel(JDialog a_EditDialog, CustomTable a_CustomTable) {
TableModifyPanel l_TableModifyPanel = new TableModifyPanel(a_EditDialog, a_CustomTable);
l_TableModifyPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
return l_TableModifyPanel;
}
 
/**
* Returns the EditPanelHolder clone
* @returnthe EditPanelHolder clone
*/
public EditPanelHolder getEditPanelHolderClone() {
return m_EditPanelHolderClone;
}
 
/**
* Returns the EditPanelHolder original
* @return the EditPanelHolder original
*/
public EditPanelHolder getEditPanelHolderOriginal() {
return m_EditPanelHolderOriginal;
}
 
/**
* Initializes TabbedDialog, this should be done _after_ adding all attributes/tabs
*/
public void initialize() {
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
m_MainPanel.setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.BOTH;
l_Constraints.weighty = 0.0;
l_Constraints.weightx = 1.0;
l_Constraints.gridwidth = GridBagConstraints.REMAINDER;
if (m_AttributesPanel != null) {
makeComponent(m_MainPanel, m_AttributesPanel, l_Gridbag, l_Constraints);
}
l_Constraints.weighty = 1.0;
if (m_TabbedPanel != null) {
makeComponent(m_MainPanel, m_TabbedPanel, l_Gridbag, l_Constraints);
}
l_Constraints.weighty = 0.0;
makeComponent(m_MainPanel, m_AcceptPanel, l_Gridbag, l_Constraints);
}
 
/**
* Returns the tab JPanel
* @param a_PanelTab the ShowPanel of the Tab
* @param a_EditDialog the EditDialog of the tab
* @return
*/
private JPanel initializeTab(ShowPanel a_PanelTab, JDialog a_EditDialog) {
JPanel l_JPanelTab = new JPanel(new GridBagLayout());
l_JPanelTab.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
l_JPanelTab.setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.BOTH;
l_Constraints.weighty = 1.0;
l_Constraints.weightx = 1.0;
l_Constraints.gridwidth = GridBagConstraints.REMAINDER;
a_PanelTab.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
makeComponent(l_JPanelTab, a_PanelTab, l_Gridbag, l_Constraints);
l_Constraints.weightx = 0.0;
JPanel l_ModifyPanel = createModifyPanel(a_EditDialog, a_PanelTab);
l_ModifyPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 0));
makeComponent(l_JPanelTab, l_ModifyPanel, l_Gridbag, l_Constraints);
return l_JPanelTab;
}
 
/**
* Returns the tab JPanel
* @param a_PanelTableTab the CustomTable of the Tab
* @param a_EditDialog the EditDialog of the tab
* @return
*/
private JPanel initializeTableTab(CustomTable a_PanelTableTab, JDialog a_EditDialog) {
JPanel l_JPanelTab = new JPanel(new GridBagLayout());
l_JPanelTab.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
GridBagLayout l_Gridbag = new GridBagLayout();
GridBagConstraints l_Constraints = new GridBagConstraints();
l_JPanelTab.setLayout(l_Gridbag);
l_Constraints.fill = GridBagConstraints.BOTH;
l_Constraints.weighty = 1.0;
l_Constraints.weightx = 1.0;
l_Constraints.gridwidth = GridBagConstraints.REMAINDER;
JScrollPane l_JScrollPane = new JScrollPane();
l_JScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
l_JScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
l_JScrollPane.getViewport().add(a_PanelTableTab);
makeComponent(l_JPanelTab, l_JScrollPane, l_Gridbag, l_Constraints);
l_Constraints.weightx = 1.0;
l_Constraints.weighty = 0.0;
l_Constraints.anchor = GridBagConstraints.LINE_END;
JPanel l_TableModifyPanel = createTableModifyPanel(a_EditDialog, a_PanelTableTab);
l_TableModifyPanel.setBorder(BorderFactory.createEmptyBorder());
makeComponent(l_JPanelTab, l_TableModifyPanel, l_Gridbag, l_Constraints);
return l_JPanelTab;
}
 
/**
* Helper method to ease the layout process
* @param a_Parent the parent component
* @param a_JChild the child component
* @param a_Gridbag the type of layout used for layouting this child in the parent
* @param a_Constraints the constraints added
*/
public void makeComponent(JComponent a_Parent, JComponent a_JChild, GridBagLayout a_Gridbag,
GridBagConstraints a_Constraints) {
a_Gridbag.setConstraints(a_JChild, a_Constraints);
a_Parent.add(a_JChild);
}
 
/**
* The attributepanels gets updated
*/
public void updateEditPanelHolder() {
Enumeration l_EnumInputPanels = m_InputPanels.elements();
Enumeration l_EnumAttributeObjects = m_AttributeObjects.elements();
DoublePanel l_InputPanel;
while (l_EnumInputPanels.hasMoreElements()) {
l_InputPanel = (DoublePanel) l_EnumInputPanels.nextElement();
if (l_InputPanel instanceof NCNamePanel) {
NCName l_NCName = (NCName) l_EnumAttributeObjects.nextElement();
l_NCName.update(((NCNamePanel) l_InputPanel).getNCName());
} else if (l_InputPanel instanceof QNamePanel) {
QName l_QName = (QName) l_EnumAttributeObjects.nextElement();
l_QName.update(((QNamePanel) l_InputPanel).getQName());
} else if (l_InputPanel instanceof BooleanExprPanel) {
BooleanExpr l_BooleanExpr = (BooleanExpr) l_EnumAttributeObjects.nextElement();
l_BooleanExpr.update(((BooleanExprPanel) l_InputPanel).getBooleanExpr());
} else if (l_InputPanel instanceof DurationExprPanel) {
DurationExpr l_DurationExpr = (DurationExpr) l_EnumAttributeObjects.nextElement();
l_DurationExpr.update(((DurationExprPanel) l_InputPanel).getDurationExpr());
} else if (l_InputPanel instanceof DeadlineExprPanel) {
DeadlineExpr l_DeadlineExpr = (DeadlineExpr) l_EnumAttributeObjects.nextElement();
l_DeadlineExpr.update(((DeadlineExprPanel) l_InputPanel).getDeadlineExpr());
} else if (l_InputPanel instanceof BooleanPanel) {
BPBoolean l_Boolean = (BPBoolean) l_EnumAttributeObjects.nextElement();
l_Boolean.update(((BooleanPanel) l_InputPanel).getBoolean());
} else if (l_InputPanel instanceof URIPanel) {
URI l_URI = (URI) l_EnumAttributeObjects.nextElement();
l_URI.update(((URIPanel) l_InputPanel).getURI());
} else if (l_InputPanel instanceof RolesPanel) {
Roles l_Roles = (Roles) l_EnumAttributeObjects.nextElement();
l_Roles.update(((RolesPanel) l_InputPanel).getRoles());
} else if (l_InputPanel instanceof BPStringPanel) {
BPString l_BPString = (BPString) l_EnumAttributeObjects.nextElement();
l_BPString.update(((BPStringPanel) l_InputPanel).getBPString());
}
}
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/utils/XMLUtils.java
New file
0,0 → 1,733
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.utils;
 
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.StringReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
 
import org.apache.xerces.parsers.DOMParser;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
 
/**
* The XMLUtils class contains utility methods for XML document en element manipulation.
*
* The selectors that can be passed to several of these methods consist of element names
* (qualified or unqualified) separated dots. Specific elements can be selected by appending a
* (zero-based) index between brackets to an element name. For example:
* "subelement.subsubelement[3].subsubsubelement".
* <br><br>
* Copyright (c) 2004, eMAXX B.V.
*
* @author A.K. Boerma [AKB]
* @author J.G. de Vries [JDV]
* @version $Revision: 1.1 $ $Date: 2005-01-17 12:01:01 $
*/
public final class XMLUtils {
 
/*
* Internal fields.
*/
private static final boolean NAME_CHECKING = true;
private static final boolean VALUE_CHECKING = true;
 
/*
* Private constructor.
*/
private XMLUtils() {
}
 
/**
* Converts the specified <code>document</code> to a String.
*
* @param document The document to convert.
* @return A string representation of the document.
* @throws DOMException If an error occurs while transforming the document to
* a string.
*/
public static String documentToString(Document document) throws DOMException {
return elementToString(document.getDocumentElement());
}
 
/**
* Tests <code>node1</code> and <code>node2</code> for equality. The nodes are deemed equal when
* type, name, value, all attributes and all children are equal. Note: attributes and children
* must be present in the same order.
*
* @param node1 The first node to use in the comparison.
* @param node2 The second node to use in the comparison.
* @return True if the both nodes are equal; false otherwise.
*/
public static boolean elementsEqual(Node node1, Node node2) {
 
// Check parameters and types.
if ((node1 == null) && (node2 == null)) {
return true;
} else if (((node1 == null) && (node2 != null)) || ((node1 != null) && (node2 == null))) {
return false;
}
 
if (node1.getNodeType() != node2.getNodeType()) {
return false;
}
 
// Check equality of name and value.
if (!safeEquals(node1.getNodeName(), node2.getNodeName())
|| !safeEquals(node1.getNodeValue(), node2.getNodeValue())) {
return false;
}
 
// Check equality of attributes.
if (((node1.getAttributes() == null) && (node2.getAttributes() != null))
|| ((node1.getAttributes() != null) && (node2.getAttributes() == null))) {
return false;
} else if ((node1.getAttributes() != null) && (node2.getAttributes() != null)) {
if (node1.getAttributes().getLength() == node2.getAttributes().getLength()) {
for (int i = 0; i < node1.getAttributes().getLength(); i++) {
Node attr1 = node1.getAttributes().item(i);
Node attr2 = node2.getAttributes().getNamedItem(attr1.getNodeName());
 
if (attr2 != null) {
if (!safeEquals(attr1.getNodeName(), attr2.getNodeName())
|| !safeEquals(attr1.getNodeValue(), attr2.getNodeValue())) {
return false;
}
} else {
return false;
}
}
}
}
 
// Check equality of children (recursively).
Node child1 = node1.getFirstChild();
Node child2 = node2.getFirstChild();
 
while ((child1 != null) || (child2 != null)) {
if (!elementsEqual(child1, child2)) {
return false;
}
 
child1 = child1.getNextSibling();
child2 = child2.getNextSibling();
}
 
return true;
}
 
/**
* Converts the specified <code>node</code> to a String.
*
* @param node The node to convert.
* @return A string representation of the element.
* @throws DOMException If an error occurs while transforming the element to
* a string.
* TODO: refactor to nodeToString.
*/
public static String elementToString(Node node) throws DOMException {
try {
TransformerFactory tf = TransformerFactory.newInstance();
Transformer optimusPrime = tf.newTransformer();
 
optimusPrime.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
optimusPrime.setOutputProperty(OutputKeys.METHOD, "xml");
optimusPrime.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
 
StreamResult result = new StreamResult(new ByteArrayOutputStream());
optimusPrime.transform(new DOMSource(node), result);
 
return result.getOutputStream().toString();
} catch (Exception e) {
throw new DOMException((short) -1, e.getMessage());
}
}
 
/**
* Returns the first child element of the specified <code>element</code> that has the specified
* <code>name</code>.
*
* @param element The element to search the children of.
* @param name The name of the element to return.
* @return The element with the specified name, null if no match was found.
*/
public static Element getChildElement(Element element, String name) {
return getChildElement(element, name, 0);
}
 
/**
* Returns the first child element of the specified <code>document</code> element that has the
* specified <code>name</code>.
*
* @param document The document to search the children of.
* @param name The name of the element to return.
* @return The element with the specified name, null if no match was found.
*/
public static Element getChildElement(Document document, String name) {
return getChildElement(document.getDocumentElement(), name, 0);
}
 
/**
* Returns the first child element of the specified <code>element</code> that has the specified
* <code>name</code> and an index of at least <code>fromIndex</code>.
*
* @param element The element to search the children of.
* @param name The name of the element to return.
* @param fromIndex The minimum index of the element.
* @return The element with the specified name, null if no match was found.
*/
public static Element getChildElement(Element element, String name, int fromIndex) {
 
for (int i = fromIndex; i < element.getChildNodes().getLength(); i++) {
if ((element.getChildNodes().item(i).getNodeType() == Node.ELEMENT_NODE)
&& (element.getChildNodes().item(i).getNodeName().equals(name) || element.getChildNodes().item(
i).getLocalName().equals(name))) {
return (Element) element.getChildNodes().item(i);
}
}
 
return null;
}
 
/**
* Returns all child elements of the specified <code>document</code> that have the specified
* <code>name</code>.
*
* @param document The document to search the children of.
* @param name The name of the element(s) to return.
* @return A list of elements with the specified name.
*/
public static NodeList getChildElements(Document document, String name) {
return getChildElements(document.getDocumentElement(), name);
}
 
/**
* Returns all child elements of the specified <code>element</code> that have the specified
* <code>name</code>.
*
* @param element The element to search the children of.
* @param name The name of the element(s) to return.
* @return A list of elements with the specified name.
* TODO: getElementsByTagName could return too many elements, the original method bombed.
*/
public static NodeList getChildElements(Element element, String name) {
NodeList list = element.getElementsByTagName(name);
 
if (list.getLength() == 0) {
list = element.getElementsByTagNameNS(element.getNamespaceURI(), name);
}
 
return list;
}
 
/**
* Returns all child elements of the specified <code>element</code> that have the specified
* <code>name</code>.
*
* @param element The element to search the children of.
* @param name The name of the element(s) to return.
* @return A list of elements with the specified name.
*/
public static NodeList getChildElements(Document document, String selector, String name) {
return getChildElements(getSubElement(document.getDocumentElement(), selector), name);
}
 
/**
* Returns all child elements of the specified <code>element</code> that have the specified
* <code>name</code>.
*
* @param element The element to search the children of.
* @param name The name of the element(s) to return.
* @return A list of elements with the specified name.
*/
public static NodeList getChildElements(Element element, String selector, String name) {
return getChildElements(getSubElement(element, selector), name);
}
 
/**
*
* @param element
* @param selector
* @param value
*/
public static void setElementText(Element element, String selector, String value) {
setElementText(getSubElement(element, selector), value);
}
 
/**
* Sets the text of the specified <code>element</code> to <code>value</code>.
*
* @param element The element to set the text of.
* @param value The new text.
*/
public static void setElementText(Element element, String value) {
 
if ((element.getChildNodes().getLength() == 1)
&& (element.getChildNodes().item(0).getNodeType() == Node.TEXT_NODE)) {
Text text = (Text) element.getChildNodes().item(0);
text.setData(value);
} else {
element.appendChild(element.getOwnerDocument().createTextNode(value));
}
}
 
/**
*
* @param document
* @param selector
* @return
*/
public static String getElementText(Document document, String selector) {
return getElementText(getSubElement(document, selector));
}
 
/**
*
* @param element
* @param selector
* @return
*/
public static String getElementText(Element element, String selector) {
return getElementText(getSubElement(element, selector));
}
 
/**
* Returns the text of the specified <code>element</code>.
*
* @param element The element to return the text of.
* @return The text of the element, or an empty string if no text was found.
*/
public static String getElementText(Element element) {
 
if ((element.getChildNodes().getLength() == 1)
&& (element.getChildNodes().item(0).getNodeType() == Node.TEXT_NODE)) {
Text text = (Text) element.getChildNodes().item(0);
 
return (text.getData() != null) ? text.getData() : "";
}
 
return "";
}
 
/**
* Sets the prefix of the specified <code>element</code>, and all it's descendants, to the
* specified <code>prefix</code>.
*
* @param element The root element.
* @param prefix The prefix.
*/
public static void setPrefixRecusive(Element element, String prefix) {
 
element.setPrefix(prefix);
for (int i = 0; i < element.getChildNodes().getLength(); i++) {
if (element.getChildNodes().item(i).getNodeType() == Node.ELEMENT_NODE) {
Element child = (Element) element.getChildNodes().item(i);
setPrefixRecusive(child, prefix);
}
}
}
 
/**
* Returns the sub element of the specified <code>document</code> that matches the specified
* <code>selector</code>. See above for more details on the format of the selector.
*
* @param parent The document used as root of the search.
* @param selector The selector.
* @return The requested sub element.
* @throws DOMException If the requested sub element was not found.
*/
public static Element getSubElement(Document document, String selector) throws DOMException {
return getSubElement(document.getDocumentElement(), selector);
}
 
/**
* Returns the sub element of the specified <code>parent</code> element that matches the
* specified <code>selector</code>. See above for more details on the format of the selector.
*
* @param parent The element used as root of the search.
* @param selector The selector.
* @return The requested sub element.
* @throws DOMException If the requested sub element was not found.
*/
public static Element getSubElement(Element parent, String selectorString) throws DOMException {
 
try {
int fromIndex = 0;
int dotPosition = 0;
Element subElement = parent;
Pattern pattern = Pattern.compile("([a-zA-Z]{1}[a-zA-Z_0-9$]*)(\\[(\\d+)\\])*");
Matcher matcher = null;
 
while (dotPosition < selectorString.length()) {
dotPosition = selectorString.indexOf(".", fromIndex);
dotPosition = (dotPosition == -1) ? selectorString.length() : dotPosition;
matcher = pattern.matcher(selectorString.substring(fromIndex, dotPosition));
 
if (matcher.lookingAt()) {
String elementName = matcher.group(1);
NodeList list = subElement.getElementsByTagName(elementName);
list = (list.getLength() == 0) ? subElement.getElementsByTagNameNS(
subElement.getNamespaceURI(), elementName) : list;
 
if (matcher.group(2) != null) {
subElement = (Element) list.item(new Integer(matcher.group(3)).intValue());
} else {
subElement = (Element) list.item(0);
}
}
 
fromIndex = dotPosition + 1;
}
 
return subElement;
} catch (Exception e) {
throw new DOMException((short) -1, e.getMessage());
}
}
 
/**
* Sets the CDATA of the first sub element of the specified <code>document</code> that matches
* the specified <code>selector</code> to <code>value</code>. See above for more details on the
* format of the selector.
*
* @param document The document used as root of the search.
* @param selector The selector.
* @return The requested sub element.
* @throws DOMException If the requested sub element was not found.
*/
public static void setSubElementCData(Document document, String selector, String value)
throws DOMException {
setSubElementCData(document.getDocumentElement(), selector, value);
}
 
/**
* Sets the CDATA of the first sub element of the specified <code>element</code> that matches
* the specified <code>selector</code> to <code>value</code>. See above for more details on the
* format of the selector.
*
* @param element The element used as root of the search.
* @param selector The selector.
* @param value The value to set.
* @throws DOMException If the requested sub element was not found.
*/
public static void setSubElementCData(Element element, String selector, String value)
throws DOMException {
Element parent = (selector == null) ? element : getSubElement(element, selector);
 
if (parent != null) {
while (parent.getChildNodes().getLength() > 0) {
parent.removeChild(parent.getChildNodes().item(0));
}
 
if (value != null) {
parent.appendChild(element.getOwnerDocument().createCDATASection(value));
} else {
parent.appendChild(element.getOwnerDocument().createCDATASection(value));
}
}
}
 
/**
* Gets the CDATA of the first sub element of the specified <code>document</code> that matches
* the specified <code>selector</code> to <code>value</code>. See above for more details on the
* format of the selector.
*
* @param document The document used as root of the search.
* @param selector The selector.
* @return The value of the CDATA sub element if it exists, null otherwise.
* @throws DOMException If the requested sub element was not found.
*/
public static String getSubElementCData(Document document, String selector) throws DOMException {
return getSubElementCData(document.getDocumentElement(), selector);
}
 
/**
* Gets the CDATA of the first sub element of the specified <code>element</code> that matches
* the specified <code>selector</code> to <code>value</code>. See above for more details on the
* format of the selector.
*
* @param element The element used as root of the search.
* @param selector The selector.
* @return The value of the CDATA sub element if it exists, null otherwise.
* @throws DOMException If the requested sub element was not found.
*/
public static String getSubElementCData(Element element, String selector) throws DOMException {
Element parent = (selector == null) ? element : getSubElement(element, selector);
 
if ((parent != null) && (parent.getChildNodes().getLength() > 0)) {
return parent.getChildNodes().item(0).getNodeValue();
}
 
return null;
}
 
/**
* Sets the text of the first sub element of the specified <code>document</code> that matches
* the specified <code>selector</code> to <code>value</code>. See above for more details on the
* format of the selector.
*
* @param parent The document used as root of the search.
* @param selector The selector.
* @return The requested sub element.
* @throws DOMException If the requested sub element was not found.
*/
public static void setSubElementText(Document document, String selector, String value)
throws DOMException {
setElementText(getSubElement(document.getDocumentElement(), selector), value);
}
 
/**
* Sets the text of the first sub element of the specified <code>parent</code> element that
* matches the specified <code>selector</code> to <code>value</code>. See above for more details
* on the format of the selector.
*
* @param parent The root element used in the search.
* @param selector The search path string.
* @param value The new text.
* @throws DOMException If the requested sub element was not found.
*/
public static void setSubElementText(Element parent, String selector, String value)
throws DOMException {
setElementText(getSubElement(parent, selector), value);
}
 
/**
* Returns the text of the sub element of the specified <code>document</code> that matches the
* specified <code>selector</code>. See above for more details on the format of the selector.
*
* @param parent The root element used in the search.
* @param selector The search path string.
* @return The text of the sub element.
* @throws DOMException If the requested sub element was not found.
*/
public static String getSubElementText(Document document, String selector) throws DOMException {
return getElementText(getSubElement(document.getDocumentElement(), selector));
}
 
/**
* Returns the text of the sub element of the specified <code>parent</code> element that matches
* the specified <code>selector</code>. See above for more details on the format of the selector.
*
* @param parent The root element used in the search.
* @param selector The search path string.
* @return The text of the sub element.
* @throws DOMException If the requested sub element was not found.
*/
public static String getSubElementText(Element parent, String selector) throws DOMException {
return getElementText(getSubElement(parent, selector));
}
 
/**
* Sets the XML of the first sub element of the specified <code>document</code> that matches
* the specified <code>selector</code> to <code>value</code>. See above for more details on the
* format of the selector.
*
* @param parent The document used as root of the search.
* @param selector The selector.
* @param value The new XML.
* @throws DOMException If the requested sub element was not found.
*/
public static void setSubElementXML(Document document, String selector, String value)
throws DOMException {
setSubElementXML(document.getDocumentElement(), selector, value);
}
 
/**
* Sets the XML of the first sub element of the specified <code>parent</code> element that
* matches the specified <code>selector</code> to <code>value</code>. See above for more details
* on the format of the selector.
*
* @param parent The root element used in the search.
* @param selector The selector.
* @param value The new XML.
* @throws DOMException If the requested sub element was not found.
*/
public static void setSubElementXML(Element parent, String selector, String value)
throws DOMException {
 
try {
Element element = getSubElement(parent, selector);
 
for (int i = element.getChildNodes().getLength() - 1; i >= 0; i--) {
element.removeChild(element.getChildNodes().item(i));
}
 
Document document = parse(value, false);
element.appendChild(element.getOwnerDocument().importNode(
document.getDocumentElement(), true));
} catch (IOException ioe) {
throw new DOMException((short) -1, ioe.getMessage());
} catch (SAXException se) {
throw new DOMException((short) -1, se.getMessage());
}
}
 
/**
* Returns the XML of the sub element of the specified <code>document</code> that matches the
* specified <code>selector</code>. See above for more details on the format of the selector.
*
* @param parent The root element used in the search.
* @param selector The search path string.
* @return The XML of the sub element.
* @throws DOMException If the requested sub element was not found.
*/
public static String getSubElementXML(Document document, String selector) throws DOMException {
return getSubElementXML(document.getDocumentElement(), selector);
}
 
/**
* Returns the XML of the sub element of the specified <code>parent</code> element that matches
* the specified <code>selector</code>. See above for more details on the format of the selector.
*
* @param parent The root element used in the search.
* @param selector The search path string.
* @return The XML of the sub element.
* @throws DOMException If the requested sub element was not found.
*/
public static String getSubElementXML(Element parent, String selector) throws DOMException {
StringBuffer result = new StringBuffer();
Element element = getSubElement(parent, selector);
 
for (int i = 0; i < element.getChildNodes().getLength(); i++) {
result.append(elementToString(element.getChildNodes().item(i)));
}
 
return result.toString();
}
 
/**
* Returns a new empty document.
*
* @return A Document.
*/
public static Document newDocument() {
 
try {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
return builder.newDocument();
} catch (ParserConfigurationException e) {
return null;
}
}
 
/**
*
* @param xml
* @param validate
* @return
* @throws SAXException
* @throws IOException
*/
public final static Document parse(String xml, boolean validate) throws SAXException,
IOException {
DOMParser parser = new DOMParser();
 
parser.setFeature("http://xml.org/sax/features/validation", validate);
parser.setFeature("http://apache.org/xml/features/validation/schema", validate);
parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking",
validate);
 
//parser.setEntityResolver(new ProcessEntityResolver());
//parser.setErrorHandler(new ProcessErrorHandler());
parser.parse(new InputSource(new StringReader(xml)));
 
return parser.getDocument();
}
 
/**
* Removes all children of the specified <code>element</code>.
*
* @param element The element to remove the children of.
*/
public static void removeChildren(Element element) {
 
for (int i = element.getChildNodes().getLength() - 1; i >= 0; i--) {
element.removeChild(element.getChildNodes().item(i));
}
}
 
/**
* Removes the specified <code>element</code> from the list of child nodes of its parent.
*
* @param element The element to remove.
*/
public static void removeElement(Element element) {
element.getParentNode().removeChild(element);
}
 
/**
* Removes the first sub element of the specified <code>parent</code> element that matches the
* specified <code>selector</code>. The removed element is returned. See above for more details
* on the format of the selector.
*
* @param parent The parent of the element to remove.
* @param selector The selector of the element to remove.
* @return The removed element.
*/
public static Element removeElement(Element parent, String selector) {
Element result = getSubElement(parent, selector);
 
if (result != null) {
parent.removeChild(result);
}
 
return result;
}
 
/**
* Returns true if <code>object1</code> is equal to <code>object2</code>, false otherwise. The
* two objects are deemed to be equal when:
* (1) They are both null.
* (2) The are equal according to equals method of object1.
*
* @param object1 The first object to compare.
* @param object2 The second object to compare.
* @return True if the objects are equal; false otherwise.
*/
private static final boolean safeEquals(Object object1, Object object2) {
 
if ((object1 == null) && (object2 == null)) {
return true;
} else if (((object1 == null) && (object2 != null))
|| ((object1 != null) && (object2 == null))) {
return false;
}
 
return object1.equals(object2);
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/To.java
New file
0,0 → 1,79
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
 
/**
* Represents the BPEL To element, BPEL To Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class To extends From {
 
public To() {
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("to");
addXMLattribute(l_Element, "variable", getVariable().toXML());
addXMLattribute(l_Element, "part", getPart().toXML());
addXMLattribute(l_Element, "query", getQuery().toXML());
addXMLattribute(l_Element, "property", getProperty().toXML());
addXMLattribute(l_Element, "partnerLink", getPartnerLink().toXML());
return l_Element;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
From l_From = (To) this.clone();
ShowPanel l_ShowPanel = new ShowPanel("To", l_From, this);
l_ShowPanel.addAttribute(l_From.getVariable(), "Variable");
l_ShowPanel.addAttribute(l_From.getPart(), "Part");
l_ShowPanel.addAttribute(l_From.getQuery(), "Query");
l_ShowPanel.addAttribute(l_From.getProperty(), "Property");
l_ShowPanel.addAttribute(l_From.getPartnerLink(), "PartnerLink");
return l_ShowPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
From l_From = (From) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("To", l_From, this, a_ShowPanel);
l_EditPanel.addAttribute(l_From.getVariable(), "Variable");
l_EditPanel.addAttribute(l_From.getPart(), "Part");
l_EditPanel.addAttribute(l_From.getQuery(), "Query");
l_EditPanel.addAttribute(l_From.getProperty(), "Property");
l_EditPanel.addAttribute(l_From.getPartnerLink(), "PartnerLink");
return l_EditPanel;
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Roles.java
New file
0,0 → 1,77
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.io.Serializable;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.DeepCopy;
 
/**
* This class represents the Roles BPEL-type
*/
public class Roles implements Serializable, Cloneable {
 
private BPString m_Role = new BPString();
 
public Roles() {
}
 
public Object clone() {
try {
return DeepCopy.deepCopy(this);
} catch (Exception e) {
System.out.println("Caught an exception while cloning");
return null;
}
}
 
public void update(Roles a_Roles) {
m_Role = a_Roles.getRole();
}
 
public Roles(String a_Role) {
m_Role = new BPString(a_Role);
}
 
public Roles(BPString a_Role) {
m_Role = a_Role;
}
 
public BPString getRole() {
return m_Role;
}
 
public void setRole(BPString a_Role) {
m_Role = a_Role;
}
 
public String toString() {
return m_Role.toString();
}
 
/**
* Returns this attribute in XML-value
* @return this attribute in XML-value
*/
public String toXML() {
return m_Role.toXML();
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/OnAlarm.java
New file
0,0 → 1,161
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL OnAlarm element, BPEL OnAlarm Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class OnAlarm extends ActivityContainer implements EditPanelHolder {
 
private DurationExpr m_For = new DurationExpr();
private DeadlineExpr m_Until = new DeadlineExpr();
 
public OnAlarm() {
}
 
public OnAlarm(DurationExpr a_For, DeadlineExpr a_Until) {
m_For = a_For;
m_Until = a_Until;
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_OnAlarm the instance with the data that should be updated into this instance
*/
public void update(OnAlarm a_OnAlarm) {
super.update(a_OnAlarm);
getFor().update((a_OnAlarm.getFor()));
getUntil().update(a_OnAlarm.getUntil());
}
 
public DurationExpr getFor() {
return m_For;
}
 
public DeadlineExpr getUntil() {
return m_Until;
}
 
public void setFor(DurationExpr a_For) {
m_For = a_For;
return;
}
 
public void setUntil(DeadlineExpr a_Until) {
m_Until = a_Until;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("for")) {
setFor(new DurationExpr(l_CurrentValue));
} else if (l_CurrentName.equals("until")) {
setUntil(new DeadlineExpr(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_OnAlarmClone) {
if (a_OnAlarmClone instanceof OnAlarm) {
OnAlarm l_OnAlarm = (OnAlarm) a_OnAlarmClone;
m_For = l_OnAlarm.getFor();
m_Until = l_OnAlarm.getUntil();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
OnAlarm l_OnAlarm = (OnAlarm) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("OnAlarm", l_OnAlarm, this, a_ShowPanel);
l_EditPanel.addAttribute(l_OnAlarm.getFor(), "For");
l_EditPanel.addAttribute(l_OnAlarm.getUntil(), "Until");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("onAlarm");
super.writeToXML(a_Document, l_Element);
addXMLattribute(l_Element, "for", getFor().toXML());
addXMLattribute(l_Element, "until", getUntil().toXML());
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/PartnerLink.java
New file
0,0 → 1,222
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Vector;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.emaxx.bpeldesigner.input.Tableable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL PartnerLink element, BPEL PartnerLink Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class PartnerLink extends ExtensibleElements implements Tableable, EditPanelHolder {
 
private NCName m_Name = new NCName();
private QName m_PartnerLinkType = new QName();
private NCName m_MyRole = new NCName();
private NCName m_PartnerRole = new NCName();
 
public PartnerLink() {
 
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.Tableable#getRow()
*/
public Vector getRow() {
Vector l_Vector = new Vector();
l_Vector.add(m_Name.toString());
l_Vector.add(m_PartnerLinkType.toString());
return l_Vector;
}
 
public static Vector getColumnNames() {
Vector l_Vector = new Vector();
l_Vector.add("Name*");
l_Vector.add("PartnerLinkType*");
return l_Vector;
}
 
public NCName getName() {
return m_Name;
}
 
public QName getPartnerLinkType() {
return m_PartnerLinkType;
}
 
public NCName getMyRole() {
return m_MyRole;
}
 
public NCName getPartnerRole() {
return m_PartnerRole;
}
 
public void setName(NCName a_Name) {
m_Name = a_Name;
return;
}
 
public void setPartnerLinkType(QName a_PartnerLinkType) {
m_PartnerLinkType = a_PartnerLinkType;
return;
}
 
public void setMyRole(NCName a_MyRole) {
m_MyRole = a_MyRole;
return;
}
 
public void setPartnerRole(NCName a_PartnerRole) {
m_PartnerRole = a_PartnerRole;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("name")) {
setName(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("partnerLinkType")) {
setPartnerLinkType(new QName(l_CurrentValue));
} else if (l_CurrentName.equals("myRole")) {
setMyRole(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("partnerRole")) {
setPartnerRole(new NCName(l_CurrentValue));
}
}
}
 
public String toString() {
if (m_Name != null) {
return m_Name.getName();
} else {
return "";
}
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_PartnerLink the instance with the data that should be updated into this instance
*/
public void update(PartnerLink a_PartnerLink) {
super.update(a_PartnerLink);
getName().update((a_PartnerLink.getName()));
getPartnerLinkType().update(a_PartnerLink.getPartnerLinkType());
getMyRole().update(a_PartnerLink.getMyRole());
getPartnerRole().update(a_PartnerLink.getPartnerRole());
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
TabbedDialog l_EditPanel = new TabbedDialog("PartnerLink", this, this, a_CustomTable, true);
l_EditPanel.addAttribute(this.getName(), "Name*");
l_EditPanel.addAttribute(this.getPartnerLinkType(), "PartnerLinkType*");
l_EditPanel.addAttribute(this.getMyRole(), "MyRole");
l_EditPanel.addAttribute(this.getPartnerRole(), "PartnerRole");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
PartnerLink l_PartnerLink = (PartnerLink) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("PartnerLink", l_PartnerLink, this,
a_CustomTable, false);
l_EditPanel.addAttribute(l_PartnerLink.getName(), "Name*");
l_EditPanel.addAttribute(l_PartnerLink.getPartnerLinkType(), "PartnerLinkType*");
l_EditPanel.addAttribute(l_PartnerLink.getMyRole(), "MyRole");
l_EditPanel.addAttribute(l_PartnerLink.getPartnerRole(), "PartnerRole");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_PartnerLinkClone) {
if (a_PartnerLinkClone instanceof PartnerLink) {
PartnerLink l_PartnerLink = (PartnerLink) a_PartnerLinkClone;
m_Name = l_PartnerLink.getName();
m_PartnerLinkType = l_PartnerLink.getPartnerLinkType();
m_MyRole = l_PartnerLink.getMyRole();
m_PartnerRole = l_PartnerLink.getPartnerRole();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("partnerLink");
addXMLattribute(l_Element, "name", getName().toXML());
addXMLattribute(l_Element, "partnerLinkType", getPartnerLinkType().toXML());
addXMLattribute(l_Element, "myRole", getMyRole().toXML());
addXMLattribute(l_Element, "partnerRole", getPartnerRole().toXML());
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Reply.java
New file
0,0 → 1,202
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
 
/**
* Represents the BPEL Reply element, BPEL Reply Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Reply extends Activity implements ActivityGroup {
 
private Correlations m_Correlations = new Correlations();
private NCName m_PartnerLink = new NCName();
private QName m_PortType = new QName();
private NCName m_Operation = new NCName();
private NCName m_Variable = new NCName();
private QName m_FaultName = new QName();
 
public Reply() {
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Reply the instance with the data that should be updated into this instance
*/
public void update(Reply a_Reply) {
super.update(a_Reply);
getCorrelations().update(a_Reply.getCorrelations());
getPartnerLink().update(a_Reply.getPartnerLink());
getPortType().update(a_Reply.getPortType());
getOperation().update(a_Reply.getOperation());
getVariable().update(a_Reply.getVariable());
getFaultName().update(a_Reply.getFaultName());
}
 
public Correlations getCorrelations() {
return m_Correlations;
}
 
public NCName getPartnerLink() {
return m_PartnerLink;
}
 
public QName getPortType() {
return m_PortType;
}
 
public NCName getOperation() {
return m_Operation;
}
 
public NCName getVariable() {
return m_Variable;
}
 
public QName getFaultName() {
return m_FaultName;
}
 
public void setCorrelations(Correlations a_Correlations) {
m_Correlations = a_Correlations;
return;
}
 
public void setPartnerLink(NCName a_PartnerLink) {
m_PartnerLink = a_PartnerLink;
return;
}
 
public void setPortType(QName a_PortType) {
m_PortType = a_PortType;
return;
}
 
public void setOperation(NCName a_Operation) {
m_Operation = a_Operation;
return;
}
 
public void setVariable(NCName a_Variable) {
m_Variable = a_Variable;
return;
}
 
public void setFaultName(QName a_FaultName) {
m_FaultName = a_FaultName;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("partnerLink")) {
setPartnerLink(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("portType")) {
setPortType(new QName(l_CurrentValue));
} else if (l_CurrentName.equals("operation")) {
setOperation(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("variable")) {
setVariable(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("faultName")) {
setFaultName(new QName(l_CurrentValue));
}
}
 
NodeList children = a_Node.getChildNodes();
if (children != null) {
for (int i = 0; i < children.getLength(); i++) {
String l_TempNodeName = children.item(i).getNodeName();
if (l_TempNodeName.equals("correlations")) {
Correlations l_Correlations = new Correlations();
l_Correlations.handleParse(children.item(i));
setCorrelations(l_Correlations);
}
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_ReplyClone) {
if (a_ReplyClone instanceof Reply) {
super.saveEditPanel(a_ReplyClone);
Reply l_Reply = (Reply) a_ReplyClone;
m_Correlations = l_Reply.getCorrelations();
m_PartnerLink = l_Reply.getPartnerLink();
m_PortType = l_Reply.getPortType();
m_Operation = l_Reply.getOperation();
m_Variable = l_Reply.getVariable();
m_FaultName = l_Reply.getFaultName();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
TabbedDialog l_EditPanel = super.getShowEditPanel(a_ShowPanel);
Reply l_Reply = (Reply) l_EditPanel.getEditPanelHolderClone();
l_EditPanel.addAttribute(l_Reply.getPartnerLink(), "PartnerLink*");
l_EditPanel.addAttribute(l_Reply.getPortType(), "PortType*");
l_EditPanel.addAttribute(l_Reply.getOperation(), "Operation*");
l_EditPanel.addAttribute(l_Reply.getVariable(), "Variable");
l_EditPanel.addAttribute(l_Reply.getFaultName(), "FaultName");
l_EditPanel.addTab(l_Reply.getCorrelations());
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("reply");
super.writeToXML(a_Document, l_Element);
addXMLattribute(l_Element, "partnerLink", getPartnerLink().toXML());
addXMLattribute(l_Element, "portType", getPortType().toXML());
addXMLattribute(l_Element, "operation", getOperation().toXML());
addXMLattribute(l_Element, "variable", getVariable().toXML());
addXMLattribute(l_Element, "faultName", getFaultName().toXML());
addXMLChild(l_Element, getCorrelations().writeToXML(a_Document));
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/FaultHandlers.java
New file
0,0 → 1,143
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Enumeration;
import java.util.Vector;
 
import org.emaxx.bpeldesigner.bpel.figures.BPELActivityOrCompensateContainerFigure;
import org.emaxx.bpeldesigner.bpel.figures.BPELCatchFigure;
import org.emaxx.bpeldesigner.bpel.standard.BPELDrawing;
import org.emaxx.bpeldesigner.bpel.standard.BPELFigureHolder;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
 
/**
* Represents the BPEL FaultHandlers element, BPEL FaultHandlers Nodes can be converted to this class.
* This class supports certain modifying attributes. This class can be saved to a BPEL Node.
*/
public class FaultHandlers extends ExtensibleElements {
 
private BPELDrawing m_Drawing;
private Vector m_Catch = new Vector();
private ActivityOrCompensateContainer m_CatchAll = new ActivityOrCompensateContainer();
 
public FaultHandlers() {
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ExtensibleElements#getBPELDrawing(CH.ifa.draw.standard.BPELFigureHolder)
*/
public BPELDrawing getBPELDrawing(BPELFigureHolder a_BPELFigureHolder) {
if (m_Drawing == null) {
if (a_BPELFigureHolder.getHolderParent() != null) {
m_Drawing = new BPELDrawing(a_BPELFigureHolder,
a_BPELFigureHolder.getHolderParent().getBPELDrawing().getRootDocument());
} else {
m_Drawing = new BPELDrawing(a_BPELFigureHolder, null);
}
if (this.getCatchAll() != null) {
BPELActivityOrCompensateContainerFigure l_ActivityOrCompensateContainerFigure = new BPELActivityOrCompensateContainerFigure();
l_ActivityOrCompensateContainerFigure.setActivityOrCompensateContainer(this.getCatchAll());
m_Drawing.add(l_ActivityOrCompensateContainerFigure);
}
if (this.getCatch() != null) {
Enumeration l_Enum = this.getCatch().elements();
while (l_Enum.hasMoreElements()) {
BPELCatchFigure l_CatchFigure = new BPELCatchFigure();
l_CatchFigure.setCatch((Catch) l_Enum.nextElement());
m_Drawing.add(l_CatchFigure);
}
}
}
return m_Drawing;
}
 
public ActivityOrCompensateContainer getCatchAll() {
return m_CatchAll;
}
 
public void setCatchAll(ActivityOrCompensateContainer a_CatchAll) {
m_CatchAll = a_CatchAll;
return;
}
 
public void addCatch(Catch a_Catch) {
m_Catch.add(a_Catch);
}
 
public boolean removeCatch(Catch a_Catch) {
return m_Catch.remove(a_Catch);
}
 
public Vector getCatch() {
return m_Catch;
}
 
public void setCatch(Vector a_Catch) {
m_Catch = a_Catch;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NodeList children = a_Node.getChildNodes();
if (children != null) {
for (int i = 0; i < children.getLength(); i++) {
String l_TempNodeName = children.item(i).getNodeName();
if (l_TempNodeName.equals("catch")) {
Catch l_Catch = new Catch();
l_Catch.handleParse(children.item(i));
addCatch(l_Catch);
} else if (l_TempNodeName.equals("ActivityOrCompensateContainer")) {
ActivityOrCompensateContainer l_ActivityOrCompensateContainer = new ActivityOrCompensateContainer();
l_ActivityOrCompensateContainer.handleParse(children.item(i));
setCatchAll(l_ActivityOrCompensateContainer);
}
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("faultHandlers");
Enumeration l_Enum = getCatch().elements();
while (l_Enum.hasMoreElements()) {
addXMLChild(l_Element, ((Catch) l_Enum.nextElement()).writeToXML(a_Document));
}
addXMLChild(l_Element, getCatchAll().writeToXML(a_Document));
if (l_Element.hasChildNodes()) {
return l_Element;
} else {
return null;
}
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Compensate.java
New file
0,0 → 1,115
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL Compensate element, BPEL Compensate Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Compensate extends Activity {
 
private NCName m_Scope = new NCName();
 
public Compensate() {
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Compensate the instance with the data that should be updated into this instance
*/
public void update(Compensate a_Compensate) {
super.update(a_Compensate);
getScope().update(a_Compensate.getScope());
}
 
public Compensate(NCName a_Scope) {
m_Scope = a_Scope;
}
 
public NCName getScope() {
return m_Scope;
}
 
public void setScope(NCName a_Scope) {
m_Scope = a_Scope;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("scope")) {
setScope(new NCName(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_CompensateClone) {
super.saveEditPanel(a_CompensateClone);
if (a_CompensateClone instanceof Compensate) {
Compensate l_Compensate = (Compensate) a_CompensateClone;
m_Scope = l_Compensate.getScope();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
TabbedDialog l_EditPanel = super.getShowEditPanel(a_ShowPanel);
l_EditPanel.addAttribute(((Compensate) l_EditPanel.getEditPanelHolderClone()).getScope(),
"ScopeName");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("compensate");
super.writeToXML(a_Document, l_Element);
addXMLattribute(l_Element, "scope", getScope().toXML());
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/ParseAble.java
New file
0,0 → 1,46
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
 
/**
* Implementing this interface means that you can parse a XML-node, extract
* its information and have the ability to write information to a XML-node again
*/
public interface ParseAble {
 
/**
* Parse a Node and extract the information
* @param a_Node this Node should be parsed
*/
public void handleParse(Node a_Node);
 
/**
* Convert the class to an XML-element
* @param a_Document The general document in which this element is placed
* @return The XML-element
*/
public Element writeToXML(Document a_Document);
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/URI.java
New file
0,0 → 1,83
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.io.Serializable;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.DeepCopy;
 
/**
* This class represents the URI BPEL-type
*/
public class URI implements Cloneable, Serializable {
 
private String m_URI = new String("");
 
public URI() {
}
 
public URI(String a_URI) {
m_URI = a_URI;
}
 
public String getURI() {
return m_URI;
}
 
public void setURI(String a_URI) {
m_URI = a_URI;
}
 
public Object clone() {
try {
return DeepCopy.deepCopy(this);
} catch (Exception e) {
System.out.println("Caught an exception while cloning");
return null;
}
}
 
public void update(URI a_URI) {
m_URI = a_URI.getURI();
}
 
public String toString() {
if (m_URI != null) {
return m_URI;
}
return "";
}
 
/**
* Returns this attribute in XML-value
* @return this attribute in XML-value
*/
public String toXML() {
if (m_URI != null) {
if (m_URI.equals("")) {
return null;
} else {
return m_URI;
}
}
return null;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/ExtensibleElements.java
New file
0,0 → 1,110
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.io.Serializable;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.DeepCopy;
import org.emaxx.bpeldesigner.bpel.standard.BPELDrawing;
import org.emaxx.bpeldesigner.bpel.standard.BPELFigureHolder;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
 
/**
* This class is the superclass of all BPEL-elements.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class ExtensibleElements implements ParseAble, Serializable {
 
public ExtensibleElements() {
}
 
public Object clone() {
try {
return DeepCopy.deepCopy(this);
} catch (Exception e) {
e.printStackTrace();
e.toString();
System.out.println("Caught an exception while cloning");
return null;
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
 
}
 
/**
* Returns an existing or new BPELDrawing if the BPELFigureHolder can contain a BPELDrawing,
* returns null otherwise
* @param a_BPELFigureHolder the figure that contains this Element
* @return an existing or new BPELDrawing if the BPELFigureHolder can contain a BPELDrawing,
* returns null otherwise
*/
public BPELDrawing getBPELDrawing(BPELFigureHolder a_BPELFigureHolder) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
return null;
}
 
/**
* Empty method to update the specific BPEL-element
* Updating in this case means transferring the data but holding the references
* @param a_ExtensibleElements the instance which contains the data that this instance needs to get
*/
public void update(ExtensibleElements a_ExtensibleElements) {
}
 
/**
* This method adds a XML-element to another (parent) XML-element
* @param a_ParentElement the parent Element
* @param a_ChildElement the child Element
*/
public void addXMLChild(Element a_ParentElement, Element a_ChildElement) {
if (a_ChildElement != null) {
a_ParentElement.appendChild(a_ChildElement);
}
}
 
/**
* This method adds an attribute to a XML-element
* @param a_ParentElement the XML-element to which the attribute is added
* @param a_AttributeName the attribute name
* @param a_Attribute the attribute value
*/
public void addXMLattribute(Element a_ParentElement, String a_AttributeName, String a_Attribute) {
if (a_AttributeName != null && a_Attribute != null) {
if ((!a_AttributeName.equals("")) && (!a_Attribute.equals(""))) {
a_ParentElement.setAttribute(a_AttributeName, a_Attribute);
}
}
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Source.java
New file
0,0 → 1,179
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Vector;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.emaxx.bpeldesigner.input.Tableable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL Source element, BPEL Source Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Source extends ExtensibleElements implements EditPanelHolder, Tableable {
 
private NCName m_LinkName = new NCName();
private BooleanExpr m_TransitionCondition = new BooleanExpr();
 
public Source() {
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Source the instance with the data that should be updated into this instance
*/
public void update(Source a_Source) {
super.update(a_Source);
getLinkName().update((a_Source.getLinkName()));
getTransitionCondition().update(a_Source.getTransitionCondition());
}
 
public NCName getLinkName() {
return m_LinkName;
}
 
public BooleanExpr getTransitionCondition() {
return m_TransitionCondition;
}
 
public void setLinkName(NCName a_LinkName) {
m_LinkName = a_LinkName;
return;
}
 
public void setTransitionCondition(BooleanExpr a_TransitionCondition) {
m_TransitionCondition = a_TransitionCondition;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("linkName")) {
setLinkName(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("transitionCondition")) {
setTransitionCondition(new BooleanExpr(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_SourceClone) {
if (a_SourceClone instanceof Source) {
Source l_Source = (Source) a_SourceClone;
m_LinkName = l_Source.getLinkName();
m_TransitionCondition = l_Source.getTransitionCondition();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.Tableable#getRow()
*/
public Vector getRow() {
Vector l_Vector = new Vector();
l_Vector.add(m_LinkName.toString());
l_Vector.add(m_TransitionCondition.toString());
return l_Vector;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
Source l_Source = (Source) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("Source", l_Source, this, a_CustomTable, false);
l_EditPanel.addAttribute(l_Source.getLinkName(), "LinkName*");
l_EditPanel.addAttribute(l_Source.getTransitionCondition(), "TransitionCondition");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
 
public static Vector getColumnNames() {
Vector l_Vector = new Vector();
l_Vector.add("LinkName*");
l_Vector.add("TransitionCondition");
return l_Vector;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
TabbedDialog l_EditPanel = new TabbedDialog("Source", this, this, a_CustomTable, true);
l_EditPanel.addAttribute(this.getLinkName(), "LinkName*");
l_EditPanel.addAttribute(this.getTransitionCondition(), "TransitionCondition");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("source");
addXMLattribute(l_Element, "linkName", getLinkName().toXML());
addXMLattribute(l_Element, "transitionCondition", getTransitionCondition().toXML());
return l_Element;
}
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/NCName.java
New file
0,0 → 1,84
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.io.Serializable;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.DeepCopy;
 
/**
* This class represents the NCName BPEL-type
*/
public class NCName implements Serializable, Cloneable {
 
private String m_NCName = new String();
 
public NCName() {
}
 
public NCName(String a_NCName) {
m_NCName = a_NCName;
}
 
public Object clone() {
try {
return DeepCopy.deepCopy(this);
} catch (Exception e) {
System.out.println("Caught an exception while cloning");
return null;
}
}
 
public void update(NCName a_NCName) {
m_NCName = a_NCName.getName();
}
 
public String getName() {
return m_NCName;
}
 
public void setName(String a_NCName) {
m_NCName = a_NCName;
}
 
public String toString() {
if (m_NCName != null) {
return m_NCName;
}
return "";
}
 
/**
* Returns this attribute in XML-value
* @return this attribute in XML-value
*/
public String toXML() {
if (m_NCName != null) {
if (m_NCName.equals("")) {
return null;
} else {
return m_NCName;
}
}
return null;
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Throw.java
New file
0,0 → 1,132
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL Throw element, BPEL Throw Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Throw extends Activity implements ActivityGroup {
 
private QName m_FaultName = new QName();
private NCName m_FaultVariable = new NCName();
 
public Throw() {
}
 
public Throw(QName a_FaultName, NCName a_FaultVariable) {
m_FaultName = a_FaultName;
m_FaultVariable = a_FaultVariable;
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Throw the instance with the data that should be updated into this instance
*/
public void update(Throw a_Throw) {
super.update(a_Throw);
getFaultName().update(a_Throw.getFaultName());
getFaultVariable().update(a_Throw.getFaultVariable());
}
 
public QName getFaultName() {
return m_FaultName;
}
 
public NCName getFaultVariable() {
return m_FaultVariable;
}
 
public void setFaultName(QName a_FaultName) {
m_FaultName = a_FaultName;
return;
}
 
public void setFaultVariable(NCName a_FaultVariable) {
m_FaultVariable = a_FaultVariable;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("faultName")) {
setFaultName(new QName(l_CurrentValue));
} else if (l_CurrentName.equals("faultVariable")) {
setFaultVariable(new NCName(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_ThrowClone) {
if (a_ThrowClone instanceof Throw) {
super.saveEditPanel(a_ThrowClone);
Throw l_Throw = (Throw) a_ThrowClone;
m_FaultName = l_Throw.getFaultName();
m_FaultVariable = l_Throw.getFaultVariable();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
TabbedDialog l_EditPanel = super.getShowEditPanel(a_ShowPanel);
Throw l_Throw = (Throw) l_EditPanel.getEditPanelHolderClone();
l_EditPanel.addAttribute(l_Throw.getFaultName(), "FaultName*");
l_EditPanel.addAttribute(l_Throw.getFaultVariable(), "FaultVariable");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("throw");
super.writeToXML(a_Document, l_Element);
addXMLattribute(l_Element, "faultName", getFaultName().toXML());
addXMLattribute(l_Element, "faultVariable", getFaultVariable().toXML());
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/From.java
New file
0,0 → 1,277
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL From element, BPEL From Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class From extends ExtensibleElements implements EditPanelHolder {
 
private NCName m_Variable = new NCName();
private NCName m_Part = new NCName();
private BPString m_Query = new BPString();
private QName m_Property = new QName();
private NCName m_PartnerLink = new NCName();
private Roles m_EndpointReference = new Roles();
private BPString m_Expression = new BPString();
private BPBoolean m_Opaque = new BPBoolean("no");
 
public From() {
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_From the instance with the data that should be updated into this instance
*/
public void update(From a_From) {
getVariable().update(a_From.getVariable());
getPart().update(a_From.getPart());
getQuery().update(a_From.getQuery());
getProperty().update(a_From.getProperty());
getPartnerLink().update(a_From.getPartnerLink());
getEndpointReference().update(a_From.getEndpointReference());
getExpression().update(a_From.getExpression());
getOpaque().update(a_From.getOpaque());
}
 
public NCName getVariable() {
return m_Variable;
}
 
public NCName getPart() {
return m_Part;
}
 
public BPString getQuery() {
return m_Query;
}
 
public QName getProperty() {
return m_Property;
}
 
public NCName getPartnerLink() {
return m_PartnerLink;
}
 
public Roles getEndpointReference() {
return m_EndpointReference;
}
 
public BPString getExpression() {
return m_Expression;
}
 
public BPBoolean getOpaque() {
return m_Opaque;
}
 
public void setVariable(NCName a_Variable) {
m_Variable = a_Variable;
return;
}
 
public void setPart(NCName a_Part) {
m_Part = a_Part;
return;
}
 
public void setQuery(BPString a_Query) {
m_Query = a_Query;
return;
}
 
public void setProperty(QName a_Property) {
m_Property = a_Property;
return;
}
 
public void setPartnerLink(NCName a_PartnerLink) {
m_PartnerLink = a_PartnerLink;
return;
}
 
public void setEndpointReference(Roles a_EndpointReference) {
m_EndpointReference = a_EndpointReference;
return;
}
 
public void setExpression(BPString a_Expression) {
m_Expression = a_Expression;
return;
}
 
public void setOpaque(BPBoolean a_Opaque) {
m_Opaque = a_Opaque;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("variable")) {
setVariable(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("part")) {
setPart(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("query")) {
setQuery(new BPString(l_CurrentValue));
} else if (l_CurrentName.equals("property")) {
setProperty(new QName(l_CurrentValue));
} else if (l_CurrentName.equals("partnerLink")) {
setPartnerLink(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("endpointReference")) {
setEndpointReference(new Roles(l_CurrentValue));
} else if (l_CurrentName.equals("expression")) {
setExpression(new BPString(l_CurrentValue));
} else if (l_CurrentName.equals("opaque")) {
setOpaque(new BPBoolean(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
From l_From = (From) this.clone();
ShowPanel l_ShowPanel = new ShowPanel("From", l_From, this);
l_ShowPanel.addAttribute(l_From.getVariable(), "Variable");
l_ShowPanel.addAttribute(l_From.getPart(), "Part");
l_ShowPanel.addAttribute(l_From.getQuery(), "Query");
l_ShowPanel.addAttribute(l_From.getProperty(), "Property");
l_ShowPanel.addAttribute(l_From.getPartnerLink(), "PartnerLink");
l_ShowPanel.addAttribute(l_From.getEndpointReference(), "EndpointReference");
l_ShowPanel.addAttribute(l_From.getExpression(), "Expression");
l_ShowPanel.addAttribute(l_From.getOpaque(), "Opaque");
return l_ShowPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_FromClone) {
if (a_FromClone instanceof From) {
From l_From = (From) a_FromClone;
m_Variable.update(l_From.getVariable());
m_Part.update(l_From.getPart());
m_Query.update(l_From.getQuery());
m_Property.update(l_From.getProperty());
m_PartnerLink.update(l_From.getPartnerLink());
m_EndpointReference.update(l_From.getEndpointReference());
m_Expression.update(l_From.getExpression());
m_Opaque.update(l_From.getOpaque());
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
From l_From = (From) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("From", l_From, this, a_ShowPanel);
l_EditPanel.addAttribute(l_From.getVariable(), "Variable");
l_EditPanel.addAttribute(l_From.getPart(), "Part");
l_EditPanel.addAttribute(l_From.getQuery(), "Query");
l_EditPanel.addAttribute(l_From.getProperty(), "Property");
l_EditPanel.addAttribute(l_From.getPartnerLink(), "PartnerLink");
l_EditPanel.addAttribute(l_From.getEndpointReference(), "EndpointReference");
l_EditPanel.addAttribute(l_From.getExpression(), "Expression");
l_EditPanel.addAttribute(l_From.getOpaque(), "Opaque");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("from");
addXMLattribute(l_Element, "variable", getVariable().toXML());
addXMLattribute(l_Element, "part", getPart().toXML());
addXMLattribute(l_Element, "query", getQuery().toXML());
addXMLattribute(l_Element, "property", getProperty().toXML());
addXMLattribute(l_Element, "partnerLink", getPartnerLink().toXML());
addXMLattribute(l_Element, "endpointReference", getEndpointReference().toXML());
addXMLattribute(l_Element, "expression", getExpression().toXML());
addXMLattribute(l_Element, "opaque", getOpaque().toXML());
return l_Element;
}
 
/**
* This method should be called by subclasses, the elementname can be the subclasses name
* @param a_Document The general document in which this element is placed
* @param a_Element The XML-element of which the super-attributes and elements should be added
* @return The parameter XML-element (with added attributes)
*/
public Element writeToXML(Document a_Document, Element a_Element) {
addXMLattribute(a_Element, "variable", getVariable().toXML());
addXMLattribute(a_Element, "part", getPart().toXML());
addXMLattribute(a_Element, "query", getQuery().toXML());
addXMLattribute(a_Element, "property", getProperty().toXML());
addXMLattribute(a_Element, "partnerLink", getPartnerLink().toXML());
addXMLattribute(a_Element, "expression", getExpression().toXML());
addXMLattribute(a_Element, "opaque", getOpaque().toXML());
return a_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Wait.java
New file
0,0 → 1,132
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL Wait element, BPEL Wait Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Wait extends Activity implements ActivityGroup {
 
private DurationExpr m_For = new DurationExpr();
private DeadlineExpr m_Until = new DeadlineExpr();
 
public Wait() {
}
 
public Wait(DurationExpr a_For, DeadlineExpr a_Until) {
m_For = a_For;
m_Until = a_Until;
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Wait the instance with the data that should be updated into this instance
*/
public void update(Wait a_Wait) {
super.update(a_Wait);
getFor().update(a_Wait.getFor());
getUntil().update(a_Wait.getUntil());
}
 
public DurationExpr getFor() {
return m_For;
}
 
public DeadlineExpr getUntil() {
return m_Until;
}
 
public void setFor(DurationExpr a_For) {
m_For = a_For;
return;
}
 
public void setUntil(DeadlineExpr a_Until) {
m_Until = a_Until;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("for")) {
setFor(new DurationExpr(l_CurrentValue));
} else if (l_CurrentName.equals("until")) {
setUntil(new DeadlineExpr(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_WaitClone) {
if (a_WaitClone instanceof Wait) {
super.saveEditPanel(a_WaitClone);
Wait l_Wait = (Wait) a_WaitClone;
m_For = l_Wait.getFor();
m_Until = l_Wait.getUntil();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
TabbedDialog l_EditPanel = super.getShowEditPanel(a_ShowPanel);
Wait l_Wait = (Wait) l_EditPanel.getEditPanelHolderClone();
l_EditPanel.addAttribute(l_Wait.getFor(), "For");
l_EditPanel.addAttribute(l_Wait.getUntil(), "Until");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("wait");
super.writeToXML(a_Document, l_Element);
addXMLattribute(l_Element, "for", getFor().toXML());
addXMLattribute(l_Element, "until", getUntil().toXML());
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Flow.java
New file
0,0 → 1,169
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Enumeration;
import java.util.Vector;
 
import org.emaxx.bpeldesigner.bpel.figures.BPELActivityFigure;
import org.emaxx.bpeldesigner.bpel.standard.BPELDrawing;
import org.emaxx.bpeldesigner.bpel.standard.BPELFigureHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
 
/**
* Represents the BPEL Flow element, BPEL Flow Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Flow extends Activity implements ActivityGroup {
 
private BPELDrawing m_Drawing;
private Links m_Links = new Links();
private Vector m_FlowActivityGroups = new Vector();
 
public Flow() {
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ExtensibleElements#getBPELDrawing(CH.ifa.draw.standard.BPELFigureHolder)
*/
public BPELDrawing getBPELDrawing(BPELFigureHolder a_BPELFigureHolder) {
if (m_Drawing == null) {
if (a_BPELFigureHolder.getHolderParent() != null) {
m_Drawing = new BPELDrawing(a_BPELFigureHolder,
a_BPELFigureHolder.getHolderParent().getBPELDrawing().getRootDocument());
} else {
m_Drawing = new BPELDrawing(a_BPELFigureHolder, null);
}
if (this.getFlowActivityGroups() != null) {
Enumeration l_Enum = this.getFlowActivityGroups().elements();
while (l_Enum.hasMoreElements()) {
ActivityGroup l_ActivityGroup = (ActivityGroup) l_Enum.nextElement();
BPELActivityFigure l_ActivityFigure = BPELActivityFigure.giveFigure(l_ActivityGroup);
l_ActivityFigure.setActivity((Activity) l_ActivityGroup);
m_Drawing.add(l_ActivityFigure);
}
}
}
return m_Drawing;
}
 
/**
* This method updates this instance with an instance of the sameclass, such that
* reference to this instance sub-elements remain intact
* @param a_Flow the instance with the data that should be updated into this instance
*/
public void update(Flow a_Flow) {
super.update(a_Flow);
getLinks().update((a_Flow.getLinks()));
}
 
public Links getLinks() {
return m_Links;
}
 
public void setLinks(Links a_Links) {
m_Links = a_Links;
}
 
public void addFlowActivityGroup(ActivityGroup a_FlowActivityGroup) {
m_FlowActivityGroups.add(a_FlowActivityGroup);
return;
}
 
public boolean removeFlowActivityGroup(ActivityGroup a_FlowActivityGroup) {
return m_FlowActivityGroups.remove(a_FlowActivityGroup);
}
 
public Vector getFlowActivityGroups() {
return m_FlowActivityGroups;
}
 
public void setFlowActivityGroups(Vector a_FlowActivityGroups) {
m_FlowActivityGroups = a_FlowActivityGroups;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NodeList children = a_Node.getChildNodes();
if (children != null) {
KeyClassVector l_KeyClassVector = new KeyClassVector();
for (int i = 0; i < children.getLength(); i++) {
String l_TempNodeName = children.item(i).getNodeName();
if (l_TempNodeName.equals("links")) {
Links l_Links = new Links();
l_Links.handleParse(children.item(i));
setLinks(l_Links);
} else if (l_KeyClassVector.getAContaining(l_TempNodeName) != null) {
ActivityGroup l_ActivityGroup = l_KeyClassVector.getAContaining(l_TempNodeName);
l_ActivityGroup.handleParse(children.item(i));
addFlowActivityGroup(l_ActivityGroup);
}
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_FlowClone) {
super.saveEditPanel(a_FlowClone);
if (a_FlowClone instanceof Flow) {
Flow l_Flow = (Flow) a_FlowClone;
m_Links = l_Flow.getLinks();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
TabbedDialog l_EditPanel = super.getShowEditPanel(a_ShowPanel);
l_EditPanel.addTab(((Flow) l_EditPanel.getEditPanelHolderClone()).getLinks());
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("flow");
super.writeToXML(a_Document, l_Element);
addXMLChild(l_Element, getLinks().writeToXML(a_Document));
Enumeration l_Enum = getFlowActivityGroups().elements();
while (l_Enum.hasMoreElements()) {
addXMLChild(l_Element, ((ActivityGroup) l_Enum.nextElement()).writeToXML(a_Document));
}
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/ActivityGroup.java
New file
0,0 → 1,28
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
/**
* Implementing this interface lets the Object be easily identified as a part of an ActivityGroup.
* An advantage is that it can be parsed with less code and more ease.
*/
public interface ActivityGroup extends ParseAble {
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Case.java
New file
0,0 → 1,140
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL Case element, BPEL Case Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Case extends ActivityContainer implements EditPanelHolder {
 
private BooleanExpr m_Condition = new BooleanExpr();
 
public Case() {
}
 
public BooleanExpr getCondition() {
return m_Condition;
}
 
public void setCondition(BooleanExpr a_Condition) {
m_Condition = a_Condition;
return;
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Case the instance with the data that should be updated into this instance
*/
public void update(Case a_Case) {
super.update(a_Case);
getCondition().update(a_Case.getCondition());
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("condition")) {
setCondition(new BooleanExpr(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("case");
super.writeToXML(a_Document, l_Element);
addXMLattribute(l_Element, "condition", getCondition().toXML());
return l_Element;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
Case l_Case = (Case) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("Case", l_Case, this, a_ShowPanel);
l_EditPanel.addAttribute(l_Case.getCondition(), "Condition*");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_CaseClone) {
if (a_CaseClone instanceof Case) {
Case l_Case = (Case) a_CaseClone;
m_Condition = l_Case.getCondition();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/ActivityOrCompensateContainer.java
New file
0,0 → 1,173
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Vector;
 
import org.emaxx.bpeldesigner.bpel.figures.BPELActivityFigure;
import org.emaxx.bpeldesigner.bpel.figures.BPELCompensateFigure;
import org.emaxx.bpeldesigner.bpel.standard.BPELDrawing;
import org.emaxx.bpeldesigner.bpel.standard.BPELFigureHolder;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
 
/**
* Represents the BPEL ActivityOrCompensateContainer element, BPEL ActivityOrCompensateContainer
* Nodes can be converted to this class.
* This class supports certain modifying attributes. This class can be saved to a BPEL Node.
*/
public class ActivityOrCompensateContainer extends ExtensibleElements {
 
private BPELDrawing m_Drawing;
private ActivityGroup m_ActivityGroup;
private Compensate m_Compensate;
 
public ActivityOrCompensateContainer() {
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ExtensibleElements#getBPELDrawing(CH.ifa.draw.standard.BPELFigureHolder)
*/
public BPELDrawing getBPELDrawing(BPELFigureHolder a_BPELFigureHolder) {
if (m_Drawing == null) {
if (a_BPELFigureHolder.getHolderParent() != null) {
m_Drawing = new BPELDrawing(a_BPELFigureHolder,
a_BPELFigureHolder.getHolderParent().getBPELDrawing().getRootDocument());
} else {
m_Drawing = new BPELDrawing(a_BPELFigureHolder, null);
}
if (this.getCompensate() != null) {
BPELCompensateFigure l_CompensateFigure = new BPELCompensateFigure();
l_CompensateFigure.setCompensate(this.getCompensate());
m_Drawing.add(l_CompensateFigure);
}
if (this.getActivityGroup() != null) {
BPELActivityFigure l_ActivityFigure = BPELActivityFigure.giveFigure(this.getActivityGroup());
l_ActivityFigure.setActivity((Activity) this.getActivityGroup());
m_Drawing.add(l_ActivityFigure);
}
}
return m_Drawing;
}
 
public ActivityGroup getActivityGroup() {
return m_ActivityGroup;
}
 
public Compensate getCompensate() {
return m_Compensate;
}
 
public void setActivityGroup(ActivityGroup a_ActivityGroup) {
m_ActivityGroup = a_ActivityGroup;
return;
}
 
public void setCompensate(Compensate a_Compensate) {
m_Compensate = a_Compensate;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NodeList children = a_Node.getChildNodes();
if (children != null) {
KeyClassVector l_KeyClassVector = new KeyClassVector();
Vector l_Vector = activityGroup();
for (int i = 0; i < children.getLength(); i++) {
String l_TempNodeName = children.item(i).getNodeName();
if (l_KeyClassVector.getAContaining(l_TempNodeName) != null) {
ActivityGroup l_ActivityGroup = l_KeyClassVector.getAContaining(l_TempNodeName);
l_ActivityGroup.handleParse(children.item(i));
setActivityGroup(l_ActivityGroup);
} else if (l_TempNodeName.equals("compensate")) {
Compensate l_Compensate = new Compensate();
l_Compensate.handleParse(children.item(i));
setCompensate(l_Compensate);
}
}
}
}
 
private static Vector activityGroup() {
Vector l_Vector = new Vector();
l_Vector.add("empty");
l_Vector.add("invoke");
l_Vector.add("receive");
l_Vector.add("reply");
l_Vector.add("assign");
l_Vector.add("wait");
l_Vector.add("throw");
l_Vector.add("terminate");
l_Vector.add("flow");
l_Vector.add("switch");
l_Vector.add("while");
l_Vector.add("sequence");
l_Vector.add("pick");
l_Vector.add("scope");
return l_Vector;
 
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("activityOrCompensateContainer");
if (getActivityGroup() != null) {
addXMLChild(l_Element, getActivityGroup().writeToXML(a_Document));
} else if (getCompensate() != null) {
addXMLChild(l_Element, getCompensate().writeToXML(a_Document));
}
if (l_Element.hasChildNodes()) {
return l_Element;
} else {
return null;
}
}
 
/**
* This method should be called by subclasses, the elementname can be the subclasses name
* @param a_Document The general document in which this element is placed
* @param a_Element The XML-element of which the super-attributes and elements should be added
* @return The parameter XML-element (with added attributes)
*/
public Element writeToXML(Document a_Document, Element a_Element) {
if (getActivityGroup() != null) {
addXMLChild(a_Element, getActivityGroup().writeToXML(a_Document));
} else if (getCompensate() != null) {
addXMLChild(a_Element, getCompensate().writeToXML(a_Document));
}
if (a_Element.hasChildNodes()) {
return a_Element;
} else {
return null;
}
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/KeyClassType.java
New file
0,0 → 1,58
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
/**
* This class returns the corresponding Object for a BPEL-ActivityGroup name String
*/
public class KeyClassType {
 
private String m_Key = new String();
private int m_ClassType;
 
/**
* Returns the unique int value of this type
* @return the unique int value of this type
*/
public int getClassType() {
return m_ClassType;
}
 
/**
* Constructs a KeyClassType
* @param a_Key the name of the element
* @param a_ClassType the unique class number
*/
public KeyClassType(String a_Key, int a_ClassType) {
m_Key = a_Key;
m_ClassType = a_ClassType;
}
 
/**
* Returns whether a mapping is available of the specified name
* @param a_Key the name of the element
* @return whether a mapping is available of the specified name
*/
public boolean hasKey(String a_Key) {
return a_Key.equals(m_Key);
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELChangeScopeCommand.java
New file
0,0 → 1,99
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.BPELDesigner;
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
/**
* Insert a figure or a Vector of figures and Undo and Redo this action
*/
public class BPELChangeScopeCommand extends AdvancedCommand {
 
public BPELFigureHolder m_OldScopeFigure;
public BPELFigureHolder m_NewScopeFigure;
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_NewScopeFigure the figure which scope we want to see
*/
public BPELChangeScopeCommand(String a_Name, BPELFigureHolder a_NewScopeFigure) {
super(a_Name);
m_NewScopeFigure = a_NewScopeFigure;
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param m_OldScopeFigure the figure which scope we saw
* @param a_NewScopeFigure the figure which scope we want to see
*/
public BPELChangeScopeCommand(String a_Name, BPELFigureHolder a_OldScopeFigure,
BPELFigureHolder a_NewScopeFigure) {
super(a_Name);
m_NewScopeFigure = a_NewScopeFigure;
m_OldScopeFigure = a_OldScopeFigure;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
if (m_Drawing instanceof BPELDrawing) {
BPELFigureHolder l_FigureHolder = ((BPELDrawing) m_Drawing).getOwner();
BPELDrawing l_Drawing = m_NewScopeFigure.getBPELDrawing();
((BPELDesigner) m_DrawApp).changeScope(m_NewScopeFigure.getHierarchyName(), l_Drawing,
m_NewScopeFigure);
UndoableEdit edit = new BPELChangeScopeCommand(this.getPresentationName(),
l_FigureHolder, m_NewScopeFigure);
UndoManage.getUndoableEditSupport().postEdit(edit);
}
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
BPELDrawing l_Drawing = m_OldScopeFigure.getBPELDrawing();
((BPELDesigner) m_DrawApp).changeScope(m_OldScopeFigure.getHierarchyName(), l_Drawing,
m_OldScopeFigure);
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
BPELDrawing l_Drawing = m_NewScopeFigure.getBPELDrawing();
((BPELDesigner) m_DrawApp).changeScope(m_NewScopeFigure.getHierarchyName(), l_Drawing,
m_NewScopeFigure);
m_HasBeenDone = true;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELFigureHolder.java
New file
0,0 → 1,119
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import org.emaxx.bpeldesigner.bpel.contrib.BPELLayoutable;
import org.emaxx.bpeldesigner.bpel.framework.adv.PopupAble;
import org.emaxx.bpeldesigner.input.TabbedDialog;
 
import CH.ifa.draw.framework.Figure;
 
/**
* The interface of a figure that can contain figures
* It can be used to layout a drawing and to show children in a new drawing
*/
 
public interface BPELFigureHolder extends BPELLayoutable, PopupAble {
 
/**
* Returns whether the BPEL figure can hold the Figure
* @param a_Figure the figure to be held
* @return the possibility of holding the Figure
*/
public boolean acceptsHolding(Figure a_Figure);
 
/**
* Tries to add a figure to the current scope and returns true if it was possible
* @param a_Figure the figure to be inserted
* @return true if the figure was added, false otherwise
*/
public boolean addToScope(Figure a_Figure);
 
/**
* Returns whether this figure can be removed, in case it is a BPELFigure, it will be removed in the
* internal BPEL-representation, graphical removal should still be done separately
* @param a_Figure the figure to be removed
* @return the possibility to remove this figure
*/
public boolean removeFromScope(Figure a_Figure);
 
/**
* Returns the drawing containing all its children
* @return the drawing containing all its children
*/
public BPELDrawing getBPELDrawing();
 
/**
* The name on the actual picture
* @return The name on the actual picture
*/
public String getFigureName();
 
/**
* The name on the actual picture
* @param a_FigureName The name on the actual picture
*/
public void setFigureName(String a_FigureName);
 
/**
* Every BPELFigure has a parent BPEL Figure, with this method you can get it
* This name is used for frame titles
* * @return the parent of the figure
*/
public BPELFigureHolder getHolderParent();
 
/**
* returns the figure's complete name. This is a name in which
* the ancestors names are included.
* @return the complete name of the figure
*/
public String getHierarchyName();
 
/**
* returns the local part of the figure's complete name
* @return the local part of the figure's complete name
*/
public String getHierarchyLocalName();
 
/**
* Every BPEL figure has a parent BPEL figure, with this method you can set it
* This name is used for frame titles
* @param a_HolderParent the parent of the figure
*/
public void setHolderParent(BPELFigureHolder a_HolderParent);
 
/**
* Every BPELFigureHolder has an optional TabbedDialog. This is normally used
* for a property screen.
* @return
*/
public TabbedDialog getPanel();
 
/**
* This should return the tools that can be used. Add the values in BPELTools that you need
* @return the sum of all the tools that can be used
* @see org.emaxx.bpeldesigner.bpel.contrib.BPELTools
*/
public int getBPELToolSelection();
 
public String getRootName();
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELNewScopeCommand.java
New file
0,0 → 1,83
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.BPELDesigner;
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
/**
* Insert a figure or a Vector of figures and Undo and Redo this action
*/
public class BPELNewScopeCommand extends AdvancedCommand {
 
public BPELFigureHolder m_OldScopeFigure;
public BPELFigureHolder m_NewScopeFigure;
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_NewScopeFigure the figure which scope we want to see
*/
public BPELNewScopeCommand(String a_Name, BPELFigureHolder a_NewScopeFigure) {
super(a_Name);
m_NewScopeFigure = a_NewScopeFigure;
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_NewScopeFigure the figure which scope we want to see
*/
public BPELNewScopeCommand(String a_Name, BPELFigureHolder a_OldScopeFigure,
BPELFigureHolder a_NewScopeFigure) {
super(a_Name);
m_NewScopeFigure = a_NewScopeFigure;
m_OldScopeFigure = a_OldScopeFigure;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
if (m_Drawing instanceof BPELDrawing) {
BPELDrawing l_Drawing = m_NewScopeFigure.getBPELDrawing();
((BPELDesigner) m_DrawApp).newScope(m_NewScopeFigure.getHierarchyName(), l_Drawing,
m_NewScopeFigure);
UndoableEdit edit = new BPELNewScopeCommand(this.getPresentationName(),
m_NewScopeFigure);
UndoManage.getUndoableEditSupport().postEdit(edit);
}
}
 
public boolean isExecutable() {
return m_NewScopeFigure != null;
}
 
public boolean canUndo() {
return false;
}
 
public boolean canRedo() {
return false;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELHierarchyUpCommand.java
New file
0,0 → 1,83
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
 
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
/**
* Command to go one level up in BPEL hierarchy in the view
*/
public class BPELHierarchyUpCommand extends AdvancedCommand {
 
/**
* @param a_Name the name of the command
*/
public BPELHierarchyUpCommand(String a_Name) {
super(a_Name);
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
BPELFigureHolder l_Owner = null;
if (m_Drawing != null) {
l_Owner = ((BPELDrawing) m_Drawing).getOwner();
}
 
if (l_Owner != null) {
BPELFigureHolder l_BPELFigureHolder = ((BPELFigureHolder) l_Owner).getHolderParent();
if (l_BPELFigureHolder != null) {
BPELChangeScopeCommand l_Command = new BPELChangeScopeCommand("HierarchyUpCommand",
l_BPELFigureHolder);
l_Command.execute();
}
}
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public boolean canUndo() {
return false;
}
 
public boolean canRedo() {
return false;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELSelectionTool.java
New file
0,0 → 1,63
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.event.MouseEvent;
 
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedSelectionTool;
 
import CH.ifa.draw.framework.DrawingView;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.Tool;
 
public class BPELSelectionTool extends AdvancedSelectionTool {
 
/**
* Create an instance of this SelectionTool for the given view
*
* @param view DrawingView for which the SelectionTool operates
*/
public BPELSelectionTool(DrawingView view) {
super(view);
}
 
/**
* Hook method which can be overriden by subclasses to provide
* specialised behaviour in the event of a mouse double click.
*/
protected void handleMouseDoubleClick(MouseEvent e, int x, int y) {
BPELFigureHolder l_BPELFigureHolder = null;
Figure pressedFigure = drawing().findFigureInside(x, y);
if (pressedFigure instanceof BPELFigureHolder) {
l_BPELFigureHolder = (BPELFigureHolder) pressedFigure;
BPELDialogCommand l_Command = new BPELDialogCommand("Properties", pressedFigure);
l_Command.execute();
view().clearSelection();
}
}
 
/**
* Factory method to create a AdvancedDrag tracker. It is used to drag a figure.
*/
protected Tool createDragTracker(DrawingView a_View, Figure a_Figure) {
return new BPELDragTracker(a_View, a_Figure);
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedRedoCommand.java
New file
0,0 → 1,71
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoManager;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
/**
* Redo the command in the Undomanager
* @see UndoManage
*/
public class AdvancedRedoCommand extends AdvancedCommand {
 
UndoManager m_UndoManager;
 
/**
* @param a_Name the name of the command
*/
public AdvancedRedoCommand(String a_Name) {
super(a_Name);
m_UndoManager = UndoManage.getUndoManager();
}
 
public void execute() {
if (m_UndoManager.canRedo()) {
m_UndoManager.redo();
UndoManage.refreshUndoRedo();
}
}
 
public void undo() throws CannotUndoException {
}
 
public void redo() throws CannotRedoException {
}
 
public boolean canUndo() {
return false;
}
 
public boolean canRedo() {
return false;
}
 
public boolean isExecutable() {
return m_UndoManager.canRedo();
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedDragTracker.java
New file
0,0 → 1,83
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.awt.Point;
import java.awt.event.MouseEvent;
 
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
 
import CH.ifa.draw.framework.DrawingView;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.standard.DragTracker;
import CH.ifa.draw.standard.SelectionTool;
 
/**
* DragTracker implements the dragging of the clicked
* figure. It posts an UndoableEdit to the UndoManager
* which keeps the original position when the dragging
* started and the position when the mousebutton was
* released again.
*
* @see SelectionTool
*/
public class AdvancedDragTracker extends DragTracker {
 
public Point m_OldPoint;
public boolean m_Dragged = false;
 
public AdvancedDragTracker(DrawingView view, Figure anchor) {
super(view, anchor);
}
 
public void mouseDown(MouseEvent e, int x, int y) {
super.mouseDown(e, x, y);
m_OldPoint = new Point(x, y);
m_Dragged = false;
}
 
public void mouseDrag(MouseEvent e, int x, int y) {
super.mouseDrag(e, x, y);
if ((Math.abs(x - fAnchorX) > 4) || (Math.abs(y - fAnchorY) > 4)) {
m_Dragged = true;
}
}
 
public void mouseUp(MouseEvent e, int x, int y) {
super.mouseUp(e, x, y);
Point l_NewPoint = new Point(x, y);
if (!l_NewPoint.equals(m_OldPoint) && m_Dragged) {
AdvancedMoveCommand l_Command = createMoveCommand(l_NewPoint);
UndoableEdit edit = l_Command;
l_Command.execute();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
m_Dragged = false;
}
 
public AdvancedMoveCommand createMoveCommand(Point a_NewPoint) {
return new AdvancedMoveCommand("Move", (AdvancedStandardDrawing) editor().drawing(),
m_OldPoint, a_NewPoint);
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedCutCommand.java
New file
0,0 → 1,120
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
 
import CH.ifa.draw.framework.FigureSelection;
import CH.ifa.draw.standard.FigureEnumerator;
import CH.ifa.draw.util.Clipboard;
 
/**
* Delete the selection and move the selected figures to
* the clipboard and Undo and Redo this action
* @see Clipboard
*/
public class AdvancedCutCommand extends AdvancedFigureTransferCommand {
 
public Vector m_OldClipBoard;
public Vector m_NewClipBoard;
 
/**
* @param a_Name the name of the command
*/
public AdvancedCutCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param figuresOld the old clipboard
* @param figuresNew the new clipboard
*/
public AdvancedCutCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Vector figuresOld,
Vector figuresNew) {
super(a_Name, a_Drawing);
m_OldClipBoard = figuresOld;
m_NewClipBoard = figuresNew;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
FigureSelection temp1 = (FigureSelection) Clipboard.getClipboard().getContents();
Vector tempvector = null;
if (temp1 != null) {
tempvector = (Vector) temp1.getData(FigureSelection.TYPE);
}
FigureEnumerator temp2 = (FigureEnumerator) getView().selectionElements();
Vector tempvector2 = new Vector();
while (temp2.hasMoreElements()) {
tempvector2.add(temp2.nextElement());
}
UndoableEdit edit = new AdvancedCutCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), tempvector, tempvector2);
copySelection();
saveLinesOfFigures(tempvector2);
deleteSelection();
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0 && m_DrawApp.drawing() != null;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_NewClipBoard != null) {
if (m_NewClipBoard.size() == 0)
return;
 
getView().clearSelection();
insertFigures(m_NewClipBoard, 0, 0);
reinsertLines(m_NewClipBoard);
m_Drawing.checkDamage();
}
if (m_OldClipBoard != null) {
copySelection(new FigureSelection(m_OldClipBoard));
}
m_HasBeenDone = false;
 
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
copySelection(new FigureSelection(m_NewClipBoard));
deleteSelection(m_NewClipBoard);
m_Drawing.checkDamage();
m_HasBeenDone = true;
}
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedDeleteCommand.java
New file
0,0 → 1,100
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
 
import CH.ifa.draw.framework.FigureSelection;
 
/**
* Delete the selection and Undo and Redo this action
*/
public class AdvancedDeleteCommand extends AdvancedFigureTransferCommand {
 
/**
* @param a_Name the name of the command
*/
public AdvancedDeleteCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
*/
public AdvancedDeleteCommand(String name, AdvancedStandardDrawing a_Drawing) {
super(name, a_Drawing);
setSelectionZOrdered();
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
FigureSelection selection = getView().getFigureSelection();
Vector tempvector = getView().selectionZOrdered();
saveLinesOfFigures(tempvector);
UndoableEdit edit = new AdvancedDeleteCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing());
deleteSelection();
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (getSelectionZOrdered() != null) {
if (getSelectionZOrdered().size() == 0)
return;
getView().clearSelection();
insertFigures(getSelectionZOrdered(), 0, 0);
reinsertLines(getSelectionZOrdered());
 
m_Drawing.checkDamage();
}
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
deleteSelection(getSelectionZOrdered());
m_Drawing.checkDamage();
m_HasBeenDone = true;
}
 
public boolean canRedo() {
return (super.canRedo() && (m_Drawing != null));
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedInsertCommand.java
New file
0,0 → 1,107
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
 
import CH.ifa.draw.framework.Figure;
 
/**
* Insert a figure or a Vector of figures and Undo and Redo this action
*/
public class AdvancedInsertCommand extends AdvancedFigureTransferCommand {
 
public Vector m_Figures;
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_Figure the figure that needs to be inserted
*/
public AdvancedInsertCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Figure a_Figure) {
super(a_Name, a_Drawing);
m_Figures = new Vector();
m_Figures.add(a_Figure);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_Figures the figures that need to be inserted
*/
public AdvancedInsertCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Vector a_Figures) {
super(a_Name, a_Drawing);
m_Figures = a_Figures;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
if (m_Figures != null) {
UndoableEdit edit = new AdvancedInsertCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), m_Figures);
if (m_Figures.size() == 0)
return;
getView().clearSelection();
insertFigures(m_Figures, 0, 0);
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
deleteSelection(m_Figures);
m_Drawing.checkDamage();
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
if (m_Figures != null) {
if (m_Figures.size() == 0)
return;
getView().clearSelection();
insertFigures(m_Figures, 0, 0);
m_Drawing.checkDamage();
}
m_HasBeenDone = true;
}
 
public boolean canRedo() {
return (super.canRedo() && (m_Drawing != null));
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedUndoCommand.java
New file
0,0 → 1,69
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import javax.swing.undo.UndoManager;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
import CH.ifa.draw.framework.Drawing;
 
/**
* Undo the command in the Undomanager
* @see UndoManage
*/
public class AdvancedUndoCommand extends AdvancedCommand {
 
UndoManager m_UndoManager;
 
/**
* @param a_Name the name of the command
*/
public AdvancedUndoCommand(String a_Name) {
super(a_Name);
m_UndoManager = UndoManage.getUndoManager();
}
 
public void execute() {
if (m_UndoManager.canUndo()) {
m_UndoManager.undo();
UndoManage.refreshUndoRedo();
Drawing l_Drawing = m_DrawApp.drawing();
if (l_Drawing instanceof AdvancedStandardDrawing) {
((AdvancedStandardDrawing) l_Drawing).checkDamage();
}
}
}
 
public boolean canUndo() {
return false;
}
 
public boolean canRedo() {
return false;
}
 
public boolean isExecutable() {
return m_UndoManager.canUndo();
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedMoveCommand.java
New file
0,0 → 1,116
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.awt.Point;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
import CH.ifa.draw.framework.FigureEnumeration;
import CH.ifa.draw.standard.FigureEnumerator;
 
/**
* Moves the selected figures and Undo and Redo this action
*
*/
public class AdvancedMoveCommand extends AdvancedCommand {
 
public Point m_OldPoint;
public Point m_NewPoint;
 
/**
* @param a_Name the name of the command
* @param a_OldPoint old Position
* @param a_NewPoint new Position
*/
public AdvancedMoveCommand(String a_Name, Point a_OldPoint, Point a_NewPoint) {
super(a_Name);
m_OldPoint = a_OldPoint;
m_NewPoint = a_NewPoint;
}
 
/**
* This constructor can be used if the first execute wont be used but Undo/Redo functionality is needed
* Movement is calculated by moving the selection
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_OldPoint old Position
* @param a_NewPoint new Position
*/
public AdvancedMoveCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Point a_OldPoint,
Point a_NewPoint) {
super(a_Name, a_Drawing);
setSelectionZOrdered();
m_OldPoint = a_OldPoint;
m_NewPoint = a_NewPoint;
}
 
public void execute() {
if (m_OldPoint != null && m_NewPoint != null) {
setSelectionZOrdered();
UndoableEdit edit = new AdvancedMoveCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), m_OldPoint, m_NewPoint);
FigureEnumeration l_Figures = new FigureEnumerator(getSelectionZOrdered());
while (l_Figures.hasMoreElements()) {
l_Figures.nextFigure().moveBy(m_NewPoint.x - m_OldPoint.x,
m_NewPoint.y - m_OldPoint.y);
}
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
FigureEnumeration l_Figures = new FigureEnumerator(getSelectionZOrdered());
while (l_Figures.hasMoreElements()) {
l_Figures.nextFigure().moveBy(m_OldPoint.x - m_NewPoint.x, m_OldPoint.y - m_NewPoint.y);
}
m_Drawing.checkDamage();
m_HasBeenDone = false;
 
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
FigureEnumeration l_Figures = new FigureEnumerator(getSelectionZOrdered());
while (l_Figures.hasMoreElements()) {
l_Figures.nextFigure().moveBy(m_NewPoint.x - m_OldPoint.x, m_NewPoint.y - m_OldPoint.y);
}
m_Drawing.checkDamage();
m_HasBeenDone = true;
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedChangeAttributeCommand.java
New file
0,0 → 1,117
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.FigureEnumeration;
 
/**
* Command to change a named figure attribute and to Undo or Redo this action.
*/
public class AdvancedChangeAttributeCommand extends AdvancedCommand {
 
private String m_Attribute;
private Object m_Value;
private Vector m_OldAttributes;
 
/**
* Constructs a change attribute command.
* @param a_Name the command name
* @param a_AttributeName the name of the attribute to be changed
* @param a_Value the new attribute value
*/
public AdvancedChangeAttributeCommand(String a_Name, String a_AttributeName, Object a_Value) {
super(a_Name);
m_Attribute = a_AttributeName;
m_Value = a_Value;
}
 
/**
* @param a_Name the command name
* @param a_AttributeName the name of the attribute to be changed
* @param a_Value the new attribute value
* @param a_Drawing the drawing that this command should be executed on
* @param a_OldAttributes the attributes to be saved for Undo/Redo
*/
private AdvancedChangeAttributeCommand(String a_Name, String a_AttributeName, Object a_Value,
AdvancedStandardDrawing a_Drawing, Vector a_OldAttributes) {
super(a_Name, a_Drawing);
m_Attribute = a_AttributeName;
m_Value = a_Value;
m_OldAttributes = a_OldAttributes;
setSelectionZOrdered();
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
FigureEnumeration k = getView().selectionElements();
Vector tempvector = new Vector();
Vector tempvector2 = new Vector();
while (k.hasMoreElements()) {
Figure f = k.nextFigure();
tempvector.add(f.getAllAttributes(m_Attribute));
tempvector2.add(f);
f.setAttribute(m_Attribute, m_Value);
}
UndoableEdit edit = new AdvancedChangeAttributeCommand(this.getPresentationName(),
m_Attribute, m_Value, (AdvancedStandardDrawing) m_DrawApp.drawing(), tempvector);
UndoManage.getUndoableEditSupport().postEdit(edit);
m_Drawing.checkDamage();
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
for (int i = 0; i < getSelectionZOrdered().size(); i++) {
Vector tempvector = (Vector) m_OldAttributes.get(i);
((Figure) getSelectionZOrdered().get(i)).setAllAttributes(m_Attribute, tempvector);
}
m_Drawing.checkDamage();
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
for (int i = 0; i < getSelectionZOrdered().size(); i++) {
((Figure) getSelectionZOrdered().get(i)).setAttribute(m_Attribute, m_Value);
}
m_Drawing.checkDamage();
m_HasBeenDone = true;
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedCopyCommand.java
New file
0,0 → 1,104
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
 
import CH.ifa.draw.framework.FigureSelection;
import CH.ifa.draw.util.Clipboard;
 
/**
* Copy the selection to the clipboard and Undo and Redo this action
* @see Clipboard
*/
public class AdvancedCopyCommand extends AdvancedFigureTransferCommand {
 
public Vector m_NewClipBoard;
public Vector m_OldClipBoard;
 
/**
* @param a_Name the command name
*/
 
public AdvancedCopyCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param name the command name
* @param a_Drawing the drawing that this command should be executed on
* @param a_FiguresOld the previous clipboard contents
* @param a_FiguresNew the new clipboard contents
*/
public AdvancedCopyCommand(String name, AdvancedStandardDrawing a_Drawing, Vector a_FiguresOld,
Vector a_FiguresNew) {
super(name, a_Drawing);
m_OldClipBoard = a_FiguresOld;
m_NewClipBoard = a_FiguresNew;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
FigureSelection temp1 = (FigureSelection) Clipboard.getClipboard().getContents();
Vector tempvector = null;
if (temp1 != null) {
tempvector = (Vector) temp1.getData(FigureSelection.TYPE);
}
this.setSelectionZOrdered();
FigureSelection temp2 = new FigureSelection(this.getSelectionZOrdered());
UndoableEdit edit = new AdvancedCopyCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), tempvector,
(Vector) temp2.getData(FigureSelection.TYPE));
copySelection();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
public boolean isExecutable() {
return this.getView().selectionCount() > 0;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
copySelection(new FigureSelection(m_NewClipBoard));
m_HasBeenDone = true;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_OldClipBoard != null) {
copySelection(new FigureSelection(m_OldClipBoard));
}
m_HasBeenDone = false;
 
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedDuplicateCommand.java
New file
0,0 → 1,95
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
 
import CH.ifa.draw.framework.Drawing;
import CH.ifa.draw.framework.FigureSelection;
 
/**
* Duplicate the selection and Undo and Redo this action
*/
public class AdvancedDuplicateCommand extends AdvancedFigureTransferCommand {
 
public Vector m_DuplicateSelection = new Vector();
 
/**
* @param a_Name the name of the command
*/
public AdvancedDuplicateCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
*/
public AdvancedDuplicateCommand(String a_Name, AdvancedStandardDrawing a_Drawing) {
super(a_Name, a_Drawing);
setSelectionZOrdered();
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
FigureSelection selection = getView().getFigureSelection();
Drawing draw = m_Drawing;
Vector figures = (Vector) selection.getData(FigureSelection.TYPE);
UndoableEdit edit = new AdvancedDuplicateCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing());
getView().clearSelection();
insertFigures(figures, 10, 10);
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
m_Drawing.removeAll(getSelectionZOrdered());
getView().clearSelection();
m_Drawing.checkDamage();
 
m_HasBeenDone = false;
 
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
getView().clearSelection();
insertFigures(getSelectionZOrdered(), 10, 10);
m_Drawing.checkDamage();
m_HasBeenDone = true;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedPasteCommand.java
New file
0,0 → 1,122
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.awt.Point;
import java.awt.Rectangle;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.FigureSelection;
import CH.ifa.draw.util.Clipboard;
 
/**
* Insert the clipboard into the drawing and Undo and Redo this action.
* @see Clipboard
*/
public class AdvancedPasteCommand extends AdvancedFigureTransferCommand {
 
public Point m_Insertpoint;
public Vector m_Figures;
 
/**
* @param a_Name the name of the command
*/
public AdvancedPasteCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_LastClick the point that was clicked last (point where figure will be inserted)
*/
public AdvancedPasteCommand(String a_Name, AdvancedStandardDrawing a_Drawing,
Point a_LastClick, Vector a_Figures) {
super(a_Name, a_Drawing);
setSelectionZOrdered();
m_Insertpoint = a_LastClick;
m_Figures = a_Figures;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
Point lastClick = getView().lastClick();
FigureSelection selection = (FigureSelection) Clipboard.getClipboard().getContents();
Vector tempvector = null;
if (selection != null) {
tempvector = (Vector) selection.getData(FigureSelection.TYPE);
UndoableEdit edit = new AdvancedPasteCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), lastClick, tempvector);
 
if (tempvector.size() == 0)
return;
 
Rectangle r = bounds(tempvector.elements());
getView().clearSelection();
insertFigures(tempvector, lastClick.x - r.x, lastClick.y - r.y);
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
}
 
public Rectangle bounds(Enumeration k) {
Rectangle r = ((Figure) k.nextElement()).displayBox();
while (k.hasMoreElements())
r.add(((Figure) k.nextElement()).displayBox());
return r;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
deleteSelection(m_Figures);
m_Drawing.checkDamage();
m_HasBeenDone = false;
 
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
Vector tempvector = m_Figures;
if (tempvector != null) {
if (tempvector.size() == 0)
return;
 
Rectangle r = bounds(tempvector.elements());
insertFigures(tempvector, m_Insertpoint.x - r.x, m_Insertpoint.y - r.y);
m_Drawing.checkDamage();
}
m_HasBeenDone = true;
}
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedSendToBackCommand.java
New file
0,0 → 1,115
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
import CH.ifa.draw.framework.Drawing;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.FigureEnumeration;
import CH.ifa.draw.standard.FigureEnumerator;
 
/**
* Sends the selected figures to the back of
* the other figures and Undo and Redo this action
*
* @see AdvancedBringToFrontCommand
*/
public class AdvancedSendToBackCommand extends AdvancedCommand {
 
Vector m_IndexIntegers;
 
/**
* @param a_Name the name of the command
*/
public AdvancedSendToBackCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_Indexes the original positions of the figures
*/
public AdvancedSendToBackCommand(String a_Name, AdvancedStandardDrawing a_Drawing,
Vector a_Indexes) {
super(a_Name, a_Drawing);
m_IndexIntegers = a_Indexes;
setSelectionZOrdered();
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
FigureEnumeration k = new FigureEnumerator(getView().selectionZOrdered());
Vector figurevector = new Vector();
Vector indexvector = new Vector();
Figure tempFigure;
Drawing draw = m_Drawing;
UndoableEdit edit = new AdvancedSendToBackCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), indexvector);
while (k.hasMoreElements()) {
tempFigure = k.nextFigure();
indexvector.add(new Integer(((AdvancedStandardDrawing) draw).getFigureIndex(tempFigure)));
figurevector.add(tempFigure);
draw.sendToBack(tempFigure);
}
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
for (int i = getSelectionZOrdered().size() - 1; i >= 0; i--) {
((AdvancedStandardDrawing) m_Drawing).bringToPosition(
(Figure) getSelectionZOrdered().get(i),
((Integer) m_IndexIntegers.get(i)).intValue());
}
m_Drawing.checkDamage();
m_HasBeenDone = false;
 
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
for (int i = 0; i < getSelectionZOrdered().size(); i++) {
((AdvancedStandardDrawing) m_Drawing).sendToBack((Figure) getSelectionZOrdered().get(i));
}
m_Drawing.checkDamage();
m_HasBeenDone = true;
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedBringToFrontCommand.java
New file
0,0 → 1,112
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.FigureEnumeration;
import CH.ifa.draw.standard.FigureEnumerator;
 
/**
* Brings the selected figures in the front of
* the other figures and Undo and Redo this action
*
* @see AdvancedSendToBackCommand
*/
public class AdvancedBringToFrontCommand extends AdvancedCommand {
 
private Vector m_IndexIntegers;
 
/**
* @param a_Name the name of the command
*/
public AdvancedBringToFrontCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_Indexes the original positions of the figures
*/
private AdvancedBringToFrontCommand(String a_Name, AdvancedStandardDrawing a_Drawing,
Vector a_Indexes) {
super(a_Name, a_Drawing);
m_IndexIntegers = a_Indexes;
setSelectionZOrdered();
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
FigureEnumeration k = new FigureEnumerator(getView().selectionZOrdered());
Vector figurevector = new Vector();
Vector indexvector = new Vector();
UndoableEdit edit = new AdvancedBringToFrontCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), indexvector);
Figure tempFigure;
while (k.hasMoreElements()) {
tempFigure = k.nextFigure();
indexvector.add(new Integer((m_Drawing).getFigureIndex(tempFigure)));
figurevector.add(tempFigure);
m_Drawing.bringToFront(tempFigure);
}
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
for (int i = getSelectionZOrdered().size() - 1; i >= 0; i--) {
m_Drawing.bringToPosition((Figure) getSelectionZOrdered().get(i),
((Integer) m_IndexIntegers.get(i)).intValue());
}
m_Drawing.checkDamage();
m_HasBeenDone = false;
 
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
for (int i = 0; i < getSelectionZOrdered().size(); i++) {
(m_Drawing).bringToFront((Figure) getSelectionZOrdered().get(i));
}
m_Drawing.checkDamage();
m_HasBeenDone = true;
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedStandardDrawing.java
New file
0,0 → 1,158
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.awt.Dimension;
import java.awt.Rectangle;
import java.util.Enumeration;
import java.util.Vector;
 
import org.emaxx.bpeldesigner.bpel.figures.adv.DashedLineConnection;
import org.emaxx.bpeldesigner.bpel.framework.adv.PopupAble;
 
import CH.ifa.draw.figures.LineConnection;
import CH.ifa.draw.framework.Drawing;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.FigureEnumeration;
import CH.ifa.draw.standard.FigureEnumerator;
import CH.ifa.draw.standard.StandardDrawing;
import CH.ifa.draw.standard.StandardDrawingView;
 
/**
* Adds some functionality to StandardDrawing, like changing window size when figures don't fit in,
* (re)connection of LineConnections and DashedLineConnections, support for storing and restoring the
* depth position of figures
*
* @see Drawing
*/
 
public class AdvancedStandardDrawing extends StandardDrawing {
 
/**
* Constructs the Drawing.
*/
public AdvancedStandardDrawing() {
super();
}
 
/**
* Adds a figure to the list of figures. Initializes the
* the figure's container. Also connects the figure again if it is a LineConnection
*/
public Figure add(Figure figure) {
if (!fFigures.contains(figure)) {
fFigures.addElement(figure);
figure.addToContainer(this);
}
if (figure instanceof LineConnection) {
if (((LineConnection) figure).start() != null
&& ((LineConnection) figure).end() != null) {
((LineConnection) figure).connectStart(((LineConnection) figure).start());
((LineConnection) figure).connectEnd(((LineConnection) figure).end());
}
}
if (figure instanceof DashedLineConnection) {
if (((DashedLineConnection) figure).start() != null
&& ((DashedLineConnection) figure).end() != null) {
((DashedLineConnection) figure).connectStart(((DashedLineConnection) figure).start());
((DashedLineConnection) figure).connectEnd(((DashedLineConnection) figure).end());
}
}
if (figure instanceof PopupAble) {
((PopupAble) figure).addPopup();
}
return figure;
}
 
/**
* Checks the 'damage' on all it's DrawingViews
*/
public synchronized void checkDamage() {
Enumeration each = this.drawingChangeListeners();
while (each.hasMoreElements()) {
Object l = each.nextElement();
if (l instanceof StandardDrawingView) {
checkMinimumSize((StandardDrawingView) l);
((StandardDrawingView) l).repairDamage();
}
}
}
 
/**
* Checks the size of drawing and enlarges the view if the pictures don't fit in
* @param a_View the DrawingView
*/
public void checkMinimumSize(StandardDrawingView a_View) {
FigureEnumeration k = new FigureEnumerator(new Vector());
if (a_View.drawing() != null) {
k = a_View.drawing().figures();
} else {
k = new FigureEnumerator(new Vector());
}
Dimension d = new Dimension(0, 0);
while (k.hasMoreElements()) {
Rectangle r = k.nextFigure().displayBox();
d.width = Math.max(d.width, r.x + r.width);
d.height = Math.max(d.height, r.y + r.height);
}
if (a_View.getMinimumSize().height < d.height + 100) {
a_View.getMinimumSize().height = d.height + 300;
a_View.setSize(a_View.getMinimumSize());
}
if (a_View.getMinimumSize().width < d.width + 100) {
a_View.getMinimumSize().width = d.width + 300;
a_View.setSize(a_View.getMinimumSize());
}
}
 
/**
* Adds a vector of figures.
* @see #add
*/
public void addAll(Vector newFigures) {
Enumeration k = newFigures.elements();
while (k.hasMoreElements())
add((Figure) k.nextElement());
}
 
/**
* @param figure The figure from which you want the position of the drawing order
* @return the position of the drawing order
*/
public synchronized int getFigureIndex(Figure figure) {
return fFigures.indexOf(figure);
}
 
/**
* This function brings a figure to a certain position in the drawing
* order from back to front
* @param figure the figure that needs to be brought to
* @param index the position in the order from back to front
*/
public synchronized void bringToPosition(Figure figure, int index) {
if (fFigures.contains(figure)) {
fFigures.removeElement(figure);
fFigures.add(index, figure);
figure.changed();
}
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedCommandButtonListener.java
New file
0,0 → 1,58
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
import CH.ifa.draw.util.PaletteButton;
import CH.ifa.draw.util.PaletteListener;
 
/**
* This class listens to a AdvancedCommandButton and executes the AdvancedCommand when pressed
*/
public class AdvancedCommandButtonListener implements PaletteListener {
 
private AdvancedCommand m_AdvancedCommand;
 
/**
* Create an AdvancedCommandButtonListener with an AdvancedCommand
* @param a_AdvancedCommand The command to be executed when the button is pressed
*/
public AdvancedCommandButtonListener(AdvancedCommand a_AdvancedCommand) {
m_AdvancedCommand = a_AdvancedCommand;
}
 
/**
* The user selected a palette entry. The selected button is
* passed as an argument.
*/
public void paletteUserSelected(PaletteButton button) {
m_AdvancedCommand.execute();
}
 
/**
* The user moved the mouse over the palette entry.
*/
public void paletteUserOver(PaletteButton button, boolean inside) {
 
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedHierarchyUpCommand.java
New file
0,0 → 1,84
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
 
import org.emaxx.bpeldesigner.bpel.standard.BPELChangeScopeCommand;
import org.emaxx.bpeldesigner.bpel.standard.BPELDrawing;
import org.emaxx.bpeldesigner.bpel.standard.BPELFigureHolder;
 
/**
* Command to go one level up in BPEL hierarchy in the view
*/
public class AdvancedHierarchyUpCommand extends AdvancedFigureTransferCommand {
 
/**
* @param a_Name the name of the command
*/
public AdvancedHierarchyUpCommand(String a_Name) {
super(a_Name);
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
BPELFigureHolder l_Owner = null;
if (m_Drawing != null) {
l_Owner = ((BPELDrawing) m_Drawing).getOwner();
}
 
if (l_Owner != null) {
BPELFigureHolder l_BPELFigureHolder = ((BPELFigureHolder) l_Owner).getHolderParent();
if (l_BPELFigureHolder != null) {
BPELChangeScopeCommand l_Command = new BPELChangeScopeCommand("HierarchyUpCommand",
l_BPELFigureHolder);
l_Command.execute();
}
}
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public boolean canUndo() {
return false;
}
 
public boolean canRedo() {
return false;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedSelectionTool.java
New file
0,0 → 1,193
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.awt.Component;
import java.awt.Point;
import java.awt.event.MouseEvent;
 
import javax.swing.JPopupMenu;
 
import org.emaxx.bpeldesigner.bpel.framework.BPELView;
 
import CH.ifa.draw.contrib.PopupMenuFigureSelection;
import CH.ifa.draw.framework.DrawingView;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.Tool;
import CH.ifa.draw.standard.SelectionTool;
 
/**
* This tool is an enhancement of the SelectionTool,
* it has support for Undo/Redo the drag movement.
* @see SelectionTool
*/
public class AdvancedSelectionTool extends SelectionTool {
 
public AdvancedSelectionTool(DrawingView a_View) {
super(a_View);
}
 
/**
* Factory method to create a AdvancedDrag tracker. It is used to drag a figure.
*/
protected Tool createDragTracker(DrawingView a_View, Figure a_Figure) {
return new AdvancedDragTracker(a_View, a_Figure);
}
 
/**
* This method displays a popup menu, if there is one registered with the
* Figure (the Figure's attributes are queried for Figure.POPUP_MENU which
* is used to indicate an association of a popup menu with the Figure).
*
* @param figure Figure for which a popup menu should be displayed
* @param x x coordinate where the popup menu should be displayed
* @param y y coordinate where the popup menu should be displayed
* @param component Component which invoked the popup menu
*/
protected void showPopupMenu(Figure figure, int x, int y, Component comp) {
Object attribute = figure.getAttribute(Figure.POPUP_MENU);
if ((attribute != null) && (attribute instanceof JPopupMenu)) {
JPopupMenu popup = (JPopupMenu) attribute;
if (popup instanceof PopupMenuFigureSelection) {
((PopupMenuFigureSelection) popup).setSelectedFigure(figure);
}
if (comp instanceof BPELView) {
popup.setLocation(((BPELView) comp).lastClick());
}
// calculate offsets for internal MDI frames
Point newLocation = new Point(x, y);
adjustOffsets(comp.getParent(), newLocation);
newLocation.translate(comp.getLocation().x, comp.getLocation().y);
popup.setLocation(newLocation);
popup.setInvoker(comp);
popup.setVisible(true);
 
}
}
 
/**
* Internal MDI frames have offsets where a popup menu should be
* shown (in JDK 1.2).
* This method sums up iteratively all x and y offsets of all
* parent compontents until the top parent component is reached.
*/
private void adjustOffsets(Component comp, Point offsetPoint) {
if (comp != null) {
Point compLocation = comp.getLocation();
offsetPoint.translate(compLocation.x, compLocation.y);
adjustOffsets(comp.getParent(), offsetPoint);
}
}
 
/**
* Hook method which can be overriden by subclasses to provide
* specialised behaviour in the event of a popup trigger.
*/
protected void handlePopupMenu(MouseEvent e, int x, int y) {
Figure figure = drawing().findFigureInside(e.getX(), e.getY());
if (figure != null) {
Object attribute = figure.getAttribute(Figure.POPUP_MENU);
showPopupMenu(figure, e.getX(), e.getY(), e.getComponent());
}
}
 
/**
* MouseListener method for mouseDown events. If the popup trigger has been
* activated, then the appropriate hook method is called.
*
* @param e MouseEvent which should be interpreted
* @param x x coordinate of the MouseEvent
* @param y y coordinate of the MouseEvent
*/
public void mouseDown(MouseEvent e, int x, int y) {
// isPopupTrigger() at mouseDown() is only notified at UNIX systems
if (e.isPopupTrigger()) {
handlePopupMenu(e, x, y);
} else {
super.mouseDown(e, x, y);
handleMouseDown(e, x, y);
}
}
 
/**
* MouseListener method for mouseDrag events. Usually, mouse drags are
* ignored for popup menus or double clicks.
*
* @param e MouseEvent which should be interpreted
* @param x x coordinate of the MouseEvent
* @param y y coordinate of the MouseEvent
*/
public void mouseDrag(MouseEvent e, int x, int y) {
if (!e.isPopupTrigger()) {
super.mouseDrag(e, x, y);
}
}
 
/**
* MouseListener method for mouseUp events. Depending on the kind of event
* the appropriate hook method is called (popupMenuUp for popup trigger,
* doubleMouseClick for a double click, and mouseUp() and mouseClick() for
* normal mouse clicks).
*
* @param e MouseEvent which should be interpreted
* @param x x coordinate of the MouseEvent
* @param y y coordinate of the MouseEvent
*/
public void mouseUp(MouseEvent e, int x, int y) {
if (e.isPopupTrigger()) {
handlePopupMenu(e, x, y);
} else if (e.getClickCount() == 2) {
handleMouseDoubleClick(e, x, y);
} else {
super.mouseUp(e, x, y);
handleMouseUp(e, x, y);
handleMouseClick(e, x, y);
}
}
 
/**
* Hook method which can be overriden by subclasses to provide
* specialised behaviour in the event of a mouse down.
*/
protected void handleMouseDown(MouseEvent e, int x, int y) {
}
 
/**
* Hook method which can be overriden by subclasses to provide
* specialised behaviour in the event of a mouse up.
*/
protected void handleMouseUp(MouseEvent e, int x, int y) {
}
 
/**
* Hook method which can be overriden by subclasses to provide
* specialised behaviour in the event of a mouse click.
*/
protected void handleMouseClick(MouseEvent e, int x, int y) {
}
 
/**
* Hook method which can be overriden by subclasses to provide
* specialised behaviour in the event of a mouse double click.
*/
protected void handleMouseDoubleClick(MouseEvent e, int x, int y) {
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedFigureTransferCommand.java
New file
0,0 → 1,161
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.util.Vector;
 
import org.emaxx.bpeldesigner.bpel.figures.adv.DashedLineConnection;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
import CH.ifa.draw.figures.LineConnection;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.FigureEnumeration;
import CH.ifa.draw.framework.FigureSelection;
import CH.ifa.draw.standard.AbstractFigure;
import CH.ifa.draw.standard.FigureEnumerator;
import CH.ifa.draw.util.Clipboard;
 
/**
* Common base clase for commands that transfer figures
* between a drawing and the clipboard. Has supportmethods for Undo/Redo commands.
*/
public abstract class AdvancedFigureTransferCommand extends AdvancedCommand {
 
/**
* Constructs a drawing command.
* @param a_Name the command name
* @param a_Drawing the drawing that this command should be executed on
*/
public AdvancedFigureTransferCommand(String a_Name, AdvancedStandardDrawing a_Drawing) {
super(a_Name, a_Drawing);
}
 
/**
* @param a_Name the command name
*/
public AdvancedFigureTransferCommand(String a_Name) {
super(a_Name);
}
 
/**
* Deletes the current selection from the drawing.
*/
public void deleteSelection() {
m_Drawing.removeAll(getView().selection());
getView().clearSelection();
}
 
/**
* Deletes the selection from the drawing.
* @param a_Selection the selection of Figures to be deleted
*/
public void deleteSelection(Vector a_Selection) {
m_Drawing.removeAll(a_Selection);
getView().clearSelection();
}
 
/**
* Copies the current selection to the clipboard.
*/
public void copySelection() {
FigureSelection selection = getView().getFigureSelection();
Clipboard.getClipboard().setContents(selection);
}
 
/**
* Copies the current selection to the clipboard.
* @param a_Selection the selection of Figures to be copied to the clipboard
*/
public void copySelection(FigureSelection a_Selection) {
Clipboard.getClipboard().setContents(a_Selection);
}
 
/**
* Inserts a vector of figures and translates them by the
* given offset.
*/
public void insertFigures(Vector a_Figures, int dx, int dy) {
FigureEnumeration e = new FigureEnumerator(a_Figures);
while (e.hasMoreElements()) {
Figure figure = e.nextFigure();
figure.moveBy(dx, dy);
figure = m_Drawing.add(figure);
}
}
 
/**
* Saves lines that are deleted together with one of the objects to which they are connected
* @param a_FigureVector the (parent)Figures that are deleted
*/
public void saveLinesOfFigures(Vector a_FigureVector) {
if (a_FigureVector != null) {
for (int i = 0; i < a_FigureVector.size(); i++) {
Object temp = a_FigureVector.get(i);
if (temp instanceof AbstractFigure) {
((AbstractFigure) temp).saveLines();
}
}
}
return;
}
 
/**
* Restores lines that were deleted together with one of the objects to which they are connected
* @param a_FigureVector the (parent)Figures that were deleted
*/
public void reinsertLines(Vector a_FigureVector) {
for (int i = 0; i < a_FigureVector.size(); i++) {
Object temp = a_FigureVector.get(i);
if (temp instanceof AbstractFigure) {
Vector templines = ((AbstractFigure) temp).getLines();
if (!templines.isEmpty()) {
insertLineFigures(templines, 0, 0);
}
}
}
return;
}
 
/**
* Helps restoring deleted lines
* @param a_Figures The lines to be inserted again
* @param dx the x position
* @param dy the y position
*/
private void insertLineFigures(Vector a_Figures, int dx, int dy) {
FigureEnumeration e = new FigureEnumerator(a_Figures);
while (e.hasMoreElements()) {
Figure figure = e.nextFigure();
figure.moveBy(dx, dy);
if (figure instanceof LineConnection) {
((LineConnection) figure).connectStart(((LineConnection) figure).start());
((LineConnection) figure).connectEnd(((LineConnection) figure).end());
}
if (figure instanceof DashedLineConnection) {
((DashedLineConnection) figure).connectStart(((DashedLineConnection) figure).start());
((DashedLineConnection) figure).connectEnd(((DashedLineConnection) figure).end());
}
figure = m_Drawing.add(figure);
}
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/adv/AdvancedToggleGridCommand.java
New file
0,0 → 1,124
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard.adv;
 
import java.awt.Point;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
import CH.ifa.draw.framework.PointConstrainer;
import CH.ifa.draw.standard.GridConstrainer;
 
/**
* A command to toggle the snap to grid behavior and Undo and Redo this action.
*/
public class AdvancedToggleGridCommand extends AdvancedCommand {
 
private Point m_Grid;
private Point m_OldGrid;
 
/**
* @param a_Name the command name
* @param a_Grid the grid size. A grid size of 1,1 turns grid snapping off.
*/
public AdvancedToggleGridCommand(String a_Name, Point a_Grid) {
super(a_Name);
if (a_Grid == null) {
m_Grid = null;
} else {
m_Grid = new Point(a_Grid.x, a_Grid.y);
}
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_Grid the new grid size
* @param a_OldGrid the old grid size
*/
private AdvancedToggleGridCommand(String a_Name, AdvancedStandardDrawing a_Drawing,
Point a_Grid, Point a_OldGrid) {
super(a_Name, a_Drawing);
if (a_Grid == null) {
m_Grid = null;
} else {
m_Grid = new Point(a_Grid.x, a_Grid.y);
}
if (a_OldGrid == null) {
m_OldGrid = null;
} else {
m_OldGrid = new Point(a_OldGrid.x, a_OldGrid.y);
}
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
PointConstrainer grid = getView().getConstrainer();
Point l_OldGrid = null;
if (grid != null) {
l_OldGrid = new Point(grid.getStepX(), grid.getStepY());
}
if (m_Grid == null) {
getView().setConstrainer(null);
} else {
getView().setConstrainer(new GridConstrainer(m_Grid.x, m_Grid.y));
}
 
UndoableEdit edit = new AdvancedToggleGridCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), m_Grid, l_OldGrid);
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
public boolean isExecutable() {
return getView() != null;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_OldGrid == null) {
getView().setConstrainer(null);
} else {
getView().setConstrainer(new GridConstrainer(m_OldGrid.x, m_OldGrid.y));
}
m_HasBeenDone = false;
 
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
if (m_Grid == null) {
getView().setConstrainer(null);
} else {
getView().setConstrainer(new GridConstrainer(m_Grid.x, m_Grid.y));
}
m_HasBeenDone = true;
}
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELDragTracker.java
New file
0,0 → 1,53
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
 
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedDragTracker;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedMoveCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.DrawingView;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.standard.SelectionTool;
 
/**
* DragTracker implements the dragging of the clicked
* figure. It posts an UndoableEdit to the UndoManager
* which keeps the original position when the dragging
* started and the position when the mousebutton was
* released again.
*
* @see SelectionTool
*/
public class BPELDragTracker extends AdvancedDragTracker {
 
public BPELDragTracker(DrawingView view, Figure anchor) {
super(view, anchor);
}
 
public AdvancedMoveCommand createMoveCommand(Point a_NewPoint) {
return new BPELMoveCommand("Move", (AdvancedStandardDrawing) editor().drawing(),
m_OldPoint, a_NewPoint);
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELCutCommand.java
New file
0,0 → 1,173
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.ActivityGroup;
import org.emaxx.bpeldesigner.bpel.figures.BPELSequenceFigure;
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedCutCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.util.Clipboard;
 
/**
* Delete the selection and move the selected figures to
* the clipboard and Undo and Redo this action
* @see Clipboard
*/
public class BPELCutCommand extends AdvancedCutCommand {
 
public Vector m_CutSelection;
 
/**
* @param a_Name the name of the command
*/
public BPELCutCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param figuresOld the old clipboard
* @param figuresNew the new clipboard
*/
public BPELCutCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Vector a_OldClipboard,
Vector a_NewClipboard, Vector a_CutSelection) {
super(a_Name, a_Drawing, a_OldClipboard, a_NewClipboard);
m_CutSelection = a_CutSelection;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
setSelectionZOrdered();
Vector l_VectorOld = (Vector) Clipboard.getClipboard().getContents();
getView().clearSelection();
saveLinesOfFigures(getSelectionZOrdered());
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Vector l_Figures = new Vector();
Enumeration l_Enum = getSelectionZOrdered().elements();
Vector l_Vector = new Vector();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
if (((BPELDrawing) m_Drawing).getOwner().removeFromScope(l_Figure)) {
if (l_Figure instanceof BPELFigureHolder) {
BPELFigureHolder l_HolderParent;
if (((BPELFigureHolder) l_Figure).getHolderParent() instanceof BPELSequenceFigure) {
l_HolderParent = ((BPELFigureHolder) l_Figure).getHolderParent();
if (l_Figure instanceof ActivityGroup) {
ActivityGroup l_ActivityGroup = (ActivityGroup) l_Figure;
int l_Position = ((BPELSequenceFigure) l_HolderParent).getSequence().getActivityGroupPosition(
l_ActivityGroup);
}
}
 
}
m_Drawing.remove(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
l_Figures.add(l_Figure);
l_Vector.add(l_Figure.clone());
}
}
if (l_Figures.size() > 0) {
UndoableEdit edit = new BPELCutCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), l_VectorOld, l_Vector,
l_Figures);
UndoManage.getUndoableEditSupport().postEdit(edit);
Clipboard.getClipboard().setContents(l_Vector);
}
}
}
m_Drawing.checkDamage();
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_CutSelection != null) {
if (m_CutSelection.size() == 0)
return;
getView().clearSelection();
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_CutSelection.elements();
Vector l_Vector = new Vector();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
boolean l_Possible = ((BPELDrawing) m_Drawing).getOwner().addToScope(
l_Figure);
if (l_Possible) {
m_Drawing.add(l_Figure);
l_Vector.add(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
reinsertLines(l_Vector);
}
}
m_Drawing.checkDamage();
}
Clipboard.getClipboard().setContents(m_OldClipBoard);
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
Clipboard.getClipboard().setContents(m_NewClipBoard);
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_CutSelection.elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
if (((BPELDrawing) m_Drawing).getOwner().removeFromScope(l_Figure)) {
m_Drawing.remove(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = true;
}
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELDrawing.java
New file
0,0 → 1,138
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import org.emaxx.bpeldesigner.bpel.BPELDocument;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.Drawing;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.FigureEnumeration;
 
/**
* The BPEL implementation of the Drawing interface.
* A BPELDrawing holds a reference to the top node element, the BPELDocument
* It holds also its owner, a BPELFigureHolder
* @see Drawing
*/
 
public class BPELDrawing extends AdvancedStandardDrawing {
 
private BPELDocument m_Root = null;
private BPELFigureHolder m_Owner = null;
 
/**
* Constructs the BPELDrawing.
*/
public BPELDrawing() {
super();
}
 
/**
* Due to problems with serializing Popups, Popups need to be added manually. This method
* adds Popups to an element and all its children.
*/
public void addPopupToChildren() {
FigureEnumeration l_Enum = figures();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = l_Enum.nextFigure();
if (l_Figure instanceof BPELFigureHolder) {
((BPELFigureHolder) l_Figure).addPopup();
if (((BPELFigureHolder) l_Figure).getBPELDrawing() != null) {
((BPELFigureHolder) l_Figure).getBPELDrawing().addPopupToChildren();
}
}
}
}
 
/**
* Due to problems with serializing Listeners, Listeners need to be added manually. This method
* adds Popups to an element and all its children.
*/
public void addListenersToChildren() {
FigureEnumeration l_Enum = figures();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = l_Enum.nextFigure();
l_Figure.addToContainer(this);
if (l_Figure instanceof BPELFigureHolder) {
if (((BPELFigureHolder) l_Figure).getBPELDrawing() != null) {
((BPELFigureHolder) l_Figure).getBPELDrawing().addListenersToChildren();
}
}
}
}
 
/**
* This method adds a figure to the Drawing and sets the HolderParent attribute of the figure
* @param the figure to be added
*/
public Figure add(Figure figure) {
if (figure instanceof BPELFigureHolder) {
BPELFigureHolder l_BPELFigure = (BPELFigureHolder) figure;
l_BPELFigure.setHolderParent(this.getOwner());
}
Figure l_Figure = super.add(figure);
return figure;
}
 
/**
* @return the top node element which is a BPELDocument
*/
public BPELDocument getRootDocument() {
return m_Root;
}
 
/**
* Set the top node element which is a BPELDocument
* @param a_Root The top node BPELDocument
*/
public void setRootDocument(BPELDocument a_Root) {
m_Root = a_Root;
}
 
/**
* Constructs a BPELDrawing
* @param a_Owner The owner of this drawing
* @param a_Root The top node element (BPELDocument)
*/
public BPELDrawing(BPELFigureHolder a_Owner, BPELDocument a_Root) {
super();
m_Root = a_Root;
m_Owner = a_Owner;
}
 
/**
* returns the owner of this Drawing
* @return the owner of this Drawing
*/
public synchronized BPELFigureHolder getOwner() {
return m_Owner;
}
 
/**
* sets the owner of this Drawing
* @param a_Owner the owner of this drawing
*/
public synchronized void setOwner(BPELFigureHolder a_Owner) {
m_Owner = a_Owner;
return;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELViewDepthCommand.java
New file
0,0 → 1,139
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.figures.BPELFigure;
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
 
/**
* Change the Viewing Depth of a figure and Undo and Redo this action
*/
public class BPELViewDepthCommand extends AdvancedCommand {
 
private int m_NewDepth;
private int m_OldDepth;
private BPELFigure m_Figure;
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_NewDepth the viewing depth of the figure, -1 is infinite, 1 is only the figure itself
* @param a_OldDepth the viewing depth of the figure, -1 is infinite, 1 is only the figure itself
* @param a_Figure the figure involved
*/
public BPELViewDepthCommand(String a_Name, AdvancedStandardDrawing a_Drawing, int a_NewDepth,
int a_OldDepth, BPELFigure a_Figure) {
super(a_Name, a_Drawing);
setSelectionZOrdered();
m_Figure = a_Figure;
m_NewDepth = a_NewDepth;
m_OldDepth = a_OldDepth;
}
 
/**
* @param a_Name the name of the command
* @param a_NewDepth the viewing depth of the figure, -1 is infinite, 1 is only the figure itself
* @param a_Figure the figure involved
*/
public BPELViewDepthCommand(String a_Name, int a_NewDepth, BPELFigure a_Figure) {
super(a_Name);
m_Figure = a_Figure;
m_NewDepth = a_NewDepth;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
if (m_NewDepth >= -1 && m_NewDepth != 0) {
this.setSelectionZOrdered();
getView().clearSelection();
UndoableEdit edit = new BPELViewDepthCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), m_NewDepth, m_Figure.getLevels(),
m_Figure);
m_Figure.setLevels(m_NewDepth);
m_Figure.setCurrentLevels(m_NewDepth);
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(new Point(0, 0),
new Point(0, 0));
}
}
UndoManage.getUndoableEditSupport().postEdit(edit);
m_Drawing.checkDamage();
}
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_OldDepth >= -1 && m_OldDepth != 0) {
this.setSelectionZOrdered();
getView().clearSelection();
m_Figure.setLevels(m_OldDepth);
m_Figure.setCurrentLevels(m_OldDepth);
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(new Point(0, 0),
new Point(0, 0));
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
if (m_NewDepth >= -1 && m_NewDepth != 0) {
this.setSelectionZOrdered();
getView().clearSelection();
m_Figure.setLevels(m_NewDepth);
m_Figure.setCurrentLevels(m_NewDepth);
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(new Point(0, 0),
new Point(0, 0));
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = true;
}
 
public boolean canRedo() {
return (super.canRedo() && (m_Drawing != null));
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELDialogCommand.java
New file
0,0 → 1,96
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.BorderLayout;
 
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
 
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
import org.emaxx.bpeldesigner.bpel.util.adv.AdvancedCommand;
import org.emaxx.bpeldesigner.input.TabbedDialog;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.util.Clipboard;
 
/**
* open the Dialog for a BPEL figure
* @see Clipboard
*/
public class BPELDialogCommand extends AdvancedCommand {
 
public Figure m_Figure;
 
/**
* @param a_Name the command name
* @param a_Figure the figure which needs to show the dialog
*/
public BPELDialogCommand(String a_Name, Figure a_Figure) {
super(a_Name);
m_Figure = a_Figure;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
if (m_Figure instanceof BPELFigureHolder) {
TabbedDialog l_TabbedDialog = ((BPELFigureHolder) m_Figure).getPanel();
if (l_TabbedDialog != null) {
l_TabbedDialog.initialize();
JDialog l_JDialog = new JDialog((JFrame) null,
((BPELFigureHolder) m_Figure).getHierarchyName(), true);
l_JDialog.setResizable(false);
l_JDialog.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
l_JDialog.getContentPane().add(l_TabbedDialog, BorderLayout.CENTER);
l_JDialog.pack();
l_JDialog.setVisible(true);
}
}
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public boolean canUndo() {
return false;
}
 
public boolean canRedo() {
return false;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELDeleteCommand.java
New file
0,0 → 1,161
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.ActivityGroup;
import org.emaxx.bpeldesigner.bpel.figures.BPELSequenceFigure;
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedDeleteCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.Figure;
 
/**
* Delete the selection and Undo and Redo this action
*/
public class BPELDeleteCommand extends AdvancedDeleteCommand {
 
public Vector m_Figures;
 
/**
* @param a_Name the name of the command
*/
public BPELDeleteCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
*/
public BPELDeleteCommand(String name, AdvancedStandardDrawing a_Drawing, Vector a_Figures) {
super(name, a_Drawing);
m_Figures = a_Figures;
}
 
public void execute() {
 
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
setSelectionZOrdered();
getView().clearSelection();
saveLinesOfFigures(getSelectionZOrdered());
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Vector l_Figures = new Vector();
Enumeration l_Enum = getSelectionZOrdered().elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
if (((BPELDrawing) m_Drawing).getOwner().removeFromScope(l_Figure)) {
if (l_Figure instanceof BPELFigureHolder) {
BPELFigureHolder l_HolderParent;
if (((BPELFigureHolder) l_Figure).getHolderParent() instanceof BPELSequenceFigure) {
l_HolderParent = ((BPELFigureHolder) l_Figure).getHolderParent();
if (l_Figure instanceof ActivityGroup) {
ActivityGroup l_ActivityGroup = (ActivityGroup) l_Figure;
int l_Position = ((BPELSequenceFigure) l_HolderParent).getSequence().getActivityGroupPosition(
l_ActivityGroup);
}
}
 
}
m_Drawing.remove(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
l_Figures.add(l_Figure);
}
}
if (l_Figures.size() > 0) {
UndoableEdit edit = new BPELDeleteCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), l_Figures);
UndoManage.getUndoableEditSupport().postEdit(edit);
}
}
}
m_Drawing.checkDamage();
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_Figures != null) {
if (m_Figures.size() == 0)
return;
getView().clearSelection();
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_Figures.elements();
Vector l_Vector = new Vector();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
boolean l_Possible = ((BPELDrawing) m_Drawing).getOwner().addToScope(
l_Figure);
if (l_Possible) {
m_Drawing.add(l_Figure);
l_Vector.add(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
reinsertLines(l_Vector);
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_Figures.elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
if (((BPELDrawing) m_Drawing).getOwner().removeFromScope(l_Figure)) {
m_Drawing.remove(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = true;
}
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELCreationTool.java
New file
0,0 → 1,84
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
 
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.DrawingView;
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.standard.CreationTool;
 
/**
* This tool is used for 'dropping' the selected BPEL-element in the BPELTool window into the drawing
* A prototype will be cloned and inserted
*/
public class BPELCreationTool extends CreationTool {
 
/**
* Create an instance and set the prototype
* @param view The view needed for AbstractTool
* @param prototype The prototype figure that needs to be cloned when inserted into the Drawing
*/
public BPELCreationTool(DrawingView view, Figure prototype) {
super(view, prototype);
}
 
/**
* If the pressed figure is a TextHolder it can be edited otherwise
* a new text figure is created.
*/
public void mouseDown(MouseEvent e, int x, int y) {
BPELFigureHolder l_BPELFigureHolder = null;
 
Figure pressedFigure = drawing().findFigureInside(x, y);
if (pressedFigure instanceof BPELFigureHolder) {
l_BPELFigureHolder = (BPELFigureHolder) pressedFigure;
if (!l_BPELFigureHolder.acceptsHolding(null))
l_BPELFigureHolder = null;
else {
}
}
Point fAnchorPoint = new Point(x, y);
Figure fCreatedFigure = createFigure();
Rectangle l_DisplayBox = fCreatedFigure.displayBox();
int l_Height = (int) l_DisplayBox.getHeight();
int l_Width = (int) l_DisplayBox.getWidth();
Point cornerpoint = new Point(l_Width, l_Height);
cornerpoint.translate(fAnchorPoint.x, fAnchorPoint.y);
fCreatedFigure.displayBox(fAnchorPoint, cornerpoint);
BPELInsertCommand l_Command = new BPELInsertCommand("Insert Figure",
(AdvancedStandardDrawing) drawing(), fCreatedFigure);
l_Command.execute();
editor().toolDone();
}
 
public void mouseDrag(MouseEvent e, int x, int y) {
}
 
public void mouseUp(MouseEvent e, int x, int y) {
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELInsertCommand.java
New file
0,0 → 1,146
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedInsertCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.Figure;
 
/**
* Insert a figure or a Vector of figures and Undo and Redo this action
*/
public class BPELInsertCommand extends AdvancedInsertCommand {
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_Figure the figure that needs to be inserted
*/
public BPELInsertCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Figure a_Figure) {
super(a_Name, a_Drawing, a_Figure);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_Figures the figures that need to be inserted
*/
public BPELInsertCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Vector a_Figures) {
super(a_Name, a_Drawing, a_Figures);
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
if (m_Figures != null) {
Vector l_Figures = new Vector();
if (m_Figures.size() == 0)
return;
getView().clearSelection();
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_Figures.elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
boolean l_Possible = ((BPELDrawing) m_Drawing).getOwner().addToScope(
l_Figure);
if (l_Possible) {
m_Drawing.add(l_Figure);
l_Figures.add(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
}
if (l_Figures.size() > 0) {
UndoableEdit edit = new BPELInsertCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), l_Figures);
UndoManage.getUndoableEditSupport().postEdit(edit);
}
m_Drawing.checkDamage();
 
}
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_Figures.elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
if (((BPELDrawing) m_Drawing).getOwner().removeFromScope(l_Figure)) {
if (m_DrawApp.view() != null) {
m_DrawApp.view().clearSelection();
}
m_Drawing.remove(l_Figure);
}
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
if (m_Figures != null) {
if (m_Figures.size() == 0) {
return;
}
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_Figures.elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
boolean l_Possible = ((BPELDrawing) m_Drawing).getOwner().addToScope(
l_Figure);
if (l_Possible) {
m_Drawing.add(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = true;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELMoveCommand.java
New file
0,0 → 1,129
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.figures.BPELActivityFigure;
import org.emaxx.bpeldesigner.bpel.figures.BPELSequenceFigure;
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedMoveCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.framework.FigureEnumeration;
import CH.ifa.draw.standard.FigureEnumerator;
 
/**
* Moves the selected figures and Undo and Redo this action
*
*/
public class BPELMoveCommand extends AdvancedMoveCommand {
 
/**
* @param a_Name the name of the command
* @param a_OldPoint old Position
* @param a_NewPoint new Position
*/
public BPELMoveCommand(String a_Name, Point a_OldPoint, Point a_NewPoint) {
super(a_Name, a_OldPoint, a_NewPoint);
}
 
/**
* This constructor can be used if the first execute wont be used but Undo/Redo functionality is needed
* Movement is calculated by moving the selection
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_OldPoint old Position
* @param a_NewPoint new Position
*/
public BPELMoveCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Point a_OldPoint,
Point a_NewPoint) {
super(a_Name, a_Drawing, a_OldPoint, a_NewPoint);
}
 
public void execute() {
if (m_OldPoint != null && m_NewPoint != null) {
setSelectionZOrdered();
UndoableEdit edit = new BPELMoveCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), m_OldPoint, m_NewPoint);
FigureEnumeration l_Figures = new FigureEnumerator(getSelectionZOrdered());
while (l_Figures.hasMoreElements()) {
Figure l_Figure = l_Figures.nextFigure();
if (l_Figure instanceof BPELActivityFigure) {
BPELFigureHolder l_BPELFigureHolder = ((BPELActivityFigure) l_Figure).getHolderParent();
if (l_BPELFigureHolder instanceof BPELSequenceFigure) {
l_BPELFigureHolder.getBPELLayouter().layout(new Point(0, 0),
new Point(0, 0));
}
}
 
}
m_Drawing.checkDamage();
UndoManage.getUndoableEditSupport().postEdit(edit);
}
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
FigureEnumeration l_Figures = new FigureEnumerator(getSelectionZOrdered());
while (l_Figures.hasMoreElements()) {
Figure l_Figure = l_Figures.nextFigure();
l_Figure.moveBy(m_OldPoint.x - m_NewPoint.x, m_OldPoint.y - m_NewPoint.y);
if (l_Figure instanceof BPELActivityFigure) {
BPELFigureHolder l_BPELFigureHolder = ((BPELActivityFigure) l_Figure).getHolderParent();
if (l_BPELFigureHolder instanceof BPELSequenceFigure) {
l_BPELFigureHolder.getBPELLayouter().layout(new Point(0, 0), new Point(0, 0));
}
}
 
}
m_Drawing.checkDamage();
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
FigureEnumeration l_Figures = new FigureEnumerator(getSelectionZOrdered());
while (l_Figures.hasMoreElements()) {
Figure l_Figure = l_Figures.nextFigure();
l_Figure.moveBy(m_NewPoint.x - m_OldPoint.x, m_NewPoint.y - m_OldPoint.y);
if (l_Figure instanceof BPELActivityFigure) {
BPELFigureHolder l_BPELFigureHolder = ((BPELActivityFigure) l_Figure).getHolderParent();
if (l_BPELFigureHolder instanceof BPELSequenceFigure) {
l_BPELFigureHolder.getBPELLayouter().layout(new Point(0, 0), new Point(0, 0));
}
}
}
m_Drawing.checkDamage();
m_HasBeenDone = true;
}
 
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELCopyCommand.java
New file
0,0 → 1,94
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedCopyCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.util.Clipboard;
 
/**
* Copy the selection to the clipboard and Undo and Redo this action
* @see Clipboard
*/
public class BPELCopyCommand extends AdvancedCopyCommand {
 
/**
* @param a_Name the command name
*/
 
public BPELCopyCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param name the command name
* @param a_Drawing the drawing that this command should be executed on
* @param a_FiguresOld the previous clipboard contents
* @param a_FiguresNew the new clipboard contents
*/
public BPELCopyCommand(String name, AdvancedStandardDrawing a_Drawing, Vector a_FiguresOld,
Vector a_FiguresNew) {
super(name, a_Drawing, a_FiguresOld, a_FiguresNew);
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
Vector l_VectorOld = (Vector) Clipboard.getClipboard().getContents();
Vector l_Vector = new Vector();
this.setSelectionZOrdered();
Enumeration l_Enum = getSelectionZOrdered().elements();
 
while (l_Enum.hasMoreElements()) {
l_Vector.add(((Figure) l_Enum.nextElement()).clone());
}
UndoableEdit edit = new BPELCopyCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), l_VectorOld, l_Vector);
Clipboard.getClipboard().setContents(l_Vector);
UndoManage.getUndoableEditSupport().postEdit(edit);
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
Clipboard.getClipboard().setContents(m_NewClipBoard);
m_HasBeenDone = true;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
Clipboard.getClipboard().setContents(m_OldClipBoard);
m_HasBeenDone = false;
}
}
 
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELDuplicateCommand.java
New file
0,0 → 1,152
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedDuplicateCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.util.Clipboard;
 
/**
* Duplicate the selection and Undo and Redo this action
*/
public class BPELDuplicateCommand extends AdvancedDuplicateCommand {
 
public Vector m_DuplicateSelection = new Vector();
 
/**
* @param a_Name the name of the command
*/
public BPELDuplicateCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
*/
public BPELDuplicateCommand(String a_Name, AdvancedStandardDrawing a_Drawing,
Vector a_DuplicateSelection) {
super(a_Name, a_Drawing);
m_DuplicateSelection = a_DuplicateSelection;
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
Vector l_Vector = new Vector();
this.setSelectionZOrdered();
Enumeration l_Enum = getSelectionZOrdered().elements();
 
while (l_Enum.hasMoreElements()) {
l_Vector.add(((Figure) l_Enum.nextElement()).clone());
}
UndoableEdit edit = new BPELDuplicateCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), l_Vector);
Enumeration l_Enum1 = l_Vector.elements();
getView().clearSelection();
Vector l_Figures = new Vector();
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum2 = l_Vector.elements();
while (l_Enum2.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum2.nextElement();
boolean l_Possible = ((BPELDrawing) m_Drawing).getOwner().addToScope(l_Figure);
if (l_Possible) {
l_Figure.moveBy(10, 10);
m_Drawing.add(l_Figure);
l_Figures.add(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
m_Drawing.checkDamage();
}
if (l_Figures.size() > 0) {
UndoManage.getUndoableEditSupport().postEdit(edit);
Clipboard.getClipboard().setContents(l_Vector);
}
}
 
public boolean isExecutable() {
return getView().selectionCount() > 0;
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_DuplicateSelection.elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
if (((BPELDrawing) m_Drawing).getOwner().removeFromScope(l_Figure)) {
m_Drawing.remove(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = false;
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum2 = m_DuplicateSelection.elements();
while (l_Enum2.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum2.nextElement();
boolean l_Possible = ((BPELDrawing) m_Drawing).getOwner().addToScope(l_Figure);
if (l_Possible) {
l_Figure.moveBy(10, 10);
m_Drawing.add(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = true;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/standard/BPELPasteCommand.java
New file
0,0 → 1,163
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel.standard;
 
import java.awt.Point;
import java.awt.Rectangle;
import java.util.Enumeration;
import java.util.Vector;
 
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.UndoManage;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedPasteCommand;
import org.emaxx.bpeldesigner.bpel.standard.adv.AdvancedStandardDrawing;
 
import CH.ifa.draw.framework.Figure;
import CH.ifa.draw.util.Clipboard;
 
/**
* Insert the clipboard into the drawing and Undo and Redo this action.
* @see Clipboard
*/
public class BPELPasteCommand extends AdvancedPasteCommand {
 
/**
* @param a_Name the name of the command
*/
public BPELPasteCommand(String a_Name) {
super(a_Name);
}
 
/**
* @param a_Name the name of the command
* @param a_Drawing the drawing that this command should be executed on
* @param a_LastClick the point that was clicked last (point where figure will be inserted)
*/
public BPELPasteCommand(String a_Name, AdvancedStandardDrawing a_Drawing, Point a_LastClick,
Vector a_Figures) {
super(a_Name, a_Drawing, a_LastClick, a_Figures);
}
 
public void execute() {
m_Drawing = (AdvancedStandardDrawing) m_DrawApp.drawing();
Point lastClick = getView().lastClick();
Vector l_Vector = (Vector) Clipboard.getClipboard().getContents();
if (l_Vector != null) {
Enumeration l_Enum1 = l_Vector.elements();
Vector tempvector = new Vector();
while (l_Enum1.hasMoreElements()) {
tempvector.add(((Figure) l_Enum1.nextElement()).clone());
}
UndoableEdit edit = new BPELPasteCommand(this.getPresentationName(),
(AdvancedStandardDrawing) m_DrawApp.drawing(), lastClick, tempvector);
if (tempvector.size() == 0)
return;
Vector l_Figures = new Vector();
Rectangle r = bounds(tempvector.elements());
getView().clearSelection();
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum2 = tempvector.elements();
while (l_Enum2.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum2.nextElement();
boolean l_Possible = ((BPELDrawing) m_Drawing).getOwner().addToScope(
l_Figure);
if (l_Possible) {
l_Figure.moveBy(lastClick.x - r.x, lastClick.y - r.y);
m_Drawing.add(l_Figure);
l_Figures.add(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
}
if (l_Figures.size() > 0) {
UndoManage.getUndoableEditSupport().postEdit(edit);
Clipboard.getClipboard().setContents(l_Vector);
}
m_Drawing.checkDamage();
}
}
 
public void undo() throws CannotUndoException {
if (!canUndo()) {
throw new CannotUndoException();
}
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = m_Figures.elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
if (((BPELDrawing) m_Drawing).getOwner().removeFromScope(l_Figure)) {
m_Drawing.remove(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
m_Drawing.checkDamage();
}
m_Drawing.checkDamage();
m_HasBeenDone = false;
 
}
 
public void redo() throws CannotUndoException {
if (!canRedo()) {
throw new CannotRedoException();
}
Vector tempvector = m_Figures;
if (tempvector != null) {
if (tempvector.size() == 0)
return;
 
Rectangle r = bounds(tempvector.elements());
if (m_Drawing instanceof BPELDrawing) {
if (((BPELDrawing) m_Drawing).getOwner() != null) {
Enumeration l_Enum = tempvector.elements();
while (l_Enum.hasMoreElements()) {
Figure l_Figure = (Figure) l_Enum.nextElement();
boolean l_Possible = ((BPELDrawing) m_Drawing).getOwner().addToScope(
l_Figure);
if (l_Possible) {
l_Figure.moveBy(m_Insertpoint.x - r.x, m_Insertpoint.y - r.y);
m_Drawing.add(l_Figure);
if (((BPELDrawing) m_Drawing).getOwner() != null) {
((BPELDrawing) m_Drawing).getOwner().getBPELLayouter().layout(
new Point(0, 0), new Point(0, 0));
}
}
}
}
}
m_Drawing.checkDamage();
}
m_HasBeenDone = true;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Correlation.java
New file
0,0 → 1,190
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Vector;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.emaxx.bpeldesigner.input.Tableable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL Correlation element, BPEL Correlation Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Correlation extends ExtensibleElements implements EditPanelHolder, Tableable {
 
private NCName m_Set = new NCName();
private BPBoolean m_Initiate = new BPBoolean("no");
 
public Correlation() {
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Correlation the instance with the data that should be updated into this instance
*/
public void update(Correlation a_Correlation) {
getSet().update(a_Correlation.getSet());
getInitiate().update(a_Correlation.getInitiate());
}
 
public static Vector getColumnNames() {
Vector l_Vector = new Vector();
l_Vector.add("Set*");
l_Vector.add("Initiate");
return l_Vector;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.Tableable#getRow()
*/
public Vector getRow() {
Vector l_Vector = new Vector();
l_Vector.add(m_Set.toString());
l_Vector.add(m_Initiate.booleanValue());
return l_Vector;
}
 
public NCName getSet() {
return m_Set;
}
 
public BPBoolean getInitiate() {
return m_Initiate;
}
 
public void setSet(NCName a_Set) {
m_Set = a_Set;
return;
}
 
public void setInitiate(BPBoolean a_Initiate) {
m_Initiate = a_Initiate;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("set")) {
setSet(new NCName(l_CurrentValue));
} else if (l_CurrentName.equals("initiate")) {
setInitiate(new BPBoolean(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
TabbedDialog l_EditPanel = new TabbedDialog("Correlation", this, this, a_CustomTable, true);
l_EditPanel.addAttribute(this.getSet(), "Set*");
l_EditPanel.addAttribute(this.getInitiate(), "Initiate");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
Correlation l_Correlation = (Correlation) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("Correlation", l_Correlation, this,
a_CustomTable, false);
l_EditPanel.addAttribute(l_Correlation.getSet(), "Set*");
l_EditPanel.addAttribute(l_Correlation.getInitiate(), "Initiate");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_CorrelationClone) {
if (a_CorrelationClone instanceof Correlation) {
Correlation l_Correlation = (Correlation) a_CorrelationClone;
m_Set = l_Correlation.getSet();
m_Initiate = l_Correlation.getInitiate();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("correlation");
addXMLattribute(l_Element, "set", getSet().toXML());
addXMLattribute(l_Element, "initiate", getInitiate().toXML());
return l_Element;
}
 
/**
* This method should be called by subclasses, the elementname can be the subclasses name
* @param a_Document The general document in which this element is placed
* @param a_Element The XML-element of which the super-attributes and elements should be added
* @return The parameter XML-element (with added attributes)
*/
public Element writeToXML(Document a_Document, Element a_Element) {
addXMLattribute(a_Element, "set", getSet().toXML());
addXMLattribute(a_Element, "initiate", getInitiate().toXML());
return a_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Catch.java
New file
0,0 → 1,161
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL Catch element, BPEL Catch Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Catch extends ActivityOrCompensateContainer implements EditPanelHolder {
 
private QName m_FaultName = new QName();
private NCName m_FaultVariable = new NCName();
 
public Catch() {
}
 
public Catch(QName a_FaultName, NCName a_FaultVariable) {
m_FaultName = a_FaultName;
m_FaultVariable = a_FaultVariable;
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Catch the instance with the data that should be updated into this instance
*/
public void update(Catch a_Catch) {
super.update(a_Catch);
getFaultName().update(a_Catch.getFaultName());
getFaultVariable().update(a_Catch.getFaultVariable());
}
 
public QName getFaultName() {
return m_FaultName;
}
 
public NCName getFaultVariable() {
return m_FaultVariable;
}
 
public void setFaultName(QName a_FaultName) {
m_FaultName = a_FaultName;
return;
}
 
public void setFaultVariable(NCName a_FaultVariable) {
m_FaultVariable = a_FaultVariable;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("faultName")) {
setFaultName(new QName(l_CurrentValue));
} else if (l_CurrentName.equals("faultVariable")) {
setFaultVariable(new NCName(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
Catch l_Catch = (Catch) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("Catch", l_Catch, this, a_ShowPanel);
l_EditPanel.addAttribute(l_Catch.getFaultName(), "FaultName");
l_EditPanel.addAttribute(l_Catch.getFaultVariable(), "FaultVariable");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_CatchClone) {
if (a_CatchClone instanceof Catch) {
Catch l_Catch = (Catch) a_CatchClone;
m_FaultName = l_Catch.getFaultName();
m_FaultVariable = l_Catch.getFaultVariable();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("catch");
super.writeToXML(a_Document, l_Element);
addXMLattribute(l_Element, "faultName", getFaultName().toXML());
addXMLattribute(l_Element, "faultVariable", getFaultVariable().toXML());
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Namespace.java
New file
0,0 → 1,152
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.io.Serializable;
import java.util.Vector;
 
import org.emaxx.bpeldesigner.bpel.framework.adv.DeepCopy;
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.emaxx.bpeldesigner.input.Tableable;
 
/**
* Represents the namespace attribute.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically.
*/
public class Namespace implements EditPanelHolder, Tableable, Serializable {
 
private QName m_Name = new QName();
private BPString m_Value = new BPString();
 
public Namespace() {
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Namespace the instance with the data that should be updated into this instance
*/
public void update(Namespace a_Namespace) {
getName().update((a_Namespace.getName()));
getValue().update((a_Namespace.getValue()));
}
 
public Object clone() {
try {
return DeepCopy.deepCopy(this);
} catch (Exception e) {
System.out.println("Caught an exception while cloning");
return null;
}
}
 
public static Vector getColumnNames() {
Vector l_Vector = new Vector();
l_Vector.add("Namespace*");
l_Vector.add("Targetnamespace*");
return l_Vector;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.Tableable#getRow()
*/
public Vector getRow() {
Vector l_Vector = new Vector();
l_Vector.add(m_Name.toString());
l_Vector.add(m_Value.toString());
return l_Vector;
}
 
public QName getName() {
return m_Name;
}
 
public void setName(QName a_Name) {
m_Name = a_Name;
}
 
public BPString getValue() {
return m_Value;
}
 
public void setValue(BPString a_Value) {
m_Value = a_Value;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
TabbedDialog l_EditPanel = new TabbedDialog("Namespace", this, this, a_CustomTable, true);
l_EditPanel.addAttribute(this.getName(), "Name*");
l_EditPanel.addAttribute(this.getValue(), "Value*");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
Namespace l_Namespace = (Namespace) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("Namespace", l_Namespace, this, a_CustomTable,
false);
l_EditPanel.addAttribute(l_Namespace.getName(), "Name*");
l_EditPanel.addAttribute(l_Namespace.getValue(), "Value*");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_NamespaceClone) {
if (a_NamespaceClone instanceof Namespace) {
Namespace l_Namespace = (Namespace) a_NamespaceClone;
m_Name = l_Namespace.getName();
m_Value = l_Namespace.getValue();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
return null;
}
 
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Link.java
New file
0,0 → 1,159
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Vector;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.emaxx.bpeldesigner.input.Tableable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL Link element, BPEL Link Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Link extends ExtensibleElements implements EditPanelHolder, Tableable {
 
private NCName m_Name = new NCName();
 
public Link() {
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_Link the instance with the data that should be updated into this instance
*/
public void update(Link a_Link) {
super.update(a_Link);
getName().update((a_Link.getName()));
}
 
public static Vector getColumnNames() {
Vector l_Vector = new Vector();
l_Vector.add("LinkName*");
return l_Vector;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.Tableable#getRow()
*/
public Vector getRow() {
Vector l_Vector = new Vector();
l_Vector.add(m_Name.toString());
return l_Vector;
}
 
public NCName getName() {
return m_Name;
}
 
public void setName(NCName a_Name) {
m_Name = a_Name;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("name")) {
setName(new NCName(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
TabbedDialog l_EditPanel = new TabbedDialog("Link", this, this, a_CustomTable, true);
l_EditPanel.addAttribute(this.getName(), "Name*");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
Link l_Link = (Link) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("Link", l_Link, this, a_CustomTable, false);
l_EditPanel.addAttribute(l_Link.getName(), "Name*");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_LinkClone) {
if (a_LinkClone instanceof Link) {
Link l_Link = (Link) a_LinkClone;
m_Name = l_Link.getName();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("link");
addXMLattribute(l_Element, "name", getName().toXML());
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/CompensationHandler.java
New file
0,0 → 1,55
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL CompensationHandler element, BPEL Compensate Nodes can be converted to this class.
* This class supports certain modifying attributes. This class can be saved to a BPEL Node.
*/
public class CompensationHandler extends ActivityOrCompensateContainer {
 
public CompensationHandler() {
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("compensationHandler");
super.writeToXML(a_Document, l_Element);
if (l_Element.hasChildNodes()) {
return l_Element;
} else {
return null;
}
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/CorrelationSet.java
New file
0,0 → 1,202
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.StringTokenizer;
import java.util.Vector;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.emaxx.bpeldesigner.input.Tableable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL CorrelationSet element, BPEL CorrelationSet Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class CorrelationSet extends ExtensibleElements implements Tableable, EditPanelHolder {
 
private BPProperties m_Properties = new BPProperties();
private NCName m_Name = new NCName();
 
public CorrelationSet() {
}
 
public CorrelationSet(BPProperties a_Properties, NCName a_Name) {
m_Properties = a_Properties;
m_Name = a_Name;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.Tableable#getRow()
*/
public Vector getRow() {
Vector l_Vector = new Vector();
l_Vector.add(m_Name.toString());
return l_Vector;
}
 
public static Vector getColumnNames() {
Vector l_Vector = new Vector();
l_Vector.add("Name*");
return l_Vector;
}
 
public void addProperty(BPProperty a_Property) {
m_Properties.addProperty(a_Property);
}
 
public BPProperties getProperties() {
return m_Properties;
}
 
public NCName getName() {
return m_Name;
}
 
public void setProperties(BPProperties a_Properties) {
m_Properties = a_Properties;
return;
}
 
public void setName(NCName a_Name) {
m_Name = a_Name;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("properties")) {
StringTokenizer l_ST = new StringTokenizer(l_CurrentValue);
String l_Temp;
while (l_ST.hasMoreTokens()) {
l_Temp = l_ST.nextToken();
addProperty(new BPProperty(new QName(l_Temp)));
}
} else if (l_CurrentName.equals("name")) {
setName(new NCName(l_CurrentValue));
}
 
}
}
 
public String toString() {
if (m_Name != null) {
return m_Name.getName();
} else {
return "";
}
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_CorrelationSet the instance with the data that should be updated into this instance
*/
public void update(CorrelationSet a_CorrelationSet) {
super.update(a_CorrelationSet);
getName().update((a_CorrelationSet.getName()));
m_Properties = (a_CorrelationSet.getProperties());
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
TabbedDialog l_EditPanel = new TabbedDialog("CorrelationSet", this, this, a_CustomTable,
true);
l_EditPanel.addAttribute(this.getName(), "Name*");
l_EditPanel.addTab(this.getProperties());
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
CorrelationSet l_CorrelationSet = (CorrelationSet) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("CorrelationSet", l_CorrelationSet, this,
a_CustomTable, false);
l_EditPanel.addAttribute(l_CorrelationSet.getName(), "Name*");
l_EditPanel.addTab(this.getProperties());
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_CorrelationSetClone) {
if (a_CorrelationSetClone instanceof CorrelationSet) {
CorrelationSet l_CorrelationSet = (CorrelationSet) a_CorrelationSetClone;
m_Name = l_CorrelationSet.getName();
m_Properties = l_CorrelationSet.getProperties();
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowPanel()
*/
public ShowPanel getShowPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getShowEditPanel(org.emaxx.bpeldesigner.input.ShowPanel)
*/
public TabbedDialog getShowEditPanel(ShowPanel a_ShowPanel) {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("correlationSet");
addXMLattribute(l_Element, "properties", getProperties().toXML());
addXMLattribute(l_Element, "name", getName().toXML());
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/Switch.java
New file
0,0 → 1,137
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Enumeration;
import java.util.Vector;
 
import org.emaxx.bpeldesigner.bpel.figures.BPELCaseFigure;
import org.emaxx.bpeldesigner.bpel.figures.BPELOtherwiseFigure;
import org.emaxx.bpeldesigner.bpel.standard.BPELDrawing;
import org.emaxx.bpeldesigner.bpel.standard.BPELFigureHolder;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
 
/**
* Represents the BPEL Switch element, BPEL Switch Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class Switch extends Activity implements ActivityGroup {
 
private BPELDrawing m_Drawing;
private Vector m_Case = new Vector();
private Otherwise m_Otherwise;
 
public Switch() {
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ExtensibleElements#getBPELDrawing(CH.ifa.draw.standard.BPELFigureHolder)
*/
public BPELDrawing getBPELDrawing(BPELFigureHolder a_BPELFigureHolder) {
if (m_Drawing == null) {
if (a_BPELFigureHolder.getHolderParent() != null) {
m_Drawing = new BPELDrawing(a_BPELFigureHolder,
a_BPELFigureHolder.getHolderParent().getBPELDrawing().getRootDocument());
} else {
m_Drawing = new BPELDrawing(a_BPELFigureHolder, null);
}
if (this.getCase() != null) {
Enumeration l_Enum = this.getCase().elements();
while (l_Enum.hasMoreElements()) {
BPELCaseFigure l_CaseFigure = new BPELCaseFigure();
l_CaseFigure.setCase((Case) l_Enum.nextElement());
m_Drawing.add(l_CaseFigure);
}
}
if (this.getOtherwise() != null) {
BPELOtherwiseFigure l_OtherwiseFigure = new BPELOtherwiseFigure();
l_OtherwiseFigure.setOtherwise(this.getOtherwise());
m_Drawing.add(l_OtherwiseFigure);
}
}
return m_Drawing;
}
 
public void setOtherwise(Otherwise a_Otherwise) {
m_Otherwise = a_Otherwise;
return;
}
 
public Otherwise getOtherwise() {
return m_Otherwise;
}
 
public void addCase(Case a_Case) {
m_Case.add(a_Case);
}
 
public boolean removeCase(Case a_Case) {
return m_Case.remove(a_Case);
}
 
public Vector getCase() {
return m_Case;
}
 
public void setCase(Vector a_Case) {
m_Case = a_Case;
return;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
NodeList children = a_Node.getChildNodes();
if (children != null) {
for (int i = 0; i < children.getLength(); i++) {
String l_TempNodeName = children.item(i).getNodeName();
if (l_TempNodeName.equals("case")) {
Case l_Case = new Case();
l_Case.handleParse(children.item(i));
addCase(l_Case);
} else if (l_TempNodeName.equals("otherwise")) {
Otherwise l_Otherwise = new Otherwise();
l_Otherwise.handleParse(children.item(i));
setOtherwise(l_Otherwise);
}
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#writeToXML(org.w3c.dom.Document)
*/
public Element writeToXML(Document a_Document) {
Element l_Element = a_Document.createElement("switch");
super.writeToXML(a_Document, l_Element);
Enumeration l_Enum = getCase().elements();
while (l_Enum.hasMoreElements()) {
addXMLChild(l_Element, ((Case) l_Enum.nextElement()).writeToXML(a_Document));
}
return l_Element;
}
}
/trunk/mobe/src/org/emaxx/bpeldesigner/bpel/SimplePartnerLink.java
New file
0,0 → 1,160
/*
* Copyright (c) 2004 eMAXX
*
* This file is part of the MOBE (MidOffice BPEL Engine) designer.
*
* The MOBE designer is free software; you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* The MOBE designer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with the MOBE designer;
* if not, write to the
*
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*/
package org.emaxx.bpeldesigner.bpel;
 
import java.util.Vector;
 
import org.emaxx.bpeldesigner.input.CustomTable;
import org.emaxx.bpeldesigner.input.EditPanelHolder;
import org.emaxx.bpeldesigner.input.ShowPanel;
import org.emaxx.bpeldesigner.input.TabbedDialog;
import org.emaxx.bpeldesigner.input.Tableable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
 
/**
* Represents the BPEL SimplePartnerLink element, BPEL SimplePartnerLink Nodes can be converted to this class.
* This class supports certain modifying attributes and elements and contains a JPanel
* for editing values graphically. This class can be saved to a BPEL Node.
*/
public class SimplePartnerLink extends ExtensibleElements implements EditPanelHolder, Tableable {
 
private NCName m_Name = new NCName();
 
public SimplePartnerLink() {
}
 
/**
* This method updates this instance with an instance of the same class, such that
* reference to this instance sub-elements remain intact
* @param a_SimplePartnerLink the instance with the data that should be updated into this instance
*/
public void update(SimplePartnerLink a_SimplePartnerLink) {
super.update(a_SimplePartnerLink);
getName().update((a_SimplePartnerLink.getName()));
}
 
public static Vector getColumnNames() {
Vector l_Vector = new Vector();
l_Vector.add("SimplePartnerLinkName*");
return l_Vector;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.Tableable#getRow()
*/
public Vector getRow() {
Vector l_Vector = new Vector();
l_Vector.add(m_Name.toString());
return l_Vector;
}
 
public NCName getName() {
return m_Name;
}
 
public void setName(NCName a_Name) {
m_Name = a_Name;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.xml.ParseAble#handleParse(org.w3c.dom.Node)
*/
public void handleParse(Node a_Node) {
super.handleParse(a_Node);
String l_CurrentName;
String l_CurrentValue;
 
NamedNodeMap attributes = a_Node.getAttributes();
for (int i = 0; i < attributes.getLength(); i++) {
Node current = attributes.item(i);
l_CurrentName = current.getNodeName();
l_CurrentValue = current.getNodeValue();
 
if (l_CurrentName.equals("name")) {
setName(new NCName(l_CurrentValue));
}
}
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#checkEditPanel()
*/
public String checkEditPanel() {
return null;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getAddPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getAddPanel(CustomTable a_CustomTable) {
TabbedDialog l_EditPanel = new TabbedDialog("SimplePartnerLink", this, this, a_CustomTable,
true);
l_EditPanel.addAttribute(this.getName(), "Name*");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#getSelectedEditPanel(org.emaxx.bpeldesigner.input.CustomTable)
*/
public TabbedDialog getSelectedEditPanel(CustomTable a_CustomTable) {
SimplePartnerLink l_SimplePartnerLink = (SimplePartnerLink) this.clone();
TabbedDialog l_EditPanel = new TabbedDialog("SimplePartnerLink", l_SimplePartnerLink, this,
a_CustomTable, false);
l_EditPanel.addAttribute(l_SimplePartnerLink.getName(), "Name*");
return l_EditPanel;
}
 
/* (non-Javadoc)
* @see org.emaxx.bpeldesigner.input.EditPanelHolder#saveEditPanel(java.lang.Object)
*/
public void saveEditPanel(Object a_SimplePartnerLinkClone) {
if (a_SimplePartnerLinkClone instanceof SimplePartnerLink) {
SimplePartnerLink l_SimplePartnerLink = (SimplePartnerLink) a_SimplePartnerLinkClone;
m_Name = l_SimplePartnerLink.getName();
}