/[libvob]/libvob/org/nongnu/libvob/lava/SimpleBreaker.java
ViewVC logotype

Diff of /libvob/org/nongnu/libvob/lava/SimpleBreaker.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by benja, Sat Apr 5 18:51:19 2003 UTC revision 1.2 by benja, Sun Apr 6 14:18:28 2003 UTC
# Line 31  import java.awt.Graphics; Line 31  import java.awt.Graphics;
31  public class SimpleBreaker extends AbstractMonoVob  public class SimpleBreaker extends AbstractMonoVob
32      implements Sequence {      implements Sequence {
33    
34      protected Sequence lineType;      /** The sequence lines are put into. */
35      protected Sequence lineHolder;      protected Sequence lineHolder;
36    
37        /** The width of each line. */
38      protected float lineWidth;      protected float lineWidth;
39    
40        /** The axis along which to do breaking:
41         *  X is for left-to-right line, Y for
42         *  top-to-bottom lines.
43         */
44      protected Axis axis;      protected Axis axis;
45    
46      protected Sequence line;  
47        /** The current line. */
48        protected Box line;
49    
50        /** The width of the vobs currently put into the current line. */
51      protected float currentWidth;      protected float currentWidth;
52    
53      public SimpleBreaker(Sequence lineType,  
54                           Sequence lineHolder,      public SimpleBreaker(Sequence lineHolder,
55                           float lineWidth,                           float lineWidth,
56                           Axis axis) {                           Axis axis) {
57          super(lineHolder);          super(lineHolder);
58    
         this.lineType = lineType;  
59          this.lineHolder = lineHolder;          this.lineHolder = lineHolder;
60          this.lineWidth = lineWidth;          this.lineWidth = lineWidth;
61          this.axis = axis;          this.axis = axis;
# Line 55  public class SimpleBreaker extends Abstr Line 65  public class SimpleBreaker extends Abstr
65    
66      protected void newline() {      protected void newline() {
67          if(line != null) lineHolder.add(line);          if(line != null) lineHolder.add(line);
68          line = lineType.cloneEmpty();          line = new Box(axis);
69          currentWidth = 0;          currentWidth = 0;
70      }      }
71    
72      public Sequence cloneEmpty() {      public Sequence cloneEmpty() {
73          return new SimpleBreaker(lineType,          return new SimpleBreaker(lineHolder.cloneEmpty(),
                                  lineHolder.cloneEmpty(),  
74                                   lineWidth, axis);                                   lineWidth, axis);
75      }      }
76    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26