public boolean hasEffectTypes(@Nonnull final EffectEventId id) { return effects.isSet(id); }
public Collection<EffectType> getEventEffectTypes(@Nonnull final EffectEventId id) { if (effects.isSet(id)) { return Collections.unmodifiableCollection(effects.get(id)); } else { return Collections.emptyList(); } }
@SuppressWarnings("unchecked") public <T extends ControlEffectAttributes> void convertCopy( @Nonnull final EffectEventId effectId, @Nonnull final Collection<T> storage) { if (effects.isSet(effectId)) { for (EffectType e : effects.get(effectId)) { storage.add((T) e.convert()); } } } }
@Nonnull private String getCollectionString(@Nonnull final EffectEventId effectId, final int offset) { if (!effects.isSet(effectId)) { return ""; } StringBuilder builder = new StringBuilder(); for (EffectType effect : effects.get(effectId)) { if (builder.length() > 0) { builder.append('\n'); } builder.append(StringHelper.whitespace(offset)).append('<').append(effectId.name()).append("> "); builder.append(effect.output(offset)); if (effect.getStyleId() != null) { builder.append(" [").append(effect.getStyleId()).append(']'); } } return builder.toString(); }
public void resolveParameters(@Nonnull final Attributes src) { for (EffectEventId id : EffectEventId.values()) { if (effects.isSet(id)) { resolveParameterCollection(effects.get(id), src); } } }
@Override @SuppressWarnings("unchecked") public void translateSpecialValues(@Nonnull final Nifty nifty, @Nullable final Screen screen) { super.translateSpecialValues(nifty, screen); for (final EffectEventId event : EffectEventId.values()) { if (effects.isSet(event)) { for (EffectType effectType : effects.get(event)) { effectType.translateSpecialValues(nifty, screen); } } } }
public void apply(@Nonnull final EffectsType dstEffectType, @Nullable final String styleId) { for (EffectEventId id : EffectEventId.values()) { if (effects.isSet(id)) { applyEffectCollection(effects.get(id), dstEffectType.effects.get(id), styleId); } } }
private void copyEffects(@Nonnull final EffectsType src) { for (final EffectEventId event : EffectEventId.values()) { if (src.effects.isSet(event)) { copyCollection(effects.get(event), src.effects.get(event)); } } }
private void mergeEffects(@Nonnull final EffectsType src) { for (final EffectEventId event : EffectEventId.values()) { if (src.effects.isSet(event)) { mergeCollection(effects.get(event), src.effects.get(event)); } } }
public void removeWithTag(@Nonnull final String styleId) { getAttributes().removeWithTag(styleId); for (EffectEventId id : EffectEventId.values()) { if (effects.isSet(id)) { removeAllEffectsWithStyleId(effects.get(id), styleId); } } }
@Nonnull public EffectsType create() { EffectsType effectsType = new EffectsType(attributes); for (EffectEventId id : EffectEventId.values()) { if (effectAttributes.isSet(id)) { for (ControlEffectAttributes effectParam : effectAttributes.get(id)) { effectsType.addEventEffect(id, effectParam.create()); } } } return effectsType; }
private void connectAttributes() { attributes.setEffects(createEffects()); for (EffectEventId eventId : EffectEventId.values()) { if (effectBuilders.isSet(eventId)) { Collection<EffectBuilder> builders = effectBuilders.get(eventId); for (EffectBuilder builder : builders) { attributes.addEffects(eventId, builder.getAttributes()); } } } }