Search in sources :

Example 1 with Color

use of com.djrapitops.plan.extension.icon.Color in project Plan by plan-player-analytics.

the class ExtensionServerDataQuery 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);
}
Also used : Color(com.djrapitops.plan.extension.icon.Color) Family(com.djrapitops.plan.extension.icon.Family) Icon(com.djrapitops.plan.extension.icon.Icon)

Example 2 with Color

use of com.djrapitops.plan.extension.icon.Color in project Plan by plan-player-analytics.

the class ExtensionServerDataQuery 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();
    }
}
Also used : Color(com.djrapitops.plan.extension.icon.Color) Family(com.djrapitops.plan.extension.icon.Family) Icon(com.djrapitops.plan.extension.icon.Icon)

Example 3 with Color

use of com.djrapitops.plan.extension.icon.Color in project Plan by plan-player-analytics.

the class QueriedTables method toQueriedTabs.

public QueriedTabData toQueriedTabs() {
    QueriedTabData tabData = new QueriedTabData();
    for (Map.Entry<Integer, Map<Integer, Table.Factory>> entry : byPluginID.entrySet()) {
        Integer pluginID = entry.getKey();
        for (Table.Factory table : entry.getValue().values()) {
            // Extra Table information
            String tableName = TableAccessor.getTableName(table);
            Color tableColor = TableAccessor.getColor(table);
            // Extra tab information
            String tabName = TableAccessor.getTabName(table);
            ExtensionTabData.Builder tab = tabData.getTab(pluginID, tabName, () -> extractTabInformation(table));
            tab.putTableData(new ExtensionTableData(tableName, table.build(), tableColor));
        }
    }
    return tabData;
}
Also used : ExtensionTabData(com.djrapitops.plan.extension.implementation.results.ExtensionTabData) Table(com.djrapitops.plan.extension.table.Table) ExtensionTableData(com.djrapitops.plan.extension.implementation.results.ExtensionTableData) Color(com.djrapitops.plan.extension.icon.Color) Map(java.util.Map) HashMap(java.util.HashMap)

Example 4 with Color

use of com.djrapitops.plan.extension.icon.Color 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);
}
Also used : Color(com.djrapitops.plan.extension.icon.Color) ExtensionDescription(com.djrapitops.plan.extension.implementation.results.ExtensionDescription) Family(com.djrapitops.plan.extension.icon.Family) Icon(com.djrapitops.plan.extension.icon.Icon)

Example 5 with Color

use of com.djrapitops.plan.extension.icon.Color 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();
    }
}
Also used : Color(com.djrapitops.plan.extension.icon.Color) Family(com.djrapitops.plan.extension.icon.Family) Icon(com.djrapitops.plan.extension.icon.Icon)

Aggregations

Color (com.djrapitops.plan.extension.icon.Color)16 Family (com.djrapitops.plan.extension.icon.Family)15 Icon (com.djrapitops.plan.extension.icon.Icon)15 ExtensionDescription (com.djrapitops.plan.extension.implementation.results.ExtensionDescription)5 ExtensionInformation (com.djrapitops.plan.extension.implementation.results.ExtensionInformation)1 ExtensionTabData (com.djrapitops.plan.extension.implementation.results.ExtensionTabData)1 ExtensionTableData (com.djrapitops.plan.extension.implementation.results.ExtensionTableData)1 Table (com.djrapitops.plan.extension.table.Table)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1