1 30 31 package com.jgoodies.forms.layout; 32 33 56 57 public class RowSpec extends FormSpec { 58 59 60 62 65 public static final DefaultAlignment TOP = FormSpec.TOP_ALIGN; 66 67 70 public static final DefaultAlignment CENTER = FormSpec.CENTER_ALIGN; 71 72 75 public static final DefaultAlignment BOTTOM = FormSpec.BOTTOM_ALIGN; 76 77 80 public static final DefaultAlignment FILL = FormSpec.FILL_ALIGN; 81 82 85 public static final DefaultAlignment DEFAULT = CENTER; 86 87 88 90 101 public RowSpec(DefaultAlignment defaultAlignment, 102 Size size, 103 double resizeWeight) { 104 super(defaultAlignment, size, resizeWeight); 105 } 106 107 115 public RowSpec(Size size) { 116 super(DEFAULT, size, NO_GROW); 117 } 118 119 125 public RowSpec(String encodedDescription) { 126 super(DEFAULT, encodedDescription); 127 } 128 129 130 136 public RowSpec asUnmodifyable() { 137 return new UnmodifyableRowSpec(this); 138 } 139 140 141 143 150 protected final boolean isHorizontal() { return false; } 151 152 153 155 private static final class UnmodifyableRowSpec extends RowSpec { 156 157 private UnmodifyableRowSpec(RowSpec rowSpec) { 158 super(rowSpec.getDefaultAlignment(), 159 rowSpec.getSize(), 160 rowSpec.getResizeWeight()); 161 } 162 163 166 public void setDefaultAlignment(DefaultAlignment newDefaultAlignment) { 167 throw new UnsupportedOperationException (); 168 } 169 170 173 public void setSize(Size size) { 174 throw new UnsupportedOperationException (); 175 } 176 177 180 public void setResizeWeight(double weight) { 181 throw new UnsupportedOperationException (); 182 } 183 184 189 public RowSpec asUnmodifyable() { 190 return this; 191 } 192 193 } 194 195 196 197 } 198 199 | Popular Tags |