TeeChartPHP
[
class tree: TeeChartPHP
] [
index: TeeChartPHP
] [
all elements
]
Todo List
Packages:
TeeChartPHP
Source for file Imports.php
Documentation is available at
Imports.php
<?php
/**
* Imports class
*
* Description:
*
*
@author
*
@copyright
(c) 1995-2008 by Steema Software SL. All Rights Reserved. <info@steema.com>
*
@version
1.0
*
@package
TeeChartPHP
*
@subpackage
imports
*
@link
http://www.steema.com
*/
class
Imports
extends
TeeBase
{
private
$template
;
private
$xml
;
// Interceptors
function
__get
(
$property
)
{
$method
=
"
get{
$property
}
"
;
if
(
method_exists
(
$this
,
$method
) )
{
return
$this
->
$method
(
)
;
}
}
function
__set
(
$property
,
$value
)
{
$method
=
"
set{
$property
}
"
;
if
(
method_exists
(
$this
,
$method
) )
{
return
$this
->
$method
(
$value
)
;
}
}
public
function
Imports
(
$c
)
{
parent
::
__construct
(
$c
)
;
}
public
function
getTemplate
(
)
{
if
(
$this
->
template
==
null
)
{
$this
->
template
=
new
Template
(
$this
->
chart
)
;
}
return
$this
->
template
;
}
public
function
getXML
(
)
{
if
(
$this
->
xml
==
null
)
{
$this
->
xml
=
new
XMLImport
(
$this
->
chart
)
;
}
return
$this
->
xml
;
}
}
class
Template
{
private
$chart
;
function
Template
(
$c
=
null
)
{
$this
->
chart
=
$c
;
}
/**
*
@return
TChart
Object
*/
public
function
fromFile
(
$fileName
)
{
if
(
file_exists
(
$fileName
))
{
$str
=
file_get_contents
(
$fileName
)
;
if
(
$str
!=
false
)
{
$newo
=
SerializeManager
::
instance
(
)
->
unserializeObject
(
$str
)
;
$newo
->
getGraphics3D
(
)
->
img
=
$this
->
chart
->
getGraphics3D
(
)
->
img
;
return
$newo
;
}
else
{
// There's not strings into the file
echo
"The Files does not contain any string to import !"
;
}
}
else
{
// File does not exists
echo
"The File doex not exists !"
;
}
}
/* public function fromXML($fileName) /* TODO throws FileNotFoundException {
return $this->fromXML(new BufferedInputStream(
new FileInputStream($fileName)));
return $filename;
}
public function fromXML($stream)
{
$decoder = new XMLDecoder($stream);
$decoder->setExceptionListener(new ExceptionListener()
{
public function exceptionThrown($exception)
{
$exception->printStackTrace();
}
}
);
$result = null;
try
{
$result = ($this->Chart)$this->decoder->readObject();
}
$this->finally{
$this->decoder->close();
}
if(($this->chart->getParent() != null))
(($this->com->steema->teechart->TChart)($this->chart->getParent()))->setChart($result);
return $result;
}
*/
/* TODO
public function fromFile($fileName) throws FileNotFoundException,
IOException, ClassNotFoundException{
return fromStream(new BufferedInputStream(new FileInputStream(
fileName)));
}
public function fromFile($file)throws FileNotFoundException,
IOException, ClassNotFoundException{
return fromFile(file . getPath());
}
public function fromStream($stream)throws IOException,
ClassNotFoundException{
ObjectInputStream in = new ObjectInputStream(stream);
Chart result = null;
try
{
result = (Chart)in . readObject();
}finally{
in . close();
}
return result;
}
*/
}
?>
Documentation generated on Wed, 16 Jun 2010 12:06:28 +0200 by
phpDocumentor 1.4.1