Methods Summary |
---|
private void | visitAttribute(UMLAttribute uattr)
o.out( "(object ClassAttribute " + o.makeString( uattr.getName() ) );
o.advance();
o.out( "quid" + o.tab() + o.makeString( optioner.linker.genID() ) );
if( uattr.getProperty("stereotype") != null )
o.out( "stereotype" + o.tab() + o.makeString(uattr.getProperty("stereotype")) );
o.out( "type" + o.tab() + o.makeString( uattr.getTypeExpression() ) );
Object initvObj = uattr.getInitialValue();
String initv = (initvObj!=null) ? initvObj.toString() : null;
if( initv != null )
{
if( o.isString( initv ) )
o.out( "initv" + o.tab() + o.makeLongString( initv ) );
else
o.out( "initv" + o.tab() + o.makeString( initv ) );
}
o.retreat();
o.closeObject(); // close ClassAttribute
|
private void | visitClass(UMLClass uc)visitClass
String quid = quidTable.get( uc.getQualifiedName() );
String ref = refTable.get( optioner.CurrentDiagram + "#" + uc.getQualifiedName() + "#View" );
java.awt.Rectangle rect = uc.getRectangle();
int x = 0, y = 0, w = 0, h = 0;
if( rect != null )
{
x = ( rect.x + rect.width / 2 ) * 3;
y = ( rect.y + rect.height / 2 ) * 3;
w = rect.width * 3;
h = rect.height * 3;
}
if( optioner.isVisual )
{
if( optioner.isClassViewMode )
{
o.out( "(object ClassView " + o.makeString( "Class" ) + " " + o.makeString( o.makeRose98StyleQualifiedName( uc.getQualifiedName() ) ) + " @" + ref );
o.advance();
o.out( "IncludeAttribute" + o.tab() + o.makeBooleanString(true) );
o.out( "IncludeOperation" + o.tab() + o.makeBooleanString(true) );
o.out( "location" + o.tab() + "(" + x + ", " + y + ")" );
o.out( "width" + o.tab() + w );
o.out( "height" + o.tab() + h );
o.out( "quidu" + o.tab() + o.makeString( quid ) );
o.out( "annotation" + o.tab() + "8" );
o.out( "autoResize" + o.tab() + o.makeBooleanString(true) );
o.retreat();
o.closeObject(); // ClassView
}
else
{
/* Realizations */
UMLGeneralizationEnumeration qge = uc.getGeneralizations();
while( qge.hasMoreElements() )
{
UMLGeneralization qg = qge.getNextUMLGeneralization();
String supername = qg.getSupertype().getQualifiedName();
if( qg.getSupertype() instanceof UMLInterface ) {
if((String)optioner.linker.getQuidTable().get(supername) != null)
{
o.out( "(object RealizeView " + o.makeString(null) + " @" + optioner.linker.genRef() );
o.advance();
String inhQuidu = quidTable.get( uc.getQualifiedName() + "#" + supername + "#Inheritance" );
o.out( "quidu" + o.tab() + o.makeString( inhQuidu ) );
o.out( "client" + o.tab() + "@" + ref );
String supplier = refTable.get( optioner.CurrentDiagram + "#" + supername + "#View" );
o.out( "supplier" + o.tab() + "@" + supplier );
visitPoints( qg.getPoints() );
o.out( "line_style" + o.tab() + "0" );
o.retreat();
o.closeObject(); // InheritView
}
}
}
/* Generalizations */
qge = uc.getGeneralizations();
while( qge.hasMoreElements() )
{
UMLGeneralization qg = qge.getNextUMLGeneralization();
String supername = qg.getSupertype().getQualifiedName();
if( !( qg.getSupertype() instanceof UMLInterface ) ) {
if( quidTable.get(supername) != null )
{
o.out( "(object InheritView " + o.makeString(null) + " @" + optioner.linker.genRef() );
o.advance();
String inhQuidu = quidTable.get( uc.getQualifiedName() + "#" + supername + "#Inheritance" );
o.out( "quidu" + o.tab() + o.makeString( inhQuidu ) );
o.out( "client" + o.tab() + "@" + ref );
String supplier = refTable.get( optioner.CurrentDiagram + "#" + supername + "#View" );
o.out( "supplier" + o.tab() + "@" + supplier );
visitPoints( qg.getPoints() );
o.out( "line_style" + o.tab() + "0" );
o.retreat();
o.closeObject(); // InheritView
}
}
}
/* Associations */
UMLAssociationEnumeration qasse = uc.getAssociations();
while( qasse.hasMoreElements() )
{
UMLAssociation qa = qasse.getNextUMLAssociation();
UMLAssociationEnd qassendSource = qa.getSourceAssociationEnd();
UMLAssociationEnd qassendDest = qa.getDestAssociationEnd();
String qassendSourceQuid = quidTable.get( qa.getQualifiedName() + "#" + qassendSource.getQualifiedName() + "#Source" );
String qassendSourceQuidu = quidTable.get( qa.getSource().getQualifiedName() );
String qassendDestQuid = quidTable.get( qa.getQualifiedName() + "#" + qassendDest.getQualifiedName() + "#Dest" );
String qassendDestQuidu = quidTable.get( qa.getDest().getQualifiedName() );
String qassRef = optioner.linker.genRef();
String assName = "";
if( qa.getProperty("label") != null )
assName = qa.getProperty("label");
else
assName = qa.getName();
o.out( "(object AssociationViewNew " + o.makeString( assName ) + " @" + qassRef );
o.advance();
String assQuid = quidTable.get( qa.getQualifiedName() );
o.out( "quidu" + o.tab() + o.makeString( assQuid ) );
o.out( "roleview_list" + o.tab() + "(list RoleViews" );
o.advance();
o.out( "(object RoleView " + o.makeString( qassendSource.getName() ) + " @" + optioner.linker.genRef() );
o.advance();
o.out( "Parent_View" + o.tab() + "@" + qassRef );
o.out( "quidu" + o.tab() + o.makeString( qassendSourceQuidu ) );
o.out( "client" + o.tab() + "@" + qassRef );
String supplierRef = refTable.get( optioner.CurrentDiagram + "#" + qa.getSource().getQualifiedName() + "#View" );
o.out( "supplier" + o.tab() + "@" + supplierRef );
visitPoints( qa.getPoints() );
o.out( "line_style" + o.tab() + "0" );
o.retreat();
o.closeObject(); // close RoleView
o.out( "(object RoleView " + o.makeString( qassendDest.getName() ) + " @" + optioner.linker.genRef() );
o.advance();
o.out( "Parent_View" + o.tab() + "@" + qassRef );
o.out( "quidu" + o.tab() + o.makeString( qassendDestQuidu ) );
o.out( "client" + o.tab() + "@" + qassRef );
supplierRef = refTable.get( optioner.CurrentDiagram + "#" + qa.getDest().getQualifiedName() + "#View" );
o.out( "supplier" + o.tab() + "@" + supplierRef );
//visitPoints( qa.getPoints() );
o.out( "line_style" + o.tab() + "0" );
o.retreat();
o.closeObject(); // RoleView
o.retreat();
o.closeObject(); // roleview_list
o.retreat();
o.closeObject(); // AssociationViewNew
}
}
}
else
if( uc.isModelElement() )
{
if( uc.getProperty("alias") != null )
o.out( "(object Class " + o.makeString( uc.getProperty("alias") ) );
else
o.out( "(object Class " + o.makeString( uc.getName() ) );
o.advance();
o.out( "quid" + o.tab() + o.makeString( quid ) );
if( uc.getProperty("Documentation")!=null )
o.out( "documentation" + o.tab() + o.makeLongString( uc.getProperty("Documentation") ) );
else if (uc.getProperty(null) != null )
o.out( "documentation" + o.tab() + o.makeLongString( uc.getProperty(null) ) );
if( uc.getProperty("stereotype")!=null )
o.out( "stereotype" + o.tab() + o.makeString( uc.getProperty("stereotype") ) );
/* Realization */
UMLGeneralizationEnumeration qge = uc.getGeneralizations();
if( qge.hasMoreElements() )
{
o.out( "realized_interfaces" + o.tab() + "(list realize_rel_list" );
o.advance();
while( qge.hasMoreElements() )
{
UMLGeneralization qg = qge.getNextUMLGeneralization();
String supername = qg.getSupertype().getQualifiedName();
if( ( qg.getSupertype() instanceof UMLInterface) ) {
if( quidTable.get(supername) != null )
{
o.out( "(object Realize_Relationship" );
o.advance();
String inhQuid = optioner.linker.genID();
quidTable.put( uc.getQualifiedName() + "#" + supername + "#Inheritance", inhQuid );
o.out( "quid" + o.tab() + o.makeString( inhQuid ) );
o.out( "supplier" + o.tab() + o.makeString( o.makeRose98StyleQualifiedName( supername ) ) );
o.out( "quidu" + o.tab() + o.makeString( quidTable.get( supername ) ) );
o.retreat();
o.closeObject(); // Realize_Relationship
}
}
}
o.retreat();
o.closeObject(); // realized_interfaces
}
/* Generalization */
qge = uc.getGeneralizations();
if( qge.hasMoreElements() )
{
o.out( "superclasses" + o.tab() + "(list inheritance_relationship_list" );
o.advance();
while( qge.hasMoreElements() )
{
UMLGeneralization qg = qge.getNextUMLGeneralization();
String supername = qg.getSupertype().getQualifiedName();
if( !( qg.getSupertype() instanceof UMLInterface) ) {
if( quidTable.get(supername) != null )
{
o.out( "(object Inheritance_Relationship" );
o.advance();
String inhQuid = optioner.linker.genID();
quidTable.put( uc.getQualifiedName() + "#" + supername + "#Inheritance", inhQuid );
o.out( "quid" + o.tab() + o.makeString( inhQuid ) );
o.out( "supplier" + o.tab() + o.makeString( o.makeRose98StyleQualifiedName( supername ) ) );
o.out( "quidu" + o.tab() + o.makeString( quidTable.get( supername ) ) );
o.retreat();
o.closeObject(); // Inheritance_Relationship
}
}
}
o.retreat();
o.closeObject(); // superclasses
}
/* Operations */
o.out( "operations (list Operations" );
UMLOperationEnumeration qoe = uc.getOperations();
while( qoe.hasMoreElements() )
{
o.advance();
UMLOperation qop = qoe.getNextUMLOperation();
visitOperation( qop );
o.retreat();
}
o.closeObject(); // Operations
/* Attributes */
o.out( "class_attributes (list class_attribute_list" );
UMLAttributeEnumeration qae = uc.getAttributes();
while( qae.hasMoreElements() )
{
o.advance();
UMLAttribute qattr = qae.getNextUMLAttribute();
visitAttribute( qattr );
o.retreat();
}
o.closeObject(); // class_attributes
UMLElementEnumeration hyperlinks = uc.getHyperlinks();
if( hyperlinks.hasMoreElements() )
{
while( hyperlinks.hasMoreElements() )
{
UMLElement hyperlink = hyperlinks.getNextUMLElement();
if( hyperlink != null && hyperlink instanceof UMLStateDiagram )
{
(new StateExporter(optioner)).visitStateDiagram( (UMLStateDiagram)hyperlink );
}
}
}
hyperlinks = uc.getHyperlinks();
if( hyperlinks.hasMoreElements() )
{
while( hyperlinks.hasMoreElements() )
{
UMLElement hyperlink = hyperlinks.getNextUMLElement();
if( hyperlink != null && hyperlink instanceof UMLStateDiagram )
{
optioner.isVisual = true;
(new StateExporter(optioner)).visitStateDiagram( (UMLStateDiagram)hyperlink );
optioner.isVisual = false;
}
}
}
o.retreat();
o.closeObject(); // close Class
/* Associations */
UMLAssociationEnumeration qasse = null;
if( uc != null )
{
qasse = uc.getAssociations();
}
if( qasse != null )
while( qasse.hasMoreElements() )
{
UMLAssociation qass;
qass = qasse.getNextUMLAssociation();
if( qass != null )
{
String assquid = quidTable.get( qass.getQualifiedName() );
UMLAssociationEnd qassendSource = qass.getSourceAssociationEnd();
UMLAssociationEnd qassendDest = qass.getDestAssociationEnd();
o.out( "(object Association " + o.makeString( qass.getName() ) );
o.advance();
o.out( "quid" + o.tab() + o.makeString( assquid ) );
o.out( "roles" + o.tab() + "(list role_list" );
o.advance();
/* Source End */
o.out( "(object Role " + o.makeString( qassendSource.getName() ) );
o.advance();
String qassendSourceQuid = quidTable.get( qass.getQualifiedName() + "#" + qassendSource.getQualifiedName() + "#Source" );
o.out( "quid" + o.tab() + o.makeString( qassendSourceQuid ) );
String qassendSourceQuidu = quidTable.get( qass.getSource().getQualifiedName() );
o.out( "quidu" + o.tab() + o.makeString( qassendSourceQuidu ) );
if(qassendSource.getCardinality()!=null)
o.out( "client_cardinality" + o.tab() + "(value cardinality " + o.makeString( qassendSource.getCardinality() ) + ")" );
if( qass.getLinkKind().equals(UMLLink.AGGREGATION) )
o.out( "is_aggregate" + o.tab() + o.makeBooleanString(true) );
o.retreat();
o.closeObject(); // Role
/* Dest End */
o.out( "(object Role " + o.makeString( qassendDest.getName() ) );
o.advance();
String qassendDestQuid = quidTable.get( qass.getQualifiedName() + "#" + qassendDest.getQualifiedName() + "#Dest" );
o.out( "quid" + o.tab() + o.makeString( qassendDestQuid ) );
String qassendDestQuidu = quidTable.get( qass.getDest().getQualifiedName() );
o.out( "quidu" + o.tab() + o.makeString( qassendDestQuidu ) );
if(qassendDest.getCardinality()!=null)
o.out( "client_cardinality" + o.tab() + "(value cardinality " + o.makeString( qassendDest.getCardinality() ) + ")" );
o.out( "is_navigable" + o.tab() + o.makeBooleanString(true) );
o.retreat();
o.closeObject(); // Role
o.retreat();
o.closeObject(); // roles
o.retreat();
o.closeObject(); // Association
}
}
}
|
public void | visitClassDiagram(UMLClassDiagram ucd)
optioner.CurrentDiagram = ucd.getQualifiedName();
String diagramName = "";
if( ucd.getProperty("alias") != null )
diagramName = ucd.getProperty("alias");
else
diagramName = ucd.getName();
if( optioner.isVisual )
{
if( optioner.isCategoryViewMode )
{
if( !ucd.isLogicalPackage() )
{
String cvRef = optioner.linker.genRef();
String cvQuidu = quidTable.get( ucd.getQualifiedName() );
java.awt.Rectangle rect = ucd.getRectangle();
int x = 0, y = 0;
if( rect != null )
{
x = ( rect.x + rect.width / 2 ) * 3;
y = ( rect.y + rect.height / 2 ) * 3;
}
o.out( "(object CategoryView " + o.makeString( diagramName ) + " @" + cvRef );
o.advance();
o.out( "location" + o.tab() + "(" + x + ", " + y + ")" );
o.out( "quidu" + o.tab() + o.makeString( cvQuidu ) );
o.retreat();
o.closeObject(); // CategoryView
}
} else
{
if( ucd.isLogicalPackage() )
o.out( "(object ClassDiagram " + o.makeString( diagramName ) );
else
o.out( "(object ClassDiagram " + o.makeString( "Main" ) );
o.advance();
o.out( "quid" + o.tab() + o.makeString( optioner.linker.genID() ) );
o.out( "items" +o.tab() + "(list diagram_item_list" );
o.advance();
/* class views */
optioner.isClassViewMode = true;
UMLClassEnumeration qce = ucd.getClasses();
while( qce.hasMoreElements() )
{
UMLClass uc = qce.getNextUMLClass();
visitClass( uc );
}
/* interface views */
optioner.isClassViewMode = true;
UMLInterfaceEnumeration qie = ucd.getInterfaces();
while( qie.hasMoreElements() )
{
UMLInterface ui = qie.getNextUMLInterface();
visitInterface( ui );
}
/* classes */
optioner.isClassViewMode = false;
qce = ucd.getClasses();
while( qce.hasMoreElements() )
{
UMLClass uc = qce.getNextUMLClass();
visitClass( uc );
}
/* interfaces */
optioner.isClassViewMode = false;
qie = ucd.getInterfaces();
while( qie.hasMoreElements() )
{
UMLInterface ui = qie.getNextUMLInterface();
visitInterface( ui );
}
/* category views */
UMLClassDiagramEnumeration qcde = ucd.getClassDiagrams();
while( qcde.hasMoreElements() )
{
UMLClassDiagram cd = qcde.getNextUMLClassDiagram();
if( cd != null )
{
optioner.isVisual = true;
optioner.isCategoryViewMode = true;
visitClassDiagram(cd);
//cd.accept( this );
optioner.isCategoryViewMode = false;
}
}
o.retreat();
o.closeObject(); // items
o.retreat();
o.closeObject(); // ClassDiagram
/* nested UseCase diagrams */
UMLUseCaseDiagramEnumeration qucde = ucd.getUseCaseDiagrams();
while( qucde.hasMoreElements() )
{
UMLUseCaseDiagram uucd = qucde.getNextUMLUseCaseDiagram();
if( uucd != null )
{
optioner.isVisual = true;
(new UseCaseExporter(optioner)).visitUseCaseDiagram( uucd );
}
}
/* nested Interaction diagrams */
UMLInteractionDiagramEnumeration uide = ucd.getInteractionDiagrams();
while( uide.hasMoreElements() )
{
UMLInteractionDiagram uid = uide.getNextUMLInteractionDiagram();
if( uid != null )
{
optioner.isVisual = true;
(new InteractionExporter(optioner)).visitInteractionDiagram( uid );
}
}
}
}
else
{
if( !ucd.isLogicalPackage() )
{
if( optioner.rootCategory.equals(ucd.getQualifiedName()) )
o.out( "root_category" + o.tab() + "(object Class_Category " + o.makeString( "Logical View" ) );
else
o.out( "(object Class_Category " + o.makeString( diagramName ) );
o.advance();
o.out( "quid" + o.tab() + o.makeString( (String)optioner.linker.getQuidTable().get( ucd.getQualifiedName() ) ) );
o.out( "logical_models" + o.tab() + "(list unit_reference_list" );
o.advance();
/* nested class diagrams */
UMLClassDiagramEnumeration qcde = ucd.getClassDiagrams();
while( qcde.hasMoreElements() )
{
UMLClassDiagram cd = qcde.getNextUMLClassDiagram();
if( cd != null )
{
optioner.isVisual = false;
visitClassDiagram(cd);
//cd.accept( this );
}
}
UMLClassEnumeration qce = ucd.getClasses();
while( qce.hasMoreElements() )
{
UMLClass qc = qce.getNextUMLClass();
if( qc != null )
{
visitClass( qc );
}
}
UMLInterfaceEnumeration qie = ucd.getInterfaces();
while( qie.hasMoreElements() )
{
UMLInterface qi = qie.getNextUMLInterface();
if( qi != null )
{
visitInterface( qi );
}
}
/* nested UseCase diagrams */
UMLUseCaseDiagramEnumeration qucde = ucd.getUseCaseDiagrams();
while( qucde.hasMoreElements() )
{
UMLUseCaseDiagram uucd = qucde.getNextUMLUseCaseDiagram();
if( uucd != null )
{
optioner.isVisual = false;
(new UseCaseExporter(optioner)).visitUseCaseDiagram( uucd );
}
}
/* nested Interaction diagrams */
UMLInteractionDiagramEnumeration uide = ucd.getInteractionDiagrams();
while( uide.hasMoreElements() )
{
UMLInteractionDiagram uid = uide.getNextUMLInteractionDiagram();
if( uid != null )
{
optioner.isVisual = false;
(new InteractionExporter(optioner)).visitInteractionDiagram( uid );
}
}
/* nested State diagrams */
UMLStateDiagramEnumeration usde = ucd.getStateDiagrams();
while( usde.hasMoreElements() )
{
UMLStateDiagram usd = usde.getNextUMLStateDiagram();
if( usd != null )
{
UMLElementEnumeration uee = usd.getHyperlinks();
if (!uee.hasMoreElements())
(new UseCaseExporter(optioner)).createStateDiagramAnchor( usd );
}
}
o.retreat();
o.closeObject();
o.out( "logical_presentations" + o.tab() + "(list unit_reference_list" );
o.advance();
optioner.isVisual = true;
visitClassDiagram( ucd );
optioner.isVisual = false;
o.retreat();
o.closeObject();
o.retreat();
o.closeObject();
}
}
|
private void | visitInterface(UMLInterface uc)
String quid = quidTable.get( uc.getQualifiedName() );
String ref = refTable.get( optioner.CurrentDiagram + "#" + uc.getQualifiedName() + "#View" );
java.awt.Rectangle rect = uc.getRectangle();
int x = 0, y = 0, w = 0, h = 0;
if( rect != null )
{
x = ( rect.x + rect.width / 2 ) * 3;
y = ( rect.y + rect.height / 2 ) * 3;
w = rect.width * 3;
h = rect.height * 3;
}
if( optioner.isVisual )
{
if( optioner.isClassViewMode )
{
o.out( "(object ClassView " + o.makeString( "Class" ) + " " + o.makeString( o.makeRose98StyleQualifiedName( uc.getQualifiedName() ) ) + " @" + ref );
o.advance();
o.out( "IncludeAttribute" + o.tab() + o.makeBooleanString(true) );
o.out( "IncludeOperation" + o.tab() + o.makeBooleanString(true) );
o.out( "location" + o.tab() + "(" + x + ", " + y + ")" );
o.out( "width" + o.tab() + w );
o.out( "height" + o.tab() + h );
o.out( "quidu" + o.tab() + o.makeString( quid ) );
o.out( "icon" + o.tab() + o.makeString("Interface") );
o.out( "icon_style" + o.tab() + o.makeString("Label") );
o.out( "annotation" + o.tab() + "8" );
o.out( "autoResize" + o.tab() + o.makeBooleanString(true) );
o.retreat();
o.closeObject(); // ClassView
}
else
{
/* Generalizations */
UMLGeneralizationEnumeration qge = uc.getGeneralizations();
while( qge.hasMoreElements() )
{
UMLGeneralization qg = qge.getNextUMLGeneralization();
String supername = qg.getSupertype().getQualifiedName();
if((String)optioner.linker.getQuidTable().get(supername) != null)
{
o.out( "(object InheritView " + o.makeString(null) + " @" + optioner.linker.genRef() );
o.advance();
String inhQuidu = quidTable.get( uc.getQualifiedName() + "#" + supername + "#Inheritance" );
o.out( "quidu" + o.tab() + o.makeString( inhQuidu ) );
o.out( "client" + o.tab() + "@" + ref );
String supplier = refTable.get( optioner.CurrentDiagram + "#" + supername + "#View" );
o.out( "supplier" + o.tab() + "@" + supplier );
o.out( "line_style" + o.tab() + "0" );
visitPoints( qg.getPoints() );
o.retreat();
o.closeObject(); // close InheritView
}
}
/* Associations */
UMLAssociationEnumeration qasse = uc.getAssociations();
while( qasse.hasMoreElements() )
{
UMLAssociation qa = qasse.getNextUMLAssociation();
UMLAssociationEnd qassendSource = qa.getSourceAssociationEnd();
UMLAssociationEnd qassendDest = qa.getDestAssociationEnd();
String qassendSourceQuid = quidTable.get( qa.getQualifiedName() + "#" + qassendSource.getQualifiedName() + "#Source" );
String qassendSourceQuidu = quidTable.get( qa.getSource().getQualifiedName() );
String qassendDestQuid = quidTable.get( qa.getQualifiedName() + "#" + qassendDest.getQualifiedName() + "#Dest" );
String qassendDestQuidu = quidTable.get( qa.getDest().getQualifiedName() );
String qassRef = optioner.linker.genRef();
o.out( "(object AssociationViewNew " + o.makeString( qa.getName() ) + " @" + qassRef );
o.advance();
String assQuid = quidTable.get( qa.getQualifiedName() );
o.out( "quidu" + o.tab() + o.makeString( assQuid ) );
o.out( "roleview_list" + o.tab() + "(list RoleViews" );
o.advance();
o.out( "(object RoleView " + o.makeString( qassendSource.getName() ) + " @" + optioner.linker.genRef() );
o.advance();
o.out( "Parent_View" + o.tab() + "@" + qassRef );
o.out( "quidu" + o.tab() + o.makeString( qassendSourceQuidu ) );
o.out( "client" + o.tab() + "@" + qassRef );
String supplierRef = refTable.get( optioner.CurrentDiagram + "#" + qa.getSource().getQualifiedName() + "#View" );
o.out( "supplier" + o.tab() + "@" + supplierRef );
visitPoints( qa.getPoints() );
o.out( "line_style" + o.tab() + "0" );
o.retreat();
o.closeObject(); // RoleView
o.out( "(object RoleView " + o.makeString( qassendDest.getName() ) + " @" + optioner.linker.genRef() );
o.advance();
o.out( "Parent_View" + o.tab() + "@" + qassRef );
o.out( "quidu" + o.tab() + o.makeString( qassendDestQuidu ) );
o.out( "client" + o.tab() + "@" + qassRef );
supplierRef = refTable.get( optioner.CurrentDiagram + "#" + qa.getDest().getQualifiedName() + "#View" );
o.out( "supplier" + o.tab() + "@" + supplierRef );
//visitPoints( qa.getPoints() );
o.out( "line_style" + o.tab() + "0" );
o.retreat();
o.closeObject(); // RoleView
o.retreat();
o.closeObject(); // roleview_list
o.retreat();
o.closeObject(); // AssociationViewNew
}
}
}
else
if( uc.isModelElement() )
{
if( uc.getProperty("alias") != null )
o.out( "(object Class " + o.makeString( uc.getProperty("alias") ) );
else
o.out( "(object Class " + o.makeString( uc.getName() ) );
o.advance();
o.out( "quid" + o.tab() + o.makeString( quid ) );
if( uc.getProperty("Documentation")!=null )
o.out( "documentation" + o.tab() + o.makeLongString( uc.getProperty("Documentation") ) );
else if (uc.getProperty(null) != null )
o.out( "documentation" + o.tab() + o.makeLongString( uc.getProperty(null) ) );
o.out( "stereotype" + o.tab() + o.makeString( "Interface" ) );
/* Realization */
UMLGeneralizationEnumeration qge = uc.getGeneralizations();
if( qge.hasMoreElements() )
{
o.out( "realized_interfaces" + o.tab() + "(list realize_rel_list" );
o.advance();
while( qge.hasMoreElements() )
{
UMLGeneralization qg = qge.getNextUMLGeneralization();
String supername = qg.getSupertype().getQualifiedName();
if( ( qg.getSupertype() instanceof UMLInterface) ) {
if((String)optioner.linker.getQuidTable().get(supername) != null)
{
o.out( "(object Realize_Relationship" );
o.advance();
String inhQuid = optioner.linker.genID();
quidTable.put( uc.getQualifiedName() + "#" + supername + "#Inheritance", inhQuid );
o.out( "quid" + o.tab() + o.makeString( inhQuid ) );
o.out( "supplier" + o.tab() + o.makeString( o.makeRose98StyleQualifiedName( supername ) ) );
o.out( "quidu" + o.tab() + o.makeString( quidTable.get( supername ) ) );
o.retreat();
o.closeObject(); // close Realize_Relationship
}
}
}
o.retreat();
o.closeObject(); // close realized_interfaces
}
/* Generalization */
qge = uc.getGeneralizations();
if( qge.hasMoreElements() )
{
o.out( "superclasses" + o.tab() + "(list inheritance_relationship_list" );
o.advance();
while( qge.hasMoreElements() )
{
UMLGeneralization qg = qge.getNextUMLGeneralization();
String supername = qg.getSupertype().getQualifiedName();
if( !( qg.getSupertype() instanceof UMLInterface) ) {
if( quidTable.get(supername) != null )
{
o.out( "(object Inheritance_Relationship" );
o.advance();
String inhQuid = optioner.linker.genID();
quidTable.put( uc.getQualifiedName() + "#" + supername + "#Inheritance", inhQuid );
o.out( "quid" + o.tab() + o.makeString( inhQuid ) );
o.out( "supplier" + o.tab() + o.makeString( o.makeRose98StyleQualifiedName( supername ) ) );
o.out( "quidu" + o.tab() + o.makeString( quidTable.get( supername ) ) );
o.retreat();
o.closeObject(); // Inheritance_Relationship
}
}
}
o.retreat();
o.closeObject(); // superclasses
}
/* Operations */
o.out( "operations (list Operations" );
UMLOperationEnumeration qoe = uc.getOperations();
while( qoe.hasMoreElements() )
{
o.advance();
UMLOperation qop = qoe.getNextUMLOperation();
visitOperation( qop );
o.retreat();
}
o.closeObject(); // Operations
/* Attributes */
o.out( "class_attributes (list class_attribute_list" );
UMLAttributeEnumeration qae = uc.getAttributes();
while( qae.hasMoreElements() )
{
o.advance();
UMLAttribute qattr = qae.getNextUMLAttribute();
visitAttribute( qattr );
o.retreat();
}
o.closeObject(); // class_attributes
o.retreat();
o.closeObject(); // Class
/* Associations */
UMLAssociationEnumeration qasse = null;
if( uc != null )
{
qasse = uc.getAssociations();
}
if( qasse != null )
while( qasse.hasMoreElements() )
{
UMLAssociation qass;
qass = qasse.getNextUMLAssociation();
if( qass != null )
{
String assquid = quidTable.get( qass.getQualifiedName() );
UMLAssociationEnd qassendSource = qass.getSourceAssociationEnd();
UMLAssociationEnd qassendDest = qass.getDestAssociationEnd();
o.out( "(object Association " + o.makeString( qass.getName() ) );
o.advance();
o.out( "quid" + o.tab() + o.makeString( assquid ) );
o.out( "roles" + o.tab() + "(list role_list" );
o.advance();
/* Source End */
o.out( "(object Role " + o.makeString( qassendSource.getName() ) );
o.advance();
String qassendSourceQuid = quidTable.get( qass.getQualifiedName() + "#" + qassendSource.getQualifiedName() + "#Source" );
o.out( "quid" + o.tab() + o.makeString( qassendSourceQuid ) );
String qassendSourceQuidu = quidTable.get( qass.getSource().getQualifiedName() );
o.out( "quidu" + o.tab() + o.makeString( qassendSourceQuidu ) );
if(qassendSource.getCardinality()!=null)
o.out( "client_cardinality" + o.tab() + "(value cardinality " + o.makeString( qassendSource.getCardinality() ) + ")" );
if( qass.getLinkKind().equals(UMLLink.AGGREGATION) )
o.out( "is_aggregate" + o.tab() + o.makeBooleanString(true) );
o.retreat();
o.closeObject(); // Role
/* Dest End */
o.out( "(object Role " + o.makeString( qassendDest.getName() ) );
o.advance();
String qassendDestQuid = quidTable.get( qass.getQualifiedName() + "#" + qassendDest.getQualifiedName() + "#Dest" );
o.out( "quid" + o.tab() + o.makeString( qassendDestQuid ) );
String qassendDestQuidu = quidTable.get( qass.getDest().getQualifiedName() );
o.out( "quidu" + o.tab() + o.makeString( qassendDestQuidu ) );
if(qassendDest.getCardinality()!=null)
o.out( "client_cardinality" + o.tab() + "(value cardinality " + o.makeString( qassendDest.getCardinality() ) + ")" );
if( !qass.getLinkKind().equals(UMLLink.AGGREGATION) )
o.out( "is_navigable" + o.tab() + o.makeBooleanString(true) );
o.retreat();
o.closeObject(); // Role
o.retreat();
o.closeObject(); // roles
o.retreat();
o.closeObject(); // Association
}
}
}
|
private void | visitOperation(UMLOperation uop)
o.out( "(object Operation " + o.makeString( uop.getName() ) );
o.advance();
o.out( "quid" + o.tab() + o.makeString( optioner.linker.genID() ) );
if( uop.getProperty("stereotype") != null )
o.out( "stereotype" + o.tab() + o.makeString(uop.getProperty("stereotype")) );
UMLParameterEnumeration upe = uop.getParameters();
UMLParameter up;
if (upe.hasMoreElements())
{
o.out( "parameters" + o.tab() + "(list Parameters" );
o.advance();
while( upe.hasMoreElements() )
{
up = upe.getNextUMLParameter();
if( up != null ) {
o.out( "(object Parameter " + o.makeString(up.getName()) );
o.advance();
o.out( "type" + o.tab() + o.makeString(up.getTypeExpression()) );
String initv = up.getInitialValue();
if( initv != null )
if( o.isString( initv ) )
o.out( "initv" + o.tab() + o.makeLongString(initv) );
else
o.out( "initv" + o.tab() + o.makeString(initv) );
o.retreat();
o.closeObject();
}
}
o.retreat();
o.closeObject();
}
o.out( "result" + o.tab() + o.makeString( uop.getTypeExpression() ) );
if( uop.getConcurrency() != null )
o.out( "concurrency" + o.tab() + o.makeString( uop.getConcurrency() ) );
String v = uop.getVisibility();
if( v != null && ( v.equalsIgnoreCase("public" ) || v.equalsIgnoreCase("private") ||
v.equalsIgnoreCase("protected") || v.equalsIgnoreCase("implementation") ) )
o.out( "opExportControl" + o.tab() + o.makeString( v ) );
else
o.out( "opExportControl" + o.tab() + o.makeString( "Private" ) );
if( uop.getProperty("semantics") != null )
{
o.out( "semantics" + o.tab() + o.makeLongString(uop.getProperty("semantics")) );
}
if( uop.getProperty("preconditions") != null )
{
o.out( "pre_condition" + o.tab() + o.makeLongString(uop.getProperty("preconditions")) );
}
if( uop.getProperty("postconditions") != null )
{
o.out( "post_condition" + o.tab() + o.makeLongString(uop.getProperty("postconditions")) );
}
o.retreat();
o.closeObject(); // close Operation
|
private void | visitPoints(UMLPointEnumeration points)
if( points != null && points.hasMoreElements() )
{
o.out( "vertices" + o.tab() + "(list Points" );
o.advance();
while( points.hasMoreElements() )
{
java.awt.Point point = points.getNextPoint();
o.out( "(" + (point.x * 3) + ", " + (point.y * 3) + ")" );
}
o.retreat();
o.closeObject();
}
|