Skip to content

Commit 114faad

Browse files
committed
Base: Rufs update
* ColorPicker, MessageInf, PrepareSentence, Session, Rondutils
1 parent d93fe46 commit 114faad

File tree

8 files changed

+312
-132
lines changed

8 files changed

+312
-132
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright (C) 2023 Paulo Borges
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
package com.openbravo.data.gui;
18+
19+
import java.awt.Color;
20+
import javax.swing.JButton;
21+
import javax.swing.JColorChooser;
22+
23+
/**
24+
*
25+
* @author poolb
26+
*/
27+
public class JColorPicker extends JButton {
28+
29+
private static final long serialVersionUID = 1L;
30+
31+
private Color color = null;
32+
33+
//This is important to allow use nas Bean on IDE
34+
public JColorPicker() {
35+
this(null);
36+
}
37+
38+
public JColorPicker(Color color) {
39+
this.color = color;
40+
this.setBackground(this.color);
41+
initComponent();
42+
}
43+
44+
private void initComponent() {
45+
this.addActionListener((java.awt.event.ActionEvent evt) -> {
46+
jBtnColourActionPerformed(evt);
47+
});
48+
}
49+
50+
private void jBtnColourActionPerformed(java.awt.event.ActionEvent evt) {
51+
this.color = JColorChooser.showDialog(this, "", this.color);
52+
if (color != null) {
53+
this.setBackground(color);
54+
this.setText(getHexColor());
55+
}
56+
}
57+
58+
public Color getColor() {
59+
return this.color;
60+
}
61+
62+
public String getHexColor() {
63+
String colorName = null;
64+
if(this.color != null){
65+
colorName = "#" + Integer.toHexString(color.getRGB() & 0x00ffffff);
66+
}
67+
return colorName;
68+
}
69+
}

kriolos-opos-base/src/main/java/com/openbravo/data/gui/JMessageDialog.form

+65-33
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,19 @@
55
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
66
<ResourceString bundle="data_messages.properties" key="title.message" replaceFormat="LocalRes.getIntString(&quot;{key}&quot;)"/>
77
</Property>
8+
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
9+
<Dimension value="[480, 300]"/>
10+
</Property>
11+
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
12+
<Dimension value="[300, 200]"/>
13+
</Property>
14+
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
15+
<Dimension value="[260, 277]"/>
16+
</Property>
817
<Property name="resizable" type="boolean" value="false"/>
918
</Properties>
1019
<SyntheticProperties>
11-
<SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,21,0,0,1,-57"/>
20+
<SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,49,0,0,1,-30"/>
1221
<SyntheticProperty name="formSizePolicy" type="int" value="0"/>
1322
<SyntheticProperty name="generateSize" type="boolean" value="true"/>
1423
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
@@ -50,12 +59,15 @@
5059
<Property name="axis" type="int" value="1"/>
5160
</Layout>
5261
<SubComponents>
53-
<Component class="javax.swing.JLabel" name="jlblErrorCode">
62+
<Component class="javax.swing.JLabel" name="jlblIcon">
5463
<Properties>
55-
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
56-
<Font name="Arial" size="14" style="0"/>
64+
<Property name="text" type="java.lang.String" value="jlblIcon"/>
65+
<Property name="verticalAlignment" type="int" value="1"/>
66+
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
67+
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
68+
<EmptyBorder bottom="10" left="10" right="10" top="10"/>
69+
</Border>
5770
</Property>
58-
<Property name="text" type="java.lang.String" value="jlblErrorCode"/>
5971
</Properties>
6072
</Component>
6173
<Component class="javax.swing.JLabel" name="jlblMessage">
@@ -65,17 +77,23 @@
6577
</Property>
6678
<Property name="text" type="java.lang.String" value="jlblMessage"/>
6779
<Property name="verticalAlignment" type="int" value="1"/>
80+
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
81+
<Dimension value="[460, 90]"/>
82+
</Property>
6883
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
69-
<Dimension value="[200, 100]"/>
84+
<Dimension value="[200, 30]"/>
7085
</Property>
7186
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
72-
<Dimension value="[200, 100]"/>
87+
<Dimension value="[200, 64]"/>
7388
</Property>
7489
</Properties>
7590
</Component>
7691
<Container class="javax.swing.JScrollPane" name="jscrException">
7792
<Properties>
7893
<Property name="alignmentX" type="float" value="0.0"/>
94+
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
95+
<Dimension value="[200, 150]"/>
96+
</Property>
7997
</Properties>
8098

