001    /*
002     * Copyright (c) 2009 The openGion Project.
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     *     http://www.apache.org/licenses/LICENSE-2.0
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
013     * either express or implied. See the License for the specific language
014     * governing permissions and limitations under the License.
015     */
016    package org.opengion.hayabusa.io;
017    
018    import org.opengion.hayabusa.db.DBTableModel;
019    
020    import java.awt.Color;                                                  // 6.0.2.2 (2014/10/03)
021    import java.sql.Connection;
022    import java.sql.SQLException;
023    
024    import org.jfree.data.category.CategoryDataset;
025    import org.jfree.data.Range;
026    
027    /**
028     * HybsJDBCCategoryDataset は、org.jfree.data.jdbc.JDBCCategoryDataset を継承したサブクラスで?
029     * executeQuery(Connection , String )  をオーバ?ライドして?す?
030     * これは、?のソースの??タベ?ス検索結果を?部で持っておき、getValue(int row, int column)
031     * メソ?で直接値を返します?
032     * select category,series1,series2,series3,??? from ???
033     * series の横持ち(標準と同じ) 対応です?
034     * category カラ??値は、カ?リのラベルになり?series1,2,3 のラベルがシリーズラベル、??
035     * seriesの値になります?
036     *
037     * カ?リのカラー名??を行う場合???カラ?、カラー名???になります?
038     * select category,series1,series2,series3,???,color from ???
039     * color??の検索結果は、Dataset には含まれません?
040     *
041     * なお?Colorコード?、このクラスで作?しますが、Renderer に与える?があります?
042     * 通常のRenderer には、categoryにカラーを指定する機?がありませんので、HybsBarRenderer に
043     * setCategoryColor( Color[] ) メソ?を用意します?(正確には、HybsDrawItem インターフェース)
044     * こ?Renderer で、getItemPaint( int  , int )メソ?をオーバ?ライドすることで、カ?リごとの
045     * 色を返します?
046     *
047     * @og.rev 3.8.9.2 (2007/07/28) 新規作?
048     *
049     * @version  0.9.0  2001/05/05
050     * @author   Kazuhiko Hasegawa
051     * @since    JDK1.1,
052     */
053    public interface HybsDataset extends CategoryDataset {
054    
055            /**
056             * レンジオブジェクトを取得します?(独自メソ?)
057             *
058             * @return      レンジオブジェク?
059             */
060            Range getRange() ;
061    
062            /**
063             * CategoryDataset を構築するに当たり?初期パラメータを設定します?
064             *
065             * @og.rev 6.0.2.2 (2014/10/03) 新規追?
066             *
067             * @param lbls  シリーズのラベル名??
068             * @param isColCate  カ?リのカラー名??有無(true:使用する)
069             * @param isPareto   パレート図用のDatasetとして処?るかど?(true:処??
070             */
071            void initParam( final String[] lbls , final boolean isColCate , final boolean isPareto );
072    
073            /**
074             * コネクションと、SQL??から、CategoryDataset の??タを作?します?
075             * ?なる???、org.jfree.data.jdbc.JDBCCategoryDataset#executeQuery( Connection,String ) です?
076             *
077             * こ?メソ?では、?に #initParam(String[],boolean,isPareto) のパラメータを使用して
078             * 検索した結果の??タを加工、??ます?
079             * また???、データをキャ?ュする事と、データ?を示?レンジオブジェク?を作?します?
080             *
081             * @og.rev 6.0.2.2 (2014/10/03) 新規追?
082             *
083             * @param con  コネクション
084             * @param query  SQL??
085             *
086             * @throws SQLException ??タベ?スアクセス時?エラー
087             * @see         org.jfree.data.jdbc.JDBCCategoryDataset#executeQuery( Connection,String )
088             */
089            void execute( final Connection con, final String query ) throws SQLException ;
090    
091            /**
092             * DBTableModelオブジェクトから?CategoryDataset の??タを作?します?
093             * openGionの独自処?ソ?です?
094             *
095             * こ?メソ?では、?に #initParam(String[],boolean,isPareto) のパラメータを使用して
096             * 検索した結果の??タを加工、??ます?
097             * また???、データをキャ?ュする事と、データ?を示?レンジオブジェク?を作?します?
098             *
099             * @og.rev 6.0.2.2 (2014/10/03) 新規追?
100             *
101             * @param table DBTableModelオブジェク?
102             * @see         #execute( Connection,String )
103             */
104            void execute( final DBTableModel table ) ;
105    
106            /**
107             * categoryカラー配?を取得します?(独自メソ?)
108             *
109             * こ?クラスは、???カラ?、色??として処?、categoryにColorを指定できます?
110             * select??されて?かった?合?、null を返します?
111             *
112             * select category,series1,series2,series3,???,color from ???
113             *
114             * なお?Colorコード?、このクラスで作?しますが、Renderer に与える?があります?
115             * 通常のRenderer には、categoryにカラーを指定する機?がありませんので、HybsBarRenderer に
116             * setCategoryColor( Color[] ) メソ?を用意します?(正確には、HybsDrawItem インターフェース)
117             * こ?Renderer で、getItemPaint( int  , int )メソ?をオーバ?ライドすることで、カ?リごとの
118             * 色を返します?
119             * こ?設定を行うと、シリーズは、カ?リと同?になります?
120             *
121             * @og.rev 6.0.2.2 (2014/10/03) 新規追?
122             *
123             * @return      categoryカラー配?(なければ null)
124             */
125            Color[] getCategoryColor() ;
126    }