• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP java函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中java函数的典型用法代码示例。如果您正苦于以下问题:PHP java函数的具体用法?PHP java怎么用?PHP java使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了java函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @param $paragraph
  * @param $mainStyleSheet
  */
 function __construct($paragraph, $mainStyleSheet)
 {
     if (java_instanceof($paragraph, java('org.apache.poi.xwpf.usermodel.XWPFParagraph'))) {
         $this->paragraph = $paragraph;
     }
     $this->mainStyleSheet = $mainStyleSheet;
 }
开发者ID:skypeter1,项目名称:webapps,代码行数:11,代码来源:XWPFParagraph.php


示例2: autoFitTableToWindow

 public static function autoFitTableToWindow($dataDir)
 {
     //ExStart
     //ExFor:Table.AutoFit
     //ExFor:AutoFitBehavior
     //ExId:FitTableToPageWidth
     //ExSummary:Autofits a table to fit the page width.
     // Open the document
     $doc = new java("com.aspose.words.Document", $dataDir . "TestFile.doc");
     $nodeType = java("com.aspose.words.NodeType");
     $table = $doc->getChild($nodeType->TABLE, 0, true);
     // Autofit the first table to the page width.
     $autoFitBehavior = new Java("com.aspose.words.AutoFitBehavior");
     $table->autoFit($autoFitBehavior->AUTO_FIT_TO_WINDOW);
     // Save the document to disk.
     $doc->save($dataDir . "TestFile.AutoFitToWindow Out.doc");
     //ExEnd
     $preferredWidthType = new Java("com.aspose.words.PreferredWidthType");
     if (java_values($doc->getFirstSection()->getBody()->getTables()->get(0)->getPreferredWidth()->getType()) == java_values($preferredWidthType->PERCENT)) {
         echo "PreferredWidth type is not percent <br />";
     }
     if (java_values($doc->getFirstSection()->getBody()->getTables()->get(0)->getPreferredWidth()->getValue()) == 100) {
         echo "PreferredWidth value is different than 100 <br />";
     }
 }
开发者ID:XEdwin,项目名称:Aspose_Words_Java,代码行数:25,代码来源:AutoFitTables.php


示例3: main

 public static function main()
 {
     echo "<pre>";
     self::printTime("initializing...");
     self::clearDir(self::$NEO4J_DB, false);
     self::$neo = new java("org.neo4j.kernel.EmbeddedGraphDatabase", self::$NEO4J_DB);
     self::$neo->shutdown();
     self::printTime("clean db created");
     self::$inserter = new java("org.neo4j.kernel.impl.batchinsert.BatchInserterImpl", self::$NEO4J_DB);
     self::createChildren(self::$inserter->getReferenceNode(), 10, 1);
     self::$inserter->shutdown();
     self::printTime("nodes created");
     self::$neo = new java("org.neo4j.kernel.EmbeddedGraphDatabase", self::$NEO4J_DB);
     for ($i = 0; $i < 10; $i++) {
         echo "\ntraversing through all nodes and counting depthSum...";
         $tx = self::$neo->beginTx();
         $traverser = self::$neo->getReferenceNode()->traverse(java('org.neo4j.graphdb.Traverser$Order')->BREADTH_FIRST, java('org.neo4j.graphdb.StopEvaluator')->END_OF_GRAPH, java('org.neo4j.graphdb.ReturnableEvaluator')->ALL_BUT_START_NODE, java('org.neo4j.graphdb.DynamicRelationshipType')->withName('PARENT'), java('org.neo4j.graphdb.Direction')->OUTGOING);
         $depthSum = 0;
         $nodes = $traverser->iterator();
         while (java_values($nodes->hasNext())) {
             $node = $nodes->next();
             $depthSum += intval(java_values($node->getProperty("level")));
         }
         $tx->finish();
         $tx->success();
         echo "\ndepthSum = {$depthSum}";
         self::printTime("done traversing");
     }
     self::$neo->shutdown();
     echo "\nneo has been shut down";
     echo "</pre>";
 }
