37a38,42 > * the registered listeners for selection changes > */ > private transient Vector fSelectionListeners; > > /** 106a112,113 > fSelectionListeners = new Vector(); > addFigureSelectionListener(editor()); 132c139 < return fEditor.tool(); --- > return editor().tool(); 214a222,229 > * Sets the current display update strategy. > * @see Painter > */ > public Painter getDisplayUpdate() { > return fUpdateStrategy; > } > > /** 265c280 < selectionChanged(); --- > fireSelectionChanged(); 286c301 < selectionChanged(); --- > fireSelectionChanged(); 299c314 < selectionChanged(); --- > fireSelectionChanged(); 314c329 < selectionChanged(); --- > fireSelectionChanged(); 339c354 < return new FigureSelection(selectionZOrdered()); --- > return new StandardFigureSelection(selectionZOrdered()); 363,364c378,384 < protected void selectionChanged() { < fEditor.selectionChanged(this); --- > protected void fireSelectionChanged() { > if (fSelectionListeners != null) { > for (int i = 0; i < fSelectionListeners.size(); i++) { > FigureSelectionListener l = (FigureSelectionListener)fSelectionListeners.elementAt(i); > l.figureSelectionChanged(this); > } > } 498d517 < 539,545d557 < * Updates the drawing view. < */ < public void update(Graphics g) { < paint(g); < } < < /** 550,551c562,563 < public void paint(Graphics g) { < fUpdateStrategy.draw(g, this); --- > protected void paintComponent(Graphics g) { > getDisplayUpdate().draw(g, this); 681a694 > fSelectionListeners= new Vector(); 708a722,737 > > /** > * Add a listener for selection changes. > * @param fsl jhotdraw.framework.FigureSelectionListener > */ > public void addFigureSelectionListener(FigureSelectionListener fsl) { > fSelectionListeners.add(fsl); > } > > /** > * Remove a listener for selection changes. > * @param fsl jhotdraw.framework.FigureSelectionListener > */ > public void removeFigureSelectionListener(FigureSelectionListener fsl) { > fSelectionListeners.remove(fsl); > }