当前位置: 首页>>代码示例>>PHP>>正文


PHP Frame_Decorator类代码示例

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


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

示例1: _render_border

 protected function _render_border(Frame_Decorator $frame, $corner_style = "bevel")
 {
     $cb = $frame->get_containing_block();
     $style = $frame->get_style();
     $bbox = $frame->get_border_box();
     $bp = $frame->get_style()->get_border_properties();
     $widths = array($style->length_in_pt($bp["top"]["width"]), $style->length_in_pt($bp["right"]["width"]), $style->length_in_pt($bp["bottom"]["width"]), $style->length_in_pt($bp["left"]["width"]));
     foreach ($bp as $side => $props) {
         list($x, $y, $w, $h) = $bbox;
         if (!$props["style"] || $props["style"] == "none" || $props["width"] <= 0) {
             continue;
         }
         switch ($side) {
             case "top":
                 $length = $w;
                 break;
             case "bottom":
                 $length = $w;
                 $y += $h;
                 break;
             case "left":
                 $length = $h;
                 break;
             case "right":
                 $length = $h;
                 $x += $w;
                 break;
             default:
                 break;
         }
         $method = "_border_" . $props["style"];
         $this->{$method}($x, $y, $length, $props["color"], $widths, $side, $corner_style);
     }
 }
开发者ID:emeraldstudio,项目名称:somosmaestros,代码行数:34,代码来源:block_renderer.cls.php

示例2: reflow

 function reflow(Frame_Decorator $block = null)
 {
     $frame = $this->_frame;
     $page = $frame->get_root();
     $page->check_forced_page_break($frame);
     if ($page->is_full()) {
         return;
     }
     $style = $frame->get_style();
     $this->_set_content();
     $frame->position();
     $cb = $frame->get_containing_block();
     if (($f = $frame->get_first_child()) && $f instanceof Text_Frame_Decorator) {
         $f_style = $f->get_style();
         $f_style->margin_left = $style->margin_left;
         $f_style->padding_left = $style->padding_left;
         $f_style->border_left = $style->border_left;
     }
     if (($l = $frame->get_last_child()) && $l instanceof Text_Frame_Decorator) {
         $l_style = $l->get_style();
         $l_style->margin_right = $style->margin_right;
         $l_style->padding_right = $style->padding_right;
         $l_style->border_right = $style->border_right;
     }
     if ($block) {
         $block->add_frame_to_line($this->_frame);
     }
     foreach ($frame->get_children() as $child) {
         $child->set_containing_block($cb);
         $child->reflow($block);
     }
 }
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:32,代码来源:inline_frame_reflower.cls.php

示例3: reflow

    function reflow(Frame_Decorator $block = null)
    {
        $frame = $this->_frame;
        $page = $frame->get_root();
        $page->check_forced_page_break($this->_frame);

        if ($page->is_full())
            return;

        $this->_block_parent = /*isset($block) ? $block : */
            $frame->find_block_parent();

        // Left trim the text if this is the first text on the line and we're
        // collapsing white space
//     if ( $this->_block_parent->get_current_line()->w == 0 &&
//          ($frame->get_style()->white_space !== "pre" ||
//           $frame->get_style()->white_space !== "pre-wrap") ) {
//       $frame->set_text( ltrim( $frame->get_text() ) );
//     }

        $frame->position();

        $this->_layout_line();

        if ($block) {
            $block->add_frame_to_line($frame);
        }
    }
开发者ID:rmuyinda,项目名称:dms-1,代码行数:28,代码来源:text_frame_reflower.cls.php

示例4: reflow

 function reflow(Frame_Decorator $block = null)
 {
     $this->_frame->position();
     $this->get_min_max_width();
     if ($block) {
         $block->add_frame_to_line($this->_frame);
     }
 }
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:8,代码来源:image_frame_reflower.cls.php

