本文整理汇总了Java中master.flame.danmaku.danmaku.model.IDisplayer.getHeight方法的典型用法代码示例。如果您正苦于以下问题:Java IDisplayer.getHeight方法的具体用法?Java IDisplayer.getHeight怎么用?Java IDisplayer.getHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类master.flame.danmaku.danmaku.model.IDisplayer
的用法示例。
在下文中一共展示了IDisplayer.getHeight方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDisplayer
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
public BaseDanmakuParser setDisplayer(IDisplayer disp) {
this.mDisp = disp;
this.mDispWidth = disp.getWidth();
this.mDispHeight = disp.getHeight();
this.mDispDensity = disp.getDensity();
this.mScaledDensity = disp.getScaledDensity();
this.mContext.mDanmakuFactory.updateViewportState((float) this.mDispWidth, (float) this.mDispHeight, getViewportSizeFactor());
this.mContext.mDanmakuFactory.updateMaxDanmakuDuration();
return this;
}
示例2: setDisplayer
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
public BaseDanmakuParser setDisplayer(IDisplayer disp){
mDisp = disp;
mDispWidth = disp.getWidth();
mDispHeight = disp.getHeight();
mDispDensity = disp.getDensity();
mScaledDensity = disp.getScaledDensity();
mContext.mDanmakuFactory.updateViewportState(mDispWidth, mDispHeight, getViewportSizeFactor());
mContext.mDanmakuFactory.updateMaxDanmakuDuration();
return this;
}
示例3: isOutVerticalEdge
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
protected boolean isOutVerticalEdge(boolean overwriteInsert, BaseDanmaku drawItem,
IDisplayer disp, float topPos, BaseDanmaku firstItem, BaseDanmaku lastItem) {
if (topPos < 0 || (firstItem != null && firstItem.getTop() > 0) || topPos + drawItem.paintHeight > disp.getHeight()) {
return true;
}
return false;
}
示例4: setDisplayer
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
public BaseDanmakuParser setDisplayer(IDisplayer disp){
mDisp = disp;
mDispWidth = disp.getWidth();
mDispHeight = disp.getHeight();
mDispDensity = disp.getDensity();
mScaledDensity = disp.getScaledDensity();
return this;
}
示例5: checkVerticalEdge
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
protected float checkVerticalEdge(boolean overwriteInsert, BaseDanmaku drawItem,
IDisplayer disp, float topPos, BaseDanmaku firstItem, BaseDanmaku lastItem) {
if (topPos < 0 || (firstItem!=null && firstItem.getTop() > 0) || topPos + drawItem.paintHeight > disp.getHeight()) {
topPos = 0;
clear();
}
return topPos;
}
示例6: draw
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
public RenderingState draw(IDisplayer disp, IDanmakus danmakus, long startRenderTime) {
int lastTotalDanmakuCount = this.mRenderingState.totalDanmakuCount;
this.mRenderingState.reset();
IDanmakuIterator itr = danmakus.iterator();
int orderInScreen = 0;
this.mStartTimer.update(SystemClock.uptimeMillis());
int sizeInScreen = danmakus.size();
BaseDanmaku drawItem = null;
while (itr.hasNext()) {
drawItem = itr.next();
if (!drawItem.hasPassedFilter()) {
this.mContext.mDanmakuFilters.filter(drawItem, orderInScreen, sizeInScreen, this.mStartTimer, false, this.mContext);
}
if (drawItem.time >= startRenderTime && (!(drawItem.priority == (byte) 0 && drawItem.isFiltered()) && drawItem.time >= startRenderTime)) {
if (!drawItem.isDanmakuTypeFiltered || !drawItem.isFiltered()) {
if (drawItem.isLate()) {
if (this.mCacheManager == null || drawItem.hasDrawingCache()) {
break;
}
this.mCacheManager.addDanmaku(drawItem);
} else {
orderInScreen++;
if (!drawItem.isMeasured()) {
drawItem.measure(disp, false);
}
this.mDanmakusRetainer.fix(drawItem, disp, this.mVerifier);
if (!drawItem.isOutside() && drawItem.isShown()) {
if (drawItem.lines != null || drawItem.getBottom() <= ((float) disp.getHeight())) {
int renderingType = drawItem.draw(disp);
RenderingState renderingState;
if (renderingType == 1) {
renderingState = this.mRenderingState;
renderingState.cacheHitCount++;
} else if (renderingType == 2) {
renderingState = this.mRenderingState;
renderingState.cacheMissCount++;
if (this.mCacheManager != null) {
this.mCacheManager.addDanmaku(drawItem);
}
}
this.mRenderingState.addCount(drawItem.getType(), 1);
this.mRenderingState.addTotalCount(1);
if (!(this.mOnDanmakuShownListener == null || drawItem.firstShownFlag == this.mContext.mGlobalFlagValues.FIRST_SHOWN_RESET_FLAG)) {
drawItem.firstShownFlag = this.mContext.mGlobalFlagValues.FIRST_SHOWN_RESET_FLAG;
this.mOnDanmakuShownListener.onDanmakuShown(drawItem);
}
}
}
}
}
}
}
this.mRenderingState.nothingRendered = this.mRenderingState.totalDanmakuCount == 0;
this.mRenderingState.endTime = drawItem != null ? drawItem.time : -1;
if (this.mRenderingState.nothingRendered) {
this.mRenderingState.beginTime = -1;
}
this.mRenderingState.incrementCount = this.mRenderingState.totalDanmakuCount - lastTotalDanmakuCount;
this.mRenderingState.consumingTime = this.mStartTimer.update(SystemClock.uptimeMillis());
return this.mRenderingState;
}
示例7: isOutVerticalEdge
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
protected boolean isOutVerticalEdge(boolean overwriteInsert, BaseDanmaku drawItem, IDisplayer disp, float topPos, BaseDanmaku firstItem, BaseDanmaku lastItem) {
if (topPos < 0.0f || ((firstItem != null && firstItem.getTop() > 0.0f) || drawItem.paintHeight + topPos > ((float) disp.getHeight()))) {
return true;
}
return false;
}
示例8: fix
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
public void fix(BaseDanmaku drawItem, IDisplayer disp, Verifier verifier) {
if (!drawItem.isOutside()) {
boolean shown = drawItem.isShown();
float topPos = drawItem.getTop();
int lines = 0;
boolean willHit = (drawItem.isShown() || this.mVisibleDanmakus.isEmpty()) ? false : true;
boolean isOutOfVerticalEdge = false;
if (topPos < 0.0f) {
topPos = ((float) disp.getHeight()) - drawItem.paintHeight;
}
BaseDanmaku removeItem = null;
BaseDanmaku firstItem = null;
if (!shown) {
this.mCancelFixingFlag = false;
IDanmakuIterator it = this.mVisibleDanmakus.iterator();
while (!this.mCancelFixingFlag && it.hasNext()) {
lines++;
BaseDanmaku item = it.next();
if (item == drawItem) {
removeItem = null;
willHit = false;
break;
}
if (firstItem == null) {
firstItem = item;
if (firstItem.getBottom() != ((float) disp.getHeight())) {
break;
}
}
if (topPos < 0.0f) {
removeItem = null;
break;
}
willHit = DanmakuUtils.willHitInDuration(disp, item, drawItem, drawItem.getDuration(), drawItem.getTimer().currMillisecond);
if (!willHit) {
removeItem = item;
break;
}
topPos = item.getTop() - drawItem.paintHeight;
}
isOutOfVerticalEdge = isOutVerticalEdge(false, drawItem, disp, topPos, firstItem, null);
if (isOutOfVerticalEdge) {
topPos = ((float) disp.getHeight()) - drawItem.paintHeight;
willHit = true;
} else if (topPos >= 0.0f) {
willHit = false;
}
}
if (verifier == null || !verifier.skipLayout(drawItem, topPos, lines, willHit)) {
if (isOutOfVerticalEdge) {
clear();
}
drawItem.layout(disp, drawItem.getLeft(), topPos);
if (!shown) {
this.mVisibleDanmakus.removeItem(removeItem);
this.mVisibleDanmakus.addItem(drawItem);
}
}
}
}
示例9: draw
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
@Override
public RenderingState draw(IDisplayer disp, IDanmakus danmakus, long startRenderTime) {
int lastTotalDanmakuCount = mRenderingState.totalDanmakuCount;
mRenderingState.reset();
IDanmakuIterator itr = danmakus.iterator();
int orderInScreen = 0;
mStartTimer.update(SystemClock.uptimeMillis());
int sizeInScreen = danmakus.size();
BaseDanmaku drawItem = null;
while (itr.hasNext()) {
drawItem = itr.next();
if (!drawItem.hasPassedFilter()) {
mContext.mDanmakuFilters.filter(drawItem, orderInScreen, sizeInScreen, mStartTimer, false, mContext);
}
if (drawItem.time < startRenderTime
|| (drawItem.priority == 0 && drawItem.isFiltered())) {
continue;
}
if (drawItem.isLate()) {
if (mCacheManager != null && !drawItem.hasDrawingCache()) {
mCacheManager.addDanmaku(drawItem);
}
break;
}
if (drawItem.getType() == BaseDanmaku.TYPE_SCROLL_RL){
// 同屏弹幕密度只对滚动弹幕有效
orderInScreen++;
}
// measure
if (!drawItem.isMeasured()) {
drawItem.measure(disp, false);
}
// layout
mDanmakusRetainer.fix(drawItem, disp, mVerifier);
// draw
if (!drawItem.isOutside() && drawItem.isShown()) {
if (drawItem.lines == null && drawItem.getBottom() > disp.getHeight()) {
continue; // skip bottom outside danmaku
}
int renderingType = drawItem.draw(disp);
if(renderingType == IRenderer.CACHE_RENDERING) {
mRenderingState.cacheHitCount++;
} else if(renderingType == IRenderer.TEXT_RENDERING) {
mRenderingState.cacheMissCount++;
if (mCacheManager != null) {
mCacheManager.addDanmaku(drawItem);
}
}
mRenderingState.addCount(drawItem.getType(), 1);
mRenderingState.addTotalCount(1);
if (mOnDanmakuShownListener != null
&& drawItem.firstShownFlag != mContext.mGlobalFlagValues.FIRST_SHOWN_RESET_FLAG) {
drawItem.firstShownFlag = mContext.mGlobalFlagValues.FIRST_SHOWN_RESET_FLAG;
mOnDanmakuShownListener.onDanmakuShown(drawItem);
}
}
}
mRenderingState.nothingRendered = (mRenderingState.totalDanmakuCount == 0);
mRenderingState.endTime = drawItem != null ? drawItem.time : RenderingState.UNKNOWN_TIME;
if (mRenderingState.nothingRendered) {
mRenderingState.beginTime = RenderingState.UNKNOWN_TIME;
}
mRenderingState.incrementCount = mRenderingState.totalDanmakuCount - lastTotalDanmakuCount;
mRenderingState.consumingTime = mStartTimer.update(SystemClock.uptimeMillis());
return mRenderingState;
}
示例10: draw
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
@Override
public RenderingState draw(IDisplayer disp, IDanmakus danmakus, long startRenderTime) {
int lastTotalDanmakuCount = mRenderingState.totalDanmakuCount;
mRenderingState.reset();
IDanmakuIterator itr = danmakus.iterator();
int orderInScreen = 0;
mStartTimer.update(SystemClock.uptimeMillis());
int sizeInScreen = danmakus.size();
BaseDanmaku drawItem = null;
while (itr.hasNext()) {
drawItem = itr.next();
if (!drawItem.hasPassedFilter()) {
mContext.mDanmakuFilters.filter(drawItem, orderInScreen, sizeInScreen, mStartTimer, false, mContext);
}
if (drawItem.time < startRenderTime
|| (drawItem.priority == 0 && drawItem.isFiltered())) {
continue;
}
if (drawItem.isLate()) {
IDrawingCache<?> cache = drawItem.getDrawingCache();
if (mCacheManager != null && (cache == null || cache.get() == null)) {
mCacheManager.addDanmaku(drawItem);
}
break;
}
if (drawItem.getType() == BaseDanmaku.TYPE_SCROLL_RL){
// 同屏弹幕密度只对滚动弹幕有效
orderInScreen++;
}
// measure
if (!drawItem.isMeasured()) {
drawItem.measure(disp, false);
}
// layout
mDanmakusRetainer.fix(drawItem, disp, mVerifier);
// draw
if (!drawItem.isOutside() && drawItem.isShown()) {
if (drawItem.lines == null && drawItem.getBottom() > disp.getHeight()) {
continue; // skip bottom outside danmaku
}
int renderingType = drawItem.draw(disp);
if(renderingType == IRenderer.CACHE_RENDERING) {
mRenderingState.cacheHitCount++;
} else if(renderingType == IRenderer.TEXT_RENDERING) {
mRenderingState.cacheMissCount++;
if (mCacheManager != null) {
mCacheManager.addDanmaku(drawItem);
}
}
mRenderingState.addCount(drawItem.getType(), 1);
mRenderingState.addTotalCount(1);
if (mOnDanmakuShownListener != null
&& drawItem.firstShownFlag != mContext.mGlobalFlagValues.FIRST_SHOWN_RESET_FLAG) {
drawItem.firstShownFlag = mContext.mGlobalFlagValues.FIRST_SHOWN_RESET_FLAG;
mOnDanmakuShownListener.onDanmakuShown(drawItem);
}
}
}
mRenderingState.nothingRendered = (mRenderingState.totalDanmakuCount == 0);
mRenderingState.endTime = drawItem != null ? drawItem.time : RenderingState.UNKNOWN_TIME;
if (mRenderingState.nothingRendered) {
mRenderingState.beginTime = RenderingState.UNKNOWN_TIME;
}
mRenderingState.incrementCount = mRenderingState.totalDanmakuCount - lastTotalDanmakuCount;
mRenderingState.consumingTime = mStartTimer.update(SystemClock.uptimeMillis());
return mRenderingState;
}
示例11: fix
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
@Override
public void fix(BaseDanmaku drawItem, IDisplayer disp, Verifier verifier) {
if (drawItem.isOutside())
return;
boolean shown = drawItem.isShown();
float topPos = drawItem.getTop();
int lines = 0;
boolean willHit = !drawItem.isShown() && !mVisibleDanmakus.isEmpty();
boolean isOutOfVerticalEdge = false;
if (topPos < 0) {
topPos = disp.getHeight() - drawItem.paintHeight;
}
BaseDanmaku removeItem = null, firstItem = null;
if (!shown) {
mCancelFixingFlag = false;
IDanmakuIterator it = mVisibleDanmakus.iterator();
while (!mCancelFixingFlag && it.hasNext()) {
lines++;
BaseDanmaku item = it.next();
if (item == drawItem) {
removeItem = null;
willHit = false;
break;
}
if (firstItem == null) {
firstItem = item;
if (firstItem.getBottom() != disp.getHeight()) {
break;
}
}
if (topPos < 0) {
removeItem = null;
break;
}
// 检查碰撞
willHit = DanmakuUtils.willHitInDuration(disp, item, drawItem,
drawItem.getDuration(), drawItem.getTimer().currMillisecond);
if (!willHit) {
removeItem = item;
// topPos = item.getBottom() - drawItem.paintHeight;
break;
}
topPos = item.getTop() - drawItem.paintHeight;
}
isOutOfVerticalEdge = isOutVerticalEdge(false, drawItem, disp, topPos, firstItem, null);
if (isOutOfVerticalEdge) {
topPos = disp.getHeight() - drawItem.paintHeight;
willHit = true;
} else if (topPos >= 0) {
willHit = false;
}
}
if (verifier != null && verifier.skipLayout(drawItem, topPos, lines, willHit)) {
return;
}
if (isOutOfVerticalEdge) {
clear();
}
drawItem.layout(disp, drawItem.getLeft(), topPos);
if (!shown) {
mVisibleDanmakus.removeItem(removeItem);
mVisibleDanmakus.addItem(drawItem);
}
}
示例12: draw
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
@Override
public RenderingState draw(IDisplayer disp, IDanmakus danmakus, long startRenderTime) {
int lastTotalDanmakuCount = mRenderingState.totalDanmakuCount;
mRenderingState.reset();
IDanmakuIterator itr = danmakus.iterator();
int orderInScreen = 0;
mStartTimer.update(System.currentTimeMillis());
int sizeInScreen = danmakus.size();
BaseDanmaku drawItem = null;
while (itr.hasNext()) {
drawItem = itr.next();
if (drawItem.isLate()) {
break;
}
if (!drawItem.hasPassedFilter()) {
mContext.mDanmakuFilters.filter(drawItem, orderInScreen, sizeInScreen, mStartTimer, false, mContext);
}
if (drawItem.time < startRenderTime
|| (drawItem.priority == 0 && drawItem.isFiltered())) {
continue;
}
if (drawItem.getType() == BaseDanmaku.TYPE_SCROLL_RL){
// 同屏弹幕密度只对滚动弹幕有效
orderInScreen++;
}
// measure
if (!drawItem.isMeasured()) {
drawItem.measure(disp);
}
// layout
mDanmakusRetainer.fix(drawItem, disp, mVerifier);
// draw
if (!drawItem.isOutside() && drawItem.isShown()) {
if (drawItem.lines == null && drawItem.getBottom() > disp.getHeight()) {
continue; // skip bottom outside danmaku
}
int renderingType = drawItem.draw(disp);
if(renderingType == IRenderer.CACHE_RENDERING) {
mRenderingState.cacheHitCount++;
} else if(renderingType == IRenderer.TEXT_RENDERING) {
mRenderingState.cacheMissCount++;
}
mRenderingState.addCount(drawItem.getType(), 1);
mRenderingState.addTotalCount(1);
}
}
mRenderingState.nothingRendered = (mRenderingState.totalDanmakuCount == 0);
mRenderingState.endTime = drawItem != null ? drawItem.time : RenderingState.UNKNOWN_TIME;
if (mRenderingState.nothingRendered) {
mRenderingState.beginTime = RenderingState.UNKNOWN_TIME;
}
mRenderingState.incrementCount = mRenderingState.totalDanmakuCount - lastTotalDanmakuCount;
mRenderingState.consumingTime = mStartTimer.update(System.currentTimeMillis());
return mRenderingState;
}
示例13: draw
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
@Override
public RenderingState draw(IDisplayer disp, IDanmakus danmakus, long startRenderTime) {
mRenderingState.reset();
float left = disp.getWidth(),top = disp.getHeight(), right = 0 ,bottom = 0;
boolean fullScreenRefreshing = false;
IDanmakuIterator itr = danmakus.iterator();
int orderInScreen = 0;
mStartTimer.update(System.currentTimeMillis());
int sizeInScreen = danmakus.size();
while (itr.hasNext()) {
BaseDanmaku drawItem = itr.next();
if (drawItem.time < startRenderTime
|| (drawItem.priority == 0 && DanmakuFilters.getDefault().filter(drawItem,
orderInScreen, sizeInScreen, mStartTimer))) {
continue;
}
if(drawItem.getType() == BaseDanmaku.TYPE_SCROLL_RL){
// 同屏弹幕密度只对滚动弹幕有效
orderInScreen++;
}
// measure
if (!drawItem.isMeasured()) {
drawItem.measure(disp);
}
// layout
DanmakusRetainer.fix(drawItem, disp);
// draw
if (!drawItem.isOutside() && drawItem.isShown()) {
drawItem.draw(disp);
mRenderingState.add(drawItem.getType(), 1);
mRenderingState.add(1);
}
if (fullScreenRefreshing)
continue;
// calculate the refreshing area
if (drawItem.getType() == BaseDanmaku.TYPE_SPECIAL
&& (drawItem.rotationY != 0 || drawItem.rotationZ != 0)) {
left = 0;
top = 0;
right = disp.getWidth();
bottom = disp.getHeight();
fullScreenRefreshing = true;
continue;
}
float dtop = 0, dbottom = 0;
float dleft = drawItem.getLeft();
float dright = drawItem.getRight();
dtop = drawItem.getTop();
dbottom = drawItem.getBottom();
left = Math.min(dleft, left);
top = Math.min(dtop, top);
right = Math.max(dright, right);
bottom = Math.max(dbottom, bottom);
}
float borderWidth = disp.getStrokeWidth() * 2;
mRefreshArea.set(left, top, right + borderWidth, bottom + borderWidth);
mRenderingState.consumingTime = mStartTimer.update(System.currentTimeMillis());
return mRenderingState;
}
示例14: fix
import master.flame.danmaku.danmaku.model.IDisplayer; //导入方法依赖的package包/类
@Override
public void fix(BaseDanmaku drawItem, IDisplayer disp) {
if (drawItem.isOutside())
return;
boolean shown = drawItem.isShown();
float topPos = drawItem.getTop();
if (topPos < 0) {
topPos = disp.getHeight() - drawItem.paintHeight;
}
BaseDanmaku removeItem = null, firstItem = null;
if (!shown) {
IDanmakuIterator it = mVisibleDanmakus.iterator();
while (it.hasNext()) {
BaseDanmaku item = it.next();
if (item == drawItem) {
removeItem = null;
break;
}
if (firstItem == null) {
firstItem = item;
if (firstItem.getBottom() != disp.getHeight()) {
break;
}
}
if (topPos < 0) {
removeItem = null;
break;
}
// 检查碰撞
boolean willHit = DanmakuUtils.willHitInDuration(disp, item, drawItem,
drawItem.getDuration(), drawItem.getTimer().currMillisecond);
if (!willHit) {
removeItem = item;
// topPos = item.getBottom() - drawItem.paintHeight;
break;
}
topPos = item.getTop() - drawItem.paintHeight;
}
topPos = checkVerticalEdge(false, drawItem, disp, topPos, firstItem, null);
}
drawItem.layout(disp, drawItem.getLeft(), topPos);
if (!shown) {
mVisibleDanmakus.removeItem(removeItem);
mVisibleDanmakus.addItem(drawItem);
}
}