Layout Options

Version 1.1 by cds on 2013/05/31 20:06

Warning

This is preliminary documentation. You've been warned.

KIML defines a whole set of standard layout options that many layout algorithms support. Whether an algorithm supports a layout option depends on the option and on the algorithm. Algorithms may provide more specialized documentation for a given layout option.

Contents

Overview

Beside a human-readable name, layout options are defined by the following properties:

  • An ID to identify them.
  • A type. One of Boolean, String, Int, Float, Enum, EnumSet (a Set over a given enumeration), or Object. The types Enum and EnumSet have to be further defined by an enumeration class. The Object type can be constricted to a certain class.
  • An optional definition of what kinds of graph objects the option applies to. At least one of Parents (nodes that have children, including the diagram root node), Nodes, Edges, Ports, and Labels. If this definition is omitted, a layout option will not be shown to the user in the UI, but can still be set programmatically.
  • An optional default value. If an option is not set on an object and if the option does not have a default value, null is returned when it is accessed.

KIML defines the following set of layout options:

Option

ID

Type

Applies to

Default

Alignment

de.cau.cs.kieler.alignment

Enum

Nodes

AUTOMATIC

Aspect Ratio

de.cau.cs.kieler.aspectRatio

Float

Parents

0.0

Bend Points

de.cau.cs.kieler.bendPoints

Object

Edges

 

Border Spacing

de.cau.cs.kieler.borderSpacing

Float

Parents

-1.0

Comment Box

de.cau.cs.kieler.commentBox

Boolean

 

false

Debug Mode

de.cau.cs.kieler.debugMode

Boolean

Parents

false

Diagram Type

de.cau.cs.kieler.diagramType

String

 

 

Direction

de.cau.cs.kieler.direction

Enum

Parents

UNDEFINED

Edge Label Placement

de.cau.cs.kieler.edgeLabelPlacement

Enum

 

UNDEFINED

Edge Routing

de.cau.cs.kieler.edgeRouting

Enum

Parents

UNDEFINED

Edge Type

de.cau.cs.kieler.edgeType

Enum

 

NONE

Expand Nodes

de.cau.cs.kieler.expandNodes

Boolean

Parents

false

Font Name

de.cau.cs.kieler.fontName

String

 

 

Font Size

de.cau.cs.kieler.fontSize

Int

 

 

Hypernode

de.cau.cs.kieler.hypernode

Boolean

 

false

Interactive

de.cau.cs.kieler.interactive

Boolean

Parents

false

Label Spacing

de.cau.cs.kieler.labelSpacing

Float

Edges
Nodes

-1.0

Layout Hierarchy

de.cau.cs.kieler.layoutHierarchy

Boolean

Parents

false

Layout Algorithm

de.cau.cs.kieler.algorithm

String

Parents

 

Minimal Height

de.cau.cs.kieler.minHeight

Float

 

0.0

Minimal Width

de.cau.cs.kieler.minWidth

Float

 

0.0

No Layout

de.cau.cs.kieler.noLayout

Boolean

 

false

Node Label Placement

de.cau.cs.kieler.nodeLabelPlacement

EnumSet

Nodes

 

Port Constraints

de.cau.cs.kieler.portConstraints

Enum

Nodes

UNDEFINED

Port Label Placement

de.cau.cs.kieler.portLabelPlacement

Enum

Nodes

OUTSIDE

Port Offset

de.cau.cs.kieler.offset

Float

 

 

Port Side

de.cau.cs.kieler.portSide

Enum

 

UNDEFINED

Position

de.cau.cs.kieler.position

Object

Labels
Nodes
Ports

 

Priority

de.cau.cs.kieler.priority

Int

Edges
Nodes

 

Randomization Seed

de.cau.cs.kieler.randomSeed

Int

Parents

 

Separate Connected Components

de.cau.cs.kieler.separateConnComp

Boolean

Parents

 

Size Constraint

de.cau.cs.kieler.sizeConstraint

EnumSet

Nodes

 

Size Options

de.cau.cs.kieler.sizeOptions

EnumSet

Nodes

DEFAULT_MINIMUM_SIZE

Spacing

de.cau.cs.kieler.spacing

Float

Parents

-1.0

The Most Important Options

TODO: Write a bit of documentation about the most important layout options and how to use them, possibly with a simple example or something.

Detailed Documentation

This section explains every layout option in more detail.

Port Offset

The port offset is used to specify how much space a layout algorithm should leave between a port and the border of its node. This is usually zero, but doesn't have to be. If the offset is not defined for a given port, a layout algorithm can try to infer the offset from the port's coordinates and its node's size in the input graph. This of course requires both properties to be set to sensible values.