Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.swing / org.gvsig.tools.swing.api / src / main / java / org / gvsig / tools / swing / api / ToolsSwingManager.java @ 1628

History | View | Annotate | Download (3.18 KB)

1

    
2
package org.gvsig.tools.swing.api;
3

    
4
import java.awt.Color;
5
import java.awt.Dimension;
6
import java.awt.Image;
7
import java.awt.image.BufferedImage;
8
import java.io.IOException;
9
import javax.swing.ComboBoxModel;
10
import javax.swing.JButton;
11
import javax.swing.JComboBox;
12
import javax.swing.JList;
13
import javax.swing.JSlider;
14
import javax.swing.JTextField;
15
import javax.swing.tree.TreeModel;
16

    
17

    
18
public interface ToolsSwingManager {
19

    
20
    public ActionListenerSupport createActionListenerSupport();
21

    
22
    public JListWithCheckbox createJListWithCheckbox(JList wrappedList);
23

    
24
    public void setTreeModel(JComboBox comboBox, TreeModel aTreeModel);
25

    
26
    public ComboBoxModel createComboBoxModel(TreeModel treeModel);
27

    
28
    public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull);
29
    public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog);
30
    public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha);
31
    
32
    
33
    /**
34
     * Create a buffered Image of the given size and type.
35
     * In this context, buffered image means editable image (admits setRGB etc)
36
     * If the size is bigger of max physical size of buffered image, creates a file mapped buffered Image.
37
     *
38
     * @param w width in pixels of the requested image
39
     * @param h height in pixels of the requested image
40
     * @param type image type (refers to bands, etc. see {@link Image}
41
     * @return a buffered (editable) image of the desired size and type
42
     * @see setMaxPhysicalSizeOfBufferedImage
43
     * @see getMaxPhysicalSizeOfBufferedImage
44
     *
45
     */
46
    public BufferedImage createBufferedImage(int w, int h, int type);
47

    
48

    
49
    /**
50
     * Create a file mapped buffered Image of the given size and type.
51
     * In this context, buffered image means editable image (admits setRGB etc)
52
     *
53
     * @param w width in pixels of the requested image
54
     * @param h height in pixels of the requested image
55
     * @param type image type (refers to bands, etc. see {@link Image}
56
     * @return a buffered (editable) image of the desired size and type
57
     * @throws IOException
58
     */
59
    public BufferedImage createVirtualBufferedImage(int w, int h, int type);
60

    
61
    public BufferedImage copyBufferedImage(BufferedImage img);
62

    
63
    /**
64
     * Sets the max physical size of buffered image creates by this manager.
65
     *
66
     * @param dimension
67
     * @see createBufferedImage
68
     * @see createVirtualBufferedImage
69
     */
70
    public void setMaxPhysicalSizeOfBufferedImage(Dimension dimension);
71

    
72
    /**
73
     * Return the max physical size of buffered image creates by this manager.
74
     *
75
     * @return
76
     * @see createBufferedImage
77
     * @see createVirtualBufferedImage
78
     */
79
    public Dimension getMaxPhysicalSizeOfBufferedImage();
80

    
81
    /**
82
     * Alpha blending is the process of combining a translucent foreground color with a background 
83
     * 
84
     * https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending
85
     * 
86
     * @param bgColor
87
     * @param fgColor
88
     * @return 
89
     */    
90
    public Color alphaBlendingWithOpaqueBackground(Color bgColor, Color fgColor);
91
    
92
}