APIdia Launch Partner
Top Inners Fields Constructors Methods
com.badlogic.gdx.tools.flame

pack-priv Class GradientPanel

extends ParticleValuePanel<GradientColorValue>
Class Inheritance
Imports
java.awt.Color, .Dimension, .GradientPaint, .Graphics, .Graphics2D, .GridBagConstraints, .GridBagLayout, .Insets, java.awt.event.MouseAdapter, .MouseEvent, .MouseMotionAdapter, java.util.ArrayList, javax.swing.BorderFactory, .JColorChooser, .JPanel, .JSlider, javax.swing.event.ChangeEvent, .ChangeListener, com.badlogic.gdx.graphics.g3d.particles.values.GradientColorValue

Author
Inferno

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public class

Field Summary

Modifier and TypeField and Description
pack-priv JPanel
private GradientPanel.GradientEditor
private GradientPanel.ColorSlider
pack-priv GradientPanel.ColorSlider
pack-priv GradientPanel.ColorSlider

Constructor Summary

AccessConstructor and Description
public
GradientPanel(FlameMain editor, GradientColorValue value, String name, String description, boolean hideGradientEditor)

Method Summary

Modifier and TypeMethod and Description
public Dimension
getPreferredSize()

Overrides javax.swing.JComponent.getPreferredSize.

If the preferredSize has been set to a non-null value just returns it.

protected void
public void
setColor(Color color)

pack-priv void
Inherited from com.badlogic.gdx.tools.flame.ParticleValuePanel:
activatesetHasAdvancedsetValue

Field Detail

colorPanelback to summary
pack-priv JPanel colorPanel
gradientEditorback to summary
private GradientPanel.GradientEditor gradientEditor
hueSliderback to summary
private GradientPanel.ColorSlider hueSlider
lightnessSliderback to summary
pack-priv GradientPanel.ColorSlider lightnessSlider
saturationSliderback to summary
pack-priv GradientPanel.ColorSlider saturationSlider

Constructor Detail

GradientPanelback to summary
public GradientPanel(FlameMain editor, GradientColorValue value, String name, String description, boolean hideGradientEditor)

Method Detail

getPreferredSizeback to summary
public Dimension getPreferredSize()

Overrides javax.swing.JComponent.getPreferredSize.

Doc from javax.swing.JComponent.getPreferredSize.

If the preferredSize has been set to a non-null value just returns it. If the UI delegate's getPreferredSize method returns a non null value then return that; otherwise defer to the component's layout manager.

initializeComponentsback to summary
protected void initializeComponents()

Overrides com.badlogic.gdx.tools.flame.EditorPanel.initializeComponents.

setColorback to summary
public void setColor(Color color)
updateColorback to summary
pack-priv void updateColor()
com.badlogic.gdx.tools.flame back to summary

public Class GradientPanel.ColorSlider

extends JPanel
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
private GradientPanel.ColorSlider.ColorPicker
pack-priv Color[]
pack-priv JSlider

Constructor Summary

AccessConstructor and Description
public
ColorSlider(Color[] paletteColors)

Method Summary

Modifier and TypeMethod and Description
protected void
public float
public Dimension
getPreferredSize()

Overrides javax.swing.JComponent.getPreferredSize.

If the preferredSize has been set to a non-null value just returns it.

public void
setColors(Color[] colors)

public void
setPercentage(float percent)

Inherited from javax.swing.JPanel:
getAccessibleContextgetUIgetUIClassIDparamStringsetUIupdateUI

Field Detail

colorPickerback to summary
private GradientPanel.ColorSlider.ColorPicker colorPicker
paletteColorsback to summary
pack-priv Color[] paletteColors
sliderback to summary
pack-priv JSlider slider

Constructor Detail

ColorSliderback to summary
public ColorSlider(Color[] paletteColors)

Method Detail

colorPickedback to summary
protected void colorPicked()
getPercentageback to summary
public float getPercentage()
getPreferredSizeback to summary
public Dimension getPreferredSize()

Overrides javax.swing.JComponent.getPreferredSize.

Doc from javax.swing.JComponent.getPreferredSize.

If the preferredSize has been set to a non-null value just returns it. If the UI delegate's getPreferredSize method returns a non null value then return that; otherwise defer to the component's layout manager.

setColorsback to summary
public void setColors(Color[] colors)
setPercentageback to summary
public void setPercentage(float percent)
com.badlogic.gdx.tools.flame back to summary

public Class GradientPanel.ColorSlider.ColorPicker

extends JPanel
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
paintComponent(Graphics graphics)

Overrides javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null.

Inherited from javax.swing.JPanel:
getAccessibleContextgetUIgetUIClassIDparamStringsetUIupdateUI

Constructor Detail

ColorPickerback to summary
public ColorPicker()

Method Detail

paintComponentback to summary
protected void paintComponent(Graphics graphics)

Overrides javax.swing.JComponent.paintComponent.

Doc from javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoke super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in an opaque color. If you do not honor the opaque property you will likely see visual artifacts.

The passed in Graphics object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.

com.badlogic.gdx.tools.flame back to summary

public Class GradientPanel.GradientEditor

extends JPanel
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv ArrayList<Color>
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv int
pack-priv ArrayList<Float>
pack-priv int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
protected void
paintComponent(Graphics graphics)

Overrides javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null.

public void
setColor(Color color)

Inherited from javax.swing.JPanel:
getAccessibleContextgetUIgetUIClassIDparamStringsetUIupdateUI

Field Detail

colorsback to summary
pack-priv ArrayList<Color> colors
dragIndexback to summary
pack-priv int dragIndex
gradientHeightback to summary
pack-priv int gradientHeight
gradientWidthback to summary
pack-priv int gradientWidth
gradientXback to summary
pack-priv int gradientX
gradientYback to summary
pack-priv int gradientY
handleHeightback to summary
pack-priv int handleHeight
handleWidthback to summary
pack-priv int handleWidth
percentagesback to summary
pack-priv ArrayList<Float> percentages
selectedIndexback to summary
pack-priv int selectedIndex

Constructor Detail

GradientEditorback to summary
public GradientEditor()

Method Detail

handleSelectedback to summary
public void handleSelected(Color color)
paintComponentback to summary
protected void paintComponent(Graphics graphics)

Overrides javax.swing.JComponent.paintComponent.

Doc from javax.swing.JComponent.paintComponent.

Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoke super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in an opaque color. If you do not honor the opaque property you will likely see visual artifacts.

The passed in Graphics object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.

setColorback to summary
public void setColor(Color color)