@Override public void setAlpha(float alpha) { // TODO: Alpha doesn't work for particles here as intended :( this.alpha = alpha; for (ParticleEffect e : effects.keySet()) { for (ParticleEmitter emitter : e.getEmitters()) { ScaledNumericValue v = emitter.getTransparency(); v.setHigh(alpha); v.setLow(alpha); } } }
public PercentagePanel (final ScaledNumericValue value, String chartTitle, String name, String description) { super(value, name, description); this.value = value; initializeComponents(chartTitle); chart.setValues(value.getTimeline(), value.getScaling()); expandButton.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent event) { chart.setExpanded(!chart.isExpanded()); boolean expanded = chart.isExpanded(); GridBagLayout layout = (GridBagLayout)getContentPanel().getLayout(); GridBagConstraints chartConstraints = layout.getConstraints(chart); GridBagConstraints expandButtonConstraints = layout.getConstraints(expandButton); if (expanded) { chart.setPreferredSize(new Dimension(150, 200)); expandButton.setText("-"); chartConstraints.weightx = 1; expandButtonConstraints.weightx = 0; } else { chart.setPreferredSize(new Dimension(150, 62)); expandButton.setText("+"); chartConstraints.weightx = 0; expandButtonConstraints.weightx = 1; } layout.setConstraints(chart, chartConstraints); layout.setConstraints(expandButton, expandButtonConstraints); chart.revalidate(); } }); }
public ScaledNumericValue getXScale () { return xScaleValue; }
public ScaledNumericValue getYScale () { return yScaleValue; }
public ScaledNumericValue getVelocity () { return velocityValue; }
public ScaledNumericValue getEmission () { return emissionValue; }
public ScaledNumericValue getSpawnWidth () { return spawnWidthValue; }
public ScaledNumericValue getSpawnHeight () { return spawnHeightValue; }
@Override public void setRotation(float degrees) { ScaledNumericValue v = particleEffect.getEmitters().first().getAngle(); v.setHigh(degrees + 90f, degrees -90f); v.setLow(degrees); }