本文整理汇总了Java中org.microemu.device.InputMethod.INPUT_123属性的典型用法代码示例。如果您正苦于以下问题:Java InputMethod.INPUT_123属性的具体用法?Java InputMethod.INPUT_123怎么用?Java InputMethod.INPUT_123使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.microemu.device.InputMethod
的用法示例。
在下文中一共展示了InputMethod.INPUT_123属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChars
public char[] getChars(int inputMode)
{
char[] result = null;
switch (inputMode) {
case InputMethod.INPUT_123 :
result = (char[]) inputToChars.get("123");
break;
case InputMethod.INPUT_ABC_LOWER :
result = (char[]) inputToChars.get("abc");
break;
case InputMethod.INPUT_ABC_UPPER :
result = (char[]) inputToChars.get("ABC");
break;
}
if (result == null) {
result = (char[]) inputToChars.get("common");
}
if (result == null) {
result = new char[0];
}
return result;
}
示例2: getChars
public char[] getChars(int inputMode) {
char[] result = null;
switch (inputMode) {
case InputMethod.INPUT_123:
result = (char[]) inputToChars.get("123");
break;
case InputMethod.INPUT_ABC_LOWER:
result = (char[]) inputToChars.get("abc");
break;
case InputMethod.INPUT_ABC_UPPER:
result = (char[]) inputToChars.get("ABC");
break;
}
if (result == null) {
result = (char[]) inputToChars.get("common");
}
if (result == null) {
result = new char[0];
}
return result;
}
示例3: filterInputMode
protected char[] filterInputMode(char[] chars) {
if (chars == null) {
return new char[0];
}
int inputMode = getInputMode();
char[] result = new char[chars.length];
int i, j;
for (i = 0, j = 0; i < chars.length; i++) {
if (inputMode == InputMethod.INPUT_ABC_UPPER) {
result[j] = Character.toUpperCase(chars[i]);
j++;
} else if (inputMode == InputMethod.INPUT_ABC_LOWER) {
result[j] = Character.toLowerCase(chars[i]);
j++;
} else if (inputMode == InputMethod.INPUT_123) {
if (Character.isDigit(chars[i]) || chars[i] == '-' || chars[i] == '.') {
result[j] = chars[i];
j++;
}
}
}
if (i != j) {
char[] newresult = new char[j];
System.arraycopy(result, 0, newresult, 0, j);
result = newresult;
}
return result;
}
示例4: paintControls
public void paintControls(SwtGraphics g) {
Device device = DeviceFactory.getDevice();
g.setBackground(g.getColor(new RGB(backgroundColor.getRed(), backgroundColor.getGreen(), backgroundColor
.getBlue())));
g.fillRectangle(0, 0, displayRectangle.width, displayPaintable.y);
g.fillRectangle(0, displayPaintable.y, displayPaintable.x, displayPaintable.height);
g.fillRectangle(displayPaintable.x + displayPaintable.width, displayPaintable.y, displayRectangle.width
- displayPaintable.x - displayPaintable.width, displayPaintable.height);
g.fillRectangle(0, displayPaintable.y + displayPaintable.height, displayRectangle.width,
displayRectangle.height - displayPaintable.y - displayPaintable.height);
g.setForeground(g.getColor(new RGB(foregroundColor.getRed(), foregroundColor.getGreen(), foregroundColor
.getBlue())));
for (Enumeration s = device.getSoftButtons().elements(); s.hasMoreElements();) {
((SwtSoftButton) s.nextElement()).paint(g);
}
int inputMode = device.getInputMethod().getInputMode();
if (inputMode == InputMethod.INPUT_123) {
g.drawImage(((SwtImmutableImage) mode123Image.getImage()).getImage(), mode123Image.getRectangle().x,
mode123Image.getRectangle().y);
} else if (inputMode == InputMethod.INPUT_ABC_UPPER) {
g.drawImage(((SwtImmutableImage) modeAbcUpperImage.getImage()).getImage(),
modeAbcUpperImage.getRectangle().x, modeAbcUpperImage.getRectangle().y);
} else if (inputMode == InputMethod.INPUT_ABC_LOWER) {
g.drawImage(((SwtImmutableImage) modeAbcLowerImage.getImage()).getImage(),
modeAbcLowerImage.getRectangle().x, modeAbcLowerImage.getRectangle().y);
}
}
示例5: paintControls
public void paintControls(Graphics g) {
Device device = DeviceFactory.getDevice();
g.setColor(backgroundColor);
g.fillRect(0, 0, displayRectangle.width, displayPaintable.y);
g.fillRect(0, displayPaintable.y, displayPaintable.x, displayPaintable.height);
g.fillRect(displayPaintable.x + displayPaintable.width, displayPaintable.y, displayRectangle.width
- displayPaintable.x - displayPaintable.width, displayPaintable.height);
g.fillRect(0, displayPaintable.y + displayPaintable.height, displayRectangle.width, displayRectangle.height
- displayPaintable.y - displayPaintable.height);
g.setColor(foregroundColor);
for (Enumeration s = device.getSoftButtons().elements(); s.hasMoreElements();) {
((J2SESoftButton) s.nextElement()).paint(g);
}
int inputMode = device.getInputMethod().getInputMode();
if (inputMode == InputMethod.INPUT_123) {
g.drawImage(((J2SEImmutableImage) mode123Image.getImage()).getImage(), mode123Image.getRectangle().x,
mode123Image.getRectangle().y, null);
} else if (inputMode == InputMethod.INPUT_ABC_UPPER) {
g.drawImage(((J2SEImmutableImage) modeAbcUpperImage.getImage()).getImage(), modeAbcUpperImage
.getRectangle().x, modeAbcUpperImage.getRectangle().y, null);
} else if (inputMode == InputMethod.INPUT_ABC_LOWER) {
g.drawImage(((J2SEImmutableImage) modeAbcLowerImage.getImage()).getImage(), modeAbcLowerImage
.getRectangle().x, modeAbcLowerImage.getRectangle().y, null);
}
}