DefaultFigureSelection extends DefaultFigureCollection implements FigureSelection { @Override public boolean isSelected() { return false; } DefaultFigureSelection(); @Override E getExtension(Class<E> extensionType); @Override int getSelectionStage(); @Override void setSelectionStage(int selectionStage); @Override Handle[] getHandles(); @Override Handle getSelectedHandle(); @Override void setSelectedHandle(Handle handle); @Override boolean isSelectable(); @Override boolean isSelected(); @Override void setSelected(boolean selected); @Override String getPresentationName(); @Override Object getSelectedValue(); @Override Object[] getSelectedValues(); @Override boolean isEmpty(); @Override Transferable createTransferable(boolean copy); @Override void lostOwnership(Clipboard clipboard, Transferable contents); @Override FigureSelection clone(); @Override String toString(); @Override Figure[] removeAllFigures(); @Override void draw(Rendering rendering);  }
@Test public void testPropagateSelectionState() { Figure figure = new DefaultShapeFigure(new Rectangle(0, 0, 10, 10), Figure.Rank.AREA, new DefaultFigureStyle()); FigureSelection figureSelection = new DefaultFigureSelection(); assertEquals(false, figureSelection.isSelected()); assertEquals(false, figure.isSelected()); figureSelection.addFigure(figure); assertEquals(false, figureSelection.isSelected()); assertEquals(true, figure.isSelected()); figureSelection.removeFigure(figure); assertEquals(false, figureSelection.isSelected()); assertEquals(false, figure.isSelected()); }