Search in sources :

Example 1 with CharMap4

use of com.sldeditor.ui.ttf.CharMap4 in project sldeditor by robward-scisys.

the class CharMap4Test method testCharMap4.

/**
 * Test method for {@link com.sldeditor.ui.ttf.CharMap4#CharMap4()}.
 */
@Test
public void testCharMap4() {
    CharMap4 testObj = new CharMap4();
    testObj.loadConfig();
    testObj.setTTFString("ttf://Symbol#221");
    testObj.setSelectedCharacter("a");
    testObj.setStatusText("new status");
    testObj.copyText();
    assertEquals(Character.MAX_CODE_POINT, CharMap4.getMaxUnicode());
    assertEquals(Character.MIN_CODE_POINT, CharMap4.getMinUnicode());
    assertNotNull(testObj.getDisplayFont());
    assertNotNull(CharMap4.getFormatComma());
    assertFalse(CharMap4.isGlyphFlag());
    int expectedValue = 42;
    assertNotNull(CharMap4.charToString(expectedValue));
    assertNotNull(CharMap4.unicodeNotation(expectedValue));
    assertEquals(expectedValue, CharMap4.decodeUnicodeNotation(CharMap4.unicodeNotation(expectedValue)));
    for (int i = 0; i < 0x10FFFF + 2; i += 10) {
        assertNotNull(testObj.captionGet(i));
    }
    testObj.userKey("GotoEnd");
    testObj.userKey("GotoHome");
    testObj.userKey("LineDown");
    testObj.userKey("LineUp");
    testObj.userKey("PageDown");
    testObj.userKey("PageUp");
    testObj.userKey("ReportShow");
    testObj.userKey("made up");
}
Also used : CharMap4(com.sldeditor.ui.ttf.CharMap4) Test(org.junit.Test)

Example 2 with CharMap4

use of com.sldeditor.ui.ttf.CharMap4 in project sldeditor by robward-scisys.

the class TTFDetails method buttonPressed.

/**
 * Button pressed.
 *
 * @param buttonExternal the button external
 */
@Override
public void buttonPressed(Component buttonExternal) {
    CharMap4 charMap4 = new CharMap4();
    charMap4.loadConfig();
    charMap4.setTTFString(fieldConfigVisitor.getText(FieldIdEnum.TTF_SYMBOL));
    String selectedChar = charMap4.showDialog();
    if (selectedChar != null) {
        fieldConfigVisitor.populateTextField(FieldIdEnum.TTF_SYMBOL, selectedChar);
        UndoManager.getInstance().addUndoEvent(new UndoEvent(this, FieldIdEnum.TTF_SYMBOL, oldValueObj, selectedChar));
        oldValueObj = selectedChar;
        EventQueue.invokeLater(new Runnable() {

            public void run() {
                updateSymbol();
            }
        });
    }
}
Also used : UndoEvent(com.sldeditor.common.undo.UndoEvent) CharMap4(com.sldeditor.ui.ttf.CharMap4)

Aggregations

CharMap4 (com.sldeditor.ui.ttf.CharMap4)2 UndoEvent (com.sldeditor.common.undo.UndoEvent)1 Test (org.junit.Test)1