Enhanced chat window interface.

cusax-fix
Yana Stamcheva 16 years ago
parent f57b42d322
commit 20e30037da

@ -98,6 +98,9 @@ service.gui.icons.CHANGE_NICKNAME_16x16=resources/images/impl/gui/common/changeN
service.gui.icons.BAN_16x16=resources/images/impl/gui/common/ban16x16.png
service.gui.icons.KICK_16x16=resources/images/impl/gui/common/kick16x16.png
service.gui.icons.VOICEMAIL=resources/images/impl/gui/common/voicemail.png
service.gui.icons.SEND_SMS=resources/images/impl/gui/common/sms.png
service.gui.icons.SEND_SMS_SELECTED=resources/images/impl/gui/common/smsSelected.png
service.gui.icons.TYPING=resources/images/impl/gui/common/typing.gif
# Status icons
service.gui.statusicons.USER_ONLINE_ICON=resources/images/impl/gui/common/statusicons/online.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 958 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 757 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
@ -12,12 +13,94 @@
height="1052.3622047"
id="svg2"
sodipodi:version="0.32"
inkscape:version="0.45.1"
sodipodi:docbase="/home/yana/workspace/NewProject/resources/images/impl/gui/common/src"
inkscape:version="0.47 r22583"
sodipodi:docname="gsm.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
inkscape:output_extension="org.inkscape.output.svg.inkscape"
version="1.1">
<defs
id="defs4" />
id="defs4">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective47" />
<inkscape:perspective
id="perspective6124"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
id="linearGradient3591">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop3593" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop3595" />
</linearGradient>
<inkscape:perspective
id="perspective6146"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3737"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective6236"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3777"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3777-9"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3813"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3858"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3858-3"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
@ -28,15 +111,17 @@
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="9.7501663"
inkscape:cx="170.97208"
inkscape:cy="572.94653"
inkscape:zoom="13.788817"
inkscape:cx="189.89415"
inkscape:cy="565.00196"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:window-width="1432"
inkscape:window-height="843"
inkscape:window-width="1280"
inkscape:window-height="756"
inkscape:window-x="0"
inkscape:window-y="0" />
inkscape:window-y="0"
showgrid="false"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<rdf:RDF>
@ -45,6 +130,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@ -52,276 +138,145 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<rect
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#5d5d5d;stroke-width:0.21988384;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect9068"
width="1.5795845"
height="4.3504252"
x="161.46323"
y="471.54114"
rx="1.5"
ry="1.5"
inkscape:export-filename="/home/yana/workspace/NewProject/resources/images/impl/gui/common/gsm.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#d2d5e8;fill-opacity:1;stroke:#000000;stroke-width:0.37483144;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect2162"
width="8.1949053"
height="13.15696"
x="154.86119"
y="474.08682"
rx="1.5"
ry="1.5"
inkscape:export-filename="/home/yana/workspace/NewProject/resources/images/impl/gui/common/gsm.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
style="opacity:1;fill:#ffffff;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.23416792;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4147"
width="5.9918089"
height="4.3417587"
x="155.97798"
y="475.02893"
rx="1.5"
ry="1.5"
inkscape:export-filename="/home/yana/workspace/NewProject/resources/images/impl/gui/common/gsm.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<path
style="fill:#0079ff;fill-opacity:1;stroke:none"
d="m 172.40025,467.16455 c -1.8479,0 -3.33704,1.3518 -3.33704,3.02925 l 0,4.03638 c 0,1.67473 1.48424,3.0248 3.32805,3.02925 l 0.54185,2.06392 2.99287,-1.9821 0.92033,-0.0865 c 1.84788,0 3.33704,-1.35181 3.33704,-3.02926 l 0,-4.03625 c 0,-1.67758 -1.48916,-3.02938 -3.33704,-3.02938 l -4.44647,0 z"
id="rect3145-0-3"
sodipodi:nodetypes="ccccccccccc"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/smsSelected.png"
inkscape:export-xdpi="147.98357"
inkscape:export-ydpi="147.98357" />
<g
id="g11009"
transform="matrix(0.9186391,0,0,0.9640044,12.931138,17.034351)"
inkscape:export-filename="/home/yana/workspace/NewProject/resources/images/impl/gui/common/gsm.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
id="g3791"
transform="translate(12.111263,-0.36261268)"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/sms.png"
inkscape:export-xdpi="147.98357"
inkscape:export-ydpi="147.98357">
<path
inkscape:export-ydpi="147.98357"
inkscape:export-xdpi="147.98357"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/sms.png"
sodipodi:nodetypes="ccccccccccc"
id="rect3145"
d="m 180.13358,467.69703 c -1.8479,0 -3.33704,1.3518 -3.33704,3.02925 l 0,4.03638 c 0,1.67473 1.48424,3.0248 3.32805,3.02925 l 0.54185,2.06392 2.99287,-1.9821 0.92033,-0.0865 c 1.84788,0 3.33704,-1.35181 3.33704,-3.02926 l 0,-4.03625 c 0,-1.67758 -1.48916,-3.02938 -3.33704,-3.02938 l -4.44647,0 z"
style="fill:#474747;fill-opacity:0.76499999;stroke:none" />
<path
inkscape:export-ydpi="147.98357"
inkscape:export-xdpi="147.98357"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/sms.png"
sodipodi:nodetypes="cccccccccccccccccc"
id="rect2162"
d="m 180.77005,468.78335 c -0.48817,0 -0.89107,0.4029 -0.89107,0.89107 l 0,5.95149 c 0,0.48817 0.4029,0.89106 0.89107,0.89106 l 3.06003,0 c 0.48817,0 0.86759,-0.40289 0.86759,-0.89106 l 0,-5.95149 c 0,-0.48817 -0.37942,-0.89107 -0.86759,-0.89107 l -3.06003,0 z m 0.57839,0.57839 1.9276,0 c 0.42761,0 0.77119,0.34358 0.77119,0.77119 l 0,3.14101 c 0,0.42762 -0.34358,0.77119 -0.77119,0.77119 l -1.9276,0 c -0.42761,0 -0.77119,-0.34357 -0.77119,-0.77119 l 0,-3.14101 c 0,-0.42761 0.34358,-0.77119 0.77119,-0.77119 z"
style="fill:#ffffff;fill-opacity:1;stroke:none" />
<rect
ry="5.1866984"
rx="5.4428334"
y="480.44638"
x="155.34554"
height="1.3017812"
width="2.0054467"
inkscape:export-ydpi="147.98357"
inkscape:export-xdpi="147.98357"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/sms.png"
ry="4.8737111"
rx="4.8737106"
y="474.6312"
x="181.48154"
height="1.2232263"
width="1.7957498"
id="rect5118"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="480.4288"
x="157.9315"
height="1.3017812"
width="2.0054467"
id="rect7058"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="480.4288"
x="160.49989"
height="1.3017812"
width="2.0054467"
id="rect7060"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="482.18796"
x="155.35434"
height="1.3017812"
width="2.0054467"
id="rect7062"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="482.20554"
x="157.94031"
height="1.3017812"
width="2.0054467"
id="rect7064"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="482.17035"
x="160.50868"
height="1.3017812"
width="2.0054467"
id="rect7066"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="483.91193"
x="155.35434"
height="1.3017812"
width="2.0054467"
id="rect7068"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="483.92953"
x="157.94031"
height="1.3017812"
width="2.0054467"
id="rect7070"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="483.89435"
x="160.50868"
height="1.3017812"
width="2.0054467"
id="rect7072"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="485.56555"
x="155.35434"
height="1.3017812"
width="2.0054467"
id="rect7074"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="485.58313"
x="157.94031"
height="1.3017812"
width="2.0054467"
id="rect7076"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="5.1866984"
rx="5.4428334"
y="485.54794"
x="160.50868"
height="1.3017812"
width="2.0054467"
id="rect7078"
style="opacity:1;fill:#111111;fill-opacity:0.94117647;stroke:#5d5d5d;stroke-width:0.18664756;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<text
id="text7080"
y="481.43152"
x="156.08438"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="481.43152"
x="156.08438"
id="tspan7082"
sodipodi:role="line">1</tspan></text>
<text
id="text8053"
y="481.37106"
x="158.64136"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="481.37106"
x="158.64136"
id="tspan8055"
sodipodi:role="line">2</tspan></text>
<text
id="text8057"
y="481.39633"
x="161.22115"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="481.39633"
x="161.22115"
id="tspan8059"
sodipodi:role="line">3</tspan></text>
<text
id="text9030"
y="483.12033"
x="156.01402"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="483.12033"
x="156.01402"
id="tspan9032"
sodipodi:role="line">4</tspan></text>
<text
id="text9034"
y="483.15549"
x="158.61758"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="483.15549"
x="158.61758"
id="tspan9036"
sodipodi:role="line">5</tspan></text>
<text
id="text9038"
y="483.15906"
x="161.25739"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="483.15906"
x="161.25739"
id="tspan9040"
sodipodi:role="line">6</tspan></text>
<text
id="text9042"
y="484.88895"
x="156.0426"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="484.88895"
x="156.0426"
id="tspan9044"
sodipodi:role="line">7</tspan></text>
<text
id="text9046"
y="484.87949"
x="158.65276"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="484.87949"
x="158.65276"
id="tspan9048"
sodipodi:role="line">8</tspan></text>
<text
id="text9050"
y="484.81857"
x="161.25301"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="484.81857"
x="161.25301"
id="tspan9052"
sodipodi:role="line">9</tspan></text>
<text
id="text9056"
y="486.61295"
x="156.11931"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="486.61295"
x="156.11931"
id="tspan9058"
sodipodi:role="line">*</tspan></text>
<text
id="text9060"
y="486.53635"
x="158.67506"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="486.53635"
x="158.67506"
id="tspan9062"
sodipodi:role="line">0</tspan></text>
<text
id="text9064"
y="486.54257"
x="161.14746"
style="font-size:0.89590824px;font-style:normal;font-weight:normal;text-align:justify;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
xml:space="preserve"><tspan
y="486.54257"
x="161.14746"
id="tspan9066"
sodipodi:role="line">#</tspan></text>
style="fill:#474747;fill-opacity:0.76470588;stroke:none" />
</g>
<path
sodipodi:type="star"
style="fill:#323232;fill-opacity:1;stroke:#323232;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path3919"
sodipodi:sides="3"
sodipodi:cx="391.12592"
sodipodi:cy="627.03607"
sodipodi:r1="27.367224"
sodipodi:r2="13.683612"
sodipodi:arg1="0.022723361"
sodipodi:arg2="1.0699209"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 418.48607,627.65789 -20.78937,11.38093 -20.78938,11.38093 0.53852,-23.69459 0.53851,-23.69459 20.25086,12.31366 20.25086,12.31366 z"
transform="matrix(0.00188412,0.06285871,-0.09401515,0.00125973,261.41889,447.20767)"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/sms.png"
inkscape:export-xdpi="147.98357"
inkscape:export-ydpi="147.98357" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="m 173.03672,468.25087 c -0.48817,0 -0.89107,0.4029 -0.89107,0.89107 l 0,5.95149 c 0,0.48817 0.4029,0.89106 0.89107,0.89106 l 3.06003,0 c 0.48817,0 0.86759,-0.40289 0.86759,-0.89106 l 0,-5.95149 c 0,-0.48817 -0.37942,-0.89107 -0.86759,-0.89107 l -3.06003,0 z m 0.57839,0.57839 1.9276,0 c 0.42761,0 0.77119,0.34358 0.77119,0.77119 l 0,3.14101 c 0,0.42762 -0.34358,0.77119 -0.77119,0.77119 l -1.9276,0 c -0.42761,0 -0.77119,-0.34357 -0.77119,-0.77119 l 0,-3.14101 c 0,-0.42761 0.34358,-0.77119 0.77119,-0.77119 z"
id="rect2162-2-7"
sodipodi:nodetypes="cccccccccccccccccc"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/smsSelected.png"
inkscape:export-xdpi="147.98357"
inkscape:export-ydpi="147.98357" />
<rect
style="fill:#0079ff;fill-opacity:1;stroke:none"
id="rect5118-4-9"
width="1.7957498"
height="1.2232263"
x="173.7482"
y="474.09869"
rx="4.8737106"
ry="4.8737111"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/smsSelected.png"
inkscape:export-xdpi="147.98357"
inkscape:export-ydpi="147.98357" />
<path
sodipodi:type="star"
style="fill:#323232;fill-opacity:1;stroke:#323232;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path3919-0"
sodipodi:sides="3"
sodipodi:cx="391.12592"
sodipodi:cy="627.03607"
sodipodi:r1="27.367224"
sodipodi:r2="13.683612"
sodipodi:arg1="0.022723361"
sodipodi:arg2="1.0699209"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 418.48607,627.65789 -20.78937,11.38093 -20.78938,11.38093 0.53852,-23.69459 0.53851,-23.69459 20.25086,12.31366 20.25086,12.31366 z"
transform="matrix(0.00188422,0.06286199,-0.09402005,0.00125979,241.58716,447.20602)"
inkscape:export-filename="/Users/yanastamcheva/workspace/trunk1/resources/images/impl/gui/common/smsSelected.png"
inkscape:export-xdpi="147.98357"
inkscape:export-ydpi="147.98357" />
<path
sodipodi:type="arc"
style="fill:#555555;fill-opacity:1;stroke:none"
id="path3848"
sodipodi:cx="174.45296"
sodipodi:cy="486.9765"
sodipodi:rx="2.9371626"
sodipodi:ry="2.8283789"
d="m 177.39012,486.9765 a 2.9371626,2.8283789 0 1 1 -5.87433,0 2.9371626,2.8283789 0 1 1 5.87433,0 z"
transform="matrix(0.85116158,0,0,0.88389854,25.528139,56.867061)"
inkscape:export-filename="/Users/yanastamcheva/Desktop/typing2.png"
inkscape:export-xdpi="72"
inkscape:export-ydpi="72" />
<path
sodipodi:type="arc"
style="fill:#707070;fill-opacity:1;stroke:none"
id="path3848-2"
sodipodi:cx="174.45296"
sodipodi:cy="486.9765"
sodipodi:rx="2.9371626"
sodipodi:ry="2.8283789"
d="m 177.39012,486.9765 a 2.9371626,2.8283789 0 1 1 -5.87433,0 2.9371626,2.8283789 0 1 1 5.87433,0 z"
transform="matrix(0.85116158,0,0,0.88389854,34.528345,56.867364)"
inkscape:export-filename="/Users/yanastamcheva/Desktop/typing1.png"
inkscape:export-xdpi="70.434128"
inkscape:export-ydpi="70.434128" />
<path
sodipodi:type="arc"
style="fill:#707070;fill-opacity:1;stroke:none"
id="path3848-9"
sodipodi:cx="174.45296"
sodipodi:cy="486.9765"
sodipodi:rx="2.9371626"
sodipodi:ry="2.8283789"
d="m 177.39012,486.9765 a 2.9371626,2.8283789 0 1 1 -5.87433,0 2.9371626,2.8283789 0 1 1 5.87433,0 z"
transform="matrix(0.85116158,0,0,0.88389854,43.528345,56.867364)"
inkscape:export-filename="/Users/yanastamcheva/Desktop/typing1.png"
inkscape:export-xdpi="70.434128"
inkscape:export-ydpi="70.434128" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

