Commit 365f5316 authored by Erika Segatto's avatar Erika Segatto

Remove alguns warnings

parent ebe3caac
......@@ -51,11 +51,11 @@ type
implementation
uses
InstantCode, SysUtils, Mostra_Processamento, utuStateMachine, fCodeGen, Controls, Forms,
InstantCode, SysUtils, Mostra_Processamento, fCodeGen, Controls, Forms,
fModelMappingsGenerationOptions, fXSDEditor, ituDataBaseLogin, formMemo,
cxuCadastroClasse, cxuCadastroCasoDeUso, ituCadastrarDefinicao, ituCadastrarFormulario,
cxuCadastroClasse, cxuCadastroCasoDeUso, ituCadastrarFormulario,
utuMessage, uCadastroCasoDeUso, uCadastroClasse, ituServiceParameters, ituExplorerV2,
Registry, uRTFEditor, ituXSDExplorer, ituExportUnits, ituOQLExplorerV2, cxuCadastroDefinicaoClasse;
Registry, ituOQLExplorerV2, cxuCadastroDefinicaoClasse;
//procedure TDelphiAddInObj.NotifyUpdate(piMsg: string);
//begin
......@@ -250,9 +250,10 @@ begin
end;
class procedure TDelphiAddInObj.ActionMenu_LoadMethods;
var lsResult: string;
lUtilitario: TUtil;
lMetaModelGenOpt: TMetaModelGenerationOptions;
var
//lsResult: string;
// lUtilitario: TUtil;
lMetaModelGenOpt: TMetaModelGenerationOptions;
begin
lMetaModelGenOpt.SilentMode := false;
lMetaModelGenOpt.CheckDBAttributeNameLength := true;
......@@ -470,7 +471,7 @@ var lDynamoDef: TitCadastrarFormulario;
lSession: cxSession;
lCadastroDefinicaoClasseUC: cxCadastroDefinicaoClasse;
lModel: IModel;
lUMLPackageAux: IUMLPackage;
//lUMLPackageAux: IUMLPackage;
lUMLClassAux: IUMLClass;
begin
lModel := gStarUMLApp.SelectionManager.GetSelectedModelAt(0);
......@@ -525,12 +526,12 @@ end;
class procedure TDelphiAddInObj.ActionMenu_ExportDiagramClasses;
var
lEnum : Integer;
listaStrings : TStringList;
listaObjetos : TInterfaceList;
//var
//lEnum : Integer;
//listaStrings : TStringList;
//listaObjetos : TInterfaceList;
// lClass: IUMLClass;
lForm : TExportUnits;
//lForm : TExportUnits;
begin
//listaStrings := TStringList.Create;
//listaObjetos := TInterfaceList.Create;
......@@ -566,7 +567,7 @@ begin
end;
class procedure TDelphiAddInObj.ActionMenu_UseCaseXSDsEditor;
var lXSDExplorer: TXSDExplorer;
//var lXSDExplorer: TXSDExplorer;
begin
// lModel := StarUMLApp.SelectionManager.GetSelectedModelAt(0);
//if lModel.GetMetaClass.IsKindOf('UMLUseCase') then
......
......@@ -246,7 +246,7 @@ end;
function TUtil.SQLColumnTypeByVendor(piAttributeTicket: acAttributeTicket;
piDBVendor: TDataBaseVendor): string;
begin
Result := '';
end;
function TUtil.SQLScriptDBColumn(piDBColumnMap: acDBColumnMapTicket; piAlwaysNulls: boolean; piDBVendor: TDataBaseVendor): string;
......@@ -1615,24 +1615,25 @@ end;
function TUtil.AlimentarMetamodel(piMetaModelOptions: TMetaModelGenerationOptions; piProgress: TFShowProgress): string;
var lPrjManager: IProjectManager;
lPrj: IUMLProject;
lIMetaModel: IMetaModel;
// lMetaClass: IMetaClass;
lModel: IUMLModel;
lPackage: IUMLPackage;
lClassePersistentObject: IUMLClass;
lElement: IElement;
var
lPrjManager: IProjectManager;
lPrj: IUMLProject;
//lIMetaModel: IMetaModel;
// lMetaClass: IMetaClass;
lModel: IUMLModel;
lPackage: IUMLPackage;
lClassePersistentObject: IUMLClass;
lElement: IElement;
lRootUseCase: IUMLUseCase;
lRootUseCase: IUMLUseCase;
lUMLBaseStateMachine: IUMLStateMachine;
lUMLTopState: IUMLCompositeState;
lUMLBaseSubmachineState: IUMLSubmachineState;
lUMLBaseStateMachine: IUMLStateMachine;
lUMLTopState: IUMLCompositeState;
lUMLBaseSubmachineState: IUMLSubmachineState;
I: integer;
lLostClasses: TStringList;
// lsResult: string;
I: integer;
lLostClasses: TStringList;
// lsResult: string;
begin
if not piMetaModelOptions.SilentMode then PutMessage(FormatDateTime('hh:nn:ss', Time) + ' - Generating model mappings...', gStarUMLApp.GetProject, 2);
......@@ -1652,7 +1653,7 @@ begin
if assigned(lPrj) then
begin
// Meta Modelo do Star UML
lIMetaModel := gStarUMLApp.MetaModel;
//lIMetaModel := gStarUMLApp.MetaModel;
//Obtem a classe acPersistentObject do modelo do StarUML
lElement := gStarUMLApp.FindByPathname(MODELO + '::FrameworkModel::acuFrameworkPackage::' + cBASE_PERSISTENT_OBJECT_CLASS);
......@@ -1732,7 +1733,7 @@ var index, index2, lFixSize, lVarSize: integer;
lClassDisplayName, lAttributeDisplayName: string;
lClassErrors: TStringList;
begin
lsResult := '';
if (poClasseRaiz.GetSpecializationCount > 0) then
begin
if assigned(piProgress) then piProgress.ChangeMessage('Creating Meta Model...', 0, poClasseRaiz.GetSpecializationCount);
......@@ -1940,6 +1941,7 @@ var lRelationTicket: acRelationTicket;
lBidirectional: boolean;
lDisplayName, lDestinationDisplayName, lOriginDisplayName: string;
begin
lsresult := '';
lacOrAggregation := acPropertyAggregation.pvNone;
lacDsAggregation := acPropertyAggregation.pvNone;
......@@ -2360,7 +2362,7 @@ var
lUseCaseCode: String;
begin
Result := '';
//Varre todos os usecases filho de ucUseCase
for lChildUseCaseCount := 0 to poRootUseCase.GetSpecializationCount - 1 do
begin
......@@ -2412,7 +2414,7 @@ end;
function TUtil.GerarBodyRegisterMappings(piModelMappingsOptions: TModelMappingsOptions; const piInstantCodeConsts: TInstantCodeConsts; piProgress: TFShowProgress; piStartAt: Integer; piEndAt: Integer): string;
var lEnum, lEnumAttributes: acEnumerator;
var lEnum: acEnumerator;
lClassTicket: acClassTicket;
lAttributeTicket: acAttributeTicket;
lsNomeClasse, lsTabela, lsIDOCode, lsTypeColumnName, sRegisterMapping, lsAtributo, lsIDO, lsColumnName, lsNomeClasseParent, lsAtrStereotype, lsAtrType: String;
......@@ -4665,10 +4667,11 @@ var li: Integer;
// lPartner: acObject;
// lRelationPartnerList: acRelationPartnerList;
// lRelationPartnerShip: acRelationPartnerShip;
lInstantCodeField: TInstantCodeField;
//lInstantCodeField: TInstantCodeField;
lInstantCodeProperty: TInstantCodeProperty;
lsresult: String;
begin
lsresult := '';
// while piClassTicket <> nil do
// begin
for li := 0 to piClassTicket.RelationTicketsIn.Count - 1 do
......@@ -4953,7 +4956,7 @@ function TUtil.GerarClassPreview_Java(piClass: IUMLClass): string;
end;
var
lsNomeClasse, lsAtributo, lsTipoAttribute, lsNomeUnit: string;
lsNomeClasse, lsAtributo, lsTipoAttribute: string;
index: integer;
lClassTicket: acClassTicket;
lAttributeTicket: acAttributeTicket;
......@@ -4968,7 +4971,7 @@ begin
Result := '';
lParamsConstrutor := '';
lsNomeClasse := piClass.Name;
lsNomeUnit := Copy(lsNomeClasse, 1, 2) + 'u' + Copy(lsNomeClasse, 3, Length(lsNomeClasse)-2);
//lsNomeUnit := Copy(lsNomeClasse, 1, 2) + 'u' + Copy(lsNomeClasse, 3, Length(lsNomeClasse)-2);
lClassTicket := MetaModel.GetClassTicketByName(lsNomeClasse);
lCodigoClasse := PStringWriter.Create;
......@@ -5091,7 +5094,7 @@ function TUtil.GerarClassPreview_JavaHibernate(piClass: IUMLClass): string;
piCodigoClasse.WriteLine('private ' + piTipoAtributo+' '+piNomeAtributo+';');
end;
procedure EscreveGetterSetterClasse(const piCodigoClasse: PStringWriter; piNomeAtributo, piTipoAtributo: String; piVisibility: Integer; piApenasGetter: Boolean = False);
procedure EscreveGetterSetterClasse(const piCodigoClasse: PStringWriter; piNomeAtributo, piTipoAtributo: String; piApenasGetter: Boolean = False);
begin
//Escreve getter and setter
piCodigoClasse.WriteLine('public ' + piTipoAtributo+' get'+piNomeAtributo+'() { return '+' f'+piNomeAtributo+'; }');
......@@ -5105,11 +5108,14 @@ const
_NomeId = 'Id';
var
lsNomeClasse,
lsNomeTabela,
lsAtributo,
lsTipoAttribute: string;
index: integer;
lClassTicket: acClassTicket;
lAttributeTicket: acAttributeTicket;
lAttributeTicket: acAttributeTicket;
lMetaModelPersistenceMapSQL: acMetaModelPersistenceMapSQL;
lClassToDBMapTicket: acClassToDBMapTicket;
lCodigoClasse: PStringWriter;
lParamsConstrutor: string;
......@@ -5122,8 +5128,7 @@ begin
lClassTicket := MetaModel.GetClassTicketByName(lsNomeClasse);
for index := 0 to 2 do
lHasImport[index] := False;
if Copy(lsNomeClasse, 1, 2) = 'ng' then lsNomeClasse := RightStr(lsNomeClasse, Length(lsNomeClasse)-2);
lCodigoClasse := PStringWriter.Create;
try
lCodigoClasse.WriteLine('package adapters.persistence.entities;');
......@@ -5155,14 +5160,20 @@ begin
lHasImport[2] := True;
end;
end;
lCodigoClasse.WriteLine('');
// Incio da classe
lCodigoClasse.WriteLine('');
// Obter ticket do banco
lsNomeTabela := Uppercase(Copy(lsNomeClasse, 0, 2)) + 'U' + Copy(lsNomeClasse, 3, Length(lsNomeClasse)-2);
lMetaModelPersistenceMapSQL := fMetaModelPersistenceMap as acMetaModelPersistenceMapSQL;
lClassToDBMapTicket := lMetaModelPersistenceMapSQL.GetClassToDBMapTicket(lClassTicket);
// Incio da classe
if Copy(lsNomeClasse, 1, 2) = 'ng' then lsNomeClasse := RightStr(lsNomeClasse, Length(lsNomeClasse)-2);
lsNomeTabela := lClassToDBMapTicket.TableName;
lCodigoClasse.WriteLine('@Entity');
lCodigoClasse.WriteLine('@TableGenerator(name = "ddoPessoa", table = "SISBTNUMER", valueColumnName = "SISBNONUME",');
lCodigoClasse.WriteLine(' pkColumnName = "SISBDSNUME", pkColumnValue = "CGR_DDO_PESSOA", allocationSize = 1)');
lCodigoClasse.WriteLine('@TableGenerator(name = "'+lsNomeClasse+'", table = "SISBTNUMER", valueColumnName = "SISBNONUME",');
lCodigoClasse.WriteLine(' pkColumnName = "SISBDSNUME", pkColumnValue = "'+lsNomeTabela+'", allocationSize = 1)');
lCodigoClasse.WriteLine('@Inheritance(strategy = InheritanceType.JOINED)');
lCodigoClasse.WriteLine('@DiscriminatorColumn(name = "CX_TYPE")');
lCodigoClasse.WriteLine('@Table(name = "CGR_DDO_PESSOA")');
lCodigoClasse.WriteLine('@Table(name = "'+lsNomeTabela+'")');
lCodigoClasse.WriteLine('public abstract class ' + lsNomeClasse + ' {');
lCodigoClasse.WriteLine('');
lCodigoClasse.Indent();
......@@ -5257,20 +5268,6 @@ begin
finally
lCodigoClasse.Free;
end;
//lClass := piModelElement as IUMLClass;
//
//lsNomeClasse := lClass.Name;
//
//lsNomeTabela := Uppercase(Copy(lsNomeClasse, 0, 2)) + 'U' + Copy(lsNomeClasse, 3, Length(lsNomeClasse)-2);
//
//lClassTicket := MetaModel.GetClassTicketByName(lsNomeClasse);
//lClassToDBMapTicket := lMetaModelPersistenceMapSQL.GetClassToDBMapTicket(lClassTicket);
//
//lsResult := concat(lsResult, SQLScriptCreateDirectTable(lClassToDBMapTicket, piDBVendor));
//
//lsResult := Concat(lsResult, #13#10#13#10);
//
//lsResult := Concat(lsResult, SQLScriptDirectTableForeignKeys(lClassToDBMapTicket, piDBVendor));
end;
......@@ -5301,7 +5298,7 @@ function TUtil.GerarClassPreview_JavaDomain(piClass: IUMLClass): string;
piCodigoClasse.WriteLine(piTipoAtributo+' f'+piNomeAtributo+';');
end;
procedure EscreveGetterSetterClasse(const piCodigoClasse: PStringWriter; piNomeAtributo, piTipoAtributo: String; piVisibility: Integer; piApenasGetter: Boolean = False);
procedure EscreveGetterSetterClasse(const piCodigoClasse: PStringWriter; piNomeAtributo, piTipoAtributo: String; piApenasGetter: Boolean = False);
begin
//Escreve getter and setter
piCodigoClasse.WriteLine('public ' + piTipoAtributo+' get'+piNomeAtributo+'() { return '+' f'+piNomeAtributo+'; }');
......@@ -5410,7 +5407,7 @@ begin
lCodigoClasse.WriteLine('');
// GETTER/SETTER: Percorre atributos da classe
EscreveGetterSetterClasse(lCodigoClasse, _NomeId, _TipoId, acAttributeVisibility.pvPublic, True);
EscreveGetterSetterClasse(lCodigoClasse, _NomeId, _TipoId, True);
for index := 0 to lClassTicket.Attributes.Count - 1 do
begin
lAttributeTicket := lClassTicket.Attributes.Objects[index] as acAttributeTicket;
......@@ -5418,7 +5415,7 @@ begin
lsTipoAttribute := ObterTipoAtributo(lAttributeTicket.AttributeType);
lParamsConstrutor:= lParamsConstrutor + lsTipoAttribute + ' pi'+ lsAtributo + ', ';
EscreveGetterSetterClasse(lCodigoClasse, lsAtributo, lsTipoAttribute, lAttributeTicket.Visibility);
EscreveGetterSetterClasse(lCodigoClasse, lsAtributo, lsTipoAttribute);
end;
//Escrever RelationsPartnerShips
for index := 0 to lClassTicket.RelationTicketsIn.Count - 1 do
......@@ -5431,7 +5428,7 @@ begin
if lRelation.DestinationMaxMultiplicity > 1
then lsTipoAttribute := 'List<'+lRelation.OriginClassTicket.DisplayName+'>'
else lsTipoAttribute := lRelation.OriginClassTicket.DisplayName;
EscreveGetterSetterClasse(lCodigoClasse, lsAtributo, lsTipoAttribute, acAttributeVisibility.pvProtected);
EscreveGetterSetterClasse(lCodigoClasse, lsAtributo, lsTipoAttribute);
end;
end;
for index := 0 to lClassTicket.RelationTicketsOut.Count - 1 do
......@@ -5444,7 +5441,7 @@ begin
if lRelation.OriginMaxMultiplicity > 1
then lsTipoAttribute := 'List<'+lRelation.DestinationClassTicket.DisplayName+'>'
else lsTipoAttribute := lRelation.DestinationClassTicket.DisplayName;
EscreveGetterSetterClasse(lCodigoClasse, lsAtributo, lsTipoAttribute, acAttributeVisibility.pvProtected, lRelation.OriginMaxMultiplicity > 1);
EscreveGetterSetterClasse(lCodigoClasse, lsAtributo, lsTipoAttribute, lRelation.OriginMaxMultiplicity > 1);
end;
end;
......@@ -5453,7 +5450,7 @@ begin
lCodigoClasse.WriteLine('');
lCodigoClasse.WriteLine('public '+lsNomeClasse+'('+_TipoId+' piId, '+strutils.LeftStr(lParamsConstrutor, Length(lParamsConstrutor)-2)+') {');
lCodigoClasse.Indent();
lCodigoClasse.WriteLine('id = piId;');
lCodigoClasse.WriteLine('fId = piId;');
for index := 0 to lClassTicket.Attributes.Count - 1 do
begin
lsAtributo := lClassTicket.Attributes.Strings[index];
......@@ -5464,7 +5461,8 @@ begin
//Escreve construtor sem id
lCodigoClasse.WriteLine('');
lCodigoClasse.WriteLine('public '+lsNomeClasse+'('+strutils.LeftStr(lParamsConstrutor, Length(lParamsConstrutor)-2)+') {');
lCodigoClasse.Indent();
lCodigoClasse.Indent();
//lCodigoClasse.WriteLine('fId = null;');
for index := 0 to lClassTicket.Attributes.Count - 1 do
begin
lsAtributo := lClassTicket.Attributes.Strings[index];
......@@ -5513,7 +5511,6 @@ var
lInstantCodeModule: TInstantCodeModule;
lInstantCodeProject: TInstantCodeProject;
lInstantCodeClass: TInstantCodeClass;
lInstantCodeField: TInstantCodeField;
lAttributeTicket: acAttributeTicket;
lInstantCodeProperty: TInstantCodeProperty;
......@@ -5611,12 +5608,11 @@ end;
function TUtil.GerarFullSQLPreview(piDBVendor: TDataBaseVendor): string;
var
///////////
lEnumClass, lEnumRelation: acEnumerator;
lMetaModelPersistenceMapSQL: acMetaModelPersistenceMapSQL;
lRelationSQLPersistenceMapTicket: acRelationSQLPersistenceMapTicket;
lClassTicket: acClassTicket;
lAux: string;
lEnumClass, lEnumRelation: acEnumerator;
lMetaModelPersistenceMapSQL: acMetaModelPersistenceMapSQL;
lRelationSQLPersistenceMapTicket: acRelationSQLPersistenceMapTicket;
lClassTicket: acClassTicket;
lAux: string;
begin
Result := format('-- SCRIPT CREATION DATE/TIME %s', [FormatDateTime('dd/mm/yyyy @ hhnn',now)]) + #13#10#13#10;
......@@ -5964,13 +5960,14 @@ end;
procedure TUtil.CarregarMetodosNGU(pUMLClass: IUMLClass; pInstantCodeClass: TInstantCodeClass);
var lMetCont, liCont, liCont2, liParCount, liParIndex: integer;
lsMetName: string;
lMetodo: TInstantCodeMethod;
lVisibility: TInstantCodeVisibility;
lParameter: TInstantCodeParameter;
lUMLOperation: IUMLOperation;
lUMLParameter: IUMLParameter;
var
lMetCont, liCont, liCont2, liParCount, liParIndex: integer;
lsMetName: string;
lMetodo: TInstantCodeMethod;
lVisibility: TInstantCodeVisibility;
lParameter: TInstantCodeParameter;
lUMLOperation: IUMLOperation;
lUMLParameter: IUMLParameter;
begin
lMetCont := pUMLClass.GetOperationCount;
......@@ -6156,28 +6153,26 @@ end;
function TUtil.GerarSQLPreview(piModelElement: IModel; piDBVendor: TDataBaseVendor = dbvSQLServer): string;
var
lClass: IUMLClass;
lAssociation: IUMLAssociation;
lsNomeClasse, lsNomeTabela, lRelationName: string;
lsResult: string;
lClassTicket, lClassOriginTicket, lClassDestTicket: acClassTicket;
lClassToDBMapTicket: acClassToDBMapTicket;
lMetaModelPersistenceMapSQL: acMetaModelPersistenceMapSQL;
lRelationSQLPersistenceMapTicket: acRelationSQLPersistenceMapTicket;
lRelationTicket: acRelationTicket;
// liOriginMinCardinalidade,
liOriginMaxCardinalidade,
// liDestinationMinCardinalidade,
liDestinationMaxCardinalidade, lPos: integer;
lsMin, lsMax: string;
lClass: IUMLClass;
lAssociation: IUMLAssociation;
lsNomeClasse,
lRelationName,
lsResult: string;
lClassTicket,
lClassOriginTicket,
lClassDestTicket: acClassTicket;
lClassToDBMapTicket: acClassToDBMapTicket;
lMetaModelPersistenceMapSQL: acMetaModelPersistenceMapSQL;
lRelationSQLPersistenceMapTicket: acRelationSQLPersistenceMapTicket;
lRelationTicket: acRelationTicket;
// liOriginMinCardinalidade,
liOriginMaxCardinalidade,
// liDestinationMinCardinalidade,
liDestinationMaxCardinalidade, lPos: integer;
lsMax: string;
begin
lsResult := '';
lMetaModelPersistenceMapSQL := fMetaModelPersistenceMap as acMetaModelPersistenceMapSQL;
if (piModelElement.GetClassName = 'UMLClass') then
......@@ -6185,16 +6180,13 @@ begin
lClass := piModelElement as IUMLClass;
lsNomeClasse := lClass.Name;
lsNomeTabela := Uppercase(Copy(lsNomeClasse, 0, 2)) + 'U' + Copy(lsNomeClasse, 3, Length(lsNomeClasse)-2);
//lsNomeTabela := Uppercase(Copy(lsNomeClasse, 0, 2)) + 'U' + Copy(lsNomeClasse, 3, Length(lsNomeClasse)-2);
lClassTicket := MetaModel.GetClassTicketByName(lsNomeClasse);
lClassToDBMapTicket := lMetaModelPersistenceMapSQL.GetClassToDBMapTicket(lClassTicket);
lsResult := concat(lsResult, SQLScriptCreateDirectTable(lClassToDBMapTicket, piDBVendor));
lsResult := Concat(lsResult, #13#10#13#10);
lsResult := Concat(lsResult, SQLScriptDirectTableForeignKeys(lClassToDBMapTicket, piDBVendor));
end
else
......@@ -6223,7 +6215,7 @@ begin
else
begin
lPos := Pos('..', lAssociation.GetConnectionAt(1).Get_Multiplicity);
lsMin := copy(lAssociation.GetConnectionAt(1).Get_Multiplicity, 1, lPos-1);
//lsMin := copy(lAssociation.GetConnectionAt(1).Get_Multiplicity, 1, lPos-1);
lsMax := copy(lAssociation.GetConnectionAt(1).Get_Multiplicity, lPos + 2, length(lAssociation.GetConnectionAt(1).Get_Multiplicity) - (lPos + 1));
// liOriginMinCardinalidade := strtoint(lsMin);
if (uppercase(lsMax) = 'N') or (lsMax = '*') then
......@@ -6246,7 +6238,7 @@ begin
else
begin
lPos := Pos('..', lAssociation.GetConnectionAt(0).Get_Multiplicity);
lsMin := copy(lAssociation.GetConnectionAt(0).Get_Multiplicity, 1, lPos-1);
//lsMin := copy(lAssociation.GetConnectionAt(0).Get_Multiplicity, 1, lPos-1);
lsMax := copy(lAssociation.GetConnectionAt(0).Get_Multiplicity, lPos + 2, length(lAssociation.GetConnectionAt(0).Get_Multiplicity) - (lPos + 1));
// liDestinationMinCardinalidade := strtoint(lsMin);
if (uppercase(lsMax) = 'N') or (lsMax = '*') then
......@@ -6284,32 +6276,33 @@ end;
procedure TUtil.Reversa(psNomePacote, psPrjPath, psSTARUMLprj: string);
var lEnum: acEnumerator;
lStarUMLApp: IStarUMLApplication;
lClassTicket, lPatriarca: acClassTicket;
lPrjManager: IProjectManager;
lPrj: IUMLProject;
lFactory: IUMLFactory;
lModel, lModelBase: IUMLModel;
lElement: IElement;
lPackage, lCommonPack: IUMLPackage;
lClass, lClassePersistentObject: IUMLClass;
lRelationHash: acObjectHash;
lIMetaModel: IMetaModel;
lExtensionManager: IExtensionManager;
lbCriouNovaClasse: boolean;
lPackageUnit: IUMLUnitDocument;
Tela : TFShowProgress;
lMetaModel: acMetaModel;
var
lEnum: acEnumerator;
lStarUMLApp: IStarUMLApplication;
lClassTicket, lPatriarca: acClassTicket;
lPrjManager: IProjectManager;
lPrj: IUMLProject;
lFactory: IUMLFactory;
lModel, lModelBase: IUMLModel;
lElement: IElement;
lPackage, lCommonPack: IUMLPackage;
lClass, lClassePersistentObject: IUMLClass;
lRelationHash: acObjectHash;
//lIMetaModel: IMetaModel;
//lExtensionManager: IExtensionManager;
lbCriouNovaClasse: boolean;
//lPackageUnit: IUMLUnitDocument;
Tela : TFShowProgress;
//lMetaModel: acMetaModel;
begin
try
Tela := TFShowProgressForm.create('Carregando o StarUML...', 1, 100);
// Criao de aplicao STARUML
// lStarUMLApp := StarUML_TLB.CoStarUMLApplication.Create;
//lStarUMLApp := StarUML_TLB.CoStarUMLApplication.Create;
// Obtm Gerenciador de Projeto do STARUML
lPrjManager := lStarUMLApp.Get_ProjectManager;
// Obtm gerenciador de mecanismos de estenso
lExtensionManager := lStarUMLApp.ExtensionManager;
//lExtensionManager := lStarUMLApp.ExtensionManager;
lPrjManager.OpenProject(psSTARUMLprj);
// Obtm projeto do STARUML onde sero inseridos os elementos UML
lPrj := lPrjManager.Get_Project;
......@@ -6331,7 +6324,7 @@ begin
begin
lCommonPack := lFactory.CreatePackage(lModelBase);
lCommonPack.Name := 'Common';
lPackageUnit := lPrjManager.SeparateUnit(lCommonPack, psPrjPath+ 'Commonx.unt');
{lPackageUnit := }lPrjManager.SeparateUnit(lCommonPack, psPrjPath+ 'Commonx.unt');
end;
if (psNomePacote = 'siscon') then
......@@ -6342,7 +6335,7 @@ begin
begin
lModel := lFactory.CreateModel(lModelBase);
lModel.Name := MODELO_SISCON_NAME;
lPackageUnit := lPrjManager.SeparateUnit(lModel, psPrjPath + psNomePacote+'.unt');
{lPackageUnit := }lPrjManager.SeparateUnit(lModel, psPrjPath + psNomePacote+'.unt');
end;
lPackage := lModel as IUMLPackage;
end
......@@ -6360,12 +6353,12 @@ begin
begin
lPackage := lFactory.CreatePackage(lModel);
lPackage.Name := psNomePacote;
lPackageUnit := lPrjManager.SeparateUnit(lPackage, psPrjPath + psNomePacote+'.unt');
{lPackageUnit := }lPrjManager.SeparateUnit(lPackage, psPrjPath + psNomePacote+'.unt');
end;
end;
// Meta Modelo do Star UML
lIMetaModel := lStarUMLApp.MetaModel;
//lIMetaModel := lStarUMLApp.MetaModel;
lElement := lStarUMLApp.FindByPathname(MODELO + '::FrameworkModel::acuFrameworkPackage::' + cBASE_PERSISTENT_OBJECT_CLASS);
......@@ -6422,20 +6415,17 @@ begin
end;
function TUtil.BuscaClasseModelo(poPackage: IUMLPackage; piClassName: string; var pbAchou: boolean) : IUMLClass;
var lModelElement: IUMLModelElement;
lClass: IUMLClass;
lPackage: IUMLPackage;
lindex, lnumElem: integer;
s:String;
var
lModelElement: IUMLModelElement;
lClass: IUMLClass;
lPackage: IUMLPackage;
lindex, lnumElem: integer;
begin
lnumElem := poPackage.GetOwnedElementCount;
lindex := 0;
while (lindex < lnumElem) and (not pbAchou) do
begin
lModelElement := poPackage.GetOwnedElementAt(lindex);
s := poPackage.Name;
s := lModelElement.Name;
s := lModelElement.GetClassName;
if (lModelElement.GetClassName = 'UMLPackage') or (lModelElement.GetClassName = 'UMLModel') then
begin
......@@ -6462,12 +6452,13 @@ begin
end;
function TUtil.CriarUMLClass(pIStarUMLApp: IStarUMLApplication; pClassTicket: acClassTicket; pUMLPackage: IUMLPackage; var piUMLClass: IUMLClass): boolean;
var lIElement: IElement;
lModel: IUMLPackage;
lClassToDBMapTicket: acClassToDBMapTicket;
// Stream: TFileStream;
lbAchou: boolean;
lInstantCodeModule: TInstantCodeModule;
var
lIElement: IElement;
lModel: IUMLPackage;
lClassToDBMapTicket: acClassToDBMapTicket;
//Stream: TFileStream;
lbAchou: boolean;
lInstantCodeModule: TInstantCodeModule;
begin
lIElement := pIStarUMLApp.FindByPathname(MODELO);
lModel := lIElement as IUMLPackage;
......@@ -6605,12 +6596,13 @@ end;
}
// Procedure responsvel por criar a estrutura de rvore de todo modelo (cria generalizaes e UML classes envolvidas)
procedure TUtil.CriarArvore(piIStarUMLApp: IStarUMLApplication; piUMLClass: IUMLClass; piUMLPackage: IUMLPackage; piClassTicket: acClassTicket);
var lDescendetesList: acObjectList;
lDescendente: acClassTicket;
index: Integer;
lUMLDescendente: IUMLClass;
lUMLGeneralizacao: IUMLGeneralization;
lbCriouNovaClasse: boolean;
var
lDescendetesList: acObjectList;
lDescendente: acClassTicket;
index: Integer;
lUMLDescendente: IUMLClass;
//lUMLGeneralizacao: IUMLGeneralization;
lbCriouNovaClasse: boolean;
begin
// Ponto de parada da recurso
// S classes com descendentes podem originar rvores
......@@ -6627,7 +6619,7 @@ begin
if (lbCriouNovaClasse) then
begin
// Criao de UML Generalization
lUMLGeneralizacao := piIStarUMLApp.UMLFactory.CreateGeneralization(piUMLPackage, piUMLClass, lUMLDescendente);
{lUMLGeneralizacao := }piIStarUMLApp.UMLFactory.CreateGeneralization(piUMLPackage, piUMLClass, lUMLDescendente);
end;
// Recursso
......@@ -6637,11 +6629,14 @@ begin
end;
function TUtil.ExisteAssociacao(piRelationTicket: acRelationTicket; piUMLClassOrigem, piUMLClassDestino: IUMLClass): boolean;
var lNumAssoc, index: integer;
lbAchou: boolean;
lUMLAssociation: IUMLAssociation;
lAssociationEndOr, lAssociationEndDest: IUMLAssociationEnd;
lsNomePropOr, lsNomePropDest, lsParticipantOr, lsParticipantDest: string;
var
lNumAssoc,
index: integer;
lbAchou: boolean;
lUMLAssociation: IUMLAssociation;
lAssociationEndOr, lAssociationEndDest: IUMLAssociationEnd;
lsNomePropOr, lsNomePropDest,
lsParticipantOr, lsParticipantDest: string;
begin
lNumAssoc := piUMLClassOrigem.GetAssociationCount;
......@@ -6669,17 +6664,18 @@ end;
procedure TUtil.CriarUMLAssociations(piIStarUMLApp: IStarUMLApplication; piRelationHash: acObjectHash; piModel: IUMLModel; piPackage: IUMLPackage);
var lEnumRelation: acEnumerator;
lRelationTicket: acRelationTicket;
lClassOrigem, lClassDestino: acClassTicket;
lIElement: IElement;
lMultiplicity, lsNomeTabelaAssociativa, lsNomeFKA, lsNomeFKB: String;
lAssociation: IUMLAssociation;
lAssociationEndOr, lAssociationEndDest: IUMLAssociationEnd;
lUMLClassOrigem, lUMLClassDestino: IUMLClass;
lRelationSQLPersistenceMapTicket: acRelationSQLPersistenceMapTicket;
lModel: IUMLModel;
lbAchou: boolean;
var
lEnumRelation: acEnumerator;
lRelationTicket: acRelationTicket;
lClassOrigem, lClassDestino: acClassTicket;
lIElement: IElement;
lMultiplicity, lsNomeTabelaAssociativa, lsNomeFKA, lsNomeFKB: String;
lAssociation: IUMLAssociation;
lAssociationEndOr, lAssociationEndDest: IUMLAssociationEnd;
lUMLClassOrigem, lUMLClassDestino: IUMLClass;
lRelationSQLPersistenceMapTicket: acRelationSQLPersistenceMapTicket;
lModel: IUMLModel;
lbAchou: boolean;
begin
lEnumRelation := piRelationHash.GetEnumerator;
try
......@@ -6785,9 +6781,10 @@ begin
end;
function TUtil.ValidateAttribute(const piAttribute: IUMLAttribute; piCheckLength: boolean): string;
var lsColumnName, lsColumnDBType: String;
lFixSize, lVarSize: integer;
// lbMandatory: boolean;
var
lsColumnName, lsColumnDBType: String;
lFixSize, lVarSize: integer;
// lbMandatory: boolean;
begin
result := '';
......@@ -6809,10 +6806,12 @@ begin
end;
function TUtil.ValidateClass(piUMLClass: IUMLClass; poErrors: TStringList): integer;
var I: integer;
lAttributeNames, lAttributeNamesTag: TStringList;
lUMLAtt: IUMLAttribute;
lAttNameTagValue: string;
var
I: integer;
lAttributeNames,
lAttributeNamesTag: TStringList;
lUMLAtt: IUMLAttribute;
lAttNameTagValue: string;
begin
result := 0;
lAttributeNames := TStringList.Create;
......@@ -6880,18 +6879,18 @@ end;
function TUtil.CarregaMetodo(pStarUMLApp: IStarUMLApplication): string;
var //lPrjManager: IProjectManager;
lModel: IModel;
lClass: IUMLClass;
lPackage: IUMLPackage;
lElement: IElement;
lsPrjFileName, lsPrjPathName, lsNomePacote, lsPasPath, lsNomeUnit, lsNomeClasse, lsMetName: string;
lPos, lMetCont, liCont, liParCount, liParIndex, lopCont: integer;
lInstantCodeProjectAux: TInstantCodeProject;
lModuleAux: TInstantCodeModule;
lOptions: TInstantCodeParameterOptions;
lFactory: IUMLFactory;
lOperation: IUMLOperation;
lParameter: IUMLParameter;
lModel: IModel;
lClass: IUMLClass;
lPackage: IUMLPackage;
lElement: IElement;
lsPrjFileName, lsPrjPathName, lsNomePacote, lsPasPath, lsNomeUnit, lsNomeClasse, lsMetName: string;
lPos, lMetCont, liCont, liParCount, liParIndex, lopCont: integer;
lInstantCodeProjectAux: TInstantCodeProject;
lModuleAux: TInstantCodeModule;
lOptions: TInstantCodeParameterOptions;
lFactory: IUMLFactory;
lOperation: IUMLOperation;
lParameter: IUMLParameter;
begin
try
lModel := pStarUMLApp.SelectionManager.GetSelectedModelAt(0);
......@@ -7018,14 +7017,14 @@ begin
end;
function TUtil.DescendsFrom(piElement: IUMLGeneralizableElement; piName: string): boolean;
var I: integer;
var
I: integer;
begin
result := false;
for I := 0 to piElement.GetGeneralizationCount - 1 do
if SameText(piElement.GetGeneralizationAt(i).Parent.Name, piName) then
result := true
else
result := DescendsFrom(piElement.GetGeneralizationAt(i).Parent, piName);
if SameText(piElement.GetGeneralizationAt(i).Parent.Name, piName)
then result := true
else result := DescendsFrom(piElement.GetGeneralizationAt(i).Parent, piName);
end;
destructor TUtil.Destroy;
......
......@@ -10,9 +10,9 @@ uses
{$IFnDEF FPC}
Windows,
{$ELSE}
LCLIntf, LCLType, LMessages,
LCLIntf, LCLType,
{$ENDIF}
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, acuModel, acuframework;
type
......
......@@ -10,11 +10,11 @@ uses
{$IFnDEF FPC}
Windows,
{$ELSE}
LCLIntf, LCLType, LMessages,
LCLIntf, LCLType,
{$ENDIF}
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, utuOQL, Menus, ComCtrls, Buttons, ActnList, ituExplorerV2, ImgList,
ituDataBaseLogin, ToolWin, SynHighlighterPas, SynEdit;
SynHighlighterPas, SynEdit;
type
......
......@@ -10,10 +10,10 @@ uses
{$IFnDEF FPC}
Mask, Windows,
{$ELSE}
MaskEdit, LCLIntf, LCLType, LMessages,
MaskEdit, LCLIntf, LCLType,
{$ENDIF}
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, acuOQL, ComCtrls, StdCtrls, acuContainers, Buttons;
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, acuOQL, ComCtrls, StdCtrls, Buttons;
const cCol1 = 5;
cCol1Width = 120;
......
......@@ -7,10 +7,10 @@ unit uCadastroCasoDeUso;
interface
uses
LCLIntf, LCLType, LMessages, StarUMLintf,
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
LCLIntf, LCLType, StarUMLintf,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls, utuMessage, uCadastroCasoDeUsoIcones, acuObject, cxuCadastroCasoDeUso,
Buttons, cxuSession;
Buttons;
type
......@@ -196,8 +196,7 @@ var lFieldCategorias, lFieldCategoria,
lMemoryStream: TMemoryStream;
lListItem: TListItem;
lIDO: integer;
I,T: integer;
s: CP1252String;
I: integer;
begin
inherited;
//CATEGORIAS
......@@ -225,7 +224,6 @@ begin
while not lEnum.EOL do
begin
lFieldEntidade := utField(lEnum.Current);
s := lFieldEntidade.AttributeByName('nome').AsString;
cbxEntidade.AddItem(lFieldEntidade.AttributeByName('nome').AsString, lFieldEntidade.AttributeByName('ido'));
lEnum.MoveNext;
end;
......
......@@ -7,10 +7,10 @@ unit uCadastroClasse;
interface
uses
LCLIntf, LCLType, LMessages, StarUMLintf,
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls, utuMessage, uCadastroCasoDeUsoIcones, acuObject, cxuCadastroClasse,
Buttons, cxuSession;
LCLIntf, LCLType, StarUMLintf,
SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ComCtrls, utuMessage, acuObject, cxuCadastroClasse,
Buttons;
type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment