skip to main content
Programmer's documentation > Developing with the JViews Diagrammer SDK > Accessible diagrams and dashboards > High contrast mode
 
High contrast mode
A high contrast mode supports people with low vision. On Microsoft® Windows® systems, high contrast mode is available from the Control Panel; in the Ease of Access Center in Windows 7 and equivalent facilities in other versions of Windows.
In JViews Diagrammer, the recommended way to support high contrast mode is to design a special cascading style sheet (CSS) for this mode. You can use the cascading feature to combine different CSS files.
An application might have a style sheet for everything except colors and fonts, a style sheet defining the colors and fonts for normal mode, and a different style sheet defining brighter colors and larger fonts for high contrast mode. The choice of style sheet can be implemented by checking IlvSwingUtil.isHighContrastMode.
    if (IlvSwingUtil.isHighContrastMode()) {
        diagrammer.addStyleSheet(new URL("file:highContrastStyleSheet.css"));
    } else {
        diagrammer.addStyleSheet(new URL("file:normalStyleSheet.css"));
    }
Instead of using two different style files, you can also specify a high contrast and a normal contrast theme in the same style file, by using the CSS pseudo-classes high-contrast and normal-contrast. The following code example shows this kind of CSS file:
    node {
       ... here are all settings that apply to normal and high contrast ...
    }
    node:normal-contrast {
       ... here are color and font settings that apply to normal contrast ...
    }
    node:high-contrast {
       ... here are brighter color and larger font settings that apply to high contrast ...
    }
The SDM engine is initialized with the contrast theme detected from the operating system. To change the initial setting, you can call in Java:
 sdmEngine.setContrastAccessibilityTheme(IlvSDMEngine.HIGH_CONTRAST);

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.