@ -83,6 +83,7 @@ service.gui.CALL_VIA=Call via:
service.gui.CALL_NOT_SUPPORTING_PARTICIPANT=This call only supports participants from the {0} network and your {1} account. {2} does not contain any address for this network or account.
service.gui.CANCEL=&Cancel
service.gui.CHAT=Chat
service.gui.CHANGE_FONT=Change font
service.gui.CHANGE_ROOM_SUBJECT=Change room's subject...
service.gui.CHANGE_ROOM_SUBJECT_LABEL=In the field below, you can enter the new subject for this room.
service.gui.CHANGE_NICKNAME=Change nickname...
@ -129,7 +130,6 @@ service.gui.CONTACT_NOT_SUPPORTING_TELEPHONY=The chosen {0} contact doesn''t sup
service.gui.CONTACT_NOT_SUPPORTING_CHAT_CONF=The chosen {0} contact doesn''t support chat conferencing.
service.gui.CONTACT_PAUSED_TYPING={0} paused typing the message
service.gui.CONTACT_TYPING={0} is typing a message
service.gui.CONTACT_TYPING_STATE_STALE=typing state not updated
service.gui.CONTACT_INFO=&Contact info
service.gui.CONTACTS=Contacts
service.gui.COPY=&Copy
@ -424,6 +424,7 @@ service.gui.UNKNOWN=Unknown user
service.gui.UNKNOWN_STATUS=Unknown state
service.gui.UNREGISTERED_MESSAGE=Unable to connect the following account: User name: {0}, Server name: {1}. You are currently offline.
service.gui.VIDEO_CALL=&Video call
service.gui.VIA_SMS=Via SMS
service.gui.VIEW=&View
service.gui.VIEW_HISTORY=View &history
service.gui.VIEW_SMILEYS=View &smileys

@ -1,80 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.lookandfeel;
import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
/**
* The SIPCommSelectorMenuUI implementation.
*
* @author Yana Stamcheva
* @author Adam Netocny
*/
public class SIPCommSelectorMenuUI
extends BasicMenuUI
implements Skinnable
{
private Image menuBgImage
= ImageLoader.getImage(ImageLoader.STATUS_SELECTOR_BOX);
/**
* Creates a new SIPCommSelectorMenuUI instance.
*
* @param c the component for which we create the UI
* @return the created <tt>ComponentUI</tt>
*/
public static ComponentUI createUI(JComponent c)
{
return new SIPCommSelectorMenuUI();
}
/**
* Draws the background of the menu item.
*
* @param g the paint graphics
* @param menuItem menu item to be painted
* @param bgColor selection background color
* @since 1.4
*/
protected void paintBackground( Graphics g,
JMenuItem menuItem,
Color bgColor)
{
g = g.create();
try
{
AntialiasingManager.activateAntialiasing(g);
int menuWidth = menuItem.getWidth();
int menuHeight = menuItem.getHeight();
g.drawImage(menuBgImage, 0, 0, menuWidth, menuHeight, null);
}
finally
{
g.dispose();
}
}
/**
* Reloads the background icon.
*/
public void loadSkin()
{
menuBgImage
= ImageLoader.getImage(ImageLoader.STATUS_SELECTOR_BOX);
}
}

@ -30,5 +30,5 @@ public interface ChatConversationContainer
*
* @param statusMessage the status message to set
*/
public void setStatusMessage(String statusMessage);
public void addTypingNotification(String statusMessage);
}

