Optional interface which indicates that glyph positioning is supported and, if supported, can perform positioning.
This work was originally authored by Glenn Adams (gadams@apache.org).
175176177178179180181182183184185186
item.calcPreferredSize(); float itemWidth = item.width; float itemHeight = item.height; if (item instanceof Positionable) { Positionable pos = (Positionable) item; pos.setPosition(x + xOffset, y + yOffset); } if (orientation == HORIZONTAL) xOffset += itemWidth; else
424425426427428429430431432433434
} /** {@inheritDoc} */ public boolean performsPositioning() { if ( metric instanceof Positionable ) { Positionable p = (Positionable) metric; return p.performsPositioning(); } else { return false; } }
434435436437438439440441442443444
} /** {@inheritDoc} */ public int[][] performPositioning ( CharSequence cs, String script, String language, int fontSize ) { if ( metric instanceof Positionable ) { Positionable p = (Positionable) metric; return p.performPositioning ( cs, script, language, fontSize ); } else { throw new UnsupportedOperationException(); } }