2c2 < * @(#)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 > * 18a26,27 > * > * @version <$CURRENT_VERSION$> 22,23c31,32 < protected Connector fStart = null; < protected Connector fEnd = null; --- > protected Connector myStartConnector; > protected Connector myEndConnector; 55c64 < for (int i = 1; i < fPoints.size()-1; i++) --- > for (int i = 1; i < fPoints.size()-1; i++) { 56a66 > } 64,65c74,75 < public void connectStart(Connector start) { < fStart = start; --- > public void connectStart(Connector newStartConnector) { > setStartConnector(newStartConnector); 72,73c82,83 < public void connectEnd(Connector end) { < fEnd = end; --- > public void connectEnd(Connector newEndConnector) { > setEndConnector(newEndConnector); 83c93 < fStart = null; --- > setStartConnector(null); 92c102 < fEnd = null; --- > setEndConnector(null); 100c110,111 < return other.start() == start() && other.end() == end(); --- > return other.getStartConnector() == getStartConnector() > && other.getEndConnector() == getEndConnector(); 119,120c130,132 < if (start() != null) < return start().owner(); --- > if (getStartConnector() != null) { > return getStartConnector().owner(); > } 128,129c140,142 < if (end() != null) < return end().owner(); --- > if (getEndConnector() != null) { > return getEndConnector().owner(); > } 132a146,149 > protected void setStartConnector(Connector newStartConnector) { > myStartConnector = newStartConnector; > } > 136,137c153,158 < public Connector start() { < return fStart; --- > public Connector getStartConnector() { > return myStartConnector; > } > > protected void setEndConnector(Connector newEndConnector) { > myEndConnector = newEndConnector; 143,144c164,165 < public Connector end() { < return fEnd; --- > public Connector getEndConnector() { > return myEndConnector; 159c180 < if (fPoints.size() == 0) --- > if (fPoints.size() == 0) { 161c182,183 < else --- > } > else { 162a185 > } 171c194 < if (fPoints.size() < 2) --- > if (fPoints.size() < 2) { 173c196,197 < else --- > } > else { 174a199 > } 202c227 < for (int i = 1; i < fPoints.size()-1; i++) --- > for (int i = 1; i < fPoints.size()-1; i++) { 203a229 > } 236,237c262,265 < if (fStart != null) { < Point start = fStart.findStart(this); --- > if (getStartConnector() != null) { > Point start = getStartConnector().findStart(this); > > if(start != null) { 240,241c268,272 < if (fEnd != null) { < Point end = fEnd.findEnd(this); --- > } > if (getEndConnector() != null) { > Point end = getEndConnector().findEnd(this); > > if(end != null) { 244a276 > } 259c291 < if (listener() != null) --- > if (listener() != null) { 261a294 > } 270,271c303,308 < if (fStart != null) startFigure().removeFigureChangeListener(this); < if (fEnd != null) endFigure().removeFigureChangeListener(this); --- > if (getStartConnector() != null) { > startFigure().removeFigureChangeListener(this); > } > if (getEndConnector() != null) { > endFigure().removeFigureChangeListener(this); > } 276,277c313,314 < dw.writeStorable(fStart); < dw.writeStorable(fEnd); --- > dw.writeStorable(getStartConnector()); > dw.writeStorable(getEndConnector()); 283c320 < if (start != null) --- > if (start != null) { 284a322 > } 286c324 < if (end != null) --- > if (end != null) { 288c326,327 < if (start != null && end != null) --- > } > if (start != null && end != null) { 290a330 > } 297,300c337,342 < if (fStart != null) < connectStart(fStart); < if (fEnd != null) < connectEnd(fEnd); --- > if (getStartConnector() != null) { > connectStart(getStartConnector()); > } > if (getEndConnector() != null) { > connectEnd(getEndConnector()); > }