@ -150,6 +150,17 @@ public class ChatConversationPanel
*/
private boolean scrollToBottomIsPending = false;
/**
* The label showing current typing notification.
*/
private JLabel typingNotificationLabel;
/**
* The typing notification icon.
*/
private final Icon typingIcon = GuiActivator.getResources()
.getImage("service.gui.icons.TYPING");
/**
* The implementation of the routine which scrolls {@link #chatTextPane} to its
* bottom.
@ -203,7 +214,10 @@ public ChatConversationPanel(ChatConversationContainer chatContainer)
this.setWheelScrollingEnabled(true);
this.setViewportView(chatTextPane);
JPanel viewportView = new TransparentPanel(new BorderLayout());
viewportView.add(chatTextPane);
this.setViewportView(viewportView);
this.setHorizontalScrollBarPolicy(
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
@ -279,7 +293,7 @@ public void componentResized(ComponentEvent e)
}
}
};
chatTextPane.addComponentListener(componentListener);
viewportView.addComponentListener(componentListener);
getViewport().addComponentListener(componentListener);
}
@ -1380,6 +1394,55 @@ public void addComponent(ChatConversationComponent component)
}
}
/**
* Adds a typing notification message to the conversation panel.
*
* @param typingNotification the typing notification to show
*/
public void addTypingNotification(String typingNotification)
{
if (typingNotificationLabel == null)
{
typingNotificationLabel
= new JLabel( typingNotification,
typingIcon,
SwingConstants.CENTER);
typingNotificationLabel.setForeground(Color.GRAY);
typingNotificationLabel.setFont(
typingNotificationLabel.getFont().deriveFont(11f));
typingNotificationLabel.setVerticalTextPosition(JLabel.BOTTOM);
typingNotificationLabel.setHorizontalTextPosition(JLabel.LEFT);
typingNotificationLabel.setIconTextGap(0);
((JComponent) getViewport().getView()).add(
typingNotificationLabel, BorderLayout.SOUTH);
}
else
{
typingNotificationLabel.setText(typingNotification);
if (typingNotification != null && typingNotification.length() > 0)
typingNotificationLabel.setIcon(typingIcon);
else
typingNotificationLabel.setIcon(null);
}
synchronized (scrollToBottomRunnable)
{
scrollToBottomIsPending = true;
}
revalidate();
repaint();
}
/**
* Removes the typing notification message from the conversation panel.
*/
public void removeTypingNotification()
{
addTypingNotification("");
}
/**
* Returns the date string to show for the given date.
*

@ -63,23 +63,14 @@ public class ChatPanel
private final JSplitPane messagePane
= new JSplitPane(JSplitPane.VERTICAL_SPLIT);
private final JCheckBox sendSmsCheckBox = new SIPCommCheckBox(
GuiActivator.getResources().getI18NString("service.gui.SEND_AS_SMS"));
private JSplitPane topSplitPane;
private ChatTransportSelectorBox transportSelectorBox;
private JLabel sendViaLabel;
private final ChatConversationPanel conversationPanel;
private final ChatWritePanel writeMessagePanel;
private ChatRoomMemberListPanel chatContactListPanel;
private final ChatSendPanel sendPanel;
private final ChatContainer chatContainer;
private ChatRoomSubjectPanel subjectPanel;
@ -119,6 +110,8 @@ public class ChatPanel
private boolean isHistoryLoaded;
private int autoDividerLocation = 0;
/**
* Stores all active file transfer requests and effective transfers with
* the identifier of the transfer.
@ -142,28 +135,18 @@ public ChatPanel(ChatContainer chatContainer)
this.conversationPanel.getChatTextPane()
.setTransferHandler(new ChatTransferHandler(this));
this.sendPanel = new ChatSendPanel(this);
this.writeMessagePanel = new ChatWritePanel(this);
int chatAreaSize = ConfigurationManager.getChatWriteAreaSize();
Dimension writeMessagePanelDefaultSize
= new Dimension(500, (chatAreaSize > 0) ? chatAreaSize : 100);
Dimension writeMessagePanelMinSize = new Dimension(500, 45);
this.writeMessagePanel.setMinimumSize(writeMessagePanelMinSize);
this.writeMessagePanel.setPreferredSize(writeMessagePanelDefaultSize);
this.messagePane.setBorder(null);
this.messagePane.setOpaque(false);
this.messagePane.addPropertyChangeListener(
new DividerLocationListener());
this.messagePane.setDividerSize(3);
this.messagePane.setResizeWeight(1.0D);
this.messagePane.setBottomComponent(writeMessagePanel);
this.add(messagePane, BorderLayout.CENTER);
this.add(sendPanel, BorderLayout.SOUTH);
if (OSUtils.IS_MAC)
{
@ -251,16 +234,7 @@ public void setChatSession(ChatSession chatSession)
this.repaint();
}
initChatTransportSelectorBox();
if (!transportSelectorBox.getMenu().isEnabled())
{
// Show a message to the user that IM is not possible.
getChatConversationPanel().appendMessageToEnd("<h5>" +
GuiActivator.getResources().
getI18NString("service.gui.MSG_NOT_POSSIBLE") +
"</h5>");
}
writeMessagePanel.setTransportSelectorBoxVisible(true);
//Enables to change the protocol provider by simply pressing the
// CTRL-P key combination
@ -279,7 +253,7 @@ else if (chatSession instanceof ConferenceChatSession)
ConferenceChatSession confSession
= (ConferenceChatSession) chatSession;
removeChatTransportSelectorBox();
writeMessagePanel.setTransportSelectorBoxVisible(false);
confSession.addLocalUserRoleListener(this);
confSession.addMemberRoleListener(this);
@ -301,9 +275,6 @@ else if (chatSession instanceof ConferenceChatSession)
while (chatParticipants.hasNext())
chatContactListPanel.addContact(chatParticipants.next());
}
if (!chatSession.getCurrentChatTransport().allowsSmsMessage())
sendSmsCheckBox.setEnabled(false);
}
/**
@ -315,17 +286,6 @@ public ChatSession getChatSession()
return chatSession;
}
/**
* Shows or hides the Stylebar depending on the value of parameter b.
*
* @param b if true, makes the Stylebar visible, otherwise hides the
* Stylebar
*/
public void setStylebarVisible(boolean b)
{
this.writeMessagePanel.setStylebarVisible(b);
}
/**
* Runs clean-up for associated resources which need explicit disposal (e.g.
* listeners keeping this instance alive because they were added to the
@ -362,13 +322,21 @@ public Window getConversationContainerWindow()
}
/**
* Sets the message text to the status panel in the bottom of the chat
* window. Used to show typing notification messages, links' hrefs, etc.
* @param statusMessage The message text to be displayed.
* Adds a typing notification message to the conversation panel.
*
* @param typingNotification the typing notification string
*/
public void addTypingNotification(String typingNotification)
{
conversationPanel.addTypingNotification(typingNotification);
}
/**
* Removes the typing notification message from the conversation panel.
*/
public void setStatusMessage(String statusMessage)
public void removeTypingNotification()
{
this.sendPanel.getStatusPanel().setStatusMessage(statusMessage);
conversationPanel.removeTypingNotification();
}
/**
@ -391,16 +359,6 @@ public ChatWritePanel getChatWritePanel()
return this.writeMessagePanel;
}
/**
* Returns the send panel, contained in this chat panel.
*
* @return the send panel, contained in this chat panel
*/
public ChatSendPanel getChatSendPanel()
{
return this.sendPanel;
}
/**
* Returns the corresponding role description to the given role index.
*
@ -876,10 +834,19 @@ public void paste()
*/
public void sendButtonDoClick()
{
JButton sendButton = this.sendPanel.getSendButton();
if (!isWriteAreaEmpty())
{
new Thread()
{
public void run()
{
sendMessage();
}
}.start();
}
sendButton.requestFocus();
sendButton.doClick();
//make sure the focus goes back to the write area
requestFocusInWriteArea();
}
/**
@ -1148,7 +1115,7 @@ public void sendFile(final File file)
*/
protected void sendMessage()
{
if (sendSmsCheckBox.isSelected())
if (writeMessagePanel.isSmsSelected())
{
this.sendSmsMessage();
}
@ -1311,59 +1278,6 @@ protected void sendInstantMessage()
this.refreshWriteArea();
}
/**
* Initializes the send via label and selector box.
*/
private void initChatTransportSelectorBox()
{
// Initialize the "send via" selector box and adds it to the send panel.
if (transportSelectorBox == null)
{
transportSelectorBox = new ChatTransportSelectorBox(
chatSession, chatSession.getCurrentChatTransport());
sendViaLabel = new JLabel(
GuiActivator.getResources().getI18NString(
"service.gui.SEND_VIA"));
}
JPanel sendPanel = getChatSendPanel().getSendPanel();
sendPanel.add(transportSelectorBox, 0);
sendPanel.add(sendViaLabel, 0);
updateSendButtonStatus();
this.revalidate();
this.repaint();
}
/**
* Sets the send button to the same state (enabled/ disabled) as the
* transportSelectorBox.
*/
private void updateSendButtonStatus()
{
getChatSendPanel().getSendButton().
setEnabled(transportSelectorBox.getMenu().isEnabled());
}
/**
* Removes the send via selector box and label.
*/
private void removeChatTransportSelectorBox()
{
if (transportSelectorBox == null)
return;
JPanel sendPanel = getChatSendPanel().getSendPanel();
sendPanel.remove(transportSelectorBox);
sendPanel.remove(sendViaLabel);
this.revalidate();
this.repaint();
}
/**
* Listens for SMS messages and shows them in the chat.
*/
@ -1557,7 +1471,7 @@ private void loadHistoryPeriod()
*/
public void setSmsSelected(boolean isSmsSelected)
{
sendSmsCheckBox.setSelected(isSmsSelected);
writeMessagePanel.setSmsSelected(isSmsSelected);
}
/**
@ -1569,12 +1483,7 @@ private class ChangeTransportAction
{
public void actionPerformed(ActionEvent e)
{
/*
* Opens the selector box containing the protocol contact icons.
* This is the menu, where user could select the protocol specific
* contact to communicate through.
*/
transportSelectorBox.getMenu().doClick();
writeMessagePanel.openChatTransportSelectorBox();
}
}
@ -1608,9 +1517,7 @@ public void setContactName(ChatContact<?> chatContact, String name)
*/
public void addChatTransport(ChatTransport chatTransport)
{
if (transportSelectorBox != null)
transportSelectorBox.addChatTransport(chatTransport);
updateSendButtonStatus();
writeMessagePanel.addChatTransport(chatTransport);
}
/**
@ -1620,9 +1527,7 @@ public void addChatTransport(ChatTransport chatTransport)
*/
public void removeChatTransport(ChatTransport chatTransport)
{
if (transportSelectorBox != null)
transportSelectorBox.removeChatTransport(chatTransport);
updateSendButtonStatus();
writeMessagePanel.removeChatTransport(chatTransport);
}
/**
@ -1632,8 +1537,7 @@ public void removeChatTransport(ChatTransport chatTransport)
*/
public void setSelectedChatTransport(ChatTransport chatTransport)
{
if (transportSelectorBox != null)
transportSelectorBox.setSelected(chatTransport);
writeMessagePanel.setSelectedChatTransport(chatTransport);
}
/**
@ -1643,8 +1547,7 @@ public void setSelectedChatTransport(ChatTransport chatTransport)
*/
public void updateChatTransportStatus(ChatTransport chatTransport)
{
if (transportSelectorBox != null)
transportSelectorBox.updateTransportStatus(chatTransport);
writeMessagePanel.updateChatTransportStatus(chatTransport);
// Show a status message to the user.
this.addMessage(
@ -2154,15 +2057,65 @@ public void propertyChange(PropertyChangeEvent evt)
.equals(JSplitPane.DIVIDER_LOCATION_PROPERTY))
{
int dividerLocation = (Integer) evt.getNewValue();
int writeAreaSize = messagePane.getHeight() - dividerLocation
- messagePane.getDividerSize();
ConfigurationManager
.setChatWriteAreaSize(writeAreaSize);
// We store the divider location only when the user drags the
// divider and not when we've set it programatically.
if (dividerLocation != autoDividerLocation)
{
int writeAreaSize
= messagePane.getHeight() - dividerLocation
- messagePane.getDividerSize();
ConfigurationManager
.setChatWriteAreaSize(writeAreaSize);
writeMessagePanel.setPreferredSize(
new Dimension(
(int) writeMessagePanel.getPreferredSize()
.getWidth(),
writeAreaSize));
}
}
}
}
/**
* Sets the location of the split pane divider.
*
* @param location the location of the divider given by the pixel count
* between the left bottom corner and the left bottom divider location
*/
public void setDividerLocation(int location)
{
int dividerLocation = messagePane.getHeight() - location;
autoDividerLocation = dividerLocation;
messagePane.setDividerLocation(dividerLocation);
messagePane.revalidate();
messagePane.repaint();
}
/**
* Returns the contained divider location.
*
* @return the contained divider location
*/
public int getDividerLocation()
{
return messagePane.getHeight() - messagePane.getDividerLocation();
}
/**
* Returns the contained divider size.
*
* @return the contained divider size
*/
public int getDividerSize()
{
return messagePane.getDividerSize();
}
/**
* Adds all events accumulated in the incoming event buffer to the
* chat conversation panel.
@ -2362,6 +2315,47 @@ public void promptRepaint()
this.getChatWritePanel().getEditorPane().repaint();
}
/**
* Shows the font chooser dialog
*/
public void showFontChooserDialog()
{
JEditorPane editorPane = writeMessagePanel.getEditorPane();
FontChooser fontChooser = new FontChooser();
fontChooser.setFontFamily(
editorPane.getFont().getFontName());
fontChooser.setFontSize(
editorPane.getFont().getSize());
fontChooser.setBoldStyle(editorPane.getFont().isBold());
fontChooser.setItalicStyle(editorPane.getFont().isItalic());
int result = fontChooser.showDialog(this);
if (result == FontChooser.OK_OPTION)
{
// Font family and size
writeMessagePanel.setFontFamilyAndSize(
fontChooser.getFontFamily(),
fontChooser.getFontSize());
// Font style
writeMessagePanel.setBoldStyleEnable(
fontChooser.isBoldStyleSelected());
writeMessagePanel.setItalicStyleEnable(
fontChooser.isItalicStyleSelected());
writeMessagePanel.setUnderlineStyleEnable(
fontChooser.isUnderlineStyleSelected());
// Font color
writeMessagePanel.setFontColor(fontChooser.getFontColor());
}
editorPane.requestFocus();
}
/**
* Reloads chat messages.
*/

