Constructor and Description |
---|
ScaleScene() |
ScaleScene(int width,
int height,
GraphicScaleStrategy scaleStrategy) |
Modifier and Type | Method and Description |
---|---|
Point |
convertGlobalToLocal(Point point)
Converts a global point (real size) to local point (fixed size).
|
Point |
convertLocalToGlobal(Point point)
Converts a local point (fixed size) to global point (real size).
|
protected double |
getFactorX()
Get the scale factor for scene width (realWidth / fixedWidth).
|
protected double |
getFactorY()
Get the scale factor for scene height (realHeight / fixedHeight).
|
int |
getHeight() |
GraphicScaleStrategy |
getScaleStrategy() |
protected double |
getTranslateX()
Get the translation for scene width.
|
protected double |
getTranslateY()
Get the translation for scene height.
|
int |
getWidth() |
protected abstract void |
paintFixedScene(Graphics2D g,
long elapsedTime) |
void |
paintScene(Graphics2D g,
int realWidth,
int realHeight,
long elapsedTime)
Draw actual scene state
|
void |
setScaleStrategy(GraphicScaleStrategy scaleStrategy) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEventListeners
public ScaleScene(int width, int height, GraphicScaleStrategy scaleStrategy)
public ScaleScene()
public void paintScene(Graphics2D g, int realWidth, int realHeight, long elapsedTime)
Scene
paintScene
in interface Scene
g
- Graphics2D
object to draw onrealWidth
- Width of painting arearealHeight
- Height of painting areaelapsedTime
- Time since the last paintingpublic int getWidth()
public int getHeight()
public GraphicScaleStrategy getScaleStrategy()
public void setScaleStrategy(GraphicScaleStrategy scaleStrategy)
protected abstract void paintFixedScene(Graphics2D g, long elapsedTime)
protected double getFactorX()
paintFixedScene(Graphics2D, long)
.protected double getFactorY()
paintFixedScene(Graphics2D, long)
.protected double getTranslateX()
paintFixedScene(Graphics2D, long)
.protected double getTranslateY()
paintFixedScene(Graphics2D, long)
.public Point convertGlobalToLocal(Point point)
paintFixedScene(Graphics2D, long)
.public Point convertLocalToGlobal(Point point)
paintFixedScene(Graphics2D, long)
.Copyright © 2017. All rights reserved.