示例5: _render_outline

 protected function _render_outline(Frame_Decorator $frame, $corner_style = "bevel")
 {
     $style = $frame->get_style();
     $props = array("width" => $style->outline_width, "style" => $style->outline_style, "color" => $style->outline_color);
     if (!$props["style"] || $props["style"] === "none" || $props["width"] <= 0) {
         return;
     }
     $bbox = $frame->get_border_box();
     $offset = $style->length_in_pt($props["width"]);
     $pattern = $this->_get_dash_pattern($props["style"], $offset);
     if (in_array($props["style"], array("solid", "dashed", "dotted"))) {
         $bbox[0] -= $offset / 2;
         $bbox[1] -= $offset / 2;
         $bbox[2] += $offset;
         $bbox[3] += $offset;
         list($x, $y, $w, $h) = $bbox;
         $this->_canvas->rectangle($x, $y, $w, $h, $props["color"], $offset, $pattern);
         return;
     }
     $bbox[0] -= $offset;
     $bbox[1] -= $offset;
     $bbox[2] += $offset * 2;
     $bbox[3] += $offset * 2;
     $method = "_border_" . $props["style"];
     $widths = array_fill(0, 4, $props["width"]);
     $sides = array("top", "right", "left", "bottom");
     foreach ($sides as $side) {
         list($x, $y, $w, $h) = $bbox;
         switch ($side) {
             case "top":
                 $length = $w;
                 break;
             case "bottom":
                 $length = $w;
                 $y += $h;
                 break;
             case "left":
                 $length = $h;
                 break;
             case "right":
                 $length = $h;
                 $x += $w;
                 break;
             default:
                 break;
         }
         $this->{$method}($x, $y, $length, $props["color"], $widths, $side, $corner_style);
     }
 }
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:49,代码来源:block_renderer.cls.php

示例6: __construct

 /**
  * Class constructor
  *
  * @param Frame $frame the bullet frame to decorate
  * @param DOMPDF $dompdf the document's dompdf object
  */
 function __construct(Frame $frame, DOMPDF $dompdf)
 {
     $style = $frame->get_style();
     $url = $style->list_style_image;
     $frame->get_node()->setAttribute("src", $url);
     $this->_img = new Image_Frame_Decorator($frame, $dompdf);
     parent::__construct($this->_img, $dompdf);
     list($width, $height) = dompdf_getimagesize($this->_img->get_image_url());
     // Resample the bullet image to be consistent with 'auto' sized images
     // See also Image_Frame_Reflower::get_min_max_width
     // Tested php ver: value measured in px, suffix "px" not in value: rtrim unnecessary.
     $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI;
     $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_DPI;
     //If an image is taller as the containing block/box, the box should be extended.
     //Neighbour elements are overwriting the overlapping image areas.
     //Todo: Where can the box size be extended?
     //Code below has no effect.
     //See block_frame_reflower _calculate_restricted_height
     //See generated_frame_reflower, Dompdf:render() "list-item", "-dompdf-list-bullet"S.
     //Leave for now
     //if ($style->min_height < $this->_height ) {
     //  $style->min_height = $this->_height;
     //}
     //$style->height = "auto";
 }
开发者ID:agashish,项目名称:test_new,代码行数:31,代码来源:list_bullet_image_frame_decorator.cls.php

示例7: reflow

    function reflow(Frame_Decorator $block = null)
    {
        $frame = $this->_frame;

        // Check if a page break is forced
        $page = $frame->get_root();
        $page->check_forced_page_break($frame);

        if ($page->is_full())
            return;

        $style = $frame->get_style();

        // Generated content
        $this->_set_content();

        $frame->position();

        $cb = $frame->get_containing_block();

        // Add our margin, padding & border to the first and last children
        if (($f = $frame->get_first_child()) && $f instanceof Text_Frame_Decorator) {
            $f_style = $f->get_style();
            $f_style->margin_left = $style->margin_left;
            $f_style->padding_left = $style->padding_left;
            $f_style->border_left = $style->border_left;
        }

        if (($l = $frame->get_last_child()) && $l instanceof Text_Frame_Decorator) {
            $l_style = $l->get_style();
            $l_style->margin_right = $style->margin_right;
            $l_style->padding_right = $style->padding_right;
            $l_style->border_right = $style->border_right;
        }

        if ($block) {
            $block->add_frame_to_line($this->_frame);
        }

        // Set the containing blocks and reflow each child.  The containing
        // block is not changed by line boxes.
        foreach ($frame->get_children() as $child) {
            $child->set_containing_block($cb);
            $child->reflow($block);
        }
    }
