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

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

    
27

    
28
public interface ToolsSwingManager {
29

    
30
    public ActionListenerSupport createActionListenerSupport();
31

    
32
    public JListWithCheckbox createJListWithCheckbox(JList wrappedList);
33

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

    
36
    public ComboBoxModel createComboBoxModel(TreeModel treeModel);
37

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

    
79

    
80
    /**
81
     * Create a file mapped buffered Image of the given size and type.
82
     * In this context, buffered image means editable image (admits setRGB etc)
83
     *
84
     * @param w width in pixels of the requested image
85
     * @param h height in pixels of the requested image
86
     * @param type image type (refers to bands, etc. see {@link Image}
87
     * @return a buffered (editable) image of the desired size and type
88
     */
89
    public BufferedImage createVirtualBufferedImage(int w, int h, int type);
90

    
91
    public BufferedImage copyBufferedImage(BufferedImage img);
92

    
93
    /**
94
     * Sets the max physical size of buffered image creates by this manager.
95
     *
96
     * @param dimension
97
     * @see createBufferedImage
98
     * @see createVirtualBufferedImage
99
     */
100
    public void setMaxPhysicalSizeOfBufferedImage(Dimension dimension);
101

    
102
    /**
103
     * Return the max physical size of buffered image creates by this manager.
104
     *
105
     * @return
106
     * @see createBufferedImage
107
     * @see createVirtualBufferedImage
108
     */
109
    public Dimension getMaxPhysicalSizeOfBufferedImage();
110

    
111
    /**
112
     * Alpha blending is the process of combining a translucent foreground color with a background 
113
     * 
114
     * https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending
115
     * 
116
     * @param bgColor
117
     * @param fgColor
118
     * @return 
119
     */    
120
    public Color alphaBlendingWithOpaqueBackground(Color bgColor, Color fgColor);
121
    
122
    public Color opaqueColor(Color src);
123

    
124
    public void translate(JComponent component);
125
    
126
    public void translate(AbstractButton component);
127

    
128
    public void translate(JLabel component);
129
    
130
    public void translate(JTabbedPane component);
131

    
132
    public void setDefaultPopupMenu(final JTextComponent component);
133
    
134
    public void setDefaultPopupMenu(final JComboBox component);
135

    
136
    public void setDefaultPopupMenu(final JTextComponent component, String title);    
137

    
138
    public void setDefaultPopupMenu(final JComboBox component, String title);    
139

    
140
    public ChangeListenerHelper createChangeListenerHelper();
141
    
142
    public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull);
143
    
144
    public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog);
145
    
146
    public ColorPickerController createColorPickerController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha);
147
    
148
    public DatePickerController createDatePickerController(JTextField txtDate, JButton btnDate);
149

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

    
152
    public FilePickerController createFilePickerController(JTextField txtFile, JButton btnFile);
153

    
154
    public FilePickerController createFilePickerController(JTextField txtFile, JButton btnFile, String dialogTitle);
155

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

    
158
    public FolderPickerController createFolderPickerController(JTextField txtFile, JButton btnFile);
159

    
160
    public FolderPickerController createFolderPickerController(JTextField txtFile, JButton btnFile, String dialogTitle);
161

    
162
    public void removeBorder(JComponent component);
163
    
164
    public void addClearButton(final JTextComponent text,  final ActionListener action);
165

    
166
    public void addClearButton(final JTextComponent text);
167

    
168
}