@Test public void derive_DiscardingId() { List<StyleKey> keys = StyleKey.getDefinedStyleKeysList(); ElementStyleSheet sheet = new ElementStyleSheet(); setEverySecondKey( sheet, keys ); ElementStyleSheet clone = sheet.derive( false ); assertNotSame( sheet.getId(), clone.getId() ); assertEverySecondKey( clone, keys ); }
public ElementStyleSheet derive( final boolean preserveId ) { final ElementStyleSheet sc = (ElementStyleSheet) super.derive( preserveId ); if ( properties != null ) { sc.properties = properties.clone(); } if ( source != null ) { sc.source = source.clone(); } sc.styleChangeSupport = new StyleChangeSupport( sc ); sc.pruneCachedEntries(); return sc; }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public ElementStyleSheet derive( final boolean preserveId ) { final ElementStyleSheet sc = (ElementStyleSheet) super.derive( preserveId ); if ( properties != null ) { sc.properties = properties.clone(); } if ( source != null ) { sc.source = source.clone(); } sc.styleChangeSupport = new StyleChangeSupport( sc ); sc.pruneCachedEntries(); return sc; } }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public ElementStyleSheet derive( final boolean preserveId ) { final ElementStyleSheet sc = (ElementStyleSheet) super.derive( preserveId ); if ( properties != null ) { sc.properties = properties.clone(); } if ( source != null ) { sc.source = source.clone(); } sc.styleChangeSupport = new StyleChangeSupport( sc ); sc.pruneCachedEntries(); return sc; } ElementStyleSheet(); }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public ElementStyleSheet derive( final boolean preserveId ) { final ElementStyleSheet sc = (ElementStyleSheet) super.derive( preserveId ); if ( properties != null ) { sc.properties = properties.clone(); } if ( source != null ) { sc.source = source.clone(); } sc.styleChangeSupport = new StyleChangeSupport( sc ); sc.pruneCachedEntries(); return sc; } ElementStyleSheet(); long getChangeTracker(); boolean isLocalKey( final StyleKey key ); final Object[] toArray(); Object getStyleProperty( final StyleKey key, final Object defaultValue ); void setBooleanStyleProperty( final StyleKey key, final boolean value ); void setStyleProperty( final StyleKey key, final Object value ); ElementStyleSheet clone(); ElementStyleSheet derive( final boolean preserveId ); StyleKey[] getDefinedPropertyNamesArray(); void addListener( final StyleChangeListener l ); void removeListener( final StyleChangeListener l ); StyleKey[] getPropertyKeys(); List<StyleKey> getPropertyKeyList(); void addAll( final ElementStyleSheet sourceStyleSheet ); void addInherited( final ElementStyleSheet sourceStyleSheet ); void addInherited( final SimpleStyleSheet sourceStyleSheet ); void addDefault( final ElementStyleSheet sourceStyleSheet ); void clear(); long getModificationCount(); long getChangeTrackerHash(); void copyFrom( final ElementStyleSheet style ); }
ElementStyleSheet extends AbstractStyleSheet implements Serializable, Cloneable { public ElementStyleSheet derive( final boolean preserveId ) { final ElementStyleSheet sc = (ElementStyleSheet) super.derive( preserveId ); if ( properties != null ) { sc.properties = properties.clone(); } if ( source != null ) { sc.source = source.clone(); } sc.styleChangeSupport = new StyleChangeSupport( sc ); sc.pruneCachedEntries(); return sc; } ElementStyleSheet(); long getChangeTracker(); boolean isLocalKey( final StyleKey key ); final Object[] toArray(); Object getStyleProperty( final StyleKey key, final Object defaultValue ); void setBooleanStyleProperty( final StyleKey key, final boolean value ); void setStyleProperty( final StyleKey key, final Object value ); ElementStyleSheet clone(); ElementStyleSheet derive( final boolean preserveId ); StyleKey[] getDefinedPropertyNamesArray(); void addListener( final StyleChangeListener l ); void removeListener( final StyleChangeListener l ); StyleKey[] getPropertyKeys(); List<StyleKey> getPropertyKeyList(); void addAll( final ElementStyleSheet sourceStyleSheet ); void addInherited( final ElementStyleSheet sourceStyleSheet ); void addInherited( final SimpleStyleSheet sourceStyleSheet ); void addDefault( final ElementStyleSheet sourceStyleSheet ); void clear(); long getModificationCount(); long getChangeTrackerHash(); void copyFrom( final ElementStyleSheet style );  }