Main

Linux Archives

February 13, 2007

7 Buttons Mouse in Linux


I had some problems to have my 7 buttons mouse (Logitech MX510) working correctly under Linux.
Problem was that the Back and Forward buttons didn't work correctly:
the first had the same effect has the left button click and the second the same effect as the right button click.
And I couldn't find the right mouse (or equivalent) in the Mouse Configuration.

I could finally configure it correctly by editing the /etc/X11/XF86Config (Red Hat 4) and /etc/X11/xorg.conf (Oracle Unbreakable Linux) as the following:

(...)
Section "ServerLayout"
        (...)
        InputDevice    "Logitech" "CorePointer"
        (...)
EndSection
(...)
Section "InputDevice"
        Identifier  "Logitech"
        Driver       "mouse"
        Option      "Protocol" "ExplorerPS/2"
        Option      "Device" "/dev/input/mice"
        Option      "Buttons" "7"
        Option      "ZAxisMapping" "6 7"
        Option      "Emulate3Buttons" "no"
EndSection
(...)
The button numbers after "ZAxisMapping" are the values of the
scroll wheel up and down.

I used the xev tool to determine
which button numbers these are.
That is, I ran xev in a terminal,
hovered the mouse over the pop up window and on the mouse pushed the scroll
wheel up and down;
the output was as the following:
(...)
ButtonRelease event, serial 25, synthetic NO, window 0x2a00001,
    root 0x3b, subw 0x2a00002, time 550529, (22,49), root:(892,69),
    state 0x800, button 4, same_screen YES
(...)
ButtonPress event, serial 25, synthetic NO, window 0x2a00001,
    root 0x3b, subw 0x2a00002, time 551169, (22,49), root:(892,69),
    state 0x0, button 5, same_screen YES
(...)
I did the same to determine the values of the Back and Forward buttons:
(...)
ButtonRelease event, serial 25, synthetic NO, window 0x2a00001,
    root 0x3b, subw 0x2a00002, time 615813, (40,29), root:(910,49),
    state 0x200, button 6, same_screen YES
(...)
ButtonPress event, serial 25, synthetic NO, window 0x2a00001,
    root 0x3b, subw 0x2a00002, time 617300, (44,31), root:(914,51),
    state 0x0, button 7, same_screen YES
(...)

I then specified the order of the buttons (left, middle and right clicks, back, forward, wheel up & wheel down) in file /etc/X11/Xmodmap:
pointer = 1 2 3 6 7 4 5
It now works as expected :-)

June 9, 2008

Buttons Generated As Standard Html Buttons In ADF Faces On Linux


Problem

This question comes regularly in the OTN forums.

You have developed your application on a Windows system and defined your own skin (css), including some customizations for the buttons f.ex.:
.AFButtonServerText:alias
{
    color:black;
    background-color: #D2DEED;
    font-weight:bold;
    font-family: Arial, Helvetica;
    font-size: 11px;
}

.AFButtonServerTextDisabled:alias
{
    color:#AAAAAA;
    font-family:Arial, Helvetica;
    font-size: 11px;
    font-weight: normal;
}

When you run the application in the Embedded OC4J on Windows, the page renders correctly, with the buttons generated as "image buttons":
ADFButton:

However, the same application deployed on iAS on your Linux machine shows the buttons as standard HTML buttons:
StandardButton: .

You use the following Java Option in iAS on Linux:
   -Djava.awt.headless=true
as recommended in the JDeveloper online help, "About ADF Faces Supported Platforms".

So, what's the problem ?

Cause

The font "Arial" is not available on your Operating System.

The ADF Faces buttons are normally generated as GIF files by the Java's AWT graphics library.
When the Java API doesn't have access to the specified font, it generates the button as a standard HTML button.

Solution

Either install the missing font on your Linux system (the Java API will use it to generate the image buttons) or use another font.

The best choice to avoid the problem when deploying the application on different platform is to specify a logical font (Dialog, SansSerif, ...), that's mapped to an existing physical font on your OS.
You can find the list of the mapping in <iAS_Home>\jdk\jre\lib\font.properties
NB: this name may differ depending on the OS

F.ex. the "SansSerif" logical font is mapped to the "Lucida Sans" physical font:
sansserif.plain.latin-1=-b&h-lucidasans-medium-r-normal-sans-*-%d-*-*-p-*-iso8859-1
and the Lucida font is always installed as part of the JDK (in ...\jre\lib\fonts).
So you are sure with this solution that the buttons will always be generated as image buttons, whatever the OS you are deploying to.


NB: though it was written for UIX, most of the information contained in the chapter "18. Image Generation in ADF UIX" of the "Oracle ADF UIX Developer's Guide" is still valid for ADF Faces.

About Linux

This page contains an archive of all entries posted to Didier's Blog in the Linux category. They are listed from oldest to newest.

Java is the previous category.

News is the next category.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle