本文整理了Java中java.awt.Canvas.getHeight()
方法的一些代码示例,展示了Canvas.getHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.getHeight()
方法的具体详情如下:
包路径:java.awt.Canvas
类名称:Canvas
方法名:getHeight
暂无
代码示例来源:origin: libgdx/libgdx
public int getHeight () {
return Math.round(super.getHeight() * scaleY);
}
};
代码示例来源:origin: libgdx/libgdx
public int getHeight () {
return Math.round(super.getHeight() * scaleY);
}
};
代码示例来源:origin: libgdx/libgdx
private void checkCatched (MouseEvent e) {
if (catched && robot != null && canvas.isShowing()) {
int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x;
int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y;
if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) {
robot.mouseMove(x, y);
}
}
}
代码示例来源:origin: libgdx/libgdx
private void checkCatched (MouseEvent e) {
if (catched && robot != null && canvas.isShowing()) {
int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x;
int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y;
if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) {
robot.mouseMove(x, y);
}
}
}
代码示例来源:origin: libgdx/libgdx
public int getHeight () {
if (canvas != null)
return Math.max(1, canvas.getHeight());
else
return (int)(Display.getHeight() * Display.getPixelScaleFactor());
}
代码示例来源:origin: libgdx/libgdx
public int getHeight () {
if (canvas != null)
return Math.max(1, canvas.getHeight());
else
return (int)(Display.getHeight() * Display.getPixelScaleFactor());
}
代码示例来源:origin: libgdx/libgdx
LwjglGraphics (Canvas canvas) {
this.config = new LwjglApplicationConfiguration();
config.width = canvas.getWidth();
config.height = canvas.getHeight();
this.canvas = canvas;
}
代码示例来源:origin: libgdx/libgdx
LwjglGraphics (Canvas canvas) {
this.config = new LwjglApplicationConfiguration();
config.width = canvas.getWidth();
config.height = canvas.getHeight();
this.canvas = canvas;
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
int newHeight = Math.max(canvas.getHeight(), 1);
if (width != newWidth || height != newHeight){
width = newWidth;
代码示例来源:origin: runelite/runelite
graphics.fillRect(0, 0, client.getCanvas().getWidth(), client.getCanvas().getHeight());
代码示例来源:origin: libgdx/libgdx
int height = graphics.canvas.getHeight();
if (lastWidth != width || lastHeight != height) {
lastWidth = width;
代码示例来源:origin: libgdx/libgdx
int height = graphics.canvas.getHeight();
if (lastWidth != width || lastHeight != height) {
lastWidth = width;
代码示例来源:origin: google/sagetv
public void componentResized(java.awt.event.ComponentEvent evt)
{
synchronized (inputQueue)
{
inputQueue.add(new java.awt.Dimension(c.getWidth(), c.getHeight()));
inputQueue.notifyAll();
}
}
});
代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl
private void checkCatched (MouseEvent e) {
if (catched && robot != null && canvas.isShowing()) {
int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x;
int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y;
if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) {
robot.mouseMove(x, y);
}
}
}
代码示例来源:origin: google/sagetv
public void componentResized(java.awt.event.ComponentEvent evt)
{
if (myConn != null)
myConn.postResizeEvent(new java.awt.Dimension(c.getWidth(), c.getHeight()));
}
});
代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl
LwjglGraphics (Canvas canvas) {
this.config = new LwjglApplicationConfiguration();
config.width = canvas.getWidth();
config.height = canvas.getHeight();
this.canvas = canvas;
}
代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport
/**
* Returns the size of the canvas as a vector.
* @return size of the canvas in pixel
*/
public IVector2 getCanvasSize()
{
return new Vector2Double(canvas_.getWidth(), canvas_.getHeight());
}
代码示例来源:origin: com.projectdarkstar.example.projectsnowman/snowman-world-editor
@Override
public void componentResized(ComponentEvent ce) {
impl.resizeCanvas(comp.getWidth(), comp.getHeight());
}
});
代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport
/**
* Returns the size of a pixel.
* @retun size of a pixel
*/
public IVector2 getPixelSize()
{
Canvas canvas = canvas_;
if (canvas == null)
return Vector2Double.ZERO;
return paddedSize_.copy().divide(new Vector2Double(canvas.getWidth(), canvas.getHeight()));
}
代码示例来源:origin: org.activecomponents.jadex/jadex-kernel-extension-envsupport
public void componentResized(ComponentEvent e)
{
if ((canvas_.getWidth() == 0) || (canvas_.getHeight() == 0))
return;
IVector2 oldPaddedSize = paddedSize_.copy();
setSize(size_);
setPosition(paddedSize_.copy().subtract(oldPaddedSize).multiply(0.5).negate().add(position_));
}
内容来源于网络,如有侵权,请联系作者删除!