开发者ID:peterneubauer,项目名称:neo4j-php-wrapper,代码行数:32,代码来源:SimpleTest.php


示例4: __construct

 /**
  * @param $run
  * @param $mainStyleSheet
  */
 function __construct($run, $mainStyleSheet)
 {
     if (java_instanceof($run, java('org.apache.poi.xwpf.usermodel.XWPFRun'))) {
         $this->run = $run;
     }
     $this->mainStyleSheet = $mainStyleSheet;
 }
开发者ID:skypeter1,项目名称:webapps,代码行数:11,代码来源:XWPFRun.php


示例5: MBeanServer

 public function MBeanServer($id = null)
 {
     if (isset($id)) {
         $this->delegate = java("com.caucho.quercus.lib.resin.MBeanServer", $id);
     } else {
         $this->delegate = java("com.caucho.quercus.lib.resin.MBeanServer");
     }
 }
开发者ID:xaviernoumbis,项目名称:resin-taint-analysis,代码行数:8,代码来源:MBeanServer.php


示例6: __construct

 /**
  * @param $picture
  * @param $mainStyleSheet
  * @param $path
  */
 function __construct($picture, $mainStyleSheet, $path)
 {
     if (java_instanceof($picture, java('org.apache.poi.xwpf.usermodel.XWPFPicture'))) {
         $this->picture = $picture;
     }
     $this->mainStyleSheet = $mainStyleSheet;
     $this->_tmp_path = $path;
 }
开发者ID:skypeter1,项目名称:webapps,代码行数:13,代码来源:XWPFPicture.php


示例7: __construct

 /**
  * @param $element
  */
 function __construct($element)
 {
     if (java_instanceof($element, java('org.apache.poi.xwpf.usermodel.XWPFSDT'))) {
         $toc = java_cast($element, 'org.apache.poi.xwpf.usermodel.XWPFSDT');
         $this->toc = $toc;
         $this->idList = array();
         $this->tableContents = array();
     }
 }
开发者ID:skypeter1,项目名称:webapps,代码行数:12,代码来源:TableOfContents.php


示例8: __construct

 function __construct($style)
 {
     if (java_instanceof($style, java('org.apache.poi.xwpf.usermodel.XWPFStyle'))) {
         $this->style = $style;
     } else {
         echo "This is not  Style Class";
         die;
     }
 }
开发者ID:skypeter1,项目名称:webapps,代码行数:9,代码来源:XWPFStyle.php


示例9: __construct

 function __construct($cell, $mainStyleSheet)
 {
     if (java_instanceof($cell, java('org.apache.poi.xwpf.usermodel.XWPFTableCell'))) {
         $this->cell = $cell;
     } else {
         throw new Exception("[XWPFTableCell::new XWPFTableCell] Cell cannot be null");
     }
     $this->mainStyleSheet = $mainStyleSheet;
     $this->xmlCell = $this->getXMLCellObject();
 }
开发者ID:skypeter1,项目名称:webapps,代码行数:10,代码来源:XWPFTableCell.php


示例10: create_index_dir

/** create a temporary directory for the lucene index files. Make sure
 * to create the tmpdir from Java so that the directory has
 * javabridge_tmp_t Security Enhanced Linux permission. Note that PHP
 * does not have access to tempfiles with java_bridge_tmp_t: PHP
 * inherits the rights from the HTTPD, usually httpd_tmp_t.
 */
function create_index_dir()
{
    global $tmp_file, $tmp_dir;
    $javaTmpdir = java("java.lang.System")->getProperty("java.io.tmpdir");
    $tmpdir = java_values($javaTmpdir);
    $tmp_file = tempnam($tmpdir, "idx");
    $tmp_dir = new java("java.io.File", "{$tmp_file}.d");
    $tmp_dir->mkdir();
    return java_values($tmp_dir->toString());
}
开发者ID:dreamsxin,项目名称:php-java-bridge,代码行数:16,代码来源:lucene_search.old.php


