Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / fmap / mapcontext / rendering / legend / styling / ILabelable.java @ 40559

History | View | Annotate | Download (3.67 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
/* CVS MESSAGES:
25
*
26
* $Id: ILabelable.java 21103 2008-06-03 10:04:57Z vcaballero $
27
* $Log$
28
* Revision 1.2  2007-03-09 11:20:57  jaume
29
* Advanced symbology (start committing)
30
*
31
* Revision 1.1.2.5  2007/02/15 16:23:44  jaume
32
* *** empty log message ***
33
*
34
* Revision 1.1.2.4  2007/02/09 07:47:05  jaume
35
* Isymbol moved
36
*
37
* Revision 1.1.2.3  2007/02/02 16:21:24  jaume
38
* start commiting labeling stuff
39
*
40
* Revision 1.1.2.2  2007/02/01 17:46:49  jaume
41
* *** empty log message ***
42
*
43
* Revision 1.1.2.1  2007/01/30 18:10:45  jaume
44
* start commiting labeling stuff
45
*
46
*
47
*/
48
package org.gvsig.fmap.mapcontext.rendering.legend.styling;
49

    
50
import java.awt.Graphics2D;
51
import java.awt.image.BufferedImage;
52

    
53
import org.gvsig.compat.print.PrintAttributes;
54
import org.gvsig.fmap.dal.exception.ReadException;
55
import org.gvsig.fmap.mapcontext.ViewPort;
56
import org.gvsig.tools.task.Cancellable;
57

    
58
/**
59
 * This interface enables support for labeling an object such as a layer, but also others, if any. It gives support for detecting if labeling is being applied (<code>isLabeled()</code> and <code>setIsLabeled()</code>), to manage the labeling strategy (<code>getLabelingStrategy()</code> and <code>setLabelingStrategy</code>). The labeling is performed by the <code>drawLabels(..)</code> method.
60
 * @author   jaume dominguez faus - jaume.dominguez@iver.es
61
 */
62
public interface ILabelable {
63
        /**
64
         * Returns <b>true</b> if labels are drawn, or <b>false</b> otherwise.
65
         * @return <b>boolean</b> telling if labels are drawn
66
         */
67
        public boolean isLabeled();
68

    
69
        /**
70
         * Enables or disables the label drawing.
71
         * @param isLabeled, if true then labels will be drawn
72
         */
73
        public void setIsLabeled(boolean isLabeled);
74

    
75
        /**
76
         * Returns the current labeling strategy
77
         * @return ILabelingStrategy
78
         * @see ILabelingStrategy
79
         */
80
        public ILabelingStrategy getLabelingStrategy();
81

    
82
        /**
83
         * Sets the new labeling strategy. Changes on the results will take effect next time the drawLabels(...) method is invoked.
84
         * @param  strategy
85
         * @uml.property  name="labelingStrategy"
86
         */
87
        public void setLabelingStrategy(ILabelingStrategy strategy);
88

    
89
    /**
90
     * Causes the labels to be drawn. The policy of process is determined by the
91
     * LabelingStrategy previously set.
92
     * 
93
     * @param image
94
     * @param g
95
     * @param viewPort
96
     * @param cancel
97
     * @param scale
98
     * @param dpi
99
     * @throws ReadException
100
     */
101
        public void drawLabels(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, double dpi) throws ReadException;
102
        public void printLabels(Graphics2D g, ViewPort viewPort,
103
                    Cancellable cancel, double scale, PrintAttributes properties) throws ReadException;
104
}