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 */
016package org.opengion.hayabusa.io;
017
018import java.awt.Graphics2D;
019import java.awt.Color;
020import java.awt.geom.Rectangle2D;
021
022import org.jfree.chart.renderer.category.CategoryItemRendererState;
023import org.jfree.chart.plot.CategoryPlot;
024import org.jfree.chart.axis.CategoryAxis;
025import org.jfree.chart.axis.ValueAxis;
026import org.jfree.data.category.CategoryDataset;
027
028/**
029 * HybsDrawItem は、ChartPlot インターフェースを継承した実体クラスです。
030 * JFreeChart では、XYPlot 関係の プロットを構築して、レンデラーや、データセットを
031 * 設定していきます。
032 * ここでは、複数のデータセットはサポートしていません。
033 *
034 * @version  0.9.0      2007/06/21
035 * @author       Kazuhiko Hasegawa
036 * @since        JDK1.1,
037 */
038public interface HybsDrawItem {
039
040        /**
041         * drawItem と同等の機能を持った、高速版メソッドです。
042         *
043         * @og.rev 4.1.1.0 (2008/02/04) 新規追加
044         *
045         * @param g2                    Graphics2Dオブジェクト
046         * @param state                 CategoryItemRendererStateオブジェクト
047         * @param dataArea              Rectangle2Dオブジェクト
048         * @param plot                  CategoryPlotオブジェクト
049         * @param domainAxis    CategoryAxisオブジェクト
050         * @param rangeAxis             ValueAxisオブジェクト
051         * @param dataset               CategoryDatasetオブジェクト
052         * @param serNo                 シリアル番号
053         */
054        void drawItem2( final Graphics2D g2, final CategoryItemRendererState state,
055                        final Rectangle2D dataArea, final CategoryPlot plot, final CategoryAxis domainAxis,
056                        final ValueAxis rangeAxis, final CategoryDataset dataset, final int serNo ) ;
057
058        /**
059         * itemLabelVisible 時に、最後の値のみ表示するかどうか[true:有効/false:無効]を指定します。
060         *
061         * これは、itemLabelVisible 属性に、"last" という設定値を指定した場合は、
062         * 最後のみラベル表示します。
063         * このメソッドでは、true が指定された場合は、"last" 属性が有効になったと
064         * 判断します。
065         * (独自メソッド)
066         *
067         * @og.rev 4.1.2.0 (2008/03/12) 新規追加
068         *
069         * @param       flag    最後の値のみ表示するかどうか[true:有効/false:無効]
070         */
071        void setItemLabelLastVisible( final boolean flag ) ;
072
073        /**
074         * categoryカラー配列を設定します。
075         *
076         * これは、HybsJDBCCategoryDataset クラスで、カテゴリカラーを指定した場合に、
077         * そこから取り出した値をセットすることで、Hybs***Renderer に設定して使います。
078         * Hybs***Renderer 側では、このカラー配列を使用して、getItemPaint(int,int) を
079         * オーバーライドして使います。
080         * (独自メソッド)
081         *
082         * @og.rev 6.0.2.1 (2014/09/26) 新規追加
083         *
084         * @param       categoryColor   categoryカラー配列(可変長引数)
085         */
086        void setCategoryColor( final Color... categoryColor ) ;
087}