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 @ 1698
History | View | Annotate | Download (3.75 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 javax.swing.AbstractButton; |
9 |
import javax.swing.ComboBoxModel; |
10 |
import javax.swing.JButton; |
11 |
import javax.swing.JComboBox; |
12 |
import javax.swing.JLabel; |
13 |
import javax.swing.JList; |
14 |
import javax.swing.JSlider; |
15 |
import javax.swing.JTabbedPane; |
16 |
import javax.swing.JTextField; |
17 |
import javax.swing.text.JTextComponent; |
18 |
import javax.swing.tree.TreeModel; |
19 |
|
20 |
|
21 |
public interface ToolsSwingManager { |
22 |
|
23 |
public ActionListenerSupport createActionListenerSupport();
|
24 |
|
25 |
public JListWithCheckbox createJListWithCheckbox(JList wrappedList); |
26 |
|
27 |
public void setTreeModel(JComboBox comboBox, TreeModel aTreeModel); |
28 |
|
29 |
public ComboBoxModel createComboBoxModel(TreeModel treeModel); |
30 |
|
31 |
public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha, boolean allowNull); |
32 |
public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog); |
33 |
public ColorChooserController createColorChooserController(JTextField txtLabel, JButton btnShowDialog, JSlider sldAlpha); |
34 |
|
35 |
|
36 |
/**
|
37 |
* Create a buffered Image of the given size and type.
|
38 |
* In this context, buffered image means editable image (admits setRGB etc)
|
39 |
* If the size is bigger of max physical size of buffered image, creates a file mapped buffered Image.
|
40 |
*
|
41 |
* @param w width in pixels of the requested image
|
42 |
* @param h height in pixels of the requested image
|
43 |
* @param type image type (refers to bands, etc. see {@link Image}
|
44 |
* @return a buffered (editable) image of the desired size and type
|
45 |
* @see setMaxPhysicalSizeOfBufferedImage
|
46 |
* @see getMaxPhysicalSizeOfBufferedImage
|
47 |
*
|
48 |
*/
|
49 |
public BufferedImage createBufferedImage(int w, int h, int type); |
50 |
|
51 |
|
52 |
/**
|
53 |
* Create a file mapped buffered Image of the given size and type.
|
54 |
* In this context, buffered image means editable image (admits setRGB etc)
|
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 |
*/
|
61 |
public BufferedImage createVirtualBufferedImage(int w, int h, int type); |
62 |
|
63 |
public BufferedImage copyBufferedImage(BufferedImage img); |
64 |
|
65 |
/**
|
66 |
* Sets the max physical size of buffered image creates by this manager.
|
67 |
*
|
68 |
* @param dimension
|
69 |
* @see createBufferedImage
|
70 |
* @see createVirtualBufferedImage
|
71 |
*/
|
72 |
public void setMaxPhysicalSizeOfBufferedImage(Dimension dimension); |
73 |
|
74 |
/**
|
75 |
* Return the max physical size of buffered image creates by this manager.
|
76 |
*
|
77 |
* @return
|
78 |
* @see createBufferedImage
|
79 |
* @see createVirtualBufferedImage
|
80 |
*/
|
81 |
public Dimension getMaxPhysicalSizeOfBufferedImage(); |
82 |
|
83 |
/**
|
84 |
* Alpha blending is the process of combining a translucent foreground color with a background
|
85 |
*
|
86 |
* https://en.wikipedia.org/wiki/Alpha_compositing#Alpha_blending
|
87 |
*
|
88 |
* @param bgColor
|
89 |
* @param fgColor
|
90 |
* @return
|
91 |
*/
|
92 |
public Color alphaBlendingWithOpaqueBackground(Color bgColor, Color fgColor); |
93 |
|
94 |
public Color opaqueColor(Color src); |
95 |
|
96 |
public void translate(AbstractButton component); |
97 |
|
98 |
public void translate(JLabel component); |
99 |
|
100 |
public void translate(JTabbedPane component); |
101 |
|
102 |
public void setDefaultPopupMenu(final JTextComponent component); |
103 |
|
104 |
public void setDefaultPopupMenu(final JComboBox component); |
105 |
|
106 |
public void setDefaultPopupMenu(final JTextComponent component, String title); |
107 |
|
108 |
public void setDefaultPopupMenu(final JComboBox component, String title); |
109 |
} |