Command line options - modelint/flatland-model-diagram-editor GitHub Wiki

Command syntax

flatland [-m <model> -l <layout_sheet> [ -d <diagram> ] [-G] [-N] [-CF] [-E] [-D] [-V] [-R] [-L] [-NC] [-COLORS]

Example

% flatland -m aircraft.xmm -l aicraft_layout1.mls -d aircraft_class_diagram.pdf

Arguments

-m <model> Specifies the model (.xmm or .xsm file)

At this point Flatland supports the .xmm (Executable Markup Model) format for class diagrams as well as the .xsm (Executable State Model) for state machine diagram formats defined in this wiki. So only Executable UML models are supported out of the box. That said, Flatland is designed to support a variety of modeling languages. You will need to do a small amount of python programming to supply a scripting language and arpeggio peg parser for your modeling language. You will also need to write a draw engine population class. It's actually not that complicated and you can use the Executable Model Markup components as a guiding example.

-l <layout_sheet> Specifies the model layout sheet (.mls file)

This is a .mls (Model Layout Sheet) file that specifies your selected notation, sheet size and node and connector placement. This file format is not specific to any modeling language, so you can use it as is for all model files. Basically, it just knows how to place nodes and connectors in the Flatland grid.

[-d <diagram>]

This one is optional and will create or replace a local file named 'diagram.pdf' with your generated diagram if you leave it out. Otherwise, you can use this option to specify your own output diagram file name/path.

Assist the layout process and helpful for diagnosing a problem

-G

Extremely helpful when you are laying out a diagram. It paints a grid to aid you in specifying node and connector placements. I always start with this option on until I'm happy with the diagram and then remove it to provide the final output.

-N

If you've done something wrong in your connector specifications and you aren't getting a diagram generated, you can try drawing only the nodes (classes, for example) to see if they are all in the right place. Mis-placed Nodes can cause all kinds of connector problems.

User configuration startup

-CF

The configuration option will create a config directory if one does not already exist in your $HOME/.flatland directory. It will create the .flatland directory too if it is not found. Inside this config directory will be a .yaml file for each supported configuration file.

At present there is only one: color.yaml But in the near future there will be more. The initial .yaml files will provide commented instructions explaining how to configure various flatland features. The color.yaml file, for example, lets the user specify their own RGB colors for use as canvas backgrounds and other purposes. Once specified and loaded into the database via the -R option, the user can reference these colors from their .msl layout files.

If a config directory already exists, it will not be overwritten. To refresh it, you need to rename the directory or move it somewhere or delete it first. We don't want to accidentally overwrite any carefully crafted user settings. If any user settings collide with a system setting, the user setting will overwrite it when the database is reloaded

Say the user redefines 'recycle bin' to a different shade of blue. The system setting is then overwritten. To recover the original system setting, just rename your color and reload the database with the -R option.

It is important run flatland with the -R option whenever a new version of flatland is downloaded or whenever a user .yaml file is updated. That's because each new version of flatland comes with a fresh database containing only system supplied settings.

Documentation and examples

-E

Creates a local directory filled with example model and layout patterns used to test Flatland. You can poke through these if you want to see lots of example models and layout sheets. Inside the examples directory you will find a copy of the test script used to test all of the examples. It won't run locally, but you can look inside this file to see which model and layout files pair together. For example, you can see that test t001 pairs the aircraft2.xmm model with the t001_straight_binary_horiz.mls layout. (No diagram will be output if you specify this option).

-D

Creates a local directory filled with all of the models used to design Flatland. Yes, Flatland was designed using Executable UML. In addition to all of the models and layout sheets in this directory, you will find a pdf that documents each class, attribute and relationship in the Flatland models. These may serve as useful examples in and of themselves. No diagram will be output.

Other

-V

Shows the current Flatland version and quits. (No diagram will be generated)

-R

Rebuilds the database that Flatland uses to store style sheets, notation, etc. Ideally, you should never need this option since you get a newly rebuilt database each time you upgrade your package. But if things get weird, there's never harm in rebuilding the database.

-L

Creates a log file in the local directory. Useful to the developer when diagnosing problems in the Flatland code. If you run into trouble, we may want to take a peak at your log.

'-NC'

No colors: When you want to create a PDF with a white background for hardcopy, you can turn off any background colors in the diagram output. See also color keyword in the header section.

'-COLORS'

Prints out a list of colors suitable for your canvas background. All of them are light enough that black typeface is legible on most display hardware. You can then use any of these names when specifying your background color. When this flag is specified the only other command line information taken into account is the -R option if present. No diagram will be output if you specify this option. You can define your own colors by editing the color.yaml file

⚠️ **GitHub.com Fallback** ⚠️