use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class ExtensionAggregatePercentagesQuery method extractTabInformation.
private TabInformation extractTabInformation(String tabName, ResultSet set) throws SQLException {
Optional<Integer> tabPriority = Optional.of(set.getInt("tab_priority"));
if (set.wasNull()) {
tabPriority = Optional.empty();
}
Optional<ElementOrder[]> elementOrder = Optional.ofNullable(set.getString(ExtensionTabTable.ELEMENT_ORDER)).map(ElementOrder::deserialize);
Icon tabIcon = extractTabIcon(set);
return new TabInformation(tabName, tabIcon, elementOrder.orElse(ElementOrder.values()), tabPriority.orElse(100));
}
use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class ExtensionAggregatePercentagesQuery method extractTabIcon.
private Icon extractTabIcon(ResultSet set) throws SQLException {
Optional<String> iconName = Optional.ofNullable(set.getString("tab_icon_name"));
if (iconName.isPresent()) {
Family iconFamily = Family.getByName(set.getString("tab_icon_family")).orElse(Family.SOLID);
Color iconColor = Color.getByName(set.getString("tab_icon_color")).orElse(Color.NONE);
return new Icon(iconFamily, iconName.get(), iconColor);
} else {
return TabInformation.defaultIcon();
}
}
use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class ExtensionPlayerDataQuery method extractTabInformation.
private TabInformation extractTabInformation(String tabName, ResultSet set) throws SQLException {
Optional<Integer> tabPriority = Optional.of(set.getInt("tab_priority"));
if (set.wasNull()) {
tabPriority = Optional.empty();
}
Optional<ElementOrder[]> elementOrder = Optional.ofNullable(set.getString(ExtensionTabTable.ELEMENT_ORDER)).map(ElementOrder::deserialize);
Icon tabIcon = extractTabIcon(set);
return new TabInformation(tabName, tabIcon, elementOrder.orElse(ElementOrder.values()), tabPriority.orElse(100));
}
use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class ExtensionQueryResultTableDataQuery method extractDescription.
private ExtensionDescription extractDescription(ResultSet set) throws SQLException {
String name = set.getString("provider_name");
String text = set.getString(ExtensionProviderTable.TEXT);
String iconName = set.getString("provider_icon_name");
Family family = Family.getByName(set.getString("provider_icon_family")).orElse(Family.SOLID);
Icon icon = new Icon(family, iconName, Color.NONE);
return new ExtensionDescription(name, text, null, icon, 0);
}
use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class ExtensionServerDataQuery method extractTabInformation.
private TabInformation extractTabInformation(String tabName, ResultSet set) throws SQLException {
Optional<Integer> tabPriority = Optional.of(set.getInt("tab_priority"));
if (set.wasNull()) {
tabPriority = Optional.empty();
}
Optional<ElementOrder[]> elementOrder = Optional.ofNullable(set.getString(ExtensionTabTable.ELEMENT_ORDER)).map(ElementOrder::deserialize);
Icon tabIcon = extractTabIcon(set);
return new TabInformation(tabName, tabIcon, elementOrder.orElse(ElementOrder.values()), tabPriority.orElse(100));
}
Aggregations