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

History | View | Annotate | Download (10.4 KB)

1 1251 jjdelcerro
2
package org.gvsig.tools.swing.api;
3
4 1628 jjdelcerro
import java.awt.Color;
5 1530 fdiaz
import java.awt.Dimension;
6
import java.awt.Image;
7 1758 jjdelcerro
import java.awt.event.ActionListener;
8 1530 fdiaz
import java.awt.image.BufferedImage;
9 1746 jjdelcerro
import java.io.File;
10 1640 jjdelcerro
import javax.swing.AbstractButton;
11 1424 jjdelcerro
import javax.swing.ComboBoxModel;
12 1947 jjdelcerro
import javax.swing.Icon;
13 1610 jjdelcerro
import javax.swing.JButton;
14 1377 jjdelcerro
import javax.swing.JComboBox;
15 1746 jjdelcerro
import javax.swing.JComponent;
16 1640 jjdelcerro
import javax.swing.JLabel;
17 1377 jjdelcerro
import javax.swing.JList;
18 1610 jjdelcerro
import javax.swing.JSlider;
19 1685 jjdelcerro
import javax.swing.JTabbedPane;
20 1610 jjdelcerro
import javax.swing.JTextField;
21 2116 omartinez
import javax.swing.JTree;
22 1997 jjdelcerro
import javax.swing.table.TableModel;
23 1698 jjdelcerro
import javax.swing.text.JTextComponent;
24 1377 jjdelcerro
import javax.swing.tree.TreeModel;
25 1986 omartinez
import org.gvsig.tools.bookmarksandhistory.Bookmarks;
26
import org.gvsig.tools.bookmarksandhistory.History;
27
import org.gvsig.tools.swing.api.bookmarkshistory.BookmarksController;
28
import org.gvsig.tools.swing.api.bookmarkshistory.HistoryController;
29 1746 jjdelcerro
import org.gvsig.tools.swing.api.pickercontroller.ColorPickerController;
30
import org.gvsig.tools.swing.api.pickercontroller.DatePickerController;
31
import org.gvsig.tools.swing.api.pickercontroller.FilePickerController;
32
import org.gvsig.tools.swing.api.pickercontroller.FolderPickerController;
33 1894 jjdelcerro
import org.gvsig.tools.swing.api.pickercontroller.PickerController;
34 1251 jjdelcerro
35 1377 jjdelcerro
36 1251 jjdelcerro
public interface ToolsSwingManager {
37 1530 fdiaz
38 1251 jjdelcerro
    public ActionListenerSupport createActionListenerSupport();
39 1530 fdiaz
40 1377 jjdelcerro
    public JListWithCheckbox createJListWithCheckbox(JList wrappedList);
41 1530 fdiaz
42 1377 jjdelcerro
    public void setTreeModel(JComboBox comboBox, TreeModel aTreeModel);
43 1530 fdiaz
44 1424 jjdelcerro
    public ComboBoxModel createComboBoxModel(TreeModel treeModel);
45 1530 fdiaz
46 1746 jjdelcerro
    /**
47 1766 jjdelcerro
     * @param txtLabel
48
     * @param btnShowDialog
49
     * @param sldAlpha
50
     * @param allowNull
51
     * @return
52 1746 jjdelcerro
     * @deprecated use createColorPickerController
53
     */
54 2165 jjdelcerro
    public ColorChooserController createColorChooserController(JTextComponent txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull);
55 1746 jjdelcerro
    /**
56 1766 jjdelcerro
     * @param txtLabel
57
     * @param btnShowDialog
58
     * @return
59 1746 jjdelcerro
     * @deprecated use createColorPickerController
60
     */
61 2165 jjdelcerro
    public ColorChooserController createColorChooserController(JTextComponent txtLabel, JButton btnShowDialog);
62 1746 jjdelcerro
    /**
63 1766 jjdelcerro
     * @param txtLabel
64
     * @param btnShowDialog
65
     * @param sldAlpha
66
     * @return
67 1746 jjdelcerro
     * @deprecated use createColorPickerController
68
     */
69 2165 jjdelcerro
    public ColorChooserController createColorChooserController(JTextComponent txtLabel, JButton btnShowDialog, JSlider sldAlpha);
70 1610 jjdelcerro
71
72 1530 fdiaz
    /**
73
     * Create a buffered Image of the given size and type.
74
     * In this context, buffered image means editable image (admits setRGB etc)
75
     * If the size is bigger of max physical size of buffered image, creates a file mapped buffered Image.
76
     *
77
     * @param w width in pixels of the requested image
78
     * @param h height in pixels of the requested image
79
     * @param type image type (refers to bands, etc. see {@link Image}
80
     * @return a buffered (editable) image of the desired size and type
81
     * @see setMaxPhysicalSizeOfBufferedImage
82
     * @see getMaxPhysicalSizeOfBufferedImage
83
     *
84
     */
85
    public BufferedImage createBufferedImage(int w, int h, int type);
86
87
88
    /**
89
     * Create a file mapped buffered Image of the given size and type.
90
     * In this context, buffered image means editable image (admits setRGB etc)
91
     *
92
     * @param w width in pixels of the requested image
93
     * @param h height in pixels of the requested image
94
     * @param type image type (refers to bands, etc. see {@link Image}
95
     * @return a buffered (editable) image of the desired size and type
96
     */
97
    public BufferedImage createVirtualBufferedImage(int w, int h, int type);
98
99
    public BufferedImage copyBufferedImage(BufferedImage img);
100
101
    /**
102
     * Sets the max physical size of buffered image creates by this manager.
103
     *
104
     * @param dimension
105
     * @see createBufferedImage
106
     * @see createVirtualBufferedImage
107
     */
108
    public void setMaxPhysicalSizeOfBufferedImage(Dimension dimension);
109
110
    /**
111
     * Return the max physical size of buffered image creates by this manager.
112
     *
113
     * @return
114
     * @see createBufferedImage
115
     * @see createVirtualBufferedImage
116
     */
117
    public Dimension getMaxPhysicalSizeOfBufferedImage();
118
119 1628 jjdelcerro
    /**
120
     * Alpha blending is the process of combining a translucent foreground color with a background
121
     *
122
     * https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending
123
     *
124
     * @param bgColor
125
     * @param fgColor
126
     * @return
127
     */
128
    public Color alphaBlendingWithOpaqueBackground(Color bgColor, Color fgColor);
129
130 1632 jjdelcerro
    public Color opaqueColor(Color src);
131 1640 jjdelcerro
132 1746 jjdelcerro
    public void translate(JComponent component);
133
134 1640 jjdelcerro
    public void translate(AbstractButton component);
135
136
    public void translate(JLabel component);
137 1685 jjdelcerro
138
    public void translate(JTabbedPane component);
139 1698 jjdelcerro
140
    public void setDefaultPopupMenu(final JTextComponent component);
141
142
    public void setDefaultPopupMenu(final JComboBox component);
143
144
    public void setDefaultPopupMenu(final JTextComponent component, String title);
145
146
    public void setDefaultPopupMenu(final JComboBox component, String title);
147 1746 jjdelcerro
148
    public ChangeListenerHelper createChangeListenerHelper();
149
150 2165 jjdelcerro
    public ColorPickerController createColorPickerController(JTextComponent txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull);
151 1746 jjdelcerro
152 2165 jjdelcerro
    public ColorPickerController createColorPickerController(JTextComponent txtLabel, JButton btnShowDialog);
153 1746 jjdelcerro
154 2165 jjdelcerro
    public ColorPickerController createColorPickerController(JTextComponent txtLabel, JButton btnShowDialog, JSlider sldAlpha);
155 1746 jjdelcerro
156 2165 jjdelcerro
    public DatePickerController createDatePickerController(JTextComponent txtDate, JButton btnDate);
157 1746 jjdelcerro
158 2165 jjdelcerro
    public FilePickerController createFilePickerController(JTextComponent txtFile, JButton btnFile, String dialogTitle, String fileChooserID, File initialPath, boolean seticon);
159 1746 jjdelcerro
160 2165 jjdelcerro
    public FilePickerController createFilePickerController(JTextComponent txtFile, JButton btnFile);
161 1746 jjdelcerro
162 2165 jjdelcerro
    public FilePickerController createFilePickerController(JTextComponent txtFile, JButton btnFile, String dialogTitle);
163 1746 jjdelcerro
164 2165 jjdelcerro
    public FolderPickerController createFolderPickerController(JTextComponent txtFile, JButton btnFile, String dialogTitle, String fileChooserID, File initialPath, boolean seticon);
165 1746 jjdelcerro
166 2165 jjdelcerro
    public FolderPickerController createFolderPickerController(JTextComponent txtFile, JButton btnFile);
167 1746 jjdelcerro
168 2165 jjdelcerro
    public FolderPickerController createFolderPickerController(JTextComponent txtFile, JButton btnFile, String dialogTitle);
169 1746 jjdelcerro
170 2165 jjdelcerro
    public PickerController<byte[]> createByteArrayPickerController(JTextComponent txtText, JButton btnUpload, JButton btnDownload, String fileChooserID, File initialPath);
171 1894 jjdelcerro
172 2165 jjdelcerro
    public PickerController<byte[]> createByteArrayPickerController(JTextComponent txtText, JButton btnUpload, JButton btnDownload);
173 1894 jjdelcerro
174 1750 jjdelcerro
    public void removeBorder(JComponent component);
175 1758 jjdelcerro
176 1796 jjdelcerro
    public void addClearButton(final JTextComponent text,  final ActionListener action);
177 1758 jjdelcerro
178 1796 jjdelcerro
    public void addClearButton(final JTextComponent text);
179 1758 jjdelcerro
180 1862 jjdelcerro
    public void addClearButton(JComboBox combo);
181
182 1840 jjdelcerro
    public SimpleImage createSimpleImage();
183
184
    public SimpleImage createSimpleImage(Object source);
185 1884 jjdelcerro
186
    public DropDown createDropDown(JComboBox combo);
187
188
    public DropDown createDropDown(JLabel label);
189 2010 jjdelcerro
190
    public DropDown createDropDown(AbstractButton button);
191
192
    public DropDown createDropDown(JComponent component);
193 1884 jjdelcerro
194 1947 jjdelcerro
    /**
195
     * Contructor for creating a CompoundIcon where the icons are
196
     * layed out HORIZONTAL, the gap is 0 and the X/Y alignments will
197
     * default to CENTER.
198
     *
199
     * @param icons the Icons to be painted as part of the CompoundIcon
200
     *
201
     * @return the CompoundIcon
202
     */
203
    public CompoundIcon createCompoundIcon(Icon... icons);
204
205
    /**
206
     * Contructor for creating a CompoundIcon where the gap is 0 and
207
     * the X/Y alignments will default to CENTER.
208
     *
209
     * @param orientation the orientation used to lay out the icons for painting.
210
     * Must be one of SwingConstants.HORIZONTAL, SwingConstants.VERTICAL or STACKED.
211
     * @param icons the Icons to be painted as part of the CompoundIcon
212
     *
213
     * @return the CompoundIcon
214
     */
215
    public CompoundIcon createCompoundIcon(int orientation, Icon... icons);
216
217
    /**
218
     * Convenience contructor for creating a CompoundIcon where the X/Y
219
     * alignments will default to CENTER.
220
     *
221
     * @param orientation the orientation used to lay out the icons for painting.
222
     * Must be one of SwingConstants.HORIZONTAL, SwingConstants.VERTICAL or STACKED.
223
     * @param gap the gap between the icons
224
     * @param icons the Icons to be painted as part of the CompoundIcon
225
     *
226
     * @return the CompoundIcon
227
     */
228
    public CompoundIcon createCompoundIcon(int orientation, int gap, Icon... icons);
229
230
    /**
231
     * Create a CompoundIcon specifying all the properties.
232
     *
233
     * @param orientation the orientation used to lay out the icons for painting.
234
     * Must be one of SwingConstants.HORIZONTAL, SwingConstants.VERTICAL or STACKED.
235
     * @param gap the gap between the icons
236
     * @param alignmentX the X alignment of the icons. Common values are SwingConstants.LEFT,
237
     * SwingConstants.CENTER, SwingConstants.RIGHT.
238
     * @param alignmentY the Y alignment of the icons. Common values are SwingConstants.TOP,
239
     * SwingConstants.CENTER, SwingConstants.BOTTOM.
240
     * @param icons the Icons to be painted as part of the CompoundIcon
241
     *
242
     * @return the CompoundIcon
243
     */
244
    public CompoundIcon createCompoundIcon(int orientation, int gap, int alignmentX, int alignmentY, Icon... icons);
245
246 1986 omartinez
    public BookmarksController createBookmarksController(Bookmarks bookmarks, JButton button);
247
248
    public HistoryController createHistoryController(History history, JButton button);
249 1997 jjdelcerro
250
    public FilteredTableModel createFilteredTableModel(TableModel model, int filterColumn);
251 2035 jjdelcerro
252 2073 jjdelcerro
    public FilteredListModel createFilteredListModel();
253
254 2116 omartinez
    public FilteredTreeModel createFilteredTreeModel(JTree tree);
255
256 2111 jjdelcerro
    public FilteredListController createFilteredListController(JList list, JTextComponent text, JButton button);
257
258 2116 omartinez
    public FilteredTreeController createFilteredTreeController(JTree list, JTextComponent text, JButton button);
259
260 2035 jjdelcerro
    public JLabel createTitledSeparator(String title, int height, int titlePosition, int titleJustification);
261
262
    public JLabel createTitledSeparator(String title);
263 2080 jjdelcerro
264
    public JWebBrowser createJWebBrowser();
265
266
    public void registerJWebBrowserFactory(JWebBrowserFactory factory);
267 1251 jjdelcerro
}