@ -1,126 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.chat;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
/**
* The <tt>ChatSendPanel</tt> is the panel in the bottom of the chat. It
* contains the send button, the status panel, where typing notifications are
* shown and the selector box, where the protocol specific contact is chosen.
*
* @author Yana Stamcheva
*/
public class ChatSendPanel
extends TransparentPanel
implements ActionListener
{
private final JButton sendButton;
private final StatusPanel statusPanel = new StatusPanel();
private final TransparentPanel sendPanel
= new TransparentPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
private final ChatPanel chatPanel;
/**
* Creates an instance of <tt>ChatSendPanel</tt>.
*
* @param chatPanel The parent <tt>ChatPanel</tt>.
*/
public ChatSendPanel(ChatPanel chatPanel)
{
super(new BorderLayout(5, 0));
// MacOS would add a default border, so we just add a border for
// other operating systems.
if (!OSUtils.IS_MAC)
this.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
sendButton = new JButton(
GuiActivator.getResources().getI18NString("service.gui.SEND"));
this.chatPanel = chatPanel;
this.sendPanel.add(sendButton);
this.add(statusPanel, BorderLayout.CENTER);
this.add(sendPanel, BorderLayout.EAST);
this.sendButton.addActionListener(this);
this.sendButton.setMnemonic(
GuiActivator.getResources().getI18nMnemonic("service.gui.SEND"));
}
/**
* Defines actions when send button is pressed.
*
* @param evt The <tt>ActionEvent</tt> object.
*/
public void actionPerformed(ActionEvent evt)
{
if (!chatPanel.isWriteAreaEmpty())
{
new Thread()
{
public void run()
{
chatPanel.sendMessage();
}
}.start();
}
//make sure the focus goes back to the write area
chatPanel.requestFocusInWriteArea();
}
/**
* Returns the parent <tt>ChatPanel</tt>.
* @return the parent <tt>ChatPanel</tt>
*/
public ChatPanel getChatPanel()
{
return chatPanel;
}
/**
* Returns the main container. Used by the single user chat panel to add
* here the "send via" selector box.
* @return the main container
*/
public JPanel getSendPanel()
{
return sendPanel;
}
/**
* Returns the status panel contained in this panel.
* @return the status panel contained in this panel
*/
public StatusPanel getStatusPanel()
{
return statusPanel;
}
/**
* Returns the send button.
*
* @return The send button.
*/
public JButton getSendButton()
{
return sendButton;
}
}

@ -12,7 +12,6 @@
import javax.swing.*;
import net.java.sip.communicator.impl.gui.lookandfeel.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.skin.*;
@ -38,36 +37,52 @@ public class ChatTransportSelectorBox
private final Map<ChatTransport, JMenuItem> transportMenuItems =
new Hashtable<ChatTransport, JMenuItem>();
private final SIPCommMenu menu = new SIPCommMenu();
private final SIPCommMenu menu = new SelectorMenu();
private final ChatSession chatSession;
private final ChatPanel chatPanel;
/**
* Creates an instance of <tt>ChatTransportSelectorBox</tt>.
*
* @param chatSession the corresponding chat session
* @param selectedChatTransport the chat transport to select by default
*/
public ChatTransportSelectorBox(ChatSession chatSession,
public ChatTransportSelectorBox(ChatPanel chatPanel,
ChatSession chatSession,
ChatTransport selectedChatTransport)
{
this.chatPanel = chatPanel;
this.chatSession = chatSession;
this.menu.setPreferredSize(new Dimension(28, 24));
this.menu.setUI(new SIPCommSelectorMenuUI());
setPreferredSize(new Dimension(30, 28));
setMaximumSize(new Dimension(30, 28));
setMinimumSize(new Dimension(30, 28));
this.menu.setPreferredSize(new Dimension(30, 45));
this.menu.setMaximumSize(new Dimension(30, 45));
this.add(menu);
this.setBorder(null);
this.menu.setBorder(null);
this.menu.setOpaque(false);
this.setOpaque(false);
// as a default disable the menu, it will be enabled as soon as we add
// a valid menu item
this.menu.setEnabled(false);
Iterator<ChatTransport> chatTransports = chatSession.getChatTransports();
Iterator<ChatTransport> chatTransports
= chatSession.getChatTransports();
while (chatTransports.hasNext())
this.addChatTransport(chatTransports.next());
if (this.menu.getItemCount() > 0 &&
selectedChatTransport.allowsInstantMessage())
(selectedChatTransport.allowsInstantMessage()
|| selectedChatTransport.allowsSmsMessage()))
{
this.setSelected(selectedChatTransport);
}
@ -90,7 +105,8 @@ private void updateEnableStatus()
*/
public void addChatTransport(ChatTransport chatTransport)
{
if (chatTransport.allowsInstantMessage())
if (chatTransport.allowsInstantMessage()
|| chatTransport.allowsSmsMessage())
{
Image img = createTransportStatusImage(chatTransport);
@ -238,6 +254,9 @@ private void setSelected(ChatTransport chatTransport, ImageIcon icon)
tooltipText += chatTransport.getDisplayName();
this.menu.setToolTipText(tooltipText);
chatPanel.getChatWritePanel().setSmsLabelVisible(
chatTransport.allowsSmsMessage());
}
/**
@ -278,15 +297,18 @@ private boolean containsOtherOnlineContacts(ChatTransport chatTransport)
return false;
}
/**
* Reloads UI defs.
*/
public void loadSkin()
private class SelectorMenu extends SIPCommMenu
{
super.loadSkin();
Image image = ImageLoader.getImage(ImageLoader.DOWN_ARROW_ICON);
if(menu != null && menu.getUI() != null
&& menu.getUI() instanceof SIPCommSelectorMenuUI)
((SIPCommSelectorMenuUI) menu.getUI()).loadSkin();
public void paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawImage(image,
getWidth() - image.getWidth(this) - 1,
(getHeight() - image.getHeight(this) - 1)/2,
this);
}
}
}

@ -148,27 +148,6 @@ public void setToolbarVisible(boolean b)
toolbarPanel.setVisible(b);
}
/**
* Shows or hides the Stylebar depending on the value of parameter b.
*
* @param b if true, makes the Stylebar visible, otherwise hides the Stylebar
*/
public void setStylebarVisible(boolean b)
{
ChatPanel p = this.getCurrentChat();
// Set the value for the current chat panel
if (p != null)
p.setStylebarVisible(b);
// if there is tabs, set it for all
for (int i = 0, imax = this.getChatTabCount(); i < imax; i++)
{
p = (ChatPanel) this.chatTabbedPane.getComponentAt(i);
p.setStylebarVisible(b);
}
}
/**
* @see SIPCommFrame#dispose()
*/
@ -427,6 +406,8 @@ public void setCurrentChat(final ChatPanel chatPanel)
this.setTitle(chatSession.getChatName());
this.setChatContactPhoto(chatSession);
this.mainToolBar.getSmileysBox().setChat(chatPanel);
chatPanel.requestFocusInWriteArea();
new Thread()
@ -654,8 +635,7 @@ private class OpenSmileyAction
{
public void actionPerformed(ActionEvent e)
{
getCurrentChat().getChatWritePanel()
.getEditTextToolBar().getSmileysSelectorBox().open();
mainToolBar.getSmileysBox().open();
}
}
@ -731,8 +711,7 @@ else if (writePanelRightMenu.isVisible())
writePanelRightMenu.setVisible(false);
}
else if ((menuBar.getSelectedMenu() != null)
|| chatWritePanel
.getEditTextToolBar().hasSelectedMenus())
|| mainToolBar.getSmileysBox().isVisible())
{
MenuSelectionManager.defaultManager().clearSelectedPath();
}

