public void setUnitSymbolSize(int size) { synchronized(_UnitFontMutex) { _UnitFont = SinglePointFont.getInstance().getUnitFont(size); } }
public void setSinglePointTGSymbolSize(int size) { synchronized(_SinglePointFontMutex) { _SinglePointFont = SinglePointFont.getInstance().getSPFont(size); } }
public void setSinglePointTGSymbolSize(int size) { synchronized(_SinglePointFontMutex) { _SinglePointFont = SinglePointFont.getInstance().getSPFont(size); } }
public void setUnitSymbolSize(int size) { synchronized(_UnitFontMutex) { _UnitFont = SinglePointFont.getInstance().getUnitFont(size); } }
private TacticalGraphicIconRenderer() { try { //font size of 60 produces a 40x40 pixel image. float fontSizeForTGIcons = 60; _RendererSettings = RendererSettings.getInstance(); _TacticalGraphicFont = SinglePointFont.getInstance().getTGFont(fontSizeForTGIcons); _className = this.getClass().getName(); if(_TacticalGraphicFont == null) { ErrorLogger.LogException(this.getClass().getName() ,"SinglePointRenderer()", new RendererException("TacticalGraphicIconRenderer failed to initialize - _TacticalGraphicFont didn't load.", null)); } //trying to use just 1 image all the time //and one FontRenderContext if(_buffer == null) { _buffer = new BufferedImage(8,8,BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = (Graphics2D)_buffer.createGraphics(); _fontRenderContext = g2d.getFontRenderContext(); } } catch(Exception exc) { ErrorLogger.LogException(_className, "TacticalGraphicIconRenderer", exc); } }
private TacticalGraphicIconRenderer() { try { //font size of 60 produces a 40x40 pixel image. float fontSizeForTGIcons = 60; _RendererSettings = RendererSettings.getInstance(); _TacticalGraphicFont = SinglePointFont.getInstance().getTGFont(fontSizeForTGIcons); _className = this.getClass().getName(); if(_TacticalGraphicFont == null) { ErrorLogger.LogException(this.getClass().getName() ,"SinglePointRenderer()", new RendererException("TacticalGraphicIconRenderer failed to initialize - _TacticalGraphicFont didn't load.", null)); } //trying to use just 1 image all the time //and one FontRenderContext if(_buffer == null) { _buffer = new BufferedImage(8,8,BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = (Graphics2D)_buffer.createGraphics(); _fontRenderContext = g2d.getFontRenderContext(); } } catch(Exception exc) { ErrorLogger.LogException(_className, "TacticalGraphicIconRenderer", exc); } }
_SinglePointFont = SinglePointFont.getInstance().getSPFont(SymbolSizeSmall); _UnitFont = SinglePointFont.getInstance().getUnitFont(UnitSizeMedium); _ModifierFont = RendererSettings.getInstance().getLabelFont();
_SinglePointFont = SinglePointFont.getInstance().getSPFont(SymbolSizeSmall); _UnitFont = SinglePointFont.getInstance().getUnitFont(UnitSizeMedium); _ModifierFont = RendererSettings.getInstance().getLabelFont();
/** * Try to make sure everything is loaded during server creation so later * calls to the renderer don't crap out due to the font files not being * loaded. Sometimes the 'X's appear because of font loading errors. * This is an attempt to fix that. * * @author Spinelli */ private void preloadRenderer() { try { if (_preloadedRenderer == false) { MilStdSymbol foo = null; foo = new MilStdSymbol("SFGPUCDM-------", "", null, null); UnitFontLookup.getInstance(); SinglePointLookup.getInstance(); SymbolDefTable.getInstance(); UnitDefTable.getInstance(); foo = null; SinglePointFont.getInstance().getSPFont(50); SinglePointFont.getInstance().getUnitFont(50); _preloadedRenderer = true; // System.out.println("preloaded"); } } catch (Exception exc) { // System.err.println(exc.getMessage()); // System.err.println(ErrorLogger.getStackTrace(exc)); ErrorLogger.LogException("SinglePointServer", "preloadRenderer", exc, Level.WARNING); } }
/** * Try to make sure everything is loaded during server creation so later * calls to the renderer don't crap out due to the font files not being * loaded. Sometimes the 'X's appear because of font loading errors. * This is an attempt to fix that. * * @author Spinelli */ private void preloadRenderer() { try { if (_preloadedRenderer == false) { MilStdSymbol foo = null; foo = new MilStdSymbol("SFGPUCDM-------", "", null, null); UnitFontLookup.getInstance(); SinglePointLookup.getInstance(); SymbolDefTable.getInstance(); UnitDefTable.getInstance(); foo = null; SinglePointFont.getInstance().getSPFont(50); SinglePointFont.getInstance().getUnitFont(50); _preloadedRenderer = true; // System.out.println("preloaded"); } } catch (Exception exc) { // System.err.println(exc.getMessage()); // System.err.println(ErrorLogger.getStackTrace(exc)); ErrorLogger.LogException("SinglePointServer", "preloadRenderer", exc, Level.WARNING); } }