示例11: init

 function init()
 {
     $SWT = new JavaClass("org.eclipse.swt.SWT");
     $shell = $this->shell = new java("org.eclipse.swt.widgets.Shell");
     $shell->setSize(320, 200);
     $shell->setLayout(new java("org.eclipse.swt.layout.FillLayout"));
     $button = new Java("org.eclipse.swt.widgets.Button", $this->shell, $SWT->PUSH);
     $button->setText("Click here.");
     $button->addSelectionListener(java_closure($this, null, java("org.eclipse.swt.events.SelectionListener")));
     $this->shell->open();
 }
开发者ID:dreamsxin,项目名称:php-java-bridge,代码行数:11,代码来源:swt-button.php


示例12: java_PageContext

 function java_PageContext($java_session)
 {
     if (java_is_null($java_session)) {
         throw new Exception("session is null");
     }
     $ctx = java_context();
     $this->servlet = $ctx->getAttribute("php.java.servlet.Servlet");
     $this->response = $ctx->getAttribute("php.java.servlet.HttpServletResponse");
     $this->request = $ctx->getAttribute("php.java.servlet.HttpServletRequest");
     $factory = java("javax.servlet.jsp.JspFactory")->getDefaultFactory();
     $this->pc = $factory->getPageContext($this->servlet, $this->request, $this->response, null, true, 8192, false);
     $this->out = $this->pc->out;
 }
开发者ID:dreamsxin,项目名称:php-java-bridge,代码行数:13,代码来源:JspTag.php


示例13: run

 function run()
 {
     $name = java_values(java_context()->getAttribute("name", 100));
     // engine scope
     $out = new Java("java.io.FileOutputStream", "{$name}.out", true);
     $Thread = java("java.lang.Thread");
     $nr = java_values(java_context()->getAttribute("nr", 100));
     echo "started thread: {$nr}\n";
     for ($i = 0; $i < 10; $i++) {
         $out->write(ord("{$nr}"));
         $Thread->yield();
     }
     $out->close();
 }
开发者ID:dreamsxin,项目名称:php-java-bridge,代码行数:14,代码来源:script_api.php


示例14: createComponents

 function createComponents()
 {
     $button = new java("javax.swing.JButton", "I'm a Swing button!");
     // set the label before we close over $this
     $this->label = new java("javax.swing.JLabel");
     $button->addActionListener(java_closure($this, null, java("java.awt.event.ActionListener")));
     $this->label->setLabelFor($button);
     $pane = new java("javax.swing.JPanel", new java("java.awt.GridLayout", 0, 1));
     $pane->add($button);
     $pane->add($this->label);
     $BorderFactory = new JavaClass("javax.swing.BorderFactory");
     $pane->setBorder($BorderFactory->createEmptyBorder(30, 30, 10, 30));
     return $pane;
 }
开发者ID:dreamsxin,项目名称:php-java-bridge,代码行数:14,代码来源:SwingTest.php


