Ignore:
Timestamp:
2013/02/18 19:09:54 (13 years ago)
Author:
shutta
Message:

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

Location:
branches/version-2_12-dev/data/class/graph
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/graph/SC_Graph_Bar.php

    r22206 r22567  
    2323 
    2424// 棒グラフ生成クラス 
    25 class SC_Graph_Bar extends SC_Graph_Line_Ex{ 
     25class SC_Graph_Bar extends SC_Graph_Line_Ex 
     26{ 
    2627    // コンストラクタ 
    2728    function __construct( 
     
    3233 
    3334    // グラフの描画 
    34     function drawGraph() { 
     35    function drawGraph() 
     36    { 
    3537        $this->drawYLine(); 
    3638        $this->drawXLine(true); 
     
    5153 
    5254    // 棒グラフの描画 
    53     function drawBar($line_no) { 
     55    function drawBar($line_no) 
     56    { 
    5457        $arrPointList = $this->arrPointList[$line_no]; 
    5558        // データ数を数える 
     
    8083 
    8184    // ラベルを描画する 
    82     function drawLabel($line_no) { 
     85    function drawLabel($line_no) 
     86    { 
    8387        $arrData = $this->arrDataList[$line_no]; 
    8488        $arrPointList = $this->arrPointList[$line_no]; 
  • branches/version-2_12-dev/data/class/graph/SC_Graph_Base.php

    r22206 r22567  
    131131 * @version $Id$ 
    132132 */ 
    133 class SC_Graph_Base { 
     133class SC_Graph_Base  
     134{ 
    134135 
    135136    // {{{ properties 
     
    182183 
    183184    // コンストラクタ 
    184     function __construct($bgw, $bgh, $left, $top) { 
     185    function __construct($bgw, $bgh, $left, $top) 
     186    { 
    185187        $this->init(); 
    186188        // 画像作成 
     
    211213 
    212214    // リサンプル(画像を滑らかに縮小する) 
    213     function resampled() { 
     215    function resampled() 
     216    { 
    214217        $new_width = $this->bgw * 0.8; 
    215218        $new_height = $this->bgh * 0.8; 
     
    221224 
    222225    // オブジェクトカラーの設定 
    223     function setColorList($arrRGB) { 
     226    function setColorList($arrRGB) 
     227    { 
    224228        $this->arrRGB = $arrRGB; 
    225229        $count = count($this->arrRGB); 
     
    235239 
    236240    // 影のありなし 
    237     function setShadeOn($shade_on) { 
     241    function setShadeOn($shade_on) 
     242    { 
    238243        $this->shade_on = $shade_on; 
    239244    } 
    240245 
    241246    // 画像を出力する 
    242     function outputGraph($header = true, $filename = '') { 
     247    function outputGraph($header = true, $filename = '') 
     248    { 
    243249        if ($header) { 
    244250            header('Content-type: image/png'); 
     
    255261 
    256262    // 描画時のテキスト幅を求める 
    257     function getTextWidth($text, $font_size) { 
     263    function getTextWidth($text, $font_size) 
     264    { 
    258265        $text_len = strlen($text); 
    259266        $ret = $font_size * $text_len * TEXT_RATE; 
     
    268275 
    269276    // テキストを出力する 
    270     function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) { 
     277    function setText($font_size, $left, $top, $text, $color = NULL, $angle = 0, $labelbg = false) 
     278    { 
    271279        // 時計回りに角度を変更 
    272280        $angle = -$angle; 
     
    300308 
    301309    // タイトルを出力する 
    302     function drawTitle($text, $font_size = TITLE_FONT_SIZE) { 
     310    function drawTitle($text, $font_size = TITLE_FONT_SIZE) 
     311    { 
    303312        // 出力位置の算出 
    304313        $text_width = $this->getTextWidth($text, $font_size); 
     
    309318 
    310319    // ログを出力する 
    311     function debugPrint($text) { 
     320    function debugPrint($text) 
     321    { 
    312322        $text = mb_convert_encoding($text, 'UTF-8', CHAR_CODE); 
    313323        if (!isset($this->text_top)) { 
     
    320330 
    321331    // カラーラベルを描画 
    322     function drawLegend($legend_max = '', $clabelbg = true) { 
     332    function drawLegend($legend_max = '', $clabelbg = true) 
     333    { 
    323334        // 凡例が登録されていなければ中止 
    324335        if (count($this->arrLegend) <= 0) { 
     
    369380 
    370381    // カラーラベル背景の描画 
    371     function drawClabelBG($left, $top, $right, $bottom) { 
     382    function drawClabelBG($left, $top, $right, $bottom) 
     383    { 
    372384        // 影の描画 
    373385        if ($this->shade_on) { 
     
    380392 
    381393    // 凡例をセットする 
    382     function setLegend($arrLegend) { 
     394    function setLegend($arrLegend) 
     395    { 
    383396        $this->arrLegend = array_values((array)$arrLegend); 
    384397    } 
     
    395408     * @return void 
    396409     */ 
    397     function init() { 
     410    function init() 
     411    { 
    398412        // 凡例背景 
    399413        $this->ARR_LEGENDBG_COLOR = array(245,245,245); 
     
    437451     * @return array 円の中心点と直径から弧の終端座標の配列 
    438452     */ 
    439     function lfGetArcPos($cx, $cy, $cw, $ch, $e) { 
     453    function lfGetArcPos($cx, $cy, $cw, $ch, $e) 
     454    { 
    440455        // 三角関数用の角度を求める 
    441456        $s = 90 - $e; 
     
    448463 
    449464    /** 画像にテキストを描画する */ 
    450     function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) { 
     465    function lfImageText($dst_image, $text, $font_size, $left, $top, $font, $arrRGB) 
     466    { 
    451467        $color = ImageColorAllocate($dst_image, $arrRGB[0], $arrRGB[1], $arrRGB[2]); 
    452468        $text = mb_convert_encoding($text, 'UTF-8', CHAR_CODE); 
     
    458474 
    459475    /** 表示色の取得 */ 
    460     function lfGetImageColor($image, $array) { 
     476    function lfGetImageColor($image, $array) 
     477    { 
    461478        if (count($array) != 3) { 
    462479            return NULL; 
     
    467484 
    468485    /** 影用表示色の取得 */ 
    469     function lfGetImageDarkColor($image, $array) { 
     486    function lfGetImageDarkColor($image, $array) 
     487    { 
    470488        if (count($array) != 3) { 
    471489            return NULL; 
  • branches/version-2_12-dev/data/class/graph/SC_Graph_Line.php

    r22206 r22567  
    2323 
    2424// 折れ線グラフ生成クラス 
    25 class SC_Graph_Line extends SC_Graph_Base_Ex{ 
     25class SC_Graph_Line extends SC_Graph_Base_Ex 
     26{ 
    2627    var $area_width; 
    2728    var $area_height; 
     
    5556 
    5657    // X軸ラベルの角度セット 
    57     function setXLabelAngle($Angle) { 
     58    function setXLabelAngle($Angle) 
     59    { 
    5860        $this->XLabelAngle = $Angle; 
    5961    } 
    6062 
    6163    // Y軸タイトル 
    62     function drawYTitle() { 
     64    function drawYTitle() 
     65    { 
    6366        // Y軸にタイトルを入れる 
    6467        if ($this->YTitle != '') { 
     
    7174 
    7275    // X軸タイトル 
    73     function drawXTitle() { 
     76    function drawXTitle() 
     77    { 
    7478        // Y軸にタイトルを入れる 
    7579        if ($this->XTitle != '') { 
     
    8286 
    8387    // Y軸の描画 
    84     function drawYLine() { 
     88    function drawYLine() 
     89    { 
    8590        imageline($this->image, $this->left, $this->top, $this->left, $this->top + $this->area_height, $this->flame_color); 
    8691        // 目盛り幅を求める(中間点は自動) 
     
    107112 
    108113    // X軸の描画 
    109     function drawXLine($bar = false) { 
     114    function drawXLine($bar = false) 
     115    { 
    110116        imageline($this->image, $this->left, $this->top + $this->area_height, $this->left + $this->area_width, $this->top + $this->area_height, $this->flame_color); 
    111117        $arrPointList = $this->arrPointList[0]; 
     
    150156 
    151157    // グリッド表示 
    152     function setYGridOn($ygrid_on) { 
     158    function setYGridOn($ygrid_on) 
     159    { 
    153160        $this->ygrid_on = $ygrid_on; 
    154161    } 
    155162 
    156163    // ポイントの描画 
    157     function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE) { 
     164    function setMark($line_no, $left, $top, $size = LINE_MARK_SIZE) 
     165    { 
    158166        // 偶数に変換しておく 
    159167        $size += $size % 2; 
     
    170178 
    171179    // Y軸目盛りに値を入れる 
    172     function setYScale() { 
     180    function setYScale() 
     181    { 
    173182        // 1目盛りの値 
    174183        $number = intval($this->graph_max / LINE_Y_SCALE); 
     
    186195 
    187196    // 
    188     function setMax($arrData) { 
     197    function setMax($arrData) 
     198    { 
    189199        // データの最大値を取得する。 
    190200        $data_max = max($arrData); 
     
    202212 
    203213    // グラフの描画 
    204     function drawGraph() { 
     214    function drawGraph() 
     215    { 
    205216        // グラフ背景を描画 
    206217        $this->drawYLine(); 
     
    227238 
    228239    // ラインを描画する 
    229     function drawLine($line_no) { 
     240    function drawLine($line_no) 
     241    { 
    230242        $arrPointList = $this->arrPointList[$line_no]; 
    231243 
     
    243255 
    244256    // マークを描画する 
    245     function drawMark($line_no) { 
     257    function drawMark($line_no) 
     258    { 
    246259        $arrPointList = $this->arrPointList[$line_no]; 
    247260        $count = count($arrPointList); 
     
    254267 
    255268    // ラベルを描画する 
    256     function drawLabel($line_no) { 
     269    function drawLabel($line_no) 
     270    { 
    257271        $arrData = $this->arrDataList[$line_no]; 
    258272        $arrPointList = $this->arrPointList[$line_no]; 
     
    269283 
    270284    // データをセットする 
    271     function setData($arrData) { 
     285    function setData($arrData) 
     286    { 
    272287        $this->arrDataList[$this->line_max] = array_values((array)$arrData); 
    273288        $this->setMax($this->arrDataList[$this->line_max]); 
     
    290305 
    291306    // X軸ラベルをセットする 
    292     function setXLabel($arrXLabel) { 
     307    function setXLabel($arrXLabel) 
     308    { 
    293309        $this->arrXLabel = array_values((array)$arrXLabel); 
    294310    } 
    295311 
    296312    // X軸タイトルをセットする 
    297     function setXTitle($title) { 
     313    function setXTitle($title) 
     314    { 
    298315        $this->XTitle = $title; 
    299316    } 
    300317 
    301318    // Y軸タイトルをセットする 
    302     function setYTitle($title) { 
     319    function setYTitle($title) 
     320    { 
    303321        $this->YTitle = $title; 
    304322    } 
  • branches/version-2_12-dev/data/class/graph/SC_Graph_Pie.php

    r22206 r22567  
    2323 
    2424// 円グラフ生成クラス 
    25 class SC_Graph_Pie extends SC_Graph_Base_Ex{ 
     25class SC_Graph_Pie extends SC_Graph_Base_Ex 
     26{ 
    2627    var $cw; 
    2728    var $ch; 
     
    3334 
    3435    // コンストラクタ 
    35     function __construct($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = PIE_LEFT, $top = PIE_TOP) { 
     36    function __construct($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = PIE_LEFT, $top = PIE_TOP) 
     37    { 
    3638        parent::__construct($bgw, $bgh, $left, $top); 
    3739        // サイズ設定 
     
    4244 
    4345    // データを360°値に変換する 
    44     function getCircleData($array) { 
     46    function getCircleData($array) 
     47    { 
    4548        $total = ''; 
    4649        $new_total = ''; 
     
    7376 
    7477    // 円の位置設定を行う 
    75     function setPosition($cx, $cy) { 
     78    function setPosition($cx, $cy) 
     79    { 
    7680        $this->cx = $cx; 
    7781        $this->cy = $cy; 
     
    7983 
    8084    // 円のサイズ設定を行う 
    81     function setSize($cw, $ch, $cz = 0) { 
     85    function setSize($cw, $ch, $cz = 0) 
     86    { 
    8287        $this->cw = $cw; 
    8388        $this->ch = $ch; 
     
    8691 
    8792    // 影の描画 
    88     function drawShade() { 
     93    function drawShade() 
     94    { 
    8995        $move = 1; 
    9096        for ($i = ($this->cy + $this->cz); $i <= ($this->cy + $this->cz + ($this->cz * PIE_SHADE_IMPACT)); $i++) { 
     
    95101 
    96102    // データをセットする 
    97     function setData($arrData) { 
     103    function setData($arrData) 
     104    { 
    98105        $this->arrData = array_values($arrData); 
    99106    } 
    100107 
    101108    // 円グラフを描画する 
    102     function drawGraph() { 
     109    function drawGraph() 
     110    { 
    103111        $x = $this->cx; 
    104112        $y = $this->cy; 
     
    198206 
    199207    // 円グラフのラベルを描画する 
    200     function drawLabel($arrRad) { 
     208    function drawLabel($arrRad) 
     209    { 
    201210        $rd_max = count($arrRad); 
    202211        $start = 0; 
Note: See TracChangeset for help on using the changeset viewer.