yUML Use Case Desktop Client

This a Desktop GUI Client for yUML Use Case Diagram. [coming soon ...]

To execute type in rebol console:

do read http://askuml.com/blog/yuml-use-case-desktop-client/

then copy and paste sample input

uml-online-tool

;requires encode-url function (embedded in askuml.com)
yuml-command: ask "command (validate to read from clipboard): "

		either ((length? yuml-command) = 0) [
			yuml-command0: copy yuml-command: read clipboard://
		][
			yuml-command0: copy yuml-command
		]

;remove last empty line if any
if (p: back tail yuml-command) = "^/" [remove p]

;encode ^[ to ^^[ as ^ is an escape sequence key in Rebol
replace/all yuml-command "^[" "^^["

;replace newline by ","
replace/all yuml-command newline ", "

;form the url
yuml-url: to-url rejoin [http://yuml.me/diagram/scruffy/usecase/ (encode-url yuml-command) ".jpg"]

;load image into Rebol's img variable
img: load yuml-url

;request-save function called by save button
request-save: func[][
    target-file: pick request-file/save 1
    write/binary target-file read/binary yuml-url
]

request-refresh: func[][
    print "refresh is not implemented yet"
]

panel1.layout: layout [
  origin 0x0
  yuml-image: image img
]

panel2.layout: layout [
  origin 0x0
  area (yuml-command0) yellow
]

panelbuttons.layout: layout [
    origin 5x10 space 5 across
    button "Save" [request-save]
    button "Refresh" [request-refresh]
    button "Quit" [quit]

]

;visual form
Main: layout [
    offset: 0x0
    yuml-image: image img
    return
    across
    btn "Save" [request-save]
    btn "Refresh" [request-refresh]
    btn "Quit" [quit]
    return
    area (yuml-command0) yellow
]

Main: layout [
  origin 0x0
  panel1: box 640x300 white
  panelbuttons: box 640x50
  panel2: box 640x180 yellow
]

panel1/pane: panel1.layout
panel2/pane: panel2.layout
panelbuttons/pane: panelbuttons.layout

image-panel: [
    yuml-image: image 600x400 img
]

btn-panel: [
    across origin 6 space 6
    btn "Save" [request-save]
    btn "Refresh" [request-refresh]
    btn "Quit" [quit]
]

area-panel: [
    area yellow 600x200
]

main: layout [
    origin 0 space 0
    panel image-panel
    panel btn-panel
    panel area-panel
]

view/title/options center-face Main "askuml.com" [no-border]


Sample input:

note: User onLogin Page{bg:beige}
[User]-(Connect to Login Page)
(Connect to Login Page)<(Login with Username & Password)
(Login with Username & Password)<(Remember me)
(Connect to Login Page)<(Fill Username if forgot Password)
(Connect to Login Page)<(Click on Register)
Bookmark and Share

Leave a comment