repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
threerings/nenya | core/src/main/java/com/threerings/media/sound/SoundLoader.java | SoundLoader.getSound | public InputStream getSound (String bundle, String path)
throws IOException
{
InputStream rsrc;
try {
rsrc = _rmgr.getResource(bundle, path);
} catch (FileNotFoundException notFound) {
// try from the classpath
try {
rsrc = _rmgr.ge... | java | public InputStream getSound (String bundle, String path)
throws IOException
{
InputStream rsrc;
try {
rsrc = _rmgr.getResource(bundle, path);
} catch (FileNotFoundException notFound) {
// try from the classpath
try {
rsrc = _rmgr.ge... | [
"public",
"InputStream",
"getSound",
"(",
"String",
"bundle",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"InputStream",
"rsrc",
";",
"try",
"{",
"rsrc",
"=",
"_rmgr",
".",
"getResource",
"(",
"bundle",
",",
"path",
")",
";",
"}",
"catch",
... | Attempts to load a sound stream from the given path from the given bundle and from the
classpath. If nothing is found, a FileNotFoundException is thrown. | [
"Attempts",
"to",
"load",
"a",
"sound",
"stream",
"from",
"the",
"given",
"path",
"from",
"the",
"given",
"bundle",
"and",
"from",
"the",
"classpath",
".",
"If",
"nothing",
"is",
"found",
"a",
"FileNotFoundException",
"is",
"thrown",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/SoundLoader.java#L92-L107 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/SoundLoader.java | SoundLoader.getConfig | protected Config getConfig (String packagePath)
{
Config c = _configs.get(packagePath);
if (c == null) {
Properties props = new Properties();
String propFilename = packagePath + Sounds.PROP_NAME + ".properties";
try {
props = ConfigUtil.loadInherit... | java | protected Config getConfig (String packagePath)
{
Config c = _configs.get(packagePath);
if (c == null) {
Properties props = new Properties();
String propFilename = packagePath + Sounds.PROP_NAME + ".properties";
try {
props = ConfigUtil.loadInherit... | [
"protected",
"Config",
"getConfig",
"(",
"String",
"packagePath",
")",
"{",
"Config",
"c",
"=",
"_configs",
".",
"get",
"(",
"packagePath",
")",
";",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";"... | Get the cached Config. | [
"Get",
"the",
"cached",
"Config",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/SoundLoader.java#L117-L132 | train |
threerings/nenya | core/src/main/java/com/threerings/media/sound/SoundLoader.java | SoundLoader.loadClipData | protected byte[] loadClipData (String bundle, String path)
throws IOException
{
InputStream clipin = null;
try {
clipin = getSound(bundle, path);
} catch (FileNotFoundException fnfe) {
// only play the default sound if we have verbose sound debugging turned on... | java | protected byte[] loadClipData (String bundle, String path)
throws IOException
{
InputStream clipin = null;
try {
clipin = getSound(bundle, path);
} catch (FileNotFoundException fnfe) {
// only play the default sound if we have verbose sound debugging turned on... | [
"protected",
"byte",
"[",
"]",
"loadClipData",
"(",
"String",
"bundle",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"InputStream",
"clipin",
"=",
"null",
";",
"try",
"{",
"clipin",
"=",
"getSound",
"(",
"bundle",
",",
"path",
")",
";",
"}",... | Read the data from the resource manager. | [
"Read",
"the",
"data",
"from",
"the",
"resource",
"manager",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/sound/SoundLoader.java#L137-L170 | train |
threerings/nenya | core/src/main/java/com/threerings/media/timer/CalibratingTimer.java | CalibratingTimer.init | protected void init (long milliDivider, long microDivider)
{
_milliDivider = milliDivider;
_microDivider = microDivider;
reset();
log.info("Using " + getClass() + " timer", "mfreq", _milliDivider,
"ufreq", _microDivider, "start", _startStamp);
} | java | protected void init (long milliDivider, long microDivider)
{
_milliDivider = milliDivider;
_microDivider = microDivider;
reset();
log.info("Using " + getClass() + " timer", "mfreq", _milliDivider,
"ufreq", _microDivider, "start", _startStamp);
} | [
"protected",
"void",
"init",
"(",
"long",
"milliDivider",
",",
"long",
"microDivider",
")",
"{",
"_milliDivider",
"=",
"milliDivider",
";",
"_microDivider",
"=",
"microDivider",
";",
"reset",
"(",
")",
";",
"log",
".",
"info",
"(",
"\"Using \"",
"+",
"getCla... | Initializes this timer. Must be called before the timer is used.
@param milliDivider - value by which current() must be divided to get milliseconds
@param microDivider - value by which current() must be divided to get microseconds | [
"Initializes",
"this",
"timer",
".",
"Must",
"be",
"called",
"before",
"the",
"timer",
"is",
"used",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/timer/CalibratingTimer.java#L43-L50 | train |
threerings/nenya | core/src/main/java/com/threerings/media/timer/CalibratingTimer.java | CalibratingTimer.calibrate | protected void calibrate ()
{
long currentTimer = current();
long currentMillis = System.currentTimeMillis();
long elapsedTimer = currentTimer - _driftTimerStamp;
float elapsedMillis = currentMillis - _driftMilliStamp;
float drift = elapsedMillis / (elapsedTimer / _milliDivid... | java | protected void calibrate ()
{
long currentTimer = current();
long currentMillis = System.currentTimeMillis();
long elapsedTimer = currentTimer - _driftTimerStamp;
float elapsedMillis = currentMillis - _driftMilliStamp;
float drift = elapsedMillis / (elapsedTimer / _milliDivid... | [
"protected",
"void",
"calibrate",
"(",
")",
"{",
"long",
"currentTimer",
"=",
"current",
"(",
")",
";",
"long",
"currentMillis",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"elapsedTimer",
"=",
"currentTimer",
"-",
"_driftTimerStamp",
";",
... | Calculates the drift factor from the time elapsed from the last calibrate call. | [
"Calculates",
"the",
"drift",
"factor",
"from",
"the",
"time",
"elapsed",
"from",
"the",
"last",
"calibrate",
"call",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/timer/CalibratingTimer.java#L121-L160 | train |
threerings/nenya | tools/src/main/java/com/threerings/cast/tools/xml/ClassRuleSet.java | ClassRuleSet.addRuleInstances | @Override
public void addRuleInstances (Digester digester)
{
// this creates the appropriate instance when we encounter a
// <class> tag
digester.addObjectCreate(_prefix + CLASS_PATH,
ComponentClass.class.getName());
// grab the attributes from t... | java | @Override
public void addRuleInstances (Digester digester)
{
// this creates the appropriate instance when we encounter a
// <class> tag
digester.addObjectCreate(_prefix + CLASS_PATH,
ComponentClass.class.getName());
// grab the attributes from t... | [
"@",
"Override",
"public",
"void",
"addRuleInstances",
"(",
"Digester",
"digester",
")",
"{",
"// this creates the appropriate instance when we encounter a",
"// <class> tag",
"digester",
".",
"addObjectCreate",
"(",
"_prefix",
"+",
"CLASS_PATH",
",",
"ComponentClass",
".",... | Adds the necessary rules to the digester to parse our classes. | [
"Adds",
"the",
"necessary",
"rules",
"to",
"the",
"digester",
"to",
"parse",
"our",
"classes",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/cast/tools/xml/ClassRuleSet.java#L70-L106 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/ObjectSet.java | ObjectSet.insert | public boolean insert (ObjectInfo info)
{
// bail if it's already in the set
int ipos = indexOf(info);
if (ipos >= 0) {
// log a warning because the caller shouldn't be doing this
log.warning("Requested to add an object to a set that already " +
... | java | public boolean insert (ObjectInfo info)
{
// bail if it's already in the set
int ipos = indexOf(info);
if (ipos >= 0) {
// log a warning because the caller shouldn't be doing this
log.warning("Requested to add an object to a set that already " +
... | [
"public",
"boolean",
"insert",
"(",
"ObjectInfo",
"info",
")",
"{",
"// bail if it's already in the set",
"int",
"ipos",
"=",
"indexOf",
"(",
"info",
")",
";",
"if",
"(",
"ipos",
">=",
"0",
")",
"{",
"// log a warning because the caller shouldn't be doing this",
"lo... | Inserts the supplied object into the set.
@return true if it was inserted, false if the object was already in
the set. | [
"Inserts",
"the",
"supplied",
"object",
"into",
"the",
"set",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/ObjectSet.java#L44-L61 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/ObjectSet.java | ObjectSet.remove | public boolean remove (ObjectInfo info)
{
int opos = indexOf(info);
if (opos >= 0) {
remove(opos);
return true;
} else {
return false;
}
} | java | public boolean remove (ObjectInfo info)
{
int opos = indexOf(info);
if (opos >= 0) {
remove(opos);
return true;
} else {
return false;
}
} | [
"public",
"boolean",
"remove",
"(",
"ObjectInfo",
"info",
")",
"{",
"int",
"opos",
"=",
"indexOf",
"(",
"info",
")",
";",
"if",
"(",
"opos",
">=",
"0",
")",
"{",
"remove",
"(",
"opos",
")",
";",
"return",
"true",
";",
"}",
"else",
"{",
"return",
... | Removes the specified object from the set.
@return true if it was removed, false if it was not in the set. | [
"Removes",
"the",
"specified",
"object",
"from",
"the",
"set",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/ObjectSet.java#L103-L112 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/ObjectSet.java | ObjectSet.toArray | public ObjectInfo[] toArray ()
{
ObjectInfo[] info = new ObjectInfo[_size];
System.arraycopy(_objs, 0, info, 0, _size);
return info;
} | java | public ObjectInfo[] toArray ()
{
ObjectInfo[] info = new ObjectInfo[_size];
System.arraycopy(_objs, 0, info, 0, _size);
return info;
} | [
"public",
"ObjectInfo",
"[",
"]",
"toArray",
"(",
")",
"{",
"ObjectInfo",
"[",
"]",
"info",
"=",
"new",
"ObjectInfo",
"[",
"_size",
"]",
";",
"System",
".",
"arraycopy",
"(",
"_objs",
",",
"0",
",",
"info",
",",
"0",
",",
"_size",
")",
";",
"return... | Converts the contents of this object set to an array. | [
"Converts",
"the",
"contents",
"of",
"this",
"object",
"set",
"to",
"an",
"array",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/ObjectSet.java#L126-L131 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.getBaseTile | public BaseTile getBaseTile (int tx, int ty)
{
BaseTile tile = _base[index(tx, ty)];
if (tile == null && _defset != null) {
tile = (BaseTile)_defset.getTile(
TileUtil.getTileHash(tx, ty) % _defset.getTileCount());
}
return tile;
} | java | public BaseTile getBaseTile (int tx, int ty)
{
BaseTile tile = _base[index(tx, ty)];
if (tile == null && _defset != null) {
tile = (BaseTile)_defset.getTile(
TileUtil.getTileHash(tx, ty) % _defset.getTileCount());
}
return tile;
} | [
"public",
"BaseTile",
"getBaseTile",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"BaseTile",
"tile",
"=",
"_base",
"[",
"index",
"(",
"tx",
",",
"ty",
")",
"]",
";",
"if",
"(",
"tile",
"==",
"null",
"&&",
"_defset",
"!=",
"null",
")",
"{",
"til... | Returns the base tile at the specified coordinates or null if
there's no tile at said coordinates. | [
"Returns",
"the",
"base",
"tile",
"at",
"the",
"specified",
"coordinates",
"or",
"null",
"if",
"there",
"s",
"no",
"tile",
"at",
"said",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L288-L296 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.updateBaseTile | public void updateBaseTile (int fqTileId, int tx, int ty)
{
String errmsg = null;
int tidx = index(tx, ty);
// this is a bit magical: we pass the fully qualified tile id to
// the tile manager which loads up from the configured tileset
// repository the appropriate tileset (... | java | public void updateBaseTile (int fqTileId, int tx, int ty)
{
String errmsg = null;
int tidx = index(tx, ty);
// this is a bit magical: we pass the fully qualified tile id to
// the tile manager which loads up from the configured tileset
// repository the appropriate tileset (... | [
"public",
"void",
"updateBaseTile",
"(",
"int",
"fqTileId",
",",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"String",
"errmsg",
"=",
"null",
";",
"int",
"tidx",
"=",
"index",
"(",
"tx",
",",
"ty",
")",
";",
"// this is a bit magical: we pass the fully qualifie... | Informs this scene block that the specified base tile has been
changed. | [
"Informs",
"this",
"scene",
"block",
"that",
"the",
"specified",
"base",
"tile",
"has",
"been",
"changed",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L311-L340 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.updateFringe | public void updateFringe (int tx, int ty)
{
int tidx = index(tx, ty);
if (_base[tidx] != null) {
_fringe[tidx] = computeFringeTile(tx, ty);
}
} | java | public void updateFringe (int tx, int ty)
{
int tidx = index(tx, ty);
if (_base[tidx] != null) {
_fringe[tidx] = computeFringeTile(tx, ty);
}
} | [
"public",
"void",
"updateFringe",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"int",
"tidx",
"=",
"index",
"(",
"tx",
",",
"ty",
")",
";",
"if",
"(",
"_base",
"[",
"tidx",
"]",
"!=",
"null",
")",
"{",
"_fringe",
"[",
"tidx",
"]",
"=",
"comput... | Instructs this block to recompute its fringe at the specified
location. | [
"Instructs",
"this",
"block",
"to",
"recompute",
"its",
"fringe",
"at",
"the",
"specified",
"location",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L346-L352 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.computeMemoryUsage | public void computeMemoryUsage (Map<Tile.Key,BaseTile> bases, Set<BaseTile> fringes,
Map<Tile.Key,ObjectTile> objects, long[] usage)
{
// account for our base tiles
for (int yy = 0; yy < _bounds.height; yy++) {
for (int xx = 0; xx < _bounds.width; xx++... | java | public void computeMemoryUsage (Map<Tile.Key,BaseTile> bases, Set<BaseTile> fringes,
Map<Tile.Key,ObjectTile> objects, long[] usage)
{
// account for our base tiles
for (int yy = 0; yy < _bounds.height; yy++) {
for (int xx = 0; xx < _bounds.width; xx++... | [
"public",
"void",
"computeMemoryUsage",
"(",
"Map",
"<",
"Tile",
".",
"Key",
",",
"BaseTile",
">",
"bases",
",",
"Set",
"<",
"BaseTile",
">",
"fringes",
",",
"Map",
"<",
"Tile",
".",
"Key",
",",
"ObjectTile",
">",
"objects",
",",
"long",
"[",
"]",
"u... | Computes the memory usage of the base and object tiles in this
scene block; registering counted tiles in the hash map so that
other blocks can be sure not to double count them. Base tile usage
is placed into the zeroth array element, fringe tile usage into the
first and object tile usage into the second. | [
"Computes",
"the",
"memory",
"usage",
"of",
"the",
"base",
"and",
"object",
"tiles",
"in",
"this",
"scene",
"block",
";",
"registering",
"counted",
"tiles",
"in",
"the",
"hash",
"map",
"so",
"that",
"other",
"blocks",
"can",
"be",
"sure",
"not",
"to",
"d... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L435-L483 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.index | protected final int index (int tx, int ty)
{
// if (!_bounds.contains(tx, ty)) {
// String errmsg = "Coordinates out of bounds: +" + tx + "+" + ty +
// " not in " + StringUtil.toString(_bounds);
// throw new IllegalArgumentException(errmsg);
// }
retur... | java | protected final int index (int tx, int ty)
{
// if (!_bounds.contains(tx, ty)) {
// String errmsg = "Coordinates out of bounds: +" + tx + "+" + ty +
// " not in " + StringUtil.toString(_bounds);
// throw new IllegalArgumentException(errmsg);
// }
retur... | [
"protected",
"final",
"int",
"index",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"// if (!_bounds.contains(tx, ty)) {",
"// String errmsg = \"Coordinates out of bounds: +\" + tx + \"+\" + ty +",
"// \" not in \" + StringUtil.toString(_bounds);",
"... | Returns the index into our arrays of the specified tile. | [
"Returns",
"the",
"index",
"into",
"our",
"arrays",
"of",
"the",
"specified",
"tile",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L499-L507 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.update | protected void update (Map<Integer, SceneBlock> blocks)
{
boolean recover = false;
// link up to our neighbors
for (int ii = 0; ii < DX.length; ii++) {
SceneBlock neigh = blocks.get(neighborKey(DX[ii], DY[ii]));
if (neigh != _neighbors[ii]) {
_neighbo... | java | protected void update (Map<Integer, SceneBlock> blocks)
{
boolean recover = false;
// link up to our neighbors
for (int ii = 0; ii < DX.length; ii++) {
SceneBlock neigh = blocks.get(neighborKey(DX[ii], DY[ii]));
if (neigh != _neighbors[ii]) {
_neighbo... | [
"protected",
"void",
"update",
"(",
"Map",
"<",
"Integer",
",",
"SceneBlock",
">",
"blocks",
")",
"{",
"boolean",
"recover",
"=",
"false",
";",
"// link up to our neighbors",
"for",
"(",
"int",
"ii",
"=",
"0",
";",
"ii",
"<",
"DX",
".",
"length",
";",
... | Links this block to its neighbors; informs neighboring blocks of
object coverage. | [
"Links",
"this",
"block",
"to",
"its",
"neighbors",
";",
"informs",
"neighboring",
"blocks",
"of",
"object",
"coverage",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L513-L536 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.neighborKey | protected final int neighborKey (int dx, int dy)
{
int nx = MathUtil.floorDiv(_bounds.x, _bounds.width)+dx;
int ny = MathUtil.floorDiv(_bounds.y, _bounds.height)+dy;
return MisoScenePanel.compose(nx, ny);
} | java | protected final int neighborKey (int dx, int dy)
{
int nx = MathUtil.floorDiv(_bounds.x, _bounds.width)+dx;
int ny = MathUtil.floorDiv(_bounds.y, _bounds.height)+dy;
return MisoScenePanel.compose(nx, ny);
} | [
"protected",
"final",
"int",
"neighborKey",
"(",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"int",
"nx",
"=",
"MathUtil",
".",
"floorDiv",
"(",
"_bounds",
".",
"x",
",",
"_bounds",
".",
"width",
")",
"+",
"dx",
";",
"int",
"ny",
"=",
"MathUtil",
".",... | Computes the key of our neighbor. | [
"Computes",
"the",
"key",
"of",
"our",
"neighbor",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L539-L544 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.blockKey | protected final int blockKey (int tx, int ty)
{
int bx = MathUtil.floorDiv(tx, _bounds.width);
int by = MathUtil.floorDiv(ty, _bounds.height);
return MisoScenePanel.compose(bx, by);
} | java | protected final int blockKey (int tx, int ty)
{
int bx = MathUtil.floorDiv(tx, _bounds.width);
int by = MathUtil.floorDiv(ty, _bounds.height);
return MisoScenePanel.compose(bx, by);
} | [
"protected",
"final",
"int",
"blockKey",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"int",
"bx",
"=",
"MathUtil",
".",
"floorDiv",
"(",
"tx",
",",
"_bounds",
".",
"width",
")",
";",
"int",
"by",
"=",
"MathUtil",
".",
"floorDiv",
"(",
"ty",
",",
... | Computes the key for the block that holds the specified tile. | [
"Computes",
"the",
"key",
"for",
"the",
"block",
"that",
"holds",
"the",
"specified",
"tile",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L547-L552 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/SceneBlock.java | SceneBlock.setCovered | protected void setCovered (Map<Integer, SceneBlock> blocks, SceneObject scobj)
{
int endx = scobj.info.x - scobj.tile.getBaseWidth() + 1;
int endy = scobj.info.y - scobj.tile.getBaseHeight() + 1;
for (int xx = scobj.info.x; xx >= endx; xx--) {
for (int yy = scobj.info.y; yy >= e... | java | protected void setCovered (Map<Integer, SceneBlock> blocks, SceneObject scobj)
{
int endx = scobj.info.x - scobj.tile.getBaseWidth() + 1;
int endy = scobj.info.y - scobj.tile.getBaseHeight() + 1;
for (int xx = scobj.info.x; xx >= endx; xx--) {
for (int yy = scobj.info.y; yy >= e... | [
"protected",
"void",
"setCovered",
"(",
"Map",
"<",
"Integer",
",",
"SceneBlock",
">",
"blocks",
",",
"SceneObject",
"scobj",
")",
"{",
"int",
"endx",
"=",
"scobj",
".",
"info",
".",
"x",
"-",
"scobj",
".",
"tile",
".",
"getBaseWidth",
"(",
")",
"+",
... | Sets the footprint of this object tile | [
"Sets",
"the",
"footprint",
"of",
"this",
"object",
"tile"
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/SceneBlock.java#L557-L572 | train |
groupon/robo-remote | RoboRemoteClient/src/main/com/groupon/roboremote/roboremoteclient/Solo.java | Solo.clearEditText | public static void clearEditText(String editText) throws Exception{
Client.getInstance().map(Constants.ROBOTIUM_SOLO, "clearEditText", editText);
} | java | public static void clearEditText(String editText) throws Exception{
Client.getInstance().map(Constants.ROBOTIUM_SOLO, "clearEditText", editText);
} | [
"public",
"static",
"void",
"clearEditText",
"(",
"String",
"editText",
")",
"throws",
"Exception",
"{",
"Client",
".",
"getInstance",
"(",
")",
".",
"map",
"(",
"Constants",
".",
"ROBOTIUM_SOLO",
",",
"\"clearEditText\"",
",",
"editText",
")",
";",
"}"
] | Clears edit text for the specified widget
@param editText - Identifier for the correct widget(ex: android.widget.EditText@409af0b0) - Can be found using getViews | [
"Clears",
"edit",
"text",
"for",
"the",
"specified",
"widget"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClient/src/main/com/groupon/roboremote/roboremoteclient/Solo.java#L59-L61 | train |
groupon/robo-remote | RoboRemoteClient/src/main/com/groupon/roboremote/roboremoteclient/Solo.java | Solo.getLocationOnScreen | public static int[] getLocationOnScreen(String view) throws Exception {
int[] location = new int[2];
JSONArray results = Client.getInstance().map(Constants.ROBOTIUM_SOLO, "getLocationOnScreen", view);
location[0] = results.getInt(0);
location[1] = results.getInt(1);
ret... | java | public static int[] getLocationOnScreen(String view) throws Exception {
int[] location = new int[2];
JSONArray results = Client.getInstance().map(Constants.ROBOTIUM_SOLO, "getLocationOnScreen", view);
location[0] = results.getInt(0);
location[1] = results.getInt(1);
ret... | [
"public",
"static",
"int",
"[",
"]",
"getLocationOnScreen",
"(",
"String",
"view",
")",
"throws",
"Exception",
"{",
"int",
"[",
"]",
"location",
"=",
"new",
"int",
"[",
"2",
"]",
";",
"JSONArray",
"results",
"=",
"Client",
".",
"getInstance",
"(",
")",
... | Get the location of a view on the screen
@param view - string reference to the view
@return - int array(x, y) of the view location
@throws Exception | [
"Get",
"the",
"location",
"of",
"a",
"view",
"on",
"the",
"screen"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClient/src/main/com/groupon/roboremote/roboremoteclient/Solo.java#L813-L821 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/TileOpApplicator.java | TileOpApplicator.applyToTiles | public void applyToTiles (Rectangle region, TileOp op)
{
// determine which tiles intersect this region: this is going to
// be nearly incomprehensible without some sort of diagram; i'll
// do what i can to comment it, but you'll want to print out a
// scene diagram (docs/miso/scene.... | java | public void applyToTiles (Rectangle region, TileOp op)
{
// determine which tiles intersect this region: this is going to
// be nearly incomprehensible without some sort of diagram; i'll
// do what i can to comment it, but you'll want to print out a
// scene diagram (docs/miso/scene.... | [
"public",
"void",
"applyToTiles",
"(",
"Rectangle",
"region",
",",
"TileOp",
"op",
")",
"{",
"// determine which tiles intersect this region: this is going to",
"// be nearly incomprehensible without some sort of diagram; i'll",
"// do what i can to comment it, but you'll want to print out... | Applies the supplied tile operation to all tiles that intersect the supplied screen
rectangle. | [
"Applies",
"the",
"supplied",
"tile",
"operation",
"to",
"all",
"tiles",
"that",
"intersect",
"the",
"supplied",
"screen",
"rectangle",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/TileOpApplicator.java#L44-L123 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagSupport.java | TagSupport.findAncestorWithClass | public static final Tag findAncestorWithClass(Tag from, Class klass) {
boolean isInterface = false;
if (from == null ||
klass == null ||
(!Tag.class.isAssignableFrom(klass) &&
!(isInterface = klass.isInterface()))) {
return null;
}
for (;;) {
Tag tag = from.getParent();
if (tag == ... | java | public static final Tag findAncestorWithClass(Tag from, Class klass) {
boolean isInterface = false;
if (from == null ||
klass == null ||
(!Tag.class.isAssignableFrom(klass) &&
!(isInterface = klass.isInterface()))) {
return null;
}
for (;;) {
Tag tag = from.getParent();
if (tag == ... | [
"public",
"static",
"final",
"Tag",
"findAncestorWithClass",
"(",
"Tag",
"from",
",",
"Class",
"klass",
")",
"{",
"boolean",
"isInterface",
"=",
"false",
";",
"if",
"(",
"from",
"==",
"null",
"||",
"klass",
"==",
"null",
"||",
"(",
"!",
"Tag",
".",
"cl... | Find the instance of a given class type that is closest to a given
instance.
This method uses the getParent method from the Tag
interface.
This method is used for coordination among cooperating tags.
<p>
The current version of the specification only provides one formal
way of indicating the observable type of a tag ha... | [
"Find",
"the",
"instance",
"of",
"a",
"given",
"class",
"type",
"that",
"is",
"closest",
"to",
"a",
"given",
"instance",
".",
"This",
"method",
"uses",
"the",
"getParent",
"method",
"from",
"the",
"Tag",
"interface",
".",
"This",
"method",
"is",
"used",
... | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagSupport.java#L113-L136 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagSupport.java | TagSupport.release | public void release() {
parent = null;
id = null;
if( values != null ) {
values.clear();
}
values = null;
} | java | public void release() {
parent = null;
id = null;
if( values != null ) {
values.clear();
}
values = null;
} | [
"public",
"void",
"release",
"(",
")",
"{",
"parent",
"=",
"null",
";",
"id",
"=",
"null",
";",
"if",
"(",
"values",
"!=",
"null",
")",
"{",
"values",
".",
"clear",
"(",
")",
";",
"}",
"values",
"=",
"null",
";",
"}"
] | Release state.
@see Tag#release() | [
"Release",
"state",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagSupport.java#L198-L205 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagSupport.java | TagSupport.setValue | public void setValue(String k, Object o) {
if (values == null) {
values = new Hashtable<String, Object>();
}
values.put(k, o);
} | java | public void setValue(String k, Object o) {
if (values == null) {
values = new Hashtable<String, Object>();
}
values.put(k, o);
} | [
"public",
"void",
"setValue",
"(",
"String",
"k",
",",
"Object",
"o",
")",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"values",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"}",
"values",
".",
"put",
"(",
"k",... | Associate a value with a String key.
@param k The key String.
@param o The value to associate. | [
"Associate",
"a",
"value",
"with",
"a",
"String",
"key",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagSupport.java#L267-L272 | train |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagSupport.java | TagSupport.getValue | public Object getValue(String k) {
if (values == null) {
return null;
} else {
return values.get(k);
}
} | java | public Object getValue(String k) {
if (values == null) {
return null;
} else {
return values.get(k);
}
} | [
"public",
"Object",
"getValue",
"(",
"String",
"k",
")",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"values",
".",
"get",
"(",
"k",
")",
";",
"}",
"}"
] | Get a the value associated with a key.
@param k The string key.
@return The value associated with the key, or null. | [
"Get",
"a",
"the",
"value",
"associated",
"with",
"a",
"key",
"."
] | da53166619f33a5134dc3315a3264990cc1f541f | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagSupport.java#L281-L287 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getDirection | public static int getDirection (
MisoSceneMetrics metrics, int ax, int ay, int bx, int by)
{
Point afpos = new Point(), bfpos = new Point();
// convert screen coordinates to full coordinates to get both
// tile coordinates and fine coordinates
screenToFull(metrics, ax, ay, a... | java | public static int getDirection (
MisoSceneMetrics metrics, int ax, int ay, int bx, int by)
{
Point afpos = new Point(), bfpos = new Point();
// convert screen coordinates to full coordinates to get both
// tile coordinates and fine coordinates
screenToFull(metrics, ax, ay, a... | [
"public",
"static",
"int",
"getDirection",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"ax",
",",
"int",
"ay",
",",
"int",
"bx",
",",
"int",
"by",
")",
"{",
"Point",
"afpos",
"=",
"new",
"Point",
"(",
")",
",",
"bfpos",
"=",
"new",
"Point",
"(",
... | Given two points in screen pixel coordinates, return the
compass direction that point B lies in from point A from an
isometric perspective.
@param ax the x-position of point A.
@param ay the y-position of point A.
@param bx the x-position of point B.
@param by the y-position of point B.
@return the direction specifie... | [
"Given",
"two",
"points",
"in",
"screen",
"pixel",
"coordinates",
"return",
"the",
"compass",
"direction",
"that",
"point",
"B",
"lies",
"in",
"from",
"point",
"A",
"from",
"an",
"isometric",
"perspective",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L51-L89 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getProjectedIsoDirection | public static int getProjectedIsoDirection (int ax, int ay, int bx, int by)
{
return toIsoDirection(DirectionUtil.getDirection(ax, ay, bx, by));
} | java | public static int getProjectedIsoDirection (int ax, int ay, int bx, int by)
{
return toIsoDirection(DirectionUtil.getDirection(ax, ay, bx, by));
} | [
"public",
"static",
"int",
"getProjectedIsoDirection",
"(",
"int",
"ax",
",",
"int",
"ay",
",",
"int",
"bx",
",",
"int",
"by",
")",
"{",
"return",
"toIsoDirection",
"(",
"DirectionUtil",
".",
"getDirection",
"(",
"ax",
",",
"ay",
",",
"bx",
",",
"by",
... | Given two points in screen coordinates, return the isometrically
projected compass direction that point B lies in from point A.
@param ax the x-position of point A.
@param ay the y-position of point A.
@param bx the x-position of point B.
@param by the y-position of point B.
@return the direction specified as one of ... | [
"Given",
"two",
"points",
"in",
"screen",
"coordinates",
"return",
"the",
"isometrically",
"projected",
"compass",
"direction",
"that",
"point",
"B",
"lies",
"in",
"from",
"point",
"A",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L149-L152 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.screenToTile | public static Point screenToTile (
MisoSceneMetrics metrics, int sx, int sy, Point tpos)
{
// determine the upper-left of the quadrant that contains our point
int zx = (int)Math.floor((float)sx / metrics.tilewid);
int zy = (int)Math.floor((float)sy / metrics.tilehei);
// the... | java | public static Point screenToTile (
MisoSceneMetrics metrics, int sx, int sy, Point tpos)
{
// determine the upper-left of the quadrant that contains our point
int zx = (int)Math.floor((float)sx / metrics.tilewid);
int zy = (int)Math.floor((float)sy / metrics.tilehei);
// the... | [
"public",
"static",
"Point",
"screenToTile",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"sx",
",",
"int",
"sy",
",",
"Point",
"tpos",
")",
"{",
"// determine the upper-left of the quadrant that contains our point",
"int",
"zx",
"=",
"(",
"int",
")",
"Math",
"... | Convert the given screen-based pixel coordinates to their
corresponding tile-based coordinates. Converted coordinates
are placed in the given point object.
@param sx the screen x-position pixel coordinate.
@param sy the screen y-position pixel coordinate.
@param tpos the point object to place coordinates in.
@return... | [
"Convert",
"the",
"given",
"screen",
"-",
"based",
"pixel",
"coordinates",
"to",
"their",
"corresponding",
"tile",
"-",
"based",
"coordinates",
".",
"Converted",
"coordinates",
"are",
"placed",
"in",
"the",
"given",
"point",
"object",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L197-L227 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.tileToScreen | public static Point tileToScreen (
MisoSceneMetrics metrics, int x, int y, Point spos)
{
spos.x = (x - y - 1) * metrics.tilehwid;
spos.y = (x + y) * metrics.tilehhei;
return spos;
} | java | public static Point tileToScreen (
MisoSceneMetrics metrics, int x, int y, Point spos)
{
spos.x = (x - y - 1) * metrics.tilehwid;
spos.y = (x + y) * metrics.tilehhei;
return spos;
} | [
"public",
"static",
"Point",
"tileToScreen",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"x",
",",
"int",
"y",
",",
"Point",
"spos",
")",
"{",
"spos",
".",
"x",
"=",
"(",
"x",
"-",
"y",
"-",
"1",
")",
"*",
"metrics",
".",
"tilehwid",
";",
"spos... | Convert the given tile-based coordinates to their corresponding
screen-based pixel coordinates. The screen coordinate for a tile is
the upper-left coordinate of the rectangle that bounds the tile
polygon. Converted coordinates are placed in the given point
object.
@param x the tile x-position coordinate.
@param y the ... | [
"Convert",
"the",
"given",
"tile",
"-",
"based",
"coordinates",
"to",
"their",
"corresponding",
"screen",
"-",
"based",
"pixel",
"coordinates",
".",
"The",
"screen",
"coordinate",
"for",
"a",
"tile",
"is",
"the",
"upper",
"-",
"left",
"coordinate",
"of",
"th... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L243-L249 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.fineToPixel | public static void fineToPixel (
MisoSceneMetrics metrics, int x, int y, Point ppos)
{
ppos.x = metrics.tilehwid + ((x - y) * metrics.finehwid);
ppos.y = (x + y) * metrics.finehhei;
} | java | public static void fineToPixel (
MisoSceneMetrics metrics, int x, int y, Point ppos)
{
ppos.x = metrics.tilehwid + ((x - y) * metrics.finehwid);
ppos.y = (x + y) * metrics.finehhei;
} | [
"public",
"static",
"void",
"fineToPixel",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"x",
",",
"int",
"y",
",",
"Point",
"ppos",
")",
"{",
"ppos",
".",
"x",
"=",
"metrics",
".",
"tilehwid",
"+",
"(",
"(",
"x",
"-",
"y",
")",
"*",
"metrics",
"... | Convert the given fine coordinates to pixel coordinates within
the containing tile. Converted coordinates are placed in the
given point object.
@param x the x-position fine coordinate.
@param y the y-position fine coordinate.
@param ppos the point object to place coordinates in. | [
"Convert",
"the",
"given",
"fine",
"coordinates",
"to",
"pixel",
"coordinates",
"within",
"the",
"containing",
"tile",
".",
"Converted",
"coordinates",
"are",
"placed",
"in",
"the",
"given",
"point",
"object",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L260-L265 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.pixelToFine | public static void pixelToFine (
MisoSceneMetrics metrics, int x, int y, Point fpos)
{
// calculate line parallel to the y-axis (from the given
// x/y-pos to the x-axis)
float bY = y - (metrics.fineSlopeY * x);
// determine intersection of x- and y-axis lines
int cro... | java | public static void pixelToFine (
MisoSceneMetrics metrics, int x, int y, Point fpos)
{
// calculate line parallel to the y-axis (from the given
// x/y-pos to the x-axis)
float bY = y - (metrics.fineSlopeY * x);
// determine intersection of x- and y-axis lines
int cro... | [
"public",
"static",
"void",
"pixelToFine",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"x",
",",
"int",
"y",
",",
"Point",
"fpos",
")",
"{",
"// calculate line parallel to the y-axis (from the given",
"// x/y-pos to the x-axis)",
"float",
"bY",
"=",
"y",
"-",
"(... | Convert the given pixel coordinates, whose origin is at the
top-left of a tile's containing rectangle, to fine coordinates
within that tile. Converted coordinates are placed in the
given point object.
@param x the x-position pixel coordinate.
@param y the y-position pixel coordinate.
@param fpos the point object to p... | [
"Convert",
"the",
"given",
"pixel",
"coordinates",
"whose",
"origin",
"is",
"at",
"the",
"top",
"-",
"left",
"of",
"a",
"tile",
"s",
"containing",
"rectangle",
"to",
"fine",
"coordinates",
"within",
"that",
"tile",
".",
"Converted",
"coordinates",
"are",
"pl... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L277-L303 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.screenToFull | public static Point screenToFull (
MisoSceneMetrics metrics, int sx, int sy, Point fpos)
{
// get the tile coordinates
Point tpos = new Point();
screenToTile(metrics, sx, sy, tpos);
// get the screen coordinates for the containing tile
Point spos = tileToScreen(metri... | java | public static Point screenToFull (
MisoSceneMetrics metrics, int sx, int sy, Point fpos)
{
// get the tile coordinates
Point tpos = new Point();
screenToTile(metrics, sx, sy, tpos);
// get the screen coordinates for the containing tile
Point spos = tileToScreen(metri... | [
"public",
"static",
"Point",
"screenToFull",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"sx",
",",
"int",
"sy",
",",
"Point",
"fpos",
")",
"{",
"// get the tile coordinates",
"Point",
"tpos",
"=",
"new",
"Point",
"(",
")",
";",
"screenToTile",
"(",
"met... | Convert the given screen-based pixel coordinates to full
scene-based coordinates that include both the tile coordinates
and the fine coordinates in each dimension. Converted
coordinates are placed in the given point object.
@param sx the screen x-position pixel coordinate.
@param sy the screen y-position pixel coordi... | [
"Convert",
"the",
"given",
"screen",
"-",
"based",
"pixel",
"coordinates",
"to",
"full",
"scene",
"-",
"based",
"coordinates",
"that",
"include",
"both",
"the",
"tile",
"coordinates",
"and",
"the",
"fine",
"coordinates",
"in",
"each",
"dimension",
".",
"Conver... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L317-L342 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.fullToScreen | public static Point fullToScreen (
MisoSceneMetrics metrics, int x, int y, Point spos)
{
// get the tile screen position
int tx = fullToTile(x), ty = fullToTile(y);
Point tspos = tileToScreen(metrics, tx, ty, new Point());
// get the pixel position of the fine coords within ... | java | public static Point fullToScreen (
MisoSceneMetrics metrics, int x, int y, Point spos)
{
// get the tile screen position
int tx = fullToTile(x), ty = fullToTile(y);
Point tspos = tileToScreen(metrics, tx, ty, new Point());
// get the pixel position of the fine coords within ... | [
"public",
"static",
"Point",
"fullToScreen",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"x",
",",
"int",
"y",
",",
"Point",
"spos",
")",
"{",
"// get the tile screen position",
"int",
"tx",
"=",
"fullToTile",
"(",
"x",
")",
",",
"ty",
"=",
"fullToTile",... | Convert the given full coordinates to screen-based pixel
coordinates. Converted coordinates are placed in the given
point object.
@param x the x-position full coordinate.
@param y the y-position full coordinate.
@param spos the point object to place coordinates in.
@return the point passed in to receive the coordina... | [
"Convert",
"the",
"given",
"full",
"coordinates",
"to",
"screen",
"-",
"based",
"pixel",
"coordinates",
".",
"Converted",
"coordinates",
"are",
"placed",
"in",
"the",
"given",
"point",
"object",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L355-L372 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getTilePolygon | public static Polygon getTilePolygon (
MisoSceneMetrics metrics, int x, int y)
{
return getFootprintPolygon(metrics, x, y, 1, 1);
} | java | public static Polygon getTilePolygon (
MisoSceneMetrics metrics, int x, int y)
{
return getFootprintPolygon(metrics, x, y, 1, 1);
} | [
"public",
"static",
"Polygon",
"getTilePolygon",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"getFootprintPolygon",
"(",
"metrics",
",",
"x",
",",
"y",
",",
"1",
",",
"1",
")",
";",
"}"
] | Return a polygon framing the specified tile.
@param x the tile x-position coordinate.
@param y the tile y-position coordinate. | [
"Return",
"a",
"polygon",
"framing",
"the",
"specified",
"tile",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L407-L411 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getMultiTilePolygon | public static Polygon getMultiTilePolygon (MisoSceneMetrics metrics,
Point sp1, Point sp2)
{
int x = Math.min(sp1.x, sp2.x), y = Math.min(sp1.y, sp2.y);
int width = Math.abs(sp1.x-sp2.x)+1, height = Math.abs(sp1.y-sp2.y)+1;
return getFootprintPo... | java | public static Polygon getMultiTilePolygon (MisoSceneMetrics metrics,
Point sp1, Point sp2)
{
int x = Math.min(sp1.x, sp2.x), y = Math.min(sp1.y, sp2.y);
int width = Math.abs(sp1.x-sp2.x)+1, height = Math.abs(sp1.y-sp2.y)+1;
return getFootprintPo... | [
"public",
"static",
"Polygon",
"getMultiTilePolygon",
"(",
"MisoSceneMetrics",
"metrics",
",",
"Point",
"sp1",
",",
"Point",
"sp2",
")",
"{",
"int",
"x",
"=",
"Math",
".",
"min",
"(",
"sp1",
".",
"x",
",",
"sp2",
".",
"x",
")",
",",
"y",
"=",
"Math",... | Return a screen-coordinates polygon framing the two specified
tile-coordinate points. | [
"Return",
"a",
"screen",
"-",
"coordinates",
"polygon",
"framing",
"the",
"two",
"specified",
"tile",
"-",
"coordinate",
"points",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L417-L423 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getFootprintPolygon | public static Polygon getFootprintPolygon (
MisoSceneMetrics metrics, int x, int y, int width, int height)
{
SmartPolygon footprint = new SmartPolygon();
Point tpos = MisoUtil.tileToScreen(metrics, x, y, new Point());
// start with top-center point
int rx = tpos.x + metrics.... | java | public static Polygon getFootprintPolygon (
MisoSceneMetrics metrics, int x, int y, int width, int height)
{
SmartPolygon footprint = new SmartPolygon();
Point tpos = MisoUtil.tileToScreen(metrics, x, y, new Point());
// start with top-center point
int rx = tpos.x + metrics.... | [
"public",
"static",
"Polygon",
"getFootprintPolygon",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"SmartPolygon",
"footprint",
"=",
"new",
"SmartPolygon",
"(",
")",
";",
"Point",
... | Returns a polygon framing the specified scene footprint.
@param x the x tile coordinate of the "upper-left" of the footprint.
@param y the y tile coordinate of the "upper-left" of the footprint.
@param width the width in tiles of the footprint.
@param height the height in tiles of the footprint. | [
"Returns",
"a",
"polygon",
"framing",
"the",
"specified",
"scene",
"footprint",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L433-L460 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.tilePlusFineToFull | public static Point tilePlusFineToFull (MisoSceneMetrics metrics,
int tileX, int tileY,
int fineX, int fineY,
Point full)
{
int dtx = fineX / metrics.finegran;
int dty ... | java | public static Point tilePlusFineToFull (MisoSceneMetrics metrics,
int tileX, int tileY,
int fineX, int fineY,
Point full)
{
int dtx = fineX / metrics.finegran;
int dty ... | [
"public",
"static",
"Point",
"tilePlusFineToFull",
"(",
"MisoSceneMetrics",
"metrics",
",",
"int",
"tileX",
",",
"int",
"tileY",
",",
"int",
"fineX",
",",
"int",
"fineY",
",",
"Point",
"full",
")",
"{",
"int",
"dtx",
"=",
"fineX",
"/",
"metrics",
".",
"f... | Adds the supplied fine coordinates to the supplied tile coordinates
to compute full coordinates.
@return the point object supplied as <code>full</code>. | [
"Adds",
"the",
"supplied",
"fine",
"coordinates",
"to",
"the",
"supplied",
"tile",
"coordinates",
"to",
"compute",
"full",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L468-L489 | train |
groupon/robo-remote | RoboRemoteClient/src/main/com/groupon/roboremote/roboremoteclient/Client.java | Client.getInstance | public static Client getInstance() {
if(instance == null) {
instance = new Client();
}
instance.API_PORT = PortSingleton.getInstance().getPort();
return instance;
} | java | public static Client getInstance() {
if(instance == null) {
instance = new Client();
}
instance.API_PORT = PortSingleton.getInstance().getPort();
return instance;
} | [
"public",
"static",
"Client",
"getInstance",
"(",
")",
"{",
"if",
"(",
"instance",
"==",
"null",
")",
"{",
"instance",
"=",
"new",
"Client",
"(",
")",
";",
"}",
"instance",
".",
"API_PORT",
"=",
"PortSingleton",
".",
"getInstance",
"(",
")",
".",
"getP... | Gets a client instance on the roboremote port
@return | [
"Gets",
"a",
"client",
"instance",
"on",
"the",
"roboremote",
"port"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteClient/src/main/com/groupon/roboremote/roboremoteclient/Client.java#L42-L49 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.clearBubbles | protected void clearBubbles (boolean all)
{
for (Iterator<BubbleGlyph> iter = _bubbles.iterator(); iter.hasNext();) {
ChatGlyph rec = iter.next();
if (all || isPlaceOrientedType(rec.getType())) {
_target.abortAnimation(rec);
iter.remove();
... | java | protected void clearBubbles (boolean all)
{
for (Iterator<BubbleGlyph> iter = _bubbles.iterator(); iter.hasNext();) {
ChatGlyph rec = iter.next();
if (all || isPlaceOrientedType(rec.getType())) {
_target.abortAnimation(rec);
iter.remove();
... | [
"protected",
"void",
"clearBubbles",
"(",
"boolean",
"all",
")",
"{",
"for",
"(",
"Iterator",
"<",
"BubbleGlyph",
">",
"iter",
"=",
"_bubbles",
".",
"iterator",
"(",
")",
";",
"iter",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"ChatGlyph",
"rec",
"=",
... | Clear chat bubbles, either all of them or just the place-oriented ones. | [
"Clear",
"chat",
"bubbles",
"either",
"all",
"of",
"them",
"or",
"just",
"the",
"place",
"-",
"oriented",
"ones",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L143-L152 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.splitNear | protected String splitNear (String text, int pos)
{
if (pos >= text.length()) {
return text;
}
int forward = text.indexOf(' ', pos);
int backward = text.lastIndexOf(' ', pos);
int newpos = (Math.abs(pos - forward) < Math.abs(pos - backward)) ? forward : backward... | java | protected String splitNear (String text, int pos)
{
if (pos >= text.length()) {
return text;
}
int forward = text.indexOf(' ', pos);
int backward = text.lastIndexOf(' ', pos);
int newpos = (Math.abs(pos - forward) < Math.abs(pos - backward)) ? forward : backward... | [
"protected",
"String",
"splitNear",
"(",
"String",
"text",
",",
"int",
"pos",
")",
"{",
"if",
"(",
"pos",
">=",
"text",
".",
"length",
"(",
")",
")",
"{",
"return",
"text",
";",
"}",
"int",
"forward",
"=",
"text",
".",
"indexOf",
"(",
"'",
"'",
"... | Split the text at the space nearest the specified location. | [
"Split",
"the",
"text",
"at",
"the",
"space",
"nearest",
"the",
"specified",
"location",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L242-L262 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.adjustLabel | protected Point adjustLabel (int type, Point labelpos)
{
switch (ChatLogic.modeOf(type)) {
case ChatLogic.SHOUT:
case ChatLogic.EMOTE:
case ChatLogic.THINK:
labelpos.translate(PAD * 2, PAD * 2);
break;
default:
labelpos.translate(PAD, PAD)... | java | protected Point adjustLabel (int type, Point labelpos)
{
switch (ChatLogic.modeOf(type)) {
case ChatLogic.SHOUT:
case ChatLogic.EMOTE:
case ChatLogic.THINK:
labelpos.translate(PAD * 2, PAD * 2);
break;
default:
labelpos.translate(PAD, PAD)... | [
"protected",
"Point",
"adjustLabel",
"(",
"int",
"type",
",",
"Point",
"labelpos",
")",
"{",
"switch",
"(",
"ChatLogic",
".",
"modeOf",
"(",
"type",
")",
")",
"{",
"case",
"ChatLogic",
".",
"SHOUT",
":",
"case",
"ChatLogic",
".",
"EMOTE",
":",
"case",
... | Position the label based on the type. | [
"Position",
"the",
"label",
"based",
"on",
"the",
"type",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L385-L400 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.getRectWithOlds | protected Rectangle getRectWithOlds (Rectangle r, List<BubbleGlyph> oldbubs)
{
int n = oldbubs.size();
// if no old bubs, just return the new one.
if (n == 0) {
return r;
}
// otherwise, encompass all the oldies
Rectangle bigR = null;
for (int ii=... | java | protected Rectangle getRectWithOlds (Rectangle r, List<BubbleGlyph> oldbubs)
{
int n = oldbubs.size();
// if no old bubs, just return the new one.
if (n == 0) {
return r;
}
// otherwise, encompass all the oldies
Rectangle bigR = null;
for (int ii=... | [
"protected",
"Rectangle",
"getRectWithOlds",
"(",
"Rectangle",
"r",
",",
"List",
"<",
"BubbleGlyph",
">",
"oldbubs",
")",
"{",
"int",
"n",
"=",
"oldbubs",
".",
"size",
"(",
")",
";",
"// if no old bubs, just return the new one.",
"if",
"(",
"n",
"==",
"0",
"... | Get a rectangle based on the old bubbles, but with room for the new one. | [
"Get",
"a",
"rectangle",
"based",
"on",
"the",
"old",
"bubbles",
"but",
"with",
"room",
"for",
"the",
"new",
"one",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L439-L463 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.getTail | protected Shape getTail (int type, Rectangle r, Point speaker)
{
// emotes don't actually have tails
if (ChatLogic.modeOf(type) == ChatLogic.EMOTE) {
return new Area(); // empty shape
}
int midx = r.x + (r.width / 2);
int midy = r.y + (r.height / 2);
// ... | java | protected Shape getTail (int type, Rectangle r, Point speaker)
{
// emotes don't actually have tails
if (ChatLogic.modeOf(type) == ChatLogic.EMOTE) {
return new Area(); // empty shape
}
int midx = r.x + (r.width / 2);
int midy = r.y + (r.height / 2);
// ... | [
"protected",
"Shape",
"getTail",
"(",
"int",
"type",
",",
"Rectangle",
"r",
",",
"Point",
"speaker",
")",
"{",
"// emotes don't actually have tails",
"if",
"(",
"ChatLogic",
".",
"modeOf",
"(",
"type",
")",
"==",
"ChatLogic",
".",
"EMOTE",
")",
"{",
"return"... | Create a tail to the specified rectangular area from the speaker point. | [
"Create",
"a",
"tail",
"to",
"the",
"specified",
"rectangular",
"area",
"from",
"the",
"speaker",
"point",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L625-L684 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.getAndExpireBubbles | protected List<BubbleGlyph> getAndExpireBubbles (Name speaker)
{
int num = _bubbles.size();
// first, get all the old bubbles belonging to the user
List<BubbleGlyph> oldbubs = Lists.newArrayList();
if (speaker != null) {
for (int ii=0; ii < num; ii++) {
B... | java | protected List<BubbleGlyph> getAndExpireBubbles (Name speaker)
{
int num = _bubbles.size();
// first, get all the old bubbles belonging to the user
List<BubbleGlyph> oldbubs = Lists.newArrayList();
if (speaker != null) {
for (int ii=0; ii < num; ii++) {
B... | [
"protected",
"List",
"<",
"BubbleGlyph",
">",
"getAndExpireBubbles",
"(",
"Name",
"speaker",
")",
"{",
"int",
"num",
"=",
"_bubbles",
".",
"size",
"(",
")",
";",
"// first, get all the old bubbles belonging to the user",
"List",
"<",
"BubbleGlyph",
">",
"oldbubs",
... | Expire a bubble, if necessary, and return the old bubbles for the specified speaker. | [
"Expire",
"a",
"bubble",
"if",
"necessary",
"and",
"return",
"the",
"old",
"bubbles",
"for",
"the",
"specified",
"speaker",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L689-L717 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.layoutText | protected Label layoutText (Graphics2D gfx, Font font, String text)
{
Label label = _logic.createLabel(text);
label.setFont(font);
// layout in one line
Rectangle vbounds = _target.getViewBounds();
label.setTargetWidth(vbounds.width - PAD * 2);
label.layout(gfx);
... | java | protected Label layoutText (Graphics2D gfx, Font font, String text)
{
Label label = _logic.createLabel(text);
label.setFont(font);
// layout in one line
Rectangle vbounds = _target.getViewBounds();
label.setTargetWidth(vbounds.width - PAD * 2);
label.layout(gfx);
... | [
"protected",
"Label",
"layoutText",
"(",
"Graphics2D",
"gfx",
",",
"Font",
"font",
",",
"String",
"text",
")",
"{",
"Label",
"label",
"=",
"_logic",
".",
"createLabel",
"(",
"text",
")",
";",
"label",
".",
"setFont",
"(",
"font",
")",
";",
"// layout in ... | Get a label formatted as close to the golden ratio as possible for the specified text and
given the standard padding we use on all bubbles. | [
"Get",
"a",
"label",
"formatted",
"as",
"close",
"to",
"the",
"golden",
"ratio",
"as",
"possible",
"for",
"the",
"specified",
"text",
"and",
"given",
"the",
"standard",
"padding",
"we",
"use",
"on",
"all",
"bubbles",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L730-L751 | train |
threerings/nenya | core/src/main/java/com/threerings/chat/ComicChatOverlay.java | ComicChatOverlay.getAvoidList | protected List<Shape> getAvoidList (Name speaker)
{
List<Shape> avoid = Lists.newArrayList();
if (_provider == null) {
return avoid;
}
// for now we don't accept low-priority avoids
_provider.getAvoidables(speaker, avoid, null);
// add the existing chatb... | java | protected List<Shape> getAvoidList (Name speaker)
{
List<Shape> avoid = Lists.newArrayList();
if (_provider == null) {
return avoid;
}
// for now we don't accept low-priority avoids
_provider.getAvoidables(speaker, avoid, null);
// add the existing chatb... | [
"protected",
"List",
"<",
"Shape",
">",
"getAvoidList",
"(",
"Name",
"speaker",
")",
"{",
"List",
"<",
"Shape",
">",
"avoid",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"if",
"(",
"_provider",
"==",
"null",
")",
"{",
"return",
"avoid",
";",
"}... | Return a list of rectangular areas that we should avoid while laying out a bubble for the
specified speaker. | [
"Return",
"a",
"list",
"of",
"rectangular",
"areas",
"that",
"we",
"should",
"avoid",
"while",
"laying",
"out",
"a",
"bubble",
"for",
"the",
"specified",
"speaker",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/chat/ComicChatOverlay.java#L781-L799 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/FileStream.java | FileStream.queueFile | public void queueFile (File file, boolean loop)
{
try {
queueURL(file.toURI().toURL(), loop);
} catch (MalformedURLException e) {
log.warning("Invalid file url.", "file", file, e);
}
} | java | public void queueFile (File file, boolean loop)
{
try {
queueURL(file.toURI().toURL(), loop);
} catch (MalformedURLException e) {
log.warning("Invalid file url.", "file", file, e);
}
} | [
"public",
"void",
"queueFile",
"(",
"File",
"file",
",",
"boolean",
"loop",
")",
"{",
"try",
"{",
"queueURL",
"(",
"file",
".",
"toURI",
"(",
")",
".",
"toURL",
"(",
")",
",",
"loop",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
... | Adds a file to the queue of files to play.
@param loop if true, play this file in a loop if there's nothing else
on the queue | [
"Adds",
"a",
"file",
"to",
"the",
"queue",
"of",
"files",
"to",
"play",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/FileStream.java#L52-L59 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/CharacterManager.java | CharacterManager.getActionFrames | public ActionFrames getActionFrames (
CharacterDescriptor descrip, String action)
throws NoSuchComponentException
{
Tuple<CharacterDescriptor, String> key = new Tuple<CharacterDescriptor, String>(descrip, action);
ActionFrames frames = _actionFrames.get(key);
if (frames == nu... | java | public ActionFrames getActionFrames (
CharacterDescriptor descrip, String action)
throws NoSuchComponentException
{
Tuple<CharacterDescriptor, String> key = new Tuple<CharacterDescriptor, String>(descrip, action);
ActionFrames frames = _actionFrames.get(key);
if (frames == nu... | [
"public",
"ActionFrames",
"getActionFrames",
"(",
"CharacterDescriptor",
"descrip",
",",
"String",
"action",
")",
"throws",
"NoSuchComponentException",
"{",
"Tuple",
"<",
"CharacterDescriptor",
",",
"String",
">",
"key",
"=",
"new",
"Tuple",
"<",
"CharacterDescriptor"... | Obtains the composited animation frames for the specified action for a
character with the specified descriptor. The resulting composited
animation will be cached.
@exception NoSuchComponentException thrown if any of the components in
the supplied descriptor do not exist.
@exception IllegalArgumentException thrown if a... | [
"Obtains",
"the",
"composited",
"animation",
"frames",
"for",
"the",
"specified",
"action",
"for",
"a",
"character",
"with",
"the",
"specified",
"descriptor",
".",
"The",
"resulting",
"composited",
"animation",
"will",
"be",
"cached",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterManager.java#L169-L192 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/CharacterManager.java | CharacterManager.resolveActionSequence | public void resolveActionSequence (CharacterDescriptor desc, String action)
{
try {
if (getActionFrames(desc, action) == null) {
log.warning("Failed to resolve action sequence " +
"[desc=" + desc + ", action=" + action + "].");
}
}... | java | public void resolveActionSequence (CharacterDescriptor desc, String action)
{
try {
if (getActionFrames(desc, action) == null) {
log.warning("Failed to resolve action sequence " +
"[desc=" + desc + ", action=" + action + "].");
}
}... | [
"public",
"void",
"resolveActionSequence",
"(",
"CharacterDescriptor",
"desc",
",",
"String",
"action",
")",
"{",
"try",
"{",
"if",
"(",
"getActionFrames",
"(",
"desc",
",",
"action",
")",
"==",
"null",
")",
"{",
"log",
".",
"warning",
"(",
"\"Failed to reso... | Informs the character manager that the action sequence for the
given character descriptor is likely to be needed in the near
future and so any efforts that can be made to load it into the
action sequence cache in advance should be undertaken.
<p> This will eventually be revamped to spiffily load action
sequences in th... | [
"Informs",
"the",
"character",
"manager",
"that",
"the",
"action",
"sequence",
"for",
"the",
"given",
"character",
"descriptor",
"is",
"likely",
"to",
"be",
"needed",
"in",
"the",
"near",
"future",
"and",
"so",
"any",
"efforts",
"that",
"can",
"be",
"made",
... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterManager.java#L203-L215 | train |
threerings/nenya | core/src/main/java/com/threerings/cast/CharacterManager.java | CharacterManager.getEstimatedCacheMemoryUsage | protected long getEstimatedCacheMemoryUsage ()
{
long size = 0;
Iterator<CompositedMultiFrameImage> iter = _frameCache.values().iterator();
while (iter.hasNext()) {
size += iter.next().getEstimatedMemoryUsage();
}
return size;
} | java | protected long getEstimatedCacheMemoryUsage ()
{
long size = 0;
Iterator<CompositedMultiFrameImage> iter = _frameCache.values().iterator();
while (iter.hasNext()) {
size += iter.next().getEstimatedMemoryUsage();
}
return size;
} | [
"protected",
"long",
"getEstimatedCacheMemoryUsage",
"(",
")",
"{",
"long",
"size",
"=",
"0",
";",
"Iterator",
"<",
"CompositedMultiFrameImage",
">",
"iter",
"=",
"_frameCache",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iter",
... | Returns the estimated memory usage in bytes for all images
currently cached by the cached action frames. | [
"Returns",
"the",
"estimated",
"memory",
"usage",
"in",
"bytes",
"for",
"all",
"images",
"currently",
"cached",
"by",
"the",
"cached",
"action",
"frames",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/cast/CharacterManager.java#L230-L238 | train |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/impl/bridge/WebSocketNativeBridgeHandler.java | WebSocketNativeBridgeHandler.processAuthorize | @Override
public void processAuthorize(WebSocketChannel channel, String authorizeToken) {
LOG.entering(CLASS_NAME, "processAuthorize");
WebSocketNativeChannel nativeChannel = (WebSocketNativeChannel)channel;
Proxy proxy = nativeChannel.getProxy();
proxy.processEvent(XoaEventKind.AUT... | java | @Override
public void processAuthorize(WebSocketChannel channel, String authorizeToken) {
LOG.entering(CLASS_NAME, "processAuthorize");
WebSocketNativeChannel nativeChannel = (WebSocketNativeChannel)channel;
Proxy proxy = nativeChannel.getProxy();
proxy.processEvent(XoaEventKind.AUT... | [
"@",
"Override",
"public",
"void",
"processAuthorize",
"(",
"WebSocketChannel",
"channel",
",",
"String",
"authorizeToken",
")",
"{",
"LOG",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"processAuthorize\"",
")",
";",
"WebSocketNativeChannel",
"nativeChannel",
"=",
"(... | Set the authorize token for future requests for "Basic" authentication. | [
"Set",
"the",
"authorize",
"token",
"for",
"future",
"requests",
"for",
"Basic",
"authentication",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/impl/bridge/WebSocketNativeBridgeHandler.java#L95-L102 | train |
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/util/HexUtil.java | HexUtil.byteArrayToInt | public static int byteArrayToInt(byte[] b, int offset) {
int value = 0;
for (int i = 0; i < 4; i++) {
int shift = (4 - 1 - i) * 8;
value += (b[i + offset] & 0x000000FF) << shift;
}
return value;
} | java | public static int byteArrayToInt(byte[] b, int offset) {
int value = 0;
for (int i = 0; i < 4; i++) {
int shift = (4 - 1 - i) * 8;
value += (b[i + offset] & 0x000000FF) << shift;
}
return value;
} | [
"public",
"static",
"int",
"byteArrayToInt",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
")",
"{",
"int",
"value",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"4",
";",
"i",
"++",
")",
"{",
"int",
"shift",
"=",
"(",
... | Convert the byte array to an int starting from the given offset.
@param b The byte array
@param offset The array offset
@return The integer | [
"Convert",
"the",
"byte",
"array",
"to",
"an",
"int",
"starting",
"from",
"the",
"given",
"offset",
"."
] | 25ad2ae5bb24aa9d6b79400fce649b518dcfbe26 | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/HexUtil.java#L81-L88 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/data/ObjectInfo.java | ObjectInfo.setZations | public void setZations (byte primary, byte secondary, byte tertiary, byte quaternary)
{
zations = (primary | (secondary << 16) | (tertiary << 24) | (quaternary << 8));
} | java | public void setZations (byte primary, byte secondary, byte tertiary, byte quaternary)
{
zations = (primary | (secondary << 16) | (tertiary << 24) | (quaternary << 8));
} | [
"public",
"void",
"setZations",
"(",
"byte",
"primary",
",",
"byte",
"secondary",
",",
"byte",
"tertiary",
",",
"byte",
"quaternary",
")",
"{",
"zations",
"=",
"(",
"primary",
"|",
"(",
"secondary",
"<<",
"16",
")",
"|",
"(",
"tertiary",
"<<",
"24",
")... | Sets the primary and secondary colorization assignments. | [
"Sets",
"the",
"primary",
"and",
"secondary",
"colorization",
"assignments",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/data/ObjectInfo.java#L134-L137 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.getFilteredViews | public <T extends View> ArrayList<T> getFilteredViews(Class<T> classToFilterBy) {
ArrayList<T> filteredViews = new ArrayList<T>();
List<View> allViews = this.getViews();
for(View view : allViews){
if (view != null && classToFilterBy.isAssignableFrom(view.getClass())) {
filteredViews.add(classToFilterBy.cas... | java | public <T extends View> ArrayList<T> getFilteredViews(Class<T> classToFilterBy) {
ArrayList<T> filteredViews = new ArrayList<T>();
List<View> allViews = this.getViews();
for(View view : allViews){
if (view != null && classToFilterBy.isAssignableFrom(view.getClass())) {
filteredViews.add(classToFilterBy.cas... | [
"public",
"<",
"T",
"extends",
"View",
">",
"ArrayList",
"<",
"T",
">",
"getFilteredViews",
"(",
"Class",
"<",
"T",
">",
"classToFilterBy",
")",
"{",
"ArrayList",
"<",
"T",
">",
"filteredViews",
"=",
"new",
"ArrayList",
"<",
"T",
">",
"(",
")",
";",
... | Filters through all views in current activity and gets those that inherit from a given class to filter by
@param classToFilterBy - The class type by which to filter by.
@param <T> Type representing a class
@return - an ArrayList of views matching the filter | [
"Filters",
"through",
"all",
"views",
"in",
"current",
"activity",
"and",
"gets",
"those",
"that",
"inherit",
"from",
"a",
"given",
"class",
"to",
"filter",
"by"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L65-L74 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.getVisibleText | public ArrayList<String> getVisibleText()
{
ArrayList<TextView> textViews = getFilteredViews(TextView.class);
ArrayList<String> allStrings = new ArrayList<String>();
for(TextView v: textViews)
{
if(v.getVisibility() == View.VISIBLE)
{
String s... | java | public ArrayList<String> getVisibleText()
{
ArrayList<TextView> textViews = getFilteredViews(TextView.class);
ArrayList<String> allStrings = new ArrayList<String>();
for(TextView v: textViews)
{
if(v.getVisibility() == View.VISIBLE)
{
String s... | [
"public",
"ArrayList",
"<",
"String",
">",
"getVisibleText",
"(",
")",
"{",
"ArrayList",
"<",
"TextView",
">",
"textViews",
"=",
"getFilteredViews",
"(",
"TextView",
".",
"class",
")",
";",
"ArrayList",
"<",
"String",
">",
"allStrings",
"=",
"new",
"ArrayLis... | Searches through all views and gets those containing text which are visible. Stips the text form each view and
returns it as an arraylist.
@return - ArrayList contating text in the current view | [
"Searches",
"through",
"all",
"views",
"and",
"gets",
"those",
"containing",
"text",
"which",
"are",
"visible",
".",
"Stips",
"the",
"text",
"form",
"each",
"view",
"and",
"returns",
"it",
"as",
"an",
"arraylist",
"."
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L81-L96 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.getView | public View getView(int id, int timeout) {
View v = null;
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for (int i = 0; i < retryNum; i++) {
try {
v = super.getView(id);
} catch (Exception e) {}
if (v != null) {
... | java | public View getView(int id, int timeout) {
View v = null;
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for (int i = 0; i < retryNum; i++) {
try {
v = super.getView(id);
} catch (Exception e) {}
if (v != null) {
... | [
"public",
"View",
"getView",
"(",
"int",
"id",
",",
"int",
"timeout",
")",
"{",
"View",
"v",
"=",
"null",
";",
"int",
"RETRY_PERIOD",
"=",
"250",
";",
"int",
"retryNum",
"=",
"timeout",
"/",
"RETRY_PERIOD",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | Extend the normal robotium getView to retry every 250ms over 10s to get the view requested
@param id Resource id of the view
@param timeout amount of time to retry getting the view
@return View that we want to find by id | [
"Extend",
"the",
"normal",
"robotium",
"getView",
"to",
"retry",
"every",
"250ms",
"over",
"10s",
"to",
"get",
"the",
"view",
"requested"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L114-L130 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.waitForResource | public <T> boolean waitForResource(int res, int timeout) {
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for (int i = 0; i < retryNum; i++) {
T View = (T) this.getView(res);
if (View != null) {
break;
}
if (i == ret... | java | public <T> boolean waitForResource(int res, int timeout) {
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for (int i = 0; i < retryNum; i++) {
T View = (T) this.getView(res);
if (View != null) {
break;
}
if (i == ret... | [
"public",
"<",
"T",
">",
"boolean",
"waitForResource",
"(",
"int",
"res",
",",
"int",
"timeout",
")",
"{",
"int",
"RETRY_PERIOD",
"=",
"250",
";",
"int",
"retryNum",
"=",
"timeout",
"/",
"RETRY_PERIOD",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i"... | Wait for a resource to become active
@param res - view resource
@param timeout - timeout period to keep retrying
@param <T> - View type | [
"Wait",
"for",
"a",
"resource",
"to",
"become",
"active"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L158-L172 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.getCustomViews | public ArrayList<View> getCustomViews(String viewName)
{
ArrayList<View> returnViews = new ArrayList<View>();
for(View v: this.getViews())
{
if(v.getClass().getSimpleName().equals(viewName))
returnViews.add(v);
}
return returnViews;
} | java | public ArrayList<View> getCustomViews(String viewName)
{
ArrayList<View> returnViews = new ArrayList<View>();
for(View v: this.getViews())
{
if(v.getClass().getSimpleName().equals(viewName))
returnViews.add(v);
}
return returnViews;
} | [
"public",
"ArrayList",
"<",
"View",
">",
"getCustomViews",
"(",
"String",
"viewName",
")",
"{",
"ArrayList",
"<",
"View",
">",
"returnViews",
"=",
"new",
"ArrayList",
"<",
"View",
">",
"(",
")",
";",
"for",
"(",
"View",
"v",
":",
"this",
".",
"getViews... | Gets views with a custom class name
@param viewName simple class name of the view type
@return arraylist of views matching class name provided | [
"Gets",
"views",
"with",
"a",
"custom",
"class",
"name"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L231-L241 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.waitForHintText | public void waitForHintText(String hintText, int timeout) throws Exception
{
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for(int i=0; i < retryNum; i++)
{
ArrayList<View> imageViews = getCustomViews("EditText");
for(View v: imageViews)
... | java | public void waitForHintText(String hintText, int timeout) throws Exception
{
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for(int i=0; i < retryNum; i++)
{
ArrayList<View> imageViews = getCustomViews("EditText");
for(View v: imageViews)
... | [
"public",
"void",
"waitForHintText",
"(",
"String",
"hintText",
",",
"int",
"timeout",
")",
"throws",
"Exception",
"{",
"int",
"RETRY_PERIOD",
"=",
"250",
";",
"int",
"retryNum",
"=",
"timeout",
"/",
"RETRY_PERIOD",
";",
"for",
"(",
"int",
"i",
"=",
"0",
... | Waits for hint text to appear in an EditText
@param hintText text to wait for
@param timeout amount of time to wait | [
"Waits",
"for",
"hint",
"text",
"to",
"appear",
"in",
"an",
"EditText"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L248-L267 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.enterTextAndWait | public void enterTextAndWait(int fieldResource, String value)
{
EditText textBox = (EditText) this.getView(fieldResource);
this.enterText(textBox, value);
this.waitForText(value);
} | java | public void enterTextAndWait(int fieldResource, String value)
{
EditText textBox = (EditText) this.getView(fieldResource);
this.enterText(textBox, value);
this.waitForText(value);
} | [
"public",
"void",
"enterTextAndWait",
"(",
"int",
"fieldResource",
",",
"String",
"value",
")",
"{",
"EditText",
"textBox",
"=",
"(",
"EditText",
")",
"this",
".",
"getView",
"(",
"fieldResource",
")",
";",
"this",
".",
"enterText",
"(",
"textBox",
",",
"v... | Enter text into a given field resource id
@param fieldResource - Resource id of a field (R.id.*)
@param value - value to enter into the given field | [
"Enter",
"text",
"into",
"a",
"given",
"field",
"resource",
"id"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L274-L279 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.getLocalizedResource | public String getLocalizedResource(String namespace, String resourceId) throws Exception {
String resourceValue = "";
Class r = Class.forName(namespace + "$string");
Field f = r.getField(resourceId);
resourceValue = getCurrentActivity().getResources().getString(f.getInt(f));
re... | java | public String getLocalizedResource(String namespace, String resourceId) throws Exception {
String resourceValue = "";
Class r = Class.forName(namespace + "$string");
Field f = r.getField(resourceId);
resourceValue = getCurrentActivity().getResources().getString(f.getInt(f));
re... | [
"public",
"String",
"getLocalizedResource",
"(",
"String",
"namespace",
",",
"String",
"resourceId",
")",
"throws",
"Exception",
"{",
"String",
"resourceValue",
"=",
"\"\"",
";",
"Class",
"r",
"=",
"Class",
".",
"forName",
"(",
"namespace",
"+",
"\"$string\"",
... | Returns a string for a resourceId in the specified namespace
@param namespace
@param resourceId
@return
@throws Exception | [
"Returns",
"a",
"string",
"for",
"a",
"resourceId",
"in",
"the",
"specified",
"namespace"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L288-L296 | train |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.getLocalizedResourceArray | public String[] getLocalizedResourceArray(String namespace, String resourceId) throws Exception {
Class r = Class.forName(namespace + "$string");
Field f = r.getField(resourceId);
return getCurrentActivity().getResources().getStringArray(f.getInt(f));
} | java | public String[] getLocalizedResourceArray(String namespace, String resourceId) throws Exception {
Class r = Class.forName(namespace + "$string");
Field f = r.getField(resourceId);
return getCurrentActivity().getResources().getStringArray(f.getInt(f));
} | [
"public",
"String",
"[",
"]",
"getLocalizedResourceArray",
"(",
"String",
"namespace",
",",
"String",
"resourceId",
")",
"throws",
"Exception",
"{",
"Class",
"r",
"=",
"Class",
".",
"forName",
"(",
"namespace",
"+",
"\"$string\"",
")",
";",
"Field",
"f",
"="... | Returns a string array for a specified string-array resourceId in the specified namespace
@param namespace
@param resourceId
@return
@throws Exception | [
"Returns",
"a",
"string",
"array",
"for",
"a",
"specified",
"string",
"-",
"array",
"resourceId",
"in",
"the",
"specified",
"namespace"
] | 12d242faad50bf90f98657ca9a0c0c3ae1993f07 | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L305-L309 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Listener.java | Listener.setPosition | public void setPosition (float x, float y, float z)
{
if (_px != x || _py != y || _pz != z) {
AL10.alListener3f(AL10.AL_POSITION, _px = x, _py = y, _pz = z);
}
} | java | public void setPosition (float x, float y, float z)
{
if (_px != x || _py != y || _pz != z) {
AL10.alListener3f(AL10.AL_POSITION, _px = x, _py = y, _pz = z);
}
} | [
"public",
"void",
"setPosition",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"if",
"(",
"_px",
"!=",
"x",
"||",
"_py",
"!=",
"y",
"||",
"_pz",
"!=",
"z",
")",
"{",
"AL10",
".",
"alListener3f",
"(",
"AL10",
".",
"AL_POSITION... | Sets the position of the listener. | [
"Sets",
"the",
"position",
"of",
"the",
"listener",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Listener.java#L35-L40 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Listener.java | Listener.setVelocity | public void setVelocity (float x, float y, float z)
{
if (_vx != x || _vy != y || _vz != z) {
AL10.alListener3f(AL10.AL_VELOCITY, _vx = x, _vy = y, _vz = z);
}
} | java | public void setVelocity (float x, float y, float z)
{
if (_vx != x || _vy != y || _vz != z) {
AL10.alListener3f(AL10.AL_VELOCITY, _vx = x, _vy = y, _vz = z);
}
} | [
"public",
"void",
"setVelocity",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"if",
"(",
"_vx",
"!=",
"x",
"||",
"_vy",
"!=",
"y",
"||",
"_vz",
"!=",
"z",
")",
"{",
"AL10",
".",
"alListener3f",
"(",
"AL10",
".",
"AL_VELOCITY... | Sets the velocity of the listener. | [
"Sets",
"the",
"velocity",
"of",
"the",
"listener",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Listener.java#L69-L74 | train |
threerings/nenya | core/src/main/java/com/threerings/openal/Listener.java | Listener.setGain | public void setGain (float gain)
{
if (_gain != gain) {
AL10.alListenerf(AL10.AL_GAIN, _gain = gain);
}
} | java | public void setGain (float gain)
{
if (_gain != gain) {
AL10.alListenerf(AL10.AL_GAIN, _gain = gain);
}
} | [
"public",
"void",
"setGain",
"(",
"float",
"gain",
")",
"{",
"if",
"(",
"_gain",
"!=",
"gain",
")",
"{",
"AL10",
".",
"alListenerf",
"(",
"AL10",
".",
"AL_GAIN",
",",
"_gain",
"=",
"gain",
")",
";",
"}",
"}"
] | Sets the gain of the listener. | [
"Sets",
"the",
"gain",
"of",
"the",
"listener",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/openal/Listener.java#L79-L84 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/Colorization.java | Colorization.matches | public boolean matches (float[] hsv, int[] fhsv)
{
// check to see that this color is sufficiently "close" to the
// root color based on the supplied distance parameters
if (distance(fhsv[0], _fhsv[0], Short.MAX_VALUE) > range[0] * Short.MAX_VALUE) {
return false;
}
... | java | public boolean matches (float[] hsv, int[] fhsv)
{
// check to see that this color is sufficiently "close" to the
// root color based on the supplied distance parameters
if (distance(fhsv[0], _fhsv[0], Short.MAX_VALUE) > range[0] * Short.MAX_VALUE) {
return false;
}
... | [
"public",
"boolean",
"matches",
"(",
"float",
"[",
"]",
"hsv",
",",
"int",
"[",
"]",
"fhsv",
")",
"{",
"// check to see that this color is sufficiently \"close\" to the",
"// root color based on the supplied distance parameters",
"if",
"(",
"distance",
"(",
"fhsv",
"[",
... | Returns true if this colorization matches the supplied color, false otherwise.
@param hsv the HSV values for the color in question.
@param fhsv the HSV values converted to fixed point via {@link #toFixedHSV} for the color
in question. | [
"Returns",
"true",
"if",
"this",
"colorization",
"matches",
"the",
"supplied",
"color",
"false",
"otherwise",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/Colorization.java#L115-L130 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/Colorization.java | Colorization.toFixedHSV | public static int[] toFixedHSV (float[] hsv, int[] fhsv)
{
if (fhsv == null) {
fhsv = new int[hsv.length];
}
for (int ii = 0; ii < hsv.length; ii++) {
// fhsv[i] = (int)(hsv[i]*Integer.MAX_VALUE);
fhsv[ii] = (int)(hsv[ii]*Short.MAX_VALUE);
}
... | java | public static int[] toFixedHSV (float[] hsv, int[] fhsv)
{
if (fhsv == null) {
fhsv = new int[hsv.length];
}
for (int ii = 0; ii < hsv.length; ii++) {
// fhsv[i] = (int)(hsv[i]*Integer.MAX_VALUE);
fhsv[ii] = (int)(hsv[ii]*Short.MAX_VALUE);
}
... | [
"public",
"static",
"int",
"[",
"]",
"toFixedHSV",
"(",
"float",
"[",
"]",
"hsv",
",",
"int",
"[",
"]",
"fhsv",
")",
"{",
"if",
"(",
"fhsv",
"==",
"null",
")",
"{",
"fhsv",
"=",
"new",
"int",
"[",
"hsv",
".",
"length",
"]",
";",
"}",
"for",
"... | Converts floating point HSV values to a fixed point integer representation.
@param hsv the HSV values to be converted.
@param fhsv the destination array into which the fixed values will be stored. If this is
null, a new array will be created of the appropriate length.
@return the <code>fhsv</code> parameter if it was... | [
"Converts",
"floating",
"point",
"HSV",
"values",
"to",
"a",
"fixed",
"point",
"integer",
"representation",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/Colorization.java#L172-L182 | train |
threerings/nenya | core/src/main/java/com/threerings/media/image/Colorization.java | Colorization.distance | public static int distance (int a, int b, int N)
{
return (a > b) ? Math.min(a-b, b+N-a) : Math.min(b-a, a+N-b);
} | java | public static int distance (int a, int b, int N)
{
return (a > b) ? Math.min(a-b, b+N-a) : Math.min(b-a, a+N-b);
} | [
"public",
"static",
"int",
"distance",
"(",
"int",
"a",
",",
"int",
"b",
",",
"int",
"N",
")",
"{",
"return",
"(",
"a",
">",
"b",
")",
"?",
"Math",
".",
"min",
"(",
"a",
"-",
"b",
",",
"b",
"+",
"N",
"-",
"a",
")",
":",
"Math",
".",
"min"... | Returns the distance between the supplied to numbers modulo N. | [
"Returns",
"the",
"distance",
"between",
"the",
"supplied",
"to",
"numbers",
"modulo",
"N",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/image/Colorization.java#L187-L190 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.setSceneModel | public void setSceneModel (MisoSceneModel model)
{
_model = model;
// clear out old blocks and objects
clearScene();
centerOnTile(0, 0);
if (isShowing()) {
rethink();
_remgr.invalidateRegion(_vbounds);
}
} | java | public void setSceneModel (MisoSceneModel model)
{
_model = model;
// clear out old blocks and objects
clearScene();
centerOnTile(0, 0);
if (isShowing()) {
rethink();
_remgr.invalidateRegion(_vbounds);
}
} | [
"public",
"void",
"setSceneModel",
"(",
"MisoSceneModel",
"model",
")",
"{",
"_model",
"=",
"model",
";",
"// clear out old blocks and objects",
"clearScene",
"(",
")",
";",
"centerOnTile",
"(",
"0",
",",
"0",
")",
";",
"if",
"(",
"isShowing",
"(",
")",
")",... | Configures this display with a scene model which will immediately be resolved and
displayed. | [
"Configures",
"this",
"display",
"with",
"a",
"scene",
"model",
"which",
"will",
"immediately",
"be",
"resolved",
"and",
"displayed",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L127-L139 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.clearScene | protected void clearScene ()
{
_blocks.clear();
_vizobjs.clear();
_fringes.clear();
_masks.clear();
if (_dpanel != null) {
_dpanel.newScene();
}
} | java | protected void clearScene ()
{
_blocks.clear();
_vizobjs.clear();
_fringes.clear();
_masks.clear();
if (_dpanel != null) {
_dpanel.newScene();
}
} | [
"protected",
"void",
"clearScene",
"(",
")",
"{",
"_blocks",
".",
"clear",
"(",
")",
";",
"_vizobjs",
".",
"clear",
"(",
")",
";",
"_fringes",
".",
"clear",
"(",
")",
";",
"_masks",
".",
"clear",
"(",
")",
";",
"if",
"(",
"_dpanel",
"!=",
"null",
... | Clears out our old scene business. | [
"Clears",
"out",
"our",
"old",
"scene",
"business",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L144-L153 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.centerOnTile | public void centerOnTile (int tx, int ty)
{
Rectangle trect = MisoUtil.getTilePolygon(_metrics, tx, ty).getBounds();
int nx = trect.x + trect.width/2 - _vbounds.width/2;
int ny = trect.y + trect.height/2 - _vbounds.height/2;
// Log.info("Centering on t:" + StringUtil.coordsToString(t... | java | public void centerOnTile (int tx, int ty)
{
Rectangle trect = MisoUtil.getTilePolygon(_metrics, tx, ty).getBounds();
int nx = trect.x + trect.width/2 - _vbounds.width/2;
int ny = trect.y + trect.height/2 - _vbounds.height/2;
// Log.info("Centering on t:" + StringUtil.coordsToString(t... | [
"public",
"void",
"centerOnTile",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"Rectangle",
"trect",
"=",
"MisoUtil",
".",
"getTilePolygon",
"(",
"_metrics",
",",
"tx",
",",
"ty",
")",
".",
"getBounds",
"(",
")",
";",
"int",
"nx",
"=",
"trect",
".",... | Moves the scene such that the specified tile is in the center. | [
"Moves",
"the",
"scene",
"such",
"that",
"the",
"specified",
"tile",
"is",
"in",
"the",
"center",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L169-L179 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.showFlagsDidChange | protected void showFlagsDidChange (int oldflags)
{
if ((oldflags & SHOW_TIPS) != (_showFlags & SHOW_TIPS)) {
for (SceneObjectIndicator indic : _indicators.values()) {
dirtyIndicator(indic);
}
}
} | java | protected void showFlagsDidChange (int oldflags)
{
if ((oldflags & SHOW_TIPS) != (_showFlags & SHOW_TIPS)) {
for (SceneObjectIndicator indic : _indicators.values()) {
dirtyIndicator(indic);
}
}
} | [
"protected",
"void",
"showFlagsDidChange",
"(",
"int",
"oldflags",
")",
"{",
"if",
"(",
"(",
"oldflags",
"&",
"SHOW_TIPS",
")",
"!=",
"(",
"_showFlags",
"&",
"SHOW_TIPS",
")",
")",
"{",
"for",
"(",
"SceneObjectIndicator",
"indic",
":",
"_indicators",
".",
... | Called when our show flags have changed. | [
"Called",
"when",
"our",
"show",
"flags",
"have",
"changed",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L227-L234 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getBlock | public SceneBlock getBlock (int tx, int ty)
{
int bx = MathUtil.floorDiv(tx, _metrics.blockwid);
int by = MathUtil.floorDiv(ty, _metrics.blockhei);
return _blocks.get(compose(bx, by));
} | java | public SceneBlock getBlock (int tx, int ty)
{
int bx = MathUtil.floorDiv(tx, _metrics.blockwid);
int by = MathUtil.floorDiv(ty, _metrics.blockhei);
return _blocks.get(compose(bx, by));
} | [
"public",
"SceneBlock",
"getBlock",
"(",
"int",
"tx",
",",
"int",
"ty",
")",
"{",
"int",
"bx",
"=",
"MathUtil",
".",
"floorDiv",
"(",
"tx",
",",
"_metrics",
".",
"blockwid",
")",
";",
"int",
"by",
"=",
"MathUtil",
".",
"floorDiv",
"(",
"ty",
",",
"... | Returns the resolved block that contains the specified tile coordinate or null if no block
is resolved for that coordinate. | [
"Returns",
"the",
"resolved",
"block",
"that",
"contains",
"the",
"specified",
"tile",
"coordinate",
"or",
"null",
"if",
"no",
"block",
"is",
"resolved",
"for",
"that",
"coordinate",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L265-L270 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getPath | public Path getPath (Sprite sprite, int x, int y, boolean loose)
{
// sanity check
if (sprite == null) {
throw new IllegalArgumentException(
"Can't get path for null sprite [x=" + x + ", y=" + y + ".");
}
// get the destination tile coordinates
Po... | java | public Path getPath (Sprite sprite, int x, int y, boolean loose)
{
// sanity check
if (sprite == null) {
throw new IllegalArgumentException(
"Can't get path for null sprite [x=" + x + ", y=" + y + ".");
}
// get the destination tile coordinates
Po... | [
"public",
"Path",
"getPath",
"(",
"Sprite",
"sprite",
",",
"int",
"x",
",",
"int",
"y",
",",
"boolean",
"loose",
")",
"{",
"// sanity check",
"if",
"(",
"sprite",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can't get path for ... | Computes a path for the specified sprite to the specified tile coordinates.
@param loose if true, an approximate path will be returned if a complete path cannot be
located. This path will navigate the sprite "legally" as far as possible and then walk the
sprite in a straight line to its final destination. This is gene... | [
"Computes",
"a",
"path",
"for",
"the",
"specified",
"sprite",
"to",
"the",
"specified",
"tile",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L280-L314 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getScreenCoords | public Point getScreenCoords (int x, int y)
{
return MisoUtil.fullToScreen(_metrics, x, y, new Point());
} | java | public Point getScreenCoords (int x, int y)
{
return MisoUtil.fullToScreen(_metrics, x, y, new Point());
} | [
"public",
"Point",
"getScreenCoords",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"MisoUtil",
".",
"fullToScreen",
"(",
"_metrics",
",",
"x",
",",
"y",
",",
"new",
"Point",
"(",
")",
")",
";",
"}"
] | Converts the supplied full coordinates to screen coordinates. | [
"Converts",
"the",
"supplied",
"full",
"coordinates",
"to",
"screen",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L319-L322 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getFullCoords | public Point getFullCoords (int x, int y)
{
return MisoUtil.screenToFull(_metrics, x, y, new Point());
} | java | public Point getFullCoords (int x, int y)
{
return MisoUtil.screenToFull(_metrics, x, y, new Point());
} | [
"public",
"Point",
"getFullCoords",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"MisoUtil",
".",
"screenToFull",
"(",
"_metrics",
",",
"x",
",",
"y",
",",
"new",
"Point",
"(",
")",
")",
";",
"}"
] | Converts the supplied screen coordinates to full coordinates. | [
"Converts",
"the",
"supplied",
"screen",
"coordinates",
"to",
"full",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L327-L330 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getTileCoords | public Point getTileCoords (int x, int y)
{
return MisoUtil.screenToTile(_metrics, x, y, new Point());
} | java | public Point getTileCoords (int x, int y)
{
return MisoUtil.screenToTile(_metrics, x, y, new Point());
} | [
"public",
"Point",
"getTileCoords",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"return",
"MisoUtil",
".",
"screenToTile",
"(",
"_metrics",
",",
"x",
",",
"y",
",",
"new",
"Point",
"(",
")",
")",
";",
"}"
] | Converts the supplied screen coordinates to tile coordinates. | [
"Converts",
"the",
"supplied",
"screen",
"coordinates",
"to",
"tile",
"coordinates",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L335-L338 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.reportMemoryUsage | public void reportMemoryUsage ()
{
Map<Tile.Key,BaseTile> base = Maps.newHashMap();
Set<BaseTile> fringe = Sets.newHashSet();
Map<Tile.Key,ObjectTile> object = Maps.newHashMap();
long[] usage = new long[3];
for (SceneBlock block : _blocks.values()) {
block.compute... | java | public void reportMemoryUsage ()
{
Map<Tile.Key,BaseTile> base = Maps.newHashMap();
Set<BaseTile> fringe = Sets.newHashSet();
Map<Tile.Key,ObjectTile> object = Maps.newHashMap();
long[] usage = new long[3];
for (SceneBlock block : _blocks.values()) {
block.compute... | [
"public",
"void",
"reportMemoryUsage",
"(",
")",
"{",
"Map",
"<",
"Tile",
".",
"Key",
",",
"BaseTile",
">",
"base",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"Set",
"<",
"BaseTile",
">",
"fringe",
"=",
"Sets",
".",
"newHashSet",
"(",
")",
";",
... | Reports the memory usage of the resolved tiles in the current scene block. | [
"Reports",
"the",
"memory",
"usage",
"of",
"the",
"resolved",
"tiles",
"in",
"the",
"current",
"scene",
"block",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L353-L367 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.handleObjectPressed | protected void handleObjectPressed (final SceneObject scobj, int mx, int my)
{
String action = scobj.info.action;
final ObjectActionHandler handler = ObjectActionHandler.lookup(action);
// if there's no handler, just fire the action immediately
if (handler == null) {
fir... | java | protected void handleObjectPressed (final SceneObject scobj, int mx, int my)
{
String action = scobj.info.action;
final ObjectActionHandler handler = ObjectActionHandler.lookup(action);
// if there's no handler, just fire the action immediately
if (handler == null) {
fir... | [
"protected",
"void",
"handleObjectPressed",
"(",
"final",
"SceneObject",
"scobj",
",",
"int",
"mx",
",",
"int",
"my",
")",
"{",
"String",
"action",
"=",
"scobj",
".",
"info",
".",
"action",
";",
"final",
"ObjectActionHandler",
"handler",
"=",
"ObjectActionHand... | Called when the user presses the mouse button over an object. | [
"Called",
"when",
"the",
"user",
"presses",
"the",
"mouse",
"button",
"over",
"an",
"object",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L443-L485 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.fireObjectAction | protected void fireObjectAction (
ObjectActionHandler handler, SceneObject scobj, ActionEvent event)
{
if (handler == null) {
Controller.postAction(event);
} else {
handler.handleAction(scobj, event);
}
} | java | protected void fireObjectAction (
ObjectActionHandler handler, SceneObject scobj, ActionEvent event)
{
if (handler == null) {
Controller.postAction(event);
} else {
handler.handleAction(scobj, event);
}
} | [
"protected",
"void",
"fireObjectAction",
"(",
"ObjectActionHandler",
"handler",
",",
"SceneObject",
"scobj",
",",
"ActionEvent",
"event",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"Controller",
".",
"postAction",
"(",
"event",
")",
";",
"}",
"e... | Called when an object or object menu item has been clicked. | [
"Called",
"when",
"an",
"object",
"or",
"object",
"menu",
"item",
"has",
"been",
"clicked",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L519-L527 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.appendDirtySprite | protected void appendDirtySprite (DirtyItemList list, Sprite sprite)
{
MisoUtil.screenToTile(_metrics, sprite.getX(), sprite.getY(), _tcoords);
list.appendDirtySprite(sprite, _tcoords.x, _tcoords.y);
} | java | protected void appendDirtySprite (DirtyItemList list, Sprite sprite)
{
MisoUtil.screenToTile(_metrics, sprite.getX(), sprite.getY(), _tcoords);
list.appendDirtySprite(sprite, _tcoords.x, _tcoords.y);
} | [
"protected",
"void",
"appendDirtySprite",
"(",
"DirtyItemList",
"list",
",",
"Sprite",
"sprite",
")",
"{",
"MisoUtil",
".",
"screenToTile",
"(",
"_metrics",
",",
"sprite",
".",
"getX",
"(",
")",
",",
"sprite",
".",
"getY",
"(",
")",
",",
"_tcoords",
")",
... | Computes the tile coordinates of the supplied sprite and appends it to the supplied dirty
item list. | [
"Computes",
"the",
"tile",
"coordinates",
"of",
"the",
"supplied",
"sprite",
"and",
"appends",
"it",
"to",
"the",
"supplied",
"dirty",
"item",
"list",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L756-L760 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.blockAbandoned | protected void blockAbandoned (SceneBlock block)
{
if (_dpanel != null) {
_dpanel.blockCleared(block);
}
blockFinished(block);
} | java | protected void blockAbandoned (SceneBlock block)
{
if (_dpanel != null) {
_dpanel.blockCleared(block);
}
blockFinished(block);
} | [
"protected",
"void",
"blockAbandoned",
"(",
"SceneBlock",
"block",
")",
"{",
"if",
"(",
"_dpanel",
"!=",
"null",
")",
"{",
"_dpanel",
".",
"blockCleared",
"(",
"block",
")",
";",
"}",
"blockFinished",
"(",
"block",
")",
";",
"}"
] | Called by the scene block if it has come up for resolution but is no longer influential. | [
"Called",
"by",
"the",
"scene",
"block",
"if",
"it",
"has",
"come",
"up",
"for",
"resolution",
"but",
"is",
"no",
"longer",
"influential",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L902-L909 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.blockResolved | protected void blockResolved (SceneBlock block)
{
if (_dpanel != null) {
_dpanel.resolvedBlock(block);
}
Rectangle sbounds = block.getScreenBounds();
if (!_delayRepaint && sbounds != null && sbounds.intersects(_vbounds)) {
// warnVisible(block, sbounds);
... | java | protected void blockResolved (SceneBlock block)
{
if (_dpanel != null) {
_dpanel.resolvedBlock(block);
}
Rectangle sbounds = block.getScreenBounds();
if (!_delayRepaint && sbounds != null && sbounds.intersects(_vbounds)) {
// warnVisible(block, sbounds);
... | [
"protected",
"void",
"blockResolved",
"(",
"SceneBlock",
"block",
")",
"{",
"if",
"(",
"_dpanel",
"!=",
"null",
")",
"{",
"_dpanel",
".",
"resolvedBlock",
"(",
"block",
")",
";",
"}",
"Rectangle",
"sbounds",
"=",
"block",
".",
"getScreenBounds",
"(",
")",
... | Called by a scene block when it has completed its resolution process. | [
"Called",
"by",
"a",
"scene",
"block",
"when",
"it",
"has",
"completed",
"its",
"resolution",
"process",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L914-L932 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.blockFinished | protected void blockFinished (SceneBlock block)
{
--_pendingBlocks;
// once all the visible pending blocks have completed their
// resolution, recompute our visible object set and show ourselves
if (_visiBlocks.remove(block) && _visiBlocks.size() == 0) {
allBlocksFinishe... | java | protected void blockFinished (SceneBlock block)
{
--_pendingBlocks;
// once all the visible pending blocks have completed their
// resolution, recompute our visible object set and show ourselves
if (_visiBlocks.remove(block) && _visiBlocks.size() == 0) {
allBlocksFinishe... | [
"protected",
"void",
"blockFinished",
"(",
"SceneBlock",
"block",
")",
"{",
"--",
"_pendingBlocks",
";",
"// once all the visible pending blocks have completed their",
"// resolution, recompute our visible object set and show ourselves",
"if",
"(",
"_visiBlocks",
".",
"remove",
"... | Called whenever a block is done resolving, whether it was successfully resolved or if it
was abandoned. | [
"Called",
"whenever",
"a",
"block",
"is",
"done",
"resolving",
"whether",
"it",
"was",
"successfully",
"resolved",
"or",
"if",
"it",
"was",
"abandoned",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L938-L947 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.allBlocksFinished | protected void allBlocksFinished ()
{
recomputeVisible();
log.info("Restoring repaint... ", "left", _pendingBlocks, "view",
StringUtil.toString(_vbounds));
_delayRepaint = false;
// Need to restore visibility as it may have been turned of as a result of the delay
... | java | protected void allBlocksFinished ()
{
recomputeVisible();
log.info("Restoring repaint... ", "left", _pendingBlocks, "view",
StringUtil.toString(_vbounds));
_delayRepaint = false;
// Need to restore visibility as it may have been turned of as a result of the delay
... | [
"protected",
"void",
"allBlocksFinished",
"(",
")",
"{",
"recomputeVisible",
"(",
")",
";",
"log",
".",
"info",
"(",
"\"Restoring repaint... \"",
",",
"\"left\"",
",",
"_pendingBlocks",
",",
"\"view\"",
",",
"StringUtil",
".",
"toString",
"(",
"_vbounds",
")",
... | Called to handle the proceedings once our last resolving block has been finished. | [
"Called",
"to",
"handle",
"the",
"proceedings",
"once",
"our",
"last",
"resolving",
"block",
"has",
"been",
"finished",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L952-L961 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.warnVisible | protected void warnVisible (SceneBlock block, Rectangle sbounds)
{
log.warning("Block visible during resolution " + block +
" sbounds:" + StringUtil.toString(sbounds) +
" vbounds:" + StringUtil.toString(_vbounds) + ".");
} | java | protected void warnVisible (SceneBlock block, Rectangle sbounds)
{
log.warning("Block visible during resolution " + block +
" sbounds:" + StringUtil.toString(sbounds) +
" vbounds:" + StringUtil.toString(_vbounds) + ".");
} | [
"protected",
"void",
"warnVisible",
"(",
"SceneBlock",
"block",
",",
"Rectangle",
"sbounds",
")",
"{",
"log",
".",
"warning",
"(",
"\"Block visible during resolution \"",
"+",
"block",
"+",
"\" sbounds:\"",
"+",
"StringUtil",
".",
"toString",
"(",
"sbounds",
")",
... | Issues a warning to the error log that the specified block became visible prior to being
resolved. Derived classes may wish to augment or inhibit this warning. | [
"Issues",
"a",
"warning",
"to",
"the",
"error",
"log",
"that",
"the",
"specified",
"block",
"became",
"visible",
"prior",
"to",
"being",
"resolved",
".",
"Derived",
"classes",
"may",
"wish",
"to",
"augment",
"or",
"inhibit",
"this",
"warning",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L967-L972 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.recomputeVisible | protected void recomputeVisible ()
{
// flush our visible object set which we'll recreate later
_vizobjs.clear();
Rectangle vbounds = new Rectangle(
_vbounds.x-_metrics.tilewid, _vbounds.y-_metrics.tilehei,
_vbounds.width+2*_metrics.tilewid,
_vbounds.heig... | java | protected void recomputeVisible ()
{
// flush our visible object set which we'll recreate later
_vizobjs.clear();
Rectangle vbounds = new Rectangle(
_vbounds.x-_metrics.tilewid, _vbounds.y-_metrics.tilehei,
_vbounds.width+2*_metrics.tilewid,
_vbounds.heig... | [
"protected",
"void",
"recomputeVisible",
"(",
")",
"{",
"// flush our visible object set which we'll recreate later",
"_vizobjs",
".",
"clear",
"(",
")",
";",
"Rectangle",
"vbounds",
"=",
"new",
"Rectangle",
"(",
"_vbounds",
".",
"x",
"-",
"_metrics",
".",
"tilewid"... | Recomputes our set of visible objects and their indicators. | [
"Recomputes",
"our",
"set",
"of",
"visible",
"objects",
"and",
"their",
"indicators",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L977-L1018 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.computeIndicators | public void computeIndicators ()
{
Map<SceneObject, SceneObjectIndicator> _unupdated = Maps.newHashMap(_indicators);
for (int ii = 0, nn = _vizobjs.size(); ii < nn; ii++) {
SceneObject scobj = _vizobjs.get(ii);
String action = scobj.info.action;
// if the object ... | java | public void computeIndicators ()
{
Map<SceneObject, SceneObjectIndicator> _unupdated = Maps.newHashMap(_indicators);
for (int ii = 0, nn = _vizobjs.size(); ii < nn; ii++) {
SceneObject scobj = _vizobjs.get(ii);
String action = scobj.info.action;
// if the object ... | [
"public",
"void",
"computeIndicators",
"(",
")",
"{",
"Map",
"<",
"SceneObject",
",",
"SceneObjectIndicator",
">",
"_unupdated",
"=",
"Maps",
".",
"newHashMap",
"(",
"_indicators",
")",
";",
"for",
"(",
"int",
"ii",
"=",
"0",
",",
"nn",
"=",
"_vizobjs",
... | Compute the indicators for any objects in the scene. | [
"Compute",
"the",
"indicators",
"for",
"any",
"objects",
"in",
"the",
"scene",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1032-L1078 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getTipText | protected String getTipText (SceneObject scobj, String action)
{
ObjectActionHandler oah = ObjectActionHandler.lookup(action);
return (oah == null) ? action : oah.getTipText(action);
} | java | protected String getTipText (SceneObject scobj, String action)
{
ObjectActionHandler oah = ObjectActionHandler.lookup(action);
return (oah == null) ? action : oah.getTipText(action);
} | [
"protected",
"String",
"getTipText",
"(",
"SceneObject",
"scobj",
",",
"String",
"action",
")",
"{",
"ObjectActionHandler",
"oah",
"=",
"ObjectActionHandler",
".",
"lookup",
"(",
"action",
")",
";",
"return",
"(",
"oah",
"==",
"null",
")",
"?",
"action",
":"... | Derived classes can provide human readable object tips via this method. | [
"Derived",
"classes",
"can",
"provide",
"human",
"readable",
"object",
"tips",
"via",
"this",
"method",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1083-L1087 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getTipIcon | protected Icon getTipIcon (SceneObject scobj, String action)
{
ObjectActionHandler oah = ObjectActionHandler.lookup(action);
return (oah == null) ? null : oah.getTipIcon(action);
} | java | protected Icon getTipIcon (SceneObject scobj, String action)
{
ObjectActionHandler oah = ObjectActionHandler.lookup(action);
return (oah == null) ? null : oah.getTipIcon(action);
} | [
"protected",
"Icon",
"getTipIcon",
"(",
"SceneObject",
"scobj",
",",
"String",
"action",
")",
"{",
"ObjectActionHandler",
"oah",
"=",
"ObjectActionHandler",
".",
"lookup",
"(",
"action",
")",
";",
"return",
"(",
"oah",
"==",
"null",
")",
"?",
"null",
":",
... | Provides an icon for this tooltip, the default looks up an object action handler for the
action and requests the icon from it. | [
"Provides",
"an",
"icon",
"for",
"this",
"tooltip",
"the",
"default",
"looks",
"up",
"an",
"object",
"action",
"handler",
"for",
"the",
"action",
"and",
"requests",
"the",
"icon",
"from",
"it",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1093-L1097 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.dirtyIndicator | protected void dirtyIndicator (SceneObjectIndicator indic)
{
if (indic != null) {
Rectangle r = indic.getBounds();
if (r != null) {
_remgr.invalidateRegion(r);
}
}
} | java | protected void dirtyIndicator (SceneObjectIndicator indic)
{
if (indic != null) {
Rectangle r = indic.getBounds();
if (r != null) {
_remgr.invalidateRegion(r);
}
}
} | [
"protected",
"void",
"dirtyIndicator",
"(",
"SceneObjectIndicator",
"indic",
")",
"{",
"if",
"(",
"indic",
"!=",
"null",
")",
"{",
"Rectangle",
"r",
"=",
"indic",
".",
"getBounds",
"(",
")",
";",
"if",
"(",
"r",
"!=",
"null",
")",
"{",
"_remgr",
".",
... | Dirties the specified indicator. | [
"Dirties",
"the",
"specified",
"indicator",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1102-L1110 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.changeHoverObject | protected void changeHoverObject (Object newHover)
{
if (newHover == _hobject) {
return;
}
Object oldHover = _hobject;
_hobject = newHover;
hoverObjectChanged(oldHover, newHover);
} | java | protected void changeHoverObject (Object newHover)
{
if (newHover == _hobject) {
return;
}
Object oldHover = _hobject;
_hobject = newHover;
hoverObjectChanged(oldHover, newHover);
} | [
"protected",
"void",
"changeHoverObject",
"(",
"Object",
"newHover",
")",
"{",
"if",
"(",
"newHover",
"==",
"_hobject",
")",
"{",
"return",
";",
"}",
"Object",
"oldHover",
"=",
"_hobject",
";",
"_hobject",
"=",
"newHover",
";",
"hoverObjectChanged",
"(",
"ol... | Change the hover object to the new object. | [
"Change",
"the",
"hover",
"object",
"to",
"the",
"new",
"object",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1115-L1123 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.hoverObjectChanged | protected void hoverObjectChanged (Object oldHover, Object newHover)
{
// deal with objects that care about being hovered over
if (oldHover instanceof SceneObject) {
SceneObject oldhov = (SceneObject)oldHover;
if (oldhov.setHovered(false)) {
_remgr.invalidateR... | java | protected void hoverObjectChanged (Object oldHover, Object newHover)
{
// deal with objects that care about being hovered over
if (oldHover instanceof SceneObject) {
SceneObject oldhov = (SceneObject)oldHover;
if (oldhov.setHovered(false)) {
_remgr.invalidateR... | [
"protected",
"void",
"hoverObjectChanged",
"(",
"Object",
"oldHover",
",",
"Object",
"newHover",
")",
"{",
"// deal with objects that care about being hovered over",
"if",
"(",
"oldHover",
"instanceof",
"SceneObject",
")",
"{",
"SceneObject",
"oldhov",
"=",
"(",
"SceneO... | A place for subclasses to react to the hover object changing.
One of the supplied arguments may be null. | [
"A",
"place",
"for",
"subclasses",
"to",
"react",
"to",
"the",
"hover",
"object",
"changing",
".",
"One",
"of",
"the",
"supplied",
"arguments",
"may",
"be",
"null",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1129-L1148 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.getHitObjects | protected void getHitObjects (DirtyItemList list, int x, int y)
{
for (SceneObject scobj : _vizobjs) {
Rectangle pbounds = scobj.bounds;
if (!pbounds.contains(x, y)) {
continue;
}
// see if we should skip it
if (skipHitObject(scobj... | java | protected void getHitObjects (DirtyItemList list, int x, int y)
{
for (SceneObject scobj : _vizobjs) {
Rectangle pbounds = scobj.bounds;
if (!pbounds.contains(x, y)) {
continue;
}
// see if we should skip it
if (skipHitObject(scobj... | [
"protected",
"void",
"getHitObjects",
"(",
"DirtyItemList",
"list",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"for",
"(",
"SceneObject",
"scobj",
":",
"_vizobjs",
")",
"{",
"Rectangle",
"pbounds",
"=",
"scobj",
".",
"bounds",
";",
"if",
"(",
"!",
"pb... | Adds to the supplied dirty item list, all of the object tiles that are hit by the specified
point (meaning the point is contained within their bounds and intersects a non-transparent
pixel in the actual object image. | [
"Adds",
"to",
"the",
"supplied",
"dirty",
"item",
"list",
"all",
"of",
"the",
"object",
"tiles",
"that",
"are",
"hit",
"by",
"the",
"specified",
"point",
"(",
"meaning",
"the",
"point",
"is",
"contained",
"within",
"their",
"bounds",
"and",
"intersects",
"... | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1155-L1176 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.paintBits | @Override
protected void paintBits (Graphics2D gfx, int layer, Rectangle dirty)
{
_animmgr.paint(gfx, layer, dirty);
} | java | @Override
protected void paintBits (Graphics2D gfx, int layer, Rectangle dirty)
{
_animmgr.paint(gfx, layer, dirty);
} | [
"@",
"Override",
"protected",
"void",
"paintBits",
"(",
"Graphics2D",
"gfx",
",",
"int",
"layer",
",",
"Rectangle",
"dirty",
")",
"{",
"_animmgr",
".",
"paint",
"(",
"gfx",
",",
"layer",
",",
"dirty",
")",
";",
"}"
] | We don't want sprites rendered using the standard mechanism because we intersperse them
with objects in our scene and need to manage their z-order. | [
"We",
"don",
"t",
"want",
"sprites",
"rendered",
"using",
"the",
"standard",
"mechanism",
"because",
"we",
"intersperse",
"them",
"with",
"objects",
"in",
"our",
"scene",
"and",
"need",
"to",
"manage",
"their",
"z",
"-",
"order",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1253-L1257 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.paintDirtyItems | protected void paintDirtyItems (Graphics2D gfx, Rectangle clip)
{
// add any sprites impacted by the dirty rectangle
_dirtySprites.clear();
_spritemgr.getIntersectingSprites(_dirtySprites, clip);
int size = _dirtySprites.size();
for (int ii = 0; ii < size; ii++) {
... | java | protected void paintDirtyItems (Graphics2D gfx, Rectangle clip)
{
// add any sprites impacted by the dirty rectangle
_dirtySprites.clear();
_spritemgr.getIntersectingSprites(_dirtySprites, clip);
int size = _dirtySprites.size();
for (int ii = 0; ii < size; ii++) {
... | [
"protected",
"void",
"paintDirtyItems",
"(",
"Graphics2D",
"gfx",
",",
"Rectangle",
"clip",
")",
"{",
"// add any sprites impacted by the dirty rectangle",
"_dirtySprites",
".",
"clear",
"(",
")",
";",
"_spritemgr",
".",
"getIntersectingSprites",
"(",
"_dirtySprites",
"... | Renders the dirty sprites and objects in the scene to the given graphics context. | [
"Renders",
"the",
"dirty",
"sprites",
"and",
"objects",
"in",
"the",
"scene",
"to",
"the",
"given",
"graphics",
"context",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1272-L1302 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.paintIndicators | protected void paintIndicators (Graphics2D gfx, Rectangle clip)
{
// make sure the indicators are ready
if (!_indicatorsLaidOut) {
for (Map.Entry<SceneObject, SceneObjectIndicator> entry : _indicators.entrySet()) {
SceneObjectIndicator indic = entry.getValue();
... | java | protected void paintIndicators (Graphics2D gfx, Rectangle clip)
{
// make sure the indicators are ready
if (!_indicatorsLaidOut) {
for (Map.Entry<SceneObject, SceneObjectIndicator> entry : _indicators.entrySet()) {
SceneObjectIndicator indic = entry.getValue();
... | [
"protected",
"void",
"paintIndicators",
"(",
"Graphics2D",
"gfx",
",",
"Rectangle",
"clip",
")",
"{",
"// make sure the indicators are ready",
"if",
"(",
"!",
"_indicatorsLaidOut",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"SceneObject",
",",
"SceneObjectInd... | Paint all the appropriate indicators for our scene objects. | [
"Paint",
"all",
"the",
"appropriate",
"indicators",
"for",
"our",
"scene",
"objects",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1318-L1345 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.paintIndicator | protected void paintIndicator (Graphics2D gfx, Rectangle clip, SceneObjectIndicator tip)
{
if (clip.intersects(tip.getBounds())) {
tip.paint(gfx);
}
} | java | protected void paintIndicator (Graphics2D gfx, Rectangle clip, SceneObjectIndicator tip)
{
if (clip.intersects(tip.getBounds())) {
tip.paint(gfx);
}
} | [
"protected",
"void",
"paintIndicator",
"(",
"Graphics2D",
"gfx",
",",
"Rectangle",
"clip",
",",
"SceneObjectIndicator",
"tip",
")",
"{",
"if",
"(",
"clip",
".",
"intersects",
"(",
"tip",
".",
"getBounds",
"(",
")",
")",
")",
"{",
"tip",
".",
"paint",
"("... | Paint the specified indicator if it intersects the clipping rectangle. | [
"Paint",
"the",
"specified",
"indicator",
"if",
"it",
"intersects",
"the",
"clipping",
"rectangle",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1350-L1355 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.paintTiles | protected void paintTiles (Graphics2D gfx, Rectangle clip)
{
// go through rendering our tiles
_paintOp.setGraphics(gfx);
_applicator.applyToTiles(clip, _paintOp);
_paintOp.setGraphics(null);
} | java | protected void paintTiles (Graphics2D gfx, Rectangle clip)
{
// go through rendering our tiles
_paintOp.setGraphics(gfx);
_applicator.applyToTiles(clip, _paintOp);
_paintOp.setGraphics(null);
} | [
"protected",
"void",
"paintTiles",
"(",
"Graphics2D",
"gfx",
",",
"Rectangle",
"clip",
")",
"{",
"// go through rendering our tiles",
"_paintOp",
".",
"setGraphics",
"(",
"gfx",
")",
";",
"_applicator",
".",
"applyToTiles",
"(",
"clip",
",",
"_paintOp",
")",
";"... | Renders the base and fringe layer tiles that intersect the
specified clipping rectangle. | [
"Renders",
"the",
"base",
"and",
"fringe",
"layer",
"tiles",
"that",
"intersect",
"the",
"specified",
"clipping",
"rectangle",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1361-L1367 | train |
threerings/nenya | core/src/main/java/com/threerings/miso/client/MisoScenePanel.java | MisoScenePanel.fillTile | protected void fillTile (
Graphics2D gfx, int tx, int ty, Color color)
{
Composite ocomp = gfx.getComposite();
gfx.setComposite(ALPHA_FILL_TILE);
Polygon poly = MisoUtil.getTilePolygon(_metrics, tx, ty);
gfx.setColor(color);
gfx.fill(poly);
gfx.setComposite(oc... | java | protected void fillTile (
Graphics2D gfx, int tx, int ty, Color color)
{
Composite ocomp = gfx.getComposite();
gfx.setComposite(ALPHA_FILL_TILE);
Polygon poly = MisoUtil.getTilePolygon(_metrics, tx, ty);
gfx.setColor(color);
gfx.fill(poly);
gfx.setComposite(oc... | [
"protected",
"void",
"fillTile",
"(",
"Graphics2D",
"gfx",
",",
"int",
"tx",
",",
"int",
"ty",
",",
"Color",
"color",
")",
"{",
"Composite",
"ocomp",
"=",
"gfx",
".",
"getComposite",
"(",
")",
";",
"gfx",
".",
"setComposite",
"(",
"ALPHA_FILL_TILE",
")",... | Fills the specified tile with the given color at 50% alpha.
Intended for debug-only tile highlighting purposes. | [
"Fills",
"the",
"specified",
"tile",
"with",
"the",
"given",
"color",
"at",
"50%",
"alpha",
".",
"Intended",
"for",
"debug",
"-",
"only",
"tile",
"highlighting",
"purposes",
"."
] | 3165a012fd859009db3367f87bd2a5b820cc760a | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/client/MisoScenePanel.java#L1373-L1382 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.