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 @ 1746

History | View | Annotate | Download (5.65 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.File;
9
import javax.swing.AbstractButton;
10
import javax.swing.ComboBoxModel;
11
import javax.swing.JButton;
12
import javax.swing.JComboBox;
13
import javax.swing.JComponent;
14
import javax.swing.JLabel;
15
import javax.swing.JList;
16
import javax.swing.JSlider;
17
import javax.swing.JTabbedPane;
18
import javax.swing.JTextField;
19
import javax.swing.text.JTextComponent;
20
import javax.swing.tree.TreeModel;
21
import org.gvsig.tools.swing.api.pickercontroller.ColorPickerController;
22
import org.gvsig.tools.swing.api.pickercontroller.DatePickerController;
23
import org.gvsig.tools.swing.api.pickercontroller.FilePickerController;
24
import org.gvsig.tools.swing.api.pickercontroller.FolderPickerController;
25

    
26

    
27
public interface ToolsSwingManager {
28

    
29
    public ActionListenerSupport createActionListenerSupport();
30

    
31
    public JListWithCheckbox createJListWithCheckbox(JList wrappedList);
32

    
33
    public void setTreeModel(JComboBox comboBox, TreeModel aTreeModel);
34

    
35
    public ComboBoxModel createComboBoxModel(TreeModel treeModel);
36

    
37
    /**
38
     * @deprecated use createColorPickerController
39
     */
40
    public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull);
41
    /**
42
     * @deprecated use createColorPickerController
43
     */
44
    public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog);
45
    /**
46
     * @deprecated use createColorPickerController
47
     */
48
    public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha);
49
    
50
    
51
    /**
52
     * Create a buffered Image of the given size and type.
53
     * In this context, buffered image means editable image (admits setRGB etc)
54
     * If the size is bigger of max physical size of buffered image, creates a file mapped buffered Image.
55
     *
56
     * @param w width in pixels of the requested image
57
     * @param h height in pixels of the requested image
58
     * @param type image type (refers to bands, etc. see {@link Image}
59
     * @return a buffered (editable) image of the desired size and type
60
     * @see setMaxPhysicalSizeOfBufferedImage
61
     * @see getMaxPhysicalSizeOfBufferedImage
62
     *
63
     */
64
    public BufferedImage createBufferedImage(int w, int h, int type);
65

    
66

    
67
    /**
68
     * Create a file mapped buffered Image of the given size and type.
69
     * In this context, buffered image means editable image (admits setRGB etc)
70
     *
71
     * @param w width in pixels of the requested image
72
     * @param h height in pixels of the requested image
73
     * @param type image type (refers to bands, etc. see {@link Image}
74
     * @return a buffered (editable) image of the desired size and type
75
     */
76
    public BufferedImage createVirtualBufferedImage(int w, int h, int type);
77

    
78
    public BufferedImage copyBufferedImage(BufferedImage img);
79

    
80
    /**
81
     * Sets the max physical size of buffered image creates by this manager.
82
     *
83
     * @param dimension
84
     * @see createBufferedImage
85
     * @see createVirtualBufferedImage
86
     */
87
    public void setMaxPhysicalSizeOfBufferedImage(Dimension dimension);
88

    
89
    /**
90
     * Return the max physical size of buffered image creates by this manager.
91
     *
92
     * @return
93
     * @see createBufferedImage
94
     * @see createVirtualBufferedImage
95
     */
96
    public Dimension getMaxPhysicalSizeOfBufferedImage();
97

    
98
    /**
99
     * Alpha blending is the process of combining a translucent foreground color with a background 
100
     * 
101
     * https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending
102
     * 
103
     * @param bgColor
104
     * @param fgColor
105
     * @return 
106
     */    
107
    public Color alphaBlendingWithOpaqueBackground(Color bgColor, Color fgColor);
108
    
109
    public Color opaqueColor(Color src);
110

    
111
    public void translate(JComponent component);
112
    
113
    public void translate(AbstractButton component);
114

    
115
    public void translate(JLabel component);
116
    
117
    public void translate(JTabbedPane component);
118

    
119
    public void setDefaultPopupMenu(final JTextComponent component);
120
    
121
    public void setDefaultPopupMenu(final JComboBox component);
122

    
123
    public void setDefaultPopupMenu(final JTextComponent component, String title);    
124

    
125
    public void setDefaultPopupMenu(final JComboBox component, String title);    
126

    
127
    public ChangeListenerHelper createChangeListenerHelper();
128
    
129
    public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull);
130
    
131
    public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog);
132
    
133
    public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha);
134
    
135
    public DatePickerController createDatePickerController(JTextField txtDate, JButton btnDate);
136

    
137
    public FilePickerController createFilePickerController(JTextField txtFile, JButton btnFile, String dialogTitle, String fileChooserID, File initialPath, boolean seticon);
138

    
139
    public FilePickerController createFilePickerController(JTextField txtFile, JButton btnFile);
140

    
141
    public FilePickerController createFilePickerController(JTextField txtFile, JButton btnFile, String dialogTitle);
142

    
143
    public FolderPickerController createFolderPickerController(JTextField txtFile, JButton btnFile, String dialogTitle, String fileChooserID, File initialPath, boolean seticon);
144

    
145
    public FolderPickerController createFolderPickerController(JTextField txtFile, JButton btnFile);
146

    
147
    public FolderPickerController createFolderPickerController(JTextField txtFile, JButton btnFile, String dialogTitle);
148

    
149
}