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 | 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 | import java.awt.image.BufferedImage; |
||
8 | 1640 | jjdelcerro | import javax.swing.AbstractButton; |
9 | 1424 | jjdelcerro | import javax.swing.ComboBoxModel; |
10 | 1610 | jjdelcerro | import javax.swing.JButton; |
11 | 1377 | jjdelcerro | import javax.swing.JComboBox; |
12 | 1640 | jjdelcerro | import javax.swing.JLabel; |
13 | 1377 | jjdelcerro | import javax.swing.JList; |
14 | 1610 | jjdelcerro | import javax.swing.JSlider; |
15 | 1685 | jjdelcerro | import javax.swing.JTabbedPane; |
16 | 1610 | jjdelcerro | import javax.swing.JTextField; |
17 | 1698 | jjdelcerro | import javax.swing.text.JTextComponent; |
18 | 1377 | jjdelcerro | import javax.swing.tree.TreeModel; |
19 | 1251 | jjdelcerro | |
20 | 1377 | jjdelcerro | |
21 | 1251 | jjdelcerro | public interface ToolsSwingManager { |
22 | 1530 | fdiaz | |
23 | 1251 | jjdelcerro | public ActionListenerSupport createActionListenerSupport();
|
24 | 1530 | fdiaz | |
25 | 1377 | jjdelcerro | public JListWithCheckbox createJListWithCheckbox(JList wrappedList); |
26 | 1530 | fdiaz | |
27 | 1377 | jjdelcerro | public void setTreeModel(JComboBox comboBox, TreeModel aTreeModel); |
28 | 1530 | fdiaz | |
29 | 1424 | jjdelcerro | public ComboBoxModel createComboBoxModel(TreeModel treeModel); |
30 | 1530 | fdiaz | |
31 | 1610 | jjdelcerro | 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 | 1530 | fdiaz | /**
|
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 | 1628 | jjdelcerro | /**
|
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 | 1632 | jjdelcerro | public Color opaqueColor(Color src); |
95 | 1640 | jjdelcerro | |
96 | public void translate(AbstractButton component); |
||
97 | |||
98 | public void translate(JLabel component); |
||
99 | 1685 | jjdelcerro | |
100 | public void translate(JTabbedPane component); |
||
101 | 1698 | jjdelcerro | |
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 | 1251 | jjdelcerro | } |