// Import framework stuff
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Registry\Registerable;
-use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
+use Org\Mxchange\CoreFramework\Traits\Template\CompileableTemplateTrait;
/**
* A general image class
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseImage extends BaseFrameworkSystem implements Registerable {
+ // Load traits
+ use CompileableTemplateTrait;
+
/**
* Image type
*/
/**
* Width of the image
*/
- private $width = '';
+ private $width = 0;
/**
* Height of the image
*/
- private $height = '';
+ private $height = 0;
/**
* X/Y
*/
- private $x = '';
- private $y = '';
+ private $x = 0;
+ private $y = 0;
/**
* Font size
*/
- private $fontSize = '';
+ private $fontSize = 0;
/**
* Image string
*/
private $groupable = 'single';
- /**
- * Template engine instance
- */
- private $templateInstance = NULL;
-
/**
* Protected constructor
*
* @param $string String to set in image
* @return void
*/
- public final function setString ($string) {
- $this->imageString = (string) $string;
+ public final function setString (string $string) {
+ $this->imageString = $string;
}
/**
* @param $name Name of the image
* @return void
*/
- public final function setImageName ($name) {
- $this->imageName = (string) $name;
+ public final function setImageName (string $name) {
+ $this->imageName = $name;
}
/**
$this->stringName = $stringName;
}
- /**
- * Setter for template engine instances
- *
- * @param $templateInstance An instance of a CompileableTemplate class
- * @return void
- */
- protected final function setTemplateInstance (CompileableTemplate $templateInstance) {
- $this->templateInstance = $templateInstance;
- }
-
- /**
- * Getter for template engine instances
- *
- * @return $templateInstance An instance of a CompileableTemplate class
- */
- public final function getTemplateInstance () {
- return $this->templateInstance;
- }
-
/**
* Finish this image by producing it
*
// Set the image string
//* DEBUG: */ print __METHOD__.": size={$size}, x={$x}, y={$y}, string={$imageString}<br />\n";
imagestring($this->getImageResource(), $size, $x, $y, $imageString, $foreColor);
- } // END - foreach
+ }
break;
}