Pruebas con la generación de UML.

Algunas pruebas de plugins de IntelliJ que generan UML de PlatUML.
Está bien, es similar a Mermaid y también se renderiza por ahí.
Es mejor que imágenes o cosas de esas pues es editable.
This commit is contained in:
2022-06-05 00:26:26 +02:00
parent 156f4f9f7f
commit 83e1fdac9a
2 changed files with 358 additions and 0 deletions
+247
View File
@@ -0,0 +1,247 @@
@startuml
/' diagram meta data start
config=StructureConfiguration;
{
"projectClassification": {
"searchMode": "OpenProject", // OpenProject, AllProjects
"includedProjects": "",
"pathEndKeywords": "*.impl",
"isClientPath": "",
"isClientName": "",
"isTestPath": "",
"isTestName": "",
"isMappingPath": "",
"isMappingName": "",
"isDataAccessPath": "",
"isDataAccessName": "",
"isDataStructurePath": "",
"isDataStructureName": "",
"isInterfaceStructuresPath": "",
"isInterfaceStructuresName": "",
"isEntryPointPath": "",
"isEntryPointName": "",
"treatFinalFieldsAsMandatory": false
},
"graphRestriction": {
"classPackageExcludeFilter": "",
"classPackageIncludeFilter": "",
"classNameExcludeFilter": "",
"classNameIncludeFilter": "",
"methodNameExcludeFilter": "",
"methodNameIncludeFilter": "",
"removeByInheritance": "", // inheritance/annotation based filtering is done in a second step
"removeByAnnotation": "",
"removeByClassPackage": "", // cleanup the graph after inheritance/annotation based filtering is done
"removeByClassName": "",
"cutMappings": false,
"cutEnum": true,
"cutTests": true,
"cutClient": true,
"cutDataAccess": true,
"cutInterfaceStructures": true,
"cutDataStructures": true,
"cutGetterAndSetter": true,
"cutConstructors": true
},
"graphTraversal": {
"forwardDepth": 3,
"backwardDepth": 3,
"classPackageExcludeFilter": "",
"classPackageIncludeFilter": "",
"classNameExcludeFilter": "",
"classNameIncludeFilter": "",
"methodNameExcludeFilter": "",
"methodNameIncludeFilter": "",
"hideMappings": false,
"hideDataStructures": false,
"hidePrivateMethods": true,
"hideInterfaceCalls": true, // indirection: implementation -> interface (is hidden) -> implementation
"onlyShowApplicationEntryPoints": false, // root node is included
"useMethodCallsForStructureDiagram": "ForwardOnly" // ForwardOnly, BothDirections, No
},
"details": {
"aggregation": "GroupByClass", // ByClass, GroupByClass, None
"showClassGenericTypes": true,
"showMethods": true,
"showMethodParameterNames": true,
"showMethodParameterTypes": true,
"showMethodReturnType": true,
"showPackageLevels": 2,
"showDetailedClassStructure": true
},
"rootClass": "uberelectron.testgame.BackEndTest",
"extensionCallbackMethod": "" // qualified.class.name#methodName - signature: public static String method(String)
}
diagram meta data end '/
digraph g {
rankdir="TB"
splines=polyline
'nodes
subgraph cluster_1146226812 {
label=testgame
labeljust=l
fillcolor="#ececec"
style=filled
BackEndTest1260140886[
label=<<TABLE BORDER="1" CELLBORDER="0" CELLPADDING="4" CELLSPACING="0">
<TR><TD ALIGN="LEFT" >(C)BackEndTest</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" ># game: testGame [0..1]</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" >+ dispose()</TD></TR>
<TR><TD ALIGN="LEFT" >+ hide()</TD></TR>
<TR><TD ALIGN="LEFT" >+ pause()</TD></TR>
<TR><TD ALIGN="LEFT" >+ render(delta: float)</TD></TR>
<TR><TD ALIGN="LEFT" >+ resize(width: int, height: int)</TD></TR>
<TR><TD ALIGN="LEFT" >+ resume()</TD></TR>
<TR><TD ALIGN="LEFT" >+ show()</TD></TR>
</TABLE>>
style=filled
margin=0
shape=plaintext
fillcolor="#FFFFFF"
];
testGame1260140886[
label=<<TABLE BORDER="1" CELLBORDER="0" CELLPADDING="4" CELLSPACING="0">
<TR><TD ALIGN="LEFT" >(C)testGame</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" >+ batch: SpriteBatch [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" >+ font: BitmapFont [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" >+ mcLoader: MachineLoader [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" >+ rmLoader: RoomLoader [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" >+ tileSetManager: TileSetManager [0..1]</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" ># LoadAssets()</TD></TR>
<TR><TD ALIGN="LEFT" >+ create()</TD></TR>
<TR><TD ALIGN="LEFT" >+ dispose()</TD></TR>
<TR><TD ALIGN="LEFT" >+ render()</TD></TR>
</TABLE>>
style=filled
margin=0
shape=plaintext
fillcolor="#FFFFFF"
];
}
subgraph cluster_1870910510 {
label=gameSystems
labeljust=l
fillcolor="#ececec"
style=filled
MachineLoader1069956928[
label=<<TABLE BORDER="1" CELLBORDER="0" CELLPADDING="4" CELLSPACING="0">
<TR><TD ALIGN="LEFT" >(C)MachineLoader</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" >- machineMap: HashMap&lt;String, Machine&gt; [0..*]</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" >+ AddMachine(machineToAdd: Machine)</TD></TR>
<TR><TD ALIGN="LEFT" >+ GetMachine(machineID: String): Machine</TD></TR>
<TR><TD ALIGN="LEFT" >+ LoadFromJSON(file: FileHandle)</TD></TR>
<TR><TD ALIGN="LEFT" >+ SaveToJSON(file: FileHandle)</TD></TR>
</TABLE>>
style=filled
margin=0
shape=plaintext
fillcolor="#FFFFFF"
];
Room1069956928[
label=<<TABLE BORDER="1" CELLBORDER="0" CELLPADDING="4" CELLSPACING="0">
<TR><TD ALIGN="LEFT" >(C)Room</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" ># bgData: int[][] [0..*]</TD></TR>
<TR><TD ALIGN="LEFT" ># esOnline: boolean [1]</TD></TR>
<TR><TD ALIGN="LEFT" ># espacioOcupado: int [1]</TD></TR>
<TR><TD ALIGN="LEFT" ># espacioTotal: int [1]</TD></TR>
<TR><TD ALIGN="LEFT" ># machineData: Machine[][] [0..*]</TD></TR>
<TR><TD ALIGN="LEFT" ># recursosDefecto: HashMap&lt;String, Integer&gt; [0..*]</TD></TR>
<TR><TD ALIGN="LEFT" ># recursosMaximos: HashMap&lt;String, Integer&gt; [0..*]</TD></TR>
<TR><TD ALIGN="LEFT" ># recursosOcupados: HashMap&lt;String, Integer&gt; [0..*]</TD></TR>
<TR><TD ALIGN="LEFT" ># roomName: String [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" ># roomSize: Vector2 [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" ># tileSetID: String [0..1]</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" >+ AddMachine(x: int, y: int, machineToAdd: Machine)</TD></TR>
<TR><TD ALIGN="LEFT" >+ ComprobarCapacidadRecurso(attribute: String, valorComprobar: int): boolean</TD></TR>
<TR><TD ALIGN="LEFT" >+ ComprobarMaquina(maquinaComprobar: Machine, x: int, y: int): boolean</TD></TR>
<TR><TD ALIGN="LEFT" >+ ComprobarPosicion(x: int, y: int): boolean</TD></TR>
<TR><TD ALIGN="LEFT" >+ ComprobarRecursos(maquinaComprobar: Machine): boolean</TD></TR>
<TR><TD ALIGN="LEFT" >+ EliminarMaquina(posX: int, posY: int)</TD></TR>
<TR><TD ALIGN="LEFT" >+ ModificarRecursoSala(resourceName: String, mod: int, esMaximo: boolean): boolean</TD></TR>
<TR><TD ALIGN="LEFT" >+ MoverMaquina(oldX: int, oldY: int, newX: int, newY: int)</TD></TR>
</TABLE>>
style=filled
margin=0
shape=plaintext
fillcolor="#FFFFFF"
];
RoomLoader1069956928[
label=<<TABLE BORDER="1" CELLBORDER="0" CELLPADDING="4" CELLSPACING="0">
<TR><TD ALIGN="LEFT" >(C)RoomLoader</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" ># currentRoom: Room [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" ># loadedRooms: HashMap&lt;String, Room&gt; [0..*]</TD></TR>
<TR><TD ALIGN="LEFT" ># loaderJson: Json [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" ># mcLoader: MachineLoader [0..1]</TD></TR>
<TR><TD ALIGN="LEFT" ># roomSerializer: Serializer&lt;Room&gt; [0..1]</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" >+ AddRoom(rToAdd: Room)</TD></TR>
<TR><TD ALIGN="LEFT" >+ GetCurrentRoom(): Room</TD></TR>
<TR><TD ALIGN="LEFT" >+ LoadRoomFromJSON(file: FileHandle)</TD></TR>
<TR><TD ALIGN="LEFT" >+ SaveRoomToJSON(roomID: String, file: FileHandle)</TD></TR>
<TR><TD ALIGN="LEFT" >+ SetCurrentRoom(roomID: String)</TD></TR>
<TR><TD ALIGN="LEFT" >+ UnloadRoom(roomID: String)</TD></TR>
<TR><TD ALIGN="LEFT" >+ isRoomLoader(roomID: String): boolean</TD></TR>
</TABLE>>
style=filled
margin=0
shape=plaintext
fillcolor="#FFFFFF"
];
TileSetManager1069956928[
label=<<TABLE BORDER="1" CELLBORDER="0" CELLPADDING="4" CELLSPACING="0">
<TR><TD ALIGN="LEFT" >(C)TileSetManager</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" ># tileSetsMap: HashMap&lt;String, TiledMapTileSet&gt; [0..*]</TD></TR>
<HR/>
<TR><TD ALIGN="LEFT" >+ GetTileSet(tileSetName: String): TiledMapTileSet</TD></TR>
<TR><TD ALIGN="LEFT" >+ loadTileSet(path: String, tileSetName: String, tileWidth: int, tileHeight: int): boolean</TD></TR>
</TABLE>>
style=filled
margin=0
shape=plaintext
fillcolor="#FFFFFF"
];
}
'edges
BackEndTest1260140886 -> testGame1260140886[label="game
[0..1]"];
RoomLoader1069956928 -> MachineLoader1069956928[label="mcLoader
[0..1]"];
RoomLoader1069956928 -> Room1069956928[label="currentRoom
[0..1]"];
RoomLoader1069956928 -> Room1069956928[label="loadedRooms
[0..*]"];
RoomLoader1069956928 -> Room1069956928[label="roomSerializer
[0..1]"];
testGame1260140886 -> MachineLoader1069956928[label="mcLoader
[0..1]"];
testGame1260140886 -> RoomLoader1069956928[label="rmLoader
[0..1]"];
testGame1260140886 -> TileSetManager1069956928[label="tileSetManager
[0..1]"];
}
@enduml
+111
View File
@@ -0,0 +1,111 @@
@startuml
class uberelectron.gameSystems.LoginData {
~ String nickname
~ String password
}
class uberelectron.gameSystems.SaveLoader {
+ {static} Save LoadFromJSON(FileHandle)
+ {static} void SaveToJSON(Save,FileHandle)
}
class uberelectron.gameSystems.GameManager {
+ {static} MachineLoader mcLoader
+ {static} RoomLoader rmLoader
+ {static} Save saveData
}
class uberelectron.gameSystems.TileSetManager {
~ HashMap<String,TiledMapTileSet> tileSetsMap
+ boolean loadTileSet(String,String,int,int)
+ TiledMapTileSet GetTileSet(String)
}
class uberelectron.gameSystems.RoomLoader {
~ Room currentRoom
~ HashMap<String,Room> loadedRooms
~ MachineLoader mcLoader
~ Json loaderJson
~ Json.Serializer<Room> roomSerializer
+ void LoadRoomFromJSON(FileHandle)
+ void SaveRoomToJSON(String,FileHandle)
+ void UnloadRoom(String)
+ boolean isRoomLoader(String)
+ void SetCurrentRoom(String)
+ Room GetCurrentRoom()
+ void AddRoom(Room)
}
class uberelectron.gameSystems.MachineLoader {
- HashMap<String,Machine> machineMap
+ void LoadFromJSON(FileHandle)
+ void SaveToJSON(FileHandle)
+ void AddMachine(Machine)
+ Machine GetMachine(String)
}
class uberelectron.gameSystems.Save {
~ int dinero
~ HashMap<String,Boolean> ownedRoom
}
class uberelectron.gameSystems.Machine {
~ String machineID
+ HashMap<String,Integer> attributes
~ boolean esDeRecursos
~ String tileSetID
~ int tilePos
+ String getMachineID()
+ void setMachineID(String)
+ boolean isEsDeRecursos()
+ void setEsDeRecursos(boolean)
+ HashMap<String,Integer> getAttributes()
+ String getTileSetID()
+ void setTileSetID(String)
+ int getTilePos()
+ void setTilePos(int)
+ void AddAtribute(String,int)
+ void UpdateAtribute(String,int)
+ int GetAtributeValue(String)
}
class uberelectron.gameSystems.LoginSystem {
- {static} boolean isLogged
+ {static} boolean AutentificarUsuario()
+ {static} boolean isIsLogged()
}
class uberelectron.gameSystems.Room {
~ String roomName
~ Vector2 roomSize
~ int espacioOcupado
~ int espacioTotal
~ HashMap<String,Integer> recursosOcupados
~ HashMap<String,Integer> recursosMaximos
~ HashMap<String,Integer> recursosDefecto
~ String tileSetID
~ int[][] bgData
~ Machine[][] machineData
~ boolean esOnline
+ void AddMachine(int,int,Machine)
+ boolean ComprobarCapacidadRecurso(String,int)
+ boolean ComprobarRecursos(Machine)
+ boolean ComprobarPosicion(int,int)
+ boolean ComprobarMaquina(Machine,int,int)
+ boolean ModificarRecursoSala(String,int,boolean)
+ void MoverMaquina(int,int,int,int)
+ void EliminarMaquina(int,int)
+ String getRoomName()
+ Vector2 getRoomSize()
+ int getEspacioOcupado()
+ int getEspacioTotal()
+ String getTileSetID()
+ int[][] getBgData()
+ Machine[][] getMachineData()
+ boolean isEsOnline()
}
uberelectron.gameSystems.MachineLoader --* uberelectron.gameSystems.Machine
uberelectron.gameSystems.RoomLoader --* uberelectron.gameSystems.Room
uberelectron.gameSystems.Room --* uberelectron.gameSystems.Machine
uberelectron.gameSystems.RoomLoader --> uberelectron.gameSystems.MachineLoader
uberelectron.gameSystems.SaveLoader --> uberelectron.gameSystems.Save
uberelectron.gameSystems.LoginSystem --> uberelectron.gameSystems.LoginData
uberelectron.gameSystems.GameManager --* uberelectron.gameSystems.RoomLoader
uberelectron.gameSystems.GameManager --* uberelectron.gameSystems.MachineLoader
uberelectron.gameSystems.GameManager --* uberelectron.gameSystems.SaveLoader
uberelectron.gameSystems.GameManager --* uberelectron.gameSystems.LoginSystem
@enduml