Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
StarUML Evológica Plugin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
evologica
StarUML Evológica Plugin
Commits
365f5316
Commit
365f5316
authored
Aug 10, 2020
by
Erika Segatto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove alguns warnings
parent
ebe3caac
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
207 additions
and
209 deletions
+207
-209
DelphiAddInObj.pas
EvoUMLPlugin/src/DelphiAddInObj.pas
+14
-13
IntegracaoDelphiSUML.pas
EvoUMLPlugin/src/IntegracaoDelphiSUML.pas
+177
-178
acuObjectExplorer.pas
EvoUMLPlugin/src/acuObjectExplorer.pas
+2
-2
ituOQLExplorerV2.pas
EvoUMLPlugin/src/ituOQLExplorerV2.pas
+3
-3
ituOQLParams.pas
EvoUMLPlugin/src/ituOQLParams.pas
+3
-3
uCadastroCasoDeUso.pas
EvoUMLPlugin/src/uCadastroCasoDeUso.pas
+4
-6
uCadastroClasse.pas
EvoUMLPlugin/src/uCadastroClasse.pas
+4
-4
No files found.
EvoUMLPlugin/src/DelphiAddInObj.pas
View file @
365f5316
...
@@ -51,11 +51,11 @@ type
...
@@ -51,11 +51,11 @@ type
implementation
implementation
uses
uses
InstantCode
,
SysUtils
,
Mostra_Processamento
,
utuStateMachine
,
fCodeGen
,
Controls
,
Forms
,
InstantCode
,
SysUtils
,
Mostra_Processamento
,
fCodeGen
,
Controls
,
Forms
,
fModelMappingsGenerationOptions
,
fXSDEditor
,
ituDataBaseLogin
,
formMemo
,
fModelMappingsGenerationOptions
,
fXSDEditor
,
ituDataBaseLogin
,
formMemo
,
cxuCadastroClasse
,
cxuCadastroCasoDeUso
,
ituCadastrar
Definicao
,
ituCadastrar
Formulario
,
cxuCadastroClasse
,
cxuCadastroCasoDeUso
,
ituCadastrarFormulario
,
utuMessage
,
uCadastroCasoDeUso
,
uCadastroClasse
,
ituServiceParameters
,
ituExplorerV2
,
utuMessage
,
uCadastroCasoDeUso
,
uCadastroClasse
,
ituServiceParameters
,
ituExplorerV2
,
Registry
,
uRTFEditor
,
ituXSDExplorer
,
ituExportUnits
,
ituOQLExplorerV2
,
cxuCadastroDefinicaoClasse
;
Registry
,
ituOQLExplorerV2
,
cxuCadastroDefinicaoClasse
;
//procedure TDelphiAddInObj.NotifyUpdate(piMsg: string);
//procedure TDelphiAddInObj.NotifyUpdate(piMsg: string);
//begin
//begin
...
@@ -250,8 +250,9 @@ begin
...
@@ -250,8 +250,9 @@ begin
end
;
end
;
class
procedure
TDelphiAddInObj
.
ActionMenu_LoadMethods
;
class
procedure
TDelphiAddInObj
.
ActionMenu_LoadMethods
;
var
lsResult
:
string
;
var
lUtilitario
:
TUtil
;
//lsResult: string;
// lUtilitario: TUtil;
lMetaModelGenOpt
:
TMetaModelGenerationOptions
;
lMetaModelGenOpt
:
TMetaModelGenerationOptions
;
begin
begin
lMetaModelGenOpt
.
SilentMode
:=
false
;
lMetaModelGenOpt
.
SilentMode
:=
false
;
...
@@ -470,7 +471,7 @@ var lDynamoDef: TitCadastrarFormulario;
...
@@ -470,7 +471,7 @@ var lDynamoDef: TitCadastrarFormulario;
lSession
:
cxSession
;
lSession
:
cxSession
;
lCadastroDefinicaoClasseUC
:
cxCadastroDefinicaoClasse
;
lCadastroDefinicaoClasseUC
:
cxCadastroDefinicaoClasse
;
lModel
:
IModel
;
lModel
:
IModel
;
lUMLPackageAux
:
IUMLPackage
;
//
lUMLPackageAux: IUMLPackage;
lUMLClassAux
:
IUMLClass
;
lUMLClassAux
:
IUMLClass
;
begin
begin
lModel
:=
gStarUMLApp
.
SelectionManager
.
GetSelectedModelAt
(
0
);
lModel
:=
gStarUMLApp
.
SelectionManager
.
GetSelectedModelAt
(
0
);
...
@@ -525,12 +526,12 @@ end;
...
@@ -525,12 +526,12 @@ end;
class
procedure
TDelphiAddInObj
.
ActionMenu_ExportDiagramClasses
;
class
procedure
TDelphiAddInObj
.
ActionMenu_ExportDiagramClasses
;
var
//
var
lEnum
:
Integer
;
//
lEnum : Integer;
listaStrings
:
TStringList
;
//
listaStrings : TStringList;
listaObjetos
:
TInterfaceList
;
//
listaObjetos : TInterfaceList;
// lClass: IUMLClass;
// lClass: IUMLClass;
lForm
:
TExportUnits
;
//
lForm : TExportUnits;
begin
begin
//listaStrings := TStringList.Create;
//listaStrings := TStringList.Create;
//listaObjetos := TInterfaceList.Create;
//listaObjetos := TInterfaceList.Create;
...
@@ -566,7 +567,7 @@ begin
...
@@ -566,7 +567,7 @@ begin
end
;
end
;
class
procedure
TDelphiAddInObj
.
ActionMenu_UseCaseXSDsEditor
;
class
procedure
TDelphiAddInObj
.
ActionMenu_UseCaseXSDsEditor
;
var
lXSDExplorer
:
TXSDExplorer
;
//
var lXSDExplorer: TXSDExplorer;
begin
begin
// lModel := StarUMLApp.SelectionManager.GetSelectedModelAt(0);
// lModel := StarUMLApp.SelectionManager.GetSelectedModelAt(0);
//if lModel.GetMetaClass.IsKindOf('UMLUseCase') then
//if lModel.GetMetaClass.IsKindOf('UMLUseCase') then
...
...
EvoUMLPlugin/src/IntegracaoDelphiSUML.pas
View file @
365f5316
...
@@ -246,7 +246,7 @@ end;
...
@@ -246,7 +246,7 @@ end;
function
TUtil
.
SQLColumnTypeByVendor
(
piAttributeTicket
:
acAttributeTicket
;
function
TUtil
.
SQLColumnTypeByVendor
(
piAttributeTicket
:
acAttributeTicket
;
piDBVendor
:
TDataBaseVendor
):
string
;
piDBVendor
:
TDataBaseVendor
):
string
;
begin
begin
Result
:=
''
;
end
;
end
;
function
TUtil
.
SQLScriptDBColumn
(
piDBColumnMap
:
acDBColumnMapTicket
;
piAlwaysNulls
:
boolean
;
piDBVendor
:
TDataBaseVendor
):
string
;
function
TUtil
.
SQLScriptDBColumn
(
piDBColumnMap
:
acDBColumnMapTicket
;
piAlwaysNulls
:
boolean
;
piDBVendor
:
TDataBaseVendor
):
string
;
...
@@ -1615,9 +1615,10 @@ end;
...
@@ -1615,9 +1615,10 @@ end;
function
TUtil
.
AlimentarMetamodel
(
piMetaModelOptions
:
TMetaModelGenerationOptions
;
piProgress
:
TFShowProgress
):
string
;
function
TUtil
.
AlimentarMetamodel
(
piMetaModelOptions
:
TMetaModelGenerationOptions
;
piProgress
:
TFShowProgress
):
string
;
var
lPrjManager
:
IProjectManager
;
var
lPrjManager
:
IProjectManager
;
lPrj
:
IUMLProject
;
lPrj
:
IUMLProject
;
lIMetaModel
:
IMetaModel
;
//
lIMetaModel: IMetaModel;
// lMetaClass: IMetaClass;
// lMetaClass: IMetaClass;
lModel
:
IUMLModel
;
lModel
:
IUMLModel
;
lPackage
:
IUMLPackage
;
lPackage
:
IUMLPackage
;
...
@@ -1652,7 +1653,7 @@ begin
...
@@ -1652,7 +1653,7 @@ begin
if
assigned
(
lPrj
)
then
if
assigned
(
lPrj
)
then
begin
begin
// Meta Modelo do Star UML
// Meta Modelo do Star UML
lIMetaModel
:=
gStarUMLApp
.
MetaModel
;
//
lIMetaModel := gStarUMLApp.MetaModel;
//Obtem a classe acPersistentObject do modelo do StarUML
//Obtem a classe acPersistentObject do modelo do StarUML
lElement
:=
gStarUMLApp
.
FindByPathname
(
MODELO
+
'::FrameworkModel::acuFrameworkPackage::'
+
cBASE_PERSISTENT_OBJECT_CLASS
);
lElement
:=
gStarUMLApp
.
FindByPathname
(
MODELO
+
'::FrameworkModel::acuFrameworkPackage::'
+
cBASE_PERSISTENT_OBJECT_CLASS
);
...
@@ -1732,7 +1733,7 @@ var index, index2, lFixSize, lVarSize: integer;
...
@@ -1732,7 +1733,7 @@ var index, index2, lFixSize, lVarSize: integer;
lClassDisplayName
,
lAttributeDisplayName
:
string
;
lClassDisplayName
,
lAttributeDisplayName
:
string
;
lClassErrors
:
TStringList
;
lClassErrors
:
TStringList
;
begin
begin
lsResult
:=
''
;
if
(
poClasseRaiz
.
GetSpecializationCount
>
0
)
then
if
(
poClasseRaiz
.
GetSpecializationCount
>
0
)
then
begin
begin
if
assigned
(
piProgress
)
then
piProgress
.
ChangeMessage
(
'Creating Meta Model...'
,
0
,
poClasseRaiz
.
GetSpecializationCount
);
if
assigned
(
piProgress
)
then
piProgress
.
ChangeMessage
(
'Creating Meta Model...'
,
0
,
poClasseRaiz
.
GetSpecializationCount
);
...
@@ -1940,6 +1941,7 @@ var lRelationTicket: acRelationTicket;
...
@@ -1940,6 +1941,7 @@ var lRelationTicket: acRelationTicket;
lBidirectional
:
boolean
;
lBidirectional
:
boolean
;
lDisplayName
,
lDestinationDisplayName
,
lOriginDisplayName
:
string
;
lDisplayName
,
lDestinationDisplayName
,
lOriginDisplayName
:
string
;
begin
begin
lsresult
:=
''
;
lacOrAggregation
:=
acPropertyAggregation
.
pvNone
;
lacOrAggregation
:=
acPropertyAggregation
.
pvNone
;
lacDsAggregation
:=
acPropertyAggregation
.
pvNone
;
lacDsAggregation
:=
acPropertyAggregation
.
pvNone
;
...
@@ -2360,7 +2362,7 @@ var
...
@@ -2360,7 +2362,7 @@ var
lUseCaseCode
:
String
;
lUseCaseCode
:
String
;
begin
begin
Result
:=
''
;
//Varre todos os usecases filho de ucUseCase
//Varre todos os usecases filho de ucUseCase
for
lChildUseCaseCount
:=
0
to
poRootUseCase
.
GetSpecializationCount
-
1
do
for
lChildUseCaseCount
:=
0
to
poRootUseCase
.
GetSpecializationCount
-
1
do
begin
begin
...
@@ -2412,7 +2414,7 @@ end;
...
@@ -2412,7 +2414,7 @@ end;
function
TUtil
.
GerarBodyRegisterMappings
(
piModelMappingsOptions
:
TModelMappingsOptions
;
const
piInstantCodeConsts
:
TInstantCodeConsts
;
piProgress
:
TFShowProgress
;
piStartAt
:
Integer
;
piEndAt
:
Integer
):
string
;
function
TUtil
.
GerarBodyRegisterMappings
(
piModelMappingsOptions
:
TModelMappingsOptions
;
const
piInstantCodeConsts
:
TInstantCodeConsts
;
piProgress
:
TFShowProgress
;
piStartAt
:
Integer
;
piEndAt
:
Integer
):
string
;
var
lEnum
,
lEnumAttributes
:
acEnumerator
;
var
lEnum
:
acEnumerator
;
lClassTicket
:
acClassTicket
;
lClassTicket
:
acClassTicket
;
lAttributeTicket
:
acAttributeTicket
;
lAttributeTicket
:
acAttributeTicket
;
lsNomeClasse
,
lsTabela
,
lsIDOCode
,
lsTypeColumnName
,
sRegisterMapping
,
lsAtributo
,
lsIDO
,
lsColumnName
,
lsNomeClasseParent
,
lsAtrStereotype
,
lsAtrType
:
String
;
lsNomeClasse
,
lsTabela
,
lsIDOCode
,
lsTypeColumnName
,
sRegisterMapping
,
lsAtributo
,
lsIDO
,
lsColumnName
,
lsNomeClasseParent
,
lsAtrStereotype
,
lsAtrType
:
String
;
...
@@ -4665,10 +4667,11 @@ var li: Integer;
...
@@ -4665,10 +4667,11 @@ var li: Integer;
// lPartner: acObject;
// lPartner: acObject;
// lRelationPartnerList: acRelationPartnerList;
// lRelationPartnerList: acRelationPartnerList;
// lRelationPartnerShip: acRelationPartnerShip;
// lRelationPartnerShip: acRelationPartnerShip;
lInstantCodeField
:
TInstantCodeField
;
//
lInstantCodeField: TInstantCodeField;
lInstantCodeProperty
:
TInstantCodeProperty
;
lInstantCodeProperty
:
TInstantCodeProperty
;
lsresult
:
String
;
lsresult
:
String
;
begin
begin
lsresult
:=
''
;
// while piClassTicket <> nil do
// while piClassTicket <> nil do
// begin
// begin
for
li
:=
0
to
piClassTicket
.
RelationTicketsIn
.
Count
-
1
do
for
li
:=
0
to
piClassTicket
.
RelationTicketsIn
.
Count
-
1
do
...
@@ -4953,7 +4956,7 @@ function TUtil.GerarClassPreview_Java(piClass: IUMLClass): string;
...
@@ -4953,7 +4956,7 @@ function TUtil.GerarClassPreview_Java(piClass: IUMLClass): string;
end
;
end
;
var
var
lsNomeClasse
,
lsAtributo
,
lsTipoAttribute
,
lsNomeUnit
:
string
;
lsNomeClasse
,
lsAtributo
,
lsTipoAttribute
:
string
;
index
:
integer
;
index
:
integer
;
lClassTicket
:
acClassTicket
;
lClassTicket
:
acClassTicket
;
lAttributeTicket
:
acAttributeTicket
;
lAttributeTicket
:
acAttributeTicket
;
...
@@ -4968,7 +4971,7 @@ begin
...
@@ -4968,7 +4971,7 @@ begin
Result
:=
''
;
Result
:=
''
;
lParamsConstrutor
:=
''
;
lParamsConstrutor
:=
''
;
lsNomeClasse
:=
piClass
.
Name
;
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
);
lClassTicket
:=
MetaModel
.
GetClassTicketByName
(
lsNomeClasse
);
lCodigoClasse
:=
PStringWriter
.
Create
;
lCodigoClasse
:=
PStringWriter
.
Create
;
...
@@ -5091,7 +5094,7 @@ function TUtil.GerarClassPreview_JavaHibernate(piClass: IUMLClass): string;
...
@@ -5091,7 +5094,7 @@ function TUtil.GerarClassPreview_JavaHibernate(piClass: IUMLClass): string;
piCodigoClasse
.
WriteLine
(
'private '
+
piTipoAtributo
+
' '
+
piNomeAtributo
+
';'
);
piCodigoClasse
.
WriteLine
(
'private '
+
piTipoAtributo
+
' '
+
piNomeAtributo
+
';'
);
end
;
end
;
procedure
EscreveGetterSetterClasse
(
const
piCodigoClasse
:
PStringWriter
;
piNomeAtributo
,
piTipoAtributo
:
String
;
pi
Visibility
:
Integer
;
pi
ApenasGetter
:
Boolean
=
False
);
procedure
EscreveGetterSetterClasse
(
const
piCodigoClasse
:
PStringWriter
;
piNomeAtributo
,
piTipoAtributo
:
String
;
piApenasGetter
:
Boolean
=
False
);
begin
begin
//Escreve getter and setter
//Escreve getter and setter
piCodigoClasse
.
WriteLine
(
'public '
+
piTipoAtributo
+
' get'
+
piNomeAtributo
+
'() { return '
+
' f'
+
piNomeAtributo
+
'; }'
);
piCodigoClasse
.
WriteLine
(
'public '
+
piTipoAtributo
+
' get'
+
piNomeAtributo
+
'() { return '
+
' f'
+
piNomeAtributo
+
'; }'
);
...
@@ -5105,11 +5108,14 @@ const
...
@@ -5105,11 +5108,14 @@ const
_NomeId
=
'Id'
;
_NomeId
=
'Id'
;
var
var
lsNomeClasse
,
lsNomeClasse
,
lsNomeTabela
,
lsAtributo
,
lsAtributo
,
lsTipoAttribute
:
string
;
lsTipoAttribute
:
string
;
index
:
integer
;
index
:
integer
;
lClassTicket
:
acClassTicket
;
lClassTicket
:
acClassTicket
;
lAttributeTicket
:
acAttributeTicket
;
lAttributeTicket
:
acAttributeTicket
;
lMetaModelPersistenceMapSQL
:
acMetaModelPersistenceMapSQL
;
lClassToDBMapTicket
:
acClassToDBMapTicket
;
lCodigoClasse
:
PStringWriter
;
lCodigoClasse
:
PStringWriter
;
lParamsConstrutor
:
string
;
lParamsConstrutor
:
string
;
...
@@ -5123,7 +5129,6 @@ begin
...
@@ -5123,7 +5129,6 @@ begin
for
index
:=
0
to
2
do
for
index
:=
0
to
2
do
lHasImport
[
index
]
:=
False
;
lHasImport
[
index
]
:=
False
;
if
Copy
(
lsNomeClasse
,
1
,
2
)
=
'ng'
then
lsNomeClasse
:=
RightStr
(
lsNomeClasse
,
Length
(
lsNomeClasse
)-
2
);
lCodigoClasse
:=
PStringWriter
.
Create
;
lCodigoClasse
:=
PStringWriter
.
Create
;
try
try
lCodigoClasse
.
WriteLine
(
'package adapters.persistence.entities;'
);
lCodigoClasse
.
WriteLine
(
'package adapters.persistence.entities;'
);
...
@@ -5156,13 +5161,19 @@ begin
...
@@ -5156,13 +5161,19 @@ begin
end
;
end
;
end
;
end
;
lCodigoClasse
.
WriteLine
(
''
);
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
// Incio da classe
if
Copy
(
lsNomeClasse
,
1
,
2
)
=
'ng'
then
lsNomeClasse
:=
RightStr
(
lsNomeClasse
,
Length
(
lsNomeClasse
)-
2
);
lsNomeTabela
:=
lClassToDBMapTicket
.
TableName
;
lCodigoClasse
.
WriteLine
(
'@Entity'
);
lCodigoClasse
.
WriteLine
(
'@Entity'
);
lCodigoClasse
.
WriteLine
(
'@TableGenerator(name = "
ddoPessoa
", table = "SISBTNUMER", valueColumnName = "SISBNONUME",'
);
lCodigoClasse
.
WriteLine
(
'@TableGenerator(name = "
'
+
lsNomeClasse
+
'
", table = "SISBTNUMER", valueColumnName = "SISBNONUME",'
);
lCodigoClasse
.
WriteLine
(
' pkColumnName = "SISBDSNUME", pkColumnValue = "
CGR_DDO_PESSOA
", allocationSize = 1)'
);
lCodigoClasse
.
WriteLine
(
' pkColumnName = "SISBDSNUME", pkColumnValue = "
'
+
lsNomeTabela
+
'
", allocationSize = 1)'
);
lCodigoClasse
.
WriteLine
(
'@Inheritance(strategy = InheritanceType.JOINED)'
);
lCodigoClasse
.
WriteLine
(
'@Inheritance(strategy = InheritanceType.JOINED)'
);
lCodigoClasse
.
WriteLine
(
'@DiscriminatorColumn(name = "CX_TYPE")'
);
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
(
'public abstract class '
+
lsNomeClasse
+
' {'
);
lCodigoClasse
.
WriteLine
(
''
);
lCodigoClasse
.
WriteLine
(
''
);
lCodigoClasse
.
Indent
();
lCodigoClasse
.
Indent
();
...
@@ -5257,20 +5268,6 @@ begin
...
@@ -5257,20 +5268,6 @@ begin
finally
finally
lCodigoClasse
.
Free
;
lCodigoClasse
.
Free
;
end
;
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
;
end
;
...
@@ -5301,7 +5298,7 @@ function TUtil.GerarClassPreview_JavaDomain(piClass: IUMLClass): string;
...
@@ -5301,7 +5298,7 @@ function TUtil.GerarClassPreview_JavaDomain(piClass: IUMLClass): string;
piCodigoClasse
.
WriteLine
(
piTipoAtributo
+
' f'
+
piNomeAtributo
+
';'
);
piCodigoClasse
.
WriteLine
(
piTipoAtributo
+
' f'
+
piNomeAtributo
+
';'
);
end
;
end
;
procedure
EscreveGetterSetterClasse
(
const
piCodigoClasse
:
PStringWriter
;
piNomeAtributo
,
piTipoAtributo
:
String
;
pi
Visibility
:
Integer
;
pi
ApenasGetter
:
Boolean
=
False
);
procedure
EscreveGetterSetterClasse
(
const
piCodigoClasse
:
PStringWriter
;
piNomeAtributo
,
piTipoAtributo
:
String
;
piApenasGetter
:
Boolean
=
False
);
begin
begin
//Escreve getter and setter
//Escreve getter and setter
piCodigoClasse
.
WriteLine
(
'public '
+
piTipoAtributo
+
' get'
+
piNomeAtributo
+
'() { return '
+
' f'
+
piNomeAtributo
+
'; }'
);
piCodigoClasse
.
WriteLine
(
'public '
+
piTipoAtributo
+
' get'
+
piNomeAtributo
+
'() { return '
+
' f'
+
piNomeAtributo
+
'; }'
);
...
@@ -5410,7 +5407,7 @@ begin
...
@@ -5410,7 +5407,7 @@ begin
lCodigoClasse
.
WriteLine
(
''
);
lCodigoClasse
.
WriteLine
(
''
);
// GETTER/SETTER: Percorre atributos da classe
// 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
for
index
:=
0
to
lClassTicket
.
Attributes
.
Count
-
1
do
begin
begin
lAttributeTicket
:=
lClassTicket
.
Attributes
.
Objects
[
index
]
as
acAttributeTicket
;
lAttributeTicket
:=
lClassTicket
.
Attributes
.
Objects
[
index
]
as
acAttributeTicket
;
...
@@ -5418,7 +5415,7 @@ begin
...
@@ -5418,7 +5415,7 @@ begin
lsTipoAttribute
:=
ObterTipoAtributo
(
lAttributeTicket
.
AttributeType
);
lsTipoAttribute
:=
ObterTipoAtributo
(
lAttributeTicket
.
AttributeType
);
lParamsConstrutor
:=
lParamsConstrutor
+
lsTipoAttribute
+
' pi'
+
lsAtributo
+
', '
;
lParamsConstrutor
:=
lParamsConstrutor
+
lsTipoAttribute
+
' pi'
+
lsAtributo
+
', '
;
EscreveGetterSetterClasse
(
lCodigoClasse
,
lsAtributo
,
lsTipoAttribute
,
lAttributeTicket
.
Visibility
);
EscreveGetterSetterClasse
(
lCodigoClasse
,
lsAtributo
,
lsTipoAttribute
);
end
;
end
;
//Escrever RelationsPartnerShips
//Escrever RelationsPartnerShips
for
index
:=
0
to
lClassTicket
.
RelationTicketsIn
.
Count
-
1
do
for
index
:=
0
to
lClassTicket
.
RelationTicketsIn
.
Count
-
1
do
...
@@ -5431,7 +5428,7 @@ begin
...
@@ -5431,7 +5428,7 @@ begin
if
lRelation
.
DestinationMaxMultiplicity
>
1
if
lRelation
.
DestinationMaxMultiplicity
>
1
then
lsTipoAttribute
:=
'List<'
+
lRelation
.
OriginClassTicket
.
DisplayName
+
'>'
then
lsTipoAttribute
:=
'List<'
+
lRelation
.
OriginClassTicket
.
DisplayName
+
'>'
else
lsTipoAttribute
:=
lRelation
.
OriginClassTicket
.
DisplayName
;
else
lsTipoAttribute
:=
lRelation
.
OriginClassTicket
.
DisplayName
;
EscreveGetterSetterClasse
(
lCodigoClasse
,
lsAtributo
,
lsTipoAttribute
,
acAttributeVisibility
.
pvProtected
);
EscreveGetterSetterClasse
(
lCodigoClasse
,
lsAtributo
,
lsTipoAttribute
);
end
;
end
;
end
;
end
;
for
index
:=
0
to
lClassTicket
.
RelationTicketsOut
.
Count
-
1
do
for
index
:=
0
to
lClassTicket
.
RelationTicketsOut
.
Count
-
1
do
...
@@ -5444,7 +5441,7 @@ begin
...
@@ -5444,7 +5441,7 @@ begin
if
lRelation
.
OriginMaxMultiplicity
>
1
if
lRelation
.
OriginMaxMultiplicity
>
1
then
lsTipoAttribute
:=
'List<'
+
lRelation
.
DestinationClassTicket
.
DisplayName
+
'>'
then
lsTipoAttribute
:=
'List<'
+
lRelation
.
DestinationClassTicket
.
DisplayName
+
'>'
else
lsTipoAttribute
:=
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
;
end
;
end
;
...
@@ -5453,7 +5450,7 @@ begin
...
@@ -5453,7 +5450,7 @@ begin
lCodigoClasse
.
WriteLine
(
''
);
lCodigoClasse
.
WriteLine
(
''
);
lCodigoClasse
.
WriteLine
(
'public '
+
lsNomeClasse
+
'('
+
_TipoId
+
' piId, '
+
strutils
.
LeftStr
(
lParamsConstrutor
,
Length
(
lParamsConstrutor
)-
2
)+
') {'
);
lCodigoClasse
.
WriteLine
(
'public '
+
lsNomeClasse
+
'('
+
_TipoId
+
' piId, '
+
strutils
.
LeftStr
(
lParamsConstrutor
,
Length
(
lParamsConstrutor
)-
2
)+
') {'
);
lCodigoClasse
.
Indent
();
lCodigoClasse
.
Indent
();
lCodigoClasse
.
WriteLine
(
'
i
d = piId;'
);
lCodigoClasse
.
WriteLine
(
'
fI
d = piId;'
);
for
index
:=
0
to
lClassTicket
.
Attributes
.
Count
-
1
do
for
index
:=
0
to
lClassTicket
.
Attributes
.
Count
-
1
do
begin
begin
lsAtributo
:=
lClassTicket
.
Attributes
.
Strings
[
index
];
lsAtributo
:=
lClassTicket
.
Attributes
.
Strings
[
index
];
...
@@ -5465,6 +5462,7 @@ begin
...
@@ -5465,6 +5462,7 @@ begin
lCodigoClasse
.
WriteLine
(
''
);
lCodigoClasse
.
WriteLine
(
''
);
lCodigoClasse
.
WriteLine
(
'public '
+
lsNomeClasse
+
'('
+
strutils
.
LeftStr
(
lParamsConstrutor
,
Length
(
lParamsConstrutor
)-
2
)+
') {'
);
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
for
index
:=
0
to
lClassTicket
.
Attributes
.
Count
-
1
do
begin
begin
lsAtributo
:=
lClassTicket
.
Attributes
.
Strings
[
index
];
lsAtributo
:=
lClassTicket
.
Attributes
.
Strings
[
index
];
...
@@ -5513,7 +5511,6 @@ var
...
@@ -5513,7 +5511,6 @@ var
lInstantCodeModule
:
TInstantCodeModule
;
lInstantCodeModule
:
TInstantCodeModule
;
lInstantCodeProject
:
TInstantCodeProject
;
lInstantCodeProject
:
TInstantCodeProject
;
lInstantCodeClass
:
TInstantCodeClass
;
lInstantCodeClass
:
TInstantCodeClass
;
lInstantCodeField
:
TInstantCodeField
;
lAttributeTicket
:
acAttributeTicket
;
lAttributeTicket
:
acAttributeTicket
;
lInstantCodeProperty
:
TInstantCodeProperty
;
lInstantCodeProperty
:
TInstantCodeProperty
;
...
@@ -5611,7 +5608,6 @@ end;
...
@@ -5611,7 +5608,6 @@ end;
function
TUtil
.
GerarFullSQLPreview
(
piDBVendor
:
TDataBaseVendor
):
string
;
function
TUtil
.
GerarFullSQLPreview
(
piDBVendor
:
TDataBaseVendor
):
string
;
var
var
///////////
lEnumClass
,
lEnumRelation
:
acEnumerator
;
lEnumClass
,
lEnumRelation
:
acEnumerator
;
lMetaModelPersistenceMapSQL
:
acMetaModelPersistenceMapSQL
;
lMetaModelPersistenceMapSQL
:
acMetaModelPersistenceMapSQL
;
lRelationSQLPersistenceMapTicket
:
acRelationSQLPersistenceMapTicket
;
lRelationSQLPersistenceMapTicket
:
acRelationSQLPersistenceMapTicket
;
...
@@ -5964,7 +5960,8 @@ end;
...
@@ -5964,7 +5960,8 @@ end;
procedure
TUtil
.
CarregarMetodosNGU
(
pUMLClass
:
IUMLClass
;
pInstantCodeClass
:
TInstantCodeClass
);
procedure
TUtil
.
CarregarMetodosNGU
(
pUMLClass
:
IUMLClass
;
pInstantCodeClass
:
TInstantCodeClass
);
var
lMetCont
,
liCont
,
liCont2
,
liParCount
,
liParIndex
:
integer
;
var
lMetCont
,
liCont
,
liCont2
,
liParCount
,
liParIndex
:
integer
;
lsMetName
:
string
;
lsMetName
:
string
;
lMetodo
:
TInstantCodeMethod
;
lMetodo
:
TInstantCodeMethod
;
lVisibility
:
TInstantCodeVisibility
;
lVisibility
:
TInstantCodeVisibility
;
...
@@ -6158,26 +6155,24 @@ function TUtil.GerarSQLPreview(piModelElement: IModel; piDBVendor: TDataBaseVend
...
@@ -6158,26 +6155,24 @@ function TUtil.GerarSQLPreview(piModelElement: IModel; piDBVendor: TDataBaseVend
var
var
lClass
:
IUMLClass
;
lClass
:
IUMLClass
;
lAssociation
:
IUMLAssociation
;
lAssociation
:
IUMLAssociation
;
lsNomeClasse
,
lsNomeTabela
,
lRelationName
:
string
;
lsNomeClasse
,
lRelationName
,
lsResult
:
string
;
lsResult
:
string
;
lClassTicket
,
lClassTicket
,
lClassOriginTicket
,
lClassDestTicket
:
acClassTicket
;
lClassOriginTicket
,
lClassDestTicket
:
acClassTicket
;
lClassToDBMapTicket
:
acClassToDBMapTicket
;
lClassToDBMapTicket
:
acClassToDBMapTicket
;
lMetaModelPersistenceMapSQL
:
acMetaModelPersistenceMapSQL
;
lMetaModelPersistenceMapSQL
:
acMetaModelPersistenceMapSQL
;
lRelationSQLPersistenceMapTicket
:
acRelationSQLPersistenceMapTicket
;
lRelationSQLPersistenceMapTicket
:
acRelationSQLPersistenceMapTicket
;
lRelationTicket
:
acRelationTicket
;
lRelationTicket
:
acRelationTicket
;
// liOriginMinCardinalidade,
// liOriginMinCardinalidade,
liOriginMaxCardinalidade
,
liOriginMaxCardinalidade
,
// liDestinationMinCardinalidade,
// liDestinationMinCardinalidade,
liDestinationMaxCardinalidade
,
lPos
:
integer
;
liDestinationMaxCardinalidade
,
lPos
:
integer
;
lsMin
,
lsMax
:
string
;
lsMax
:
string
;
begin
begin
lsResult
:=
''
;
lMetaModelPersistenceMapSQL
:=
fMetaModelPersistenceMap
as
acMetaModelPersistenceMapSQL
;
lMetaModelPersistenceMapSQL
:=
fMetaModelPersistenceMap
as
acMetaModelPersistenceMapSQL
;
if
(
piModelElement
.
GetClassName
=
'UMLClass'
)
then
if
(
piModelElement
.
GetClassName
=
'UMLClass'
)
then
...
@@ -6185,16 +6180,13 @@ begin
...
@@ -6185,16 +6180,13 @@ begin
lClass
:=
piModelElement
as
IUMLClass
;
lClass
:=
piModelElement
as
IUMLClass
;
lsNomeClasse
:=
lClass
.
Name
;
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
);
lClassTicket
:=
MetaModel
.
GetClassTicketByName
(
lsNomeClasse
);
lClassToDBMapTicket
:=
lMetaModelPersistenceMapSQL
.
GetClassToDBMapTicket
(
lClassTicket
);
lClassToDBMapTicket
:=
lMetaModelPersistenceMapSQL
.
GetClassToDBMapTicket
(
lClassTicket
);
lsResult
:=
concat
(
lsResult
,
SQLScriptCreateDirectTable
(
lClassToDBMapTicket
,
piDBVendor
));
lsResult
:=
concat
(
lsResult
,
SQLScriptCreateDirectTable
(
lClassToDBMapTicket
,
piDBVendor
));
lsResult
:=
Concat
(
lsResult
,
#
13
#
10
#
13
#
10
);
lsResult
:=
Concat
(
lsResult
,
#
13
#
10
#
13
#
10
);
lsResult
:=
Concat
(
lsResult
,
SQLScriptDirectTableForeignKeys
(
lClassToDBMapTicket
,
piDBVendor
));
lsResult
:=
Concat
(
lsResult
,
SQLScriptDirectTableForeignKeys
(
lClassToDBMapTicket
,
piDBVendor
));
end
end
else
else
...
@@ -6223,7 +6215,7 @@ begin
...
@@ -6223,7 +6215,7 @@ begin
else
else
begin
begin
lPos
:=
Pos
(
'..'
,
lAssociation
.
GetConnectionAt
(
1
).
Get_Multiplicity
);
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
));
lsMax
:=
copy
(
lAssociation
.
GetConnectionAt
(
1
).
Get_Multiplicity
,
lPos
+
2
,
length
(
lAssociation
.
GetConnectionAt
(
1
).
Get_Multiplicity
)
-
(
lPos
+
1
));
// liOriginMinCardinalidade := strtoint(lsMin);
// liOriginMinCardinalidade := strtoint(lsMin);
if
(
uppercase
(
lsMax
)
=
'N'
)
or
(
lsMax
=
'*'
)
then
if
(
uppercase
(
lsMax
)
=
'N'
)
or
(
lsMax
=
'*'
)
then
...
@@ -6246,7 +6238,7 @@ begin
...
@@ -6246,7 +6238,7 @@ begin
else
else
begin
begin
lPos
:=
Pos
(
'..'
,
lAssociation
.
GetConnectionAt
(
0
).
Get_Multiplicity
);
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
));
lsMax
:=
copy
(
lAssociation
.
GetConnectionAt
(
0
).
Get_Multiplicity
,
lPos
+
2
,
length
(
lAssociation
.
GetConnectionAt
(
0
).
Get_Multiplicity
)
-
(
lPos
+
1
));
// liDestinationMinCardinalidade := strtoint(lsMin);
// liDestinationMinCardinalidade := strtoint(lsMin);
if
(
uppercase
(
lsMax
)
=
'N'
)
or
(
lsMax
=
'*'
)
then
if
(
uppercase
(
lsMax
)
=
'N'
)
or
(
lsMax
=
'*'
)
then
...
@@ -6284,7 +6276,8 @@ end;
...
@@ -6284,7 +6276,8 @@ end;
procedure
TUtil
.
Reversa
(
psNomePacote
,
psPrjPath
,
psSTARUMLprj
:
string
);
procedure
TUtil
.
Reversa
(
psNomePacote
,
psPrjPath
,
psSTARUMLprj
:
string
);
var
lEnum
:
acEnumerator
;
var
lEnum
:
acEnumerator
;
lStarUMLApp
:
IStarUMLApplication
;
lStarUMLApp
:
IStarUMLApplication
;
lClassTicket
,
lPatriarca
:
acClassTicket
;
lClassTicket
,
lPatriarca
:
acClassTicket
;
lPrjManager
:
IProjectManager
;
lPrjManager
:
IProjectManager
;
...
@@ -6295,21 +6288,21 @@ var lEnum: acEnumerator;
...
@@ -6295,21 +6288,21 @@ var lEnum: acEnumerator;
lPackage
,
lCommonPack
:
IUMLPackage
;
lPackage
,
lCommonPack
:
IUMLPackage
;
lClass
,
lClassePersistentObject
:
IUMLClass
;
lClass
,
lClassePersistentObject
:
IUMLClass
;
lRelationHash
:
acObjectHash
;
lRelationHash
:
acObjectHash
;
lIMetaModel
:
IMetaModel
;
//
lIMetaModel: IMetaModel;
lExtensionManager
:
IExtensionManager
;
//
lExtensionManager: IExtensionManager;
lbCriouNovaClasse
:
boolean
;
lbCriouNovaClasse
:
boolean
;
lPackageUnit
:
IUMLUnitDocument
;
//
lPackageUnit: IUMLUnitDocument;
Tela
:
TFShowProgress
;
Tela
:
TFShowProgress
;
lMetaModel
:
acMetaModel
;
//
lMetaModel: acMetaModel;
begin
begin
try
try
Tela
:=
TFShowProgressForm
.
create
(
'Carregando o StarUML...'
,
1
,
100
);
Tela
:=
TFShowProgressForm
.
create
(
'Carregando o StarUML...'
,
1
,
100
);
// Criao de aplicao STARUML
// Criao de aplicao STARUML
//
lStarUMLApp := StarUML_TLB.CoStarUMLApplication.Create;
//
lStarUMLApp := StarUML_TLB.CoStarUMLApplication.Create;
// Obtm Gerenciador de Projeto do STARUML
// Obtm Gerenciador de Projeto do STARUML
lPrjManager
:=
lStarUMLApp
.
Get_ProjectManager
;
lPrjManager
:=
lStarUMLApp
.
Get_ProjectManager
;
// Obtm gerenciador de mecanismos de estenso
// Obtm gerenciador de mecanismos de estenso
lExtensionManager
:=
lStarUMLApp
.
ExtensionManager
;
//
lExtensionManager := lStarUMLApp.ExtensionManager;
lPrjManager
.
OpenProject
(
psSTARUMLprj
);
lPrjManager
.
OpenProject
(
psSTARUMLprj
);
// Obtm projeto do STARUML onde sero inseridos os elementos UML
// Obtm projeto do STARUML onde sero inseridos os elementos UML
lPrj
:=
lPrjManager
.
Get_Project
;
lPrj
:=
lPrjManager
.
Get_Project
;
...
@@ -6331,7 +6324,7 @@ begin
...
@@ -6331,7 +6324,7 @@ begin
begin
begin
lCommonPack
:=
lFactory
.
CreatePackage
(
lModelBase
);
lCommonPack
:=
lFactory
.
CreatePackage
(
lModelBase
);
lCommonPack
.
Name
:=
'Common'
;
lCommonPack
.
Name
:=
'Common'
;
lPackageUnit
:=
lPrjManager
.
SeparateUnit
(
lCommonPack
,
psPrjPath
+
'Commonx.unt'
);
{lPackageUnit := }
lPrjManager
.
SeparateUnit
(
lCommonPack
,
psPrjPath
+
'Commonx.unt'
);
end
;
end
;
if
(
psNomePacote
=
'siscon'
)
then
if
(
psNomePacote
=
'siscon'
)
then
...
@@ -6342,7 +6335,7 @@ begin
...
@@ -6342,7 +6335,7 @@ begin
begin
begin
lModel
:=
lFactory
.
CreateModel
(
lModelBase
);
lModel
:=
lFactory
.
CreateModel
(
lModelBase
);
lModel
.
Name
:=
MODELO_SISCON_NAME
;
lModel
.
Name
:=
MODELO_SISCON_NAME
;
lPackageUnit
:=
lPrjManager
.
SeparateUnit
(
lModel
,
psPrjPath
+
psNomePacote
+
'.unt'
);
{lPackageUnit := }
lPrjManager
.
SeparateUnit
(
lModel
,
psPrjPath
+
psNomePacote
+
'.unt'
);
end
;
end
;
lPackage
:=
lModel
as
IUMLPackage
;
lPackage
:=
lModel
as
IUMLPackage
;
end
end
...
@@ -6360,12 +6353,12 @@ begin
...
@@ -6360,12 +6353,12 @@ begin
begin
begin
lPackage
:=
lFactory
.
CreatePackage
(
lModel
);
lPackage
:=
lFactory
.
CreatePackage
(
lModel
);
lPackage
.
Name
:=
psNomePacote
;
lPackage
.
Name
:=
psNomePacote
;
lPackageUnit
:=
lPrjManager
.
SeparateUnit
(
lPackage
,
psPrjPath
+
psNomePacote
+
'.unt'
);
{lPackageUnit := }
lPrjManager
.
SeparateUnit
(
lPackage
,
psPrjPath
+
psNomePacote
+
'.unt'
);
end
;
end
;
end
;
end
;
// Meta Modelo do Star UML
// Meta Modelo do Star UML
lIMetaModel
:=
lStarUMLApp
.
MetaModel
;
//
lIMetaModel := lStarUMLApp.MetaModel;
lElement
:=
lStarUMLApp
.
FindByPathname
(
MODELO
+
'::FrameworkModel::acuFrameworkPackage::'
+
cBASE_PERSISTENT_OBJECT_CLASS
);
lElement
:=
lStarUMLApp
.
FindByPathname
(
MODELO
+
'::FrameworkModel::acuFrameworkPackage::'
+
cBASE_PERSISTENT_OBJECT_CLASS
);
...
@@ -6422,20 +6415,17 @@ begin
...
@@ -6422,20 +6415,17 @@ begin
end
;
end
;
function
TUtil
.
BuscaClasseModelo
(
poPackage
:
IUMLPackage
;
piClassName
:
string
;
var
pbAchou
:
boolean
)
:
IUMLClass
;
function
TUtil
.
BuscaClasseModelo
(
poPackage
:
IUMLPackage
;
piClassName
:
string
;
var
pbAchou
:
boolean
)
:
IUMLClass
;
var
lModelElement
:
IUMLModelElement
;
var
lModelElement
:
IUMLModelElement
;
lClass
:
IUMLClass
;
lClass
:
IUMLClass
;
lPackage
:
IUMLPackage
;
lPackage
:
IUMLPackage
;
lindex
,
lnumElem
:
integer
;
lindex
,
lnumElem
:
integer
;
s
:
String
;
begin
begin
lnumElem
:=
poPackage
.
GetOwnedElementCount
;
lnumElem
:=
poPackage
.
GetOwnedElementCount
;
lindex
:=
0
;
lindex
:=
0
;
while
(
lindex
<
lnumElem
)
and
(
not
pbAchou
)
do
while
(
lindex
<
lnumElem
)
and
(
not
pbAchou
)
do
begin
begin
lModelElement
:=
poPackage
.
GetOwnedElementAt
(
lindex
);
lModelElement
:=
poPackage
.
GetOwnedElementAt
(
lindex
);
s
:=
poPackage
.
Name
;
s
:=
lModelElement
.
Name
;
s
:=
lModelElement
.
GetClassName
;
if
(
lModelElement
.
GetClassName
=
'UMLPackage'
)
or
(
lModelElement
.
GetClassName
=
'UMLModel'
)
then
if
(
lModelElement
.
GetClassName
=
'UMLPackage'
)
or
(
lModelElement
.
GetClassName
=
'UMLModel'
)
then
begin
begin
...
@@ -6462,10 +6452,11 @@ begin
...
@@ -6462,10 +6452,11 @@ begin
end
;
end
;
function
TUtil
.
CriarUMLClass
(
pIStarUMLApp
:
IStarUMLApplication
;
pClassTicket
:
acClassTicket
;
pUMLPackage
:
IUMLPackage
;
var
piUMLClass
:
IUMLClass
):
boolean
;
function
TUtil
.
CriarUMLClass
(
pIStarUMLApp
:
IStarUMLApplication
;
pClassTicket
:
acClassTicket
;
pUMLPackage
:
IUMLPackage
;
var
piUMLClass
:
IUMLClass
):
boolean
;
var
lIElement
:
IElement
;
var
lIElement
:
IElement
;
lModel
:
IUMLPackage
;
lModel
:
IUMLPackage
;
lClassToDBMapTicket
:
acClassToDBMapTicket
;
lClassToDBMapTicket
:
acClassToDBMapTicket
;
//
Stream: TFileStream;
//
Stream: TFileStream;
lbAchou
:
boolean
;
lbAchou
:
boolean
;
lInstantCodeModule
:
TInstantCodeModule
;
lInstantCodeModule
:
TInstantCodeModule
;
begin
begin
...
@@ -6605,11 +6596,12 @@ end;
...
@@ -6605,11 +6596,12 @@ end;
}
}
// Procedure responsvel por criar a estrutura de rvore de todo modelo (cria generalizaes e UML classes envolvidas)
// 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
);
procedure
TUtil
.
CriarArvore
(
piIStarUMLApp
:
IStarUMLApplication
;
piUMLClass
:
IUMLClass
;
piUMLPackage
:
IUMLPackage
;
piClassTicket
:
acClassTicket
);
var
lDescendetesList
:
acObjectList
;
var
lDescendetesList
:
acObjectList
;
lDescendente
:
acClassTicket
;
lDescendente
:
acClassTicket
;
index
:
Integer
;
index
:
Integer
;
lUMLDescendente
:
IUMLClass
;
lUMLDescendente
:
IUMLClass
;
lUMLGeneralizacao
:
IUMLGeneralization
;
//
lUMLGeneralizacao: IUMLGeneralization;
lbCriouNovaClasse
:
boolean
;
lbCriouNovaClasse
:
boolean
;
begin
begin
// Ponto de parada da recurso
// Ponto de parada da recurso
...
@@ -6627,7 +6619,7 @@ begin
...
@@ -6627,7 +6619,7 @@ begin
if
(
lbCriouNovaClasse
)
then
if
(
lbCriouNovaClasse
)
then
begin
begin
// Criao de UML Generalization
// Criao de UML Generalization
lUMLGeneralizacao
:=
piIStarUMLApp
.
UMLFactory
.
CreateGeneralization
(
piUMLPackage
,
piUMLClass
,
lUMLDescendente
);
{lUMLGeneralizacao := }
piIStarUMLApp
.
UMLFactory
.
CreateGeneralization
(
piUMLPackage
,
piUMLClass
,
lUMLDescendente
);
end
;
end
;
// Recursso
// Recursso
...
@@ -6637,11 +6629,14 @@ begin
...
@@ -6637,11 +6629,14 @@ begin
end
;
end
;
function
TUtil
.
ExisteAssociacao
(
piRelationTicket
:
acRelationTicket
;
piUMLClassOrigem
,
piUMLClassDestino
:
IUMLClass
):
boolean
;
function
TUtil
.
ExisteAssociacao
(
piRelationTicket
:
acRelationTicket
;
piUMLClassOrigem
,
piUMLClassDestino
:
IUMLClass
):
boolean
;
var
lNumAssoc
,
index
:
integer
;
var
lNumAssoc
,
index
:
integer
;
lbAchou
:
boolean
;
lbAchou
:
boolean
;
lUMLAssociation
:
IUMLAssociation
;
lUMLAssociation
:
IUMLAssociation
;
lAssociationEndOr
,
lAssociationEndDest
:
IUMLAssociationEnd
;
lAssociationEndOr
,
lAssociationEndDest
:
IUMLAssociationEnd
;
lsNomePropOr
,
lsNomePropDest
,
lsParticipantOr
,
lsParticipantDest
:
string
;
lsNomePropOr
,
lsNomePropDest
,
lsParticipantOr
,
lsParticipantDest
:
string
;
begin
begin
lNumAssoc
:=
piUMLClassOrigem
.
GetAssociationCount
;
lNumAssoc
:=
piUMLClassOrigem
.
GetAssociationCount
;
...
@@ -6669,7 +6664,8 @@ end;
...
@@ -6669,7 +6664,8 @@ end;
procedure
TUtil
.
CriarUMLAssociations
(
piIStarUMLApp
:
IStarUMLApplication
;
piRelationHash
:
acObjectHash
;
piModel
:
IUMLModel
;
piPackage
:
IUMLPackage
);
procedure
TUtil
.
CriarUMLAssociations
(
piIStarUMLApp
:
IStarUMLApplication
;
piRelationHash
:
acObjectHash
;
piModel
:
IUMLModel
;
piPackage
:
IUMLPackage
);
var
lEnumRelation
:
acEnumerator
;
var
lEnumRelation
:
acEnumerator
;
lRelationTicket
:
acRelationTicket
;
lRelationTicket
:
acRelationTicket
;
lClassOrigem
,
lClassDestino
:
acClassTicket
;
lClassOrigem
,
lClassDestino
:
acClassTicket
;
lIElement
:
IElement
;
lIElement
:
IElement
;
...
@@ -6785,7 +6781,8 @@ begin
...
@@ -6785,7 +6781,8 @@ begin
end
;
end
;
function
TUtil
.
ValidateAttribute
(
const
piAttribute
:
IUMLAttribute
;
piCheckLength
:
boolean
):
string
;
function
TUtil
.
ValidateAttribute
(
const
piAttribute
:
IUMLAttribute
;
piCheckLength
:
boolean
):
string
;
var
lsColumnName
,
lsColumnDBType
:
String
;
var
lsColumnName
,
lsColumnDBType
:
String
;
lFixSize
,
lVarSize
:
integer
;
lFixSize
,
lVarSize
:
integer
;
// lbMandatory: boolean;
// lbMandatory: boolean;
begin
begin
...
@@ -6809,8 +6806,10 @@ begin
...
@@ -6809,8 +6806,10 @@ begin
end
;
end
;
function
TUtil
.
ValidateClass
(
piUMLClass
:
IUMLClass
;
poErrors
:
TStringList
):
integer
;
function
TUtil
.
ValidateClass
(
piUMLClass
:
IUMLClass
;
poErrors
:
TStringList
):
integer
;
var
I
:
integer
;
var
lAttributeNames
,
lAttributeNamesTag
:
TStringList
;
I
:
integer
;
lAttributeNames
,
lAttributeNamesTag
:
TStringList
;
lUMLAtt
:
IUMLAttribute
;
lUMLAtt
:
IUMLAttribute
;
lAttNameTagValue
:
string
;
lAttNameTagValue
:
string
;
begin
begin
...
@@ -7018,14 +7017,14 @@ begin
...
@@ -7018,14 +7017,14 @@ begin
end
;
end
;
function
TUtil
.
DescendsFrom
(
piElement
:
IUMLGeneralizableElement
;
piName
:
string
):
boolean
;
function
TUtil
.
DescendsFrom
(
piElement
:
IUMLGeneralizableElement
;
piName
:
string
):
boolean
;
var
I
:
integer
;
var
I
:
integer
;
begin
begin
result
:=
false
;
result
:=
false
;
for
I
:=
0
to
piElement
.
GetGeneralizationCount
-
1
do
for
I
:=
0
to
piElement
.
GetGeneralizationCount
-
1
do
if
SameText
(
piElement
.
GetGeneralizationAt
(
i
).
Parent
.
Name
,
piName
)
then
if
SameText
(
piElement
.
GetGeneralizationAt
(
i
).
Parent
.
Name
,
piName
)
result
:=
true
then
result
:=
true
else
else
result
:=
DescendsFrom
(
piElement
.
GetGeneralizationAt
(
i
).
Parent
,
piName
);
result
:=
DescendsFrom
(
piElement
.
GetGeneralizationAt
(
i
).
Parent
,
piName
);
end
;
end
;
destructor
TUtil
.
Destroy
;
destructor
TUtil
.
Destroy
;
...
...
EvoUMLPlugin/src/acuObjectExplorer.pas
View file @
365f5316
...
@@ -10,9 +10,9 @@ uses
...
@@ -10,9 +10,9 @@ uses
{$IFnDEF FPC}
{$IFnDEF FPC}
Windows
,
Windows
,
{$ELSE}
{$ELSE}
LCLIntf
,
LCLType
,
LMessages
,
LCLIntf
,
LCLType
,
{$ENDIF}
{$ENDIF}
Messages
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
Dialogs
,
ComCtrls
,
acuModel
,
acuframework
;
Dialogs
,
ComCtrls
,
acuModel
,
acuframework
;
type
type
...
...
EvoUMLPlugin/src/ituOQLExplorerV2.pas
View file @
365f5316
...
@@ -10,11 +10,11 @@ uses
...
@@ -10,11 +10,11 @@ uses
{$IFnDEF FPC}
{$IFnDEF FPC}
Windows
,
Windows
,
{$ELSE}
{$ELSE}
LCLIntf
,
LCLType
,
LMessages
,
LCLIntf
,
LCLType
,
{$ENDIF}
{$ENDIF}
Messages
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
Dialogs
,
ExtCtrls
,
StdCtrls
,
utuOQL
,
Menus
,
ComCtrls
,
Buttons
,
ActnList
,
ituExplorerV2
,
ImgList
,
Dialogs
,
ExtCtrls
,
StdCtrls
,
utuOQL
,
Menus
,
ComCtrls
,
Buttons
,
ActnList
,
ituExplorerV2
,
ImgList
,
ituDataBaseLogin
,
ToolWin
,
SynHighlighterPas
,
SynEdit
;
SynHighlighterPas
,
SynEdit
;
type
type
...
...
EvoUMLPlugin/src/ituOQLParams.pas
View file @
365f5316
...
@@ -10,10 +10,10 @@ uses
...
@@ -10,10 +10,10 @@ uses
{$IFnDEF FPC}
{$IFnDEF FPC}
Mask
,
Windows
,
Mask
,
Windows
,
{$ELSE}
{$ELSE}
MaskEdit
,
LCLIntf
,
LCLType
,
LMessages
,
MaskEdit
,
LCLIntf
,
LCLType
,
{$ENDIF}
{$ENDIF}
Messages
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
Dialogs
,
ExtCtrls
,
acuOQL
,
ComCtrls
,
StdCtrls
,
acuContainers
,
Buttons
;
Dialogs
,
ExtCtrls
,
acuOQL
,
ComCtrls
,
StdCtrls
,
Buttons
;
const
cCol1
=
5
;
const
cCol1
=
5
;
cCol1Width
=
120
;
cCol1Width
=
120
;
...
...
EvoUMLPlugin/src/uCadastroCasoDeUso.pas
View file @
365f5316
...
@@ -7,10 +7,10 @@ unit uCadastroCasoDeUso;
...
@@ -7,10 +7,10 @@ unit uCadastroCasoDeUso;
interface
interface
uses
uses
LCLIntf
,
LCLType
,
LMessages
,
StarUMLintf
,
LCLIntf
,
LCLType
,
StarUMLintf
,
Messages
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
Dialogs
,
ExtCtrls
,
StdCtrls
,
ComCtrls
,
utuMessage
,
uCadastroCasoDeUsoIcones
,
acuObject
,
cxuCadastroCasoDeUso
,
Dialogs
,
ExtCtrls
,
StdCtrls
,
ComCtrls
,
utuMessage
,
uCadastroCasoDeUsoIcones
,
acuObject
,
cxuCadastroCasoDeUso
,
Buttons
,
cxuSession
;
Buttons
;
type
type
...
@@ -196,8 +196,7 @@ var lFieldCategorias, lFieldCategoria,
...
@@ -196,8 +196,7 @@ var lFieldCategorias, lFieldCategoria,
lMemoryStream
:
TMemoryStream
;
lMemoryStream
:
TMemoryStream
;
lListItem
:
TListItem
;
lListItem
:
TListItem
;
lIDO
:
integer
;
lIDO
:
integer
;
I
,
T
:
integer
;
I
:
integer
;
s
:
CP1252String
;
begin
begin
inherited
;
inherited
;
//CATEGORIAS
//CATEGORIAS
...
@@ -225,7 +224,6 @@ begin
...
@@ -225,7 +224,6 @@ begin
while
not
lEnum
.
EOL
do
while
not
lEnum
.
EOL
do
begin
begin
lFieldEntidade
:=
utField
(
lEnum
.
Current
);
lFieldEntidade
:=
utField
(
lEnum
.
Current
);
s
:=
lFieldEntidade
.
AttributeByName
(
'nome'
).
AsString
;
cbxEntidade
.
AddItem
(
lFieldEntidade
.
AttributeByName
(
'nome'
).
AsString
,
lFieldEntidade
.
AttributeByName
(
'ido'
));
cbxEntidade
.
AddItem
(
lFieldEntidade
.
AttributeByName
(
'nome'
).
AsString
,
lFieldEntidade
.
AttributeByName
(
'ido'
));
lEnum
.
MoveNext
;
lEnum
.
MoveNext
;
end
;
end
;
...
...
EvoUMLPlugin/src/uCadastroClasse.pas
View file @
365f5316
...
@@ -7,10 +7,10 @@ unit uCadastroClasse;
...
@@ -7,10 +7,10 @@ unit uCadastroClasse;
interface
interface
uses
uses
LCLIntf
,
LCLType
,
LMessages
,
StarUMLintf
,
LCLIntf
,
LCLType
,
StarUMLintf
,
Messages
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
SysUtils
,
Variants
,
Classes
,
Graphics
,
Controls
,
Forms
,
Dialogs
,
ExtCtrls
,
StdCtrls
,
ComCtrls
,
utuMessage
,
uCadastroCasoDeUsoIcones
,
acuObject
,
cxuCadastroClasse
,
Dialogs
,
ExtCtrls
,
StdCtrls
,
ComCtrls
,
utuMessage
,
acuObject
,
cxuCadastroClasse
,
Buttons
,
cxuSession
;
Buttons
;
type
type
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment