use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class QueriedTables method extractTabInformation.
private TabInformation extractTabInformation(Table.Factory table) {
String tabName = TableAccessor.getTabName(table);
int tabPriority = TableAccessor.getTabPriority(table);
ElementOrder[] tabOrder = TableAccessor.getTabOrder(table);
Icon tabIcon = TableAccessor.getTabIcon(table);
return new TabInformation(tabName, tabIcon, tabOrder, tabPriority);
}
use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class ExtensionAggregateBooleansQuery method extractDescription.
private ExtensionDescription extractDescription(ResultSet set) throws SQLException {
String name = set.getString("provider_name") + "_aggregate";
String text = set.getString(ExtensionProviderTable.TEXT) + " / Players";
String description = set.getString(ExtensionProviderTable.DESCRIPTION);
int priority = set.getInt("provider_priority");
String iconName = set.getString("provider_icon_name");
Family family = Family.getByName(set.getString("provider_icon_family")).orElse(Family.SOLID);
Color color = Color.getByName(set.getString("provider_icon_color")).orElse(Color.NONE);
Icon icon = new Icon(family, iconName, color);
return new ExtensionDescription(name, text, description, icon, priority);
}
use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class ExtensionAggregateBooleansQuery 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 ExtensionAggregateDoublesQuery method extractDescription.
private ExtensionDescription extractDescription(ResultSet set) throws SQLException {
String name = set.getString("provider_name");
String text = set.getString(ExtensionProviderTable.TEXT);
String description = set.getString(ExtensionProviderTable.DESCRIPTION);
int priority = set.getInt("provider_priority");
String iconName = set.getString("provider_icon_name");
Family family = Family.getByName(set.getString("provider_icon_family")).orElse(Family.SOLID);
Color color = Color.getByName(set.getString("provider_icon_color")).orElse(Color.NONE);
Icon icon = new Icon(family, iconName, color);
return new ExtensionDescription(name, text, description, icon, priority);
}
use of com.djrapitops.plan.extension.icon.Icon in project Plan by plan-player-analytics.
the class ExtensionAggregateDoublesQuery 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