开发者ID:rmuyinda,项目名称:dms-1,代码行数:46,代码来源:inline_frame_reflower.cls.php

示例8: __construct

 function __construct(Frame $frame, DOMPDF $dompdf)
 {
     $style = $frame->get_style();
     $url = $style->list_style_image;
     $frame->get_node()->setAttribute("src", $url);
     $this->_img = new Image_Frame_Decorator($frame, $dompdf);
     parent::__construct($this->_img, $dompdf);
     list($width, $height) = dompdf_getimagesize($this->_img->get_image_url());
     $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI;
     $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_DPI;
 }
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:11,代码来源:list_bullet_image_frame_decorator.cls.php

示例9: __construct

 /**
  * Class constructor
  *
  * @param Frame $frame the bullet frame to decorate
  * @param DOMPDF $dompdf the document's dompdf object
  */
 function __construct(Frame $frame, DOMPDF $dompdf)
 {
     $url = $frame->get_style()->list_style_image;
     $frame->get_node()->setAttribute("src", $url);
     $this->_img = new Image_Frame_Decorator($frame, $dompdf);
     parent::__construct($this->_img, $dompdf);
     list($width, $height) = getimagesize($this->_img->get_image_url());
     // Resample the bullet image to be consistent with 'auto' sized images
     $this->_width = (double) rtrim($width, "px") * 72 / DOMPDF_DPI;
     $this->_height = (double) rtrim($height, "px") * 72 / DOMPDF_DPI;
 }
开发者ID:SkMamtajuddin,项目名称:bamboo-invoice,代码行数:17,代码来源:list_bullet_image_frame_decorator.cls.php

示例10: move

 function move($offset_x, $offset_y, $ignore_self = false)
 {
     list($x, $y) = $this->_frame->get_position();
     if (!$ignore_self) {
         $this->_frame->set_position($x + $offset_x, $y + $offset_y);
     }
     foreach ($this->_frame->get_children() as $child) {
         $child->move($offset_x, $offset_y);
     }
 }
开发者ID:alvarobfdev,项目名称:applog,代码行数:10,代码来源:positioner.cls.php

示例11: list

 /**
  * Class constructor
  *
  * @param Frame $frame the frame to decorate
  * @param DOMPDF $dompdf the document's dompdf object (required to resolve relative & remote urls)
  */
 function __construct(Frame $frame, DOMPDF $dompdf)
 {
     global $_dompdf_warnings;
     parent::__construct($frame, $dompdf);
     $url = $frame->get_node()->getAttribute("src");
     list($this->_image_url, $this->_image_ext) = Image_Cache::resolve_url($url, $dompdf->get_protocol(), $dompdf->get_host(), $dompdf->get_base_path());
 }
开发者ID:emeraldstudio,项目名称:somosmaestros,代码行数:13,代码来源:image_frame_decorator.cls.php

示例12: copy

 function copy(DomNode $node)
 {
     $deco = parent::copy($node);
     $deco->_cellmap->set_columns($this->_cellmap->get_columns());
     $deco->_cellmap->lock_columns();
     return $deco;
 }
开发者ID:EfncoPlugins,项目名称:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代码行数:7,代码来源:table_frame_decorator.cls.php

示例13: reset

 function reset()
 {
     parent::reset();
     $this->_lines = array(array("frames" => array(), "wc" => 0, "y" => null, "w" => 0, "h" => 0));
     $this->_counters = array(self::DEFAULT_COUNTER => 0);
     $this->_cl = 0;
 }
开发者ID:sgrove,项目名称:cothinker,代码行数:7,代码来源:block_frame_decorator.cls.php

示例14: reset

 function reset()
 {
     parent::reset();
     $this->_line_boxes = array(new Line_Box($this));
     $this->_counters = array(self::DEFAULT_COUNTER => 0);
     $this->_cl = 0;
 }
开发者ID:practo,项目名称:dompdf,代码行数:7,代码来源:block_frame_decorator.cls.php

示例15: reset

 function reset()
 {
     parent::reset();
     $this->_lines = array(self::$_initial_line_state);
     $this->_counters = array(self::DEFAULT_COUNTER => 0);
     $this->_cl = 0;
 }
开发者ID:rodolfobais,项目名称:proylectura,代码行数:7,代码来源:block_frame_decorator.cls.php


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