Package paintingcanvas.canvas
Class CanvasOptions
- java.lang.Object
-
- paintingcanvas.canvas.CanvasOptions
-
public class CanvasOptions extends java.lang.Object
A list of options that control the behavior of the canvas
-
-
Field Summary
Fields Modifier and Type Field Description boolean
antiAlias
Whether to do antialiasing when drawing shapesboolean
autoAdd
Whether to automatically addDrawable
's upon construction / instantiation.boolean
autoCenter
Whether to automatically center what's on screen whenever the screen is resizedjava.awt.Color
backgroundColor
The background color of the canvasint
fps
The FPS to run rendering at
-
Constructor Summary
Constructors Constructor Description CanvasOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CanvasOptions
antiAlias(boolean antiAlias)
Default:true
CanvasOptions
autoAdd(boolean autoAdd)
Default:true
CanvasOptions
autoCenter(boolean autoCenter)
Default:true
CanvasOptions
backgroundColor(java.awt.Color backgroundColor)
Default:Color.WHITE
java.awt.Color
getBackgroundColor()
boolean
isAntiAlias()
boolean
isAutoAdd()
boolean
isAutoCenter()
-
-
-
Field Detail
-
autoAdd
public boolean autoAdd
Whether to automatically addDrawable
's upon construction / instantiation.default:
true
-
autoCenter
public boolean autoCenter
Whether to automatically center what's on screen whenever the screen is resizeddefault:
true
-
antiAlias
public boolean antiAlias
Whether to do antialiasing when drawing shapesdefault:
true
-
backgroundColor
public java.awt.Color backgroundColor
The background color of the canvasdefault:
Color.WHITE
-
fps
public int fps
The FPS to run rendering atdefault:
30
-
-
Method Detail
-
isAutoAdd
public boolean isAutoAdd()
- Returns:
- Weather
Drawable
s are automatically added to the canvas upon construction - See Also:
autoAdd(boolean)
-
autoAdd
public CanvasOptions autoAdd(boolean autoAdd)
Default:true
- Parameters:
autoAdd
- Whether to automatically addDrawable
's upon construction / instantiation.- Returns:
- This object for chaining
- See Also:
isAutoAdd()
-
isAutoCenter
public boolean isAutoCenter()
- Returns:
- Whether to automatically center what's on screen whenever the screen is resized
- See Also:
autoCenter(boolean)
-
autoCenter
public CanvasOptions autoCenter(boolean autoCenter)
Default:true
- Parameters:
autoCenter
- Whether to automatically center what's on screen whenever the screen is resized- Returns:
- This object for chaining
- See Also:
isAutoCenter()
-
isAntiAlias
public boolean isAntiAlias()
- Returns:
- Whether to use antialiasing
- See Also:
antiAlias(boolean)
-
antiAlias
public CanvasOptions antiAlias(boolean antiAlias)
Default:true
- Parameters:
antiAlias
- Whether to use antialiasing- Returns:
- This object for chaining
- See Also:
isAntiAlias()
-
getBackgroundColor
public java.awt.Color getBackgroundColor()
- Returns:
- The background color of the canvas
- See Also:
backgroundColor(Color)
-
backgroundColor
public CanvasOptions backgroundColor(java.awt.Color backgroundColor)
Default:Color.WHITE
- Parameters:
backgroundColor
- The background color of the canvas- Returns:
- This object for chaining
- See Also:
getBackgroundColor()
-
-