@ -20,7 +20,6 @@
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.main.chat.menus.*;
import net.java.sip.communicator.impl.gui.main.chat.toolBars.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.event.*;
@ -44,13 +43,14 @@ public class ChatWritePanel
KeyListener,
MouseListener,
UndoableEditListener,
DocumentListener,
Skinnable
{
private final Logger logger = Logger.getLogger(ChatWritePanel.class);
private JEditorPane editorPane = new JEditorPane();
private final JEditorPane editorPane = new JEditorPane();
private UndoManager undo = new UndoManager();
private final UndoManager undo = new UndoManager();
private final ChatPanel chatPanel;
@ -60,13 +60,31 @@ public class ChatWritePanel
private int typingState = -1;
private WritePanelRightButtonMenu rightButtonMenu;
private final WritePanelRightButtonMenu rightButtonMenu;
private EditTextToolBar editTextToolBar;
private ArrayList<ChatMenuListener> menuListeners
private final ArrayList<ChatMenuListener> menuListeners
= new ArrayList<ChatMenuListener>();
private final SCScrollPane scrollPane = new SCScrollPane();
private ChatTransportSelectorBox transportSelectorBox;
private final Container centerPanel;
private JLabel smsLabel;
private JCheckBoxMenuItem smsMenuItem;
private JLabel smsCharCountLabel;
private JLabel smsNumberLabel;
private int smsNumberCount = 1;
private int smsCharCount = 160;
private boolean smsMode = false;
/**
* Creates an instance of <tt>ChatWritePanel</tt>.
*
@ -75,44 +93,26 @@ public class ChatWritePanel
public ChatWritePanel(ChatPanel panel)
{
super(new BorderLayout());
SCScrollPane scrollPane = new SCScrollPane();
this.chatPanel = panel;
this.editorPane.setContentType("text/html");
this.editorPane.putClientProperty(
JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
centerPanel = createCenter();
this.editorPane.setCaretPosition(0);
this.editorPane.setEditorKit(new SIPCommHTMLEditorKit(this));
this.editorPane.getDocument().addUndoableEditListener(this);
this.editorPane.addKeyListener(this);
this.editorPane.addMouseListener(this);
this.editorPane.setCursor(
Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
this.editorPane.setDragEnabled(true);
this.editorPane.setTransferHandler(new ChatTransferHandler(chatPanel));
int chatAreaSize = ConfigurationManager.getChatWriteAreaSize();
Dimension writeMessagePanelDefaultSize
= new Dimension(500, (chatAreaSize > 0) ? chatAreaSize : 45);
Dimension writeMessagePanelMinSize = new Dimension(500, 45);
Dimension writeMessagePanelMaxSize = new Dimension(500, 100);
this.editTextToolBar = new EditTextToolBar(this);
this.editTextToolBar.setVisible(
ConfigurationManager.isChatStylebarVisible());
setMinimumSize(writeMessagePanelMinSize);
setMaximumSize(writeMessagePanelMaxSize);
setPreferredSize(writeMessagePanelDefaultSize);
this.add(editTextToolBar, BorderLayout.NORTH);
this.add(scrollPane, BorderLayout.CENTER);
this.add(centerPanel, BorderLayout.CENTER);
this.rightButtonMenu =
new WritePanelRightButtonMenu(chatPanel.getChatContainer());
scrollPane.setHorizontalScrollBarPolicy(
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(1, 0, 1, 0, Color.GRAY),
BorderFactory.createEmptyBorder(0, 2, 0, 2)));
scrollPane.setViewportView(editorPane);
this.typingTimer.setRepeats(true);
// initialize send command to Ctrl+Enter
@ -133,13 +133,185 @@ public ChatWritePanel(ChatPanel panel)
}
/**
* Shows or hides the Stylebar depending on the value of parameter b.
* Creates the center panel.
*
* @param b if true, makes the Stylebar visible, otherwise hides the Stylebar
* @return the created center panel
*/
public void setStylebarVisible(boolean b)
private Container createCenter()
{
this.editTextToolBar.setVisible(b);
JPanel centerPanel = new JPanel(new GridBagLayout());
centerPanel.setBackground(Color.WHITE);
centerPanel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 3));
GridBagConstraints constraints = new GridBagConstraints();
initSmsLabel(centerPanel);
initTextArea(centerPanel);
smsCharCountLabel = new JLabel(String.valueOf(smsCharCount));
smsCharCountLabel.setForeground(Color.GRAY);
smsCharCountLabel.setVisible(false);
constraints.anchor = GridBagConstraints.NORTHEAST;
constraints.fill = GridBagConstraints.NONE;
constraints.gridx = 3;
constraints.gridy = 0;
constraints.weightx = 0f;
constraints.weighty = 0f;
constraints.insets = new Insets(0, 2, 0, 2);
constraints.gridheight = 1;
constraints.gridwidth = 1;
centerPanel.add(smsCharCountLabel, constraints);
smsNumberLabel = new JLabel(String.valueOf(smsNumberCount))
{
public void paintComponent(Graphics g)
{
AntialiasingManager.activateAntialiasing(g);
g.setColor(getBackground());
g.fillOval(0, 0, getWidth(), getHeight());
super.paintComponent(g);
}
};
smsNumberLabel.setHorizontalAlignment(JLabel.CENTER);
smsNumberLabel.setPreferredSize(new Dimension(18, 18));
smsNumberLabel.setMinimumSize(new Dimension(18, 18));
smsNumberLabel.setForeground(Color.WHITE);
smsNumberLabel.setBackground(Color.GRAY);
smsNumberLabel.setVisible(false);
constraints.anchor = GridBagConstraints.NORTHEAST;
constraints.fill = GridBagConstraints.NONE;
constraints.gridx = 4;
constraints.gridy = 0;
constraints.weightx = 0f;
constraints.weighty = 0f;
constraints.insets = new Insets(0, 2, 0, 2);
constraints.gridheight = 1;
constraints.gridwidth = 1;
centerPanel.add(smsNumberLabel, constraints);
return centerPanel;
}
/**
* Initializes the sms menu.
*
* @param centerPanel the parent panel
*/
private void initSmsLabel(final JPanel centerPanel)
{
GridBagConstraints constraints = new GridBagConstraints();
constraints.anchor = GridBagConstraints.NORTHWEST;
constraints.fill = GridBagConstraints.NONE;
constraints.gridx = 1;
constraints.gridy = 0;
constraints.gridheight = 1;
constraints.weightx = 0f;
constraints.weighty = 0f;
constraints.insets = new Insets(0, 3, 0, 0);
final Icon smsIcon = GuiActivator.getResources()
.getImage("service.gui.icons.SEND_SMS");
final Icon selectedIcon = GuiActivator.getResources()
.getImage("service.gui.icons.SEND_SMS_SELECTED");
smsLabel = new JLabel(smsIcon);
smsLabel.setVisible(true);
smsMenuItem = new JCheckBoxMenuItem(GuiActivator.getResources()
.getI18NString("service.gui.VIA_SMS"));
smsMenuItem.addChangeListener(new ChangeListener()
{
public void stateChanged(ChangeEvent e)
{
smsMode = smsMenuItem.isSelected();
Color bgColor;
if (smsMode)
{
smsLabel.setIcon(selectedIcon);
bgColor = new Color(GuiActivator.getResources()
.getColor("service.gui.LIST_SELECTION_COLOR"));
}
else
{
smsLabel.setIcon(smsIcon);
bgColor = Color.WHITE;
}
centerPanel.setBackground(bgColor);
editorPane.setBackground(bgColor);
smsLabel.repaint();
}
});
smsLabel.addMouseListener(new MouseAdapter()
{
public void mousePressed(MouseEvent mouseevent)
{
Point location = new Point(smsLabel.getX(),
smsLabel.getY() + smsLabel.getHeight());
SwingUtilities.convertPointToScreen(location, smsLabel);
JPopupMenu smsPopupMenu = new JPopupMenu();
smsPopupMenu.setFocusable(true);
smsPopupMenu.setInvoker(ChatWritePanel.this);
smsPopupMenu.add(smsMenuItem);
smsPopupMenu.setLocation(location.x, location.y);
smsPopupMenu.setVisible(true);
}
});
centerPanel.add(smsLabel, constraints);
}
private void initTextArea(JPanel centerPanel)
{
GridBagConstraints constraints = new GridBagConstraints();
editorPane.setContentType("text/html");
editorPane.putClientProperty(
JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
editorPane.setCaretPosition(0);
editorPane.setEditorKit(new SIPCommHTMLEditorKit(this));
editorPane.getDocument().addUndoableEditListener(this);
editorPane.getDocument().addDocumentListener(this);
editorPane.addKeyListener(this);
editorPane.addMouseListener(this);
editorPane.setCursor(
Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));
editorPane.setDragEnabled(true);
editorPane.setTransferHandler(new ChatTransferHandler(chatPanel));
scrollPane.setHorizontalScrollBarPolicy(
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scrollPane.setVerticalScrollBarPolicy(
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setOpaque(false);
scrollPane.getViewport().setOpaque(false);
scrollPane.setBorder(null);
scrollPane.setViewportView(editorPane);
constraints.anchor = GridBagConstraints.NORTHWEST;
constraints.fill = GridBagConstraints.BOTH;
constraints.gridx = 2;
constraints.gridy = 0;
constraints.weightx = 1f;
constraints.weighty = 1f;
constraints.gridheight = 1;
constraints.gridwidth = 1;
constraints.insets = new Insets(0, 0, 0, 0);
centerPanel.add(scrollPane, constraints);
}
/**
@ -195,7 +367,7 @@ public void changeSendCommand(boolean isEnter)
im.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,
KeyEvent.SHIFT_DOWN_MASK), "newLine");
chatPanel.getChatSendPanel().getSendButton().setToolTipText(
this.setToolTipText(
"<html>"
+ GuiActivator.getResources()
.getI18NString("service.gui.SEND_MESSAGE")
@ -209,14 +381,35 @@ public void changeSendCommand(boolean isEnter)
KeyEvent.CTRL_DOWN_MASK), "send");
im.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "newLine");
chatPanel.getChatSendPanel().getSendButton()
.setToolTipText(
this.setToolTipText(
GuiActivator.getResources()
.getI18NString("service.gui.SEND_MESSAGE")
+ " Ctrl-Enter");
}
}
/**
* Enables/disables the sms mode.
*
* @param selected <tt>true</tt> to enable sms mode, <tt>false</tt> -
* otherwise
*/
public void setSmsSelected(boolean selected)
{
smsMenuItem.setSelected(selected);
}
/**
* Returns <tt>true</tt> if the sms mode is enabled, otherwise returns
* <tt>false</tt>.
* @return <tt>true</tt> if the sms mode is enabled, otherwise returns
* <tt>false</tt>
*/
public boolean isSmsSelected()
{
return smsMode;
}
/**
* The <tt>SendMessageAction</tt> is an <tt>AbstractAction</tt> that
* sends the text that is currently in the write message area.
@ -556,13 +749,231 @@ private String extractFormattedText(String msgText)
}
/**
* Returns the toolbar above the chat write area.
* Initializes the send via label and selector box.
*
* @return the chat transport selector box
*/
private Component createChatTransportSelectorBox()
{
// Initialize the "send via" selector box and adds it to the send panel.
if (transportSelectorBox == null)
{
transportSelectorBox = new ChatTransportSelectorBox(
chatPanel,
chatPanel.getChatSession(),
chatPanel.getChatSession().getCurrentChatTransport());
}
return transportSelectorBox;
}
/**
*
* @param isVisible
*/
public void setTransportSelectorBoxVisible(boolean isVisible)
{
if (isVisible)
{
if (transportSelectorBox == null)
{
createChatTransportSelectorBox();
if (!transportSelectorBox.getMenu().isEnabled())
{
// Show a message to the user that IM is not possible.
chatPanel.getChatConversationPanel()
.appendMessageToEnd("<h5>" +
GuiActivator.getResources().
getI18NString("service.gui.MSG_NOT_POSSIBLE") +
"</h5>");
}
else
{
GridBagConstraints constraints = new GridBagConstraints();
constraints.anchor = GridBagConstraints.NORTHEAST;
constraints.fill = GridBagConstraints.NONE;
constraints.gridx = 0;
constraints.gridy = 0;
constraints.weightx = 0f;
constraints.weighty = 0f;
constraints.gridheight = 1;
constraints.gridwidth = 1;
centerPanel.add(transportSelectorBox, constraints, 0);
}
}
else
{
transportSelectorBox.setVisible(true);
centerPanel.repaint();
}
}
else if (transportSelectorBox != null)
{
transportSelectorBox.setVisible(false);
centerPanel.repaint();
}
}
/**
* Selects the given chat transport in the send via box.
*
* @param chatTransport the chat transport to be selected
*/
public void setSelectedChatTransport(ChatTransport chatTransport)
{
if (transportSelectorBox != null)
{
transportSelectorBox.setSelected(chatTransport);
}
}
/**
* Adds the given chatTransport to the given send via selector box.
*
* @return the toolbar above the chat write area.
* @param chatTransport the transport to add
*/
public EditTextToolBar getEditTextToolBar()
public void addChatTransport(ChatTransport chatTransport)
{
return editTextToolBar;
if (transportSelectorBox != null)
transportSelectorBox.addChatTransport(chatTransport);
}
/**
* Updates the status of the given chat transport in the send via selector
* box and notifies the user for the status change.
* @param chatTransport the <tt>chatTransport</tt> to update
*/
public void updateChatTransportStatus(ChatTransport chatTransport)
{
if (transportSelectorBox != null)
transportSelectorBox.updateTransportStatus(chatTransport);
}
/**
* Opens the selector box containing the protocol contact icons.
* This is the menu, where user could select the protocol specific
* contact to communicate through.
*/
public void openChatTransportSelectorBox()
{
transportSelectorBox.getMenu().doClick();
}
/**
* Removes the given chat status state from the send via selector box.
*
* @param chatTransport the transport to remove
*/
public void removeChatTransport(ChatTransport chatTransport)
{
if (transportSelectorBox != null)
transportSelectorBox.removeChatTransport(chatTransport);
}
/**
* Show the sms menu.
* @param isVisible <tt>true</tt> to show the sms menu, <tt>false</tt> -
* otherwise
*/
public void setSmsLabelVisible(boolean isVisible)
{
// Re-init sms count properties.
smsCharCount = 160;
smsNumberCount = 1;
smsLabel.setVisible(isVisible);
smsCharCountLabel.setVisible(isVisible);
smsNumberLabel.setVisible(isVisible);
centerPanel.repaint();
}
/**
* Sets the font family and size
* @param family the family name
* @param size the size
*/
public void setFontFamilyAndSize(String family, int size)
{
// Family
ActionEvent evt
= new ActionEvent( editorPane,
ActionEvent.ACTION_PERFORMED,
family);
Action action = new StyledEditorKit.FontFamilyAction(family, family);
action.actionPerformed(evt);
// Size
evt = new ActionEvent(editorPane,
ActionEvent.ACTION_PERFORMED, Integer.toString(size));
action = new StyledEditorKit.FontSizeAction(Integer.toString(size), size);
action.actionPerformed(evt);
}
/**
* Enables the bold style
* @param b TRUE enable - FALSE disable
*/
public void setBoldStyleEnable(boolean b)
{
if (b)
{
setStyleConstant( new HTMLEditorKit.BoldAction(),
StyleConstants.Bold);
}
}
/**
* Enables the italic style
* @param b TRUE enable - FALSE disable
*/
public void setItalicStyleEnable(boolean b)
{
if (b)
{
setStyleConstant( new HTMLEditorKit.ItalicAction(),
StyleConstants.Italic);
}
}
/**
* Enables the underline style
* @param b TRUE enable - FALSE disable
*/
public void setUnderlineStyleEnable(boolean b)
{
if (b)
{
setStyleConstant( new HTMLEditorKit.UnderlineAction(),
StyleConstants.Underline);
}
}
/**
* Sets the font color
* @param color the color
*/
public void setFontColor(Color color)
{
ActionEvent evt
= new ActionEvent(editorPane, ActionEvent.ACTION_PERFORMED, "");
Action action
= new HTMLEditorKit.ForegroundAction(
Integer.toString(color.getRGB()),
color);
action.actionPerformed(evt);
}
private void setStyleConstant(Action action, Object styleConstant)
{
ActionEvent event = new ActionEvent(editorPane,
ActionEvent.ACTION_PERFORMED,
styleConstant.toString());
action.actionPerformed(event);
}
/**
@ -596,4 +1007,54 @@ public void loadSkin()
{
getRightButtonMenu().loadSkin();
}
public void changedUpdate(DocumentEvent documentevent) {}
/**
* Updates write panel size and adjusts sms properties if the sms menu
* is visible.
*
* @param event the <tt>DocumentEvent</tt> that notified us
*/
public void insertUpdate(DocumentEvent event)
{
// If we're in sms mode count the chars typed.
if (smsLabel.isVisible())
{
if (smsCharCount == 0)
{
smsCharCount = 159;
smsNumberCount ++;
}
else
smsCharCount--;
smsCharCountLabel.setText(String.valueOf(smsCharCount));
smsNumberLabel.setText(String.valueOf(smsNumberCount));
}
}
/**
* Updates write panel size and adjusts sms properties if the sms menu
* is visible.
*
* @param event the <tt>DocumentEvent</tt> that notified us
*/
public void removeUpdate(DocumentEvent event)
{
// If we're in sms mode count the chars typed.
if (smsLabel.isVisible())
{
if (smsCharCount == 160 && smsNumberCount > 1)
{
smsCharCount = 0;
smsNumberCount --;
}
else
smsCharCount++;
smsCharCountLabel.setText(String.valueOf(smsCharCount));
smsNumberLabel.setText(String.valueOf(smsNumberCount));
}
}
}

@ -37,7 +37,7 @@ public class SmileysSelectorBox
/**
* The chat write panel.
*/
private final ChatWritePanel chatWritePanel;
private ChatPanel chatPanel;
/**
* The smiley text label.
@ -61,14 +61,9 @@ public class SmileysSelectorBox
/**
* Initializes a new <tt>SmileysSelectorBox</tt> instance.
*
* @param writePanel the <tt>ChatWritePanel</tt> the new instance is to
* write the selected <tt>Smiley</tt> into when it is clicked
*/
public SmileysSelectorBox(ChatWritePanel writePanel)
public SmileysSelectorBox()
{
this.chatWritePanel = writePanel;
this.setOpaque(false);
// Should explicitly remove any border in order to align correctly the
// icon.
@ -90,6 +85,16 @@ public SmileysSelectorBox(ChatWritePanel writePanel)
this.smiliesService = GuiActivator.getSmiliesReplacementSource();
}
/**
* Sets the chat panel, for which smilieys would be created.
*
* @param chatPanel the chat panel, for which smilieys would be created
*/
public void setChat(ChatPanel chatPanel)
{
this.chatPanel = chatPanel;
}
/**
* In order to have a popup which is at the form closest to square.
*
@ -139,9 +144,9 @@ public void actionPerformed(ActionEvent e)
SmileyMenuItem smileyItem = (SmileyMenuItem) e.getSource();
Smiley smiley = smileyItem.smiley;
chatWritePanel.appendText(smiley.getDefaultString());
chatPanel.getChatWritePanel().appendText(smiley.getDefaultString());
chatWritePanel.getEditorPane().requestFocus();
chatPanel.getChatWritePanel().getEditorPane().requestFocus();
clearMouseOverEffects(smileyItem);
}

@ -341,7 +341,7 @@ else if (o instanceof FileRecord)
/**
* Implements <tt>ChatConversationContainer.setStatusMessage</tt> method.
*/
public void setStatusMessage(String message) {}
public void addTypingNotification(String message) {}
/**
* Implements <tt>ChatConversationContainer.getWindow</tt> method.

@ -120,8 +120,7 @@ else if (menuItemName.equalsIgnoreCase("paste"))
}
else if (menuItemName.equalsIgnoreCase("font"))
{
this.chatWindow.getCurrentChat().getChatWritePanel()
.getEditTextToolBar().showFontChooserDialog();
this.chatWindow.getCurrentChat().showFontChooserDialog();
}
}

@ -31,10 +31,6 @@ public class OptionsMenu
GuiActivator.getResources().getI18NString("service.gui.VIEW_TOOLBAR"));
private static final String ACTCMD_VIEW_TOOLBAR = "ACTCMD_VIEW_TOOLBAR";
private JCheckBoxMenuItem viewStyleBar = new JCheckBoxMenuItem(
GuiActivator.getResources().getI18NString("service.gui.VIEW_STYLEBAR"));
private static final String ACTCMD_VIEW_STYLEBAR = "ACTCMD_VIEW_STYLEBAR";
private JCheckBoxMenuItem viewSmileys = new JCheckBoxMenuItem(
GuiActivator.getResources().getI18NString("service.gui.VIEW_SMILEYS"));
private static final String ACTCMD_VIEW_SMILEYS = "ACTCMD_VIEW_SMILEYS";
@ -55,10 +51,6 @@ public OptionsMenu(ChatWindow chatWindow)
this.viewToolBar.addActionListener(this);
this.add(this.viewToolBar);
this.viewStyleBar.setActionCommand(ACTCMD_VIEW_STYLEBAR);
this.viewStyleBar.addActionListener(this);
this.add(this.viewStyleBar);
this.viewSmileys.setActionCommand(ACTCMD_VIEW_SMILEYS);
this.viewSmileys.addActionListener(this);
this.add(this.viewSmileys);
@ -73,8 +65,7 @@ private void initValues()
{
this.viewToolBar.setSelected(
ConfigurationManager.isChatToolbarVisible());
this.viewStyleBar.setSelected(
ConfigurationManager.isChatStylebarVisible());
this.viewSmileys.setSelected(
ConfigurationManager.isShowSmileys());
}
@ -94,12 +85,6 @@ public void actionPerformed(ActionEvent e)
ConfigurationManager
.setChatToolbarVisible(viewToolBar.isSelected());
}
else if (action.equals(ACTCMD_VIEW_STYLEBAR))
{
this.chatWindow.setStylebarVisible(viewStyleBar.isSelected());
ConfigurationManager
.setChatStylebarVisible(viewStyleBar.isSelected());
}
else if (action.equals(ACTCMD_VIEW_SMILEYS))
{
ConfigurationManager.setShowSmileys(viewSmileys.isSelected());

@ -1,608 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license. See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.chat.toolBars;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.text.html.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.chat.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.util.skin.*;
import net.java.sip.communicator.util.swing.*;
/**
* The <tt>EditTextToolBar</tt> is a <tt>JToolBar</tt> which contains
* buttons for formatting a text, like make text in bold or italic, change the
* font, etc. It contains only <tt>MsgToolbarButton</tt>s, which have a
* specific background icon and rollover behaviour to differentiates them from
* normal buttons.
*
* @author Yana Stamcheva
* @author Lubomir Marinov
* @author Adam Netocny
*/
public class EditTextToolBar
extends TransparentPanel
implements Skinnable
{
private final ChatWritePanel chatWritePanel;
private final JEditorPane chatEditorPane;
private final SmileysSelectorBox smileysBox;
private JToggleButton boldButton;
private JToggleButton italicButton;
private JToggleButton underlineButton;
private ColorLabel colorLabel;
private SIPCommButton fontButton;
/**
* Creates an instance and constructs the <tt>EditTextToolBar</tt>.
* @param writePanel the panel containing the chat write area
*/
public EditTextToolBar(ChatWritePanel writePanel)
{
this.chatWritePanel = writePanel;
this.chatEditorPane = writePanel.getEditorPane();
this.setOpaque(false);
this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0));
this.initStyleToolbarButtons();
fontButton
= new SIPCommButton(
ImageLoader.getImage(ImageLoader.EDIT_TOOLBAR_BUTTON),
ImageLoader.getImage(ImageLoader.FONT_ICON));
fontButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent event)
{
showFontChooserDialog();
}
});
this.add(fontButton);
this.initColorLabel();
this.smileysBox = new SmileysSelectorBox(chatWritePanel);
this.smileysBox.setName("smiley");
this.smileysBox.setToolTipText(GuiActivator.getResources()
.getI18NString("service.gui.INSERT_SMILEY") + " Ctrl-M");
SIPCommMenuBar smileyMenuBar = new SIPCommMenuBar();
smileyMenuBar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
smileyMenuBar.add(smileysBox);
this.add(smileyMenuBar);
}
/**
* Initializes the label that changes font color.
*/
private void initColorLabel()
{
this.colorLabel = new ColorLabel();
colorLabel.setPreferredSize(new Dimension(18, 18));
colorLabel.setOpaque(true);
colorLabel.setBackground(Color.BLACK);
this.add(colorLabel);
colorLabel.addMouseListener(new MouseAdapter()
{
@Override
public void mousePressed(MouseEvent event)
{
Color newColor =
JColorChooser.showDialog(new JColorChooser(),
"Choose a colour",
colorLabel.getBackground());
if (newColor != null)
setFontColor(newColor);
chatEditorPane.requestFocus();
}
});
chatEditorPane.addCaretListener(new CaretListener()
{
public void caretUpdate(CaretEvent e)
{
selectColor(StyleConstants.Foreground, colorLabel);
}
});
chatEditorPane.addKeyListener(new KeyAdapter()
{
@Override
public void keyTyped(KeyEvent e)
{
String chatWritePanelText = chatWritePanel.getText();
if (chatWritePanelText != null &&
chatWritePanelText.length() > 0)
{
Color currentColor
= (Color) ((HTMLEditorKit) chatEditorPane
.getEditorKit()).getInputAttributes().getAttribute(
StyleConstants.Foreground);
if (currentColor != null)
colorLabel.setBackground(currentColor);
else
colorLabel.setBackground(Color.BLACK);
}
}
});
chatEditorPane.addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e)
{
selectColor(StyleConstants.Foreground, colorLabel);
}
});
}
/**
* Initializes Bold, Italic and Underline toggle buttons.
*/
private void initStyleToolbarButtons()
{
this.boldButton
= initStyleToggleButton(
ImageLoader.getImage(ImageLoader.TEXT_BOLD_BUTTON),
new HTMLEditorKit.BoldAction(),
StyleConstants.Bold);
this.italicButton
= initStyleToggleButton(
ImageLoader.getImage(ImageLoader.TEXT_ITALIC_BUTTON),
new HTMLEditorKit.ItalicAction(),
StyleConstants.Italic);
this.underlineButton
= initStyleToggleButton(
ImageLoader.getImage(ImageLoader.TEXT_UNDERLINED_BUTTON),
new HTMLEditorKit.UnderlineAction(),
StyleConstants.Underline);
/*
* The update of the style toggle buttons used to be very slow because
* each of it had to retrieve the same data on its own (most notably,
* JEditorPane#getText()) and make almost the same checks. That is why
* the update logic is performed for all of them, not individually i.e.
* the data is retrieved once, the checks are made and all style toggle
* buttons are updated.
*/
final Object[] styleConstants
= new Object[]
{
StyleConstants.Bold,
StyleConstants.Italic,
StyleConstants.Underline
};
final JToggleButton[] buttons
= new JToggleButton[]
{
boldButton,
italicButton,
underlineButton
};
chatEditorPane.addCaretListener(new CaretListener()
{
public void caretUpdate(CaretEvent e)
{
selectStyleToggleButtons(styleConstants, buttons);
}
});
chatEditorPane.addKeyListener(new KeyAdapter()
{
@Override
public void keyTyped(KeyEvent e)
{
if (chatEditorPane.getText().length() > 0)
{
AttributeSet attributes
= ((HTMLEditorKit) chatEditorPane.getEditorKit())
.getInputAttributes();
for (int i = 0; i < buttons.length; i++)
buttons[i]
.setSelected(
attributes
.containsAttribute(
styleConstants[i],
true));
}
}
});
chatEditorPane.addMouseListener(new MouseAdapter()
{
@Override
public void mouseClicked(MouseEvent e)
{
selectStyleToggleButtons(styleConstants, buttons);
}
});
this.addBindings();
}
/**
* Initializes a toggle button.
*
* @param buttonImage the <tt>Image</tt> to be used as the icon of the new
* button
* @param action the action to associate with the button
* @param styleConstant the style constant
* @return the toggle button with the associated action and style constant
*/
private JToggleButton initStyleToggleButton(Image buttonImage,
final Action action,
final Object styleConstant)
{
final SIPCommToggleButton button
= new SIPCommToggleButton(
ImageLoader.getImage(ImageLoader.EDIT_TOOLBAR_BUTTON),
ImageLoader.getImage(ImageLoader.EDIT_TOOLBAR_BUTTON),
buttonImage,
ImageLoader.getImage(ImageLoader.EDIT_TOOLBAR_BUTTON_PRESSED));
button.setPreferredSize(new Dimension(18, 18));
button.setName(styleConstant.toString());
button.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
ActionEvent event = new ActionEvent(chatEditorPane,
ActionEvent.ACTION_PERFORMED,
styleConstant.toString());
action.actionPerformed(event);
chatEditorPane.requestFocus();
}
});
add(button);
return button;
}
/**
* Selects or deselects the given toggle buttons depending on the given
* <tt>styleConstants</tt>.
*
* @param styleConstants the style constants
* @param buttons the buttons to select
*/
private void selectStyleToggleButtons(
Object[] styleConstants,
JToggleButton[] buttons)
{
if (chatEditorPane.getText().length() < 1)
return;
if (chatEditorPane.getSelectedText() == null)
{
AttributeSet attributes
= ((HTMLDocument) chatEditorPane.getDocument())
.getCharacterElement(chatEditorPane.getCaretPosition() - 1)
.getAttributes();
for (int i = 0; i < buttons.length; i++)
buttons[i]
.setSelected(
attributes.containsAttribute(styleConstants[i], true));
}
else
{
int selectionStart = chatEditorPane.getSelectionStart();
int selectionEnd = chatEditorPane.getSelectionEnd();
HTMLDocument htmlDocument
= (HTMLDocument) chatEditorPane.getDocument();
for (int buttonIndex = 0;
buttonIndex < buttons.length;
buttonIndex++)
{
boolean selected = false;
Object styleConstant = styleConstants[buttonIndex];
for (int selectionIndex = selectionStart;
selectionIndex < selectionEnd;
selectionIndex++)
{
AttributeSet attributes
= htmlDocument
.getCharacterElement(selectionIndex)
.getAttributes();
selected
= attributes.containsAttribute(styleConstant, true);
if (selected)
break;
}
buttons[buttonIndex].setSelected(selected);
}
}
}
/**
* Selects the color corresponding to the current style attribute.
*
* @param styleConstant the style constant
* @param colorLabel the color label to select the color from
*/
private void selectColor( final Object styleConstant,
final JLabel colorLabel)
{
Object selectedAttribute = null;
if (chatEditorPane.getSelectedText() == null)
{
int index = chatEditorPane.getCaretPosition();
selectedAttribute =
((HTMLDocument) chatEditorPane.getDocument())
.getCharacterElement(index - 1).getAttributes()
.getAttribute(styleConstant);
}
else
{
for (int index = chatEditorPane.getSelectionStart();
index < chatEditorPane.getSelectionEnd(); index++)
{
AttributeSet attributes =
((HTMLDocument) chatEditorPane.getDocument())
.getCharacterElement(index).getAttributes();
if (attributes.getAttribute(styleConstant) != null)
selectedAttribute = attributes.getAttribute(styleConstant);
}
}
if (selectedAttribute != null)
colorLabel.setBackground((Color)selectedAttribute);
else
colorLabel.setBackground(Color.BLACK);
}
/**
* Adds key bindings for formatting actions.
*/
private void addBindings()
{
InputMap inputMap = chatEditorPane.getInputMap();
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE,
Event.SHIFT_MASK), DefaultEditorKit.deletePrevCharAction);
// styles
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_B, Event.CTRL_MASK),
"font-bold"); //$NON-NLS-1$
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK),
"font-bold"); //$NON-NLS-1$
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.CTRL_MASK),
"font-italic"); //$NON-NLS-1$
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_K, Event.CTRL_MASK),
"font-italic"); //$NON-NLS-1$
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_U, Event.CTRL_MASK),
"font-underline"); //$NON-NLS-1$
}
private static class ColorLabel extends JLabel
{
@Override
public void paintComponent(Graphics g)
{
g = g.create();
try
{
AntialiasingManager.activateAntialiasing(g);
g.setColor(this.getBackground());
g.fillRoundRect(0, 0, getWidth(), getHeight(), 8, 8);
}
finally
{
g.dispose();
}
}
}
/**
* Shows the font chooser dialog
*/
public void showFontChooserDialog()
{
FontChooser fontChooser = new FontChooser();
fontChooser.setFontFamily(
chatEditorPane.getFont().getFontName());
fontChooser.setFontSize(
chatEditorPane.getFont().getSize());
fontChooser.setBoldStyle(boldButton.isSelected());
fontChooser.setItalicStyle(italicButton.isSelected());
fontChooser.setUnderlineStyle(underlineButton.isSelected());
int result = fontChooser.showDialog(this.chatWritePanel);
if (result == FontChooser.OK_OPTION)
{
// Font family and size
setFontFamilyAndSize( fontChooser.getFontFamily(),
fontChooser.getFontSize());
// Font style
setBoldStyleEnable(fontChooser.isBoldStyleSelected());
setItalicStyleEnable(fontChooser.isItalicStyleSelected());
setUnderlineStyleEnable(fontChooser.isUnderlineStyleSelected());
// Font color
setFontColor(fontChooser.getFontColor());
}
chatEditorPane.requestFocus();
}
/**
* Sets the font family and size
* @param family the family name
* @param size the size
*/
public void setFontFamilyAndSize(String family, int size)
{
// Family
ActionEvent evt
= new ActionEvent( chatEditorPane,
ActionEvent.ACTION_PERFORMED,
family);
Action action = new StyledEditorKit.FontFamilyAction(family, family);
action.actionPerformed(evt);
// Size
evt = new ActionEvent(chatEditorPane,
ActionEvent.ACTION_PERFORMED, Integer.toString(size));
action = new StyledEditorKit.FontSizeAction(Integer.toString(size), size);
action.actionPerformed(evt);
}
/**
* Enables the bold style
* @param b TRUE enable - FALSE disable
*/
public void setBoldStyleEnable(boolean b)
{
if ((b && !boldButton.isSelected()) || (!b && boldButton.isSelected()))
boldButton.doClick();
}
/**
* Enables the italic style
* @param b TRUE enable - FALSE disable
*/
public void setItalicStyleEnable(boolean b)
{
if ((b && !italicButton.isSelected())
|| (!b && italicButton.isSelected()))
italicButton.doClick();
}
/**
* Enables the underline style
* @param b TRUE enable - FALSE disable
*/
public void setUnderlineStyleEnable(boolean b)
{
if ((b && !underlineButton.isSelected())
|| (!b && underlineButton.isSelected()))
underlineButton.doClick();
}
/**
* Sets the font color
* @param color the color
*/
public void setFontColor(Color color)
{
colorLabel.setBackground(color);
ActionEvent evt
= new ActionEvent(chatEditorPane, ActionEvent.ACTION_PERFORMED, "");
Action action
= new HTMLEditorKit.ForegroundAction(
Integer.toString(color.getRGB()),
color);
action.actionPerformed(evt);
}
/**
* Returns the button used to show the list of smileys.
*
* @return the button used to show the list of smileys.
*/
public SmileysSelectorBox getSmileysSelectorBox()
{
return smileysBox;
}
/**
* Returns TRUE if there are selected menus in this toolbar, otherwise
* returns FALSE.
* @return TRUE if there are selected menus in this toolbar, otherwise
* returns FALSE
*/
public boolean hasSelectedMenus()
{
return smileysBox.isMenuSelected();
}
/**
* Loads the skin.
*/
public void loadSkin()
{
fontButton.setBackgroundImage(
ImageLoader.getImage(ImageLoader.EDIT_TOOLBAR_BUTTON));
fontButton.setIconImage(
ImageLoader.getImage(ImageLoader.FONT_ICON));
((SIPCommToggleButton)this.boldButton).setBgImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON)).getImage());
((SIPCommToggleButton)this.boldButton).setBgRolloverImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON)).getImage());
((SIPCommToggleButton)this.boldButton).setIconImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.TEXT_BOLD_BUTTON)).getImage());
((SIPCommToggleButton)this.boldButton).setPressedImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON_PRESSED)).getImage());
((SIPCommToggleButton)this.italicButton).setBgImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON)).getImage());
((SIPCommToggleButton)this.italicButton).setBgRolloverImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON)).getImage());
((SIPCommToggleButton)this.italicButton).setIconImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.TEXT_ITALIC_BUTTON)).getImage());
((SIPCommToggleButton)this.italicButton).setPressedImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON_PRESSED)).getImage());
((SIPCommToggleButton)this.underlineButton).setBgImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON)).getImage());
((SIPCommToggleButton)this.underlineButton).setBgRolloverImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON)).getImage());
((SIPCommToggleButton)this.underlineButton).setIconImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.TEXT_UNDERLINED_BUTTON)).getImage());
((SIPCommToggleButton)this.underlineButton).setPressedImage(
new ImageIcon(ImageLoader.getImage(
ImageLoader.EDIT_TOOLBAR_BUTTON_PRESSED)).getImage());
}
}

