public TableModel get( final DataCacheKey key ) { return dataCache.get( key ); }
public synchronized FontMetrics getFontMetrics( final FontKey fontKey ) { return map.get( fontKey ); }
public short getNearestColor( final Color awtColor ) { Short value = colorCache.get( awtColor.getRGB() ); if ( value != null ) { return value; } short nearestColor = base.getNearestColor( awtColor ); colorCache.put( awtColor.getRGB(), nearestColor ); return nearestColor; } }
public Result get( final InstanceID instanceID, final long styleChangeTracker, final long attributeChangeTracker, final String originalText ) { final InternalResult o = cache.get( instanceID ); if ( o == null ) { return null; } if ( o.isValid( styleChangeTracker, attributeChangeTracker, originalText ) == false ) { cache.remove( instanceID ); return null; } return o; }
public String printCornerAsCSS( final BorderCorner edge ) { final String cached = cachedCornerStyle.get( edge ); if ( cached != null ) { return cached; } final String value = ( pointConverter.format( StrictGeomUtility.toExternalValue( edge.getWidth() ) ) + "pt " + pointConverter .format( StrictGeomUtility.toExternalValue( edge.getHeight() ) ) + "pt " ); cachedCornerStyle.put( edge, value ); return value; }
public ImmutableDataAttributes normalize( final DataAttributes attrs, final DataAttributeContext context ) { ImmutableDataAttributes key = ImmutableDataAttributes.create( attrs, context ); CacheKey cacheKey = new CacheKey( context, key ); synchronized ( this ) { ImmutableDataAttributes fromCache = backend.get( cacheKey ); if ( fromCache == null ) { backend.put( cacheKey, key ); return key; } return fromCache; } } }
public String printCornerAsCSS( final BorderCorner edge ) { final String cached = cachedCornerStyle.get( edge ); if ( cached != null ) { return cached; } final String value = ( pointConverter.format( factory.fixLengthForSafari( StrictGeomUtility.toExternalValue( edge.getWidth() ) ) ) + "pt " + pointConverter .format( factory.fixLengthForSafari( StrictGeomUtility.toExternalValue( edge.getHeight() ) ) ) + "pt " ); cachedCornerStyle.put( edge, value ); return value; }
public BoxDefinition getBoxDefinition( final StyleSheet es ) { final InstanceID id = es.getId(); cacheKey.reuse( id, es.getClass().getName() ); final CacheCarrier cc = cache.get( cacheKey ); if ( cc == null ) { final BoxDefinition boxDefinition = createBoxDefinition( es ); cache.put( new CacheKey( id, es.getClass().getName() ), new CacheCarrier( es.getChangeTracker(), boxDefinition ) ); return boxDefinition; } if ( cc.getChangeTracker() != es.getChangeTracker() ) { final BoxDefinition boxDefinition = createBoxDefinition( es ); cc.update( es.getChangeTracker(), boxDefinition ); return boxDefinition; } return cc.getBoxDefinition(); }
public String printEdgeAsCSS( final BorderEdge edge ) { final BorderStyle borderStyle = edge.getBorderStyle(); final long width = edge.getWidth(); if ( BorderStyle.NONE.equals( borderStyle ) || width <= 0 ) { return "none"; } final String cached = cachedBorderStyle.get( edge ); if ( cached != null ) { return cached; } final String value = pointConverter.format( StrictGeomUtility.toExternalValue( width ) ) + "pt " + borderStyle.toString() + ' ' + HtmlColors.getColorString( edge.getColor() ); cachedBorderStyle.put( edge, value ); return value; }
final ResourceManager resourceManager = getResourceManager(); final com.lowagie.text.Image instance; final com.lowagie.text.Image maybeImage = imageCache.get( resource ); if ( maybeImage != null ) { instance = maybeImage;
public CellStyle createCellStyle( final InstanceID id, final StyleSheet element, final CellBackground bg ) { if ( id == null ) { CellStyle cellStyle = backgroundCache.get( bg ); if ( cellStyle != null ) { return cellStyle; } } else { CellStyle cellStyle = contentCache.get( new CacheKey( id, bg, element.getId(), (TextRotation) element.getStyleProperty( TextStyleKeys.TEXT_ROTATION, null ) ) ); if ( cellStyle != null ) { return cellStyle; } } CellStyle cellStyle = backend.createCellStyle( id, element, bg ); if ( cellStyle == null ) { return null; } if ( id == null ) { backgroundCache.put( bg, cellStyle ); } else { contentCache.put( new CacheKey( id, bg, element.getId(), (TextRotation) element.getStyleProperty( TextStyleKeys.TEXT_ROTATION, null ) ), cellStyle ); } return cellStyle; }
final LibLoaderResourceBundle bundle = successfulLoads.get( propsName ); if ( bundle != null ) { return bundle;
public String printEdgeAsCSS( final BorderEdge edge ) { final BorderStyle borderStyle = edge.getBorderStyle(); final long width = edge.getWidth(); if ( BorderStyle.NONE.equals( borderStyle ) || width <= 0 ) { return "none"; } final String cached = cachedBorderStyle.get( edge ); if ( cached != null ) { return cached; } final String value = pointConverter.format( factory.fixLengthForSafari( StrictGeomUtility.toExternalValue( width ) ) ) + "pt " + mapStyleToHtmlAllowed( borderStyle.toString() ) + ' ' + HtmlColors.getColorString( edge.getColor() ); cachedBorderStyle.put( edge, value ); return value; }
public String getNormalizedFontFamilyName( final String name ) { if ( name != null ) { final Object fromCache = normalizedFontNameCache.get( name ); if ( fromCache != null ) { return (String) fromCache; } } String mappedName = super.getNormalizedFontFamilyName( name ); if ( FontMappingUtility.isSerif( mappedName ) ) { mappedName = "Times"; } else if ( FontMappingUtility.isSansSerif( mappedName ) ) { mappedName = "Helvetica"; } else if ( FontMappingUtility.isCourier( mappedName ) ) { mappedName = "Courier"; } else if ( FontMappingUtility.isSymbol( mappedName ) ) { mappedName = "Symbol"; } if ( name != null ) { normalizedFontNameCache.put( name, mappedName ); } return mappedName; }
final StyleCacheEntry o = fontMetricsByStyleCache.get( lookupCacheKey ); if ( o != null ) { if ( o.getChangeTracker() == styleSheet.getChangeTracker() ) {
public SimpleStyleSheet getStyleSheet( final StyleSheet parent ) { final InstanceID id = parent.getId(); final String styleClass = parent.getClass().getName(); lookupKey.setStyleClass( styleClass ); lookupKey.setInstanceId( id ); final CacheCarrier cc = cache.get( lookupKey ); if ( cc == null ) { final CacheKey key = new CacheKey( id, styleClass ); final SimpleStyleSheet styleSheet = new SimpleStyleSheet( parent ); cache.put( key, new CacheCarrier( parent.getChangeTracker(), styleSheet ) ); cacheMiss += 1; return styleSheet; } if ( cc.getChangeTracker() != parent.getChangeTracker() ) { final CacheKey key = new CacheKey( id, styleClass ); final SimpleStyleSheet styleSheet = new SimpleStyleSheet( parent ); cache.put( key, new CacheCarrier( parent.getChangeTracker(), styleSheet ) ); cacheMiss += 1; return styleSheet; } validateCacheResult( parent, cc.getStyleSheet() ); cacheHits += 1; return cc.getStyleSheet(); }
final Object o = context.failureCache.get( value ); if ( Boolean.TRUE.equals( o ) ) { return null;
lookupKey.setItalics( italics ); final ExtendedBaselineInfo cached = baselinesCache.get( lookupKey ); if ( cached != null ) { return cached;