public class IconPainter extends GlimpseDataPainter2D
Modifier and Type | Class and Description |
---|---|
class |
IconPainter.PickResult |
BYTES_PER_FLOAT
Constructor and Description |
---|
IconPainter() |
IconPainter(int initialGroupSize,
boolean enablePicking) |
Modifier and Type | Method and Description |
---|---|
void |
addIcon(Object iconGroupId,
Object iconId,
float positionX,
float positionY,
float rotation) |
void |
addIcon(Object iconGroupId,
Object iconId,
float positionX,
float positionY,
float rotation,
float scale)
Adds the icon in the TextureAtlas referred to by iconId to iconGroupId at the provided coordinates.
|
void |
addIconGroup(Object iconGroupId,
TextureAtlas atlas) |
void |
addIconGroup(Object iconGroupId,
TextureAtlas atlas,
int initialSize)
Preallocates space for an icon group with the provided initial size.
|
void |
addIcons(Object iconGroupId,
Object iconId,
float[] positions)
Loads icons into the IconPainter with x/y/rotation/scale quadruplets (one per icon) packed into a single float[] array.
|
void |
addIcons(Object iconGroupId,
Object iconId,
float[] positionX,
float[] positionY,
float[] rotation,
float[] scale) |
void |
addIcons(Object iconGroupId,
Object iconId,
FloatBuffer positions,
int offset,
int vertexCount)
Loads icons into the IconPainter with x/y/rot/scale interleaved in a single FloatBuffer in the same
manner as
#addIcons( Object, Object, float, float[] ) . |
void |
addSpatialSelectionListener(SpatialSelectionListener<IconPainter.PickResult> listener) |
void |
dispose(javax.media.opengl.GLContext context) |
void |
ensureIconGroupSize(Object iconGroupId,
int minSize) |
boolean |
isPickingEnabled()
Indicates whether picking support is enabled for this painter.
|
void |
paintTo(javax.media.opengl.GL2 gl,
GlimpseBounds bounds,
Axis2D axis) |
void |
paintTo(GlimpseContext context,
GlimpseBounds bounds,
Axis2D axis) |
void |
removeIconGroup(Object iconGroupId)
Remove all the icons from the provided group.
|
void |
removeSpatialSelectionListener(SpatialSelectionListener<IconPainter.PickResult> listener) |
void |
setGlobalScale(float scale)
Sets the global scale factor for all icons (across all groups) rendered by this IconPainter.
|
void |
setPickingDisabled() |
void |
setPickingEnabled(GlimpseLayout layout)
Enables or disables picking support.
|
void |
showIconGroup(Object iconGroupId,
boolean show)
Toggles whether or not a particular icon group is displayed.
|
void |
showOnlyIconGroups(Collection<? extends Object> iconGroupIds)
Sets the visibility of all of this painter's icon-groups, so that a group is visible if and
only if its ID is in the specified collection.
|
isAlphaBlend, isLineSmooth, isPointSmooth, setAlphaBlend, setLineSmooth, setPointSmooth
paintTo
dispose, isDisposed, isVisible, paintTo, setErrorHandling, setLookAndFeel, setVisible
public IconPainter(int initialGroupSize, boolean enablePicking)
public IconPainter()
public void addSpatialSelectionListener(SpatialSelectionListener<IconPainter.PickResult> listener)
public void removeSpatialSelectionListener(SpatialSelectionListener<IconPainter.PickResult> listener)
public boolean isPickingEnabled()
public void setPickingEnabled(GlimpseLayout layout)
enable
- public void setPickingDisabled()
public void setGlobalScale(float scale)
scale
- the scale factor to apply to the width and height of iconspublic void addIconGroup(Object iconGroupId, TextureAtlas atlas)
public void addIconGroup(Object iconGroupId, TextureAtlas atlas, int initialSize)
iconGroupId
- initialSize
- public void ensureIconGroupSize(Object iconGroupId, int minSize)
public void addIcon(Object iconGroupId, Object iconId, float positionX, float positionY, float rotation)
#addIcon( Object, Object, float, float, float, float, float )
public void addIcon(Object iconGroupId, Object iconId, float positionX, float positionY, float rotation, float scale)
addIconGroup(Object, TextureAtlas, int)
or addIconGroup(Object, TextureAtlas)
.iconGroupId
- an arbitrary string creating an association between this icon and others in the same groupiconId
- the identifier of an icon in the underlying texture atlas loaded using loadIcon()positionX
- a position in axis space to place the icon atpositionY
- a position in axis space to place the icon atrotation
- rotation around center point of icon (CCW radians; 0 implies no rotation)scale
- a scale adjustment to the icon sizepublic void addIcons(Object iconGroupId, Object iconId, float[] positionX, float[] positionY, float[] rotation, float[] scale)
#addIcon( Object, Object, float[], float[], float[] )
public void addIcons(Object iconGroupId, Object iconId, float[] positions)
#addIcon( Object, Object, float[] )
public void addIcons(Object iconGroupId, Object iconId, FloatBuffer positions, int offset, int vertexCount)
#addIcons( Object, Object, float, float[] )
. The offset provides the index of the first
x coordinate to load into the painter and the vertex count provides the total number of x/y/rot/scale quadruplets
to read from the FloatBuffer.public void removeIconGroup(Object iconGroupId)
iconGroupId
- public void showIconGroup(Object iconGroupId, boolean show)
iconGroupId
- show
- public void showOnlyIconGroups(Collection<? extends Object> iconGroupIds)
iconGroupId
- show
- public void paintTo(GlimpseContext context, GlimpseBounds bounds, Axis2D axis)
paintTo
in class GlimpseDataPainter2D
public void paintTo(javax.media.opengl.GL2 gl, GlimpseBounds bounds, Axis2D axis)
paintTo
in class GlimpseDataPainter2D
public void dispose(javax.media.opengl.GLContext context)
Copyright © 2013 Metron, Inc.. All rights reserved.