当前位置: 首页>>代码示例>>Java>>正文


Java Messages类代码示例

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


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


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