• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Messages类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.harmony.awt.internal.nls.Messages的典型用法代码示例。如果您正苦于以下问题:Java Messages类的具体用法?Java Messages怎么用?Java Messages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Messages类属于org.apache.harmony.awt.internal.nls包,在下文中一共展示了Messages类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ColorModel

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
/**
 * Instantiates a new color model with the specified pixel bit depth. The
 * transferType is chosen based on the pixel bits, and the other data fields
 * are given default values.
 * 
 * @param bits
 *            the array of component masks.
 */
public ColorModel(int bits) {

    if (bits < 1) {
        // awt.271=The number of bits in bits is less than 1
        throw new IllegalArgumentException(Messages.getString("awt.271")); //$NON-NLS-1$
    }

    pixel_bits = bits;
    transferType = getTransferType(bits);
    cs = ColorSpace.getInstance(ColorSpace.CS_sRGB);
    hasAlpha = true;
    isAlphaPremultiplied = false;
    transparency = Transparency.TRANSLUCENT;

    numColorComponents = 3;
    numComponents = 4;

    this.bits = null;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:28,代码来源:ColorModel.java


示例2: getPixel

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
/**
 * Gets the samples of the specified pixel as a double array.
 * 
 * @param x
 *            the X coordinate of pixel.
 * @param y
 *            the Y coordinate of pixel.
 * @param dArray
 *            the double array where result will be stored.
 * @param data
 *            the image data.
 * @return the double array with the samples of the specified pixel.
 */
public double[] getPixel(int x, int y, double dArray[], DataBuffer data) {
    if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
        // awt.63=Coordinates are not in bounds
        throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
    }
    double pixel[];

    if (dArray == null) {
        pixel = new double[numBands];
    } else {
        pixel = dArray;
    }

    for (int i = 0; i < numBands; i++) {
        pixel[i] = getSampleDouble(x, y, i, data);
    }

    return pixel;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:33,代码来源:SampleModel.java


示例3: setPixels

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
@Override
public void setPixels(int x, int y, int w, int h, int iArray[],
        DataBuffer data) {
    if ((x < 0) || (y < 0) || ((long) x + (long) w > this.width)
            || ((long) y + (long) h > this.height)) {
        // awt.63=Coordinates are not in bounds
        throw new ArrayIndexOutOfBoundsException(Messages
                .getString("awt.63")); //$NON-NLS-1$
    }

    int idx = 0;

    for (int i = y; i < y + h; i++) {
        for (int j = x; j < x + w; j++) {
            for (int n = 0; n < this.numBands; n++) {
                setSample(j, i, n, iArray[idx++], data);
            }
        }
    }
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:21,代码来源:SinglePixelPackedSampleModel.java


示例4: TextLayout

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public TextLayout(String string, Font font, FontRenderContext frc) {
    if (string == null){
        // awt.01='{0}' parameter is null
        throw new IllegalArgumentException(Messages.getString("awt.01", "string")); //$NON-NLS-1$ //$NON-NLS-2$
    }
    
    if (font == null){
        // awt.01='{0}' parameter is null
        throw new IllegalArgumentException(Messages.getString("awt.01", "font")); //$NON-NLS-1$ //$NON-NLS-2$
    }

    if (string.length() == 0){
        // awt.02='{0}' parameter has zero length
        throw new IllegalArgumentException(Messages.getString("awt.02", "string")); //$NON-NLS-1$ //$NON-NLS-2$
    }

    AttributedString as = new AttributedString(string);
    as.addAttribute(TextAttribute.FONT, font);
    this.breaker = new TextRunBreaker(as.getIterator(), frc);
    caretManager = new CaretManager(breaker);
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:22,代码来源:TextLayout.java


示例5: getGlyphPosition

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
/**
 * Returns the position of the specified glyph relative to the origin of
 * this GlyphVector
 * @return a Point2D that the origin of the glyph with specified index
 */
@Override
public Point2D getGlyphPosition(int glyphIndex) {
    if ((glyphIndex > vector.length) || (glyphIndex < 0)) {
        // awt.43=glyphIndex is out of vector's limits
        throw new IndexOutOfBoundsException(Messages.getString("awt.43")); //$NON-NLS-1$
    }
    int index = glyphIndex << 1;
    Point2D pos = new Point2D.Float(visualPositions[index], visualPositions[index+1]);

    // For last position we don't have to transform !!
    if(glyphIndex==vector.length){
        return pos;
    }

    AffineTransform at = getGlyphTransform(glyphIndex);
    if ((at == null) || (at.isIdentity())){
        return pos;
    }

    pos.setLocation(pos.getX() + at.getTranslateX(), pos.getY() + at.getTranslateY());

    return pos;
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:29,代码来源:CommonGlyphVector.java


示例6: currentSegment

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public int currentSegment(double[] coords) {
    if (isDone()) {
        // awt.4B=Iterator out of bounds
        throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$
    }
    if (index == points.length) {
        return SEG_CLOSE;
    }
    int j = 0;
    double p[] = points[index];
    for (int i = 0; i < p.length; i += 4) {
        coords[j++] = x + p[i + 0] * width + p[i + 1] * aw;
        coords[j++] = y + p[i + 2] * height + p[i + 3] * ah;
    }
    if (t != null) {
        t.transform(coords, 0, coords, 0, j / 2);
    }
    return types[index];
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:20,代码来源:RoundRectangle2D.java


示例7: getPixel

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public double[] getPixel(int x, int y, double dArray[], DataBuffer data) {
    if (x < 0 || y < 0 || x >= this.width || y >= this.height) {
        // awt.63=Coordinates are not in bounds
        throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
    }
    double pixel[];

    if (dArray == null) {
        pixel = new double[numBands];
    } else {
        pixel = dArray;
    }

    for (int i = 0; i < numBands; i++) {
        pixel[i] = getSampleDouble(x, y, i, data);
    }

    return pixel;
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:20,代码来源:SampleModel.java


示例8: setPrintQuality

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public void setPrintQuality(int iprintQuality) {
    if (iprintQuality == 3) {
        setPrintQuality(PrintQualityType.DRAFT);
        return;
    }
    if (iprintQuality == 4) {
        setPrintQuality(PrintQualityType.NORMAL);
        return;
    }
    if (iprintQuality == 5) {
        setPrintQuality(PrintQualityType.HIGH);
        return;
    }
    // awt.11A=Invalid value for printQuality
    throw new IllegalArgumentException(Messages.getString("awt.11A")); //$NON-NLS-1$
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:17,代码来源:PageAttributes.java


示例9: currentSegment

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public int currentSegment(double[] coords) {
    if (isDone()) {
        // awt.4B=Iterator out of bounds
        throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$
    }
    evaluate();
    int type = bufType;
    if (type != SEG_CLOSE) {
        coords[0] = px;
        coords[1] = py;
        if (type != SEG_MOVETO) {
            type = SEG_LINETO;
        }
    }
    return type;
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:17,代码来源:FlatteningPathIterator.java


示例10: getPixels

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public double[] getPixels(int x, int y, int w, int h, double dArray[],
        DataBuffer data) {
    if (x < 0 || y < 0 || x + w > this.width || y + h > this.height) {
        // awt.63=Coordinates are not in bounds
        throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
    }
    double pixels[];
    int idx = 0;

    if (dArray == null) {
        pixels = new double[w * h * numBands];
    } else {
        pixels = dArray;
    }

    for (int i = y; i < y + h; i++) {
        for (int j = x; j < x + w; j++) {
            for (int n = 0; n < numBands; n++) {
                pixels[idx++] = getSampleDouble(j, i, n, data);
            }
        }
    }
    return pixels;
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:25,代码来源:SampleModel.java


示例11: currentSegment

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public int currentSegment(float[] coords) {
    if (isDone()) {
        // awt.4B=Iterator out of bounds
        throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$
    }
    int type;
    int count;
    if (index == 0) {
        type = SEG_MOVETO;
        coords[0] = (float)c.getX1();
        coords[1] = (float)c.getY1();
        count = 1;
    } else {
        type = SEG_QUADTO;
        coords[0] = (float)c.getCtrlX();
        coords[1] = (float)c.getCtrlY();
        coords[2] = (float)c.getX2();
        coords[3] = (float)c.getY2();
        count = 2;
    }
    if (t != null) {
        t.transform(coords, 0, coords, 0, count);
    }
    return type;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:26,代码来源:QuadCurve2D.java


示例12: currentSegment

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public int currentSegment(float[] coords) {
    if (isDone()) {
        // awt.4B=Iterator out of bounds
        throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$
    }
    int type;
    if (index == 0) {
        type = SEG_MOVETO;
        coords[0] = (float)x1;
        coords[1] = (float)y1;
    } else {
        type = SEG_LINETO;
        coords[0] = (float)x2;
        coords[1] = (float)y2;
    }
    if (t != null) {
        t.transform(coords, 0, coords, 0, 1);
    }
    return type;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:21,代码来源:Line2D.java


示例13: currentSegment

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public int currentSegment(double[] coords) {
    if (isDone()) {
        // awt.4B=Iterator out of bounds
        throw new NoSuchElementException(Messages.getString("awt.4B")); //$NON-NLS-1$
    }
    int type;
    if (index == 0) {
        type = SEG_MOVETO;
        coords[0] = x1;
        coords[1] = y1;
    } else {
        type = SEG_LINETO;
        coords[0] = x2;
        coords[1] = y2;
    }
    if (t != null) {
        t.transform(coords, 0, coords, 0, 1);
    }
    return type;
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:21,代码来源:Line2D.java


示例14: getComponents

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
@Override
public int[] getComponents(Object pixel, int components[], int offset) {
    int pixIdx = -1;
    if (pixel instanceof byte[]) {
        byte ba[] = (byte[]) pixel;
        pixIdx = ba[0] & 0xff;
    } else if (pixel instanceof short[]) {
        short sa[] = (short[]) pixel;
        pixIdx = sa[0] & 0xffff;
    } else if (pixel instanceof int[]) {
        int ia[] = (int[]) pixel;
        pixIdx = ia[0];
    } else {
        // awt.219=This transferType is not supported by this color model
        throw new UnsupportedOperationException(Messages.getString("awt.219")); //$NON-NLS-1$
    }

    return getComponents(pixIdx, components, offset);
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:20,代码来源:IndexColorModel.java


示例15: setPixels

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
@Override
public void setPixels(int x, int y, int w, int h, int iArray[], DataBuffer data) {
    if ((x < 0) || (y < 0) || ((long)x + (long)w > this.width)
            || ((long)y + (long)h > this.height)) {
        // awt.63=Coordinates are not in bounds
        throw new ArrayIndexOutOfBoundsException(Messages.getString("awt.63")); //$NON-NLS-1$
    }

    int idx = 0;

    for (int i = y; i < y + h; i++) {
        for (int j = x; j < x + w; j++) {
            for (int n = 0; n < this.numBands; n++) {
                setSample(j, i, n, iArray[idx++], data);
            }
        }
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:19,代码来源:SinglePixelPackedSampleModel.java


示例16: setGlyphPosition

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
/**
 * Sets new position to the specified glyph.
 */
@Override
public void setGlyphPosition(int glyphIndex, Point2D newPos) {
    if ((glyphIndex > vector.length) || (glyphIndex < 0)) {
        // awt.43=glyphIndex is out of vector's limits
        throw new IndexOutOfBoundsException(Messages.getString("awt.43")); //$NON-NLS-1$
    }
    float x = (float)newPos.getX();
    float y = (float)newPos.getY();
    int index = glyphIndex << 1;

    if ((x != visualPositions[index]) || (y != visualPositions[index + 1])){
        visualPositions[index] = x;
        visualPositions[index+1] = y;
        layoutFlags = layoutFlags | FLAG_HAS_POSITION_ADJUSTMENTS;
    }

}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:21,代码来源:CommonGlyphVector.java


示例17: ICC_ColorSpace

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public ICC_ColorSpace(ICC_Profile pf) {
    super(pf.getColorSpaceType(), pf.getNumComponents());

    int pfClass = pf.getProfileClass();

    switch (pfClass) {
        case ICC_Profile.CLASS_COLORSPACECONVERSION:
        case ICC_Profile.CLASS_DISPLAY:
        case ICC_Profile.CLASS_OUTPUT:
        case ICC_Profile.CLASS_INPUT:
            break; // OK, it is color conversion profile
        default:
            // awt.168=Invalid profile class.
            throw new IllegalArgumentException(Messages.getString("awt.168")); //$NON-NLS-1$
    }

    profile = pf;
    fillMinMaxValues();
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:20,代码来源:ICC_ColorSpace.java


示例18: getRGB

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
@Override
public int getRGB(Object inData) {
    int pixel = 0;
    switch (transferType) {
    case DataBuffer.TYPE_BYTE:
        byte ba[] = (byte[]) inData;
        pixel = ba[0] & 0xff;
        break;

    case DataBuffer.TYPE_USHORT:
        short sa[] = (short[]) inData;
        pixel = sa[0] & 0xffff;
        break;

    case DataBuffer.TYPE_INT:
        int ia[] = (int[]) inData;
        pixel = ia[0];
        break;

    default:
        // awt.214=This Color Model doesn't support this transferType
        throw new UnsupportedOperationException(Messages.getString("awt.214")); //$NON-NLS-1$
    }
    return getRGB(pixel);
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:26,代码来源:DirectColorModel.java


示例19: getProfileClass

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public int getProfileClass() {
    int deviceClassSignature = getIntFromHeader(icHdrDeviceClass);

    switch (deviceClassSignature) {
        case icSigColorSpaceClass:
            return CLASS_COLORSPACECONVERSION;
        case icSigDisplayClass:
            return CLASS_DISPLAY;
        case icSigOutputClass:
            return CLASS_OUTPUT;
        case icSigInputClass:
            return CLASS_INPUT;
        case icSigLinkClass:
            return CLASS_DEVICELINK;
        case icSigAbstractClass:
            return CLASS_ABSTRACT;
        case icSigNamedColorClass:
            return CLASS_NAMEDCOLOR;
        default:
    }

    // Not an ICC profile class
    // awt.15F=Profile class does not comply with ICC specification
    throw new IllegalArgumentException(Messages.getString("awt.15F")); //$NON-NLS-1$
    
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:27,代码来源:ICC_Profile.java


示例20: charsWidth

import org.apache.harmony.awt.internal.nls.Messages; //导入依赖的package包/类
public int charsWidth(char[] data, int off , int len){
    int width = 0;
    if ((off >= data.length) || (off < 0)){
        // awt.13B=offset off is out of range
        throw new IllegalArgumentException(Messages.getString("awt.13B")); //$NON-NLS-1$
    }

    if ((off+len > data.length)){
        // awt.13C=number of elements len is out of range
        throw new IllegalArgumentException(Messages.getString("awt.13C")); //$NON-NLS-1$
    }

    for (int i = off; i < off+len; i++){
        width += charWidth(data[i]);
    }

    return width;
}
 
开发者ID:windwardadmin,项目名称:android-awt,代码行数:19,代码来源:FontMetrics.java



注:本文中的org.apache.harmony.awt.internal.nls.Messages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Node类代码示例发布时间:2022-05-23
下一篇:
Java GenericRefreshResponseCollectionProto类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap