Java Code Examples for java.awt.font.GraphicAttribute#BOTTOM_ALIGNMENT
The following examples show how to use
java.awt.font.GraphicAttribute#BOTTOM_ALIGNMENT .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OracleText.java From magarena with GNU General Public License v3.0 | 6 votes |
public static AttributedString textIconReplace(final String text) { final String compacted = text.replaceAll("\\{[^}]+}", "M"); final AttributedString attrString = new AttributedString(compacted); for (int i = 0, j = 0; i < text.length(); i++, j++) { char c = text.charAt(i); if (c == '{') { final int endSymbol = text.indexOf('}', i); // get mana-string, substring returns at -1 value String iconString = text.substring(i, endSymbol + 1); // get related Icon as Image Image iconImage = MagicImages.getIcon(iconString).getImage(); // define replacement icon ImageGraphicAttribute icon = new ImageGraphicAttribute(iconImage, GraphicAttribute.BOTTOM_ALIGNMENT); // replace M with icon attrString.addAttribute( TextAttribute.CHAR_REPLACEMENT, icon, j, j + 1 ); // advance i to the end of symbol i = endSymbol; } } return attrString; }
Example 2
Source File: CoreMetrics.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 3
Source File: CoreMetrics.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 4
Source File: CoreMetrics.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 5
Source File: CoreMetrics.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 6
Source File: CoreMetrics.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 7
Source File: CoreMetrics.java From Bytecoder with Apache License 2.0 | 5 votes |
public float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 8
Source File: CoreMetrics.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 9
Source File: CoreMetrics.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 10
Source File: CoreMetrics.java From hottub with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 11
Source File: CoreMetrics.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 12
Source File: CoreMetrics.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 13
Source File: CoreMetrics.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 14
Source File: CoreMetrics.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 15
Source File: CoreMetrics.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
public final float effectiveBaselineOffset(float[] fullOffsets) { switch (baselineIndex) { case GraphicAttribute.TOP_ALIGNMENT: return fullOffsets[4] + ascent; case GraphicAttribute.BOTTOM_ALIGNMENT: return fullOffsets[3] - descent; default: return fullOffsets[baselineIndex]; } }
Example 16
Source File: RichTextSpecProducer.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
private Map<Attribute, Object> computeImageStyle( final StyleSheet layoutContext, final RenderableReplacedContentBox content ) { final Image image = imageProducer.createImagePlaceholder( content ); ImageGraphicAttribute iga = new ImageGraphicAttribute( image, GraphicAttribute.BOTTOM_ALIGNMENT ); Map<Attribute, Object> attrs = computeStyle( layoutContext ); attrs.put( TextAttribute.CHAR_REPLACEMENT, iga ); return attrs; }