Boundary Labeling Java Applet
This is a demonstration applet for several boundary labeling algorithms developed in the group GeoNet at Karlsruhe University. For a description of the applet see below.
The applet requires Java
1.5 or higher. To load image files you have to accept the self-signed
certificate. If you do not want to load images from your harddisk, you do not
need to accept the certificate.
The applet consists of three columns: A control panel, a label column and the main screen.
The control panel:
- Load image - loads a background image (*.png, *.jpg, *.bmp, *.gif) from your harddisk.
- Reset points - deletes all input points.
- Reset image - removes the background image from the mainscreen.
- France example - loads an example of the regions of France (used in the related publications)
- Algorithms - here you can choose an algorithm to be used to calculate a labeling.
There are two types of leaders used for the labeling:
- Po-leaders consist of an horizontal and an optional vertical line segment.
- Do-leaders consist of an horizontal and an optional diagonal line segment.
All algorithms minimize the cost of a labeling with different cost functions. The cost of a labeling is the sum of the cost of all leaders, which are defined as:
- BendOpt: 0, if the leader has no bend, 1, otherwise.
- LengthOpt/FastLenOpt: The length of the leader. The difference between LengthOpt and FastLenOpt is, that LengthOpt uses is a dynamic program for general badness functions (also used for BendOpt and HybridOpt), and FastLenOpt is an optimized sweep-line algorithm for minimizing the total leader length. FastLenOpt does not support nearPenalty explained below.
- HybridOpt: 0, if the leader has no bend, and otherwise the sum of bendPenalty and the ratio of the non-horizontal length to the horizontal length of the leader.
Additionally a penalty can be added to the cost of the labeling for each point
that lies within a margin of nearDelta units around the leaders. The
penalty depends on the squared distance to the leader and
nearPenalty. The margin can be visualized by enabling
nearShow. If nearPenalty is set to zero, this feature is disabled.
For more details about the algorithms see Labelings using one-bend arcs.
- Calculate - starts the calculation of an optimal labeling for the current problem instance. As a result the labeling is painted in the main screen and the number of bends, the total length, the cost of the labeling, and the time needed for the calculation is shown below the "Calculate" button.
The label column: If the main screen contains points, the label column shows the labels with names corresponding to the points. You can highlight a point by left clicking either on the point itself in the main screen or on the label. If you right click on the point or the label you can rename or remove the point. If there are no points yet, the right border of this column is drawn as a dashed line.
The main screen: This part shows all points and, if a labeling has already been calculated for this problem instance, the current labeling. You can move the points by simply dragging them with the left mouse button. To create new points you can either left click at the desired position while holding the CTRL key or right click there and choose the appropriate menu item.
The applet automatically resizes to fit the whole browser window (tested with Internet Explorer 6, Firefox 1.5 and Opera 9.2).