示例15: renderReport

 public function renderReport($reportName, $options = [], $outputType = self::OUTPUT_TYPE_HTML)
 {
     $reportPath = ArrayHelper::getValue($options, 'reportPath', $this->reportPath);
     if ($reportPath === null) {
         throw new InvalidConfigException('The "reportPath" property must be set.');
     }
     $reportPath = Yii::getAlias($reportPath);
     $context = java_context()->getServletContext();
     $birtReportEngine = java("org.eclipse.birt.php.birtengine.BirtEngine")->getBirtEngine($context);
     java_context()->onShutdown(java("org.eclipse.birt.php.birtengine.BirtEngine")->getShutdownHook());
     $report = $birtReportEngine->openReportDesign("{$reportPath}/{$reportName}");
     //        $parameterArray = $report->getDesignHandle()->getParameters();
     //        $ds = $report->getDesignHandle()->findDataSource("Data Source");
     //        $ds->setProperty('odaURL', 'jdbc:postgresql://localhost:5432/mdmbiz3');
     $task = $birtReportEngine->createRunAndRenderTask($report);
     if (!empty($options['params'])) {
         foreach ($options['params'] as $key => $value) {
             $nval = new Java("java.lang.String", $value);
             $task->setParameterValue($key, $nval);
         }
     }
     if ($outputType == self::OUTPUT_TYPE_PDF) {
         $outputOptions = ['pdfRenderOption.pageOverflow' => 'pdfRenderOption.fitToPage'];
     } else {
         $outputOptions = [];
     }
     if (!empty($options['options'])) {
         $outputOptions = array_merge($outputOptions, $options['options']);
     }
     $optionClass = isset($this->optionClasses[$outputType]) ? $this->optionClasses[$outputType] : $this->optionClasses['default'];
     $taskOptions = new Java($optionClass);
     $outputStream = new Java("java.io.ByteArrayOutputStream");
     $taskOptions->setOutputStream($outputStream);
     foreach ($outputOptions as $key => $value) {
         $taskOptions->setOption($key, $value);
     }
     $taskOptions->setOutputFormat($outputType);
     if ($outputType == self::OUTPUT_TYPE_HTML) {
         $ih = new Java("org.eclipse.birt.report.engine.api.HTMLServerImageHandler");
         $taskOptions->setImageHandler($ih);
         $taskOptions->setEnableAgentStyleEngine(true);
         $taskOptions->setBaseImageURL($this->imagePath);
         $taskOptions->setImageDirectory($this->imagePath);
     }
     $task->setRenderOption($taskOptions);
     $task->run();
     $task->close();
     return java_values($outputStream->toByteArray());
 }
开发者ID:sangkil,项目名称:application,代码行数:49,代码来源:BirtReport.php


示例16: __construct

 public function __construct()
 {
     $this->_gateway = java_context()->getServletContext()->getAttribute(PetroQuick_Neo4JGateway_Config::GATEWAY_CONTEXT_PARAM);
     $this->_neo = $this->_gateway->getGraphDb();
     $this->_index = $this->_gateway->factoryIndex();
     $this->_fulltextIndex = $this->_gateway->factoryFulltextIndex();
     $this->DIRECTION = java('org.neo4j.graphdb.Direction');
     if (empty($this->_subrefNodeName)) {
         $parts = explode('_', get_class($this));
         $this->_subrefNodeName = strtoupper($parts[count($parts) - 1]) . 'S';
     }
     if (empty($this->_nodeName)) {
         $parts = explode('_', get_class($this));
         $this->_nodeName = strtoupper($parts[count($parts) - 1]);
     }
 }
开发者ID:peterneubauer,项目名称:neo4j-php-wrapper,代码行数:16,代码来源:Abstract.php


示例17: deleteRowByBookmark

 public static function deleteRowByBookmark($doc, $bookmarkName)
 {
     // Find the bookmark in the document. Exit if cannot find it.
     $bookmark = $doc->getRange()->getBookmarks()->get($bookmarkName);
     //echo java_values($bookmark); exit;
     if (java_values($bookmark) == null) {
         return;
     }
     // Get the parent row of the bookmark. Exit if the bookmark is not in a row.
     $row = $bookmark->getBookmarkStart()->getAncestor(java('com.aspose.words.Row'));
     //echo java_inspect($row); exit;
     if (java_values($row) == null) {
         return;
     }
     // Remove the row.
     $row->remove();
 }
开发者ID:XEdwin,项目名称:Aspose_Words_Java,代码行数:17,代码来源:UntangleRowBookmarks.php


示例18: showform

