1 19 20 package org.netbeans.lib.editor.view; 21 22 import javax.swing.text.AbstractDocument ; 23 import javax.swing.text.View ; 24 import org.netbeans.editor.view.spi.FlyView; 25 import org.netbeans.editor.view.spi.LockView; 26 import org.netbeans.editor.view.spi.ViewLayoutState; 27 28 35 36 public class DefaultViewLayoutState extends SimpleViewLayoutState { 37 38 private float layoutMinorAxisMinimumSpan; 39 40 private float layoutMinorAxisMaximumSpan; 41 42 43 public DefaultViewLayoutState(View v) { 44 super(v); 45 } 46 47 protected boolean minorAxisUpdateLayout(int minorAxis) { 48 View view = getView(); 49 boolean minorAxisPreferenceChanged = false; 50 float val; 51 52 val = view.getMaximumSpan(minorAxis); 53 if (val != getLayoutMinorAxisMaximumSpan()) { 54 setLayoutMinorAxisMaximumSpan(val); 55 minorAxisPreferenceChanged = true; 56 } 57 58 val = view.getMinimumSpan(minorAxis); 59 if (val != getLayoutMinorAxisMinimumSpan()) { 60 setLayoutMinorAxisMinimumSpan(val); 61 minorAxisPreferenceChanged = true; 62 } 63 64 return minorAxisPreferenceChanged; 65 } 66 67 public float getLayoutMinorAxisMaximumSpan() { 68 return layoutMinorAxisMaximumSpan; 69 } 70 71 public void setLayoutMinorAxisMaximumSpan(float layoutMinorAxisMaximumSpan) { 72 this.layoutMinorAxisMaximumSpan = layoutMinorAxisMaximumSpan; 73 } 74 75 public float getLayoutMinorAxisMinimumSpan() { 76 return layoutMinorAxisMinimumSpan; 77 } 78 79 public void setLayoutMinorAxisMinimumSpan(float layoutMinorAxisMinimumSpan) { 80 this.layoutMinorAxisMinimumSpan = layoutMinorAxisMinimumSpan; 81 } 82 83 } 84 | Popular Tags |