Plantuml工具绘制UML用例图、类图、顺序图。
类图脚本:
@startuml
class SphereWindow [[java:SphereWindow]] {
+SphereWindow()
+actionPerformed(e: ActionEvent): void
+{static} main(args: String[]): void
}
class Sphere {
}
SphereWindow --> "1" Sphere : sphere
class JFrame {
}
JFrame <|-- SphereWindow
interface ActionListener {
}
ActionListener <|.. SphereWindow
class TextController [[java:Controller.TextController]] {
+TextController(sphere: Sphere)
+actionPerformed(e: ActionEvent): void
}
class Sphere {
}
TextController --> "1" Sphere : sphere
class TextView {
}
TextController --> "1" TextView : textView
class TextView {
}
TextController --> "1" TextView : getTextView()
interface ActionListener {
}
ActionListener <|.. TextController
class GraphicController [[java:Controller.GraphicController]] {
+GraphicController(sph: Sphere)
+mouseReleased(e: MouseEvent): void
#pointDistance(x1: double, y1: double, x2: double, y2: double): double
}
class Sphere {
}
GraphicController --> "1" Sphere : sphere
class GraphicsView {
}
GraphicController --> "1" GraphicsView : graphicView
class GraphicsView {
}
GraphicController --> "1" GraphicsView : getGranphicView()
class Sphere [[java:Model.Sphere]] {
-radius: double
-area: double
-volume: double
+Sphere()
+getRadius(): double
+getArea(): double
+getVolume(): double
+setRadius(radius: double): void
}
class Observable {
}
Observable <|-- Sphere
class GraphicsView [[java:View.GraphicsView]] {
-radius: double
+x: int
+y: int
+bShowDim: boolean
~radiusJpanel: JPanel
+GraphicsView()
+paint(g: Graphics): void
+update(o: Observable, arg: Object): void
}
class JPanel {
}
JPanel <|-- GraphicsView
interface Observer {
}
Observer <|.. GraphicsView
class TextView [[java:View.TextView]] {
-radiusLab: JLabel
-radiusTextField: JTextField
-areaLab: JLabel
-areaTextField: JTextField
-volumeLab: JLabel
-volumeTextField: JTextField
+TextView()
-Init(): void
+update(o: Observable, arg: Object): void
+addActionListener(controler: TextController): void
}
class JPanel {
}
JPanel <|-- TextView
interface Observer {
}
Observer <|.. TextView
@enduml



