Package bibliothek.gui.dock.util.color

Examples of bibliothek.gui.dock.util.color.ColorManager


     * @param factory the factory for new bridges, can be <code>null</code>
     */
    public void putColorBridgeFactory( Path kind, ColorBridgeFactory factory ){
        colorBridgeFactories.put( kind, factory );
        for( Controller setting : controllers ){
            ColorManager colors = setting.controller.getColors();
           
            ColorBridge oldBridge = setting.colors.remove( kind );
            ColorBridge newBridge = factory == null ? null : factory.create( colors );
           
            if( newBridge == null ){
                setting.colors.remove( kind );
               
                if( oldBridge != null )
                    colors.unpublish( Priority.DEFAULT, kind );
            }
            else{
                setting.colors.put( kind, newBridge );
                colors.publish( Priority.DEFAULT, kind, newBridge );
            }
        }
    }
View Full Code Here


     */
    protected void install( DockController controller ){   
        Controller settings = new Controller();
        settings.controller = controller;
       
        ColorManager colors = controller.getColors();
        CControl control = controller.getProperties().get( CControl.CCONTROL );
       
        try{
            colors.lockUpdate();
           
            ExtensionName<CColorBridgeExtension> name = new ExtensionName<CColorBridgeExtension>(
                CColorBridgeExtension.EXTENSION_NAME, CColorBridgeExtension.class, CColorBridgeExtension.PARAMETER_NAME, this );
            List<CColorBridgeExtension> extensions = controller.getExtensions().load( name );
           
            for( Map.Entry<Path, ColorBridgeFactory> entry : colorBridgeFactories.entrySet() ){
                ColorBridge bridge = entry.getValue().create( colors );
                Path key = entry.getKey();
               
                List<CColorBridgeExtension> filtered = new ArrayList<CColorBridgeExtension>();
                for( CColorBridgeExtension extension : extensions ){
                  if( key.equals( extension.getKey() )){
                    filtered.add( extension );
                  }
                }

                if( !filtered.isEmpty() ){
                  CColorBridge[] extending = new CColorBridge[ filtered.size() ];
                  for( int i = 0; i < extending.length; i++ ){
                    extending[i] = filtered.get( i ).create( control, colors );
                  }
                  bridge = new ExtendedColorBridge( bridge, extending );
                }
               
                colors.publish(
                        Priority.DEFAULT,
                        entry.getKey(),
                        bridge );
                settings.colors.put( entry.getKey(), bridge );
            }
        }
        finally{
            colors.unlockUpdate();
        }
       
        FontManager fonts = controller.getFonts();
        try{
            fonts.lockUpdate();
View Full Code Here

            Controller settings = controllers.get( i );
            if( settings.controller == controller ){
                controllers.remove( i-- );
                n--;
               
                ColorManager colors = controller.getColors();
                for( ColorBridge bridge : settings.colors.values() ){
                    colors.unpublish( Priority.DEFAULT, bridge );
                }
               
                FontManager fonts = controller.getFonts();
                for( FontBridge bridge : settings.fonts.values() ){
                    fonts.unpublish( Priority.DEFAULT, bridge );
View Full Code Here

TOP

Related Classes of bibliothek.gui.dock.util.color.ColorManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.