8199
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
@@ -92,22 +110,12 @@
92110
</Container>
93111
</SubComponents>
94112
</Container>
95-
<Component class="javax.swing.JLabel" name="jlblIcon">
113+
<Container class="javax.swing.JPanel" name="jPanel3">
96114
<Properties>
97-
<Property name="verticalAlignment" type="int" value="1"/>
98-
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
99-
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
100-
<EmptyBorder bottom="10" left="10" right="10" top="10"/>
101-
</Border>
115+
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
116+
<Dimension value="[200, 50]"/>
102117
</Property>
103118
</Properties>
104-
<Constraints>
105-
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
106-
<BorderConstraints direction="Before"/>
107-
</Constraint>
108-
</Constraints>
109-
</Component>
110-
<Container class="javax.swing.JPanel" name="jPanel3">
111119
<Constraints>
112120
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
113121
<BorderConstraints direction="South"/>
@@ -117,6 +125,11 @@
117125
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
118126
<SubComponents>
119127
<Container class="javax.swing.JPanel" name="jPanel2">
128+
<Properties>
129+
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
130+
<Dimension value="[260, 50]"/>
131+
</Property>
132+
</Properties>
120133
<Constraints>
121134
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
122135
<BorderConstraints direction="After"/>
@@ -125,25 +138,44 @@
125138

126139
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
127140
<SubComponents>
128-
<Component class="javax.swing.JButton" name="jcmdOK">
141+
<Component class="javax.swing.JButton" name="jcmdCancel">
129142
<Properties>
130143
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
131144
<Font name="Arial" size="12" style="0"/>
132145
</Property>
133-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
134-
<ResourceString bundle="data_messages.properties" key="button.OK" replaceFormat="LocalRes.getIntString(&quot;{key}&quot;)"/>
146+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
147+
<Connection code="LocalRes.getIntString(&quot;button.cancel&quot;)" type="code"/>
148+
</Property>
149+
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
150+
<Dimension value="[80, 42]"/>
151+
</Property>
152+
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
153+
<Dimension value="[80, 42]"/>
154+
</Property>
155+
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
156+
<Dimension value="[80, 42]"/>
157+
</Property>
158+
</Properties>
159+
<Events>
160+
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jcmdCancelActionPerformed"/>
161+
</Events>
162+
</Component>
163+
<Component class="javax.swing.JButton" name="jcmdOK">
164+
<Properties>
165+
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
166+
<Font name="Arial" size="12" style="0"/>
135167
</Property>
136-
<Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
137-
<ResourceString bundle="pos_messages.properties" key="button.OK" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
168+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
169+
<Connection code="LocalRes.getIntString(&quot;button.ok&quot;)" type="code"/>
138170
</Property>
139171
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
140-
<Dimension value="[65, 33]"/>
172+
<Dimension value="[80, 42]"/>
141173
</Property>
142174
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
143-
<Dimension value="[65, 33]"/>
175+
<Dimension value="[80, 42]"/>
144176
</Property>
145177
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
146-
<Dimension value="[65, 33]"/>
178+
<Dimension value="[80, 42]"/>
147179
</Property>
148180
</Properties>
149181
<Events>
@@ -155,17 +187,17 @@
155187
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
156188
<Font name="Arial" size="12" style="0"/>
157189
</Property>
158-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
159-
<ResourceString bundle="data_messages.properties" key="button.information" replaceFormat="LocalRes.getIntString(&quot;{key}&quot;)"/>
190+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
191+
<Connection code="LocalRes.getIntString(&quot;button.information&quot;)" type="code"/>
160192
</Property>
161193
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
162-
<Dimension value="[65, 33]"/>
194+
<Dimension value="[80, 42]"/>
163195
</Property>
164196
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
165-
<Dimension value="[65, 33]"/>
197+
<Dimension value="[80, 42]"/>
166198
</Property>
167199
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
168-
<Dimension value="[65, 33]"/>
200+
<Dimension value="[80, 42]"/>
169201
</Property>
170202
</Properties>
171203
<Events>

0 commit comments

Comments
 (0)