@ -115,6 +115,15 @@ public class MainToolBar
= new ChatToolbarButton(
ImageLoader.getImage(ImageLoader.CHAT_DESKTOP_SHARING));
/**
* The font button.
*/
private final ChatToolbarButton fontButton
= new ChatToolbarButton(
ImageLoader.getImage(ImageLoader.FONT_ICON));
private SmileysSelectorBox smileysBox;
/**
* The current <tt>ChatSession</tt> made known to this instance by the last
* call to its {@link #chatChanged(ChatPanel)}.
@ -166,24 +175,32 @@ protected void init()
this.add(callButton);
this.add(desktopSharingButton);
this.add(sendFileButton);
this.addSeparator();
this.add(historyButton);
this.add(previousButton);
this.add(nextButton);
// We only add the options button if the property SHOW_OPTIONS_WINDOW
// specifies so or if it's not set.
Boolean showOptionsProp
= GuiActivator.getConfigurationService()
.getBoolean(ConfigurationFrame.SHOW_OPTIONS_WINDOW_PROPERTY,
true);
false);
if (showOptionsProp.booleanValue())
{
this.add(optionsButton);
}
this.add(sendFileButton);
this.addSeparator();
this.add(previousButton);
this.add(nextButton);
this.add(fontButton);
initSmiliesSelectorBox();
this.addSeparator();
this.inviteButton.setName("invite");
this.inviteButton.setToolTipText(
@ -212,6 +229,10 @@ protected void init()
optionsButton.setToolTipText(
GuiActivator.getResources().getI18NString("service.gui.OPTIONS"));
fontButton.setName("font");
fontButton.setToolTipText(
GuiActivator.getResources().getI18NString("service.gui.CHANGE_FONT"));
this.sendFileButton.setName("sendFile");
this.sendFileButton.setToolTipText(
GuiActivator.getResources().getI18NString("service.gui.SEND_FILE"));
@ -224,15 +245,31 @@ protected void init()
this.nextButton.setToolTipText(
GuiActivator.getResources().getI18NString("service.gui.NEXT"));
this.inviteButton.addActionListener(this);
this.leaveChatRoomButton.addActionListener(this);
this.callButton.addActionListener(this);
this.desktopSharingButton.addActionListener(this);
this.historyButton.addActionListener(this);
inviteButton.addActionListener(this);
leaveChatRoomButton.addActionListener(this);
callButton.addActionListener(this);
desktopSharingButton.addActionListener(this);
historyButton.addActionListener(this);
optionsButton.addActionListener(this);
this.sendFileButton.addActionListener(this);
this.previousButton.addActionListener(this);
this.nextButton.addActionListener(this);
fontButton.addActionListener(this);
sendFileButton.addActionListener(this);
previousButton.addActionListener(this);
nextButton.addActionListener(this);
}
private void initSmiliesSelectorBox()
{
this.smileysBox = new SmileysSelectorBox();
this.smileysBox.setName("smiley");
this.smileysBox.setToolTipText(GuiActivator.getResources()
.getI18NString("service.gui.INSERT_SMILEY") + " Ctrl-M");
SIPCommMenuBar smileyMenuBar = new SIPCommMenuBar();
smileyMenuBar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
smileyMenuBar.add(smileysBox);
this.add(smileyMenuBar);
}
/**
@ -522,6 +559,8 @@ else if (buttonText.equals("options"))
{
GuiActivator.getUIService().setConfigurationWindowVisible(true);
}
else if (buttonText.equals("font"))
chatPanel.showFontChooserDialog();
}
/**
@ -534,6 +573,11 @@ public ChatToolbarButton getHistoryButton()
return historyButton;
}
public SmileysSelectorBox getSmileysBox()
{
return smileysBox;
}
/**
* Disables/Enables history arrow buttons depending on whether the
* current page is the first, the last page or a middle page.
@ -584,6 +628,14 @@ private void setChatSession(ChatSession chatSession)
}
}
/**
* Adds a separator to this tool bar.
*/
private void addSeparator()
{
this.add(new JSeparator(SwingConstants.VERTICAL));
}
/**
* Reloads icons for buttons.
*/
@ -598,6 +650,9 @@ public void loadSkin()
sendFileButton.setIconImage(ImageLoader.getImage(
ImageLoader.SEND_FILE_ICON));
fontButton.setIconImage(ImageLoader.getImage(
ImageLoader.FONT_ICON));
previousButton.setIconImage(ImageLoader.getImage(
ImageLoader.PREVIOUS_ICON));

