2,2c2,2 < * @(#)LineConnection.java 5.2 --- > * @(#)LineConnection.java 3a4,9 > * Project: JHotdraw - a GUI framework for technical drawings > * http://www.jhotdraw.org > * http://jhotdraw.sourceforge.net > * Copyright: © by the original author(s) and all contributors > * License: Lesser GNU Public License (LGPL) > * http://www.opensource.org/licenses/lgpl-license.html 17a24,24 > * 18a26,27 > * > * @version <$CURRENT_VERSION$> 22,22c31,31 < protected Connector fStart = null; --- > protected Connector myStartConnector; 23,23c32,32 < protected Connector fEnd = null; --- > protected Connector myEndConnector; 55,55c64,64 < for (int i = 1; i < fPoints.size()-1; i++) --- > for (int i = 1; i < fPoints.size()-1; i++) { 56a66,66 > } 64a75,75 > setStartConnector(newStartConnector); 64,64c74,74 < public void connectStart(Connector start) { --- > public void connectStart(Connector newStartConnector) { 65,65d74 < fStart = start; 72,72c82,82 < public void connectEnd(Connector end) { --- > public void connectEnd(Connector newEndConnector) { 72a83,83 > setEndConnector(newEndConnector); 73,73d82 < fEnd = end; 82a93,93 > setStartConnector(null); 83,83d92 < fStart = null; 91a102,102 > setEndConnector(null); 92,92d101 < fEnd = null; 99a110,111 > return other.getStartConnector() == getStartConnector() > && other.getEndConnector() == getEndConnector(); 100,100d109 < return other.start() == start() && other.end() == end(); 118a130,130 > if (getStartConnector() != null) { 119,119d129 < if (start() != null) 120,120c131,131 < return start().owner(); --- > return getStartConnector().owner(); 120a132,132 > } 127a140,140 > if (getEndConnector() != null) { 128,128d139 < if (end() != null) 129a142,142 > } 129,129c141,141 < return end().owner(); --- > return getEndConnector().owner(); 132a146,149 > protected void setStartConnector(Connector newStartConnector) { > myStartConnector = newStartConnector; > } > 135a153,158 > public Connector getStartConnector() { > return myStartConnector; > } > > protected void setEndConnector(Connector newEndConnector) { > myEndConnector = newEndConnector; 136,136c164,164 < public Connector start() { --- > public Connector getEndConnector() { 136a165,165 > return myEndConnector; 137,137d164 < return fStart; 143,144d163 < public Connector end() { < return fEnd; 159,159c180,180 < if (fPoints.size() == 0) --- > if (fPoints.size() == 0) { 160a182,183 > } > else { 161,161d181 < else 162a185,185 > } 171,171c194,194 < if (fPoints.size() < 2) --- > if (fPoints.size() < 2) { 172a196,197 > } > else { 173,173d195 < else 174a199,199 > } 202,202c227,227 < for (int i = 1; i < fPoints.size()-1; i++) --- > for (int i = 1; i < fPoints.size()-1; i++) { 203a229,229 > } 235a262,264 > if (getStartConnector() != null) { > Point start = getStartConnector().findStart(this); > 236,236c265,265 < if (fStart != null) { --- > if(start != null) { 237,237d265 < Point start = fStart.findStart(this); 239a268,271 > } > if (getEndConnector() != null) { > Point end = getEndConnector().findEnd(this); > 240,240c272,272 < if (fEnd != null) { --- > if(end != null) { 241,241d272 < Point end = fEnd.findEnd(this); 244a276,276 > } 259,259c291,291 < if (listener() != null) --- > if (listener() != null) { 261a294,294 > } 269a303,303 > if (getStartConnector() != null) { 270a305,306 > } > if (getEndConnector() != null) { 270,270c304,304 < if (fStart != null) startFigure().removeFigureChangeListener(this); --- > startFigure().removeFigureChangeListener(this); 271a308,308 > } 271,271c307,307 < if (fEnd != null) endFigure().removeFigureChangeListener(this); --- > endFigure().removeFigureChangeListener(this); 276,276c313,313 < dw.writeStorable(fStart); --- > dw.writeStorable(getStartConnector()); 277,277c314,314 < dw.writeStorable(fEnd); --- > dw.writeStorable(getEndConnector()); 283,283c320,320 < if (start != null) --- > if (start != null) { 284a322,322 > } 286,286c324,324 < if (end != null) --- > if (end != null) { 287a326,326 > } 288,288c327,327 < if (start != null && end != null) --- > if (start != null && end != null) { 290a330,330 > } 296a337,342 > if (getStartConnector() != null) { > connectStart(getStartConnector()); > } > if (getEndConnector() != null) { > connectEnd(getEndConnector()); > } 297,300d336 < if (fStart != null) < connectStart(fStart); < if (fEnd != null) < connectEnd(fEnd);