轻量级UML工具-UMLet
免费、开源,而且灰常好用的工具,这里就当加一个备注。免得忘了
如何在UMLet中表示static和final?
UMLet中表示static用下划线(对于method、function或者operation也用下划线代表static),个人感觉可以用斜体来表示final(对于method、function或者operation斜体代表abstract),如图
代码如下:
rball::BulletGenerator -- -bullet: Sphere -bulletSize: float -bulletCollisionShape: SphereCollisionShape // 用下划线表示static,用斜体表示final /_-DEFAULT_initSpeeds: float[]_/ -initSpeed: float -initSpeedIndex: int -cam: Camera -mat: Material -rootNode: Node -bulletAppState: BulletAppState -- +BulletGenerator( cam: Camera mat: Material rootNode: Node bulletAppState: BulletAppState): BulletGenerator -- ~getInitSpeed(): float ~nextInitSpeed(): void ~previousInitSpeed(): void ~launchBullet(): void -getPhysicsSpace(): PhysicsSpace
再如图:
代码:
/SimpleApplication/
--
/+simpleInitApp(): void/
+simpleUpdate(tpf: float): void
+simpleRender(rm: RenderManager): void
rball::GameMain -- ~bulletGenerator: BulletGenerator ~matBullet: Material -bulletSpeedText: BitmapText ~bulletSpeedTextListener BulletSpeedTextListener ~positionBallGenerator: BallGenerator ~randomBallGenerator: BallGenerator ~terrain: TerrainQuad ~matRock: Material ~matWire: Material ~wireframe: boolean #hintText: BitmapText -bulletAppState: BulletAppState -- _+main(args: String[])_ +setupKeys() +simpleInitApp() +simpleUpdate(tpf: float) -initCrossHairs() -loadHintText() -loadBulletSpeedText() -getWorldIntersection(): Vector3f -isInRadius(x: float, y: float, radius: float): boolean -calculateHeight(radius: float, heightFactor: float, x: float, z: float): float -adjustHeight(loc: Vector3f, radius: float, height: float)
UML类图中可见性(参考这里):
public: +
protected: #
private: -
package: ~
类图中,如果function的返回值为void怎么处理?
不要画为function(): void,直接画为function()即可