@ -445,6 +445,9 @@ public void typingNotificationReceived(TypingNotificationEvent evt)
int typingState = evt.getTypingState();
ChatPanel chatPanel
= chatWindowManager.getContactChat(metaContact, false);
if (typingState == OperationSetTypingNotifications.STATE_TYPING)
{
notificationMsg
@ -452,39 +455,36 @@ public void typingNotificationReceived(TypingNotificationEvent evt)
"service.gui.CONTACT_TYPING",
new String[]{contactName});
typingTimer.setMetaContact(metaContact);
typingTimer.start();
// Proactive typing notification
if (!chatWindowManager.isChatOpenedFor(metaContact))
{
this.fireProactiveNotification(evt.getSourceContact());
return;
}
if (chatPanel != null)
chatPanel.addTypingNotification(notificationMsg);
typingTimer.setMetaContact(metaContact);
typingTimer.start();
}
else if (typingState == OperationSetTypingNotifications.STATE_PAUSED)
{
notificationMsg = GuiActivator.getResources().getI18NString(
"service.gui.CONTACT_PAUSED_TYPING",
new String[]{contactName});
"service.gui.CONTACT_PAUSED_TYPING",
new String[]{contactName});
if (chatPanel != null)
chatPanel.addTypingNotification(notificationMsg);
typingTimer.setMetaContact(metaContact);
typingTimer.start();
}
else if (typingState == OperationSetTypingNotifications.STATE_STOPPED)
{
notificationMsg = "";
}
else if (typingState == OperationSetTypingNotifications.STATE_STALE)
{
notificationMsg
= GuiActivator.getResources().getI18NString(
"service.gui.CONTACT_TYPING_STATE_STALE");
}
else if (typingState == OperationSetTypingNotifications.STATE_UNKNOWN)
else
{
// TODO: Implement state unknown
if (chatPanel != null)
chatPanel.removeTypingNotification();
}
this.setChatNotificationMsg(metaContact, notificationMsg);
}
/**
@ -607,22 +607,6 @@ private void fireProactiveNotification(Contact contact)
.getI18NString("service.gui.PROACTIVE_NOTIFICATION"));
}
/**
* Sets the typing notification message at the appropriate chat.
*
* @param metaContact The meta contact.
* @param notificationMsg The typing notification message.
*/
public void setChatNotificationMsg(MetaContact metaContact,
String notificationMsg)
{
ChatPanel chatPanel
= chatWindowManager.getContactChat(metaContact, false);
if (chatPanel != null)
chatPanel.setStatusMessage(notificationMsg);
}
/**
* Returns the right button menu of the contact list.
* @return the right button menu of the contact list
@ -653,7 +637,10 @@ private class TimerActionListener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
setChatNotificationMsg(metaContact, "");
ChatPanel chatPanel
= chatWindowManager.getContactChat(metaContact, false);
chatPanel.removeTypingNotification();
}
}

Loading…
Cancel
Save