function showform()
{
    $webname = $_SERVER["PHP_SELF"];
    $username = getvardata("username", "");
    $password = getvardata("password", "");
    $errormsg = getvardata("errormsg", "");
    java();
    echo "<form name='mlogin' id='mlogin' action=\"{$webname}\" method='POST'>\n";
    echo "<input type=hidden name=nextact id=nextact value=\"{$nextact}\">\n";
    echo "<input type=hidden name=errmsg id=errmsg value=\"{$errormsg}\">\n";
    echo "\t\t\tUsername? <input type=text name=username id=username value=\"{$username}\" size=10\">\n";
    echo "\t\t\tPassword? <input type=password name=password id=password value=\"{$password}\" size=10>\n";
    echo "\t\t\t<hr/>\n";
    echo "\t\t\t<a href=\"#\" onclick=\"setnext('login');\">\"Login\"</a> &nbsp; &nbsp;\n";
    echo "\t\t\t<a href='../../mobile.php'>\"Quit\"</a>\n";
    echo "</form>\n";
    if (strlen($errmsg) > 0) {
        echo "<hr>\n";
        echo $errormsg;
    }
    setfocus("username");
}
开发者ID:williamoak,项目名称:roaming,代码行数:22,代码来源:mobile.php


示例19: createDocument

function createDocument($jndiname, $serverArgs)
{
    // find initial context
    $initial = new java("javax.naming.InitialContext", $serverArgs);
    try {
        // find the service
        $objref = $initial->lookup("{$jndiname}");
        // access the home interface
        $home = java("javax.rmi.PortableRemoteObject")->narrow($objref, java("DocumentHome"));
        if (java_is_null($home)) {
            throw new Exception("home");
        }
        // create a new remote document and return it
        $doc = $home->create();
    } catch (JavaException $ex) {
        $cause = $ex->getCause();
        echo "Could not create remote document. Have you deployed documentBean.jar?<br>\n";
        echo "{$cause} <br>\nin file: {$ex->getFile()}<br>\nline:{$ex->getLine()}\n";
        exit(1);
    }
    return $doc;
}
开发者ID:dreamsxin,项目名称:php-java-bridge,代码行数:22,代码来源:documentClient.php


示例20: main

 public static function main()
 {
     $dataDir = "/usr/local/apache-tomcat-8.0.22/webapps/JavaBridge/Aspose_Words_Java_For_PHP/src/programmingwithdocuments/workingwithbookmarks/copybookmarkedtext/data/";
     // Load the source document.
     $srcDoc = new Java("com.aspose.words.Document", $dataDir . "Template.doc");
     // This is the bookmark whose content we want to copy.
     $srcBookmark = $srcDoc->getRange()->getBookmarks()->get("ntf010145060");
     // We will be adding to this document.
     $dstDoc = new Java("com.aspose.words.Document");
     // Let's say we will be appending to the end of the body of the last section.
     $dstNode = $dstDoc->getLastSection()->getBody();
     // It is a good idea to use this import context object because multiple nodes are being imported.
     // If you import multiple times without a single context, it will result in many styles created.
     $importFormatMode = java('com.aspose.words.ImportFormatMode');
     $importer = new Java("com.aspose.words.NodeImporter", $srcDoc, $dstDoc, $importFormatMode->KEEP_SOURCE_FORMATTING);
     // Do it once.
     CopyBookmarkedText::appendBookmarkedText($importer, $srcBookmark, $dstNode);
     // Do it one more time for fun.
     CopyBookmarkedText::appendBookmarkedText($importer, $srcBookmark, $dstNode);
     // Save the finished document.
     $dstDoc->save($dataDir . "Template Out.doc");
 }
开发者ID:XEdwin,项目名称:Aspose_Words_Java,代码行数:22,代码来源:CopyBookmarkedText.php



注:本文中的java函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP java_require函数代码示例发布时间:2022-05-15
下一篇:
PHP jalali_to_gregorian函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap