本文整理匯總了Java中javafx.scene.input.DataFormat.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java DataFormat.equals方法的具體用法?Java DataFormat.equals怎麽用?Java DataFormat.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.input.DataFormat
的用法示例。
在下文中一共展示了DataFormat.equals方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doVerifyContent
import javafx.scene.input.DataFormat; //導入方法依賴的package包/類
private void doVerifyContent(DataFormat... expectedDataFormats) {
if (expectedDataFormats == null) {
Assert.fail("Null pointer.");
}
if (Utils.isMacOS()) {
//On Mac OS it is possible to receive more content then it was sent.
//See http://javafx-jira.kenai.com/browse/RT-18004
if (1 == expectedDataFormats.length
&& DataFormat.RTF == expectedDataFormats[0]) {
assertTrue("When sending RTF it is expected to receive also a string",
receivedContent.size() >= 1 && receivedContent.size() <= 2);
} else {
assertTrue(expectedDataFormats.length >= receivedContent.size());
}
} else {
assertEquals(expectedDataFormats.length, receivedContent.size());
}
for (DataFormat df : expectedDataFormats) {
if (df.equals(DF_CUSTOM_BYTES)) {
assertArrayEquals((byte[]) dataFormatToCheckBoxID.get(df).getValue(), (byte[]) receivedContent.get(df));
} else if (df.equals(DataFormat.IMAGE)) {
Wrap srcImage = Lookups.byID(sceneSource, ID_SRC_IMAGE, ImageView.class);
Wrap receivedImage = Lookups.byID(sceneTarget, ID_RECEIVED_IMAGE, ImageView.class);
TestUtil.compareScreenshots(getClass().getSimpleName(),
srcImage, receivedImage);
} else if (df.equals(DataFormat.FILES)) {
final File expectedFile = ((List<File>) dataFormatToCheckBoxID.get(DataFormat.FILES).getValue()).get(0);
final File actualFile = ((List<File>) receivedContent.get(DataFormat.FILES)).get(0);
assertEquals(expectedFile.getAbsoluteFile(), actualFile);
} else {
assertEquals(dataFormatToCheckBoxID.get(df).getValue(), receivedContent.get(df));
}
}
}
示例2: getNameSimple
import javafx.scene.input.DataFormat; //導入方法依賴的package包/類
protected String getNameSimple(DataFormat df) {
String candidate = "";
candidate = getSimplestName(df);
if (!(df.equals(DF_CUSTOM_BYTES) || df.equals(DF_CUSTOM_CLASS) || df.equals(DF_CUSTOM_STRING))) {
candidate = "DataFormat." + candidate;
}
return candidate;
}
示例3: getSimplestName
import javafx.scene.input.DataFormat; //導入方法依賴的package包/類
protected String getSimplestName(DataFormat df) {
if (df.equals(DataFormat.FILES)) {
return "FILES";
}
if (df.equals(DataFormat.HTML)) {
return "HTML";
}
if (df.equals(DataFormat.IMAGE)) {
return "IMAGE";
}
if (df.equals(DataFormat.PLAIN_TEXT)) {
return "PLAIN_TEXT";
}
if (df.equals(DataFormat.RTF)) {
return "RTF";
}
if (df.equals(DataFormat.URL)) {
return "URL";
}
if (df.equals(DF_CUSTOM_BYTES)) {
return "DF_CUSTOM_BYTES";
}
if (df.equals(DF_CUSTOM_CLASS)) {
return "DF_CUSTOM_CLASS";
}
if (df.equals(DF_CUSTOM_STRING)) {
return "DF_CUSTOM_STRING";
}
return null;
}