source: default/trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/views/syntaxdiagram/OptionRepetitionFigure.java @ 5

Last change on this file since 5 was 5, checked in by zeiss, 14 years ago
  • Property svn:mime-type set to text/plain
File size: 912 bytes
Line 
1package de.ugoe.cs.swe.bnftools.ui.views.syntaxdiagram;
2
3import org.eclipse.draw2d.ToolbarLayout;
4
5public class OptionRepetitionFigure extends SyntaxDiagramFigure {
6
7        public OptionRepetitionFigure(SyntaxDiagramFigure f) {
8                super();
9
10                setLayoutManager(new ToolbarLayout());
11
12                RepetitionFigure repetition = new RepetitionFigure(f);
13                OptionFigure optional = new OptionFigure(repetition);
14
15                add(optional);
16
17                PathFigure leftConnectionPath = new PathFigure();
18                leftConnectionPath.setSourceAnchor(this.getLeftAnchor());
19                leftConnectionPath.setTargetAnchor(optional.getLeftAnchor());
20                add(leftConnectionPath);
21
22                PathFigure rightConnectionPath = new PathFigure();
23                rightConnectionPath.setSourceAnchor(optional.getRightAnchor());
24                rightConnectionPath.setTargetAnchor(this.getRightAnchor());
25                add(rightConnectionPath);
26
27                setBorder(new LineMarginBorder(10, 40, 10, 40, 0));
28        }
29
30}
Note: See TracBrowser for help on using the repository browser.