本文整理汇总了Java中org.kordamp.ikonli.Ikon类的典型用法代码示例。如果您正苦于以下问题:Java Ikon类的具体用法?Java Ikon怎么用?Java Ikon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Ikon类属于org.kordamp.ikonli包,在下文中一共展示了Ikon类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public final Location build() {
final Location LOCATION = new Location();
for (String key : properties.keySet()) {
if ("name".equals(key)) {
LOCATION.setName(((StringProperty) properties.get(key)).get());
} else if ("latitude".equals(key)) {
LOCATION.setLatitude(((DoubleProperty) properties.get(key)).get());
} else if ("longitude".equals(key)) {
LOCATION.setLongitude(((DoubleProperty) properties.get(key)).get());
} else if ("info".equals(key)) {
LOCATION.setInfo(((StringProperty) properties.get(key)).get());
} else if ("color".equals(key)) {
LOCATION.setColor(((ObjectProperty<Color>) properties.get(key)).get());
} else if ("iconCode".equals(key)) {
LOCATION.setIconCode(((ObjectProperty<Ikon>) properties.get(key)).get());
} else if ("iconSize".equals(key)) {
LOCATION.setIconSize(((IntegerProperty) properties.get(key)).get());
} else if ("mouseEnterHandler".equals(key)) {
LOCATION.setMouseEnterHandler(((ObjectProperty<EventHandler<MouseEvent>>) properties.get(key)).get());
} else if ("mousePressHandler".equals(key)) {
LOCATION.setMousePressHandler(((ObjectProperty<EventHandler<MouseEvent>>) properties.get(key)).get());
} else if ("mouseReleaseHandler".equals(key)) {
LOCATION.setMouseReleaseHandler(((ObjectProperty<EventHandler<MouseEvent>>) properties.get(key)).get());
} else if ("mouseExitHandler".equals(key)) {
LOCATION.setMouseExitHandler(((ObjectProperty<EventHandler<MouseEvent>>) properties.get(key)).get());
}
}
return LOCATION;
}
示例2: Location
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public Location(final String NAME, final double LATITUDE, final double LONGITUDE, final String INFO, final Color COLOR, final Ikon ICON_CODE, final int ICON_SIZE) {
name = NAME;
latitude = LATITUDE;
longitude = LONGITUDE;
info = INFO;
color = COLOR;
iconCode = ICON_CODE;
iconSize = ICON_SIZE;
}
示例3: getIconAsNode
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
/**
*
* @param fontIcon
* @return
*/
public Node getIconAsNode(Ikon fontIcon) {
if (fontIcon == null) {
throw new IllegalArgumentException("'fontIcon' can't be NULL."); // NOI18N
}
// TODO add more data (size, color...)
final Node node = new FontIcon(fontIcon);
return node;
}
示例4: testIkonIsFound
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
@Test
public void testIkonIsFound() {
final String fontIconName = "oct-alert";
final Ikon actualIkon = handler.resolve(fontIconName);
assertNotNull("actualIkon can't be NULL", actualIkon);
final Ikon expectedIkon = Octicons.ALERT;
assertEquals("actualIkon.ALERT must be Octicons.ALERT.getDescription() -> oct-alert", expectedIkon, actualIkon);
}
示例5: testIkonNOTFound
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
@Test(expected=IllegalArgumentException.class)
public void testIkonNOTFound() {
final String fontIconName = "DONT_EXISTS";
final Ikon actualIkon = handler.resolve(fontIconName);
assertNull("Ikon.DONT_EXISTS can't exists", actualIkon);
}
示例6: FunMenuItem
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public FunMenuItem(final Ikon CODE) {
getStylesheets().add(FunMenuItem.class.getResource("funmenu.css").toExternalForm());
iconColor = new SimpleStyleableObjectProperty<>(ICON_COLOR, this, "iconColor");
iconCode = CODE;
init();
initGraphics();
registerListeners();
}
示例7: initializeButton
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
private void initializeButton(Button btn, Ikon icon, String tooltip) {
final FontIcon fi = new FontIcon(icon);
fi.setIconSize(24);
btn.setGraphic(fi);
btn.setText(null);
btn.setTooltip(new Tooltip(tooltip));
}
示例8: iconCode
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public final B iconCode(final Ikon CODE) {
properties.put("iconCode", new SimpleObjectProperty(CODE));
return (B)this;
}
示例9: locationIconCode
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public final B locationIconCode(final Ikon ICON_CODE) {
properties.put("locationIconCode", new SimpleObjectProperty<>(ICON_CODE));
return (B)this;
}
示例10: resolve
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
@Override
public Ikon resolve(String fontIconName) {
final Ikon ikon = Octicons.findByDescription(fontIconName);
return ikon;
}
示例11: setItem1IconCode
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public void setItem1IconCode(final Ikon CODE) {
if (null == CODE) return;
item1.setIconCode(CODE);
item1.getIcon().setOnMousePressed(closeHandler);
}
示例12: setItem2IconCode
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public void setItem2IconCode(final Ikon CODE) {
if (null == CODE) return;
item2.setIconCode(CODE);
item2.getIcon().setOnMousePressed(closeHandler);
}
示例13: setItem3IconCode
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public void setItem3IconCode(final Ikon CODE) {
if (null == CODE) return;
item3.setIconCode(CODE);
item3.getIcon().setOnMousePressed(closeHandler);
}
示例14: setItem4IconCode
import org.kordamp.ikonli.Ikon; //导入依赖的package包/类
public void setItem4IconCode(final Ikon CODE) {
if (null == CODE) return;
item4.setIconCode(CODE);
item4.getIcon().setOnMousePressed(closeHandler);
}