本文整理汇总了Java中com.codename1.ui.plaf.Border.createBevelRaised方法的典型用法代码示例。如果您正苦于以下问题:Java Border.createBevelRaised方法的具体用法?Java Border.createBevelRaised怎么用?Java Border.createBevelRaised使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.codename1.ui.plaf.Border
的用法示例。
在下文中一共展示了Border.createBevelRaised方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findFlushingPropertyContrust
import com.codename1.ui.plaf.Border; //导入方法依赖的package包/类
/**
* Returns a "contrasting" value for the property to flash, e.g. for a font,
* return a differnet font or for a color return a ligher/darker color...
*/
private Object findFlushingPropertyContrust() {
if (flashingProperty.indexOf("Color") > -1) {
// flash to white or black depending on whether the color is closer to white
int val = Integer.decode("0x" + originalFlashingPropertyValue);
if (val > 0xf0f0f0) {
return "000000";
} else {
return "ffffff";
}
}
if (flashingProperty.indexOf("derive") > -1) {
return "NoPropertyUIIDExists";
}
if (flashingProperty.indexOf("font") > -1) {
// if this is not a bold font then just return a system bold font
if ((((com.codename1.ui.Font) originalFlashingPropertyValue).getStyle() & com.codename1.ui.Font.STYLE_BOLD) != 0) {
return com.codename1.ui.Font.createSystemFont(com.codename1.ui.Font.FACE_SYSTEM, com.codename1.ui.Font.STYLE_PLAIN, com.codename1.ui.Font.SIZE_LARGE);
}
return com.codename1.ui.Font.createSystemFont(com.codename1.ui.Font.FACE_SYSTEM, com.codename1.ui.Font.STYLE_BOLD, com.codename1.ui.Font.SIZE_LARGE);
}
if (flashingProperty.indexOf("bgImage") > -1) {
com.codename1.ui.Image i = (com.codename1.ui.Image) originalFlashingPropertyValue;
return i.modifyAlpha((byte) 128);
}
if (flashingProperty.indexOf("transparency") > -1) {
int v = Integer.parseInt((String) originalFlashingPropertyValue);
if (v < 128) {
return "255";
} else {
return "100";
}
}
/*
* if(flashingProperty.indexOf("scale") > -1) { return "false"; }
*/
if (flashingProperty.indexOf("padding") > -1 || flashingProperty.indexOf("margin") > -1) {
return "10,10,10,10";
}
if (flashingProperty.indexOf("border") > -1) {
if (originalFlashingPropertyValue != null) {
Border pressed = ((Border) originalFlashingPropertyValue).createPressedVersion();
if (pressed != null) {
return pressed;
}
}
return Border.createBevelRaised();
}
if (flashingProperty.indexOf("bgType") > -1) {
return originalFlashingPropertyValue;
}
if (flashingProperty.indexOf("bgGradient") > -1) {
Object[] gradient = new Object[4];
System.arraycopy(originalFlashingPropertyValue, 0, gradient, 0, 4);
gradient[0] = ((Object[]) originalFlashingPropertyValue)[1];
gradient[1] = ((Object[]) originalFlashingPropertyValue)[0];
return gradient;
}
if (flashingProperty.indexOf("align") > -1 || flashingProperty.indexOf("textDecoration") > -1) {
return originalFlashingPropertyValue;
}
throw new IllegalArgumentException("Unsupported property type: " + flashingProperty);
}
示例2: createBorder
import com.codename1.ui.plaf.Border; //导入方法依赖的package包/类
private Object createBorder(DataInputStream input, int type) throws IOException {
switch(type) {
// empty border
case 0xff01:
return Border.getEmpty();
// Line border
case 0xff02:
// use theme colors?
if(input.readBoolean()) {
return Border.createLineBorder(input.readByte());
} else {
return Border.createLineBorder(input.readByte(), input.readInt());
}
// Rounded border
case 0xff03:
// use theme colors?
if(input.readBoolean()) {
return Border.createRoundBorder(input.readByte(), input.readByte());
} else {
return Border.createRoundBorder(input.readByte(), input.readByte(), input.readInt());
}
// Etched Lowered border
case 0xff04:
// use theme colors?
if(input.readBoolean()) {
return Border.createEtchedLowered();
} else {
return Border.createEtchedLowered(input.readInt(), input.readInt());
}
// Etched raised border
case 0xff05:
// use theme colors?
if(input.readBoolean()) {
return Border.createEtchedRaised();
} else {
return Border.createEtchedRaised(input.readInt(), input.readInt());
}
// Bevel raised
case 0xff07:
// use theme colors?
if(input.readBoolean()) {
return Border.createBevelRaised();
} else {
return Border.createBevelRaised(input.readInt(), input.readInt(), input.readInt(), input.readInt());
}
// Bevel lowered
case 0xff06:
// use theme colors?
if(input.readBoolean()) {
return Border.createBevelLowered();
} else {
return Border.createBevelLowered(input.readInt(), input.readInt(), input.readInt(), input.readInt());
}
// Image border
case 0xff08:
Object[] imageBorder = readImageBorder(input);
return imageBorder;
// horizontal Image border
case 0xff09:
return readImageBorder(input, "h");
// vertical Image border
case 0xff10:
return readImageBorder(input, "v");
// scaled Image border
case 0xff11:
return readScaledImageBorder(input);
}
return null;
}