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

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

    
67

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

    
79
    public BufferedImage copyBufferedImage(BufferedImage img);
80

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
150
    public void removeBorder(JComponent component);
151
    
152
    public void addClearButton(final JTextField text,  final ActionListener action);
153

    
154
    public void addClearButton(final JTextField text);
155

    
156
}