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

public Class TexturePanel

extends ImagePanel
Class Inheritance
Imports
java.awt.Color, .Graphics, .Rectangle, java.awt.event.MouseAdapter, .MouseEvent, com.badlogic.gdx.graphics.Texture, com.badlogic.gdx.graphics.g2d.TextureRegion, com.badlogic.gdx.graphics.glutils.FileTextureData, com.badlogic.gdx.utils.Array

Author
Inferno

Field Summary

Modifier and TypeField and Description
private Color
private Color
private Color
pack-priv Array<TextureRegion>
pack-priv Texture
private Color
pack-priv Array<TextureRegion>

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
private void
draw(Graphics g, Array<TextureRegion> regions, Color color, boolean drawIndex)

public Texture
protected boolean
isInsideRegion(TextureRegion region, float x, float y)

protected void
paintComponent(Graphics g)

Overrides com.badlogic.gdx.tools.flame.ImagePanel.paintComponent.

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

public void
public void
public void
public void
private void
public void
Inherited from com.badlogic.gdx.tools.flame.ImagePanel:
getPreferredSizesetImagesetImage

Field Detail

indexBackgroundColorback to summary
private Color indexBackgroundColor
indexColorback to summary
private Color indexColor
selectedColorback to summary
private Color selectedColor
selectedRegionsback to summary
pack-priv Array<TextureRegion> selectedRegions
textureback to summary
pack-priv Texture texture
unselectedColorback to summary
private Color unselectedColor
unselectedRegionsback to summary
pack-priv Array<TextureRegion> unselectedRegions

Constructor Detail

TexturePanelback to summary
public TexturePanel()
TexturePanelback to summary
public TexturePanel(Texture texture, Array<TextureRegion> regions)

Method Detail

clearback to summary
public void clear()
clearSelectionback to summary
public void clearSelection()
drawback to summary
private void draw(Graphics g, Array<TextureRegion> regions, Color color, boolean drawIndex)
getTextureback to summary
public Texture getTexture()
isInsideRegionback to summary
protected boolean isInsideRegion(TextureRegion region, float x, float y)
paintComponentback to summary
protected void paintComponent(Graphics g)

Overrides com.badlogic.gdx.tools.flame.ImagePanel.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.

Annotations
@Override
selectback to summary
public void select(TextureRegion region)
selectAllback to summary
public void selectAll()
setRegionsback to summary
public void setRegions(Array<TextureRegion> regions)
setTextureback to summary
public void setTexture(Texture texture)
swapback to summary
private void swap(TextureRegion region, Array<TextureRegion> src, Array<TextureRegion> dst)
unselectback to summary
public void unselect(TextureRegion region)