Search in sources :

Example 1 with MindMapConfigListener

use of com.igormaznitsa.mindmap.swing.panel.MindMapConfigListener in project netbeans-mmd-plugin by raydac.

the class MindMapPanelConfigTest method testMakeFullCopyOf.

@Test
public void testMakeFullCopyOf() {
    final MindMapPanelConfig dst = new MindMapPanelConfig();
    final MindMapPanelConfig src = new MindMapPanelConfig();
    assertTrue(dst.isDropShadow());
    assertTrue(dst.isDrawBackground());
    src.setDrawBackground(false);
    src.setDropShadow(false);
    final AtomicInteger callCounter = new AtomicInteger();
    final MindMapConfigListener lstnr = new MindMapConfigListener() {

        @Override
        public void onConfigurationPropertyChanged(MindMapPanelConfig changedConfig) {
            callCounter.incrementAndGet();
        }
    };
    src.addConfigurationListener(lstnr);
    dst.makeFullCopyOf(src, true, true);
    assertFalse(dst.isDropShadow());
    assertFalse(dst.isDrawBackground());
    assertEquals(1, callCounter.get());
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) MindMapPanelConfig(com.igormaznitsa.mindmap.swing.panel.MindMapPanelConfig) MindMapConfigListener(com.igormaznitsa.mindmap.swing.panel.MindMapConfigListener) Test(org.junit.Test)

Aggregations

MindMapConfigListener (com.igormaznitsa.mindmap.swing.panel.MindMapConfigListener)1 MindMapPanelConfig (com.igormaznitsa.mindmap.swing.panel.MindMapPanelConfig)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Test (org.junit.Test)1